diff --git a/.DS_Store b/.DS_Store index f4f05c716..3ccbdbaa5 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.cursor/rules/README.md b/.cursor/rules/README.md new file mode 100644 index 000000000..31959fe73 --- /dev/null +++ b/.cursor/rules/README.md @@ -0,0 +1,107 @@ +# Evolution API Cursor Rules + +Este diretório contém as regras e configurações do Cursor IDE para o projeto Evolution API. + +## Estrutura dos Arquivos + +### Arquivos Principais (alwaysApply: true) +- **`core-development.mdc`** - Princípios fundamentais de desenvolvimento +- **`project-context.mdc`** - Contexto específico do projeto Evolution API +- **`cursor.json`** - Configurações do Cursor IDE + +### Regras Especializadas (alwaysApply: false) +Estas regras são ativadas automaticamente quando você trabalha nos arquivos correspondentes: + +#### Camadas da Aplicação +- **`specialized-rules/service-rules.mdc`** - Padrões para services (`src/api/services/`) +- **`specialized-rules/controller-rules.mdc`** - Padrões para controllers (`src/api/controllers/`) +- **`specialized-rules/dto-rules.mdc`** - Padrões para DTOs (`src/api/dto/`) +- **`specialized-rules/guard-rules.mdc`** - Padrões para guards (`src/api/guards/`) +- **`specialized-rules/route-rules.mdc`** - Padrões para routers (`src/api/routes/`) + +#### Tipos e Validação +- **`specialized-rules/type-rules.mdc`** - Definições TypeScript (`src/api/types/`) +- **`specialized-rules/validate-rules.mdc`** - Schemas de validação (`src/validate/`) + +#### Utilitários +- **`specialized-rules/util-rules.mdc`** - Funções utilitárias (`src/utils/`) + +#### Integrações +- **`specialized-rules/integration-channel-rules.mdc`** - Integrações de canal (`src/api/integrations/channel/`) +- **`specialized-rules/integration-chatbot-rules.mdc`** - Integrações de chatbot (`src/api/integrations/chatbot/`) +- **`specialized-rules/integration-storage-rules.mdc`** - Integrações de storage (`src/api/integrations/storage/`) +- **`specialized-rules/integration-event-rules.mdc`** - Integrações de eventos (`src/api/integrations/event/`) + +## Como Usar + +### Referências Cruzadas +Os arquivos principais fazem referência aos especializados usando a sintaxe `@specialized-rules/nome-do-arquivo.mdc`. Quando você trabalha em um arquivo específico, o Cursor automaticamente carrega as regras relevantes. + +### Exemplo de Uso +Quando você edita um arquivo em `src/api/services/`, o Cursor automaticamente: +1. Carrega `core-development.mdc` (sempre ativo) +2. Carrega `project-context.mdc` (sempre ativo) +3. Carrega `specialized-rules/service-rules.mdc` (ativado pelo glob pattern) + +### Padrões de Código +Cada arquivo de regras contém: +- **Estruturas padrão** - Como organizar o código +- **Padrões de nomenclatura** - Convenções de nomes +- **Exemplos práticos** - Código de exemplo +- **Anti-padrões** - O que evitar +- **Testes** - Como testar o código +- **Padrões de Commit** - Conventional Commits com commitlint + +## Configuração do Cursor + +O arquivo `cursor.json` contém: +- Configurações de formatação +- Padrões de código específicos do Evolution API +- Diretórios principais do projeto +- Integrações e tecnologias utilizadas + +## Manutenção + +Para manter as regras atualizadas: +1. Analise novos padrões no código +2. Atualize as regras especializadas correspondentes +3. Mantenha os exemplos sincronizados com o código real +4. Documente mudanças significativas + +## Tecnologias Cobertas + +- **Backend**: Node.js 20+ + TypeScript 5+ + Express.js +- **Database**: Prisma ORM (PostgreSQL/MySQL) +- **Cache**: Redis + Node-cache +- **Queue**: RabbitMQ + Amazon SQS +- **Real-time**: Socket.io +- **Storage**: AWS S3 + Minio +- **Validation**: JSONSchema7 +- **Logging**: Pino +- **WhatsApp**: Baileys + Meta Business API +- **Integrations**: Chatwoot, Typebot, OpenAI, Dify + +## Estrutura do Projeto + +``` +src/ +├── api/ +│ ├── controllers/ # Controllers (HTTP handlers) +│ ├── services/ # Business logic +│ ├── dto/ # Data Transfer Objects +│ ├── guards/ # Authentication/Authorization +│ ├── routes/ # Express routers +│ ├── types/ # TypeScript definitions +│ └── integrations/ # External integrations +│ ├── channel/ # WhatsApp channels (Baileys, Business API) +│ ├── chatbot/ # Chatbot integrations +│ ├── event/ # Event integrations +│ └── storage/ # Storage integrations +├── cache/ # Cache implementations +├── config/ # Configuration files +├── utils/ # Utility functions +├── validate/ # Validation schemas +└── exceptions/ # Custom exceptions +``` + +Este sistema de regras garante consistência no código e facilita o desenvolvimento seguindo os padrões estabelecidos do Evolution API. diff --git a/.cursor/rules/core-development.mdc b/.cursor/rules/core-development.mdc new file mode 100644 index 000000000..530385795 --- /dev/null +++ b/.cursor/rules/core-development.mdc @@ -0,0 +1,167 @@ +--- +description: Core development principles and standards for Evolution API development +globs: +alwaysApply: true +--- + +# Evolution API Development Standards + +## Cross-References +- **Project Context**: @project-context.mdc for Evolution API-specific patterns +- **Specialized Rules**: + - @specialized-rules/service-rules.mdc for service layer patterns + - @specialized-rules/controller-rules.mdc for controller patterns + - @specialized-rules/dto-rules.mdc for DTO validation patterns + - @specialized-rules/guard-rules.mdc for authentication/authorization + - @specialized-rules/route-rules.mdc for router patterns + - @specialized-rules/type-rules.mdc for TypeScript definitions + - @specialized-rules/util-rules.mdc for utility functions + - @specialized-rules/validate-rules.mdc for validation schemas + - @specialized-rules/integration-channel-rules.mdc for channel integrations + - @specialized-rules/integration-chatbot-rules.mdc for chatbot integrations + - @specialized-rules/integration-storage-rules.mdc for storage integrations + - @specialized-rules/integration-event-rules.mdc for event integrations +- **TypeScript/Node.js**: Node.js 20+ + TypeScript 5+ best practices +- **Express/Prisma**: Express.js + Prisma ORM patterns +- **WhatsApp Integrations**: Baileys + Meta Business API patterns + +## Senior Engineer Context - Evolution API Platform +- You are a senior software engineer working on a WhatsApp API platform +- Focus on Node.js + TypeScript + Express.js full-stack development +- Specialized in real-time messaging, WhatsApp integrations, and event-driven architecture +- Apply scalable patterns for multi-tenant API platform +- Consider WhatsApp integration workflow implications and performance at scale + +## Fundamental Principles + +### Code Quality Standards +- **Simplicity First**: Always prefer simple solutions over complex ones +- **DRY Principle**: Avoid code duplication - check for existing similar functionality before implementing +- **Single Responsibility**: Each function/class should have one clear purpose +- **Readable Code**: Write code that tells a story - clear naming and structure + +### Problem Resolution Approach +- **Follow Existing Patterns**: Use established Service patterns, DTOs, and Integration patterns +- **Event-Driven First**: Leverage EventEmitter2 for event publishing when adding new features +- **Integration Pattern**: Follow existing WhatsApp integration patterns for new channels +- **Conservative Changes**: Prefer extending existing services over creating new architecture +- **Clean Migration**: Remove deprecated patterns when introducing new ones +- **Incremental Changes**: Break large changes into smaller, testable increments with proper migrations + +### File and Function Organization - Node.js/TypeScript Structure +- **Services**: Keep services focused and under 200 lines +- **Controllers**: Keep controllers thin - only routing and validation +- **DTOs**: Use JSONSchema7 for all input validation +- **Integrations**: Follow `src/api/integrations/` structure for new integrations +- **Utils**: Extract common functionality into well-named utilities +- **Types**: Define clear TypeScript interfaces and types + +### Code Analysis and Reflection +- After writing code, deeply reflect on scalability and maintainability +- Provide 1-2 paragraph analysis of code changes +- Suggest improvements or next steps based on reflection +- Consider performance, security, and maintenance implications + +## Development Standards + +### TypeScript Standards +- **Strict Mode**: Always use TypeScript strict mode +- **No Any**: Avoid `any` type - use proper typing +- **Interfaces**: Define clear contracts with interfaces +- **Enums**: Use enums for constants and status values +- **Generics**: Use generics for reusable components + +### Error Handling Standards +- **HTTP Exceptions**: Use appropriate HTTP status codes +- **Logging**: Structured logging with context +- **Retry Logic**: Implement retry for external services +- **Graceful Degradation**: Handle service failures gracefully + +### Security Standards +- **Input Validation**: Validate all inputs with JSONSchema7 +- **Authentication**: Use API keys and JWT tokens +- **Rate Limiting**: Implement rate limiting for APIs +- **Data Sanitization**: Sanitize sensitive data in logs + +### Performance Standards +- **Caching**: Use Redis for frequently accessed data +- **Database**: Optimize Prisma queries with proper indexing +- **Memory**: Monitor memory usage and implement cleanup +- **Async**: Use async/await properly with error handling + +## Communication Standards + +### Language Requirements +- **User Communication**: Always respond in Portuguese (PT-BR) +- **Code Comments**: English for technical documentation +- **API Documentation**: English for consistency +- **Error Messages**: Portuguese for user-facing errors + +### Documentation Standards +- **Code Comments**: Document complex business logic +- **API Documentation**: Document all public endpoints +- **README**: Keep project documentation updated +- **Changelog**: Document breaking changes + +## Quality Assurance + +### Testing Standards +- **Unit Tests**: Test business logic in services +- **Integration Tests**: Test API endpoints +- **Mocks**: Mock external dependencies +- **Coverage**: Aim for 70%+ test coverage + +### Code Review Standards +- **Peer Review**: All code must be reviewed +- **Automated Checks**: ESLint, Prettier, TypeScript +- **Security Review**: Check for security vulnerabilities +- **Performance Review**: Check for performance issues + +### Commit Standards (Conventional Commits) +- **Format**: `type(scope): subject` (max 100 characters) +- **Types**: + - `feat` - New feature + - `fix` - Bug fix + - `docs` - Documentation changes + - `style` - Code style changes (formatting, etc) + - `refactor` - Code refactoring + - `perf` - Performance improvements + - `test` - Adding or updating tests + - `chore` - Maintenance tasks + - `ci` - CI/CD changes + - `build` - Build system changes + - `revert` - Reverting changes + - `security` - Security fixes +- **Examples**: + - `feat(api): add WhatsApp message status endpoint` + - `fix(baileys): resolve connection timeout issue` + - `docs(readme): update installation instructions` + - `refactor(service): extract common message validation logic` +- **Tools**: Use `npm run commit` (Commitizen) for guided commits +- **Validation**: Enforced by commitlint on commit-msg hook + +## Evolution API Specific Patterns + +### WhatsApp Integration Patterns +- **Connection Management**: One connection per instance +- **Event Handling**: Proper event listeners for Baileys +- **Message Processing**: Queue-based message processing +- **Error Recovery**: Automatic reconnection logic + +### Multi-Database Support +- **Schema Compatibility**: Support PostgreSQL and MySQL +- **Migration Sync**: Keep migrations synchronized +- **Type Safety**: Use Prisma generated types +- **Connection Pooling**: Proper database connection management + +### Cache Strategy +- **Redis Primary**: Use Redis for distributed caching +- **Local Fallback**: Node-cache for local fallback +- **TTL Strategy**: Appropriate TTL for different data types +- **Cache Invalidation**: Proper cache invalidation patterns + +### Event System +- **EventEmitter2**: Use for internal events +- **WebSocket**: Socket.io for real-time updates +- **Queue Systems**: RabbitMQ/SQS for async processing +- **Webhook Processing**: Proper webhook validation and processing \ No newline at end of file diff --git a/.cursor/rules/cursor.json b/.cursor/rules/cursor.json new file mode 100644 index 000000000..a3d4275f1 --- /dev/null +++ b/.cursor/rules/cursor.json @@ -0,0 +1,179 @@ +{ + "version": "1.0", + "description": "Cursor IDE configuration for Evolution API project", + "rules": { + "general": { + "max_line_length": 120, + "indent_size": 2, + "end_of_line": "lf", + "charset": "utf-8", + "trim_trailing_whitespace": true, + "insert_final_newline": true + }, + "typescript": { + "quotes": "single", + "semi": true, + "trailing_comma": "es5", + "bracket_spacing": true, + "arrow_parens": "avoid", + "print_width": 120, + "tab_width": 2, + "use_tabs": false, + "single_quote": true, + "end_of_line": "lf", + "strict": true, + "no_implicit_any": true, + "strict_null_checks": true + }, + "javascript": { + "quotes": "single", + "semi": true, + "trailing_comma": "es5", + "bracket_spacing": true, + "arrow_parens": "avoid", + "print_width": 120, + "tab_width": 2, + "use_tabs": false, + "single_quote": true, + "end_of_line": "lf", + "style_guide": "eslint-airbnb" + }, + "json": { + "tab_width": 2, + "use_tabs": false, + "parser": "json" + }, + "ignore": { + "files": [ + "node_modules/**", + "dist/**", + "build/**", + ".git/**", + "*.min.js", + "*.min.css", + ".env", + ".env.*", + ".env.example", + "coverage/**", + "*.log", + "*.lock", + "pnpm-lock.yaml", + "package-lock.json", + "yarn.lock", + "log/**", + "tmp/**", + "instances/**", + "public/uploads/**", + "*.dump", + "*.rdb", + "*.mmdb", + ".DS_Store", + "*.swp", + "*.swo", + "*.un~", + ".jest-cache", + ".idea/**", + ".vscode/**", + ".yalc/**", + "yalc.lock", + "*.local", + "prisma/migrations/**", + "prisma/mysql-migrations/**", + "prisma/postgresql-migrations/**" + ] + }, + "search": { + "exclude_patterns": [ + "**/node_modules/**", + "**/dist/**", + "**/build/**", + "**/.git/**", + "**/coverage/**", + "**/log/**", + "**/tmp/**", + "**/instances/**", + "**/public/uploads/**", + "**/*.min.js", + "**/*.min.css", + "**/*.log", + "**/*.lock", + "**/pnpm-lock.yaml", + "**/package-lock.json", + "**/yarn.lock", + "**/*.dump", + "**/*.rdb", + "**/*.mmdb", + "**/.DS_Store", + "**/*.swp", + "**/*.swo", + "**/*.un~", + "**/.jest-cache", + "**/.idea/**", + "**/.vscode/**", + "**/.yalc/**", + "**/yalc.lock", + "**/*.local", + "**/prisma/migrations/**", + "**/prisma/mysql-migrations/**", + "**/prisma/postgresql-migrations/**" + ] + }, + "evolution_api": { + "project_type": "nodejs_typescript_api", + "backend_framework": "express_prisma", + "database": ["postgresql", "mysql"], + "cache": ["redis", "node_cache"], + "queue": ["rabbitmq", "sqs"], + "real_time": "socket_io", + "file_storage": ["aws_s3", "minio"], + "validation": "class_validator", + "logging": "pino", + "main_directories": { + "source": "src/", + "api": "src/api/", + "controllers": "src/api/controllers/", + "services": "src/api/services/", + "integrations": "src/api/integrations/", + "dto": "src/api/dto/", + "types": "src/api/types/", + "guards": "src/api/guards/", + "routes": "src/api/routes/", + "cache": "src/cache/", + "config": "src/config/", + "utils": "src/utils/", + "exceptions": "src/exceptions/", + "validate": "src/validate/", + "prisma": "prisma/", + "tests": "test/", + "docs": "docs/" + }, + "key_patterns": [ + "whatsapp_integration", + "multi_database_support", + "instance_management", + "event_driven_architecture", + "service_layer_pattern", + "dto_validation", + "webhook_processing", + "message_queuing", + "real_time_communication", + "file_storage_integration" + ], + "whatsapp_integrations": [ + "baileys", + "meta_business_api", + "whatsapp_cloud_api" + ], + "external_integrations": [ + "chatwoot", + "typebot", + "openai", + "dify", + "rabbitmq", + "sqs", + "s3", + "minio" + ] + } + } +} diff --git a/.cursor/rules/project-context.mdc b/.cursor/rules/project-context.mdc new file mode 100644 index 000000000..0a4da37e7 --- /dev/null +++ b/.cursor/rules/project-context.mdc @@ -0,0 +1,174 @@ +--- +description: Evolution API project-specific context and constraints +globs: +alwaysApply: true +--- + +# Evolution API Project Context + +## Cross-References +- **Core Development**: @core-development.mdc for fundamental development principles +- **Specialized Rules**: Reference specific specialized rules when working on: + - Services: @specialized-rules/service-rules.mdc + - Controllers: @specialized-rules/controller-rules.mdc + - DTOs: @specialized-rules/dto-rules.mdc + - Guards: @specialized-rules/guard-rules.mdc + - Routes: @specialized-rules/route-rules.mdc + - Types: @specialized-rules/type-rules.mdc + - Utils: @specialized-rules/util-rules.mdc + - Validation: @specialized-rules/validate-rules.mdc + - Channel Integrations: @specialized-rules/integration-channel-rules.mdc + - Chatbot Integrations: @specialized-rules/integration-chatbot-rules.mdc + - Storage Integrations: @specialized-rules/integration-storage-rules.mdc + - Event Integrations: @specialized-rules/integration-event-rules.mdc +- **TypeScript/Node.js**: Node.js 20+ + TypeScript 5+ backend standards +- **Express/Prisma**: Express.js + Prisma ORM patterns +- **WhatsApp Integrations**: Baileys, Meta Business API, and other messaging platforms + +## Technology Stack +- **Backend**: Node.js 20+ + TypeScript 5+ + Express.js +- **Database**: Prisma ORM (PostgreSQL/MySQL support) +- **Cache**: Redis + Node-cache for local fallback +- **Queue**: RabbitMQ + Amazon SQS for message processing +- **Real-time**: Socket.io for WebSocket connections +- **Storage**: AWS S3 + Minio for file storage +- **Validation**: JSONSchema7 for input validation +- **Logging**: Pino for structured logging +- **Architecture**: Multi-tenant API with WhatsApp integrations + +## Project-Specific Patterns + +### WhatsApp Integration Architecture +- **MANDATORY**: All WhatsApp integrations must follow established patterns +- **BAILEYS**: Use `whatsapp.baileys.service.ts` patterns for WhatsApp Web +- **META BUSINESS**: Use `whatsapp.business.service.ts` for official API +- **CONNECTION MANAGEMENT**: One connection per instance with proper lifecycle +- **EVENT HANDLING**: Proper event listeners and error handling + +### Multi-Database Architecture +- **CRITICAL**: Support both PostgreSQL and MySQL +- **SCHEMAS**: Use appropriate schema files (postgresql-schema.prisma / mysql-schema.prisma) +- **MIGRATIONS**: Keep migrations synchronized between databases +- **TYPES**: Use database-specific types (@db.JsonB vs @db.Json) +- **COMPATIBILITY**: Ensure feature parity between databases + +### API Integration Workflow +- **CORE FEATURE**: REST API for WhatsApp communication +- **COMPLEXITY**: High - involves webhook processing, message routing, and instance management +- **COMPONENTS**: Instance management, message handling, media processing +- **INTEGRATIONS**: Baileys, Meta Business API, Chatwoot, Typebot, OpenAI, Dify + +### Multi-Tenant Instance Architecture +- **CRITICAL**: All operations must be scoped by instance +- **ISOLATION**: Complete data isolation between instances +- **SECURITY**: Validate instance ownership before operations +- **SCALING**: Support thousands of concurrent instances +- **AUTHENTICATION**: API key-based authentication per instance + +## Documentation Requirements + +### Implementation Documentation +- **MANDATORY**: Document complex integration patterns +- **LOCATION**: Use inline comments for business logic +- **API DOCS**: Document all public endpoints +- **WEBHOOK DOCS**: Document webhook payloads and signatures + +### Change Documentation +- **CHANGELOG**: Document breaking changes +- **MIGRATION GUIDES**: Document database migrations +- **INTEGRATION GUIDES**: Document new integration patterns + +## Environment and Security + +### Environment Variables +- **CRITICAL**: Never hardcode sensitive values +- **VALIDATION**: Validate required environment variables on startup +- **SECURITY**: Use secure defaults and proper encryption +- **DOCUMENTATION**: Document all environment variables + +### File Organization - Node.js/TypeScript Structure +- **CONTROLLERS**: Organized by feature (`api/controllers/`) +- **SERVICES**: Business logic in service classes (`api/services/`) +- **INTEGRATIONS**: External integrations (`api/integrations/`) +- **DTOS**: Data transfer objects (`api/dto/`) +- **TYPES**: TypeScript types (`api/types/`) +- **UTILS**: Utility functions (`utils/`) + +## Integration Points + +### WhatsApp Providers +- **BAILEYS**: WhatsApp Web integration with QR code +- **META BUSINESS**: Official WhatsApp Business API +- **CLOUD API**: WhatsApp Cloud API integration +- **WEBHOOK PROCESSING**: Proper webhook validation and processing + +### External Integrations +- **CHATWOOT**: Customer support platform integration +- **TYPEBOT**: Chatbot flow integration +- **OPENAI**: AI-powered chat integration +- **DIFY**: AI workflow integration +- **STORAGE**: S3/Minio for media file storage + +### Event-Driven Communication +- **EVENTEMITTER2**: Internal event system +- **SOCKET.IO**: Real-time WebSocket communication +- **RABBITMQ**: Message queue for async processing +- **SQS**: Amazon SQS for cloud-based queuing +- **WEBHOOKS**: Outbound webhook system + +## Development Constraints + +### Language Requirements +- **USER COMMUNICATION**: Always respond in Portuguese (PT-BR) +- **CODE/COMMENTS**: English for code and technical documentation +- **API RESPONSES**: English for consistency +- **ERROR MESSAGES**: Portuguese for user-facing errors + +### Performance Constraints +- **MEMORY**: Efficient memory usage for multiple instances +- **DATABASE**: Optimized queries with proper indexing +- **CACHE**: Strategic caching for frequently accessed data +- **CONNECTIONS**: Proper connection pooling and management + +### Security Constraints +- **AUTHENTICATION**: API key validation for all endpoints +- **AUTHORIZATION**: Instance-based access control +- **INPUT VALIDATION**: Validate all inputs with JSONSchema7 +- **RATE LIMITING**: Prevent abuse with rate limiting +- **WEBHOOK SECURITY**: Validate webhook signatures + +## Quality Standards +- **TYPE SAFETY**: Full TypeScript coverage with strict mode +- **ERROR HANDLING**: Comprehensive error scenarios with proper logging +- **TESTING**: Unit and integration tests for critical paths +- **MONITORING**: Proper logging and error tracking +- **DOCUMENTATION**: Clear API documentation and code comments +- **PERFORMANCE**: Optimized for high-throughput message processing +- **SECURITY**: Secure by default with proper validation +- **SCALABILITY**: Design for horizontal scaling + +## Evolution API Specific Development Patterns + +### Instance Management +- **LIFECYCLE**: Proper instance creation, connection, and cleanup +- **STATE MANAGEMENT**: Track connection status and health +- **RECOVERY**: Automatic reconnection and error recovery +- **MONITORING**: Health checks and status reporting + +### Message Processing +- **QUEUE-BASED**: Use queues for message processing +- **RETRY LOGIC**: Implement exponential backoff for failures +- **MEDIA HANDLING**: Proper media upload and processing +- **WEBHOOK DELIVERY**: Reliable webhook delivery with retries + +### Integration Patterns +- **SERVICE LAYER**: Business logic in service classes +- **DTO VALIDATION**: Input validation with JSONSchema7 +- **ERROR HANDLING**: Consistent error responses +- **LOGGING**: Structured logging with correlation IDs + +### Database Patterns +- **PRISMA**: Use Prisma ORM for all database operations +- **TRANSACTIONS**: Use transactions for multi-step operations +- **MIGRATIONS**: Proper migration management +- **INDEXING**: Optimize queries with appropriate indexes \ No newline at end of file diff --git a/.cursor/rules/specialized-rules/controller-rules.mdc b/.cursor/rules/specialized-rules/controller-rules.mdc new file mode 100644 index 000000000..4e4d666a7 --- /dev/null +++ b/.cursor/rules/specialized-rules/controller-rules.mdc @@ -0,0 +1,342 @@ +--- +description: Controller patterns for Evolution API +globs: + - "src/api/controllers/**/*.ts" + - "src/api/integrations/**/controllers/*.ts" +alwaysApply: false +--- + +# Evolution API Controller Rules + +## Controller Structure Pattern + +### Standard Controller Class +```typescript +export class ExampleController { + constructor(private readonly exampleService: ExampleService) {} + + public async createExample(instance: InstanceDto, data: ExampleDto) { + return this.exampleService.create(instance, data); + } + + public async findExample(instance: InstanceDto) { + return this.exampleService.find(instance); + } +} +``` + +## Dependency Injection Pattern + +### Service Injection +```typescript +// CORRECT - Evolution API pattern +export class ChatController { + constructor(private readonly waMonitor: WAMonitoringService) {} + + public async whatsappNumber({ instanceName }: InstanceDto, data: WhatsAppNumberDto) { + return await this.waMonitor.waInstances[instanceName].getWhatsAppNumbers(data); + } +} + +// INCORRECT - Don't inject multiple services when waMonitor is sufficient +export class ChatController { + constructor( + private readonly waMonitor: WAMonitoringService, + private readonly prismaRepository: PrismaRepository, // ❌ Unnecessary if waMonitor has access + private readonly configService: ConfigService, // ❌ Unnecessary if waMonitor has access + ) {} +} +``` + +## Method Signature Pattern + +### Instance Parameter Pattern +```typescript +// CORRECT - Evolution API pattern (destructuring instanceName) +public async fetchCatalog({ instanceName }: InstanceDto, data: getCatalogDto) { + return await this.waMonitor.waInstances[instanceName].fetchCatalog(instanceName, data); +} + +// CORRECT - Alternative pattern for full instance (when using services) +public async createTemplate(instance: InstanceDto, data: TemplateDto) { + return this.templateService.create(instance, data); +} + +// INCORRECT - Don't use generic method names +public async methodName(instance: InstanceDto, data: DataDto) { // ❌ Use specific names + return this.service.performAction(instance, data); +} +``` + +## WAMonitor Access Pattern + +### Direct WAMonitor Usage +```typescript +// CORRECT - Standard pattern in controllers +export class CallController { + constructor(private readonly waMonitor: WAMonitoringService) {} + + public async offerCall({ instanceName }: InstanceDto, data: OfferCallDto) { + return await this.waMonitor.waInstances[instanceName].offerCall(data); + } +} +``` + +## Controller Registration Pattern + +### Server Module Registration +```typescript +// In server.module.ts +export const templateController = new TemplateController(templateService); +export const businessController = new BusinessController(waMonitor); +export const chatController = new ChatController(waMonitor); +export const callController = new CallController(waMonitor); +``` + +## Error Handling in Controllers + +### Let Services Handle Errors +```typescript +// CORRECT - Let service handle errors +public async fetchCatalog(instance: InstanceDto, data: getCatalogDto) { + return await this.waMonitor.waInstances[instance.instanceName].fetchCatalog(instance.instanceName, data); +} + +// INCORRECT - Don't add try-catch in controllers unless specific handling needed +public async fetchCatalog(instance: InstanceDto, data: getCatalogDto) { + try { + return await this.waMonitor.waInstances[instance.instanceName].fetchCatalog(instance.instanceName, data); + } catch (error) { + throw error; // ❌ Unnecessary try-catch + } +} +``` + +## Complex Controller Pattern + +### Instance Controller Pattern +```typescript +export class InstanceController { + constructor( + private readonly waMonitor: WAMonitoringService, + private readonly configService: ConfigService, + private readonly prismaRepository: PrismaRepository, + private readonly eventEmitter: EventEmitter2, + private readonly chatwootService: ChatwootService, + private readonly settingsService: SettingsService, + private readonly proxyService: ProxyController, + private readonly cache: CacheService, + private readonly chatwootCache: CacheService, + private readonly baileysCache: CacheService, + private readonly providerFiles: ProviderFiles, + ) {} + + private readonly logger = new Logger('InstanceController'); + + // Multiple methods handling different aspects + public async createInstance(data: InstanceDto) { + // Complex instance creation logic + } + + public async deleteInstance({ instanceName }: InstanceDto) { + // Complex instance deletion logic + } +} +``` + +## Channel Controller Pattern + +### Base Channel Controller +```typescript +export class ChannelController { + public prismaRepository: PrismaRepository; + public waMonitor: WAMonitoringService; + + constructor(prismaRepository: PrismaRepository, waMonitor: WAMonitoringService) { + this.prisma = prismaRepository; + this.monitor = waMonitor; + } + + // Getters and setters for dependency access + public set prisma(prisma: PrismaRepository) { + this.prismaRepository = prisma; + } + + public get prisma() { + return this.prismaRepository; + } + + public set monitor(waMonitor: WAMonitoringService) { + this.waMonitor = waMonitor; + } + + public get monitor() { + return this.waMonitor; + } +} +``` + +### Extended Channel Controller +```typescript +export class EvolutionController extends ChannelController implements ChannelControllerInterface { + private readonly logger = new Logger('EvolutionController'); + + constructor(prismaRepository: PrismaRepository, waMonitor: WAMonitoringService) { + super(prismaRepository, waMonitor); + } + + integrationEnabled: boolean; + + public async receiveWebhook(data: any) { + const numberId = data.numberId; + + if (!numberId) { + this.logger.error('WebhookService -> receiveWebhookEvolution -> numberId not found'); + return; + } + + const instance = await this.prismaRepository.instance.findFirst({ + where: { number: numberId }, + }); + + if (!instance) { + this.logger.error('WebhookService -> receiveWebhook -> instance not found'); + return; + } + + await this.waMonitor.waInstances[instance.name].connectToWhatsapp(data); + + return { + status: 'success', + }; + } +} +``` + +## Chatbot Controller Pattern + +### Base Chatbot Controller +```typescript +export abstract class BaseChatbotController + extends ChatbotController + implements ChatbotControllerInterface +{ + public readonly logger: Logger; + integrationEnabled: boolean; + + // Abstract methods to be implemented + protected abstract readonly integrationName: string; + protected abstract processBot(/* parameters */): Promise; + protected abstract getFallbackBotId(settings: any): string | undefined; + + constructor(prismaRepository: PrismaRepository, waMonitor: WAMonitoringService) { + super(prismaRepository, waMonitor); + } + + // Base implementation methods + public async createBot(instance: InstanceDto, data: BotData) { + // Common bot creation logic + } +} +``` + +## Method Naming Conventions + +### Standard Method Names +- `create*()` - Create operations +- `find*()` - Find operations +- `fetch*()` - Fetch from external APIs +- `send*()` - Send operations +- `receive*()` - Receive webhook/data +- `handle*()` - Handle specific actions +- `offer*()` - Offer services (like calls) + +## Return Patterns + +### Direct Return Pattern +```typescript +// CORRECT - Direct return from service +public async createTemplate(instance: InstanceDto, data: TemplateDto) { + return this.templateService.create(instance, data); +} + +// CORRECT - Direct return from waMonitor +public async offerCall({ instanceName }: InstanceDto, data: OfferCallDto) { + return await this.waMonitor.waInstances[instanceName].offerCall(data); +} +``` + +## Controller Testing Pattern + +### Unit Test Structure +```typescript +describe('ExampleController', () => { + let controller: ExampleController; + let service: jest.Mocked; + + beforeEach(() => { + const mockService = { + create: jest.fn(), + find: jest.fn(), + }; + + controller = new ExampleController(mockService as any); + service = mockService as any; + }); + + describe('createExample', () => { + it('should call service create method', async () => { + const instance = { instanceName: 'test' }; + const data = { test: 'data' }; + const expectedResult = { success: true }; + + service.create.mockResolvedValue(expectedResult); + + const result = await controller.createExample(instance, data); + + expect(service.create).toHaveBeenCalledWith(instance, data); + expect(result).toEqual(expectedResult); + }); + }); +}); +``` + +## Interface Implementation + +### Controller Interface Pattern +```typescript +export interface ChannelControllerInterface { + integrationEnabled: boolean; +} + +export interface ChatbotControllerInterface { + integrationEnabled: boolean; + createBot(instance: InstanceDto, data: any): Promise; + findBot(instance: InstanceDto): Promise; + // ... other methods +} +``` + +## Controller Organization + +### File Naming Convention +- `*.controller.ts` - Main controllers +- `*/*.controller.ts` - Integration-specific controllers + +### Method Organization +1. Constructor +2. Public methods (alphabetical order) +3. Private methods (if any) + +### Import Organization +```typescript +// DTOs first +import { InstanceDto } from '@api/dto/instance.dto'; +import { ExampleDto } from '@api/dto/example.dto'; + +// Services +import { ExampleService } from '@api/services/example.service'; + +// Types +import { WAMonitoringService } from '@api/services/monitor.service'; +``` \ No newline at end of file diff --git a/.cursor/rules/specialized-rules/dto-rules.mdc b/.cursor/rules/specialized-rules/dto-rules.mdc new file mode 100644 index 000000000..b1cae17d8 --- /dev/null +++ b/.cursor/rules/specialized-rules/dto-rules.mdc @@ -0,0 +1,433 @@ +--- +description: DTO patterns and validation for Evolution API +globs: + - "src/api/dto/**/*.ts" + - "src/api/integrations/**/dto/*.ts" +alwaysApply: false +--- + +# Evolution API DTO Rules + +## DTO Structure Pattern + +### Basic DTO Class +```typescript +export class ExampleDto { + name: string; + category: string; + allowCategoryChange: boolean; + language: string; + components: any; + webhookUrl?: string; +} +``` + +## Inheritance Pattern + +### DTO Inheritance +```typescript +// CORRECT - Evolution API pattern +export class InstanceDto extends IntegrationDto { + instanceName: string; + instanceId?: string; + qrcode?: boolean; + businessId?: string; + number?: string; + integration?: string; + token?: string; + status?: string; + ownerJid?: string; + profileName?: string; + profilePicUrl?: string; + + // Settings + rejectCall?: boolean; + msgCall?: string; + groupsIgnore?: boolean; + alwaysOnline?: boolean; + readMessages?: boolean; + readStatus?: boolean; + syncFullHistory?: boolean; + wavoipToken?: string; + + // Proxy settings + proxyHost?: string; + proxyPort?: string; + proxyProtocol?: string; + proxyUsername?: string; + proxyPassword?: string; + + // Webhook configuration + webhook?: { + enabled?: boolean; + events?: string[]; + headers?: JsonValue; + url?: string; + byEvents?: boolean; + base64?: boolean; + }; + + // Chatwoot integration + chatwootAccountId?: string; + chatwootConversationPending?: boolean; + chatwootAutoCreate?: boolean; + chatwootDaysLimitImportMessages?: number; + chatwootImportContacts?: boolean; + chatwootImportMessages?: boolean; + chatwootLogo?: string; + chatwootMergeBrazilContacts?: boolean; + chatwootNameInbox?: string; + chatwootOrganization?: string; + chatwootReopenConversation?: boolean; + chatwootSignMsg?: boolean; + chatwootToken?: string; + chatwootUrl?: string; +} +``` + +## Base DTO Pattern + +### Base Chatbot DTO +```typescript +/** + * Base DTO for all chatbot integrations + * Contains common properties shared by all chatbot types + */ +export class BaseChatbotDto { + enabled?: boolean; + description: string; + expire?: number; + keywordFinish?: string; + delayMessage?: number; + unknownMessage?: string; + listeningFromMe?: boolean; + stopBotFromMe?: boolean; + keepOpen?: boolean; + debounceTime?: number; + triggerType: TriggerType; + triggerOperator?: TriggerOperator; + triggerValue?: string; + ignoreJids?: string[]; + splitMessages?: boolean; + timePerChar?: number; +} + +/** + * Base settings DTO for all chatbot integrations + */ +export class BaseChatbotSettingDto { + expire?: number; + keywordFinish?: string; + delayMessage?: number; + unknownMessage?: string; + listeningFromMe?: boolean; + stopBotFromMe?: boolean; + keepOpen?: boolean; + debounceTime?: number; + ignoreJids?: string[]; + splitMessages?: boolean; + timePerChar?: number; +} +``` + +## Message DTO Patterns + +### Send Message DTOs +```typescript +export class Metadata { + number: string; + delay?: number; +} + +export class SendTextDto extends Metadata { + text: string; + linkPreview?: boolean; + mentionsEveryOne?: boolean; + mentioned?: string[]; +} + +export class SendListDto extends Metadata { + title: string; + description: string; + buttonText: string; + footerText?: string; + + sections: Section[]; +} + +export class ContactMessage { + fullName: string; + wuid: string; + phoneNumber: string; + organization?: string; + email?: string; + url?: string; +} + +export class SendTemplateDto extends Metadata { + name: string; + language: string; + components: any; +} +``` + +## Simple DTO Patterns + +### Basic DTOs +```typescript +export class NumberDto { + number: string; +} + +export class LabelDto { + id?: string; + name: string; + color: string; + predefinedId?: string; +} + +export class HandleLabelDto { + number: string; + labelId: string; +} + +export class ProfileNameDto { + name: string; +} + +export class WhatsAppNumberDto { + numbers: string[]; +} +``` + +## Complex DTO Patterns + +### Business DTOs +```typescript +export class getCatalogDto { + number?: string; + limit?: number; + cursor?: string; +} + +export class getCollectionsDto { + number?: string; + limit?: number; + cursor?: string; +} + +export class NumberBusiness { + number: string; + name?: string; + description?: string; + email?: string; + websites?: string[]; + latitude?: number; + longitude?: number; + address?: string; + profilehandle?: string; +} +``` + +## Settings DTO Pattern + +### Settings Configuration +```typescript +export class SettingsDto { + rejectCall?: boolean; + msgCall?: string; + groupsIgnore?: boolean; + alwaysOnline?: boolean; + readMessages?: boolean; + readStatus?: boolean; + syncFullHistory?: boolean; + wavoipToken?: string; +} + +export class ProxyDto { + host?: string; + port?: string; + protocol?: string; + username?: string; + password?: string; +} +``` + +## Presence DTO Pattern + +### WhatsApp Presence +```typescript +export class SetPresenceDto { + presence: WAPresence; +} + +export class SendPresenceDto { + number: string; + presence: WAPresence; +} +``` + +## DTO Structure (No Decorators) + +### Simple DTO Classes (Evolution API Pattern) +```typescript +// CORRECT - Evolution API pattern (no decorators) +export class ExampleDto { + name: string; + description?: string; + enabled: boolean; + items?: string[]; + timeout?: number; +} + +// INCORRECT - Don't use class-validator decorators +export class ValidatedDto { + @IsString() // ❌ Evolution API doesn't use decorators + name: string; +} +``` + +## Type Safety Patterns + +### Prisma Type Integration +```typescript +import { JsonValue } from '@prisma/client/runtime/library'; +import { WAPresence } from 'baileys'; +import { TriggerOperator, TriggerType } from '@prisma/client'; + +export class TypeSafeDto { + presence: WAPresence; + triggerType: TriggerType; + triggerOperator?: TriggerOperator; + metadata?: JsonValue; +} +``` + +## DTO Documentation + +### JSDoc Comments +```typescript +/** + * DTO for creating WhatsApp templates + * Used by Meta Business API integration + */ +export class TemplateDto { + /** Template name - must be unique */ + name: string; + + /** Template category (MARKETING, UTILITY, AUTHENTICATION) */ + category: string; + + /** Whether category can be changed after creation */ + allowCategoryChange: boolean; + + /** Language code (e.g., 'pt_BR', 'en_US') */ + language: string; + + /** Template components (header, body, footer, buttons) */ + components: any; + + /** Optional webhook URL for template status updates */ + webhookUrl?: string; +} +``` + +## DTO Naming Conventions + +### Standard Naming Patterns +- `*Dto` - Data transfer objects +- `Create*Dto` - Creation DTOs +- `Update*Dto` - Update DTOs +- `Send*Dto` - Message sending DTOs +- `Get*Dto` - Query DTOs +- `Handle*Dto` - Action DTOs + +## File Organization + +### DTO File Structure +``` +src/api/dto/ +├── instance.dto.ts # Main instance DTO +├── template.dto.ts # Template management +├── sendMessage.dto.ts # Message sending DTOs +├── chat.dto.ts # Chat operations +├── business.dto.ts # Business API DTOs +├── group.dto.ts # Group management +├── label.dto.ts # Label management +├── proxy.dto.ts # Proxy configuration +├── settings.dto.ts # Instance settings +└── call.dto.ts # Call operations +``` + +## Integration DTO Patterns + +### Chatbot Integration DTOs +```typescript +// Base for all chatbot DTOs +export class BaseChatbotDto { + enabled?: boolean; + description: string; + // ... common properties +} + +// Specific chatbot DTOs extend base +export class TypebotDto extends BaseChatbotDto { + url: string; + typebot: string; + // ... typebot-specific properties +} + +export class OpenaiDto extends BaseChatbotDto { + apiKey: string; + model: string; + // ... openai-specific properties +} +``` + +## DTO Testing Pattern + +### DTO Validation Tests +```typescript +describe('ExampleDto', () => { + it('should validate required fields', () => { + const dto = new ExampleDto(); + dto.name = 'test'; + dto.category = 'MARKETING'; + dto.allowCategoryChange = true; + dto.language = 'pt_BR'; + dto.components = {}; + + expect(dto.name).toBe('test'); + expect(dto.category).toBe('MARKETING'); + }); + + it('should handle optional fields', () => { + const dto = new ExampleDto(); + dto.name = 'test'; + dto.category = 'MARKETING'; + dto.allowCategoryChange = true; + dto.language = 'pt_BR'; + dto.components = {}; + dto.webhookUrl = 'https://example.com/webhook'; + + expect(dto.webhookUrl).toBe('https://example.com/webhook'); + }); +}); +``` + +## DTO Transformation + +### Request to DTO Mapping (Evolution API Pattern) +```typescript +// CORRECT - Evolution API uses RouterBroker dataValidate +const response = await this.dataValidate({ + request: req, + schema: exampleSchema, // JSONSchema7 + ClassRef: ExampleDto, + execute: (instance, data) => controller.method(instance, data), +}); + +// INCORRECT - Don't use class-validator +const dto = plainToClass(ExampleDto, req.body); // ❌ Not used in Evolution API +const errors = await validate(dto); // ❌ Not used in Evolution API +``` \ No newline at end of file diff --git a/.cursor/rules/specialized-rules/guard-rules.mdc b/.cursor/rules/specialized-rules/guard-rules.mdc new file mode 100644 index 000000000..d85215fe9 --- /dev/null +++ b/.cursor/rules/specialized-rules/guard-rules.mdc @@ -0,0 +1,416 @@ +--- +description: Guard patterns for authentication and authorization in Evolution API +globs: + - "src/api/guards/**/*.ts" +alwaysApply: false +--- + +# Evolution API Guard Rules + +## Guard Structure Pattern + +### Standard Guard Function +```typescript +import { NextFunction, Request, Response } from 'express'; +import { Logger } from '@config/logger.config'; +import { UnauthorizedException, ForbiddenException } from '@exceptions'; + +const logger = new Logger('GUARD'); + +async function guardFunction(req: Request, _: Response, next: NextFunction) { + // Guard logic here + + if (validationFails) { + throw new UnauthorizedException(); + } + + return next(); +} + +export const guardName = { guardFunction }; +``` + +## Authentication Guard Pattern + +### API Key Authentication +```typescript +async function apikey(req: Request, _: Response, next: NextFunction) { + const env = configService.get('AUTHENTICATION').API_KEY; + const key = req.get('apikey'); + const db = configService.get('DATABASE'); + + if (!key) { + throw new UnauthorizedException(); + } + + // Global API key check + if (env.KEY === key) { + return next(); + } + + // Special routes handling + if ((req.originalUrl.includes('/instance/create') || req.originalUrl.includes('/instance/fetchInstances')) && !key) { + throw new ForbiddenException('Missing global api key', 'The global api key must be set'); + } + + const param = req.params as unknown as InstanceDto; + + try { + if (param?.instanceName) { + const instance = await prismaRepository.instance.findUnique({ + where: { name: param.instanceName }, + }); + if (instance.token === key) { + return next(); + } + } else { + if (req.originalUrl.includes('/instance/fetchInstances') && db.SAVE_DATA.INSTANCE) { + const instanceByKey = await prismaRepository.instance.findFirst({ + where: { token: key }, + }); + if (instanceByKey) { + return next(); + } + } + } + } catch (error) { + logger.error(error); + } + + throw new UnauthorizedException(); +} + +export const authGuard = { apikey }; +``` + +## Instance Validation Guards + +### Instance Exists Guard +```typescript +async function getInstance(instanceName: string) { + try { + const cacheConf = configService.get('CACHE'); + + const exists = !!waMonitor.waInstances[instanceName]; + + if (cacheConf.REDIS.ENABLED && cacheConf.REDIS.SAVE_INSTANCES) { + const keyExists = await cache.has(instanceName); + return exists || keyExists; + } + + return exists || (await prismaRepository.instance.findMany({ where: { name: instanceName } })).length > 0; + } catch (error) { + throw new InternalServerErrorException(error?.toString()); + } +} + +export async function instanceExistsGuard(req: Request, _: Response, next: NextFunction) { + if (req.originalUrl.includes('/instance/create')) { + return next(); + } + + const param = req.params as unknown as InstanceDto; + if (!param?.instanceName) { + throw new BadRequestException('"instanceName" not provided.'); + } + + if (!(await getInstance(param.instanceName))) { + throw new NotFoundException(`The "${param.instanceName}" instance does not exist`); + } + + next(); +} +``` + +### Instance Logged Guard +```typescript +export async function instanceLoggedGuard(req: Request, _: Response, next: NextFunction) { + if (req.originalUrl.includes('/instance/create')) { + const instance = req.body as InstanceDto; + if (await getInstance(instance.instanceName)) { + throw new ForbiddenException(`This name "${instance.instanceName}" is already in use.`); + } + + if (waMonitor.waInstances[instance.instanceName]) { + delete waMonitor.waInstances[instance.instanceName]; + } + } + + next(); +} +``` + +## Telemetry Guard Pattern + +### Telemetry Collection +```typescript +class Telemetry { + public collectTelemetry(req: Request, res: Response, next: NextFunction): void { + // Collect telemetry data + const telemetryData = { + route: req.originalUrl, + method: req.method, + timestamp: new Date(), + userAgent: req.get('User-Agent'), + }; + + // Send telemetry asynchronously (don't block request) + setImmediate(() => { + this.sendTelemetry(telemetryData); + }); + + next(); + } + + private async sendTelemetry(data: any): Promise { + try { + // Send telemetry data + } catch (error) { + // Silently fail - don't affect main request + } + } +} + +export default Telemetry; +``` + +## Guard Composition Pattern + +### Multiple Guards Usage +```typescript +// In router setup +const guards = [instanceExistsGuard, instanceLoggedGuard, authGuard['apikey']]; + +router + .use('/instance', new InstanceRouter(configService, ...guards).router) + .use('/message', new MessageRouter(...guards).router) + .use('/chat', new ChatRouter(...guards).router); +``` + +## Error Handling in Guards + +### Proper Exception Throwing +```typescript +// CORRECT - Use proper HTTP exceptions +if (!apiKey) { + throw new UnauthorizedException('API key required'); +} + +if (instanceExists) { + throw new ForbiddenException('Instance already exists'); +} + +if (!instanceFound) { + throw new NotFoundException('Instance not found'); +} + +if (validationFails) { + throw new BadRequestException('Invalid request parameters'); +} + +// INCORRECT - Don't use generic Error +if (!apiKey) { + throw new Error('API key required'); // ❌ Use specific exceptions +} +``` + +## Configuration Access in Guards + +### Config Service Usage +```typescript +async function configAwareGuard(req: Request, _: Response, next: NextFunction) { + const authConfig = configService.get('AUTHENTICATION'); + const cacheConfig = configService.get('CACHE'); + const dbConfig = configService.get('DATABASE'); + + // Use configuration for guard logic + if (authConfig.API_KEY.KEY === providedKey) { + return next(); + } + + throw new UnauthorizedException(); +} +``` + +## Database Access in Guards + +### Prisma Repository Usage +```typescript +async function databaseGuard(req: Request, _: Response, next: NextFunction) { + try { + const param = req.params as unknown as InstanceDto; + + const instance = await prismaRepository.instance.findUnique({ + where: { name: param.instanceName }, + }); + + if (!instance) { + throw new NotFoundException('Instance not found'); + } + + // Additional validation logic + if (instance.status !== 'active') { + throw new ForbiddenException('Instance not active'); + } + + return next(); + } catch (error) { + logger.error('Database guard error:', error); + throw new InternalServerErrorException('Database access failed'); + } +} +``` + +## Cache Integration in Guards + +### Cache Service Usage +```typescript +async function cacheAwareGuard(req: Request, _: Response, next: NextFunction) { + const cacheConf = configService.get('CACHE'); + + if (cacheConf.REDIS.ENABLED) { + const cached = await cache.get(`guard:${req.params.instanceName}`); + if (cached) { + // Use cached validation result + return next(); + } + } + + // Perform validation and cache result + const isValid = await performValidation(req.params.instanceName); + + if (cacheConf.REDIS.ENABLED) { + await cache.set(`guard:${req.params.instanceName}`, isValid, 300); // 5 min TTL + } + + if (isValid) { + return next(); + } + + throw new UnauthorizedException(); +} +``` + +## Logging in Guards + +### Structured Logging +```typescript +const logger = new Logger('GUARD'); + +async function loggedGuard(req: Request, _: Response, next: NextFunction) { + logger.log(`Guard validation started for ${req.originalUrl}`); + + try { + // Guard logic + const isValid = await validateRequest(req); + + if (isValid) { + logger.log(`Guard validation successful for ${req.params.instanceName}`); + return next(); + } + + logger.warn(`Guard validation failed for ${req.params.instanceName}`); + throw new UnauthorizedException(); + } catch (error) { + logger.error(`Guard validation error: ${error.message}`, error.stack); + throw error; + } +} +``` + +## Guard Testing Pattern + +### Unit Test Structure +```typescript +describe('authGuard', () => { + let req: Partial; + let res: Partial; + let next: NextFunction; + + beforeEach(() => { + req = { + get: jest.fn(), + params: {}, + originalUrl: '/test', + }; + res = {}; + next = jest.fn(); + }); + + describe('apikey', () => { + it('should pass with valid global API key', async () => { + (req.get as jest.Mock).mockReturnValue('valid-global-key'); + + await authGuard.apikey(req as Request, res as Response, next); + + expect(next).toHaveBeenCalled(); + }); + + it('should throw UnauthorizedException with no API key', async () => { + (req.get as jest.Mock).mockReturnValue(undefined); + + await expect( + authGuard.apikey(req as Request, res as Response, next) + ).rejects.toThrow(UnauthorizedException); + }); + + it('should pass with valid instance token', async () => { + (req.get as jest.Mock).mockReturnValue('instance-token'); + req.params = { instanceName: 'test-instance' }; + + // Mock prisma repository + jest.spyOn(prismaRepository.instance, 'findUnique').mockResolvedValue({ + token: 'instance-token', + } as any); + + await authGuard.apikey(req as Request, res as Response, next); + + expect(next).toHaveBeenCalled(); + }); + }); +}); +``` + +## Guard Performance Considerations + +### Efficient Validation +```typescript +// CORRECT - Efficient guard with early returns +async function efficientGuard(req: Request, _: Response, next: NextFunction) { + // Quick checks first + if (req.originalUrl.includes('/public')) { + return next(); // Skip validation for public routes + } + + const apiKey = req.get('apikey'); + if (!apiKey) { + throw new UnauthorizedException(); // Fail fast + } + + // More expensive checks only if needed + if (apiKey === globalKey) { + return next(); // Skip database check + } + + // Database check only as last resort + const isValid = await validateInDatabase(apiKey); + if (isValid) { + return next(); + } + + throw new UnauthorizedException(); +} + +// INCORRECT - Inefficient guard +async function inefficientGuard(req: Request, _: Response, next: NextFunction) { + // Always do expensive database check first + const dbResult = await expensiveDatabaseQuery(); // ❌ Expensive operation first + + const apiKey = req.get('apikey'); + if (!apiKey && dbResult) { // ❌ Complex logic + throw new UnauthorizedException(); + } + + next(); +} +``` \ No newline at end of file diff --git a/.cursor/rules/specialized-rules/integration-channel-rules.mdc b/.cursor/rules/specialized-rules/integration-channel-rules.mdc new file mode 100644 index 000000000..d2b94d965 --- /dev/null +++ b/.cursor/rules/specialized-rules/integration-channel-rules.mdc @@ -0,0 +1,552 @@ +--- +description: Channel integration patterns for Evolution API +globs: + - "src/api/integrations/channel/**/*.ts" +alwaysApply: false +--- + +# Evolution API Channel Integration Rules + +## Channel Controller Pattern + +### Base Channel Controller +```typescript +export interface ChannelControllerInterface { + integrationEnabled: boolean; +} + +export class ChannelController { + public prismaRepository: PrismaRepository; + public waMonitor: WAMonitoringService; + + constructor(prismaRepository: PrismaRepository, waMonitor: WAMonitoringService) { + this.prisma = prismaRepository; + this.monitor = waMonitor; + } + + public set prisma(prisma: PrismaRepository) { + this.prismaRepository = prisma; + } + + public get prisma() { + return this.prismaRepository; + } + + public set monitor(waMonitor: WAMonitoringService) { + this.waMonitor = waMonitor; + } + + public get monitor() { + return this.waMonitor; + } + + public init(instanceData: InstanceDto, data: ChannelDataType) { + if (!instanceData.token && instanceData.integration === Integration.WHATSAPP_BUSINESS) { + throw new BadRequestException('token is required'); + } + + if (instanceData.integration === Integration.WHATSAPP_BUSINESS) { + return new BusinessStartupService(/* dependencies */); + } + + if (instanceData.integration === Integration.EVOLUTION) { + return new EvolutionStartupService(/* dependencies */); + } + + if (instanceData.integration === Integration.WHATSAPP_BAILEYS) { + return new BaileysStartupService(/* dependencies */); + } + + return null; + } +} +``` + +### Extended Channel Controller +```typescript +export class EvolutionController extends ChannelController implements ChannelControllerInterface { + private readonly logger = new Logger('EvolutionController'); + + constructor(prismaRepository: PrismaRepository, waMonitor: WAMonitoringService) { + super(prismaRepository, waMonitor); + } + + integrationEnabled: boolean; + + public async receiveWebhook(data: any) { + const numberId = data.numberId; + + if (!numberId) { + this.logger.error('WebhookService -> receiveWebhookEvolution -> numberId not found'); + return; + } + + const instance = await this.prismaRepository.instance.findFirst({ + where: { number: numberId }, + }); + + if (!instance) { + this.logger.error('WebhookService -> receiveWebhook -> instance not found'); + return; + } + + await this.waMonitor.waInstances[instance.name].connectToWhatsapp(data); + + return { + status: 'success', + }; + } +} +``` + +## Channel Service Pattern + +### Base Channel Service +```typescript +export class ChannelStartupService { + constructor( + private readonly configService: ConfigService, + private readonly eventEmitter: EventEmitter2, + private readonly prismaRepository: PrismaRepository, + public readonly cache: CacheService, + public readonly chatwootCache: CacheService, + ) {} + + public readonly logger = new Logger('ChannelStartupService'); + + public client: WASocket; + public readonly instance: wa.Instance = {}; + public readonly localChatwoot: wa.LocalChatwoot = {}; + public readonly localProxy: wa.LocalProxy = {}; + public readonly localSettings: wa.LocalSettings = {}; + public readonly localWebhook: wa.LocalWebHook = {}; + + public setInstance(instance: InstanceDto) { + this.logger.setInstance(instance.instanceName); + + this.instance.name = instance.instanceName; + this.instance.id = instance.instanceId; + this.instance.integration = instance.integration; + this.instance.number = instance.number; + this.instance.token = instance.token; + this.instance.businessId = instance.businessId; + + if (this.configService.get('CHATWOOT').ENABLED && this.localChatwoot?.enabled) { + this.chatwootService.eventWhatsapp( + Events.STATUS_INSTANCE, + { instanceName: this.instance.name }, + { + instance: this.instance.name, + status: 'created', + }, + ); + } + } + + public set instanceName(name: string) { + this.logger.setInstance(name); + this.instance.name = name; + } + + public get instanceName() { + return this.instance.name; + } +} +``` + +### Extended Channel Service +```typescript +export class EvolutionStartupService extends ChannelStartupService { + constructor( + configService: ConfigService, + eventEmitter: EventEmitter2, + prismaRepository: PrismaRepository, + cache: CacheService, + chatwootCache: CacheService, + ) { + super(configService, eventEmitter, prismaRepository, cache, chatwootCache); + } + + public async sendMessage(data: SendTextDto): Promise { + // Evolution-specific message sending logic + const response = await this.evolutionApiCall('/send-message', data); + return response; + } + + public async connectToWhatsapp(data: any): Promise { + // Evolution-specific connection logic + this.logger.log('Connecting to Evolution API'); + + // Set up webhook listeners + this.setupWebhookHandlers(); + + // Initialize connection + await this.initializeConnection(data); + } + + private async evolutionApiCall(endpoint: string, data: any): Promise { + const config = this.configService.get('EVOLUTION'); + + try { + const response = await axios.post(`${config.API_URL}${endpoint}`, data, { + headers: { + 'Authorization': `Bearer ${this.instance.token}`, + 'Content-Type': 'application/json', + }, + }); + + return response.data; + } catch (error) { + this.logger.error(`Evolution API call failed: ${error.message}`); + throw new InternalServerErrorException('Evolution API call failed'); + } + } + + private setupWebhookHandlers(): void { + // Set up webhook event handlers + } + + private async initializeConnection(data: any): Promise { + // Initialize connection with Evolution API + } +} +``` + +## Business API Service Pattern + +### Meta Business Service +```typescript +export class BusinessStartupService extends ChannelStartupService { + constructor( + configService: ConfigService, + eventEmitter: EventEmitter2, + prismaRepository: PrismaRepository, + cache: CacheService, + chatwootCache: CacheService, + baileysCache: CacheService, + providerFiles: ProviderFiles, + ) { + super(configService, eventEmitter, prismaRepository, cache, chatwootCache); + } + + public async sendMessage(data: SendTextDto): Promise { + const businessConfig = this.configService.get('WA_BUSINESS'); + + const payload = { + messaging_product: 'whatsapp', + to: data.number, + type: 'text', + text: { + body: data.text, + }, + }; + + try { + const response = await axios.post( + `${businessConfig.URL}/${businessConfig.VERSION}/${this.instance.businessId}/messages`, + payload, + { + headers: { + 'Authorization': `Bearer ${this.instance.token}`, + 'Content-Type': 'application/json', + }, + } + ); + + return response.data; + } catch (error) { + this.logger.error(`Business API call failed: ${error.message}`); + throw new BadRequestException('Failed to send message via Business API'); + } + } + + public async receiveWebhook(data: any): Promise { + // Process incoming webhook from Meta Business API + const { entry } = data; + + for (const entryItem of entry) { + const { changes } = entryItem; + + for (const change of changes) { + if (change.field === 'messages') { + await this.processMessage(change.value); + } + } + } + } + + private async processMessage(messageData: any): Promise { + // Process incoming message from Business API + const { messages, contacts } = messageData; + + if (messages) { + for (const message of messages) { + await this.handleIncomingMessage(message, contacts); + } + } + } + + private async handleIncomingMessage(message: any, contacts: any[]): Promise { + // Handle individual message + const contact = contacts?.find(c => c.wa_id === message.from); + + // Emit event for message processing + this.eventEmitter.emit(Events.MESSAGES_UPSERT, { + instanceName: this.instance.name, + message, + contact, + }); + } +} +``` + +## Baileys Service Pattern + +### Baileys Integration Service +```typescript +export class BaileysStartupService extends ChannelStartupService { + constructor( + configService: ConfigService, + eventEmitter: EventEmitter2, + prismaRepository: PrismaRepository, + cache: CacheService, + chatwootCache: CacheService, + baileysCache: CacheService, + providerFiles: ProviderFiles, + ) { + super(configService, eventEmitter, prismaRepository, cache, chatwootCache); + } + + public async connectToWhatsapp(): Promise { + const authPath = path.join(INSTANCE_DIR, this.instance.name); + const { state, saveCreds } = await useMultiFileAuthState(authPath); + + this.client = makeWASocket({ + auth: state, + logger: P({ level: 'error' }), + printQRInTerminal: false, + browser: ['Evolution API', 'Chrome', '4.0.0'], + defaultQueryTimeoutMs: 60000, + }); + + this.setupEventHandlers(); + this.client.ev.on('creds.update', saveCreds); + } + + private setupEventHandlers(): void { + this.client.ev.on('connection.update', (update) => { + this.handleConnectionUpdate(update); + }); + + this.client.ev.on('messages.upsert', ({ messages, type }) => { + this.handleIncomingMessages(messages, type); + }); + + this.client.ev.on('messages.update', (updates) => { + this.handleMessageUpdates(updates); + }); + + this.client.ev.on('contacts.upsert', (contacts) => { + this.handleContactsUpdate(contacts); + }); + + this.client.ev.on('chats.upsert', (chats) => { + this.handleChatsUpdate(chats); + }); + } + + private async handleConnectionUpdate(update: ConnectionUpdate): Promise { + const { connection, lastDisconnect, qr } = update; + + if (qr) { + this.instance.qrcode = { + count: this.instance.qrcode?.count ? this.instance.qrcode.count + 1 : 1, + base64: qr, + }; + + this.eventEmitter.emit(Events.QRCODE_UPDATED, { + instanceName: this.instance.name, + qrcode: this.instance.qrcode, + }); + } + + if (connection === 'close') { + const shouldReconnect = (lastDisconnect?.error as Boom)?.output?.statusCode !== DisconnectReason.loggedOut; + + if (shouldReconnect) { + this.logger.log('Connection closed, reconnecting...'); + await this.connectToWhatsapp(); + } else { + this.logger.log('Connection closed, logged out'); + this.eventEmitter.emit(Events.LOGOUT_INSTANCE, { + instanceName: this.instance.name, + }); + } + } + + if (connection === 'open') { + this.logger.log('Connection opened successfully'); + this.instance.wuid = this.client.user?.id; + + this.eventEmitter.emit(Events.CONNECTION_UPDATE, { + instanceName: this.instance.name, + state: 'open', + }); + } + } + + public async sendMessage(data: SendTextDto): Promise { + const jid = createJid(data.number); + + const message = { + text: data.text, + }; + + if (data.linkPreview !== undefined) { + message.linkPreview = data.linkPreview; + } + + if (data.mentionsEveryOne) { + // Handle mentions + } + + try { + const response = await this.client.sendMessage(jid, message); + return response; + } catch (error) { + this.logger.error(`Failed to send message: ${error.message}`); + throw new BadRequestException('Failed to send message'); + } + } +} +``` + +## Channel Router Pattern + +### Channel Router Structure +```typescript +export class ChannelRouter { + public readonly router: Router; + + constructor(configService: any, ...guards: any[]) { + this.router = Router(); + + this.router.use('/', new EvolutionRouter(configService).router); + this.router.use('/', new MetaRouter(configService).router); + this.router.use('/baileys', new BaileysRouter(...guards).router); + } +} +``` + +### Specific Channel Router +```typescript +export class EvolutionRouter extends RouterBroker { + constructor(private readonly configService: ConfigService) { + super(); + this.router + .post(this.routerPath('webhook'), async (req, res) => { + const response = await evolutionController.receiveWebhook(req.body); + return res.status(HttpStatus.OK).json(response); + }); + } + + public readonly router: Router = Router(); +} +``` + +## Integration Types + +### Channel Data Types +```typescript +type ChannelDataType = { + configService: ConfigService; + eventEmitter: EventEmitter2; + prismaRepository: PrismaRepository; + cache: CacheService; + chatwootCache: CacheService; + baileysCache: CacheService; + providerFiles: ProviderFiles; +}; + +export enum Integration { + WHATSAPP_BUSINESS = 'WHATSAPP-BUSINESS', + WHATSAPP_BAILEYS = 'WHATSAPP-BAILEYS', + EVOLUTION = 'EVOLUTION', +} +``` + +## Error Handling in Channels + +### Channel-Specific Error Handling +```typescript +// CORRECT - Channel-specific error handling +public async sendMessage(data: SendTextDto): Promise { + try { + const response = await this.channelSpecificSend(data); + return response; + } catch (error) { + this.logger.error(`${this.constructor.name} send failed: ${error.message}`); + + if (error.response?.status === 401) { + throw new UnauthorizedException('Invalid token for channel'); + } + + if (error.response?.status === 429) { + throw new BadRequestException('Rate limit exceeded'); + } + + throw new InternalServerErrorException('Channel communication failed'); + } +} +``` + +## Channel Testing Pattern + +### Channel Service Testing +```typescript +describe('EvolutionStartupService', () => { + let service: EvolutionStartupService; + let configService: jest.Mocked; + let eventEmitter: jest.Mocked; + + beforeEach(() => { + const mockConfig = { + get: jest.fn().mockReturnValue({ + API_URL: 'https://api.evolution.com', + }), + }; + + service = new EvolutionStartupService( + mockConfig as any, + eventEmitter, + prismaRepository, + cache, + chatwootCache, + ); + }); + + describe('sendMessage', () => { + it('should send message successfully', async () => { + const data = { number: '5511999999999', text: 'Test message' }; + + // Mock axios response + jest.spyOn(axios, 'post').mockResolvedValue({ + data: { success: true, messageId: '123' }, + }); + + const result = await service.sendMessage(data); + + expect(result.success).toBe(true); + expect(axios.post).toHaveBeenCalledWith( + expect.stringContaining('/send-message'), + data, + expect.objectContaining({ + headers: expect.objectContaining({ + 'Authorization': expect.stringContaining('Bearer'), + }), + }) + ); + }); + }); +}); +``` \ No newline at end of file diff --git a/.cursor/rules/specialized-rules/integration-chatbot-rules.mdc b/.cursor/rules/specialized-rules/integration-chatbot-rules.mdc new file mode 100644 index 000000000..ff511754a --- /dev/null +++ b/.cursor/rules/specialized-rules/integration-chatbot-rules.mdc @@ -0,0 +1,597 @@ +--- +description: Chatbot integration patterns for Evolution API +globs: + - "src/api/integrations/chatbot/**/*.ts" +alwaysApply: false +--- + +# Evolution API Chatbot Integration Rules + +## Base Chatbot Pattern + +### Base Chatbot DTO +```typescript +/** + * Base DTO for all chatbot integrations + * Contains common properties shared by all chatbot types + */ +export class BaseChatbotDto { + enabled?: boolean; + description: string; + expire?: number; + keywordFinish?: string; + delayMessage?: number; + unknownMessage?: string; + listeningFromMe?: boolean; + stopBotFromMe?: boolean; + keepOpen?: boolean; + debounceTime?: number; + triggerType: TriggerType; + triggerOperator?: TriggerOperator; + triggerValue?: string; + ignoreJids?: string[]; + splitMessages?: boolean; + timePerChar?: number; +} +``` + +### Base Chatbot Controller +```typescript +export abstract class BaseChatbotController + extends ChatbotController + implements ChatbotControllerInterface +{ + public readonly logger: Logger; + integrationEnabled: boolean; + botRepository: any; + settingsRepository: any; + sessionRepository: any; + userMessageDebounce: { [key: string]: { message: string; timeoutId: NodeJS.Timeout } } = {}; + + // Abstract methods to be implemented by specific chatbots + protected abstract readonly integrationName: string; + protected abstract processBot( + waInstance: any, + remoteJid: string, + bot: BotType, + session: any, + settings: ChatbotSettings, + content: string, + pushName?: string, + msg?: any, + ): Promise; + protected abstract getFallbackBotId(settings: any): string | undefined; + + constructor(prismaRepository: PrismaRepository, waMonitor: WAMonitoringService) { + super(prismaRepository, waMonitor); + this.sessionRepository = this.prismaRepository.integrationSession; + } + + // Base implementation methods + public async createBot(instance: InstanceDto, data: BotData) { + if (!data.enabled) { + throw new BadRequestException(`${this.integrationName} is disabled`); + } + + // Common bot creation logic + const bot = await this.botRepository.create({ + data: { + ...data, + instanceId: instance.instanceId, + }, + }); + + return bot; + } +} +``` + +### Base Chatbot Service +```typescript +/** + * Base class for all chatbot service implementations + * Contains common methods shared across different chatbot integrations + */ +export abstract class BaseChatbotService { + protected readonly logger: Logger; + protected readonly waMonitor: WAMonitoringService; + protected readonly prismaRepository: PrismaRepository; + protected readonly configService?: ConfigService; + + constructor( + waMonitor: WAMonitoringService, + prismaRepository: PrismaRepository, + loggerName: string, + configService?: ConfigService, + ) { + this.waMonitor = waMonitor; + this.prismaRepository = prismaRepository; + this.logger = new Logger(loggerName); + this.configService = configService; + } + + /** + * Check if a message contains an image + */ + protected isImageMessage(content: string): boolean { + return content.includes('imageMessage'); + } + + /** + * Extract text content from message + */ + protected getMessageContent(msg: any): string { + return getConversationMessage(msg); + } + + /** + * Send typing indicator + */ + protected async sendTyping(instanceName: string, remoteJid: string): Promise { + await this.waMonitor.waInstances[instanceName].sendPresence(remoteJid, 'composing'); + } +} +``` + +## Typebot Integration Pattern + +### Typebot Service +```typescript +export class TypebotService extends BaseChatbotService { + constructor( + waMonitor: WAMonitoringService, + configService: ConfigService, + prismaRepository: PrismaRepository, + private readonly openaiService: OpenaiService, + ) { + super(waMonitor, prismaRepository, 'TypebotService', configService); + } + + public async sendTypebotMessage( + instanceName: string, + remoteJid: string, + typebot: TypebotModel, + content: string, + ): Promise { + try { + const response = await axios.post( + `${typebot.url}/api/v1/typebots/${typebot.typebot}/startChat`, + { + message: content, + sessionId: `${instanceName}-${remoteJid}`, + }, + { + headers: { + 'Content-Type': 'application/json', + }, + } + ); + + const { messages } = response.data; + + for (const message of messages) { + await this.processTypebotMessage(instanceName, remoteJid, message); + } + } catch (error) { + this.logger.error(`Typebot API error: ${error.message}`); + throw new InternalServerErrorException('Typebot communication failed'); + } + } + + private async processTypebotMessage( + instanceName: string, + remoteJid: string, + message: any, + ): Promise { + const waInstance = this.waMonitor.waInstances[instanceName]; + + if (message.type === 'text') { + await waInstance.sendMessage({ + number: remoteJid.split('@')[0], + text: message.content.richText[0].children[0].text, + }); + } + + if (message.type === 'image') { + await waInstance.sendMessage({ + number: remoteJid.split('@')[0], + mediaMessage: { + mediatype: 'image', + media: message.content.url, + }, + }); + } + } +} +``` + +## OpenAI Integration Pattern + +### OpenAI Service +```typescript +export class OpenaiService extends BaseChatbotService { + constructor( + waMonitor: WAMonitoringService, + prismaRepository: PrismaRepository, + configService: ConfigService, + ) { + super(waMonitor, prismaRepository, 'OpenaiService', configService); + } + + public async sendOpenaiMessage( + instanceName: string, + remoteJid: string, + openai: OpenaiModel, + content: string, + pushName?: string, + ): Promise { + try { + const openaiConfig = this.configService.get('OPENAI'); + + const response = await axios.post( + 'https://api.openai.com/v1/chat/completions', + { + model: openai.model || 'gpt-3.5-turbo', + messages: [ + { + role: 'system', + content: openai.systemMessage || 'You are a helpful assistant.', + }, + { + role: 'user', + content: content, + }, + ], + max_tokens: openai.maxTokens || 1000, + temperature: openai.temperature || 0.7, + }, + { + headers: { + 'Authorization': `Bearer ${openai.apiKey || openaiConfig.API_KEY}`, + 'Content-Type': 'application/json', + }, + } + ); + + const aiResponse = response.data.choices[0].message.content; + + await this.waMonitor.waInstances[instanceName].sendMessage({ + number: remoteJid.split('@')[0], + text: aiResponse, + }); + } catch (error) { + this.logger.error(`OpenAI API error: ${error.message}`); + + // Send fallback message + await this.waMonitor.waInstances[instanceName].sendMessage({ + number: remoteJid.split('@')[0], + text: openai.unknownMessage || 'Desculpe, não consegui processar sua mensagem.', + }); + } + } +} +``` + +## Chatwoot Integration Pattern + +### Chatwoot Service +```typescript +export class ChatwootService extends BaseChatbotService { + constructor( + waMonitor: WAMonitoringService, + configService: ConfigService, + prismaRepository: PrismaRepository, + private readonly chatwootCache: CacheService, + ) { + super(waMonitor, prismaRepository, 'ChatwootService', configService); + } + + public async eventWhatsapp( + event: Events, + instanceName: { instanceName: string }, + data: any, + ): Promise { + const chatwootConfig = this.configService.get('CHATWOOT'); + + if (!chatwootConfig.ENABLED) { + return; + } + + try { + const instance = await this.prismaRepository.instance.findUnique({ + where: { name: instanceName.instanceName }, + }); + + if (!instance?.chatwootAccountId) { + return; + } + + const webhook = { + event, + instance: instanceName.instanceName, + data, + timestamp: new Date().toISOString(), + }; + + await axios.post( + `${instance.chatwootUrl}/api/v1/accounts/${instance.chatwootAccountId}/webhooks`, + webhook, + { + headers: { + 'Authorization': `Bearer ${instance.chatwootToken}`, + 'Content-Type': 'application/json', + }, + } + ); + } catch (error) { + this.logger.error(`Chatwoot webhook error: ${error.message}`); + } + } + + public async createConversation( + instanceName: string, + contact: any, + message: any, + ): Promise { + // Create conversation in Chatwoot + const instance = await this.prismaRepository.instance.findUnique({ + where: { name: instanceName }, + }); + + if (!instance?.chatwootAccountId) { + return; + } + + try { + const conversation = await axios.post( + `${instance.chatwootUrl}/api/v1/accounts/${instance.chatwootAccountId}/conversations`, + { + source_id: contact.id, + inbox_id: instance.chatwootInboxId, + contact_id: contact.chatwootContactId, + }, + { + headers: { + 'Authorization': `Bearer ${instance.chatwootToken}`, + 'Content-Type': 'application/json', + }, + } + ); + + // Cache conversation + await this.chatwootCache.set( + `conversation:${instanceName}:${contact.id}`, + conversation.data, + 3600 + ); + } catch (error) { + this.logger.error(`Chatwoot conversation creation error: ${error.message}`); + } + } +} +``` + +## Dify Integration Pattern + +### Dify Service +```typescript +export class DifyService extends BaseChatbotService { + constructor( + waMonitor: WAMonitoringService, + prismaRepository: PrismaRepository, + configService: ConfigService, + private readonly openaiService: OpenaiService, + ) { + super(waMonitor, prismaRepository, 'DifyService', configService); + } + + public async sendDifyMessage( + instanceName: string, + remoteJid: string, + dify: DifyModel, + content: string, + ): Promise { + try { + const response = await axios.post( + `${dify.apiUrl}/v1/chat-messages`, + { + inputs: {}, + query: content, + user: remoteJid, + conversation_id: `${instanceName}-${remoteJid}`, + response_mode: 'blocking', + }, + { + headers: { + 'Authorization': `Bearer ${dify.apiKey}`, + 'Content-Type': 'application/json', + }, + } + ); + + const aiResponse = response.data.answer; + + await this.waMonitor.waInstances[instanceName].sendMessage({ + number: remoteJid.split('@')[0], + text: aiResponse, + }); + } catch (error) { + this.logger.error(`Dify API error: ${error.message}`); + + // Fallback to OpenAI if configured + if (dify.fallbackOpenai && this.openaiService) { + await this.openaiService.sendOpenaiMessage(instanceName, remoteJid, dify.openaiBot, content); + } + } + } +} +``` + +## Chatbot Router Pattern + +### Chatbot Router Structure (Evolution API Real Pattern) +```typescript +export class ChatbotRouter { + public readonly router: Router; + + constructor(...guards: any[]) { + this.router = Router(); + + // Real Evolution API chatbot integrations + this.router.use('/evolutionBot', new EvolutionBotRouter(...guards).router); + this.router.use('/chatwoot', new ChatwootRouter(...guards).router); + this.router.use('/typebot', new TypebotRouter(...guards).router); + this.router.use('/openai', new OpenaiRouter(...guards).router); + this.router.use('/dify', new DifyRouter(...guards).router); + this.router.use('/flowise', new FlowiseRouter(...guards).router); + this.router.use('/n8n', new N8nRouter(...guards).router); + this.router.use('/evoai', new EvoaiRouter(...guards).router); + } +} +``` + +## Chatbot Validation Patterns + +### Chatbot Schema Validation (Evolution API Pattern) +```typescript +import { JSONSchema7 } from 'json-schema'; +import { v4 } from 'uuid'; + +const isNotEmpty = (...fields: string[]) => { + const properties = {}; + fields.forEach((field) => { + properties[field] = { + if: { properties: { [field]: { type: 'string' } } }, + then: { properties: { [field]: { minLength: 1 } } }, + }; + }); + + return { + allOf: Object.values(properties), + }; +}; + +export const evolutionBotSchema: JSONSchema7 = { + $id: v4(), + type: 'object', + properties: { + enabled: { type: 'boolean' }, + description: { type: 'string' }, + apiUrl: { type: 'string' }, + apiKey: { type: 'string' }, + triggerType: { type: 'string', enum: ['all', 'keyword', 'none', 'advanced'] }, + triggerOperator: { type: 'string', enum: ['equals', 'contains', 'startsWith', 'endsWith', 'regex'] }, + triggerValue: { type: 'string' }, + expire: { type: 'integer' }, + keywordFinish: { type: 'string' }, + delayMessage: { type: 'integer' }, + unknownMessage: { type: 'string' }, + listeningFromMe: { type: 'boolean' }, + stopBotFromMe: { type: 'boolean' }, + keepOpen: { type: 'boolean' }, + debounceTime: { type: 'integer' }, + ignoreJids: { type: 'array', items: { type: 'string' } }, + splitMessages: { type: 'boolean' }, + timePerChar: { type: 'integer' }, + }, + required: ['enabled', 'apiUrl', 'triggerType'], + ...isNotEmpty('enabled', 'apiUrl', 'triggerType'), +}; + +function validateKeywordTrigger( + content: string, + operator: TriggerOperator, + value: string, +): boolean { + const normalizedContent = content.toLowerCase().trim(); + const normalizedValue = value.toLowerCase().trim(); + + switch (operator) { + case TriggerOperator.EQUALS: + return normalizedContent === normalizedValue; + case TriggerOperator.CONTAINS: + return normalizedContent.includes(normalizedValue); + case TriggerOperator.STARTS_WITH: + return normalizedContent.startsWith(normalizedValue); + case TriggerOperator.ENDS_WITH: + return normalizedContent.endsWith(normalizedValue); + default: + return false; + } +} +``` + +## Session Management Pattern + +### Chatbot Session Handling +```typescript +export class ChatbotSessionManager { + constructor( + private readonly prismaRepository: PrismaRepository, + private readonly cache: CacheService, + ) {} + + public async getSession( + instanceName: string, + remoteJid: string, + botId: string, + ): Promise { + const cacheKey = `session:${instanceName}:${remoteJid}:${botId}`; + + // Try cache first + let session = await this.cache.get(cacheKey); + if (session) { + return session; + } + + // Query database + session = await this.prismaRepository.integrationSession.findFirst({ + where: { + instanceId: instanceName, + remoteJid, + botId, + status: 'opened', + }, + }); + + // Cache result + if (session) { + await this.cache.set(cacheKey, session, 300); // 5 min TTL + } + + return session; + } + + public async createSession( + instanceName: string, + remoteJid: string, + botId: string, + ): Promise { + const session = await this.prismaRepository.integrationSession.create({ + data: { + instanceId: instanceName, + remoteJid, + botId, + status: 'opened', + createdAt: new Date(), + }, + }); + + // Cache new session + const cacheKey = `session:${instanceName}:${remoteJid}:${botId}`; + await this.cache.set(cacheKey, session, 300); + + return session; + } + + public async closeSession(sessionId: string): Promise { + await this.prismaRepository.integrationSession.update({ + where: { id: sessionId }, + data: { status: 'closed', updatedAt: new Date() }, + }); + + // Invalidate cache + // Note: In a real implementation, you'd need to track cache keys by session ID + } +} +``` \ No newline at end of file diff --git a/.cursor/rules/specialized-rules/integration-event-rules.mdc b/.cursor/rules/specialized-rules/integration-event-rules.mdc new file mode 100644 index 000000000..2687d72f0 --- /dev/null +++ b/.cursor/rules/specialized-rules/integration-event-rules.mdc @@ -0,0 +1,851 @@ +--- +description: Event integration patterns for Evolution API +globs: + - "src/api/integrations/event/**/*.ts" +alwaysApply: false +--- + +# Evolution API Event Integration Rules + +## Event Manager Pattern + +### Event Manager Structure +```typescript +import { PrismaRepository } from '@api/repository/repository.service'; +import { ConfigService } from '@config/env.config'; +import { Logger } from '@config/logger.config'; +import { Server } from 'http'; + +export class EventManager { + private prismaRepository: PrismaRepository; + private configService: ConfigService; + private logger = new Logger('EventManager'); + + // Event integrations + private webhook: WebhookController; + private websocket: WebsocketController; + private rabbitmq: RabbitmqController; + private nats: NatsController; + private sqs: SqsController; + private pusher: PusherController; + + constructor( + prismaRepository: PrismaRepository, + configService: ConfigService, + server?: Server, + ) { + this.prismaRepository = prismaRepository; + this.configService = configService; + + // Initialize event controllers + this.webhook = new WebhookController(prismaRepository, configService); + this.websocket = new WebsocketController(prismaRepository, configService, server); + this.rabbitmq = new RabbitmqController(prismaRepository, configService); + this.nats = new NatsController(prismaRepository, configService); + this.sqs = new SqsController(prismaRepository, configService); + this.pusher = new PusherController(prismaRepository, configService); + } + + public async emit(eventData: { + instanceName: string; + origin: string; + event: string; + data: Object; + serverUrl: string; + dateTime: string; + sender: string; + apiKey?: string; + local?: boolean; + integration?: string[]; + }): Promise { + this.logger.log(`Emitting event ${eventData.event} for instance ${eventData.instanceName}`); + + // Emit to all configured integrations + await Promise.allSettled([ + this.webhook.emit(eventData), + this.websocket.emit(eventData), + this.rabbitmq.emit(eventData), + this.nats.emit(eventData), + this.sqs.emit(eventData), + this.pusher.emit(eventData), + ]); + } + + public async setInstance(instanceName: string, data: any): Promise { + const promises = []; + + if (data.websocket) { + promises.push( + this.websocket.set(instanceName, { + websocket: { + enabled: true, + events: data.websocket?.events, + }, + }) + ); + } + + if (data.rabbitmq) { + promises.push( + this.rabbitmq.set(instanceName, { + rabbitmq: { + enabled: true, + events: data.rabbitmq?.events, + }, + }) + ); + } + + if (data.webhook) { + promises.push( + this.webhook.set(instanceName, { + webhook: { + enabled: true, + events: data.webhook?.events, + url: data.webhook?.url, + headers: data.webhook?.headers, + base64: data.webhook?.base64, + byEvents: data.webhook?.byEvents, + }, + }) + ); + } + + // Set other integrations... + + await Promise.allSettled(promises); + } +} +``` + +## Base Event Controller Pattern + +### Abstract Event Controller +```typescript +import { PrismaRepository } from '@api/repository/repository.service'; +import { ConfigService } from '@config/env.config'; +import { Logger } from '@config/logger.config'; + +export type EmitData = { + instanceName: string; + origin: string; + event: string; + data: Object; + serverUrl: string; + dateTime: string; + sender: string; + apiKey?: string; + local?: boolean; + integration?: string[]; +}; + +export interface EventControllerInterface { + integrationEnabled: boolean; + emit(data: EmitData): Promise; + set(instanceName: string, data: any): Promise; +} + +export abstract class EventController implements EventControllerInterface { + protected readonly logger: Logger; + protected readonly prismaRepository: PrismaRepository; + protected readonly configService: ConfigService; + + public integrationEnabled: boolean = false; + + // Available events for all integrations + public static readonly events = [ + 'APPLICATION_STARTUP', + 'INSTANCE_CREATE', + 'INSTANCE_DELETE', + 'QRCODE_UPDATED', + 'CONNECTION_UPDATE', + 'STATUS_INSTANCE', + 'MESSAGES_SET', + 'MESSAGES_UPSERT', + 'MESSAGES_EDITED', + 'MESSAGES_UPDATE', + 'MESSAGES_DELETE', + 'SEND_MESSAGE', + 'CONTACTS_SET', + 'CONTACTS_UPSERT', + 'CONTACTS_UPDATE', + 'PRESENCE_UPDATE', + 'CHATS_SET', + 'CHATS_UPDATE', + 'CHATS_UPSERT', + 'CHATS_DELETE', + 'GROUPS_UPSERT', + 'GROUPS_UPDATE', + 'GROUP_PARTICIPANTS_UPDATE', + 'CALL', + 'TYPEBOT_START', + 'TYPEBOT_CHANGE_STATUS', + 'LABELS_EDIT', + 'LABELS_ASSOCIATION', + 'CREDS_UPDATE', + 'MESSAGING_HISTORY_SET', + 'REMOVE_INSTANCE', + 'LOGOUT_INSTANCE', + ]; + + constructor( + prismaRepository: PrismaRepository, + configService: ConfigService, + loggerName: string, + ) { + this.prismaRepository = prismaRepository; + this.configService = configService; + this.logger = new Logger(loggerName); + } + + // Abstract methods to be implemented by specific integrations + public abstract emit(data: EmitData): Promise; + public abstract set(instanceName: string, data: any): Promise; + + // Helper method to check if event should be processed + protected shouldProcessEvent(eventName: string, configuredEvents?: string[]): boolean { + if (!configuredEvents || configuredEvents.length === 0) { + return true; // Process all events if none specified + } + return configuredEvents.includes(eventName); + } + + // Helper method to get instance configuration + protected async getInstanceConfig(instanceName: string): Promise { + try { + const instance = await this.prismaRepository.instance.findUnique({ + where: { name: instanceName }, + }); + return instance; + } catch (error) { + this.logger.error(`Failed to get instance config for ${instanceName}:`, error); + return null; + } + } +} +``` + +## Webhook Integration Pattern + +### Webhook Controller Implementation +```typescript +export class WebhookController extends EventController { + constructor( + prismaRepository: PrismaRepository, + configService: ConfigService, + ) { + super(prismaRepository, configService, 'WebhookController'); + } + + public async emit(data: EmitData): Promise { + try { + const instance = await this.getInstanceConfig(data.instanceName); + if (!instance?.webhook?.enabled) { + return; + } + + const webhookConfig = instance.webhook; + + if (!this.shouldProcessEvent(data.event, webhookConfig.events)) { + return; + } + + const payload = { + event: data.event, + instance: data.instanceName, + data: data.data, + timestamp: data.dateTime, + sender: data.sender, + server: { + version: process.env.npm_package_version, + url: data.serverUrl, + }, + }; + + // Encode data as base64 if configured + if (webhookConfig.base64) { + payload.data = Buffer.from(JSON.stringify(payload.data)).toString('base64'); + } + + const headers = { + 'Content-Type': 'application/json', + 'User-Agent': 'Evolution-API-Webhook', + ...webhookConfig.headers, + }; + + if (webhookConfig.byEvents) { + // Send to event-specific endpoint + const eventUrl = `${webhookConfig.url}/${data.event.toLowerCase()}`; + await this.sendWebhook(eventUrl, payload, headers); + } else { + // Send to main webhook URL + await this.sendWebhook(webhookConfig.url, payload, headers); + } + + this.logger.log(`Webhook sent for event ${data.event} to instance ${data.instanceName}`); + } catch (error) { + this.logger.error(`Webhook emission failed for ${data.instanceName}:`, error); + } + } + + public async set(instanceName: string, data: any): Promise { + try { + const webhookData = data.webhook; + + await this.prismaRepository.instance.update({ + where: { name: instanceName }, + data: { + webhook: webhookData, + }, + }); + + this.logger.log(`Webhook configuration set for instance ${instanceName}`); + return { webhook: webhookData }; + } catch (error) { + this.logger.error(`Failed to set webhook config for ${instanceName}:`, error); + throw error; + } + } + + private async sendWebhook(url: string, payload: any, headers: any): Promise { + try { + const response = await axios.post(url, payload, { + headers, + timeout: 30000, + maxRedirects: 3, + }); + + if (response.status >= 200 && response.status < 300) { + this.logger.log(`Webhook delivered successfully to ${url}`); + } else { + this.logger.warn(`Webhook returned status ${response.status} for ${url}`); + } + } catch (error) { + this.logger.error(`Webhook delivery failed to ${url}:`, error.message); + + // Implement retry logic here if needed + if (error.response?.status >= 500) { + // Server error - might be worth retrying + this.logger.log(`Server error detected, webhook might be retried later`); + } + } + } +} +``` + +## WebSocket Integration Pattern + +### WebSocket Controller Implementation +```typescript +import { Server as SocketIOServer } from 'socket.io'; +import { Server } from 'http'; + +export class WebsocketController extends EventController { + private io: SocketIOServer; + + constructor( + prismaRepository: PrismaRepository, + configService: ConfigService, + server?: Server, + ) { + super(prismaRepository, configService, 'WebsocketController'); + + if (server) { + this.io = new SocketIOServer(server, { + cors: { + origin: "*", + methods: ["GET", "POST"], + }, + }); + + this.setupSocketHandlers(); + } + } + + private setupSocketHandlers(): void { + this.io.on('connection', (socket) => { + this.logger.log(`WebSocket client connected: ${socket.id}`); + + socket.on('join-instance', (instanceName: string) => { + socket.join(`instance:${instanceName}`); + this.logger.log(`Client ${socket.id} joined instance ${instanceName}`); + }); + + socket.on('leave-instance', (instanceName: string) => { + socket.leave(`instance:${instanceName}`); + this.logger.log(`Client ${socket.id} left instance ${instanceName}`); + }); + + socket.on('disconnect', () => { + this.logger.log(`WebSocket client disconnected: ${socket.id}`); + }); + }); + } + + public async emit(data: EmitData): Promise { + if (!this.io) { + return; + } + + try { + const instance = await this.getInstanceConfig(data.instanceName); + if (!instance?.websocket?.enabled) { + return; + } + + const websocketConfig = instance.websocket; + + if (!this.shouldProcessEvent(data.event, websocketConfig.events)) { + return; + } + + const payload = { + event: data.event, + instance: data.instanceName, + data: data.data, + timestamp: data.dateTime, + sender: data.sender, + }; + + // Emit to specific instance room + this.io.to(`instance:${data.instanceName}`).emit('evolution-event', payload); + + // Also emit to global room for monitoring + this.io.emit('global-event', payload); + + this.logger.log(`WebSocket event ${data.event} emitted for instance ${data.instanceName}`); + } catch (error) { + this.logger.error(`WebSocket emission failed for ${data.instanceName}:`, error); + } + } + + public async set(instanceName: string, data: any): Promise { + try { + const websocketData = data.websocket; + + await this.prismaRepository.instance.update({ + where: { name: instanceName }, + data: { + websocket: websocketData, + }, + }); + + this.logger.log(`WebSocket configuration set for instance ${instanceName}`); + return { websocket: websocketData }; + } catch (error) { + this.logger.error(`Failed to set WebSocket config for ${instanceName}:`, error); + throw error; + } + } +} +``` + +## Queue Integration Patterns + +### RabbitMQ Controller Implementation +```typescript +import amqp from 'amqplib'; + +export class RabbitmqController extends EventController { + private connection: amqp.Connection | null = null; + private channel: amqp.Channel | null = null; + + constructor( + prismaRepository: PrismaRepository, + configService: ConfigService, + ) { + super(prismaRepository, configService, 'RabbitmqController'); + this.initializeConnection(); + } + + private async initializeConnection(): Promise { + try { + const rabbitmqConfig = this.configService.get('RABBITMQ'); + if (!rabbitmqConfig?.ENABLED) { + return; + } + + this.connection = await amqp.connect(rabbitmqConfig.URI); + this.channel = await this.connection.createChannel(); + + // Declare exchange for Evolution API events + await this.channel.assertExchange('evolution-events', 'topic', { durable: true }); + + this.logger.log('RabbitMQ connection established'); + } catch (error) { + this.logger.error('Failed to initialize RabbitMQ connection:', error); + } + } + + public async emit(data: EmitData): Promise { + if (!this.channel) { + return; + } + + try { + const instance = await this.getInstanceConfig(data.instanceName); + if (!instance?.rabbitmq?.enabled) { + return; + } + + const rabbitmqConfig = instance.rabbitmq; + + if (!this.shouldProcessEvent(data.event, rabbitmqConfig.events)) { + return; + } + + const payload = { + event: data.event, + instance: data.instanceName, + data: data.data, + timestamp: data.dateTime, + sender: data.sender, + }; + + const routingKey = `evolution.${data.instanceName}.${data.event.toLowerCase()}`; + + await this.channel.publish( + 'evolution-events', + routingKey, + Buffer.from(JSON.stringify(payload)), + { + persistent: true, + timestamp: Date.now(), + messageId: `${data.instanceName}-${Date.now()}`, + } + ); + + this.logger.log(`RabbitMQ message published for event ${data.event} to instance ${data.instanceName}`); + } catch (error) { + this.logger.error(`RabbitMQ emission failed for ${data.instanceName}:`, error); + } + } + + public async set(instanceName: string, data: any): Promise { + try { + const rabbitmqData = data.rabbitmq; + + await this.prismaRepository.instance.update({ + where: { name: instanceName }, + data: { + rabbitmq: rabbitmqData, + }, + }); + + this.logger.log(`RabbitMQ configuration set for instance ${instanceName}`); + return { rabbitmq: rabbitmqData }; + } catch (error) { + this.logger.error(`Failed to set RabbitMQ config for ${instanceName}:`, error); + throw error; + } + } +} +``` + +### SQS Controller Implementation +```typescript +import { SQSClient, SendMessageCommand } from '@aws-sdk/client-sqs'; + +export class SqsController extends EventController { + private sqsClient: SQSClient | null = null; + + constructor( + prismaRepository: PrismaRepository, + configService: ConfigService, + ) { + super(prismaRepository, configService, 'SqsController'); + this.initializeSQSClient(); + } + + private initializeSQSClient(): void { + try { + const sqsConfig = this.configService.get('SQS'); + if (!sqsConfig?.ENABLED) { + return; + } + + this.sqsClient = new SQSClient({ + region: sqsConfig.REGION, + credentials: { + accessKeyId: sqsConfig.ACCESS_KEY_ID, + secretAccessKey: sqsConfig.SECRET_ACCESS_KEY, + }, + }); + + this.logger.log('SQS client initialized'); + } catch (error) { + this.logger.error('Failed to initialize SQS client:', error); + } + } + + public async emit(data: EmitData): Promise { + if (!this.sqsClient) { + return; + } + + try { + const instance = await this.getInstanceConfig(data.instanceName); + if (!instance?.sqs?.enabled) { + return; + } + + const sqsConfig = instance.sqs; + + if (!this.shouldProcessEvent(data.event, sqsConfig.events)) { + return; + } + + const payload = { + event: data.event, + instance: data.instanceName, + data: data.data, + timestamp: data.dateTime, + sender: data.sender, + }; + + const command = new SendMessageCommand({ + QueueUrl: sqsConfig.queueUrl, + MessageBody: JSON.stringify(payload), + MessageAttributes: { + event: { + DataType: 'String', + StringValue: data.event, + }, + instance: { + DataType: 'String', + StringValue: data.instanceName, + }, + }, + MessageGroupId: data.instanceName, // For FIFO queues + MessageDeduplicationId: `${data.instanceName}-${Date.now()}`, // For FIFO queues + }); + + await this.sqsClient.send(command); + + this.logger.log(`SQS message sent for event ${data.event} to instance ${data.instanceName}`); + } catch (error) { + this.logger.error(`SQS emission failed for ${data.instanceName}:`, error); + } + } + + public async set(instanceName: string, data: any): Promise { + try { + const sqsData = data.sqs; + + await this.prismaRepository.instance.update({ + where: { name: instanceName }, + data: { + sqs: sqsData, + }, + }); + + this.logger.log(`SQS configuration set for instance ${instanceName}`); + return { sqs: sqsData }; + } catch (error) { + this.logger.error(`Failed to set SQS config for ${instanceName}:`, error); + throw error; + } + } +} +``` + +## Event DTO Pattern + +### Event Configuration DTO +```typescript +import { JsonValue } from '@prisma/client/runtime/library'; + +export class EventDto { + webhook?: { + enabled?: boolean; + events?: string[]; + url?: string; + headers?: JsonValue; + byEvents?: boolean; + base64?: boolean; + }; + + websocket?: { + enabled?: boolean; + events?: string[]; + }; + + sqs?: { + enabled?: boolean; + events?: string[]; + queueUrl?: string; + }; + + rabbitmq?: { + enabled?: boolean; + events?: string[]; + exchange?: string; + }; + + nats?: { + enabled?: boolean; + events?: string[]; + subject?: string; + }; + + pusher?: { + enabled?: boolean; + appId?: string; + key?: string; + secret?: string; + cluster?: string; + useTLS?: boolean; + events?: string[]; + }; +} +``` + +## Event Router Pattern + +### Event Router Structure +```typescript +import { NatsRouter } from '@api/integrations/event/nats/nats.router'; +import { PusherRouter } from '@api/integrations/event/pusher/pusher.router'; +import { RabbitmqRouter } from '@api/integrations/event/rabbitmq/rabbitmq.router'; +import { SqsRouter } from '@api/integrations/event/sqs/sqs.router'; +import { WebhookRouter } from '@api/integrations/event/webhook/webhook.router'; +import { WebsocketRouter } from '@api/integrations/event/websocket/websocket.router'; +import { Router } from 'express'; + +export class EventRouter { + public readonly router: Router; + + constructor(configService: any, ...guards: any[]) { + this.router = Router(); + + this.router.use('/webhook', new WebhookRouter(configService, ...guards).router); + this.router.use('/websocket', new WebsocketRouter(...guards).router); + this.router.use('/rabbitmq', new RabbitmqRouter(...guards).router); + this.router.use('/nats', new NatsRouter(...guards).router); + this.router.use('/pusher', new PusherRouter(...guards).router); + this.router.use('/sqs', new SqsRouter(...guards).router); + } +} +``` + +## Event Validation Schema + +### Event Configuration Validation +```typescript +import Joi from 'joi'; +import { EventController } from '@api/integrations/event/event.controller'; + +const eventListSchema = Joi.array().items( + Joi.string().valid(...EventController.events) +).optional(); + +export const webhookSchema = Joi.object({ + enabled: Joi.boolean().required(), + url: Joi.string().when('enabled', { + is: true, + then: Joi.required().uri({ scheme: ['http', 'https'] }), + otherwise: Joi.optional(), + }), + events: eventListSchema, + headers: Joi.object().pattern(Joi.string(), Joi.string()).optional(), + byEvents: Joi.boolean().optional().default(false), + base64: Joi.boolean().optional().default(false), +}).required(); + +export const websocketSchema = Joi.object({ + enabled: Joi.boolean().required(), + events: eventListSchema, +}).required(); + +export const rabbitmqSchema = Joi.object({ + enabled: Joi.boolean().required(), + events: eventListSchema, + exchange: Joi.string().optional().default('evolution-events'), +}).required(); + +export const sqsSchema = Joi.object({ + enabled: Joi.boolean().required(), + events: eventListSchema, + queueUrl: Joi.string().when('enabled', { + is: true, + then: Joi.required().uri(), + otherwise: Joi.optional(), + }), +}).required(); + +export const eventSchema = Joi.object({ + webhook: webhookSchema.optional(), + websocket: websocketSchema.optional(), + rabbitmq: rabbitmqSchema.optional(), + sqs: sqsSchema.optional(), + nats: Joi.object({ + enabled: Joi.boolean().required(), + events: eventListSchema, + subject: Joi.string().optional().default('evolution.events'), + }).optional(), + pusher: Joi.object({ + enabled: Joi.boolean().required(), + appId: Joi.string().when('enabled', { is: true, then: Joi.required() }), + key: Joi.string().when('enabled', { is: true, then: Joi.required() }), + secret: Joi.string().when('enabled', { is: true, then: Joi.required() }), + cluster: Joi.string().when('enabled', { is: true, then: Joi.required() }), + useTLS: Joi.boolean().optional().default(true), + events: eventListSchema, + }).optional(), +}).min(1).required(); +``` + +## Event Testing Pattern + +### Event Controller Testing +```typescript +describe('WebhookController', () => { + let controller: WebhookController; + let prismaRepository: jest.Mocked; + let configService: jest.Mocked; + + beforeEach(() => { + controller = new WebhookController(prismaRepository, configService); + }); + + describe('emit', () => { + it('should send webhook when enabled', async () => { + const mockInstance = { + webhook: { + enabled: true, + url: 'https://example.com/webhook', + events: ['MESSAGES_UPSERT'], + }, + }; + + prismaRepository.instance.findUnique.mockResolvedValue(mockInstance); + jest.spyOn(axios, 'post').mockResolvedValue({ status: 200 }); + + const eventData = { + instanceName: 'test-instance', + event: 'MESSAGES_UPSERT', + data: { message: 'test' }, + origin: 'test', + serverUrl: 'http://localhost', + dateTime: new Date().toISOString(), + sender: 'test', + }; + + await controller.emit(eventData); + + expect(axios.post).toHaveBeenCalledWith( + 'https://example.com/webhook', + expect.objectContaining({ + event: 'MESSAGES_UPSERT', + instance: 'test-instance', + }), + expect.objectContaining({ + headers: expect.objectContaining({ + 'Content-Type': 'application/json', + }), + }) + ); + }); + }); +}); +``` \ No newline at end of file diff --git a/.cursor/rules/specialized-rules/integration-storage-rules.mdc b/.cursor/rules/specialized-rules/integration-storage-rules.mdc new file mode 100644 index 000000000..6456f5a4b --- /dev/null +++ b/.cursor/rules/specialized-rules/integration-storage-rules.mdc @@ -0,0 +1,608 @@ +--- +description: Storage integration patterns for Evolution API +globs: + - "src/api/integrations/storage/**/*.ts" +alwaysApply: false +--- + +# Evolution API Storage Integration Rules + +## Storage Service Pattern + +### Base Storage Service Structure +```typescript +import { InstanceDto } from '@api/dto/instance.dto'; +import { PrismaRepository } from '@api/repository/repository.service'; +import { Logger } from '@config/logger.config'; +import { BadRequestException } from '@exceptions'; + +export class StorageService { + constructor(private readonly prismaRepository: PrismaRepository) {} + + private readonly logger = new Logger('StorageService'); + + public async getMedia(instance: InstanceDto, query?: MediaDto) { + try { + const where: any = { + instanceId: instance.instanceId, + ...query, + }; + + const media = await this.prismaRepository.media.findMany({ + where, + select: { + id: true, + fileName: true, + type: true, + mimetype: true, + createdAt: true, + Message: true, + }, + }); + + if (!media || media.length === 0) { + throw 'Media not found'; + } + + return media; + } catch (error) { + throw new BadRequestException(error); + } + } + + public async getMediaUrl(instance: InstanceDto, data: MediaDto) { + const media = (await this.getMedia(instance, { id: data.id }))[0]; + const mediaUrl = await this.generateUrl(media.fileName, data.expiry); + return { + mediaUrl, + ...media, + }; + } + + protected abstract generateUrl(fileName: string, expiry?: number): Promise; +} +``` + +## S3/MinIO Integration Pattern + +### MinIO Client Setup +```typescript +import { ConfigService, S3 } from '@config/env.config'; +import { Logger } from '@config/logger.config'; +import { BadRequestException } from '@exceptions'; +import * as MinIo from 'minio'; +import { join } from 'path'; +import { Readable, Transform } from 'stream'; + +const logger = new Logger('S3 Service'); +const BUCKET = new ConfigService().get('S3'); + +interface Metadata extends MinIo.ItemBucketMetadata { + instanceId: string; + messageId?: string; +} + +const minioClient = (() => { + if (BUCKET?.ENABLE) { + return new MinIo.Client({ + endPoint: BUCKET.ENDPOINT, + port: BUCKET.PORT, + useSSL: BUCKET.USE_SSL, + accessKey: BUCKET.ACCESS_KEY, + secretKey: BUCKET.SECRET_KEY, + region: BUCKET.REGION, + }); + } +})(); + +const bucketName = process.env.S3_BUCKET; +``` + +### Bucket Management Functions +```typescript +const bucketExists = async (): Promise => { + if (minioClient) { + try { + const list = await minioClient.listBuckets(); + return !!list.find((bucket) => bucket.name === bucketName); + } catch (error) { + logger.error('Error checking bucket existence:', error); + return false; + } + } + return false; +}; + +const setBucketPolicy = async (): Promise => { + if (minioClient && bucketName) { + try { + const policy = { + Version: '2012-10-17', + Statement: [ + { + Effect: 'Allow', + Principal: { AWS: ['*'] }, + Action: ['s3:GetObject'], + Resource: [`arn:aws:s3:::${bucketName}/*`], + }, + ], + }; + + await minioClient.setBucketPolicy(bucketName, JSON.stringify(policy)); + logger.log('Bucket policy set successfully'); + } catch (error) { + logger.error('Error setting bucket policy:', error); + } + } +}; + +const createBucket = async (): Promise => { + if (minioClient && bucketName) { + try { + const exists = await bucketExists(); + if (!exists) { + await minioClient.makeBucket(bucketName, BUCKET.REGION || 'us-east-1'); + await setBucketPolicy(); + logger.log(`Bucket ${bucketName} created successfully`); + } + } catch (error) { + logger.error('Error creating bucket:', error); + } + } +}; +``` + +### File Upload Functions +```typescript +export const uploadFile = async ( + fileName: string, + buffer: Buffer, + mimetype: string, + metadata?: Metadata, +): Promise => { + if (!minioClient || !bucketName) { + throw new BadRequestException('S3 storage not configured'); + } + + try { + await createBucket(); + + const uploadMetadata = { + 'Content-Type': mimetype, + ...metadata, + }; + + await minioClient.putObject(bucketName, fileName, buffer, buffer.length, uploadMetadata); + + logger.log(`File ${fileName} uploaded successfully`); + return fileName; + } catch (error) { + logger.error(`Error uploading file ${fileName}:`, error); + throw new BadRequestException(`Failed to upload file: ${error.message}`); + } +}; + +export const uploadStream = async ( + fileName: string, + stream: Readable, + size: number, + mimetype: string, + metadata?: Metadata, +): Promise => { + if (!minioClient || !bucketName) { + throw new BadRequestException('S3 storage not configured'); + } + + try { + await createBucket(); + + const uploadMetadata = { + 'Content-Type': mimetype, + ...metadata, + }; + + await minioClient.putObject(bucketName, fileName, stream, size, uploadMetadata); + + logger.log(`Stream ${fileName} uploaded successfully`); + return fileName; + } catch (error) { + logger.error(`Error uploading stream ${fileName}:`, error); + throw new BadRequestException(`Failed to upload stream: ${error.message}`); + } +}; +``` + +### File Download Functions +```typescript +export const getObject = async (fileName: string): Promise => { + if (!minioClient || !bucketName) { + throw new BadRequestException('S3 storage not configured'); + } + + try { + const stream = await minioClient.getObject(bucketName, fileName); + const chunks: Buffer[] = []; + + return new Promise((resolve, reject) => { + stream.on('data', (chunk) => chunks.push(chunk)); + stream.on('end', () => resolve(Buffer.concat(chunks))); + stream.on('error', reject); + }); + } catch (error) { + logger.error(`Error getting object ${fileName}:`, error); + throw new BadRequestException(`Failed to get object: ${error.message}`); + } +}; + +export const getObjectUrl = async (fileName: string, expiry: number = 3600): Promise => { + if (!minioClient || !bucketName) { + throw new BadRequestException('S3 storage not configured'); + } + + try { + const url = await minioClient.presignedGetObject(bucketName, fileName, expiry); + logger.log(`Generated URL for ${fileName} with expiry ${expiry}s`); + return url; + } catch (error) { + logger.error(`Error generating URL for ${fileName}:`, error); + throw new BadRequestException(`Failed to generate URL: ${error.message}`); + } +}; + +export const getObjectStream = async (fileName: string): Promise => { + if (!minioClient || !bucketName) { + throw new BadRequestException('S3 storage not configured'); + } + + try { + const stream = await minioClient.getObject(bucketName, fileName); + return stream; + } catch (error) { + logger.error(`Error getting object stream ${fileName}:`, error); + throw new BadRequestException(`Failed to get object stream: ${error.message}`); + } +}; +``` + +### File Management Functions +```typescript +export const deleteObject = async (fileName: string): Promise => { + if (!minioClient || !bucketName) { + throw new BadRequestException('S3 storage not configured'); + } + + try { + await minioClient.removeObject(bucketName, fileName); + logger.log(`File ${fileName} deleted successfully`); + } catch (error) { + logger.error(`Error deleting file ${fileName}:`, error); + throw new BadRequestException(`Failed to delete file: ${error.message}`); + } +}; + +export const listObjects = async (prefix?: string): Promise => { + if (!minioClient || !bucketName) { + throw new BadRequestException('S3 storage not configured'); + } + + try { + const objects: MinIo.BucketItem[] = []; + const stream = minioClient.listObjects(bucketName, prefix, true); + + return new Promise((resolve, reject) => { + stream.on('data', (obj) => objects.push(obj)); + stream.on('end', () => resolve(objects)); + stream.on('error', reject); + }); + } catch (error) { + logger.error('Error listing objects:', error); + throw new BadRequestException(`Failed to list objects: ${error.message}`); + } +}; + +export const objectExists = async (fileName: string): Promise => { + if (!minioClient || !bucketName) { + return false; + } + + try { + await minioClient.statObject(bucketName, fileName); + return true; + } catch (error) { + return false; + } +}; +``` + +## Storage Controller Pattern + +### S3 Controller Implementation +```typescript +import { InstanceDto } from '@api/dto/instance.dto'; +import { MediaDto } from '@api/integrations/storage/s3/dto/media.dto'; +import { S3Service } from '@api/integrations/storage/s3/services/s3.service'; + +export class S3Controller { + constructor(private readonly s3Service: S3Service) {} + + public async getMedia(instance: InstanceDto, data: MediaDto) { + return this.s3Service.getMedia(instance, data); + } + + public async getMediaUrl(instance: InstanceDto, data: MediaDto) { + return this.s3Service.getMediaUrl(instance, data); + } + + public async uploadMedia(instance: InstanceDto, data: UploadMediaDto) { + return this.s3Service.uploadMedia(instance, data); + } + + public async deleteMedia(instance: InstanceDto, data: MediaDto) { + return this.s3Service.deleteMedia(instance, data); + } +} +``` + +## Storage Router Pattern + +### Storage Router Structure +```typescript +import { S3Router } from '@api/integrations/storage/s3/routes/s3.router'; +import { Router } from 'express'; + +export class StorageRouter { + public readonly router: Router; + + constructor(...guards: any[]) { + this.router = Router(); + + this.router.use('/s3', new S3Router(...guards).router); + // Add other storage providers here + // this.router.use('/gcs', new GCSRouter(...guards).router); + // this.router.use('/azure', new AzureRouter(...guards).router); + } +} +``` + +### S3 Specific Router +```typescript +import { RouterBroker } from '@api/abstract/abstract.router'; +import { MediaDto } from '@api/integrations/storage/s3/dto/media.dto'; +import { s3Schema, s3UrlSchema } from '@api/integrations/storage/s3/validate/s3.schema'; +import { HttpStatus } from '@api/routes/index.router'; +import { s3Controller } from '@api/server.module'; +import { RequestHandler, Router } from 'express'; + +export class S3Router extends RouterBroker { + constructor(...guards: RequestHandler[]) { + super(); + this.router + .post(this.routerPath('getMedia'), ...guards, async (req, res) => { + const response = await this.dataValidate({ + request: req, + schema: s3Schema, + ClassRef: MediaDto, + execute: (instance, data) => s3Controller.getMedia(instance, data), + }); + + res.status(HttpStatus.OK).json(response); + }) + .post(this.routerPath('getMediaUrl'), ...guards, async (req, res) => { + const response = await this.dataValidate({ + request: req, + schema: s3UrlSchema, + ClassRef: MediaDto, + execute: (instance, data) => s3Controller.getMediaUrl(instance, data), + }); + + res.status(HttpStatus.OK).json(response); + }) + .post(this.routerPath('uploadMedia'), ...guards, async (req, res) => { + const response = await this.dataValidate({ + request: req, + schema: uploadSchema, + ClassRef: UploadMediaDto, + execute: (instance, data) => s3Controller.uploadMedia(instance, data), + }); + + res.status(HttpStatus.CREATED).json(response); + }) + .delete(this.routerPath('deleteMedia'), ...guards, async (req, res) => { + const response = await this.dataValidate({ + request: req, + schema: s3Schema, + ClassRef: MediaDto, + execute: (instance, data) => s3Controller.deleteMedia(instance, data), + }); + + res.status(HttpStatus.OK).json(response); + }); + } + + public readonly router: Router = Router(); +} +``` + +## Storage DTO Pattern + +### Media DTO +```typescript +export class MediaDto { + id?: string; + fileName?: string; + type?: string; + mimetype?: string; + expiry?: number; +} + +export class UploadMediaDto { + fileName: string; + mimetype: string; + buffer?: Buffer; + base64?: string; + url?: string; + metadata?: { + instanceId: string; + messageId?: string; + contactId?: string; + [key: string]: any; + }; +} +``` + +## Storage Validation Schema + +### S3 Validation Schemas +```typescript +import Joi from 'joi'; + +export const s3Schema = Joi.object({ + id: Joi.string().optional(), + fileName: Joi.string().optional(), + type: Joi.string().optional().valid('image', 'video', 'audio', 'document'), + mimetype: Joi.string().optional(), + expiry: Joi.number().optional().min(60).max(604800).default(3600), // 1 min to 7 days +}).min(1).required(); + +export const s3UrlSchema = Joi.object({ + id: Joi.string().required(), + expiry: Joi.number().optional().min(60).max(604800).default(3600), +}).required(); + +export const uploadSchema = Joi.object({ + fileName: Joi.string().required().max(255), + mimetype: Joi.string().required(), + buffer: Joi.binary().optional(), + base64: Joi.string().base64().optional(), + url: Joi.string().uri().optional(), + metadata: Joi.object({ + instanceId: Joi.string().required(), + messageId: Joi.string().optional(), + contactId: Joi.string().optional(), + }).optional(), +}).xor('buffer', 'base64', 'url').required(); // Exactly one of these must be present +``` + +## Error Handling in Storage + +### Storage-Specific Error Handling +```typescript +// CORRECT - Storage-specific error handling +public async uploadFile(fileName: string, buffer: Buffer): Promise { + try { + const result = await this.storageClient.upload(fileName, buffer); + return result; + } catch (error) { + this.logger.error(`Storage upload failed: ${error.message}`); + + if (error.code === 'NoSuchBucket') { + throw new BadRequestException('Storage bucket not found'); + } + + if (error.code === 'AccessDenied') { + throw new UnauthorizedException('Storage access denied'); + } + + if (error.code === 'EntityTooLarge') { + throw new BadRequestException('File too large'); + } + + throw new InternalServerErrorException('Storage operation failed'); + } +} +``` + +## Storage Configuration Pattern + +### Environment Configuration +```typescript +export interface S3Config { + ENABLE: boolean; + ENDPOINT: string; + PORT: number; + USE_SSL: boolean; + ACCESS_KEY: string; + SECRET_KEY: string; + REGION: string; + BUCKET: string; +} + +// Usage in service +const s3Config = this.configService.get('S3'); +if (!s3Config.ENABLE) { + throw new BadRequestException('S3 storage is disabled'); +} +``` + +## Storage Testing Pattern + +### Storage Service Testing +```typescript +describe('S3Service', () => { + let service: S3Service; + let prismaRepository: jest.Mocked; + + beforeEach(() => { + service = new S3Service(prismaRepository); + }); + + describe('getMedia', () => { + it('should return media list', async () => { + const instance = { instanceId: 'test-instance' }; + const mockMedia = [ + { id: '1', fileName: 'test.jpg', type: 'image', mimetype: 'image/jpeg' }, + ]; + + prismaRepository.media.findMany.mockResolvedValue(mockMedia); + + const result = await service.getMedia(instance); + + expect(result).toEqual(mockMedia); + expect(prismaRepository.media.findMany).toHaveBeenCalledWith({ + where: { instanceId: 'test-instance' }, + select: expect.objectContaining({ + id: true, + fileName: true, + type: true, + mimetype: true, + }), + }); + }); + + it('should throw error when no media found', async () => { + const instance = { instanceId: 'test-instance' }; + prismaRepository.media.findMany.mockResolvedValue([]); + + await expect(service.getMedia(instance)).rejects.toThrow(BadRequestException); + }); + }); +}); +``` + +## Storage Performance Considerations + +### Efficient File Handling +```typescript +// CORRECT - Stream-based upload for large files +public async uploadLargeFile(fileName: string, stream: Readable, size: number): Promise { + const uploadStream = new Transform({ + transform(chunk, encoding, callback) { + // Optional: Add compression, encryption, etc. + callback(null, chunk); + }, + }); + + return new Promise((resolve, reject) => { + stream + .pipe(uploadStream) + .on('error', reject) + .on('finish', () => resolve(fileName)); + }); +} + +// INCORRECT - Loading entire file into memory +public async uploadLargeFile(fileName: string, filePath: string): Promise { + const buffer = fs.readFileSync(filePath); // ❌ Memory intensive for large files + return await this.uploadFile(fileName, buffer); +} +``` \ No newline at end of file diff --git a/.cursor/rules/specialized-rules/route-rules.mdc b/.cursor/rules/specialized-rules/route-rules.mdc new file mode 100644 index 000000000..7be40849c --- /dev/null +++ b/.cursor/rules/specialized-rules/route-rules.mdc @@ -0,0 +1,416 @@ +--- +description: Router patterns for Evolution API +globs: + - "src/api/routes/**/*.ts" +alwaysApply: false +--- + +# Evolution API Route Rules + +## Router Base Pattern + +### RouterBroker Extension +```typescript +import { RouterBroker } from '@api/abstract/abstract.router'; +import { RequestHandler, Router } from 'express'; +import { HttpStatus } from './index.router'; + +export class ExampleRouter extends RouterBroker { + constructor(...guards: RequestHandler[]) { + super(); + this.router + .get(this.routerPath('findExample'), ...guards, async (req, res) => { + const response = await this.dataValidate({ + request: req, + schema: null, + ClassRef: ExampleDto, + execute: (instance) => exampleController.find(instance), + }); + + return res.status(HttpStatus.OK).json(response); + }) + .post(this.routerPath('createExample'), ...guards, async (req, res) => { + const response = await this.dataValidate({ + request: req, + schema: exampleSchema, + ClassRef: ExampleDto, + execute: (instance, data) => exampleController.create(instance, data), + }); + + return res.status(HttpStatus.CREATED).json(response); + }); + } + + public readonly router: Router = Router(); +} +``` + +## Main Router Pattern + +### Index Router Structure +```typescript +import { Router } from 'express'; +import { authGuard } from '@api/guards/auth.guard'; +import { instanceExistsGuard, instanceLoggedGuard } from '@api/guards/instance.guard'; +import Telemetry from '@api/guards/telemetry.guard'; + +enum HttpStatus { + OK = 200, + CREATED = 201, + NOT_FOUND = 404, + FORBIDDEN = 403, + BAD_REQUEST = 400, + UNAUTHORIZED = 401, + INTERNAL_SERVER_ERROR = 500, +} + +const router: Router = Router(); +const guards = [instanceExistsGuard, instanceLoggedGuard, authGuard['apikey']]; +const telemetry = new Telemetry(); + +router + .use((req, res, next) => telemetry.collectTelemetry(req, res, next)) + .get('/', async (req, res) => { + res.status(HttpStatus.OK).json({ + status: HttpStatus.OK, + message: 'Welcome to the Evolution API, it is working!', + version: packageJson.version, + clientName: process.env.DATABASE_CONNECTION_CLIENT_NAME, + manager: !serverConfig.DISABLE_MANAGER ? `${req.protocol}://${req.get('host')}/manager` : undefined, + documentation: `https://doc.evolution-api.com`, + whatsappWebVersion: (await fetchLatestWaWebVersion({})).version.join('.'), + }); + }) + .use('/instance', new InstanceRouter(configService, ...guards).router) + .use('/message', new MessageRouter(...guards).router) + .use('/chat', new ChatRouter(...guards).router) + .use('/business', new BusinessRouter(...guards).router); + +export { HttpStatus, router }; +``` + +## Data Validation Pattern + +### RouterBroker dataValidate Usage +```typescript +// CORRECT - Standard validation pattern +.post(this.routerPath('createTemplate'), ...guards, async (req, res) => { + const response = await this.dataValidate({ + request: req, + schema: templateSchema, + ClassRef: TemplateDto, + execute: (instance, data) => templateController.create(instance, data), + }); + + return res.status(HttpStatus.CREATED).json(response); +}) + +// CORRECT - No schema validation (for simple DTOs) +.get(this.routerPath('findTemplate'), ...guards, async (req, res) => { + const response = await this.dataValidate({ + request: req, + schema: null, + ClassRef: InstanceDto, + execute: (instance) => templateController.find(instance), + }); + + return res.status(HttpStatus.OK).json(response); +}) +``` + +## Error Handling in Routes + +### Try-Catch Pattern +```typescript +// CORRECT - Error handling with utility function +.post(this.routerPath('getCatalog'), ...guards, async (req, res) => { + try { + const response = await this.dataValidate({ + request: req, + schema: catalogSchema, + ClassRef: NumberDto, + execute: (instance, data) => businessController.fetchCatalog(instance, data), + }); + + return res.status(HttpStatus.OK).json(response); + } catch (error) { + // Log error for debugging + console.error('Business catalog error:', error); + + // Use utility function to create standardized error response + const errorResponse = createMetaErrorResponse(error, 'business_catalog'); + return res.status(errorResponse.status).json(errorResponse); + } +}) + +// INCORRECT - Let RouterBroker handle errors (when possible) +.post(this.routerPath('simpleOperation'), ...guards, async (req, res) => { + try { + const response = await this.dataValidate({ + request: req, + schema: simpleSchema, + ClassRef: SimpleDto, + execute: (instance, data) => controller.simpleOperation(instance, data), + }); + + return res.status(HttpStatus.OK).json(response); + } catch (error) { + throw error; // ❌ Unnecessary - RouterBroker handles this + } +}) +``` + +## Route Path Pattern + +### routerPath Usage +```typescript +// CORRECT - Use routerPath for consistent naming +.get(this.routerPath('findLabels'), ...guards, async (req, res) => { + // Implementation +}) +.post(this.routerPath('handleLabel'), ...guards, async (req, res) => { + // Implementation +}) + +// INCORRECT - Hardcoded paths +.get('/labels', ...guards, async (req, res) => { // ❌ Use routerPath + // Implementation +}) +``` + +## Guard Application Pattern + +### Guards Usage +```typescript +// CORRECT - Apply guards to protected routes +export class ProtectedRouter extends RouterBroker { + constructor(...guards: RequestHandler[]) { + super(); + this.router + .get(this.routerPath('protectedAction'), ...guards, async (req, res) => { + // Protected action + }) + .post(this.routerPath('anotherAction'), ...guards, async (req, res) => { + // Another protected action + }); + } +} + +// CORRECT - No guards for public routes +export class PublicRouter extends RouterBroker { + constructor() { + super(); + this.router + .get('/health', async (req, res) => { + res.status(HttpStatus.OK).json({ status: 'healthy' }); + }) + .get('/version', async (req, res) => { + res.status(HttpStatus.OK).json({ version: packageJson.version }); + }); + } +} +``` + +## Static File Serving Pattern + +### Static Assets Route +```typescript +// CORRECT - Secure static file serving +router.get('/assets/*', (req, res) => { + const fileName = req.params[0]; + + // Security: Reject paths containing traversal patterns + if (!fileName || fileName.includes('..') || fileName.includes('\\') || path.isAbsolute(fileName)) { + return res.status(403).send('Forbidden'); + } + + const basePath = path.join(process.cwd(), 'manager', 'dist'); + const assetsPath = path.join(basePath, 'assets'); + const filePath = path.join(assetsPath, fileName); + + // Security: Ensure the resolved path is within the assets directory + const resolvedPath = path.resolve(filePath); + const resolvedAssetsPath = path.resolve(assetsPath); + + if (!resolvedPath.startsWith(resolvedAssetsPath + path.sep) && resolvedPath !== resolvedAssetsPath) { + return res.status(403).send('Forbidden'); + } + + if (fs.existsSync(resolvedPath)) { + res.set('Content-Type', mimeTypes.lookup(resolvedPath) || 'text/css'); + res.send(fs.readFileSync(resolvedPath)); + } else { + res.status(404).send('File not found'); + } +}); +``` + +## Special Route Patterns + +### Manager Route Pattern +```typescript +export class ViewsRouter extends RouterBroker { + public readonly router: Router; + + constructor() { + super(); + this.router = Router(); + + const basePath = path.join(process.cwd(), 'manager', 'dist'); + const indexPath = path.join(basePath, 'index.html'); + + this.router.use(express.static(basePath)); + + this.router.get('*', (req, res) => { + res.sendFile(indexPath); + }); + } +} +``` + +### Webhook Route Pattern +```typescript +// CORRECT - Webhook without guards +.post('/webhook/evolution', async (req, res) => { + const response = await evolutionController.receiveWebhook(req.body); + return res.status(HttpStatus.OK).json(response); +}) + +// CORRECT - Webhook with signature validation +.post('/webhook/meta', validateWebhookSignature, async (req, res) => { + const response = await metaController.receiveWebhook(req.body); + return res.status(HttpStatus.OK).json(response); +}) +``` + +## Response Pattern + +### Standard Response Format +```typescript +// CORRECT - Standard success response +return res.status(HttpStatus.OK).json(response); + +// CORRECT - Created response +return res.status(HttpStatus.CREATED).json(response); + +// CORRECT - Custom response with additional data +return res.status(HttpStatus.OK).json({ + ...response, + timestamp: new Date().toISOString(), + instanceName: req.params.instanceName, +}); +``` + +## Route Organization + +### File Structure +``` +src/api/routes/ +├── index.router.ts # Main router with all route registrations +├── instance.router.ts # Instance management routes +├── sendMessage.router.ts # Message sending routes +├── chat.router.ts # Chat operations routes +├── business.router.ts # Business API routes +├── group.router.ts # Group management routes +├── label.router.ts # Label management routes +├── proxy.router.ts # Proxy configuration routes +├── settings.router.ts # Instance settings routes +├── template.router.ts # Template management routes +├── call.router.ts # Call operations routes +└── view.router.ts # Frontend views routes +``` + +## Route Testing Pattern + +### Router Testing +```typescript +describe('ExampleRouter', () => { + let app: express.Application; + let router: ExampleRouter; + + beforeEach(() => { + app = express(); + router = new ExampleRouter(); + app.use('/api', router.router); + app.use(express.json()); + }); + + describe('GET /findExample', () => { + it('should return example data', async () => { + const response = await request(app) + .get('/api/findExample/test-instance') + .set('apikey', 'test-key') + .expect(200); + + expect(response.body).toBeDefined(); + expect(response.body.instanceName).toBe('test-instance'); + }); + + it('should return 401 without API key', async () => { + await request(app) + .get('/api/findExample/test-instance') + .expect(401); + }); + }); + + describe('POST /createExample', () => { + it('should create example successfully', async () => { + const data = { + name: 'Test Example', + description: 'Test Description', + }; + + const response = await request(app) + .post('/api/createExample/test-instance') + .set('apikey', 'test-key') + .send(data) + .expect(201); + + expect(response.body.name).toBe(data.name); + }); + + it('should validate required fields', async () => { + const data = { + description: 'Test Description', + // Missing required 'name' field + }; + + await request(app) + .post('/api/createExample/test-instance') + .set('apikey', 'test-key') + .send(data) + .expect(400); + }); + }); +}); +``` + +## Route Documentation + +### JSDoc for Routes +```typescript +/** + * @route GET /api/template/findTemplate/:instanceName + * @description Find template for instance + * @param {string} instanceName - Instance name + * @returns {TemplateDto} Template data + * @throws {404} Template not found + * @throws {401} Unauthorized + */ +.get(this.routerPath('findTemplate'), ...guards, async (req, res) => { + // Implementation +}) + +/** + * @route POST /api/template/createTemplate/:instanceName + * @description Create new template + * @param {string} instanceName - Instance name + * @body {TemplateDto} Template data + * @returns {TemplateDto} Created template + * @throws {400} Validation error + * @throws {401} Unauthorized + */ +.post(this.routerPath('createTemplate'), ...guards, async (req, res) => { + // Implementation +}) +``` \ No newline at end of file diff --git a/.cursor/rules/specialized-rules/service-rules.mdc b/.cursor/rules/specialized-rules/service-rules.mdc new file mode 100644 index 000000000..0f516c555 --- /dev/null +++ b/.cursor/rules/specialized-rules/service-rules.mdc @@ -0,0 +1,294 @@ +--- +description: Service layer patterns for Evolution API +globs: + - "src/api/services/**/*.ts" + - "src/api/integrations/**/services/*.ts" +alwaysApply: false +--- + +# Evolution API Service Rules + +## Service Structure Pattern + +### Standard Service Class +```typescript +export class ExampleService { + constructor(private readonly waMonitor: WAMonitoringService) {} + + private readonly logger = new Logger('ExampleService'); + + public async create(instance: InstanceDto, data: ExampleDto) { + await this.waMonitor.waInstances[instance.instanceName].setData(data); + return { example: { ...instance, data } }; + } + + public async find(instance: InstanceDto): Promise { + try { + const result = await this.waMonitor.waInstances[instance.instanceName].findData(); + + if (Object.keys(result).length === 0) { + throw new Error('Data not found'); + } + + return result; + } catch (error) { + return null; // Evolution pattern - return null on error + } + } +} +``` + +## Dependency Injection Pattern + +### Constructor Pattern +```typescript +// CORRECT - Evolution API pattern +constructor( + private readonly waMonitor: WAMonitoringService, + private readonly prismaRepository: PrismaRepository, + private readonly configService: ConfigService, +) {} + +// INCORRECT - Don't use +constructor(waMonitor, prismaRepository, configService) {} // ❌ No types +``` + +## Logger Pattern + +### Standard Logger Usage +```typescript +// CORRECT - Evolution API pattern +private readonly logger = new Logger('ServiceName'); + +// Usage +this.logger.log('Operation started'); +this.logger.error('Operation failed', error); + +// INCORRECT +console.log('Operation started'); // ❌ Use Logger +``` + +## WAMonitor Integration Pattern + +### Instance Access Pattern +```typescript +// CORRECT - Standard pattern +public async operation(instance: InstanceDto, data: DataDto) { + await this.waMonitor.waInstances[instance.instanceName].performAction(data); + return { result: { ...instance, data } }; +} + +// Instance validation +const waInstance = this.waMonitor.waInstances[instance.instanceName]; +if (!waInstance) { + throw new NotFoundException('Instance not found'); +} +``` + +## Error Handling Pattern + +### Try-Catch Pattern +```typescript +// CORRECT - Evolution API pattern +public async find(instance: InstanceDto): Promise { + try { + const result = await this.waMonitor.waInstances[instance.instanceName].findData(); + + if (Object.keys(result).length === 0) { + throw new Error('Data not found'); + } + + return result; + } catch (error) { + this.logger.error('Find operation failed', error); + return null; // Return null on error (Evolution pattern) + } +} +``` + +## Cache Integration Pattern + +### Cache Service Usage +```typescript +export class CacheAwareService { + constructor( + private readonly cache: CacheService, + private readonly chatwootCache: CacheService, + private readonly baileysCache: CacheService, + ) {} + + public async getCachedData(key: string): Promise { + const cached = await this.cache.get(key); + if (cached) return cached; + + const data = await this.fetchFromSource(key); + await this.cache.set(key, data, 300); // 5 min TTL + return data; + } +} +``` + +## Integration Service Patterns + +### Chatbot Service Base Pattern +```typescript +export class ChatbotService extends BaseChatbotService { + constructor( + waMonitor: WAMonitoringService, + prismaRepository: PrismaRepository, + configService: ConfigService, + ) { + super(waMonitor, prismaRepository, 'ChatbotService', configService); + } + + protected async processBot( + waInstance: any, + remoteJid: string, + bot: BotType, + session: any, + settings: any, + content: string, + ): Promise { + // Implementation + } +} +``` + +### Channel Service Pattern +```typescript +export class ChannelService extends ChannelStartupService { + constructor( + configService: ConfigService, + eventEmitter: EventEmitter2, + prismaRepository: PrismaRepository, + cache: CacheService, + chatwootCache: CacheService, + baileysCache: CacheService, + ) { + super(configService, eventEmitter, prismaRepository, cache, chatwootCache, baileysCache); + } + + public readonly logger = new Logger('ChannelService'); + public client: WASocket; + public readonly instance: wa.Instance = {}; +} +``` + +## Service Initialization Pattern + +### Service Registration +```typescript +// In server.module.ts pattern +export const templateService = new TemplateService( + waMonitor, + prismaRepository, + configService, +); + +export const settingsService = new SettingsService(waMonitor); +``` + +## Async Operation Patterns + +### Promise Handling +```typescript +// CORRECT - Evolution API pattern +public async sendMessage(instance: InstanceDto, data: MessageDto) { + const waInstance = this.waMonitor.waInstances[instance.instanceName]; + return await waInstance.sendMessage(data); +} + +// INCORRECT - Don't use .then() +public sendMessage(instance: InstanceDto, data: MessageDto) { + return this.waMonitor.waInstances[instance.instanceName] + .sendMessage(data) + .then(result => result); // ❌ Use async/await +} +``` + +## Configuration Access Pattern + +### Config Service Usage +```typescript +// CORRECT - Evolution API pattern +const serverConfig = this.configService.get('SERVER'); +const authConfig = this.configService.get('AUTHENTICATION'); +const dbConfig = this.configService.get('DATABASE'); + +// Type-safe configuration access +if (this.configService.get('CHATWOOT').ENABLED) { + // Chatwoot logic +} +``` + +## Event Emission Pattern + +### EventEmitter2 Usage +```typescript +// CORRECT - Evolution API pattern +this.eventEmitter.emit(Events.INSTANCE_CREATE, { + instanceName: instance.name, + status: 'created', +}); + +// Chatwoot event pattern +if (this.configService.get('CHATWOOT').ENABLED && this.localChatwoot?.enabled) { + this.chatwootService.eventWhatsapp( + Events.STATUS_INSTANCE, + { instanceName: this.instance.name }, + { + instance: this.instance.name, + status: 'created', + }, + ); +} +``` + +## Service Method Naming + +### Standard Method Names +- `create()` - Create new resource +- `find()` - Find single resource +- `findAll()` - Find multiple resources +- `update()` - Update resource +- `delete()` - Delete resource +- `fetch*()` - Fetch from external API +- `send*()` - Send data/messages +- `process*()` - Process data + +## Service Testing Pattern + +### Unit Test Structure +```typescript +describe('ExampleService', () => { + let service: ExampleService; + let waMonitor: jest.Mocked; + let prismaRepository: jest.Mocked; + + beforeEach(() => { + const mockWaMonitor = { + waInstances: { + 'test-instance': { + performAction: jest.fn(), + }, + }, + }; + + service = new ExampleService( + mockWaMonitor as any, + prismaRepository, + configService, + ); + }); + + it('should perform action successfully', async () => { + const instance = { instanceName: 'test-instance' }; + const data = { test: 'data' }; + + const result = await service.create(instance, data); + + expect(result).toBeDefined(); + expect(waMonitor.waInstances['test-instance'].performAction).toHaveBeenCalledWith(data); + }); +}); +``` \ No newline at end of file diff --git a/.cursor/rules/specialized-rules/type-rules.mdc b/.cursor/rules/specialized-rules/type-rules.mdc new file mode 100644 index 000000000..cf7400674 --- /dev/null +++ b/.cursor/rules/specialized-rules/type-rules.mdc @@ -0,0 +1,490 @@ +--- +description: Type definitions and interfaces for Evolution API +globs: + - "src/api/types/**/*.ts" + - "src/@types/**/*.ts" +alwaysApply: false +--- + +# Evolution API Type Rules + +## Namespace Pattern + +### WhatsApp Types Namespace +```typescript +/* eslint-disable @typescript-eslint/no-namespace */ +import { JsonValue } from '@prisma/client/runtime/library'; +import { AuthenticationState, WAConnectionState } from 'baileys'; + +export declare namespace wa { + export type QrCode = { + count?: number; + pairingCode?: string; + base64?: string; + code?: string; + }; + + export type Instance = { + id?: string; + qrcode?: QrCode; + pairingCode?: string; + authState?: { state: AuthenticationState; saveCreds: () => void }; + name?: string; + wuid?: string; + profileName?: string; + profilePictureUrl?: string; + token?: string; + number?: string; + integration?: string; + businessId?: string; + }; + + export type LocalChatwoot = { + enabled?: boolean; + accountId?: string; + token?: string; + url?: string; + nameInbox?: string; + mergeBrazilContacts?: boolean; + importContacts?: boolean; + importMessages?: boolean; + daysLimitImportMessages?: number; + organization?: string; + logo?: string; + }; + + export type LocalProxy = { + enabled?: boolean; + host?: string; + port?: string; + protocol?: string; + username?: string; + password?: string; + }; + + export type LocalSettings = { + rejectCall?: boolean; + msgCall?: string; + groupsIgnore?: boolean; + alwaysOnline?: boolean; + readMessages?: boolean; + readStatus?: boolean; + syncFullHistory?: boolean; + }; + + export type LocalWebHook = { + enabled?: boolean; + url?: string; + events?: string[]; + headers?: JsonValue; + byEvents?: boolean; + base64?: boolean; + }; + + export type StatusMessage = 'ERROR' | 'PENDING' | 'SERVER_ACK' | 'DELIVERY_ACK' | 'READ' | 'DELETED' | 'PLAYED'; +} +``` + +## Enum Definitions + +### Events Enum +```typescript +export enum Events { + APPLICATION_STARTUP = 'application.startup', + INSTANCE_CREATE = 'instance.create', + INSTANCE_DELETE = 'instance.delete', + QRCODE_UPDATED = 'qrcode.updated', + CONNECTION_UPDATE = 'connection.update', + STATUS_INSTANCE = 'status.instance', + MESSAGES_SET = 'messages.set', + MESSAGES_UPSERT = 'messages.upsert', + MESSAGES_EDITED = 'messages.edited', + MESSAGES_UPDATE = 'messages.update', + MESSAGES_DELETE = 'messages.delete', + SEND_MESSAGE = 'send.message', + SEND_MESSAGE_UPDATE = 'send.message.update', + CONTACTS_SET = 'contacts.set', + CONTACTS_UPSERT = 'contacts.upsert', + CONTACTS_UPDATE = 'contacts.update', + PRESENCE_UPDATE = 'presence.update', + CHATS_SET = 'chats.set', + CHATS_UPDATE = 'chats.update', + CHATS_UPSERT = 'chats.upsert', + CHATS_DELETE = 'chats.delete', + GROUPS_UPSERT = 'groups.upsert', + GROUPS_UPDATE = 'groups.update', + GROUP_PARTICIPANTS_UPDATE = 'group-participants.update', + CALL = 'call', + TYPEBOT_START = 'typebot.start', + TYPEBOT_CHANGE_STATUS = 'typebot.change-status', + LABELS_EDIT = 'labels.edit', + LABELS_ASSOCIATION = 'labels.association', + CREDS_UPDATE = 'creds.update', + MESSAGING_HISTORY_SET = 'messaging-history.set', + REMOVE_INSTANCE = 'remove.instance', + LOGOUT_INSTANCE = 'logout.instance', +} +``` + +### Integration Types +```typescript +export const Integration = { + WHATSAPP_BUSINESS: 'WHATSAPP-BUSINESS', + WHATSAPP_BAILEYS: 'WHATSAPP-BAILEYS', + EVOLUTION: 'EVOLUTION', +} as const; + +export type IntegrationType = typeof Integration[keyof typeof Integration]; +``` + +## Constant Arrays + +### Message Type Constants +```typescript +export const TypeMediaMessage = [ + 'imageMessage', + 'documentMessage', + 'audioMessage', + 'videoMessage', + 'stickerMessage', + 'ptvMessage', // Evolution API includes this +]; + +export const MessageSubtype = [ + 'ephemeralMessage', + 'documentWithCaptionMessage', + 'viewOnceMessage', + 'viewOnceMessageV2', +]; + +export type MediaMessageType = typeof TypeMediaMessage[number]; +export type MessageSubtypeType = typeof MessageSubtype[number]; +``` + +## Interface Definitions + +### Service Interfaces +```typescript +export interface ServiceInterface { + create(instance: InstanceDto, data: any): Promise; + find(instance: InstanceDto): Promise; + update?(instance: InstanceDto, data: any): Promise; + delete?(instance: InstanceDto): Promise; +} + +export interface ChannelServiceInterface extends ServiceInterface { + sendMessage(data: SendMessageDto): Promise; + connectToWhatsapp(data?: any): Promise; + receiveWebhook?(data: any): Promise; +} + +export interface ChatbotServiceInterface extends ServiceInterface { + processMessage( + instanceName: string, + remoteJid: string, + message: any, + pushName?: string, + ): Promise; +} +``` + +## Configuration Types + +### Environment Configuration Types +```typescript +export interface DatabaseConfig { + CONNECTION: { + URI: string; + DB_PREFIX_NAME: string; + CLIENT_NAME?: string; + }; + ENABLED: boolean; + SAVE_DATA: { + INSTANCE: boolean; + NEW_MESSAGE: boolean; + MESSAGE_UPDATE: boolean; + CONTACTS: boolean; + CHATS: boolean; + }; +} + +export interface AuthConfig { + TYPE: 'apikey' | 'jwt'; + API_KEY: { + KEY: string; + }; + JWT?: { + EXPIRIN_IN: number; + SECRET: string; + }; +} + +export interface CacheConfig { + REDIS: { + ENABLED: boolean; + URI: string; + PREFIX_KEY: string; + SAVE_INSTANCES: boolean; + }; + LOCAL: { + ENABLED: boolean; + TTL: number; + }; +} +``` + +## Message Types + +### Message Structure Types +```typescript +export interface MessageContent { + text?: string; + caption?: string; + media?: Buffer | string; + mediatype?: 'image' | 'video' | 'audio' | 'document' | 'sticker'; + fileName?: string; + mimetype?: string; +} + +export interface MessageOptions { + delay?: number; + presence?: 'unavailable' | 'available' | 'composing' | 'recording' | 'paused'; + linkPreview?: boolean; + mentionsEveryOne?: boolean; + mentioned?: string[]; + quoted?: { + key: { + remoteJid: string; + fromMe: boolean; + id: string; + }; + message: any; + }; +} + +export interface SendMessageRequest { + number: string; + content: MessageContent; + options?: MessageOptions; +} +``` + +## Webhook Types + +### Webhook Payload Types +```typescript +export interface WebhookPayload { + event: Events; + instance: string; + data: any; + timestamp: string; + server?: { + version: string; + host: string; + }; +} + +export interface WebhookConfig { + enabled: boolean; + url: string; + events: Events[]; + headers?: Record; + byEvents?: boolean; + base64?: boolean; +} +``` + +## Error Types + +### Custom Error Types +```typescript +export interface ApiError { + status: number; + message: string; + error?: string; + details?: any; + timestamp: string; + path: string; +} + +export interface ValidationError extends ApiError { + status: 400; + validationErrors: Array<{ + field: string; + message: string; + value?: any; + }>; +} + +export interface AuthenticationError extends ApiError { + status: 401; + message: 'Unauthorized' | 'Invalid API Key' | 'Token Expired'; +} +``` + +## Utility Types + +### Generic Utility Types +```typescript +export type Optional = Omit & Partial>; + +export type RequiredFields = T & Required>; + +export type DeepPartial = { + [P in keyof T]?: T[P] extends object ? DeepPartial : T[P]; +}; + +export type NonEmptyArray = [T, ...T[]]; + +export type StringKeys = { + [K in keyof T]: T[K] extends string ? K : never; +}[keyof T]; +``` + +## Response Types + +### API Response Types +```typescript +export interface ApiResponse { + success: boolean; + data?: T; + message?: string; + error?: string; + timestamp: string; +} + +export interface PaginatedResponse extends ApiResponse { + pagination: { + page: number; + limit: number; + total: number; + totalPages: number; + hasNext: boolean; + hasPrev: boolean; + }; +} + +export interface InstanceResponse extends ApiResponse { + instance: { + instanceName: string; + status: 'connecting' | 'open' | 'close' | 'qr'; + qrcode?: string; + profileName?: string; + profilePicUrl?: string; + }; +} +``` + +## Integration-Specific Types + +### Baileys Types Extension +```typescript +import { WASocket, ConnectionState, DisconnectReason } from 'baileys'; + +export interface BaileysInstance { + client: WASocket; + state: ConnectionState; + qrRetry: number; + authPath: string; +} + +export interface BaileysConfig { + qrTimeout: number; + maxQrRetries: number; + authTimeout: number; + reconnectInterval: number; +} +``` + +### Business API Types +```typescript +export interface BusinessApiConfig { + version: string; + baseUrl: string; + timeout: number; + retries: number; +} + +export interface BusinessApiMessage { + messaging_product: 'whatsapp'; + to: string; + type: 'text' | 'image' | 'document' | 'audio' | 'video' | 'template'; + text?: { + body: string; + preview_url?: boolean; + }; + image?: { + link?: string; + id?: string; + caption?: string; + }; + template?: { + name: string; + language: { + code: string; + }; + components?: any[]; + }; +} +``` + +## Type Guards + +### Type Guard Functions +```typescript +export function isMediaMessage(message: any): message is MediaMessage { + return message && TypeMediaMessage.some(type => message[type]); +} + +export function isTextMessage(message: any): message is TextMessage { + return message && message.conversation; +} + +export function isValidIntegration(integration: string): integration is IntegrationType { + return Object.values(Integration).includes(integration as IntegrationType); +} + +export function isValidEvent(event: string): event is Events { + return Object.values(Events).includes(event as Events); +} +``` + +## Module Augmentation + +### Express Request Extension +```typescript +declare global { + namespace Express { + interface Request { + instanceName?: string; + instanceData?: InstanceDto; + user?: { + id: string; + apiKey: string; + }; + } + } +} +``` + +## Type Documentation + +### JSDoc Type Documentation +```typescript +/** + * WhatsApp instance configuration + * @interface InstanceConfig + * @property {string} name - Unique instance name + * @property {IntegrationType} integration - Integration type + * @property {string} [token] - API token for business integrations + * @property {WebhookConfig} [webhook] - Webhook configuration + * @property {ProxyConfig} [proxy] - Proxy configuration + */ +export interface InstanceConfig { + name: string; + integration: IntegrationType; + token?: string; + webhook?: WebhookConfig; + proxy?: ProxyConfig; +} +``` \ No newline at end of file diff --git a/.cursor/rules/specialized-rules/util-rules.mdc b/.cursor/rules/specialized-rules/util-rules.mdc new file mode 100644 index 000000000..6bcf7dd16 --- /dev/null +++ b/.cursor/rules/specialized-rules/util-rules.mdc @@ -0,0 +1,653 @@ +--- +description: Utility functions and helpers for Evolution API +globs: + - "src/utils/**/*.ts" +alwaysApply: false +--- + +# Evolution API Utility Rules + +## Utility Function Structure + +### Standard Utility Pattern +```typescript +import { Logger } from '@config/logger.config'; + +const logger = new Logger('UtilityName'); + +export function utilityFunction(param: ParamType): ReturnType { + try { + // Utility logic + return result; + } catch (error) { + logger.error(`Utility function failed: ${error.message}`); + throw error; + } +} + +export default utilityFunction; +``` + +## Authentication Utilities + +### Multi-File Auth State Pattern +```typescript +import { AuthenticationState } from 'baileys'; +import { CacheService } from '@api/services/cache.service'; +import fs from 'fs/promises'; +import path from 'path'; + +export default async function useMultiFileAuthStatePrisma( + sessionId: string, + cache: CacheService, +): Promise<{ + state: AuthenticationState; + saveCreds: () => Promise; +}> { + const localFolder = path.join(INSTANCE_DIR, sessionId); + const localFile = (key: string) => path.join(localFolder, fixFileName(key) + '.json'); + await fs.mkdir(localFolder, { recursive: true }); + + async function writeData(data: any, key: string): Promise { + const dataString = JSON.stringify(data, BufferJSON.replacer); + + if (key !== 'creds') { + if (process.env.CACHE_REDIS_ENABLED === 'true') { + return await cache.hSet(sessionId, key, data); + } else { + await fs.writeFile(localFile(key), dataString); + return; + } + } + await saveKey(sessionId, dataString); + return; + } + + async function readData(key: string): Promise { + try { + let rawData; + + if (key !== 'creds') { + if (process.env.CACHE_REDIS_ENABLED === 'true') { + return await cache.hGet(sessionId, key); + } else { + if (!(await fileExists(localFile(key)))) return null; + rawData = await fs.readFile(localFile(key), { encoding: 'utf-8' }); + return JSON.parse(rawData, BufferJSON.reviver); + } + } else { + rawData = await getAuthKey(sessionId); + } + + const parsedData = JSON.parse(rawData, BufferJSON.reviver); + return parsedData; + } catch (error) { + return null; + } + } + + async function removeData(key: string): Promise { + try { + if (key !== 'creds') { + if (process.env.CACHE_REDIS_ENABLED === 'true') { + return await cache.hDelete(sessionId, key); + } else { + await fs.unlink(localFile(key)); + } + } else { + await deleteAuthKey(sessionId); + } + } catch (error) { + return; + } + } + + let creds = await readData('creds'); + if (!creds) { + creds = initAuthCreds(); + await writeData(creds, 'creds'); + } + + return { + state: { + creds, + keys: { + get: async (type, ids) => { + const data = {}; + await Promise.all( + ids.map(async (id) => { + let value = await readData(`${type}-${id}`); + if (type === 'app-state-sync-key' && value) { + value = proto.Message.AppStateSyncKeyData.fromObject(value); + } + data[id] = value; + }) + ); + return data; + }, + set: async (data) => { + const tasks = []; + for (const category in data) { + for (const id in data[category]) { + const value = data[category][id]; + const key = `${category}-${id}`; + tasks.push(value ? writeData(value, key) : removeData(key)); + } + } + await Promise.all(tasks); + }, + }, + }, + saveCreds: () => writeData(creds, 'creds'), + }; +} +``` + +## Message Processing Utilities + +### Message Content Extraction +```typescript +export const getConversationMessage = (msg: any): string => { + const types = getTypeMessage(msg); + const messageContent = getMessageContent(types); + return messageContent; +}; + +const getTypeMessage = (msg: any): any => { + return Object.keys(msg?.message || msg || {})[0]; +}; + +const getMessageContent = (type: string, msg?: any): string => { + const typeKey = type?.replace('Message', ''); + + const types = { + conversation: msg?.message?.conversation, + extendedTextMessage: msg?.message?.extendedTextMessage?.text, + imageMessage: msg?.message?.imageMessage?.caption || 'Image', + videoMessage: msg?.message?.videoMessage?.caption || 'Video', + audioMessage: 'Audio', + documentMessage: msg?.message?.documentMessage?.caption || 'Document', + stickerMessage: 'Sticker', + contactMessage: 'Contact', + locationMessage: 'Location', + liveLocationMessage: 'Live Location', + viewOnceMessage: 'View Once', + reactionMessage: 'Reaction', + pollCreationMessage: 'Poll', + pollUpdateMessage: 'Poll Update', + }; + + let result = types[typeKey] || types[type] || 'Unknown'; + + if (!result || result === 'Unknown') { + result = JSON.stringify(msg); + } + + return result; +}; +``` + +### JID Creation Utility +```typescript +export const createJid = (number: string): string => { + if (number.includes('@')) { + return number; + } + + // Remove any non-numeric characters except + + let cleanNumber = number.replace(/[^\d+]/g, ''); + + // Remove + if present + if (cleanNumber.startsWith('+')) { + cleanNumber = cleanNumber.substring(1); + } + + // Add country code if missing (assuming Brazil as default) + if (cleanNumber.length === 11 && cleanNumber.startsWith('11')) { + cleanNumber = '55' + cleanNumber; + } else if (cleanNumber.length === 10) { + cleanNumber = '5511' + cleanNumber; + } + + // Determine if it's a group or individual + const isGroup = cleanNumber.includes('-'); + const domain = isGroup ? 'g.us' : 's.whatsapp.net'; + + return `${cleanNumber}@${domain}`; +}; +``` + +## Cache Utilities + +### WhatsApp Number Cache +```typescript +interface ISaveOnWhatsappCacheParams { + remoteJid: string; + lid?: string; +} + +function getAvailableNumbers(remoteJid: string): string[] { + const numbersAvailable: string[] = []; + + if (remoteJid.startsWith('+')) { + remoteJid = remoteJid.slice(1); + } + + const [number, domain] = remoteJid.split('@'); + + // Brazilian numbers + if (remoteJid.startsWith('55')) { + const numberWithDigit = + number.slice(4, 5) === '9' && number.length === 13 ? number : `${number.slice(0, 4)}9${number.slice(4)}`; + const numberWithoutDigit = number.length === 12 ? number : number.slice(0, 4) + number.slice(5); + + numbersAvailable.push(numberWithDigit); + numbersAvailable.push(numberWithoutDigit); + } + // Mexican/Argentina numbers + else if (number.startsWith('52') || number.startsWith('54')) { + let prefix = ''; + if (number.startsWith('52')) { + prefix = '1'; + } + if (number.startsWith('54')) { + prefix = '9'; + } + + const numberWithDigit = + number.slice(2, 3) === prefix && number.length === 13 + ? number + : `${number.slice(0, 2)}${prefix}${number.slice(2)}`; + const numberWithoutDigit = number.length === 12 ? number : number.slice(0, 2) + number.slice(3); + + numbersAvailable.push(numberWithDigit); + numbersAvailable.push(numberWithoutDigit); + } + // Other countries + else { + numbersAvailable.push(remoteJid); + } + + return numbersAvailable.map((number) => `${number}@${domain}`); +} + +export async function saveOnWhatsappCache(params: ISaveOnWhatsappCacheParams): Promise { + const { remoteJid, lid } = params; + const db = configService.get('DATABASE'); + + if (!db.SAVE_DATA.CONTACTS) { + return; + } + + try { + const numbersAvailable = getAvailableNumbers(remoteJid); + + const existingContact = await prismaRepository.contact.findFirst({ + where: { + OR: numbersAvailable.map(number => ({ id: number })), + }, + }); + + if (!existingContact) { + await prismaRepository.contact.create({ + data: { + id: remoteJid, + pushName: '', + profilePicUrl: '', + isOnWhatsapp: true, + lid: lid || null, + createdAt: new Date(), + updatedAt: new Date(), + }, + }); + } else { + await prismaRepository.contact.update({ + where: { id: existingContact.id }, + data: { + isOnWhatsapp: true, + lid: lid || existingContact.lid, + updatedAt: new Date(), + }, + }); + } + } catch (error) { + console.error('Error saving WhatsApp cache:', error); + } +} +``` + +## Search Utilities + +### Advanced Search Operators +```typescript +function normalizeString(str: string): string { + return str + .toLowerCase() + .normalize('NFD') + .replace(/[\u0300-\u036f]/g, ''); +} + +export function advancedOperatorsSearch(data: string, query: string): boolean { + const normalizedData = normalizeString(data); + const normalizedQuery = normalizeString(query); + + // Exact phrase search with quotes + if (normalizedQuery.startsWith('"') && normalizedQuery.endsWith('"')) { + const phrase = normalizedQuery.slice(1, -1); + return normalizedData.includes(phrase); + } + + // OR operator + if (normalizedQuery.includes(' OR ')) { + const terms = normalizedQuery.split(' OR '); + return terms.some(term => normalizedData.includes(term.trim())); + } + + // AND operator (default behavior) + if (normalizedQuery.includes(' AND ')) { + const terms = normalizedQuery.split(' AND '); + return terms.every(term => normalizedData.includes(term.trim())); + } + + // NOT operator + if (normalizedQuery.startsWith('NOT ')) { + const term = normalizedQuery.slice(4); + return !normalizedData.includes(term); + } + + // Wildcard search + if (normalizedQuery.includes('*')) { + const regex = new RegExp(normalizedQuery.replace(/\*/g, '.*'), 'i'); + return regex.test(normalizedData); + } + + // Default: simple contains search + return normalizedData.includes(normalizedQuery); +} +``` + +## Proxy Utilities + +### Proxy Agent Creation +```typescript +import { HttpsProxyAgent } from 'https-proxy-agent'; +import { SocksProxyAgent } from 'socks-proxy-agent'; + +type Proxy = { + host: string; + port: string; + protocol: 'http' | 'https' | 'socks4' | 'socks5'; + username?: string; + password?: string; +}; + +function selectProxyAgent(proxyUrl: string): HttpsProxyAgent | SocksProxyAgent { + const url = new URL(proxyUrl); + + if (url.protocol === 'socks4:' || url.protocol === 'socks5:') { + return new SocksProxyAgent(proxyUrl); + } else { + return new HttpsProxyAgent(proxyUrl); + } +} + +export function makeProxyAgent(proxy: Proxy): HttpsProxyAgent | SocksProxyAgent | null { + if (!proxy.host || !proxy.port) { + return null; + } + + let proxyUrl = `${proxy.protocol}://`; + + if (proxy.username && proxy.password) { + proxyUrl += `${proxy.username}:${proxy.password}@`; + } + + proxyUrl += `${proxy.host}:${proxy.port}`; + + try { + return selectProxyAgent(proxyUrl); + } catch (error) { + console.error('Failed to create proxy agent:', error); + return null; + } +} +``` + +## Telemetry Utilities + +### Telemetry Data Collection +```typescript +export interface TelemetryData { + route: string; + apiVersion: string; + timestamp: Date; + method?: string; + statusCode?: number; + responseTime?: number; + userAgent?: string; + instanceName?: string; +} + +export const sendTelemetry = async (route: string): Promise => { + try { + const telemetryData: TelemetryData = { + route, + apiVersion: packageJson.version, + timestamp: new Date(), + }; + + // Only send telemetry if enabled + if (process.env.DISABLE_TELEMETRY === 'true') { + return; + } + + // Send to telemetry service (implement as needed) + await axios.post('https://telemetry.evolution-api.com/collect', telemetryData, { + timeout: 5000, + }); + } catch (error) { + // Silently fail - don't affect main application + console.debug('Telemetry failed:', error.message); + } +}; +``` + +## Internationalization Utilities + +### i18n Setup +```typescript +import { ConfigService, Language } from '@config/env.config'; +import fs from 'fs'; +import i18next from 'i18next'; +import path from 'path'; + +const __dirname = path.resolve(process.cwd(), 'src', 'utils'); +const languages = ['en', 'pt-BR', 'es']; +const translationsPath = path.join(__dirname, 'translations'); +const configService: ConfigService = new ConfigService(); + +const resources: any = {}; + +languages.forEach((language) => { + const languagePath = path.join(translationsPath, `${language}.json`); + if (fs.existsSync(languagePath)) { + const translationContent = fs.readFileSync(languagePath, 'utf8'); + resources[language] = { + translation: JSON.parse(translationContent), + }; + } +}); + +i18next.init({ + resources, + fallbackLng: 'en', + lng: configService.get('LANGUAGE') || 'pt-BR', + interpolation: { + escapeValue: false, + }, +}); + +export const t = i18next.t.bind(i18next); +export default i18next; +``` + +## Bot Trigger Utilities + +### Bot Trigger Matching +```typescript +import { TriggerOperator, TriggerType } from '@prisma/client'; + +export function findBotByTrigger( + bots: any[], + content: string, + remoteJid: string, +): any | null { + for (const bot of bots) { + if (!bot.enabled) continue; + + // Check ignore list + if (bot.ignoreJids && bot.ignoreJids.includes(remoteJid)) { + continue; + } + + // Check trigger + if (matchesTrigger(content, bot.triggerType, bot.triggerOperator, bot.triggerValue)) { + return bot; + } + } + + return null; +} + +function matchesTrigger( + content: string, + triggerType: TriggerType, + triggerOperator: TriggerOperator, + triggerValue: string, +): boolean { + const normalizedContent = content.toLowerCase().trim(); + const normalizedValue = triggerValue.toLowerCase().trim(); + + switch (triggerType) { + case TriggerType.ALL: + return true; + + case TriggerType.KEYWORD: + return matchesKeyword(normalizedContent, triggerOperator, normalizedValue); + + case TriggerType.REGEX: + try { + const regex = new RegExp(triggerValue, 'i'); + return regex.test(content); + } catch { + return false; + } + + default: + return false; + } +} + +function matchesKeyword( + content: string, + operator: TriggerOperator, + value: string, +): boolean { + switch (operator) { + case TriggerOperator.EQUALS: + return content === value; + case TriggerOperator.CONTAINS: + return content.includes(value); + case TriggerOperator.STARTS_WITH: + return content.startsWith(value); + case TriggerOperator.ENDS_WITH: + return content.endsWith(value); + default: + return false; + } +} +``` + +## Server Utilities + +### Server Status Check +```typescript +export class ServerUP { + private static instance: ServerUP; + private isServerUp: boolean = false; + + private constructor() {} + + public static getInstance(): ServerUP { + if (!ServerUP.instance) { + ServerUP.instance = new ServerUP(); + } + return ServerUP.instance; + } + + public setServerStatus(status: boolean): void { + this.isServerUp = status; + } + + public getServerStatus(): boolean { + return this.isServerUp; + } + + public async waitForServer(timeout: number = 30000): Promise { + const startTime = Date.now(); + + while (!this.isServerUp && (Date.now() - startTime) < timeout) { + await new Promise(resolve => setTimeout(resolve, 100)); + } + + return this.isServerUp; + } +} +``` + +## Error Response Utilities + +### Standardized Error Responses +```typescript +export function createMetaErrorResponse(error: any, context: string) { + const timestamp = new Date().toISOString(); + + if (error.response?.data) { + return { + status: error.response.status || 500, + error: { + message: error.response.data.error?.message || 'External API error', + type: error.response.data.error?.type || 'api_error', + code: error.response.data.error?.code || 'unknown_error', + context, + timestamp, + }, + }; + } + + return { + status: 500, + error: { + message: error.message || 'Internal server error', + type: 'internal_error', + code: 'server_error', + context, + timestamp, + }, + }; +} + +export function createValidationErrorResponse(errors: any[], context: string) { + return { + status: 400, + error: { + message: 'Validation failed', + type: 'validation_error', + code: 'invalid_input', + context, + details: errors, + timestamp: new Date().toISOString(), + }, + }; +} +``` \ No newline at end of file diff --git a/.cursor/rules/specialized-rules/validate-rules.mdc b/.cursor/rules/specialized-rules/validate-rules.mdc new file mode 100644 index 000000000..f6baea1b6 --- /dev/null +++ b/.cursor/rules/specialized-rules/validate-rules.mdc @@ -0,0 +1,498 @@ +--- +description: Validation schemas and patterns for Evolution API +globs: + - "src/validate/**/*.ts" +alwaysApply: false +--- + +# Evolution API Validation Rules + +## Validation Schema Structure + +### JSONSchema7 Pattern (Evolution API Standard) +```typescript +import { JSONSchema7 } from 'json-schema'; +import { v4 } from 'uuid'; + +const isNotEmpty = (...fields: string[]) => { + const properties = {}; + fields.forEach((field) => { + properties[field] = { + if: { properties: { [field]: { type: 'string' } } }, + then: { properties: { [field]: { minLength: 1 } } }, + }; + }); + + return { + allOf: Object.values(properties), + }; +}; + +export const exampleSchema: JSONSchema7 = { + $id: v4(), + type: 'object', + properties: { + name: { type: 'string' }, + description: { type: 'string' }, + enabled: { type: 'boolean' }, + settings: { + type: 'object', + properties: { + timeout: { type: 'number', minimum: 1000, maximum: 60000 }, + retries: { type: 'number', minimum: 0, maximum: 5 }, + }, + }, + tags: { + type: 'array', + items: { type: 'string' }, + }, + }, + required: ['name', 'enabled'], + ...isNotEmpty('name'), +}; +``` + +## Message Validation Schemas + +### Send Message Validation +```typescript +const numberDefinition = { + type: 'string', + pattern: '^\\d+[\\.@\\w-]+', + description: 'Invalid number', +}; + +export const sendTextSchema: JSONSchema7 = { + $id: v4(), + type: 'object', + properties: { + number: numberDefinition, + text: { type: 'string', minLength: 1, maxLength: 4096 }, + delay: { type: 'number', minimum: 0, maximum: 60000 }, + linkPreview: { type: 'boolean' }, + mentionsEveryOne: { type: 'boolean' }, + mentioned: { + type: 'array', + items: { type: 'string' }, + }, + }, + required: ['number', 'text'], + ...isNotEmpty('number', 'text'), +}; + +export const sendMediaSchema = Joi.object({ + number: Joi.string().required().pattern(/^\d+$/), + mediatype: Joi.string().required().valid('image', 'video', 'audio', 'document'), + media: Joi.alternatives().try( + Joi.string().uri(), + Joi.string().base64(), + ).required(), + caption: Joi.string().optional().max(1024), + fileName: Joi.string().optional().max(255), + delay: Joi.number().optional().min(0).max(60000), +}).required(); + +export const sendButtonsSchema = Joi.object({ + number: Joi.string().required().pattern(/^\d+$/), + title: Joi.string().required().max(1024), + description: Joi.string().optional().max(1024), + footer: Joi.string().optional().max(60), + buttons: Joi.array().items( + Joi.object({ + type: Joi.string().required().valid('replyButton', 'urlButton', 'callButton'), + displayText: Joi.string().required().max(20), + id: Joi.string().when('type', { + is: 'replyButton', + then: Joi.required().max(256), + otherwise: Joi.optional(), + }), + url: Joi.string().when('type', { + is: 'urlButton', + then: Joi.required().uri(), + otherwise: Joi.optional(), + }), + phoneNumber: Joi.string().when('type', { + is: 'callButton', + then: Joi.required().pattern(/^\+?\d+$/), + otherwise: Joi.optional(), + }), + }) + ).min(1).max(3).required(), +}).required(); +``` + +## Instance Validation Schemas + +### Instance Creation Validation +```typescript +export const instanceSchema = Joi.object({ + instanceName: Joi.string().required().min(1).max(100).pattern(/^[a-zA-Z0-9_-]+$/), + integration: Joi.string().required().valid('WHATSAPP-BAILEYS', 'WHATSAPP-BUSINESS', 'EVOLUTION'), + token: Joi.string().when('integration', { + is: Joi.valid('WHATSAPP-BUSINESS', 'EVOLUTION'), + then: Joi.required().min(10), + otherwise: Joi.optional(), + }), + qrcode: Joi.boolean().optional().default(false), + number: Joi.string().optional().pattern(/^\d+$/), + businessId: Joi.string().when('integration', { + is: 'WHATSAPP-BUSINESS', + then: Joi.required(), + otherwise: Joi.optional(), + }), +}).required(); + +export const settingsSchema = Joi.object({ + rejectCall: Joi.boolean().optional(), + msgCall: Joi.string().optional().max(500), + groupsIgnore: Joi.boolean().optional(), + alwaysOnline: Joi.boolean().optional(), + readMessages: Joi.boolean().optional(), + readStatus: Joi.boolean().optional(), + syncFullHistory: Joi.boolean().optional(), + wavoipToken: Joi.string().optional(), +}).optional(); + +export const proxySchema = Joi.object({ + host: Joi.string().required().hostname(), + port: Joi.string().required().pattern(/^\d+$/).custom((value) => { + const port = parseInt(value); + if (port < 1 || port > 65535) { + throw new Error('Port must be between 1 and 65535'); + } + return value; + }), + protocol: Joi.string().required().valid('http', 'https', 'socks4', 'socks5'), + username: Joi.string().optional(), + password: Joi.string().optional(), +}).optional(); +``` + +## Webhook Validation Schemas + +### Webhook Configuration Validation +```typescript +export const webhookSchema = Joi.object({ + enabled: Joi.boolean().required(), + url: Joi.string().when('enabled', { + is: true, + then: Joi.required().uri({ scheme: ['http', 'https'] }), + otherwise: Joi.optional(), + }), + events: Joi.array().items( + Joi.string().valid( + 'APPLICATION_STARTUP', + 'INSTANCE_CREATE', + 'INSTANCE_DELETE', + 'QRCODE_UPDATED', + 'CONNECTION_UPDATE', + 'STATUS_INSTANCE', + 'MESSAGES_SET', + 'MESSAGES_UPSERT', + 'MESSAGES_UPDATE', + 'MESSAGES_DELETE', + 'CONTACTS_SET', + 'CONTACTS_UPSERT', + 'CONTACTS_UPDATE', + 'CHATS_SET', + 'CHATS_UPDATE', + 'CHATS_UPSERT', + 'CHATS_DELETE', + 'GROUPS_UPSERT', + 'GROUPS_UPDATE', + 'GROUP_PARTICIPANTS_UPDATE', + 'CALL' + ) + ).min(1).when('enabled', { + is: true, + then: Joi.required(), + otherwise: Joi.optional(), + }), + headers: Joi.object().pattern( + Joi.string(), + Joi.string() + ).optional(), + byEvents: Joi.boolean().optional().default(false), + base64: Joi.boolean().optional().default(false), +}).required(); +``` + +## Chatbot Validation Schemas + +### Base Chatbot Validation +```typescript +export const baseChatbotSchema = Joi.object({ + enabled: Joi.boolean().required(), + description: Joi.string().required().min(1).max(500), + expire: Joi.number().optional().min(0).max(86400), // 24 hours in seconds + keywordFinish: Joi.string().optional().max(100), + delayMessage: Joi.number().optional().min(0).max(10000), + unknownMessage: Joi.string().optional().max(1000), + listeningFromMe: Joi.boolean().optional().default(false), + stopBotFromMe: Joi.boolean().optional().default(false), + keepOpen: Joi.boolean().optional().default(false), + debounceTime: Joi.number().optional().min(0).max(60000), + triggerType: Joi.string().required().valid('ALL', 'KEYWORD', 'REGEX'), + triggerOperator: Joi.string().when('triggerType', { + is: 'KEYWORD', + then: Joi.required().valid('EQUALS', 'CONTAINS', 'STARTS_WITH', 'ENDS_WITH'), + otherwise: Joi.optional(), + }), + triggerValue: Joi.string().when('triggerType', { + is: Joi.valid('KEYWORD', 'REGEX'), + then: Joi.required().min(1).max(500), + otherwise: Joi.optional(), + }), + ignoreJids: Joi.array().items(Joi.string()).optional(), + splitMessages: Joi.boolean().optional().default(false), + timePerChar: Joi.number().optional().min(10).max(1000).default(100), +}).required(); + +export const typebotSchema = baseChatbotSchema.keys({ + url: Joi.string().required().uri({ scheme: ['http', 'https'] }), + typebot: Joi.string().required().min(1).max(100), + apiVersion: Joi.string().optional().valid('v1', 'v2').default('v1'), +}).required(); + +export const openaiSchema = baseChatbotSchema.keys({ + apiKey: Joi.string().required().min(10), + model: Joi.string().optional().valid( + 'gpt-3.5-turbo', + 'gpt-3.5-turbo-16k', + 'gpt-4', + 'gpt-4-32k', + 'gpt-4-turbo-preview' + ).default('gpt-3.5-turbo'), + systemMessage: Joi.string().optional().max(2000), + maxTokens: Joi.number().optional().min(1).max(4000).default(1000), + temperature: Joi.number().optional().min(0).max(2).default(0.7), +}).required(); +``` + +## Business API Validation Schemas + +### Template Validation +```typescript +export const templateSchema = Joi.object({ + name: Joi.string().required().min(1).max(512).pattern(/^[a-z0-9_]+$/), + category: Joi.string().required().valid('MARKETING', 'UTILITY', 'AUTHENTICATION'), + allowCategoryChange: Joi.boolean().required(), + language: Joi.string().required().pattern(/^[a-z]{2}_[A-Z]{2}$/), // e.g., pt_BR, en_US + components: Joi.array().items( + Joi.object({ + type: Joi.string().required().valid('HEADER', 'BODY', 'FOOTER', 'BUTTONS'), + format: Joi.string().when('type', { + is: 'HEADER', + then: Joi.valid('TEXT', 'IMAGE', 'VIDEO', 'DOCUMENT'), + otherwise: Joi.optional(), + }), + text: Joi.string().when('type', { + is: Joi.valid('HEADER', 'BODY', 'FOOTER'), + then: Joi.required().min(1).max(1024), + otherwise: Joi.optional(), + }), + buttons: Joi.array().when('type', { + is: 'BUTTONS', + then: Joi.items( + Joi.object({ + type: Joi.string().required().valid('QUICK_REPLY', 'URL', 'PHONE_NUMBER'), + text: Joi.string().required().min(1).max(25), + url: Joi.string().when('type', { + is: 'URL', + then: Joi.required().uri(), + otherwise: Joi.optional(), + }), + phone_number: Joi.string().when('type', { + is: 'PHONE_NUMBER', + then: Joi.required().pattern(/^\+?\d+$/), + otherwise: Joi.optional(), + }), + }) + ).min(1).max(10), + otherwise: Joi.optional(), + }), + }) + ).min(1).required(), + webhookUrl: Joi.string().optional().uri({ scheme: ['http', 'https'] }), +}).required(); + +export const catalogSchema = Joi.object({ + number: Joi.string().optional().pattern(/^\d+$/), + limit: Joi.number().optional().min(1).max(1000).default(10), + cursor: Joi.string().optional(), +}).optional(); +``` + +## Group Validation Schemas + +### Group Management Validation +```typescript +export const createGroupSchema = Joi.object({ + subject: Joi.string().required().min(1).max(100), + description: Joi.string().optional().max(500), + participants: Joi.array().items( + Joi.string().pattern(/^\d+$/) + ).min(1).max(256).required(), + promoteParticipants: Joi.boolean().optional().default(false), +}).required(); + +export const updateGroupSchema = Joi.object({ + subject: Joi.string().optional().min(1).max(100), + description: Joi.string().optional().max(500), +}).min(1).required(); + +export const groupParticipantsSchema = Joi.object({ + participants: Joi.array().items( + Joi.string().pattern(/^\d+$/) + ).min(1).max(50).required(), + action: Joi.string().required().valid('add', 'remove', 'promote', 'demote'), +}).required(); +``` + +## Label Validation Schemas + +### Label Management Validation +```typescript +export const labelSchema = Joi.object({ + name: Joi.string().required().min(1).max(100), + color: Joi.string().required().pattern(/^#[0-9A-Fa-f]{6}$/), // Hex color + predefinedId: Joi.string().optional(), +}).required(); + +export const handleLabelSchema = Joi.object({ + number: Joi.string().required().pattern(/^\d+$/), + labelId: Joi.string().required(), + action: Joi.string().required().valid('add', 'remove'), +}).required(); +``` + +## Custom Validation Functions + +### Phone Number Validation +```typescript +export function validatePhoneNumber(number: string): boolean { + // Remove any non-digit characters + const cleaned = number.replace(/\D/g, ''); + + // Check minimum and maximum length + if (cleaned.length < 10 || cleaned.length > 15) { + return false; + } + + // Check for valid country codes (basic validation) + const validCountryCodes = ['1', '7', '20', '27', '30', '31', '32', '33', '34', '36', '39', '40', '41', '43', '44', '45', '46', '47', '48', '49', '51', '52', '53', '54', '55', '56', '57', '58', '60', '61', '62', '63', '64', '65', '66', '81', '82', '84', '86', '90', '91', '92', '93', '94', '95', '98']; + + // Check if starts with valid country code + const startsWithValidCode = validCountryCodes.some(code => cleaned.startsWith(code)); + + return startsWithValidCode; +} + +export const phoneNumberValidator = Joi.string().custom((value, helpers) => { + if (!validatePhoneNumber(value)) { + return helpers.error('any.invalid'); + } + return value; +}, 'Phone number validation'); +``` + +### Base64 Validation +```typescript +export function validateBase64(base64: string): boolean { + try { + // Check if it's a valid base64 string + const decoded = Buffer.from(base64, 'base64').toString('base64'); + return decoded === base64; + } catch { + return false; + } +} + +export const base64Validator = Joi.string().custom((value, helpers) => { + if (!validateBase64(value)) { + return helpers.error('any.invalid'); + } + return value; +}, 'Base64 validation'); +``` + +### URL Validation with Protocol Check +```typescript +export function validateWebhookUrl(url: string): boolean { + try { + const parsed = new URL(url); + return ['http:', 'https:'].includes(parsed.protocol); + } catch { + return false; + } +} + +export const webhookUrlValidator = Joi.string().custom((value, helpers) => { + if (!validateWebhookUrl(value)) { + return helpers.error('any.invalid'); + } + return value; +}, 'Webhook URL validation'); +``` + +## Validation Error Handling + +### Error Message Customization +```typescript +export const validationMessages = { + 'any.required': 'O campo {#label} é obrigatório', + 'string.empty': 'O campo {#label} não pode estar vazio', + 'string.min': 'O campo {#label} deve ter pelo menos {#limit} caracteres', + 'string.max': 'O campo {#label} deve ter no máximo {#limit} caracteres', + 'string.pattern.base': 'O campo {#label} possui formato inválido', + 'number.min': 'O campo {#label} deve ser maior ou igual a {#limit}', + 'number.max': 'O campo {#label} deve ser menor ou igual a {#limit}', + 'array.min': 'O campo {#label} deve ter pelo menos {#limit} itens', + 'array.max': 'O campo {#label} deve ter no máximo {#limit} itens', + 'any.only': 'O campo {#label} deve ser um dos valores: {#valids}', +}; + +export function formatValidationError(error: Joi.ValidationError): any { + return { + message: 'Dados de entrada inválidos', + details: error.details.map(detail => ({ + field: detail.path.join('.'), + message: detail.message, + value: detail.context?.value, + })), + }; +} +``` + +## Schema Composition + +### Reusable Schema Components +```typescript +export const commonFields = { + instanceName: Joi.string().required().min(1).max(100).pattern(/^[a-zA-Z0-9_-]+$/), + number: phoneNumberValidator.required(), + delay: Joi.number().optional().min(0).max(60000), + enabled: Joi.boolean().optional().default(true), +}; + +export const mediaFields = { + mediatype: Joi.string().required().valid('image', 'video', 'audio', 'document'), + media: Joi.alternatives().try( + Joi.string().uri(), + base64Validator, + ).required(), + caption: Joi.string().optional().max(1024), + fileName: Joi.string().optional().max(255), +}; + +// Compose schemas using common fields +export const quickMessageSchema = Joi.object({ + ...commonFields, + text: Joi.string().required().min(1).max(4096), +}).required(); + +export const quickMediaSchema = Joi.object({ + ...commonFields, + ...mediaFields, +}).required(); +``` \ No newline at end of file diff --git a/.env.example b/.env.example index 679d15f6e..73a3b40d3 100644 --- a/.env.example +++ b/.env.example @@ -1,3 +1,4 @@ +SERVER_NAME=evolution SERVER_TYPE=http SERVER_PORT=8080 # Server URL - Set your application url @@ -8,6 +9,28 @@ SSL_CONF_FULLCHAIN=/path/to/cert.crt SENTRY_DSN= +# Telemetry - Set to false to disable telemetry +TELEMETRY_ENABLED=true +TELEMETRY_URL= + +# Prometheus metrics - Set to true to enable Prometheus metrics +PROMETHEUS_METRICS=false +METRICS_AUTH_REQUIRED=true +METRICS_USER=prometheus +METRICS_PASSWORD=secure_random_password_here +METRICS_ALLOWED_IPS=127.0.0.1,10.0.0.100,192.168.1.50 + +# Proxy configuration (optional) +PROXY_HOST= +PROXY_PORT= +PROXY_PROTOCOL= +PROXY_USERNAME= +PROXY_PASSWORD= + +# Audio converter API (optional) +API_AUDIO_CONVERTER= +API_AUDIO_CONVERTER_KEY= + # Cors - * for all or set separate by commas - ex.: 'yourdomain1.com, yourdomain2.com' CORS_ORIGIN=* CORS_METHODS=GET,POST,PUT,DELETE @@ -96,9 +119,40 @@ SQS_SECRET_ACCESS_KEY= SQS_ACCOUNT_ID= SQS_REGION= +SQS_GLOBAL_ENABLED=false +SQS_GLOBAL_FORCE_SINGLE_QUEUE=false +SQS_GLOBAL_APPLICATION_STARTUP=false +SQS_GLOBAL_CALL=false +SQS_GLOBAL_CHATS_DELETE=false +SQS_GLOBAL_CHATS_SET=false +SQS_GLOBAL_CHATS_UPDATE=false +SQS_GLOBAL_CHATS_UPSERT=false +SQS_GLOBAL_CONNECTION_UPDATE=false +SQS_GLOBAL_CONTACTS_SET=false +SQS_GLOBAL_CONTACTS_UPDATE=false +SQS_GLOBAL_CONTACTS_UPSERT=false +SQS_GLOBAL_GROUP_PARTICIPANTS_UPDATE=false +SQS_GLOBAL_GROUPS_UPDATE=false +SQS_GLOBAL_GROUPS_UPSERT=false +SQS_GLOBAL_LABELS_ASSOCIATION=false +SQS_GLOBAL_LABELS_EDIT=false +SQS_GLOBAL_LOGOUT_INSTANCE=false +SQS_GLOBAL_MESSAGES_DELETE=false +SQS_GLOBAL_MESSAGES_EDITED=false +SQS_GLOBAL_MESSAGES_SET=false +SQS_GLOBAL_MESSAGES_UPDATE=false +SQS_GLOBAL_MESSAGES_UPSERT=false +SQS_GLOBAL_PRESENCE_UPDATE=false +SQS_GLOBAL_QRCODE_UPDATED=false +SQS_GLOBAL_REMOVE_INSTANCE=false +SQS_GLOBAL_SEND_MESSAGE=false +SQS_GLOBAL_TYPEBOT_CHANGE_STATUS=false +SQS_GLOBAL_TYPEBOT_START=false + # Websocket - Environment variables WEBSOCKET_ENABLED=false WEBSOCKET_GLOBAL_EVENTS=false +WEBSOCKET_ALLOWED_HOSTS=127.0.0.1,::1,::ffff:127.0.0.1 # Pusher - Environment variables PUSHER_ENABLED=false @@ -136,6 +190,60 @@ PUSHER_EVENTS_CALL=true PUSHER_EVENTS_TYPEBOT_START=false PUSHER_EVENTS_TYPEBOT_CHANGE_STATUS=false +# Kafka - Environment variables +KAFKA_ENABLED=false +KAFKA_CLIENT_ID=evolution-api +KAFKA_BROKERS=localhost:9092 +KAFKA_CONNECTION_TIMEOUT=3000 +KAFKA_REQUEST_TIMEOUT=30000 +# Global events - By enabling this variable, events from all instances are sent to global Kafka topics. +KAFKA_GLOBAL_ENABLED=false +KAFKA_CONSUMER_GROUP_ID=evolution-api-consumers +KAFKA_TOPIC_PREFIX=evolution +KAFKA_NUM_PARTITIONS=1 +KAFKA_REPLICATION_FACTOR=1 +KAFKA_AUTO_CREATE_TOPICS=false +# Choose the events you want to send to Kafka +KAFKA_EVENTS_APPLICATION_STARTUP=false +KAFKA_EVENTS_INSTANCE_CREATE=false +KAFKA_EVENTS_INSTANCE_DELETE=false +KAFKA_EVENTS_QRCODE_UPDATED=false +KAFKA_EVENTS_MESSAGES_SET=false +KAFKA_EVENTS_MESSAGES_UPSERT=false +KAFKA_EVENTS_MESSAGES_EDITED=false +KAFKA_EVENTS_MESSAGES_UPDATE=false +KAFKA_EVENTS_MESSAGES_DELETE=false +KAFKA_EVENTS_SEND_MESSAGE=false +KAFKA_EVENTS_SEND_MESSAGE_UPDATE=false +KAFKA_EVENTS_CONTACTS_SET=false +KAFKA_EVENTS_CONTACTS_UPSERT=false +KAFKA_EVENTS_CONTACTS_UPDATE=false +KAFKA_EVENTS_PRESENCE_UPDATE=false +KAFKA_EVENTS_CHATS_SET=false +KAFKA_EVENTS_CHATS_UPSERT=false +KAFKA_EVENTS_CHATS_UPDATE=false +KAFKA_EVENTS_CHATS_DELETE=false +KAFKA_EVENTS_GROUPS_UPSERT=false +KAFKA_EVENTS_GROUPS_UPDATE=false +KAFKA_EVENTS_GROUP_PARTICIPANTS_UPDATE=false +KAFKA_EVENTS_CONNECTION_UPDATE=false +KAFKA_EVENTS_LABELS_EDIT=false +KAFKA_EVENTS_LABELS_ASSOCIATION=false +KAFKA_EVENTS_CALL=false +KAFKA_EVENTS_TYPEBOT_START=false +KAFKA_EVENTS_TYPEBOT_CHANGE_STATUS=false +# SASL Authentication (optional) +KAFKA_SASL_ENABLED=false +KAFKA_SASL_MECHANISM=plain +KAFKA_SASL_USERNAME= +KAFKA_SASL_PASSWORD= +# SSL Configuration (optional) +KAFKA_SSL_ENABLED=false +KAFKA_SSL_REJECT_UNAUTHORIZED=true +KAFKA_SSL_CA= +KAFKA_SSL_KEY= +KAFKA_SSL_CERT= + # WhatsApp Business API - Environment variables # Token used to validate the webhook on the Facebook APP WA_BUSINESS_TOKEN_WEBHOOK=evolution diff --git a/.eslintrc.js b/.eslintrc.js index b77e37db4..8f54a7766 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -31,16 +31,9 @@ module.exports = { 'import/no-duplicates': 'error', 'simple-import-sort/imports': 'error', 'simple-import-sort/exports': 'error', - '@typescript-eslint/ban-types': [ - 'error', - { - extendDefaults: true, - types: { - '{}': false, - Object: false, - }, - }, - ], + '@typescript-eslint/no-empty-object-type': 'off', + '@typescript-eslint/no-wrapper-object-types': 'off', + '@typescript-eslint/no-unused-expressions': 'off', 'prettier/prettier': ['error', { endOfLine: 'auto' }], }, }; diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 000000000..7cdafa179 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,81 @@ +name: 🐛 Bug Report +description: Report a bug or unexpected behavior +title: "[BUG] " +labels: ["bug", "needs-triage"] +assignees: [] + +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + Please search existing issues before creating a new one. + + - type: textarea + id: description + attributes: + label: 📋 Bug Description + description: A clear and concise description of what the bug is. + placeholder: Describe the bug... + validations: + required: true + + - type: textarea + id: reproduction + attributes: + label: 🔄 Steps to Reproduce + description: Steps to reproduce the behavior + placeholder: | + 1. Go to '...' + 2. Click on '....' + 3. Scroll down to '....' + 4. See error + validations: + required: true + + - type: textarea + id: expected + attributes: + label: ✅ Expected Behavior + description: A clear and concise description of what you expected to happen. + placeholder: What should happen? + validations: + required: true + + - type: textarea + id: actual + attributes: + label: ❌ Actual Behavior + description: A clear and concise description of what actually happened. + placeholder: What actually happened? + validations: + required: true + + - type: textarea + id: environment + attributes: + label: 🌍 Environment + description: Please provide information about your environment + value: | + - OS: [e.g. Ubuntu 20.04, Windows 10, macOS 12.0] + - Node.js version: [e.g. 18.17.0] + - Evolution API version: [e.g. 2.3.7] + - Database: [e.g. PostgreSQL 14, MySQL 8.0] + - Connection type: [e.g. Baileys, WhatsApp Business API] + validations: + required: true + + - type: textarea + id: logs + attributes: + label: 📋 Logs + description: If applicable, add logs to help explain your problem. + placeholder: Paste relevant logs here... + render: shell + + - type: textarea + id: additional + attributes: + label: 📝 Additional Context + description: Add any other context about the problem here. + placeholder: Any additional information... diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 000000000..789db1eb1 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,85 @@ +name: ✨ Feature Request +description: Suggest a new feature or enhancement +title: "[FEATURE] " +labels: ["enhancement", "needs-triage"] +assignees: [] + +body: + - type: markdown + attributes: + value: | + Thanks for suggesting a new feature! + Please check our [Feature Requests on Canny](https://evolutionapi.canny.io/feature-requests) first. + + - type: textarea + id: problem + attributes: + label: 🎯 Problem Statement + description: Is your feature request related to a problem? Please describe. + placeholder: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + validations: + required: true + + - type: textarea + id: solution + attributes: + label: 💡 Proposed Solution + description: Describe the solution you'd like + placeholder: A clear and concise description of what you want to happen. + validations: + required: true + + - type: textarea + id: alternatives + attributes: + label: 🔄 Alternatives Considered + description: Describe alternatives you've considered + placeholder: A clear and concise description of any alternative solutions or features you've considered. + + - type: dropdown + id: priority + attributes: + label: 📊 Priority + description: How important is this feature to you? + options: + - Low - Nice to have + - Medium - Would be helpful + - High - Important for my use case + - Critical - Blocking my work + validations: + required: true + + - type: dropdown + id: component + attributes: + label: 🧩 Component + description: Which component does this feature relate to? + options: + - WhatsApp Integration (Baileys) + - WhatsApp Business API + - Chatwoot Integration + - Typebot Integration + - OpenAI Integration + - Dify Integration + - API Endpoints + - Database + - Authentication + - Webhooks + - File Storage + - Other + + - type: textarea + id: use_case + attributes: + label: 🎯 Use Case + description: Describe your specific use case for this feature + placeholder: How would you use this feature? What problem does it solve for you? + validations: + required: true + + - type: textarea + id: additional + attributes: + label: 📝 Additional Context + description: Add any other context, screenshots, or examples about the feature request here. + placeholder: Any additional information, mockups, or examples... diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..e35dd9e5c --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,41 @@ +## 📋 Description + + +## 🔗 Related Issue + +Closes #(issue_number) + +## 🧪 Type of Change + +- [ ] 🐛 Bug fix (non-breaking change which fixes an issue) +- [ ] ✨ New feature (non-breaking change which adds functionality) +- [ ] 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected) +- [ ] 📚 Documentation update +- [ ] 🔧 Refactoring (no functional changes) +- [ ] ⚡ Performance improvement +- [ ] 🧹 Code cleanup +- [ ] 🔒 Security fix + +## 🧪 Testing + +- [ ] Manual testing completed +- [ ] Functionality verified in development environment +- [ ] No breaking changes introduced +- [ ] Tested with different connection types (if applicable) + +## 📸 Screenshots (if applicable) + + +## ✅ Checklist + +- [ ] My code follows the project's style guidelines +- [ ] I have performed a self-review of my code +- [ ] I have commented my code, particularly in hard-to-understand areas +- [ ] I have made corresponding changes to the documentation +- [ ] My changes generate no new warnings +- [ ] I have manually tested my changes thoroughly +- [ ] I have verified the changes work with different scenarios +- [ ] Any dependent changes have been merged and published + +## 📝 Additional Notes + diff --git a/.github/workflows/check_code_quality.yml b/.github/workflows/check_code_quality.yml index 07bffd7ad..df156f211 100644 --- a/.github/workflows/check_code_quality.yml +++ b/.github/workflows/check_code_quality.yml @@ -1,6 +1,10 @@ name: Check Code Quality -on: [pull_request] +on: + pull_request: + branches: [ main, develop ] + push: + branches: [ main, develop ] jobs: check-lint-and-build: @@ -8,20 +12,30 @@ jobs: timeout-minutes: 10 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v5 + with: + submodules: recursive - name: Install Node - uses: actions/setup-node@v1 + uses: actions/setup-node@v5 with: node-version: 20.x + - name: Cache node modules + uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + - name: Install packages - run: npm install + run: npm ci - name: Check linting run: npm run lint:check - - name: Check build + - name: Generate Prisma client run: npm run db:generate - name: Check build diff --git a/.github/workflows/publish_docker_image.yml b/.github/workflows/publish_docker_image.yml index 09d09390e..c5a3996ed 100644 --- a/.github/workflows/publish_docker_image.yml +++ b/.github/workflows/publish_docker_image.yml @@ -14,7 +14,9 @@ jobs: packages: write steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 + with: + submodules: recursive - name: Docker meta id: meta @@ -37,7 +39,7 @@ jobs: - name: Build and push id: docker_build - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: platforms: linux/amd64,linux/arm64 push: true diff --git a/.github/workflows/publish_docker_image_homolog.yml b/.github/workflows/publish_docker_image_homolog.yml index b97a5e250..a76e1008b 100644 --- a/.github/workflows/publish_docker_image_homolog.yml +++ b/.github/workflows/publish_docker_image_homolog.yml @@ -14,7 +14,9 @@ jobs: packages: write steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 + with: + submodules: recursive - name: Docker meta id: meta @@ -37,7 +39,7 @@ jobs: - name: Build and push id: docker_build - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: platforms: linux/amd64,linux/arm64 push: true diff --git a/.github/workflows/publish_docker_image_latest.yml b/.github/workflows/publish_docker_image_latest.yml index cffdab01e..f73fe80e4 100644 --- a/.github/workflows/publish_docker_image_latest.yml +++ b/.github/workflows/publish_docker_image_latest.yml @@ -14,7 +14,9 @@ jobs: packages: write steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 + with: + submodules: recursive - name: Docker meta id: meta @@ -37,7 +39,7 @@ jobs: - name: Build and push id: docker_build - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: platforms: linux/amd64,linux/arm64 push: true diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml new file mode 100644 index 000000000..b83f0b5d9 --- /dev/null +++ b/.github/workflows/security.yml @@ -0,0 +1,55 @@ +name: Security Scan + +on: + push: + branches: [ main, develop ] + pull_request: + branches: [ main, develop ] + schedule: + - cron: '0 0 * * 1' # Weekly on Mondays + +jobs: + codeql: + name: CodeQL Analysis + runs-on: ubuntu-latest + timeout-minutes: 15 + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'javascript' ] + + steps: + - name: Checkout repository + uses: actions/checkout@v5 + with: + submodules: recursive + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + + - name: Autobuild + uses: github/codeql-action/autobuild@v3 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" + + dependency-review: + name: Dependency Review + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + steps: + - name: Checkout Repository + uses: actions/checkout@v5 + with: + submodules: recursive + - name: Dependency Review + uses: actions/dependency-review-action@v4 diff --git a/.gitignore b/.gitignore index 1cecfa988..768d8afa4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,11 @@ +# Repo +Baileys # compiled output /dist /node_modules -.cursor* - /Docker/.env -.vscode - # Logs logs/**.json *.log diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..ef5b3e63c --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "evolution-manager-v2"] + path = evolution-manager-v2 + url = https://github.com/EvolutionAPI/evolution-manager-v2.git diff --git a/.husky/README.md b/.husky/README.md new file mode 100644 index 000000000..14d5fa8b1 --- /dev/null +++ b/.husky/README.md @@ -0,0 +1,51 @@ +# Git Hooks Configuration + +Este projeto usa [Husky](https://typicode.github.io/husky/) para automatizar verificações de qualidade de código. + +## Hooks Configurados + +### Pre-commit +- **Arquivo**: `.husky/pre-commit` +- **Executa**: `npx lint-staged` +- **Função**: Executa lint e correções automáticas apenas nos arquivos modificados + +### Pre-push +- **Arquivo**: `.husky/pre-push` +- **Executa**: `npm run build` + `npm run lint:check` +- **Função**: Verifica se o projeto compila e não tem erros de lint antes do push + +## Lint-staged Configuration + +Configurado no `package.json`: + +```json +"lint-staged": { + "src/**/*.{ts,js}": [ + "eslint --fix", + "git add" + ], + "src/**/*.ts": [ + "npm run build" + ] +} +``` + +## Como funciona + +1. **Ao fazer commit**: Executa lint apenas nos arquivos modificados +2. **Ao fazer push**: Executa build completo e verificação de lint +3. **Se houver erros**: O commit/push é bloqueado até correção + +## Comandos úteis + +```bash +# Pular hooks (não recomendado) +git commit --no-verify +git push --no-verify + +# Executar lint manualmente +npm run lint + +# Executar build manualmente +npm run build +``` diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100755 index 000000000..0a4b97de5 --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1 @@ +npx --no -- commitlint --edit $1 diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 000000000..2312dc587 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +npx lint-staged diff --git a/.husky/pre-push b/.husky/pre-push new file mode 100755 index 000000000..a72538ac2 --- /dev/null +++ b/.husky/pre-push @@ -0,0 +1,2 @@ +npm run build +npm run lint:check diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 000000000..143e6c748 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,355 @@ +# Evolution API - AI Agent Guidelines + +This document provides comprehensive guidelines for AI agents (Claude, GPT, Cursor, etc.) working with the Evolution API codebase. + +## Project Overview + +**Evolution API** is a production-ready, multi-tenant WhatsApp API platform built with Node.js, TypeScript, and Express.js. It supports multiple WhatsApp providers and extensive integrations with chatbots, CRM systems, and messaging platforms. + +## Project Structure & Module Organization + +### Core Directories +- **`src/`** – TypeScript source code with modular architecture + - `api/controllers/` – HTTP route handlers (thin layer) + - `api/services/` – Business logic (core functionality) + - `api/routes/` – Express route definitions (RouterBroker pattern) + - `api/integrations/` – External service integrations + - `channel/` – WhatsApp providers (Baileys, Business API, Evolution) + - `chatbot/` – AI/Bot integrations (OpenAI, Dify, Typebot, Chatwoot) + - `event/` – Event systems (WebSocket, RabbitMQ, SQS, NATS, Pusher) + - `storage/` – File storage (S3, MinIO) + - `dto/` – Data Transfer Objects (simple classes, no decorators) + - `guards/` – Authentication/authorization middleware + - `types/` – TypeScript type definitions + - `repository/` – Data access layer (Prisma) +- **`prisma/`** – Database schemas and migrations + - `postgresql-schema.prisma` / `mysql-schema.prisma` – Provider-specific schemas + - `postgresql-migrations/` / `mysql-migrations/` – Provider-specific migrations +- **`config/`** – Environment and application configuration +- **`utils/`** – Shared utilities and helper functions +- **`validate/`** – JSONSchema7 validation schemas +- **`exceptions/`** – Custom HTTP exception classes +- **`cache/`** – Redis and local cache implementations + +### Build & Deployment +- **`dist/`** – Build output (do not edit directly) +- **`public/`** – Static assets and media files +- **`Docker*`**, **`docker-compose*.yaml`** – Containerization and local development stack + +## Build, Test, and Development Commands + +### Development Workflow +```bash +# Development server with hot reload +npm run dev:server + +# Direct execution for testing +npm start + +# Production build and run +npm run build +npm run start:prod +``` + +### Code Quality +```bash +# Linting and formatting +npm run lint # ESLint with auto-fix +npm run lint:check # ESLint check only + +# Commit with conventional commits +npm run commit # Interactive commit with Commitizen +``` + +### Database Management +```bash +# Set database provider first (CRITICAL) +export DATABASE_PROVIDER=postgresql # or mysql + +# Generate Prisma client +npm run db:generate + +# Development migrations (with provider sync) +npm run db:migrate:dev # Unix/Mac +npm run db:migrate:dev:win # Windows + +# Production deployment +npm run db:deploy # Unix/Mac +npm run db:deploy:win # Windows + +# Database tools +npm run db:studio # Open Prisma Studio +``` + +### Docker Development +```bash +# Start local services (Redis, PostgreSQL, etc.) +docker-compose up -d + +# Full development stack +docker-compose -f docker-compose.dev.yaml up -d +``` + +## Coding Standards & Architecture Patterns + +### Code Style (Enforced by ESLint + Prettier) +- **TypeScript strict mode** with full type coverage +- **2-space indentation**, single quotes, trailing commas +- **120-character line limit** +- **Import order** via `simple-import-sort` +- **File naming**: `feature.kind.ts` (e.g., `whatsapp.baileys.service.ts`) +- **Naming conventions**: + - Classes: `PascalCase` + - Functions/variables: `camelCase` + - Constants: `UPPER_SNAKE_CASE` + - Files: `kebab-case.type.ts` + +### Architecture Patterns + +#### Service Layer Pattern +```typescript +export class ExampleService { + constructor(private readonly waMonitor: WAMonitoringService) {} + + private readonly logger = new Logger('ExampleService'); + + public async create(instance: InstanceDto, data: ExampleDto) { + // Business logic here + return { example: { ...instance, data } }; + } + + public async find(instance: InstanceDto): Promise { + try { + const result = await this.waMonitor.waInstances[instance.instanceName].findData(); + return result || null; // Return null on not found (Evolution pattern) + } catch (error) { + this.logger.error('Error finding data:', error); + return null; // Return null on error (Evolution pattern) + } + } +} +``` + +#### Controller Pattern (Thin Layer) +```typescript +export class ExampleController { + constructor(private readonly exampleService: ExampleService) {} + + public async createExample(instance: InstanceDto, data: ExampleDto) { + return this.exampleService.create(instance, data); + } +} +``` + +#### RouterBroker Pattern +```typescript +export class ExampleRouter extends RouterBroker { + constructor(...guards: any[]) { + super(); + this.router.post(this.routerPath('create'), ...guards, async (req, res) => { + const response = await this.dataValidate({ + request: req, + schema: exampleSchema, // JSONSchema7 + ClassRef: ExampleDto, + execute: (instance, data) => controller.createExample(instance, data), + }); + res.status(201).json(response); + }); + } +} +``` + +#### DTO Pattern (Simple Classes) +```typescript +// CORRECT - Evolution API pattern (no decorators) +export class ExampleDto { + name: string; + description?: string; + enabled: boolean; +} + +// INCORRECT - Don't use class-validator decorators +export class BadExampleDto { + @IsString() // ❌ Evolution API doesn't use decorators + name: string; +} +``` + +#### Validation Pattern (JSONSchema7) +```typescript +import { JSONSchema7 } from 'json-schema'; +import { v4 } from 'uuid'; + +export const exampleSchema: JSONSchema7 = { + $id: v4(), + type: 'object', + properties: { + name: { type: 'string' }, + description: { type: 'string' }, + enabled: { type: 'boolean' }, + }, + required: ['name', 'enabled'], +}; +``` + +## Multi-Tenant Architecture + +### Instance Isolation +- **CRITICAL**: All operations must be scoped by `instanceName` or `instanceId` +- **Database queries**: Always include `where: { instanceId: ... }` +- **Authentication**: Validate instance ownership before operations +- **Data isolation**: Complete separation between tenant instances + +### WhatsApp Instance Management +```typescript +// Access instance via WAMonitoringService +const waInstance = this.waMonitor.waInstances[instance.instanceName]; +if (!waInstance) { + throw new NotFoundException(`Instance ${instance.instanceName} not found`); +} +``` + +## Database Patterns + +### Multi-Provider Support +- **PostgreSQL**: Uses `@db.Integer`, `@db.JsonB`, `@default(now())` +- **MySQL**: Uses `@db.Int`, `@db.Json`, `@default(now())` +- **Environment**: Set `DATABASE_PROVIDER=postgresql` or `mysql` +- **Migrations**: Provider-specific folders auto-selected + +### Prisma Repository Pattern +```typescript +// Always use PrismaRepository for database operations +const result = await this.prismaRepository.instance.findUnique({ + where: { name: instanceName }, +}); +``` + +## Integration Patterns + +### Channel Integration (WhatsApp Providers) +- **Baileys**: WhatsApp Web with QR code authentication +- **Business API**: Official Meta WhatsApp Business API +- **Evolution API**: Custom WhatsApp integration +- **Pattern**: Extend base channel service classes + +### Chatbot Integration +- **Base classes**: Extend `BaseChatbotService` and `BaseChatbotController` +- **Trigger system**: Support keyword, regex, and advanced triggers +- **Session management**: Handle conversation state per user +- **Available integrations**: EvolutionBot, OpenAI, Dify, Typebot, Chatwoot, Flowise, N8N, EvoAI + +### Event Integration +- **Internal events**: EventEmitter2 for application events +- **External events**: WebSocket, RabbitMQ, SQS, NATS, Pusher +- **Webhook delivery**: Reliable delivery with retry logic + +## Testing Guidelines + +### Current State +- **No formal test suite** currently implemented +- **Manual testing** is the primary approach +- **Integration testing** in development environment + +### Testing Strategy +```typescript +// Place tests in test/ directory as *.test.ts +// Run: npm test (watches test/all.test.ts) + +describe('ExampleService', () => { + it('should create example', async () => { + // Mock external dependencies + // Test business logic + // Assert expected behavior + }); +}); +``` + +### Recommended Approach +- Focus on **critical business logic** in services +- **Mock external dependencies** (WhatsApp APIs, databases) +- **Integration tests** for API endpoints +- **Manual testing** for WhatsApp connection flows + +## Commit & Pull Request Guidelines + +### Conventional Commits (Enforced by commitlint) +```bash +# Use interactive commit tool +npm run commit + +# Commit format: type(scope): subject (max 100 chars) +# Types: feat, fix, docs, style, refactor, perf, test, chore, ci, build, revert, security +``` + +### Examples +- `feat(api): add WhatsApp message status endpoint` +- `fix(baileys): resolve connection timeout issue` +- `docs(readme): update installation instructions` +- `refactor(service): extract common message validation logic` + +### Pull Request Requirements +- **Clear description** of changes and motivation +- **Linked issues** if applicable +- **Migration impact** (specify database provider) +- **Local testing steps** with screenshots/logs +- **Breaking changes** clearly documented + +## Security & Configuration + +### Environment Setup +```bash +# Copy example environment file +cp .env.example .env + +# NEVER commit secrets to version control +# Set DATABASE_PROVIDER before database commands +export DATABASE_PROVIDER=postgresql # or mysql +``` + +### Security Best Practices +- **API key authentication** via `apikey` header +- **Input validation** with JSONSchema7 +- **Rate limiting** on all endpoints +- **Webhook signature validation** +- **Instance-based access control** +- **Secure defaults** for all configurations + +### Vulnerability Reporting +- See `SECURITY.md` for security vulnerability reporting process +- Contact: `contato@evolution-api.com` + +## Communication Standards + +### Language Requirements +- **User communication**: Always respond in Portuguese (PT-BR) +- **Code/comments**: English for technical documentation +- **API responses**: English for consistency +- **Error messages**: Portuguese for user-facing errors + +### Documentation Standards +- **Inline comments**: Document complex business logic +- **API documentation**: Document all public endpoints +- **Integration guides**: Document new integration patterns +- **Migration guides**: Document database schema changes + +## Performance & Scalability + +### Caching Strategy +- **Redis primary**: Distributed caching for production +- **Node-cache fallback**: Local caching when Redis unavailable +- **TTL strategy**: Appropriate cache expiration per data type +- **Cache invalidation**: Proper invalidation on data changes + +### Connection Management +- **Database**: Prisma connection pooling +- **WhatsApp**: One connection per instance with lifecycle management +- **Redis**: Connection pooling and retry logic +- **External APIs**: Rate limiting and retry with exponential backoff + +### Monitoring & Observability +- **Structured logging**: Pino logger with correlation IDs +- **Error tracking**: Comprehensive error scenarios +- **Health checks**: Instance status and connection monitoring +- **Telemetry**: Usage analytics (non-sensitive data only) + diff --git a/CHANGELOG.md b/CHANGELOG.md index b8f25542e..5102b5375 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,328 @@ +# 2.3.7 (2025-12-05) + +### Features + +* **WhatsApp Business Meta Templates**: Add update and delete endpoints for Meta templates + - New endpoints to edit and delete WhatsApp Business templates + - Added DTOs and validation schemas for template management + - Enhanced template lifecycle management capabilities + +* **Events API**: Add isLatest and progress to messages.set event + - Allows consumers to know when history sync is complete (isLatest=true) + - Track sync progress percentage through webhooks + - Added extra field to EmitData type for additional payload properties + - Updated all event controllers (webhook, rabbitmq, sqs, websocket, pusher, kafka, nats) + +* **N8N Integration**: Add quotedMessage to payload in sendMessageToBot + - Support for quoted messages in N8N chatbot integration + - Enhanced message context information + +* **WebSocket**: Add wildcard "*" to allow all hosts to connect via websocket + - More flexible host configuration for WebSocket connections + - Improved host validation logic in WebsocketController + +* **Pix Support**: Handle interactive button message for pix + - Support for interactive Pix button messages + - Enhanced payment flow integration + +### Fixed + +* **Baileys Message Processor**: Fix incoming message events not working after reconnection + - Added cleanup logic in mount() to prevent memory leaks from multiple subscriptions + - Recreate messageSubject if it was completed during logout + - Remount messageProcessor in connectToWhatsapp() to ensure subscription is active + - Fixed issue where onDestroy() calls complete() on RxJS Subject, making it permanently closed + - Ensures old subscriptions are properly cleaned up before creating new ones + +* **Baileys Authentication**: Resolve "waiting for message" state after reconnection + - Fixed Redis keys not being properly removed during instance logout + - Prevented loading of old/invalid cryptographic keys on reconnection + - Fixed blocking state where instances authenticate but cannot send messages + - Ensures new credentials (creds) are properly used after reconnection + +* **OnWhatsapp Cache**: Prevent unique constraint errors and optimize database writes + - Fixed `Unique constraint failed on the fields: (remoteJid)` error when sending to groups + - Refactored query to use OR condition finding by jidOptions or remoteJid + - Added deep comparison to skip unnecessary database updates + - Replaced sequential processing with Promise.allSettled for parallel execution + - Sorted JIDs alphabetically in jidOptions for accurate change detection + - Added normalizeJid helper function for cleaner code + +* **Proxy Integration**: Fix "Media upload failed on all hosts" error when using proxy + - Created makeProxyAgentUndici() for Undici-compatible proxy agents + - Fixed compatibility with Node.js 18+ native fetch() implementation + - Replaced traditional HttpsProxyAgent/SocksProxyAgent with Undici ProxyAgent + - Maintained legacy makeProxyAgent() for Axios compatibility + - Fixed protocol handling in makeProxyAgent to prevent undefined errors + +* **WhatsApp Business API**: Fix base64, filename and caption handling + - Corrected base64 media conversion in Business API + - Fixed filename handling for document messages + - Improved caption processing for media messages + - Enhanced remoteJid validation and processing + +* **Chat Service**: Fix fetchChats and message panel errors + - Fixed cleanMessageData errors in Manager message panel + - Improved chat fetching reliability + - Enhanced message data sanitization + +* **Contact Filtering**: Apply where filters correctly in findContacts endpoint + - Fixed endpoint to process all where clause fields (id, remoteJid, pushName) + - Previously only processed remoteJid field, ignoring other filters + - Added remoteJid field to contactValidateSchema for proper validation + - Maintained multi-tenant isolation with instanceId filtering + - Allows filtering contacts by any supported field instead of returning all contacts + +* **Chatwoot and Baileys Integration**: Multiple integration improvements + - Enhanced code formatting and consistency + - Fixed integration issues between Chatwoot and Baileys services + - Improved message handling and delivery + +* **Baileys Message Loss**: Prevent message loss from WhatsApp stub placeholders + - Fixed messages being lost and not saved to database, especially for channels/newsletters (@lid) + - Detects WhatsApp stubs through messageStubParameters containing 'Message absent from node' + - Prevents adding stubs to duplicate message cache + - Allows real message to be processed when it arrives after decryption + - Maintains stub discard to avoid saving empty placeholders + +* **Database Contacts**: Respect DATABASE_SAVE_DATA_CONTACTS in contact updates + - Added missing conditional checks for DATABASE_SAVE_DATA_CONTACTS configuration + - Fixed profile picture updates attempting to save when database save is disabled + - Fixed unawaited promise in contacts.upsert handler + +* **Prisma/PostgreSQL**: Add unique constraint to Chat model + - Generated migration to add unique index on instanceId and remoteJid + - Added deduplication step before creating index to prevent constraint violations + - Prevents chat duplication in database + +* **MinIO Upload**: Handle messageContextInfo in media upload to prevent MinIO errors + - Prevents errors when uploading media with messageContextInfo metadata + - Improved error handling for media storage operations + +* **Typebot**: Fix message routing for @lid JIDs + - Typebot now responds to messages from JIDs ending with @lid + - Maintains complete JID for @lid instead of extracting only number + - Fixed condition: `remoteJid.includes('@lid') ? remoteJid : remoteJid.split('@')[0]` + - Handles both @s.whatsapp.net and @lid message formats + +* **Message Filtering**: Unify remoteJid filtering using OR with remoteJidAlt + - Improved message filtering with alternative JID support + - Better handling of messages with different JID formats + +* **@lid Integration**: Multiple fixes for @lid problems, message events and chatwoot errors + - Reorganized imports and improved message handling in BaileysStartupService + - Enhanced remoteJid processing to handle @lid cases + - Improved jid normalization and type safety in Chatwoot integration + - Streamlined message handling logic and cache management + - Refactored message handling and polling updates with decryption logic for poll votes + - Improved event processing flow for various message types + +* **Chatwoot Contacts**: Fix contact duplication error on import + - Resolved 'ON CONFLICT DO UPDATE command cannot affect row a second time' error + - Removed attempt to update identifier field in conflict (part of constraint) + - Changed to update only updated_at field: `updated_at = NOW()` + - Allows duplicate contacts to be updated correctly without errors + +* **Chatwoot Service**: Fix async handling in update_last_seen method + - Added missing await for chatwootRequest in read message processing + - Prevents service failure when processing read messages + +* **Metrics Access**: Fix IP validation including x-forwarded-for + - Uses all IPs including x-forwarded-for header when checking metrics access + - Improved security and access control for metrics endpoint + +### Dependencies + +* **Baileys**: Updated to version 7.0.0-rc.9 + - Latest release candidate with multiple improvements and bug fixes + +* **AWS SDK**: Updated packages to version 3.936.0 + - Enhanced functionality and compatibility + - Performance improvements + +### Code Quality & Refactoring + +* **Template Management**: Remove unused template edit/delete DTOs after refactoring +* **Proxy Utilities**: Improve makeProxyAgent for Undici compatibility +* **Code Formatting**: Enhance code formatting and consistency across services +* **BaileysStartupService**: Fix indentation and remove unnecessary blank lines +* **Event Controllers**: Guard extra spread and prevent core field override in all event controllers +* **Import Organization**: Reorganize imports for better code structure and maintainability + +# 2.3.6 (2025-10-21) + +### Features + +* **Baileys, Chatwoot, OnWhatsapp Cache**: Multiple implementations and fixes + - Fixed cache for PN, LID and g.us numbers to send correct number + - Fixed audio and document sending via Chatwoot in Baileys channel + - Multiple fixes in Chatwoot integration + - Fixed ignored messages when receiving leads + +### Fixed + +* **Baileys**: Fix buffer storage in database + - Correctly save Uint8Array values to database +* **Baileys**: Simplify logging of messageSent object + - Fixed "this.isZero not is function" error + +### Chore + +* **Version**: Bump version to 2.3.6 and update Baileys dependency to 7.0.0-rc.6 +* **Workflows**: Update checkout step to include submodules + - Added 'submodules: recursive' option to checkout step in multiple workflow files to ensure submodules are properly initialized during CI/CD processes +* **Manager**: Update asset files and install process + - Updated subproject reference in evolution-manager-v2 to the latest commit + - Enhanced the manager_install.sh script to include npm install and build steps + - Replaced old JavaScript asset file with a new version for improved performance + - Added a new CSS file for consistent styling across the application + +# 2.3.5 (2025-10-15) + +### Features + +* **Chatwoot Enhancements**: Comprehensive improvements to message handling, editing, deletion and i18n +* **Participants Data**: Add participantsData field maintaining backward compatibility for group participants +* **LID to Phone Number**: Convert LID to phoneNumber on group participants +* **Docker Configurations**: Add Kafka and frontend services to Docker configurations + +### Fixed + +* **Kafka Migration**: Fixed PostgreSQL migration error for Kafka integration + - Corrected table reference from `"public"."Instance"` to `"Instance"` in foreign key constraint + - Fixed `ERROR: relation "public.Instance" does not exist` issue in migration `20250918182355_add_kafka_integration` + - Aligned table naming convention with other Evolution API migrations for consistency + - Resolved database migration failure that prevented Kafka integration setup +* **Update Baileys Version**: v7.0.0-rc.5 with compatibility fixes + - Fixed assertSessions signature compatibility using type assertion + - Fixed incompatibility in voice call (wavoip) with new Baileys version + - Handle undefined status in update by defaulting to 'DELETED' +* **Chatwoot Improvements**: Multiple fixes for enhanced reliability + - Correct chatId extraction for non-group JIDs + - Resolve webhook timeout on deletion with 5+ images + - Improve error handling in Chatwoot messages + - Adjust conversation verification logic and cache + - Optimize conversation reopening logic and connection notification + - Fix conversation reopening and connection loop +* **Baileys Message Handling**: Enhanced message processing + - Add warning log for messages not found + - Fix message verification in Baileys service + - Simplify linkPreview handling in BaileysStartupService +* **Media Validation**: Fix media content validation +* **PostgreSQL Connection**: Refactor connection with PostgreSQL and improve message handling + +### Code Quality & Refactoring + +* **Exponential Backoff**: Implement exponential backoff patterns and extract magic numbers to constants +* **TypeScript Build**: Update TypeScript build process and dependencies + +### + +# 2.3.4 (2025-09-23) + +### Features + +* **Kafka Integration**: Added Apache Kafka event integration for real-time event streaming + - New Kafka controller, router, and schema for event publishing + - Support for instance-specific and global event topics + - Configurable SASL/SSL authentication and connection settings + - Auto-creation of topics with configurable partitions and replication + - Consumer group management for reliable event processing + - Integration with existing event manager for seamless event distribution + +* **Evolution Manager v2 Open Source**: Evolution Manager v2 is now available as open source + - Added as git submodule with HTTPS URL for easy access + - Complete open source setup with Apache 2.0 license + Evolution API custom conditions + - GitHub templates for issues, pull requests, and workflows + - Comprehensive documentation and contribution guidelines + - Docker support for development and production environments + - CI/CD workflows for code quality, security audits, and automated builds + - Multi-language support (English, Portuguese, Spanish, French) + - Modern React + TypeScript + Vite frontend with Tailwind CSS + +* **EvolutionBot Enhancements**: Improved EvolutionBot functionality and message handling + - Implemented splitMessages functionality for better message segmentation + - Added linkPreview support for enhanced message presentation + - Centralized split logic across chatbot services for consistency + - Enhanced message formatting and delivery capabilities + +### Fixed + +* **MySQL Schema**: Fixed invalid default value errors for `createdAt` fields in `Evoai` and `EvoaiSetting` models + - Changed `@default(now())` to `@default(dbgenerated("CURRENT_TIMESTAMP"))` for MySQL compatibility + - Added missing relation fields (`N8n`, `N8nSetting`, `Evoai`, `EvoaiSetting`) in Instance model + - Resolved Prisma schema validation errors for MySQL provider + +* **Prisma Schema Validation**: Fixed `instanceName` field error in message creation + - Removed invalid `instanceName` field from message objects before database insertion + - Resolved `Unknown argument 'instanceName'` Prisma validation error + - Streamlined message data structure to match Prisma schema requirements + +* **Media Message Processing**: Enhanced media handling across chatbot services + - Fixed base64 conversion in EvoAI service for proper image processing + - Converted ArrayBuffer to base64 string using `Buffer.from().toString('base64')` + - Improved media URL handling and base64 encoding for better chatbot integration + - Enhanced image message detection and processing workflow + +* **Evolution Manager v2 Linting**: Resolved ESLint configuration conflicts + - Disabled conflicting Prettier rules in ESLint configuration + - Added comprehensive rule overrides for TypeScript and React patterns + - Fixed import ordering and code formatting issues + - Updated security vulnerabilities in dependencies (Vite, esbuild) + +### Code Quality & Refactoring + +* **Chatbot Services**: Streamlined media message handling across all chatbot integrations + - Standardized base64 and mediaUrl processing patterns + - Improved code readability and maintainability in media handling logic + - Enhanced error handling for media download and conversion processes + - Unified image message detection across different chatbot services + +* **Database Operations**: Improved data consistency and validation + - Enhanced Prisma schema compliance across all message operations + - Removed redundant instance name references for better data integrity + - Optimized message creation workflow with proper field validation + +### Environment Variables + +* Added comprehensive Kafka configuration options: + - `KAFKA_ENABLED`, `KAFKA_CLIENT_ID`, `KAFKA_BROKERS` + - `KAFKA_CONSUMER_GROUP_ID`, `KAFKA_TOPIC_PREFIX` + - `KAFKA_SASL_*` and `KAFKA_SSL_*` for authentication + - `KAFKA_EVENTS_*` for event type configuration + +# 2.3.3 (2025-09-18) + +### Features + +* Add extra fields to object sent to Flowise bot +* Add Prometheus-compatible /metrics endpoint (gated by PROMETHEUS_METRICS) +* Implement linkPreview support for Evolution Bot + +### Fixed + +* Address Path Traversal vulnerability in /assets endpoint by implementing security checks +* Configure Husky and lint-staged for automated code quality checks on commits and pushes +* Convert mediaKey from media messages to avoid bad decrypt errors +* Improve code formatting for better readability in WhatsApp service files +* Format messageGroupId assignment for improved readability +* Improve linkPreview implementation based on PR feedback +* Clean up code formatting for linkPreview implementation +* Use 'unknown' as fallback for clientName label +* Remove abort process when status is paused, allowing the chatbot return after the time expires and after being paused due to human interaction (stopBotFromMe) +* Enhance message content sanitization in Baileys service and improve message retrieval logic in Chatwoot service +* Integrate Typebot status change events for webhook in chatbot controller and service +* Mimetype of videos video + +### Security + +* **CRITICAL**: Fixed Path Traversal vulnerability in /assets endpoint that allowed unauthenticated local file read +* Customizable Websockets Security + +### Testing + +* Baileys Updates: v7.0.0-rc.3 ([Link](https://github.com/WhiskeySockets/Baileys/releases/tag/v7.0.0-rc.3)) + # 2.3.2 (2025-09-02) ### Features diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 000000000..7c0e87a04 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,223 @@ +# CLAUDE.md + +This file provides comprehensive guidance to Claude AI when working with the Evolution API codebase. + +## Project Overview + +**Evolution API** is a powerful, production-ready REST API for WhatsApp communication that supports multiple WhatsApp providers: +- **Baileys** (WhatsApp Web) - Open-source WhatsApp Web client +- **Meta Business API** - Official WhatsApp Business API +- **Evolution API** - Custom WhatsApp integration + +Built with **Node.js 20+**, **TypeScript 5+**, and **Express.js**, it provides extensive integrations with chatbots, CRM systems, and messaging platforms in a **multi-tenant architecture**. + +## Common Development Commands + +### Build and Run +```bash +# Development +npm run dev:server # Run in development with hot reload (tsx watch) + +# Production +npm run build # TypeScript check + tsup build +npm run start:prod # Run production build + +# Direct execution +npm start # Run with tsx +``` + +### Code Quality +```bash +npm run lint # ESLint with auto-fix +npm run lint:check # ESLint check only +npm run commit # Interactive commit with commitizen +``` + +### Database Management +```bash +# Set database provider first +export DATABASE_PROVIDER=postgresql # or mysql + +# Generate Prisma client (automatically uses DATABASE_PROVIDER env) +npm run db:generate + +# Deploy migrations (production) +npm run db:deploy # Unix/Mac +npm run db:deploy:win # Windows + +# Development migrations (with sync to provider folder) +npm run db:migrate:dev # Unix/Mac +npm run db:migrate:dev:win # Windows + +# Open Prisma Studio +npm run db:studio + +# Development migrations +npm run db:migrate:dev # Unix/Mac +npm run db:migrate:dev:win # Windows +``` + +### Testing +```bash +npm test # Run tests with watch mode +``` + +## Architecture Overview + +### Core Structure +- **Multi-tenant SaaS**: Complete instance isolation with per-tenant authentication +- **Multi-provider database**: PostgreSQL and MySQL via Prisma ORM with provider-specific schemas and migrations +- **WhatsApp integrations**: Baileys, Meta Business API, and Evolution API with unified interface +- **Event-driven architecture**: EventEmitter2 for internal events + WebSocket, RabbitMQ, SQS, NATS, Pusher for external events +- **Microservices pattern**: Modular integrations for chatbots, storage, and external services + +### Directory Layout +``` +src/ +├── api/ +│ ├── controllers/ # HTTP route handlers (thin layer) +│ ├── services/ # Business logic (core functionality) +│ ├── repository/ # Data access layer (Prisma) +│ ├── dto/ # Data Transfer Objects (simple classes) +│ ├── guards/ # Authentication/authorization middleware +│ ├── integrations/ # External service integrations +│ │ ├── channel/ # WhatsApp providers (Baileys, Business API, Evolution) +│ │ ├── chatbot/ # AI/Bot integrations (OpenAI, Dify, Typebot, Chatwoot) +│ │ ├── event/ # Event systems (WebSocket, RabbitMQ, SQS, NATS, Pusher) +│ │ └── storage/ # File storage (S3, MinIO) +│ ├── routes/ # Express route definitions (RouterBroker pattern) +│ └── types/ # TypeScript type definitions +├── config/ # Environment and app configuration +├── cache/ # Redis and local cache implementations +├── exceptions/ # Custom HTTP exception classes +├── utils/ # Shared utilities and helpers +└── validate/ # JSONSchema7 validation schemas +``` + +### Key Integration Points + +**Channel Integrations** (`src/api/integrations/channel/`): +- **Baileys**: WhatsApp Web client with QR code authentication +- **Business API**: Official Meta WhatsApp Business API +- **Evolution API**: Custom WhatsApp integration +- Connection lifecycle management per instance with automatic reconnection + +**Chatbot Integrations** (`src/api/integrations/chatbot/`): +- **EvolutionBot**: Native chatbot with trigger system +- **Chatwoot**: Customer service platform integration +- **Typebot**: Visual chatbot flow builder +- **OpenAI**: AI capabilities including GPT and Whisper (audio transcription) +- **Dify**: AI agent workflow platform +- **Flowise**: LangChain visual builder +- **N8N**: Workflow automation platform +- **EvoAI**: Custom AI integration + +**Event Integrations** (`src/api/integrations/event/`): +- **WebSocket**: Real-time Socket.io connections +- **RabbitMQ**: Message queue for async processing +- **Amazon SQS**: Cloud-based message queuing +- **NATS**: High-performance messaging system +- **Pusher**: Real-time push notifications + +**Storage Integrations** (`src/api/integrations/storage/`): +- **AWS S3**: Cloud object storage +- **MinIO**: Self-hosted S3-compatible storage +- Media file management and URL generation + +### Database Schema Management +- Separate schema files: `postgresql-schema.prisma` and `mysql-schema.prisma` +- Environment variable `DATABASE_PROVIDER` determines active database +- Migration folders are provider-specific and auto-selected during deployment + +### Authentication & Security +- **API key-based authentication** via `apikey` header (global or per-instance) +- **Instance-specific tokens** for WhatsApp connection authentication +- **Guards system** for route protection and authorization +- **Input validation** using JSONSchema7 with RouterBroker `dataValidate` +- **Rate limiting** and security middleware +- **Webhook signature validation** for external integrations + +## Important Implementation Details + +### WhatsApp Instance Management +- Each WhatsApp connection is an "instance" with unique name +- Instance data stored in database with connection state +- Session persistence in database or file system (configurable) +- Automatic reconnection handling with exponential backoff + +### Message Queue Architecture +- Supports RabbitMQ, Amazon SQS, and WebSocket for events +- Event types: message.received, message.sent, connection.update, etc. +- Configurable per instance which events to send + +### Media Handling +- Local storage or S3/Minio for media files +- Automatic media download from WhatsApp +- Media URL generation for external access +- Support for audio transcription via OpenAI + +### Multi-tenancy Support +- Instance isolation at database level +- Separate webhook configurations per instance +- Independent integration settings per instance + +## Environment Configuration + +Key environment variables are defined in `.env.example`. The system uses a strongly-typed configuration system via `src/config/env.config.ts`. + +Critical configurations: +- `DATABASE_PROVIDER`: postgresql or mysql +- `DATABASE_CONNECTION_URI`: Database connection string +- `AUTHENTICATION_API_KEY`: Global API authentication +- `REDIS_ENABLED`: Enable Redis cache +- `RABBITMQ_ENABLED`/`SQS_ENABLED`: Message queue options + +## Development Guidelines + +The project follows comprehensive development standards defined in `.cursor/rules/`: + +### Core Principles +- **Always respond in Portuguese (PT-BR)** for user communication +- **Follow established architecture patterns** (Service Layer, RouterBroker, etc.) +- **Robust error handling** with retry logic and graceful degradation +- **Multi-database compatibility** (PostgreSQL and MySQL) +- **Security-first approach** with input validation and rate limiting +- **Performance optimizations** with Redis caching and connection pooling + +### Code Standards +- **TypeScript strict mode** with full type coverage +- **JSONSchema7** for input validation (not class-validator) +- **Conventional Commits** enforced by commitlint +- **ESLint + Prettier** for code formatting +- **Service Object pattern** for business logic +- **RouterBroker pattern** for route handling with `dataValidate` + +### Architecture Patterns +- **Multi-tenant isolation** at database and instance level +- **Event-driven communication** with EventEmitter2 +- **Microservices integration** pattern for external services +- **Connection pooling** and lifecycle management +- **Caching strategy** with Redis primary and Node-cache fallback + +## Testing Approach + +Currently, the project has minimal formal testing infrastructure: +- **Manual testing** is the primary approach +- **Integration testing** in development environment +- **No unit test suite** currently implemented +- Test files can be placed in `test/` directory as `*.test.ts` +- Run `npm test` for watch mode development testing + +### Recommended Testing Strategy +- Focus on **critical business logic** in services +- **Mock external dependencies** (WhatsApp APIs, databases) +- **Integration tests** for API endpoints +- **Manual testing** for WhatsApp connection flows + +## Deployment Considerations + +- Docker support with `Dockerfile` and `docker-compose.yaml` +- Graceful shutdown handling for connections +- Health check endpoints for monitoring +- Sentry integration for error tracking +- Telemetry for usage analytics (non-sensitive data only) \ No newline at end of file diff --git a/Docker/kafka/docker-compose.yaml b/Docker/kafka/docker-compose.yaml new file mode 100644 index 000000000..dc1c794e0 --- /dev/null +++ b/Docker/kafka/docker-compose.yaml @@ -0,0 +1,51 @@ +version: '3.3' + +services: + zookeeper: + container_name: zookeeper + image: confluentinc/cp-zookeeper:7.5.0 + environment: + - ZOOKEEPER_CLIENT_PORT=2181 + - ZOOKEEPER_TICK_TIME=2000 + - ZOOKEEPER_SYNC_LIMIT=2 + volumes: + - zookeeper_data:/var/lib/zookeeper/ + ports: + - 2181:2181 + + kafka: + container_name: kafka + image: confluentinc/cp-kafka:7.5.0 + depends_on: + - zookeeper + environment: + - KAFKA_BROKER_ID=1 + - KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181 + - KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT,OUTSIDE:PLAINTEXT + - KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092,OUTSIDE://host.docker.internal:9094 + - KAFKA_INTER_BROKER_LISTENER_NAME=PLAINTEXT + - KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 + - KAFKA_TRANSACTION_STATE_LOG_MIN_ISR=1 + - KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR=1 + - KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS=0 + - KAFKA_AUTO_CREATE_TOPICS_ENABLE=true + - KAFKA_LOG_RETENTION_HOURS=168 + - KAFKA_LOG_SEGMENT_BYTES=1073741824 + - KAFKA_LOG_RETENTION_CHECK_INTERVAL_MS=300000 + - KAFKA_COMPRESSION_TYPE=gzip + ports: + - 29092:29092 + - 9092:9092 + - 9094:9094 + volumes: + - kafka_data:/var/lib/kafka/data + +volumes: + zookeeper_data: + kafka_data: + + +networks: + evolution-net: + name: evolution-net + driver: bridge \ No newline at end of file diff --git a/Docker/swarm/evolution_api_v2.yaml b/Docker/swarm/evolution_api_v2.yaml index 4055dfa3b..ccd31cdf7 100644 --- a/Docker/swarm/evolution_api_v2.yaml +++ b/Docker/swarm/evolution_api_v2.yaml @@ -2,7 +2,7 @@ version: "3.7" services: evolution_v2: - image: evoapicloud/evolution-api:v2.3.1 + image: evoapicloud/evolution-api:v2.3.7 volumes: - evolution_instances:/evolution/instances networks: diff --git a/Dockerfile b/Dockerfile index 02130c434..24c4e3bc7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:20-alpine AS builder +FROM node:24-alpine AS builder RUN apk update && \ apk add --no-cache git ffmpeg wget curl bash openssl @@ -30,7 +30,7 @@ RUN ./Docker/scripts/generate_database.sh RUN npm run build -FROM node:20-alpine AS final +FROM node:24-alpine AS final RUN apk update && \ apk add tzdata ffmpeg bash openssl diff --git a/Dockerfile.metrics b/Dockerfile.metrics new file mode 100644 index 000000000..e8d46d040 --- /dev/null +++ b/Dockerfile.metrics @@ -0,0 +1,19 @@ +FROM evoapicloud/evolution-api:latest AS base +WORKDIR /evolution + +# Copiamos apenas o necessário para recompilar o dist com as mudanças locais +COPY tsconfig.json tsup.config.ts package.json ./ +COPY src ./src + +# Recompila usando os node_modules já presentes na imagem base +RUN npm run build + +# Runtime final: reaproveita a imagem oficial e apenas sobrepõe o dist +FROM evoapicloud/evolution-api:latest AS final +WORKDIR /evolution +COPY --from=base /evolution/dist ./dist + +ENV PROMETHEUS_METRICS=true + +# Entrada original da imagem oficial já sobe o app em /evolution + diff --git a/LICENSE b/LICENSE index ad430f14a..18ebe6f6b 100644 --- a/LICENSE +++ b/LICENSE @@ -17,5 +17,5 @@ b. Your contributed code may be used for commercial purposes, including but not Apart from the specific conditions mentioned above, all other rights and restrictions follow the Apache License 2.0. Detailed information about the Apache License 2.0 can be found at http://www.apache.org/licenses/LICENSE-2.0. -© 2024 Evolution API +© 2025 Evolution API diff --git a/README.md b/README.md index 6d9b33441..eb7e638c1 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,9 @@ [![Discord Community](https://img.shields.io/badge/Discord-Community-blue)](https://evolution-api.com/discord) [![Postman Collection](https://img.shields.io/badge/Postman-Collection-orange)](https://evolution-api.com/postman) [![Documentation](https://img.shields.io/badge/Documentation-Official-green)](https://doc.evolution-api.com) +[![Feature Requests](https://img.shields.io/badge/Feature-Requests-purple)](https://evolutionapi.canny.io/feature-requests) +[![Roadmap](https://img.shields.io/badge/Roadmap-Community-blue)](https://evolutionapi.canny.io/feature-requests) +[![Changelog](https://img.shields.io/badge/Changelog-Updates-green)](https://evolutionapi.canny.io/changelog) [![License](https://img.shields.io/badge/license-Apache--2.0-blue)](./LICENSE) [![Support](https://img.shields.io/badge/Donation-picpay-green)](https://app.picpay.com/user/davidsongomes1998) [![Sponsors](https://img.shields.io/badge/Github-sponsor-orange)](https://github.com/sponsors/EvolutionAPI) @@ -52,6 +55,9 @@ Evolution API supports various integrations to enhance its functionality. Below - [RabbitMQ](https://www.rabbitmq.com/): - Receive events from the Evolution API via RabbitMQ. +- [Apache Kafka](https://kafka.apache.org/): + - Receive events from the Evolution API via Apache Kafka for real-time event streaming and processing. + - [Amazon SQS](https://aws.amazon.com/pt/sqs/): - Receive events from the Evolution API via Amazon SQS. @@ -67,6 +73,24 @@ Evolution API supports various integrations to enhance its functionality. Below - Amazon S3 / Minio: - Store media files received in [Amazon S3](https://aws.amazon.com/pt/s3/) or [Minio](https://min.io/). +## Community & Feedback + +We value community input and feedback to continuously improve Evolution API: + +### 🚀 Feature Requests & Roadmap +- **[Feature Requests](https://evolutionapi.canny.io/feature-requests)**: Submit new feature ideas and vote on community proposals +- **[Roadmap](https://evolutionapi.canny.io/feature-requests)**: View planned features and development progress +- **[Changelog](https://evolutionapi.canny.io/changelog)**: Stay updated with the latest releases and improvements + +### 💬 Community Support +- **[WhatsApp Group](https://evolution-api.com/whatsapp)**: Join our community for support and discussions +- **[Discord Community](https://evolution-api.com/discord)**: Real-time chat with developers and users +- **[GitHub Issues](https://github.com/EvolutionAPI/evolution-api/issues)**: Report bugs and technical issues + +### 🔒 Security +- **[Security Policy](./SECURITY.md)**: Guidelines for reporting security vulnerabilities +- **Security Contact**: contato@evolution-api.com + ## Telemetry Notice To continuously improve our services, we have implemented telemetry that collects data on the routes used, the most accessed routes, and the version of the API in use. We would like to assure you that no sensitive or personal data is collected during this process. The telemetry helps us identify improvements and provide a better experience for users. diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 000000000..0e3189d2f --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,99 @@ +# Security Policy + +## Supported Versions + +We actively support the following versions of Evolution API with security updates: + +| Version | Supported | +| ------- | ------------------ | +| 2.3.x | ✅ Yes | +| 2.2.x | ✅ Yes | +| 2.1.x | ⚠️ Critical fixes only | +| < 2.1 | ❌ No | + +## Reporting a Vulnerability + +We take security vulnerabilities seriously. If you discover a security vulnerability in Evolution API, please help us by reporting it responsibly. + +### 🔒 Private Disclosure Process + +**Please DO NOT create a public GitHub issue for security vulnerabilities.** + +Instead, please report security vulnerabilities via email to: + +**📧 contato@evolution-api.com** + +### 📋 What to Include + +When reporting a vulnerability, please include: + +- **Description**: A clear description of the vulnerability +- **Impact**: What an attacker could achieve by exploiting this vulnerability +- **Steps to Reproduce**: Detailed steps to reproduce the issue +- **Proof of Concept**: If possible, include a minimal proof of concept +- **Environment**: Version of Evolution API, OS, Node.js version, etc. +- **Suggested Fix**: If you have ideas for how to fix the issue + +### 🕐 Response Timeline + +We will acknowledge receipt of your vulnerability report within **48 hours** and will send you regular updates about our progress. + +- **Initial Response**: Within 48 hours +- **Status Update**: Within 7 days +- **Resolution Timeline**: Varies based on complexity, typically 30-90 days + +### 🎯 Scope + +This security policy applies to: + +- Evolution API core application +- Official Docker images +- Documentation that could lead to security issues + +### 🚫 Out of Scope + +The following are generally considered out of scope: + +- Third-party integrations (Chatwoot, Typebot, etc.) - please report to respective projects +- Issues in dependencies - please report to the dependency maintainers +- Social engineering attacks +- Physical attacks +- Denial of Service attacks + +### 🏆 Recognition + +We believe in recognizing security researchers who help us keep Evolution API secure: + +- We will acknowledge your contribution in our security advisories (unless you prefer to remain anonymous) +- For significant vulnerabilities, we may feature you in our Hall of Fame +- We will work with you on coordinated disclosure timing + +### 📚 Security Best Practices + +For users deploying Evolution API: + +- Always use the latest supported version +- Keep your dependencies up to date +- Use strong authentication methods +- Implement proper network security +- Monitor your logs for suspicious activity +- Follow the principle of least privilege + +### 🔄 Security Updates + +Security updates will be: + +- Released as patch versions (e.g., 2.3.1 → 2.3.2) +- Documented in our [CHANGELOG.md](./CHANGELOG.md) +- Announced in our community channels +- Tagged with security labels in GitHub releases + +## Contact + +For any questions about this security policy, please contact: + +- **Email**: contato@evolution-api.com + +--- + +Thank you for helping keep Evolution API and our community safe! 🛡️ diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 000000000..9beb860bf --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1,34 @@ +module.exports = { + extends: ['@commitlint/config-conventional'], + rules: { + 'type-enum': [ + 2, + 'always', + [ + 'feat', // New feature + 'fix', // Bug fix + 'docs', // Documentation changes + 'style', // Code style changes (formatting, etc) + 'refactor', // Code refactoring + 'perf', // Performance improvements + 'test', // Adding or updating tests + 'chore', // Maintenance tasks + 'ci', // CI/CD changes + 'build', // Build system changes + 'revert', // Reverting changes + 'security', // Security fixes + ], + ], + 'type-case': [2, 'always', 'lower-case'], + 'type-empty': [2, 'never'], + 'scope-case': [2, 'always', 'lower-case'], + 'subject-case': [2, 'never', ['sentence-case', 'start-case', 'pascal-case', 'upper-case']], + 'subject-empty': [2, 'never'], + 'subject-full-stop': [2, 'never', '.'], + 'header-max-length': [2, 'always', 100], + 'body-leading-blank': [1, 'always'], + 'body-max-line-length': [0, 'always', 150], + 'footer-leading-blank': [1, 'always'], + 'footer-max-line-length': [0, 'always', 150], + }, +}; diff --git a/docker-compose.dev.yaml b/docker-compose.dev.yaml index 2ca3424e5..35868ab71 100644 --- a/docker-compose.dev.yaml +++ b/docker-compose.dev.yaml @@ -15,6 +15,16 @@ services: expose: - 8080 + frontend: + container_name: evolution_frontend + image: evolution/manager:local + build: ./evolution-manager-v2 + restart: always + ports: + - "3000:80" + networks: + - evolution-net + volumes: evolution_instances: diff --git a/docker-compose.yaml b/docker-compose.yaml index b049f00f7..e0edee656 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -20,6 +20,15 @@ services: expose: - "8080" + frontend: + container_name: evolution_frontend + image: evoapicloud/evolution-manager:latest + restart: always + ports: + - "3000:80" + networks: + - evolution-net + redis: container_name: evolution_redis image: redis:latest diff --git a/env.example b/env.example new file mode 100644 index 000000000..5fe448b82 --- /dev/null +++ b/env.example @@ -0,0 +1,302 @@ +# =========================================== +# EVOLUTION API - CONFIGURAÇÃO DE AMBIENTE +# =========================================== + +# =========================================== +# SERVIDOR +# =========================================== +SERVER_NAME=evolution +SERVER_TYPE=http +SERVER_PORT=8080 +SERVER_URL=http://localhost:8080 +SERVER_DISABLE_DOCS=false +SERVER_DISABLE_MANAGER=false + +# =========================================== +# CORS +# =========================================== +CORS_ORIGIN=* +CORS_METHODS=POST,GET,PUT,DELETE +CORS_CREDENTIALS=true + +# =========================================== +# SSL (opcional) +# =========================================== +SSL_CONF_PRIVKEY= +SSL_CONF_FULLCHAIN= + +# =========================================== +# BANCO DE DADOS +# =========================================== +DATABASE_PROVIDER=postgresql +DATABASE_CONNECTION_URI=postgresql://username:password@localhost:5432/evolution_api +DATABASE_CONNECTION_CLIENT_NAME=evolution + +# Configurações de salvamento de dados +DATABASE_SAVE_DATA_INSTANCE=true +DATABASE_SAVE_DATA_NEW_MESSAGE=true +DATABASE_SAVE_MESSAGE_UPDATE=true +DATABASE_SAVE_DATA_CONTACTS=true +DATABASE_SAVE_DATA_CHATS=true +DATABASE_SAVE_DATA_HISTORIC=true +DATABASE_SAVE_DATA_LABELS=true +DATABASE_SAVE_IS_ON_WHATSAPP=true +DATABASE_SAVE_IS_ON_WHATSAPP_DAYS=7 +DATABASE_DELETE_MESSAGE=false + +# =========================================== +# REDIS +# =========================================== +CACHE_REDIS_ENABLED=true +CACHE_REDIS_URI=redis://localhost:6379 +CACHE_REDIS_PREFIX_KEY=evolution-cache +CACHE_REDIS_TTL=604800 +CACHE_REDIS_SAVE_INSTANCES=true + +# Cache local (fallback) +CACHE_LOCAL_ENABLED=true +CACHE_LOCAL_TTL=86400 + +# =========================================== +# AUTENTICAÇÃO +# =========================================== +AUTHENTICATION_API_KEY=BQYHJGJHJ +AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES=false + +# =========================================== +# LOGS +# =========================================== +LOG_LEVEL=ERROR,WARN,DEBUG,INFO,LOG,VERBOSE,DARK,WEBHOOKS,WEBSOCKET +LOG_COLOR=true +LOG_BAILEYS=error + +# =========================================== +# INSTÂNCIAS +# =========================================== +DEL_INSTANCE=false +DEL_TEMP_INSTANCES=true + +# =========================================== +# IDIOMA +# =========================================== +LANGUAGE=pt-BR + +# =========================================== +# WEBHOOK +# =========================================== +WEBHOOK_GLOBAL_URL= +WEBHOOK_GLOBAL_ENABLED=false +WEBHOOK_GLOBAL_WEBHOOK_BY_EVENTS=false + +# Eventos de webhook +WEBHOOK_EVENTS_APPLICATION_STARTUP=false +WEBHOOK_EVENTS_INSTANCE_CREATE=false +WEBHOOK_EVENTS_INSTANCE_DELETE=false +WEBHOOK_EVENTS_QRCODE_UPDATED=false +WEBHOOK_EVENTS_MESSAGES_SET=false +WEBHOOK_EVENTS_MESSAGES_UPSERT=false +WEBHOOK_EVENTS_MESSAGES_EDITED=false +WEBHOOK_EVENTS_MESSAGES_UPDATE=false +WEBHOOK_EVENTS_MESSAGES_DELETE=false +WEBHOOK_EVENTS_SEND_MESSAGE=false +WEBHOOK_EVENTS_SEND_MESSAGE_UPDATE=false +WEBHOOK_EVENTS_CONTACTS_SET=false +WEBHOOK_EVENTS_CONTACTS_UPDATE=false +WEBHOOK_EVENTS_CONTACTS_UPSERT=false +WEBHOOK_EVENTS_PRESENCE_UPDATE=false +WEBHOOK_EVENTS_CHATS_SET=false +WEBHOOK_EVENTS_CHATS_UPDATE=false +WEBHOOK_EVENTS_CHATS_UPSERT=false +WEBHOOK_EVENTS_CHATS_DELETE=false +WEBHOOK_EVENTS_CONNECTION_UPDATE=false +WEBHOOK_EVENTS_LABELS_EDIT=false +WEBHOOK_EVENTS_LABELS_ASSOCIATION=false +WEBHOOK_EVENTS_GROUPS_UPSERT=false +WEBHOOK_EVENTS_GROUPS_UPDATE=false +WEBHOOK_EVENTS_GROUP_PARTICIPANTS_UPDATE=false +WEBHOOK_EVENTS_CALL=false +WEBHOOK_EVENTS_TYPEBOT_START=false +WEBHOOK_EVENTS_TYPEBOT_CHANGE_STATUS=false +WEBHOOK_EVENTS_ERRORS=false +WEBHOOK_EVENTS_ERRORS_WEBHOOK= + +# Configurações de webhook +WEBHOOK_REQUEST_TIMEOUT_MS=30000 +WEBHOOK_RETRY_MAX_ATTEMPTS=10 +WEBHOOK_RETRY_INITIAL_DELAY_SECONDS=5 +WEBHOOK_RETRY_USE_EXPONENTIAL_BACKOFF=true +WEBHOOK_RETRY_MAX_DELAY_SECONDS=300 +WEBHOOK_RETRY_JITTER_FACTOR=0.2 +WEBHOOK_RETRY_NON_RETRYABLE_STATUS_CODES=400,401,403,404,422 + +# =========================================== +# WEBSOCKET +# =========================================== +WEBSOCKET_ENABLED=true +WEBSOCKET_GLOBAL_EVENTS=true +WEBSOCKET_ALLOWED_HOSTS= + +# =========================================== +# RABBITMQ +# =========================================== +RABBITMQ_ENABLED=false +RABBITMQ_GLOBAL_ENABLED=false +RABBITMQ_PREFIX_KEY= +RABBITMQ_EXCHANGE_NAME=evolution_exchange +RABBITMQ_URI= +RABBITMQ_FRAME_MAX=8192 + +# =========================================== +# NATS +# =========================================== +NATS_ENABLED=false +NATS_GLOBAL_ENABLED=false +NATS_PREFIX_KEY= +NATS_EXCHANGE_NAME=evolution_exchange +NATS_URI= + +# =========================================== +# SQS +# =========================================== +SQS_ENABLED=false +SQS_GLOBAL_ENABLED=false +SQS_GLOBAL_FORCE_SINGLE_QUEUE=false +SQS_GLOBAL_PREFIX_NAME=global +SQS_ACCESS_KEY_ID= +SQS_SECRET_ACCESS_KEY= +SQS_ACCOUNT_ID= +SQS_REGION= +SQS_MAX_PAYLOAD_SIZE=1048576 + +# =========================================== +# PUSHER +# =========================================== +PUSHER_ENABLED=false +PUSHER_GLOBAL_ENABLED=false +PUSHER_GLOBAL_APP_ID= +PUSHER_GLOBAL_KEY= +PUSHER_GLOBAL_SECRET= +PUSHER_GLOBAL_CLUSTER= +PUSHER_GLOBAL_USE_TLS=false + +# =========================================== +# WHATSAPP BUSINESS +# =========================================== +WA_BUSINESS_TOKEN_WEBHOOK=evolution +WA_BUSINESS_URL=https://graph.facebook.com +WA_BUSINESS_VERSION=v18.0 +WA_BUSINESS_LANGUAGE=en + +# =========================================== +# CONFIGURAÇÕES DE SESSÃO +# =========================================== +CONFIG_SESSION_PHONE_CLIENT=Evolution API +CONFIG_SESSION_PHONE_NAME=Chrome + +# =========================================== +# QR CODE +# =========================================== +QRCODE_LIMIT=30 +QRCODE_COLOR=#198754 + +# =========================================== +# INTEGRAÇÕES +# =========================================== + +# Typebot +TYPEBOT_ENABLED=false +TYPEBOT_API_VERSION=old +TYPEBOT_SEND_MEDIA_BASE64=false + +# Chatwoot +CHATWOOT_ENABLED=false +CHATWOOT_MESSAGE_DELETE=false +CHATWOOT_MESSAGE_READ=false +CHATWOOT_BOT_CONTACT=true +CHATWOOT_IMPORT_DATABASE_CONNECTION_URI= +CHATWOOT_IMPORT_PLACEHOLDER_MEDIA_MESSAGE=false + +# OpenAI +OPENAI_ENABLED=false +OPENAI_API_KEY_GLOBAL= + +# Dify +DIFY_ENABLED=false + +# N8N +N8N_ENABLED=false + +# EvoAI +EVOAI_ENABLED=false + +# Flowise +FLOWISE_ENABLED=false + +# =========================================== +# S3 / MINIO +# =========================================== +S3_ENABLED=false +S3_ACCESS_KEY= +S3_SECRET_KEY= +S3_ENDPOINT= +S3_BUCKET= +S3_PORT=9000 +S3_USE_SSL=false +S3_REGION= +S3_SKIP_POLICY=false +S3_SAVE_VIDEO=false + +# =========================================== +# MÉTRICAS +# =========================================== +PROMETHEUS_METRICS=false +METRICS_AUTH_REQUIRED=false +METRICS_USER= +METRICS_PASSWORD= +METRICS_ALLOWED_IPS= + +# =========================================== +# TELEMETRIA +# =========================================== +TELEMETRY_ENABLED=true +TELEMETRY_URL= + +# =========================================== +# PROXY +# =========================================== +PROXY_HOST= +PROXY_PORT= +PROXY_PROTOCOL= +PROXY_USERNAME= +PROXY_PASSWORD= + +# =========================================== +# CONVERSOR DE ÁUDIO +# =========================================== +API_AUDIO_CONVERTER= +API_AUDIO_CONVERTER_KEY= + +# =========================================== +# FACEBOOK +# =========================================== +FACEBOOK_APP_ID= +FACEBOOK_CONFIG_ID= +FACEBOOK_USER_TOKEN= + +# =========================================== +# SENTRY +# =========================================== +SENTRY_DSN= + +# =========================================== +# EVENT EMITTER +# =========================================== +EVENT_EMITTER_MAX_LISTENERS=50 + +# =========================================== +# PROVIDER +# =========================================== +PROVIDER_ENABLED=false +PROVIDER_HOST= +PROVIDER_PORT=5656 +PROVIDER_PREFIX=evolution diff --git a/evolution-manager-v2 b/evolution-manager-v2 new file mode 160000 index 000000000..f054b9bc2 --- /dev/null +++ b/evolution-manager-v2 @@ -0,0 +1 @@ +Subproject commit f054b9bc28083152d4948f835e3346fd0add39db diff --git a/grafana-dashboard.json.example b/grafana-dashboard.json.example new file mode 100644 index 000000000..f85eb9d6c --- /dev/null +++ b/grafana-dashboard.json.example @@ -0,0 +1,238 @@ +{ + "dashboard": { + "id": null, + "title": "Evolution API Monitoring", + "tags": ["evolution-api", "whatsapp", "monitoring"], + "style": "dark", + "timezone": "browser", + "panels": [ + { + "id": 1, + "title": "API Status", + "type": "stat", + "targets": [ + { + "expr": "up{job=\"evolution-api\"}", + "legendFormat": "API Status" + } + ], + "fieldConfig": { + "defaults": { + "mappings": [ + { + "options": { + "0": { + "text": "DOWN", + "color": "red" + }, + "1": { + "text": "UP", + "color": "green" + } + }, + "type": "value" + } + ] + } + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 0 + } + }, + { + "id": 2, + "title": "Total Instances", + "type": "stat", + "targets": [ + { + "expr": "evolution_instances_total", + "legendFormat": "Total Instances" + } + ], + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 0 + } + }, + { + "id": 3, + "title": "Instance Status Overview", + "type": "piechart", + "targets": [ + { + "expr": "sum by (state) (evolution_instance_state)", + "legendFormat": "{{ state }}" + } + ], + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 8 + } + }, + { + "id": 4, + "title": "Instances by Integration Type", + "type": "piechart", + "targets": [ + { + "expr": "sum by (integration) (evolution_instance_up)", + "legendFormat": "{{ integration }}" + } + ], + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 8 + } + }, + { + "id": 5, + "title": "Instance Uptime", + "type": "table", + "targets": [ + { + "expr": "evolution_instance_up", + "format": "table", + "instant": true + } + ], + "transformations": [ + { + "id": "organize", + "options": { + "excludeByName": { + "Time": true, + "__name__": true + }, + "renameByName": { + "instance": "Instance Name", + "integration": "Integration Type", + "Value": "Status" + } + } + } + ], + "fieldConfig": { + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Status" + }, + "properties": [ + { + "id": "mappings", + "value": [ + { + "options": { + "0": { + "text": "DOWN", + "color": "red" + }, + "1": { + "text": "UP", + "color": "green" + } + }, + "type": "value" + } + ] + } + ] + } + ] + }, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 17 + } + }, + { + "id": 6, + "title": "Instance Status Timeline", + "type": "timeseries", + "targets": [ + { + "expr": "evolution_instance_up", + "legendFormat": "{{ instance }} ({{ integration }})" + } + ], + "fieldConfig": { + "defaults": { + "custom": { + "drawStyle": "line", + "lineInterpolation": "stepAfter", + "lineWidth": 2, + "fillOpacity": 10, + "gradientMode": "none", + "spanNulls": false, + "insertNulls": false, + "showPoints": "never", + "pointSize": 5, + "stacking": { + "mode": "none", + "group": "A" + }, + "axisPlacement": "auto", + "axisLabel": "", + "scaleDistribution": { + "type": "linear" + }, + "hideFrom": { + "legend": false, + "tooltip": false, + "vis": false + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "min": 0, + "max": 1 + } + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 26 + } + } + ], + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "templating": { + "list": [] + }, + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "refresh": "30s", + "schemaVersion": 27, + "version": 0, + "links": [] + } +} diff --git a/manager/dist/assets/images/evolution-logo.png b/manager/dist/assets/images/evolution-logo.png index bd9b3850a..57a1994f3 100644 Binary files a/manager/dist/assets/images/evolution-logo.png and b/manager/dist/assets/images/evolution-logo.png differ diff --git a/manager/dist/assets/index-CO3NSIFj.js b/manager/dist/assets/index-CO3NSIFj.js new file mode 100644 index 000000000..3d8c88d0f --- /dev/null +++ b/manager/dist/assets/index-CO3NSIFj.js @@ -0,0 +1,485 @@ +var TD=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var tie=TD((ko,jo)=>{function Bk(e,t){for(var n=0;nr[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(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 l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).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)}})();function fd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var av={exports:{}},Xc={},iv={exports:{}},Et={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var A0;function ND(){if(A0)return Et;A0=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.iterator;function g(A){return A===null||typeof A!="object"?null:(A=m&&A[m]||A["@@iterator"],typeof A=="function"?A:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,w={};function C(A,F,fe){this.props=A,this.context=F,this.refs=w,this.updater=fe||x}C.prototype.isReactComponent={},C.prototype.setState=function(A,F){if(typeof A!="object"&&typeof A!="function"&&A!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,A,F,"setState")},C.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function k(){}k.prototype=C.prototype;function j(A,F,fe){this.props=A,this.context=F,this.refs=w,this.updater=fe||x}var M=j.prototype=new k;M.constructor=j,b(M,C.prototype),M.isPureReactComponent=!0;var _=Array.isArray,R=Object.prototype.hasOwnProperty,N={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};function D(A,F,fe){var te,de={},ge=null,Z=null;if(F!=null)for(te in F.ref!==void 0&&(Z=F.ref),F.key!==void 0&&(ge=""+F.key),F)R.call(F,te)&&!O.hasOwnProperty(te)&&(de[te]=F[te]);var ye=arguments.length-2;if(ye===1)de.children=fe;else if(1{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Fl=typeof window>"u"||"Deno"in globalThis;function ss(){}function RD(e,t){return typeof e=="function"?e(t):e}function Sy(e){return typeof e=="number"&&e>=0&&e!==1/0}function zk(e,t){return Math.max(e+(t||0)-Date.now(),0)}function _l(e,t){return typeof e=="function"?e(t):e}function ws(e,t){return typeof e=="function"?e(t):e}function $0(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:o,queryKey:l,stale:u}=e;if(l){if(r){if(t.queryHash!==_b(l,t.options))return!1}else if(!Ou(t.queryKey,l))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||s&&s!==t.state.fetchStatus||o&&!o(t))}function B0(e,t){const{exact:n,status:r,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(xi(t.options.mutationKey)!==xi(o))return!1}else if(!Ou(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function _b(e,t){return(t?.queryKeyHashFn||xi)(e)}function xi(e){return JSON.stringify(e,(t,n)=>Cy(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Ou(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Ou(e[n],t[n])):!1}function Uk(e,t){if(e===t)return e;const n=z0(e)&&z0(t);if(n||Cy(e)&&Cy(t)){const r=n?e:Object.keys(e),s=r.length,o=n?t:Object.keys(t),l=o.length,u=n?[]:{};let d=0;for(let f=0;f{setTimeout(t,e)})}function Ey(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Uk(e,t):t}function OD(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function ID(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Vk=Symbol();function Hk(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Vk?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var AD=class extends Zl{#e;#t;#r;constructor(){super(),this.#r=e=>{if(!Fl&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Rb=new AD,DD=class extends Zl{#e=!0;#t;#r;constructor(){super(),this.#r=e=>{if(!Fl&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},_p=new DD;function FD(e){return Math.min(1e3*2**e,3e4)}function qk(e){return(e??"online")==="online"?_p.isOnline():!0}var Kk=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function lv(e){return e instanceof Kk}function Wk(e){let t=!1,n=0,r=!1,s,o,l;const u=new Promise((k,j)=>{o=k,l=j}),d=k=>{r||(b(new Kk(k)),e.abort?.())},f=()=>{t=!0},h=()=>{t=!1},m=()=>Rb.isFocused()&&(e.networkMode==="always"||_p.isOnline())&&e.canRun(),g=()=>qk(e.networkMode)&&e.canRun(),x=k=>{r||(r=!0,e.onSuccess?.(k),s?.(),o(k))},b=k=>{r||(r=!0,e.onError?.(k),s?.(),l(k))},w=()=>new Promise(k=>{s=j=>{(r||m())&&k(j)},e.onPause?.()}).then(()=>{s=void 0,r||e.onContinue?.()}),C=()=>{if(r)return;let k;const j=n===0?e.initialPromise:void 0;try{k=j??e.fn()}catch(M){k=Promise.reject(M)}Promise.resolve(k).then(x).catch(M=>{if(r)return;const _=e.retry??(Fl?0:3),R=e.retryDelay??FD,N=typeof R=="function"?R(n,M):R,O=_===!0||typeof _=="number"&&n<_||typeof _=="function"&&_(n,M);if(t||!O){b(M);return}n++,e.onFail?.(n,M),PD(N).then(()=>m()?void 0:w()).then(()=>{t?b(M):C()})})};return{promise:u,cancel:d,continue:()=>(s?.(),u),cancelRetry:f,continueRetry:h,canStart:g,start:()=>(g()?C():w().then(C),u)}}function LD(){let e=[],t=0,n=g=>{g()},r=g=>{g()},s=g=>setTimeout(g,0);const o=g=>{s=g},l=g=>{let x;t++;try{x=g()}finally{t--,t||f()}return x},u=g=>{t?e.push(g):s(()=>{n(g)})},d=g=>(...x)=>{u(()=>{g(...x)})},f=()=>{const g=e;e=[],g.length&&s(()=>{r(()=>{g.forEach(x=>{n(x)})})})};return{batch:l,batchCalls:d,schedule:u,setNotifyFunction:g=>{n=g},setBatchNotifyFunction:g=>{r=g},setScheduler:o}}var Fn=LD(),Gk=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Sy(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Fl?1/0:300*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}},$D=class extends Gk{#e;#t;#r;#n;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.cache,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=BD(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#n?.promise}setOptions(e){this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const n=Ey(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#n?.promise;return this.#n?.cancel(e),t?t.then(ss).catch(ss):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>ws(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!zk(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#n?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#n?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#n&&(this.#o?this.#n.cancel({revert:!0}):this.#n.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}fetch(e,t){if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#n)return this.#n.continueRetry(),this.#n.promise}if(e&&this.setOptions(e),!this.options.queryFn){const u=this.observers.find(d=>d.options.queryFn);u&&this.setOptions(u.options)}const n=new AbortController,r=u=>{Object.defineProperty(u,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},s=()=>{const u=Hk(this.options,t),d={queryKey:this.queryKey,meta:this.meta};return r(d),this.#o=!1,this.options.persister?this.options.persister(u,d,this):u(d)},o={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};r(o),this.options.behavior?.onFetch(o,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#s({type:"fetch",meta:o.fetchOptions?.meta});const l=u=>{lv(u)&&u.silent||this.#s({type:"error",error:u}),lv(u)||(this.#r.config.onError?.(u,this),this.#r.config.onSettled?.(this.state.data,u,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.#n=Wk({initialPromise:t?.initialPromise,fn:o.fetchFn,abort:n.abort.bind(n),onSuccess:u=>{if(u===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(u)}catch(d){l(d);return}this.#r.config.onSuccess?.(u,this),this.#r.config.onSettled?.(u,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(u,d)=>{this.#s({type:"failed",failureCount:u,error:d})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}),this.#n.start()}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Jk(n.data,this.options),fetchMeta:e.meta??null};case"success":return{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const r=e.error;return lv(r)&&r.revert&&this.#t?{...this.#t,fetchStatus:"idle"}:{...n,error:r,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Fn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function Jk(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:qk(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function BD(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var zD=class extends Zl{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,s=t.queryHash??_b(r,t);let o=this.get(s);return o||(o=new $D({cache:this,queryKey:r,queryHash:s,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Fn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>$0(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>$0(e,n)):t}notify(e){Fn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Fn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Fn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},UD=class extends Gk{#e;#t;#r;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||Qk(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){this.#r=Wk({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(r,s)=>{this.#n({type:"failed",failureCount:r,error:s})},onPause:()=>{this.#n({type:"pause"})},onContinue:()=>{this.#n({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const t=this.state.status==="pending",n=!this.#r.canStart();try{if(!t){this.#n({type:"pending",variables:e,isPaused:n}),await this.#t.config.onMutate?.(e,this);const s=await this.options.onMutate?.(e);s!==this.state.context&&this.#n({type:"pending",context:s,variables:e,isPaused:n})}const r=await this.#r.start();return await this.#t.config.onSuccess?.(r,e,this.state.context,this),await this.options.onSuccess?.(r,e,this.state.context),await this.#t.config.onSettled?.(r,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(r,null,e,this.state.context),this.#n({type:"success",data:r}),r}catch(r){try{throw await this.#t.config.onError?.(r,e,this.state.context,this),await this.options.onError?.(r,e,this.state.context),await this.#t.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,r,e,this.state.context),r}finally{this.#n({type:"error",error:r})}}finally{this.#t.runNext(this)}}#n(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Fn.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function Qk(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var VD=class extends Zl{constructor(e={}){super(),this.config=e,this.#e=new Map,this.#t=Date.now()}#e;#t;build(e,t,n){const r=new UD({mutationCache:this,mutationId:++this.#t,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){const t=Df(e),n=this.#e.get(t)??[];n.push(e),this.#e.set(t,n),this.notify({type:"added",mutation:e})}remove(e){const t=Df(e);if(this.#e.has(t)){const n=this.#e.get(t)?.filter(r=>r!==e);n&&(n.length===0?this.#e.delete(t):this.#e.set(t,n))}this.notify({type:"removed",mutation:e})}canRun(e){const t=this.#e.get(Df(e))?.find(n=>n.state.status==="pending");return!t||t===e}runNext(e){return this.#e.get(Df(e))?.find(n=>n!==e&&n.state.isPaused)?.continue()??Promise.resolve()}clear(){Fn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...this.#e.values()].flat()}find(e){const t={exact:!0,...e};return this.getAll().find(n=>B0(t,n))}findAll(e={}){return this.getAll().filter(t=>B0(e,t))}notify(e){Fn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Fn.batch(()=>Promise.all(e.map(t=>t.continue().catch(ss))))}};function Df(e){return e.options.scope?.id??String(e.mutationId)}function HD(e){return{onFetch:(t,n)=>{const r=async()=>{const s=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,l=t.state.data?.pages||[],u=t.state.data?.pageParams||[],d={pages:[],pageParams:[]};let f=!1;const h=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(t.signal.aborted?f=!0:t.signal.addEventListener("abort",()=>{f=!0}),t.signal)})},m=Hk(t.options,t.fetchOptions),g=async(b,w,C)=>{if(f)return Promise.reject();if(w==null&&b.pages.length)return Promise.resolve(b);const k={queryKey:t.queryKey,pageParam:w,direction:C?"backward":"forward",meta:t.options.meta};h(k);const j=await m(k),{maxPages:M}=t.options,_=C?ID:OD;return{pages:_(b.pages,j,M),pageParams:_(b.pageParams,w,M)}};let x;if(o&&l.length){const b=o==="backward",w=b?qD:V0,C={pages:l,pageParams:u},k=w(s,C);x=await g(C,k,b)}else{x=await g(d,u[0]??s.initialPageParam);const b=e??l.length;for(let w=1;wt.options.persister?.(r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=r}}}function V0(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function qD(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var KD=class{#e;#t;#r;#n;#a;#o;#s;#i;constructor(e={}){this.#e=e.queryCache||new zD,this.#t=e.mutationCache||new VD,this.#r=e.defaultOptions||{},this.#n=new Map,this.#a=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#s=Rb.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=_p.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#s?.(),this.#s=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const n=this.defaultQueryOptions(e),r=this.#e.build(this,n);return e.revalidateIfStale&&r.isStaleByTime(_l(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=this.#e.get(r.queryHash)?.state.data,l=RD(t,o);if(l!==void 0)return this.#e.build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return Fn.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Fn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e,r={type:"active",...e};return Fn.batch(()=>(n.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=Fn.batch(()=>this.#e.findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(ss).catch(ss)}invalidateQueries(e={},t={}){return Fn.batch(()=>{if(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:t?.cancelRefetch??!0},r=Fn.batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()).map(s=>{let o=s.fetch(void 0,n);return n.throwOnError||(o=o.catch(ss)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(ss)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(_l(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ss).catch(ss)}fetchInfiniteQuery(e){return e.behavior=HD(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ss).catch(ss)}resumePausedMutations(){return _p.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#r}setDefaultOptions(e){this.#r=e}setQueryDefaults(e,t){this.#n.set(xi(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#n.values()];let n={};return t.forEach(r=>{Ou(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){this.#a.set(xi(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#a.values()];let n={};return t.forEach(r=>{Ou(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#r.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=_b(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.enabled!==!0&&t.queryFn===Vk&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#r.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},WD=class extends Zl{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#r=void 0;#n=void 0;#a;#o;#s;#i;#f;#p;#c;#u;#l;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),H0(this.#t,this.options)?this.#d():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ky(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ky(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e,t){const n=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ws(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),n._defaulted&&!Mp(this.options,n)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&q0(this.#t,r,this.options,n)&&this.#d(),this.updateResult(t),s&&(this.#t!==r||ws(this.options.enabled,this.#t)!==ws(n.enabled,this.#t)||_l(this.options.staleTime,this.#t)!==_l(n.staleTime,this.#t))&&this.#g();const o=this.#m();s&&(this.#t!==r||ws(this.options.enabled,this.#t)!==ws(n.enabled,this.#t)||o!==this.#l)&&this.#v(o)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return JD(this,n)&&(this.#n=n,this.#o=this.options,this.#a=this.#t.state),n}getCurrentResult(){return this.#n}trackResult(e,t){const n={};return Object.keys(e).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(r),t?.(r),e[r])})}),n}trackProp(e){this.#h.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.isFetchingOptimistic=!0,n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#n))}#d(e){this.#w();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(ss)),t}#g(){this.#b();const e=_l(this.options.staleTime,this.#t);if(Fl||this.#n.isStale||!Sy(e))return;const n=zk(this.#n.dataUpdatedAt,e)+1;this.#c=setTimeout(()=>{this.#n.isStale||this.updateResult()},n)}#m(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#l=e,!(Fl||ws(this.options.enabled,this.#t)===!1||!Sy(this.#l)||this.#l===0)&&(this.#u=setInterval(()=>{(this.options.refetchIntervalInBackground||Rb.isFocused())&&this.#d()},this.#l))}#y(){this.#g(),this.#v(this.#m())}#b(){this.#c&&(clearTimeout(this.#c),this.#c=void 0)}#x(){this.#u&&(clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,r=this.options,s=this.#n,o=this.#a,l=this.#o,d=e!==n?e.state:this.#r,{state:f}=e;let h={...f},m=!1,g;if(t._optimisticResults){const N=this.hasListeners(),O=!N&&H0(e,t),D=N&&q0(e,n,t,r);(O||D)&&(h={...h,...Jk(f.data,e.options)}),t._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:x,errorUpdatedAt:b,status:w}=h;if(t.select&&h.data!==void 0)if(s&&h.data===o?.data&&t.select===this.#i)g=this.#f;else try{this.#i=t.select,g=t.select(h.data),g=Ey(s?.data,g,t),this.#f=g,this.#s=null}catch(N){this.#s=N}else g=h.data;if(t.placeholderData!==void 0&&g===void 0&&w==="pending"){let N;if(s?.isPlaceholderData&&t.placeholderData===l?.placeholderData)N=s.data;else if(N=typeof t.placeholderData=="function"?t.placeholderData(this.#p?.state.data,this.#p):t.placeholderData,t.select&&N!==void 0)try{N=t.select(N),this.#s=null}catch(O){this.#s=O}N!==void 0&&(w="success",g=Ey(s?.data,N,t),m=!0)}this.#s&&(x=this.#s,g=this.#f,b=Date.now(),w="error");const C=h.fetchStatus==="fetching",k=w==="pending",j=w==="error",M=k&&C,_=g!==void 0;return{status:w,fetchStatus:h.fetchStatus,isPending:k,isSuccess:w==="success",isError:j,isInitialLoading:M,isLoading:M,data:g,dataUpdatedAt:h.dataUpdatedAt,error:x,errorUpdatedAt:b,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>d.dataUpdateCount||h.errorUpdateCount>d.errorUpdateCount,isFetching:C,isRefetching:C&&!k,isLoadingError:j&&!_,isPaused:h.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:j&&_,isStale:Pb(e,t),refetch:this.refetch}}updateResult(e){const t=this.#n,n=this.createResult(this.#t,this.options);if(this.#a=this.#t.state,this.#o=this.options,this.#a.data!==void 0&&(this.#p=this.#t),Mp(n,t))return;this.#n=n;const r={},s=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,l=typeof o=="function"?o():o;if(l==="all"||!l&&!this.#h.size)return!0;const u=new Set(l??this.#h);return this.options.throwOnError&&u.add("error"),Object.keys(this.#n).some(d=>{const f=d;return this.#n[f]!==t[f]&&u.has(f)})};e?.listeners!==!1&&s()&&(r.listeners=!0),this.#S({...r,...e})}#w(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#r=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#S(e){Fn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#n)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function GD(e,t){return ws(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function H0(e,t){return GD(e,t)||e.state.data!==void 0&&ky(e,t,t.refetchOnMount)}function ky(e,t,n){if(ws(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Pb(e,t)}return!1}function q0(e,t,n,r){return(e!==t||ws(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Pb(e,n)}function Pb(e,t){return ws(t.enabled,e)!==!1&&e.isStaleByTime(_l(t.staleTime,e))}function JD(e,t){return!Mp(e.getCurrentResult(),t)}var QD=class extends Zl{#e;#t=void 0;#r;#n;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#a()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),Mp(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),n?.mutationKey&&this.options.mutationKey&&xi(n.mutationKey)!==xi(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(t){this.#a(),this.#o(t)}getCurrentResult(){return this.#t}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#a(),this.#o()}mutate(t,n){return this.#n=n,this.#r?.removeObserver(this),this.#r=this.#e.getMutationCache().build(this.#e,this.options),this.#r.addObserver(this),this.#r.execute(t)}#a(){const t=this.#r?.state??Qk();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){Fn.batch(()=>{if(this.#n&&this.hasListeners()){const n=this.#t.variables,r=this.#t.context;t?.type==="success"?(this.#n.onSuccess?.(t.data,n,r),this.#n.onSettled?.(t.data,null,n,r)):t?.type==="error"&&(this.#n.onError?.(t.error,n,r),this.#n.onSettled?.(void 0,t.error,n,r))}this.listeners.forEach(n=>{n(this.#t)})})}},y=pd();const qe=fd(y),Yl=Bk({__proto__:null,default:qe},[y]);var Zk=y.createContext(void 0),Ob=e=>{const t=y.useContext(Zk);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Yk=({client:e,children:t})=>(y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),i.jsx(Zk.Provider,{value:e,children:t})),Xk=y.createContext(!1),ZD=()=>y.useContext(Xk);Xk.Provider;function YD(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var XD=y.createContext(YD()),eF=()=>y.useContext(XD);function ej(e,t){return typeof e=="function"?e(...t):!!e}function tF(){}var nF=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},rF=e=>{y.useEffect(()=>{e.clearReset()},[e])},sF=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&ej(n,[e.error,r]),oF=e=>{e.suspense&&(typeof e.staleTime!="number"&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},aF=(e,t)=>e?.suspense&&t.isPending,iF=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function lF(e,t,n){const r=Ob(),s=ZD(),o=eF(),l=r.defaultQueryOptions(e);r.getDefaultOptions().queries?._experimental_beforeQuery?.(l),l._optimisticResults=s?"isRestoring":"optimistic",oF(l),nF(l,o),rF(o);const[u]=y.useState(()=>new t(r,l)),d=u.getOptimisticResult(l);if(y.useSyncExternalStore(y.useCallback(f=>{const h=s?()=>{}:u.subscribe(Fn.batchCalls(f));return u.updateResult(),h},[u,s]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),y.useEffect(()=>{u.setOptions(l,{listeners:!1})},[l,u]),aF(l,d))throw iF(l,u,o);if(sF({result:d,errorResetBoundary:o,throwOnError:l.throwOnError,query:r.getQueryCache().get(l.queryHash)}))throw d.error;return r.getDefaultOptions().queries?._experimental_afterQuery?.(l,d),l.notifyOnChangeProps?d:u.trackResult(d)}function mt(e,t){return lF(e,WD)}function cF(e,t){const n=Ob(),[r]=y.useState(()=>new QD(n,e));y.useEffect(()=>{r.setOptions(e)},[r,e]);const s=y.useSyncExternalStore(y.useCallback(l=>r.subscribe(Fn.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=y.useCallback((l,u)=>{r.mutate(l,u).catch(tF)},[r]);if(s.error&&ej(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:o,mutateAsync:s.mutate}}var Ff={},cv={exports:{}},Cr={},uv={exports:{}},dv={};/** + * @license React + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var K0;function uF(){return K0||(K0=1,(function(e){function t(H,q){var he=H.length;H.push(q);e:for(;0>>1,F=H[A];if(0>>1;As(de,he))ges(Z,de)?(H[A]=Z,H[ge]=he,A=ge):(H[A]=de,H[te]=he,A=te);else if(ges(Z,he))H[A]=Z,H[ge]=he,A=ge;else break e}}return q}function s(H,q){var he=H.sortIndex-q.sortIndex;return he!==0?he:H.id-q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],f=[],h=1,m=null,g=3,x=!1,b=!1,w=!1,C=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(H){for(var q=n(f);q!==null;){if(q.callback===null)r(f);else if(q.startTime<=H)r(f),q.sortIndex=q.expirationTime,t(d,q);else break;q=n(f)}}function _(H){if(w=!1,M(H),!b)if(n(d)!==null)b=!0,re(R);else{var q=n(f);q!==null&&Y(_,q.startTime-H)}}function R(H,q){b=!1,w&&(w=!1,k(D),D=-1),x=!0;var he=g;try{for(M(q),m=n(d);m!==null&&(!(m.expirationTime>q)||H&&!pe());){var A=m.callback;if(typeof A=="function"){m.callback=null,g=m.priorityLevel;var F=A(m.expirationTime<=q);q=e.unstable_now(),typeof F=="function"?m.callback=F:m===n(d)&&r(d),M(q)}else r(d);m=n(d)}if(m!==null)var fe=!0;else{var te=n(f);te!==null&&Y(_,te.startTime-q),fe=!1}return fe}finally{m=null,g=he,x=!1}}var N=!1,O=null,D=-1,z=5,Q=-1;function pe(){return!(e.unstable_now()-QH||125A?(H.sortIndex=he,t(f,H),n(d)===null&&H===n(f)&&(w?(k(D),D=-1):w=!0,Y(_,he-A))):(H.sortIndex=F,t(d,H),b||x||(b=!0,re(R))),H},e.unstable_shouldYield=pe,e.unstable_wrapCallback=function(H){var q=g;return function(){var he=g;g=q;try{return H.apply(this,arguments)}finally{g=he}}}})(dv)),dv}var W0;function dF(){return W0||(W0=1,uv.exports=uF()),uv.exports}/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var G0;function fF(){if(G0)return Cr;G0=1;var e=pd(),t=dF();function n(a){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+a,p=1;p"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,h={},m={};function g(a){return d.call(m,a)?!0:d.call(h,a)?!1:f.test(a)?m[a]=!0:(h[a]=!0,!1)}function x(a,c,p,v){if(p!==null&&p.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return v?!1:p!==null?!p.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function b(a,c,p,v){if(c===null||typeof c>"u"||x(a,c,p,v))return!0;if(v)return!1;if(p!==null)switch(p.type){case 3:return!c;case 4:return c===!1;case 5:return isNaN(c);case 6:return isNaN(c)||1>c}return!1}function w(a,c,p,v,S,E,T){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=v,this.attributeNamespace=S,this.mustUseProperty=p,this.propertyName=a,this.type=c,this.sanitizeURL=E,this.removeEmptyString=T}var C={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){C[a]=new w(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var c=a[0];C[c]=new w(c,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){C[a]=new w(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){C[a]=new w(a,2,!1,a,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){C[a]=new w(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){C[a]=new w(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){C[a]=new w(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){C[a]=new w(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){C[a]=new w(a,5,!1,a.toLowerCase(),null,!1,!1)});var k=/[\-:]([a-z])/g;function j(a){return a[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var c=a.replace(k,j);C[c]=new w(c,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var c=a.replace(k,j);C[c]=new w(c,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var c=a.replace(k,j);C[c]=new w(c,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){C[a]=new w(a,1,!1,a.toLowerCase(),null,!1,!1)}),C.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){C[a]=new w(a,1,!1,a.toLowerCase(),null,!0,!0)});function M(a,c,p,v){var S=C.hasOwnProperty(c)?C[c]:null;(S!==null?S.type!==0:v||!(2I||S[T]!==E[I]){var $=` +`+S[T].replace(" at new "," at ");return a.displayName&&$.includes("")&&($=$.replace("",a.displayName)),$}while(1<=T&&0<=I);break}}}finally{fe=!1,Error.prepareStackTrace=p}return(a=a?a.displayName||a.name:"")?F(a):""}function de(a){switch(a.tag){case 5:return F(a.type);case 16:return F("Lazy");case 13:return F("Suspense");case 19:return F("SuspenseList");case 0:case 2:case 15:return a=te(a.type,!1),a;case 11:return a=te(a.type.render,!1),a;case 1:return a=te(a.type,!0),a;default:return""}}function ge(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case O:return"Fragment";case N:return"Portal";case z:return"Profiler";case D:return"StrictMode";case G:return"Suspense";case W:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case pe:return(a.displayName||"Context")+".Consumer";case Q:return(a._context.displayName||"Context")+".Provider";case V:var c=a.render;return a=a.displayName,a||(a=c.displayName||c.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case ie:return c=a.displayName||null,c!==null?c:ge(a.type)||"Memo";case re:c=a._payload,a=a._init;try{return ge(a(c))}catch{}}return null}function Z(a){var c=a.type;switch(a.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=c.render,a=a.displayName||a.name||"",c.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ge(c);case 8:return c===D?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function ye(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function Re(a){var c=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function $e(a){var c=Re(a)?"checked":"value",p=Object.getOwnPropertyDescriptor(a.constructor.prototype,c),v=""+a[c];if(!a.hasOwnProperty(c)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var S=p.get,E=p.set;return Object.defineProperty(a,c,{configurable:!0,get:function(){return S.call(this)},set:function(T){v=""+T,E.call(this,T)}}),Object.defineProperty(a,c,{enumerable:p.enumerable}),{getValue:function(){return v},setValue:function(T){v=""+T},stopTracking:function(){a._valueTracker=null,delete a[c]}}}}function Ye(a){a._valueTracker||(a._valueTracker=$e(a))}function Fe(a){if(!a)return!1;var c=a._valueTracker;if(!c)return!0;var p=c.getValue(),v="";return a&&(v=Re(a)?a.checked?"true":"false":a.value),a=v,a!==p?(c.setValue(a),!0):!1}function ft(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}function ln(a,c){var p=c.checked;return he({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:p??a._wrapperState.initialChecked})}function Sn(a,c){var p=c.defaultValue==null?"":c.defaultValue,v=c.checked!=null?c.checked:c.defaultChecked;p=ye(c.value!=null?c.value:p),a._wrapperState={initialChecked:v,initialValue:p,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function vn(a,c){c=c.checked,c!=null&&M(a,"checked",c,!1)}function Cn(a,c){vn(a,c);var p=ye(c.value),v=c.type;if(p!=null)v==="number"?(p===0&&a.value===""||a.value!=p)&&(a.value=""+p):a.value!==""+p&&(a.value=""+p);else if(v==="submit"||v==="reset"){a.removeAttribute("value");return}c.hasOwnProperty("value")?X(a,c.type,p):c.hasOwnProperty("defaultValue")&&X(a,c.type,ye(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(a.defaultChecked=!!c.defaultChecked)}function L(a,c,p){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var v=c.type;if(!(v!=="submit"&&v!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+a._wrapperState.initialValue,p||c===a.value||(a.value=c),a.defaultValue=c}p=a.name,p!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,p!==""&&(a.name=p)}function X(a,c,p){(c!=="number"||ft(a.ownerDocument)!==a)&&(p==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+p&&(a.defaultValue=""+p))}var ue=Array.isArray;function Ne(a,c,p,v){if(a=a.options,c){c={};for(var S=0;S"+c.valueOf().toString()+"",c=bn.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;c.firstChild;)a.appendChild(c.firstChild)}});function gr(a,c){if(c){var p=a.firstChild;if(p&&p===a.lastChild&&p.nodeType===3){p.nodeValue=c;return}}a.textContent=c}var Qn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ro=["Webkit","ms","Moz","O"];Object.keys(Qn).forEach(function(a){ro.forEach(function(c){c=c+a.charAt(0).toUpperCase()+a.substring(1),Qn[c]=Qn[a]})});function Bn(a,c,p){return c==null||typeof c=="boolean"||c===""?"":p||typeof c!="number"||c===0||Qn.hasOwnProperty(a)&&Qn[a]?(""+c).trim():c+"px"}function Te(a,c){a=a.style;for(var p in c)if(c.hasOwnProperty(p)){var v=p.indexOf("--")===0,S=Bn(p,c[p],v);p==="float"&&(p="cssFloat"),v?a.setProperty(p,S):a[p]=S}}var ut=he({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function It(a,c){if(c){if(ut[a]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(n(137,a));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(n(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(n(61))}if(c.style!=null&&typeof c.style!="object")throw Error(n(62))}}function Tn(a,c){if(a.indexOf("-")===-1)return typeof c.is=="string";switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var mr=null;function vr(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Gr=null,Jr=null,_r=null;function Rr(a){if(a=Lc(a)){if(typeof Gr!="function")throw Error(n(280));var c=a.stateNode;c&&(c=Qd(c),Gr(a.stateNode,a.type,c))}}function Uo(a){Jr?_r?_r.push(a):_r=[a]:Jr=a}function vc(){if(Jr){var a=Jr,c=_r;if(_r=Jr=null,Rr(a),c)for(a=0;a>>=0,a===0?32:31-(fs(a)/Rd|0)|0}var Pd=64,Od=4194304;function xc(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function Id(a,c){var p=a.pendingLanes;if(p===0)return 0;var v=0,S=a.suspendedLanes,E=a.pingedLanes,T=p&268435455;if(T!==0){var I=T&~S;I!==0?v=xc(I):(E&=T,E!==0&&(v=xc(E)))}else T=p&~S,T!==0?v=xc(T):E!==0&&(v=xc(E));if(v===0)return 0;if(c!==0&&c!==v&&(c&S)===0&&(S=v&-v,E=c&-c,S>=E||S===16&&(E&4194240)!==0))return c;if((v&4)!==0&&(v|=p&16),c=a.entangledLanes,c!==0)for(a=a.entanglements,c&=v;0p;p++)c.push(a);return c}function wc(a,c,p){a.pendingLanes|=c,c!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,c=31-Tt(c),a[c]=p}function GI(a,c){var p=a.pendingLanes&~c;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=c,a.mutableReadLanes&=c,a.entangledLanes&=c,c=a.entanglements;var v=a.eventTimes;for(a=a.expirationTimes;0=Mc),Nw=" ",Mw=!1;function _w(a,c){switch(a){case"keyup":return SA.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rw(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Ki=!1;function EA(a,c){switch(a){case"compositionend":return Rw(c);case"keypress":return c.which!==32?null:(Mw=!0,Nw);case"textInput":return a=c.data,a===Nw&&Mw?null:a;default:return null}}function kA(a,c){if(Ki)return a==="compositionend"||!Bg&&_w(a,c)?(a=Sw(),$d=Ig=Go=null,Ki=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1=c)return{node:p,offset:c-a};a=v}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=Lw(p)}}function Bw(a,c){return a&&c?a===c?!0:a&&a.nodeType===3?!1:c&&c.nodeType===3?Bw(a,c.parentNode):"contains"in a?a.contains(c):a.compareDocumentPosition?!!(a.compareDocumentPosition(c)&16):!1:!1}function zw(){for(var a=window,c=ft();c instanceof a.HTMLIFrameElement;){try{var p=typeof c.contentWindow.location.href=="string"}catch{p=!1}if(p)a=c.contentWindow;else break;c=ft(a.document)}return c}function Vg(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c&&(c==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||c==="textarea"||a.contentEditable==="true")}function IA(a){var c=zw(),p=a.focusedElem,v=a.selectionRange;if(c!==p&&p&&p.ownerDocument&&Bw(p.ownerDocument.documentElement,p)){if(v!==null&&Vg(p)){if(c=v.start,a=v.end,a===void 0&&(a=c),"selectionStart"in p)p.selectionStart=c,p.selectionEnd=Math.min(a,p.value.length);else if(a=(c=p.ownerDocument||document)&&c.defaultView||window,a.getSelection){a=a.getSelection();var S=p.textContent.length,E=Math.min(v.start,S);v=v.end===void 0?E:Math.min(v.end,S),!a.extend&&E>v&&(S=v,v=E,E=S),S=$w(p,E);var T=$w(p,v);S&&T&&(a.rangeCount!==1||a.anchorNode!==S.node||a.anchorOffset!==S.offset||a.focusNode!==T.node||a.focusOffset!==T.offset)&&(c=c.createRange(),c.setStart(S.node,S.offset),a.removeAllRanges(),E>v?(a.addRange(c),a.extend(T.node,T.offset)):(c.setEnd(T.node,T.offset),a.addRange(c)))}}for(c=[],a=p;a=a.parentNode;)a.nodeType===1&&c.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p=document.documentMode,Wi=null,Hg=null,Oc=null,qg=!1;function Uw(a,c,p){var v=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;qg||Wi==null||Wi!==ft(v)||(v=Wi,"selectionStart"in v&&Vg(v)?v={start:v.selectionStart,end:v.selectionEnd}:(v=(v.ownerDocument&&v.ownerDocument.defaultView||window).getSelection(),v={anchorNode:v.anchorNode,anchorOffset:v.anchorOffset,focusNode:v.focusNode,focusOffset:v.focusOffset}),Oc&&Pc(Oc,v)||(Oc=v,v=Wd(Hg,"onSelect"),0Yi||(a.current=rm[Yi],rm[Yi]=null,Yi--)}function Qt(a,c){Yi++,rm[Yi]=a.current,a.current=c}var Yo={},Zn=Zo(Yo),yr=Zo(!1),Ka=Yo;function Xi(a,c){var p=a.type.contextTypes;if(!p)return Yo;var v=a.stateNode;if(v&&v.__reactInternalMemoizedUnmaskedChildContext===c)return v.__reactInternalMemoizedMaskedChildContext;var S={},E;for(E in p)S[E]=c[E];return v&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=c,a.__reactInternalMemoizedMaskedChildContext=S),S}function br(a){return a=a.childContextTypes,a!=null}function Zd(){en(yr),en(Zn)}function rS(a,c,p){if(Zn.current!==Yo)throw Error(n(168));Qt(Zn,c),Qt(yr,p)}function sS(a,c,p){var v=a.stateNode;if(c=c.childContextTypes,typeof v.getChildContext!="function")return p;v=v.getChildContext();for(var S in v)if(!(S in c))throw Error(n(108,Z(a)||"Unknown",S));return he({},p,v)}function Yd(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Yo,Ka=Zn.current,Qt(Zn,a),Qt(yr,yr.current),!0}function oS(a,c,p){var v=a.stateNode;if(!v)throw Error(n(169));p?(a=sS(a,c,Ka),v.__reactInternalMemoizedMergedChildContext=a,en(yr),en(Zn),Qt(Zn,a)):en(yr),Qt(yr,p)}var ao=null,Xd=!1,sm=!1;function aS(a){ao===null?ao=[a]:ao.push(a)}function KA(a){Xd=!0,aS(a)}function Xo(){if(!sm&&ao!==null){sm=!0;var a=0,c=Kt;try{var p=ao;for(Kt=1;a>=T,S-=T,io=1<<32-Tt(c)+S|p<dt?(Vn=tt,tt=null):Vn=tt.sibling;var Lt=be(J,tt,ee[dt],ke);if(Lt===null){tt===null&&(tt=Vn);break}a&&tt&&Lt.alternate===null&&c(J,tt),U=E(Lt,U,dt),et===null?Je=Lt:et.sibling=Lt,et=Lt,tt=Vn}if(dt===ee.length)return p(J,tt),cn&&Ga(J,dt),Je;if(tt===null){for(;dtdt?(Vn=tt,tt=null):Vn=tt.sibling;var la=be(J,tt,Lt.value,ke);if(la===null){tt===null&&(tt=Vn);break}a&&tt&&la.alternate===null&&c(J,tt),U=E(la,U,dt),et===null?Je=la:et.sibling=la,et=la,tt=Vn}if(Lt.done)return p(J,tt),cn&&Ga(J,dt),Je;if(tt===null){for(;!Lt.done;dt++,Lt=ee.next())Lt=we(J,Lt.value,ke),Lt!==null&&(U=E(Lt,U,dt),et===null?Je=Lt:et.sibling=Lt,et=Lt);return cn&&Ga(J,dt),Je}for(tt=v(J,tt);!Lt.done;dt++,Lt=ee.next())Lt=De(tt,J,dt,Lt.value,ke),Lt!==null&&(a&&Lt.alternate!==null&&tt.delete(Lt.key===null?dt:Lt.key),U=E(Lt,U,dt),et===null?Je=Lt:et.sibling=Lt,et=Lt);return a&&tt.forEach(function(jD){return c(J,jD)}),cn&&Ga(J,dt),Je}function kn(J,U,ee,ke){if(typeof ee=="object"&&ee!==null&&ee.type===O&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case R:e:{for(var Je=ee.key,et=U;et!==null;){if(et.key===Je){if(Je=ee.type,Je===O){if(et.tag===7){p(J,et.sibling),U=S(et,ee.props.children),U.return=J,J=U;break e}}else if(et.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===re&&fS(Je)===et.type){p(J,et.sibling),U=S(et,ee.props),U.ref=$c(J,et,ee),U.return=J,J=U;break e}p(J,et);break}else c(J,et);et=et.sibling}ee.type===O?(U=ni(ee.props.children,J.mode,ke,ee.key),U.return=J,J=U):(ke=Nf(ee.type,ee.key,ee.props,null,J.mode,ke),ke.ref=$c(J,U,ee),ke.return=J,J=ke)}return T(J);case N:e:{for(et=ee.key;U!==null;){if(U.key===et)if(U.tag===4&&U.stateNode.containerInfo===ee.containerInfo&&U.stateNode.implementation===ee.implementation){p(J,U.sibling),U=S(U,ee.children||[]),U.return=J,J=U;break e}else{p(J,U);break}else c(J,U);U=U.sibling}U=tv(ee,J.mode,ke),U.return=J,J=U}return T(J);case re:return et=ee._init,kn(J,U,et(ee._payload),ke)}if(ue(ee))return He(J,U,ee,ke);if(q(ee))return Ke(J,U,ee,ke);rf(J,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"?(ee=""+ee,U!==null&&U.tag===6?(p(J,U.sibling),U=S(U,ee),U.return=J,J=U):(p(J,U),U=ev(ee,J.mode,ke),U.return=J,J=U),T(J)):p(J,U)}return kn}var rl=pS(!0),hS=pS(!1),sf=Zo(null),of=null,sl=null,um=null;function dm(){um=sl=of=null}function fm(a){var c=sf.current;en(sf),a._currentValue=c}function pm(a,c,p){for(;a!==null;){var v=a.alternate;if((a.childLanes&c)!==c?(a.childLanes|=c,v!==null&&(v.childLanes|=c)):v!==null&&(v.childLanes&c)!==c&&(v.childLanes|=c),a===p)break;a=a.return}}function ol(a,c){of=a,um=sl=null,a=a.dependencies,a!==null&&a.firstContext!==null&&((a.lanes&c)!==0&&(xr=!0),a.firstContext=null)}function Yr(a){var c=a._currentValue;if(um!==a)if(a={context:a,memoizedValue:c,next:null},sl===null){if(of===null)throw Error(n(308));sl=a,of.dependencies={lanes:0,firstContext:a}}else sl=sl.next=a;return c}var Ja=null;function hm(a){Ja===null?Ja=[a]:Ja.push(a)}function gS(a,c,p,v){var S=c.interleaved;return S===null?(p.next=p,hm(c)):(p.next=S.next,S.next=p),c.interleaved=p,co(a,v)}function co(a,c){a.lanes|=c;var p=a.alternate;for(p!==null&&(p.lanes|=c),p=a,a=a.return;a!==null;)a.childLanes|=c,p=a.alternate,p!==null&&(p.childLanes|=c),p=a,a=a.return;return p.tag===3?p.stateNode:null}var ea=!1;function gm(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function mS(a,c){a=a.updateQueue,c.updateQueue===a&&(c.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function uo(a,c){return{eventTime:a,lane:c,tag:0,payload:null,callback:null,next:null}}function ta(a,c,p){var v=a.updateQueue;if(v===null)return null;if(v=v.shared,(Ft&2)!==0){var S=v.pending;return S===null?c.next=c:(c.next=S.next,S.next=c),v.pending=c,co(a,p)}return S=v.interleaved,S===null?(c.next=c,hm(v)):(c.next=S.next,S.next=c),v.interleaved=c,co(a,p)}function af(a,c,p){if(c=c.updateQueue,c!==null&&(c=c.shared,(p&4194240)!==0)){var v=c.lanes;v&=a.pendingLanes,p|=v,c.lanes=p,Mg(a,p)}}function vS(a,c){var p=a.updateQueue,v=a.alternate;if(v!==null&&(v=v.updateQueue,p===v)){var S=null,E=null;if(p=p.firstBaseUpdate,p!==null){do{var T={eventTime:p.eventTime,lane:p.lane,tag:p.tag,payload:p.payload,callback:p.callback,next:null};E===null?S=E=T:E=E.next=T,p=p.next}while(p!==null);E===null?S=E=c:E=E.next=c}else S=E=c;p={baseState:v.baseState,firstBaseUpdate:S,lastBaseUpdate:E,shared:v.shared,effects:v.effects},a.updateQueue=p;return}a=p.lastBaseUpdate,a===null?p.firstBaseUpdate=c:a.next=c,p.lastBaseUpdate=c}function lf(a,c,p,v){var S=a.updateQueue;ea=!1;var E=S.firstBaseUpdate,T=S.lastBaseUpdate,I=S.shared.pending;if(I!==null){S.shared.pending=null;var $=I,ae=$.next;$.next=null,T===null?E=ae:T.next=ae,T=$;var xe=a.alternate;xe!==null&&(xe=xe.updateQueue,I=xe.lastBaseUpdate,I!==T&&(I===null?xe.firstBaseUpdate=ae:I.next=ae,xe.lastBaseUpdate=$))}if(E!==null){var we=S.baseState;T=0,xe=ae=$=null,I=E;do{var be=I.lane,De=I.eventTime;if((v&be)===be){xe!==null&&(xe=xe.next={eventTime:De,lane:0,tag:I.tag,payload:I.payload,callback:I.callback,next:null});e:{var He=a,Ke=I;switch(be=c,De=p,Ke.tag){case 1:if(He=Ke.payload,typeof He=="function"){we=He.call(De,we,be);break e}we=He;break e;case 3:He.flags=He.flags&-65537|128;case 0:if(He=Ke.payload,be=typeof He=="function"?He.call(De,we,be):He,be==null)break e;we=he({},we,be);break e;case 2:ea=!0}}I.callback!==null&&I.lane!==0&&(a.flags|=64,be=S.effects,be===null?S.effects=[I]:be.push(I))}else De={eventTime:De,lane:be,tag:I.tag,payload:I.payload,callback:I.callback,next:null},xe===null?(ae=xe=De,$=we):xe=xe.next=De,T|=be;if(I=I.next,I===null){if(I=S.shared.pending,I===null)break;be=I,I=be.next,be.next=null,S.lastBaseUpdate=be,S.shared.pending=null}}while(!0);if(xe===null&&($=we),S.baseState=$,S.firstBaseUpdate=ae,S.lastBaseUpdate=xe,c=S.shared.interleaved,c!==null){S=c;do T|=S.lane,S=S.next;while(S!==c)}else E===null&&(S.shared.lanes=0);Ya|=T,a.lanes=T,a.memoizedState=we}}function yS(a,c,p){if(a=c.effects,c.effects=null,a!==null)for(c=0;cp?p:4,a(!0);var v=xm.transition;xm.transition={};try{a(!1),c()}finally{Kt=p,xm.transition=v}}function FS(){return Xr().memoizedState}function QA(a,c,p){var v=oa(a);if(p={lane:v,action:p,hasEagerState:!1,eagerState:null,next:null},LS(a))$S(c,p);else if(p=gS(a,c,p,v),p!==null){var S=ir();ys(p,a,v,S),BS(p,c,v)}}function ZA(a,c,p){var v=oa(a),S={lane:v,action:p,hasEagerState:!1,eagerState:null,next:null};if(LS(a))$S(c,S);else{var E=a.alternate;if(a.lanes===0&&(E===null||E.lanes===0)&&(E=c.lastRenderedReducer,E!==null))try{var T=c.lastRenderedState,I=E(T,p);if(S.hasEagerState=!0,S.eagerState=I,ps(I,T)){var $=c.interleaved;$===null?(S.next=S,hm(c)):(S.next=$.next,$.next=S),c.interleaved=S;return}}catch{}finally{}p=gS(a,c,S,v),p!==null&&(S=ir(),ys(p,a,v,S),BS(p,c,v))}}function LS(a){var c=a.alternate;return a===hn||c!==null&&c===hn}function $S(a,c){Vc=df=!0;var p=a.pending;p===null?c.next=c:(c.next=p.next,p.next=c),a.pending=c}function BS(a,c,p){if((p&4194240)!==0){var v=c.lanes;v&=a.pendingLanes,p|=v,c.lanes=p,Mg(a,p)}}var hf={readContext:Yr,useCallback:Yn,useContext:Yn,useEffect:Yn,useImperativeHandle:Yn,useInsertionEffect:Yn,useLayoutEffect:Yn,useMemo:Yn,useReducer:Yn,useRef:Yn,useState:Yn,useDebugValue:Yn,useDeferredValue:Yn,useTransition:Yn,useMutableSource:Yn,useSyncExternalStore:Yn,useId:Yn,unstable_isNewReconciler:!1},YA={readContext:Yr,useCallback:function(a,c){return Fs().memoizedState=[a,c===void 0?null:c],a},useContext:Yr,useEffect:MS,useImperativeHandle:function(a,c,p){return p=p!=null?p.concat([a]):null,ff(4194308,4,PS.bind(null,c,a),p)},useLayoutEffect:function(a,c){return ff(4194308,4,a,c)},useInsertionEffect:function(a,c){return ff(4,2,a,c)},useMemo:function(a,c){var p=Fs();return c=c===void 0?null:c,a=a(),p.memoizedState=[a,c],a},useReducer:function(a,c,p){var v=Fs();return c=p!==void 0?p(c):c,v.memoizedState=v.baseState=c,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:c},v.queue=a,a=a.dispatch=QA.bind(null,hn,a),[v.memoizedState,a]},useRef:function(a){var c=Fs();return a={current:a},c.memoizedState=a},useState:TS,useDebugValue:Tm,useDeferredValue:function(a){return Fs().memoizedState=a},useTransition:function(){var a=TS(!1),c=a[0];return a=JA.bind(null,a[1]),Fs().memoizedState=a,[c,a]},useMutableSource:function(){},useSyncExternalStore:function(a,c,p){var v=hn,S=Fs();if(cn){if(p===void 0)throw Error(n(407));p=p()}else{if(p=c(),Un===null)throw Error(n(349));(Za&30)!==0||SS(v,c,p)}S.memoizedState=p;var E={value:p,getSnapshot:c};return S.queue=E,MS(ES.bind(null,v,E,a),[a]),v.flags|=2048,Kc(9,CS.bind(null,v,E,p,c),void 0,null),p},useId:function(){var a=Fs(),c=Un.identifierPrefix;if(cn){var p=lo,v=io;p=(v&~(1<<32-Tt(v)-1)).toString(32)+p,c=":"+c+"R"+p,p=Hc++,0<\/script>",a=a.removeChild(a.firstChild)):typeof v.is=="string"?a=T.createElement(p,{is:v.is}):(a=T.createElement(p),p==="select"&&(T=a,v.multiple?T.multiple=!0:v.size&&(T.size=v.size))):a=T.createElementNS(a,p),a[As]=c,a[Fc]=v,a0(a,c,!1,!1),c.stateNode=a;e:{switch(T=Tn(p,v),p){case"dialog":Xt("cancel",a),Xt("close",a),S=v;break;case"iframe":case"object":case"embed":Xt("load",a),S=v;break;case"video":case"audio":for(S=0;Sul&&(c.flags|=128,v=!0,Wc(E,!1),c.lanes=4194304)}else{if(!v)if(a=cf(T),a!==null){if(c.flags|=128,v=!0,p=a.updateQueue,p!==null&&(c.updateQueue=p,c.flags|=4),Wc(E,!0),E.tail===null&&E.tailMode==="hidden"&&!T.alternate&&!cn)return Xn(c),null}else 2*Gt()-E.renderingStartTime>ul&&p!==1073741824&&(c.flags|=128,v=!0,Wc(E,!1),c.lanes=4194304);E.isBackwards?(T.sibling=c.child,c.child=T):(p=E.last,p!==null?p.sibling=T:c.child=T,E.last=T)}return E.tail!==null?(c=E.tail,E.rendering=c,E.tail=c.sibling,E.renderingStartTime=Gt(),c.sibling=null,p=pn.current,Qt(pn,v?p&1|2:p&1),c):(Xn(c),null);case 22:case 23:return Zm(),v=c.memoizedState!==null,a!==null&&a.memoizedState!==null!==v&&(c.flags|=8192),v&&(c.mode&1)!==0?(Dr&1073741824)!==0&&(Xn(c),c.subtreeFlags&6&&(c.flags|=8192)):Xn(c),null;case 24:return null;case 25:return null}throw Error(n(156,c.tag))}function aD(a,c){switch(am(c),c.tag){case 1:return br(c.type)&&Zd(),a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 3:return al(),en(yr),en(Zn),bm(),a=c.flags,(a&65536)!==0&&(a&128)===0?(c.flags=a&-65537|128,c):null;case 5:return vm(c),null;case 13:if(en(pn),a=c.memoizedState,a!==null&&a.dehydrated!==null){if(c.alternate===null)throw Error(n(340));nl()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 19:return en(pn),null;case 4:return al(),null;case 10:return fm(c.type._context),null;case 22:case 23:return Zm(),null;case 24:return null;default:return null}}var yf=!1,er=!1,iD=typeof WeakSet=="function"?WeakSet:Set,ze=null;function ll(a,c){var p=a.ref;if(p!==null)if(typeof p=="function")try{p(null)}catch(v){xn(a,c,v)}else p.current=null}function $m(a,c,p){try{p()}catch(v){xn(a,c,v)}}var c0=!1;function lD(a,c){if(Zg=Fd,a=zw(),Vg(a)){if("selectionStart"in a)var p={start:a.selectionStart,end:a.selectionEnd};else e:{p=(p=a.ownerDocument)&&p.defaultView||window;var v=p.getSelection&&p.getSelection();if(v&&v.rangeCount!==0){p=v.anchorNode;var S=v.anchorOffset,E=v.focusNode;v=v.focusOffset;try{p.nodeType,E.nodeType}catch{p=null;break e}var T=0,I=-1,$=-1,ae=0,xe=0,we=a,be=null;t:for(;;){for(var De;we!==p||S!==0&&we.nodeType!==3||(I=T+S),we!==E||v!==0&&we.nodeType!==3||($=T+v),we.nodeType===3&&(T+=we.nodeValue.length),(De=we.firstChild)!==null;)be=we,we=De;for(;;){if(we===a)break t;if(be===p&&++ae===S&&(I=T),be===E&&++xe===v&&($=T),(De=we.nextSibling)!==null)break;we=be,be=we.parentNode}we=De}p=I===-1||$===-1?null:{start:I,end:$}}else p=null}p=p||{start:0,end:0}}else p=null;for(Yg={focusedElem:a,selectionRange:p},Fd=!1,ze=c;ze!==null;)if(c=ze,a=c.child,(c.subtreeFlags&1028)!==0&&a!==null)a.return=c,ze=a;else for(;ze!==null;){c=ze;try{var He=c.alternate;if((c.flags&1024)!==0)switch(c.tag){case 0:case 11:case 15:break;case 1:if(He!==null){var Ke=He.memoizedProps,kn=He.memoizedState,J=c.stateNode,U=J.getSnapshotBeforeUpdate(c.elementType===c.type?Ke:gs(c.type,Ke),kn);J.__reactInternalSnapshotBeforeUpdate=U}break;case 3:var ee=c.stateNode.containerInfo;ee.nodeType===1?ee.textContent="":ee.nodeType===9&&ee.documentElement&&ee.removeChild(ee.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ke){xn(c,c.return,ke)}if(a=c.sibling,a!==null){a.return=c.return,ze=a;break}ze=c.return}return He=c0,c0=!1,He}function Gc(a,c,p){var v=c.updateQueue;if(v=v!==null?v.lastEffect:null,v!==null){var S=v=v.next;do{if((S.tag&a)===a){var E=S.destroy;S.destroy=void 0,E!==void 0&&$m(c,p,E)}S=S.next}while(S!==v)}}function bf(a,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var p=c=c.next;do{if((p.tag&a)===a){var v=p.create;p.destroy=v()}p=p.next}while(p!==c)}}function Bm(a){var c=a.ref;if(c!==null){var p=a.stateNode;switch(a.tag){case 5:a=p;break;default:a=p}typeof c=="function"?c(a):c.current=a}}function u0(a){var c=a.alternate;c!==null&&(a.alternate=null,u0(c)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(c=a.stateNode,c!==null&&(delete c[As],delete c[Fc],delete c[nm],delete c[HA],delete c[qA])),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function d0(a){return a.tag===5||a.tag===3||a.tag===4}function f0(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||d0(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function zm(a,c,p){var v=a.tag;if(v===5||v===6)a=a.stateNode,c?p.nodeType===8?p.parentNode.insertBefore(a,c):p.insertBefore(a,c):(p.nodeType===8?(c=p.parentNode,c.insertBefore(a,p)):(c=p,c.appendChild(a)),p=p._reactRootContainer,p!=null||c.onclick!==null||(c.onclick=Jd));else if(v!==4&&(a=a.child,a!==null))for(zm(a,c,p),a=a.sibling;a!==null;)zm(a,c,p),a=a.sibling}function Um(a,c,p){var v=a.tag;if(v===5||v===6)a=a.stateNode,c?p.insertBefore(a,c):p.appendChild(a);else if(v!==4&&(a=a.child,a!==null))for(Um(a,c,p),a=a.sibling;a!==null;)Um(a,c,p),a=a.sibling}var qn=null,ms=!1;function na(a,c,p){for(p=p.child;p!==null;)p0(a,c,p),p=p.sibling}function p0(a,c,p){if(Dt&&typeof Dt.onCommitFiberUnmount=="function")try{Dt.onCommitFiberUnmount(pt,p)}catch{}switch(p.tag){case 5:er||ll(p,c);case 6:var v=qn,S=ms;qn=null,na(a,c,p),qn=v,ms=S,qn!==null&&(ms?(a=qn,p=p.stateNode,a.nodeType===8?a.parentNode.removeChild(p):a.removeChild(p)):qn.removeChild(p.stateNode));break;case 18:qn!==null&&(ms?(a=qn,p=p.stateNode,a.nodeType===8?tm(a.parentNode,p):a.nodeType===1&&tm(a,p),jc(a)):tm(qn,p.stateNode));break;case 4:v=qn,S=ms,qn=p.stateNode.containerInfo,ms=!0,na(a,c,p),qn=v,ms=S;break;case 0:case 11:case 14:case 15:if(!er&&(v=p.updateQueue,v!==null&&(v=v.lastEffect,v!==null))){S=v=v.next;do{var E=S,T=E.destroy;E=E.tag,T!==void 0&&((E&2)!==0||(E&4)!==0)&&$m(p,c,T),S=S.next}while(S!==v)}na(a,c,p);break;case 1:if(!er&&(ll(p,c),v=p.stateNode,typeof v.componentWillUnmount=="function"))try{v.props=p.memoizedProps,v.state=p.memoizedState,v.componentWillUnmount()}catch(I){xn(p,c,I)}na(a,c,p);break;case 21:na(a,c,p);break;case 22:p.mode&1?(er=(v=er)||p.memoizedState!==null,na(a,c,p),er=v):na(a,c,p);break;default:na(a,c,p)}}function h0(a){var c=a.updateQueue;if(c!==null){a.updateQueue=null;var p=a.stateNode;p===null&&(p=a.stateNode=new iD),c.forEach(function(v){var S=vD.bind(null,a,v);p.has(v)||(p.add(v),v.then(S,S))})}}function vs(a,c){var p=c.deletions;if(p!==null)for(var v=0;vS&&(S=T),v&=~E}if(v=S,v=Gt()-v,v=(120>v?120:480>v?480:1080>v?1080:1920>v?1920:3e3>v?3e3:4320>v?4320:1960*uD(v/1960))-v,10a?16:a,sa===null)var v=!1;else{if(a=sa,sa=null,Ef=0,(Ft&6)!==0)throw Error(n(331));var S=Ft;for(Ft|=4,ze=a.current;ze!==null;){var E=ze,T=E.child;if((ze.flags&16)!==0){var I=E.deletions;if(I!==null){for(var $=0;$Gt()-qm?ei(a,0):Hm|=p),Sr(a,c)}function T0(a,c){c===0&&((a.mode&1)===0?c=1:(c=Od,Od<<=1,(Od&130023424)===0&&(Od=4194304)));var p=ir();a=co(a,c),a!==null&&(wc(a,c,p),Sr(a,p))}function mD(a){var c=a.memoizedState,p=0;c!==null&&(p=c.retryLane),T0(a,p)}function vD(a,c){var p=0;switch(a.tag){case 13:var v=a.stateNode,S=a.memoizedState;S!==null&&(p=S.retryLane);break;case 19:v=a.stateNode;break;default:throw Error(n(314))}v!==null&&v.delete(c),T0(a,p)}var N0;N0=function(a,c,p){if(a!==null)if(a.memoizedProps!==c.pendingProps||yr.current)xr=!0;else{if((a.lanes&p)===0&&(c.flags&128)===0)return xr=!1,sD(a,c,p);xr=(a.flags&131072)!==0}else xr=!1,cn&&(c.flags&1048576)!==0&&iS(c,tf,c.index);switch(c.lanes=0,c.tag){case 2:var v=c.type;vf(a,c),a=c.pendingProps;var S=Xi(c,Zn.current);ol(c,p),S=Sm(null,c,v,a,S,p);var E=Cm();return c.flags|=1,typeof S=="object"&&S!==null&&typeof S.render=="function"&&S.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,br(v)?(E=!0,Yd(c)):E=!1,c.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,gm(c),S.updater=gf,c.stateNode=S,S._reactInternals=c,Mm(c,v,a,p),c=Om(null,c,v,!0,E,p)):(c.tag=0,cn&&E&&om(c),ar(null,c,S,p),c=c.child),c;case 16:v=c.elementType;e:{switch(vf(a,c),a=c.pendingProps,S=v._init,v=S(v._payload),c.type=v,S=c.tag=bD(v),a=gs(v,a),S){case 0:c=Pm(null,c,v,a,p);break e;case 1:c=e0(null,c,v,a,p);break e;case 11:c=JS(null,c,v,a,p);break e;case 14:c=QS(null,c,v,gs(v.type,a),p);break e}throw Error(n(306,v,""))}return c;case 0:return v=c.type,S=c.pendingProps,S=c.elementType===v?S:gs(v,S),Pm(a,c,v,S,p);case 1:return v=c.type,S=c.pendingProps,S=c.elementType===v?S:gs(v,S),e0(a,c,v,S,p);case 3:e:{if(t0(c),a===null)throw Error(n(387));v=c.pendingProps,E=c.memoizedState,S=E.element,mS(a,c),lf(c,v,null,p);var T=c.memoizedState;if(v=T.element,E.isDehydrated)if(E={element:v,isDehydrated:!1,cache:T.cache,pendingSuspenseBoundaries:T.pendingSuspenseBoundaries,transitions:T.transitions},c.updateQueue.baseState=E,c.memoizedState=E,c.flags&256){S=il(Error(n(423)),c),c=n0(a,c,v,p,S);break e}else if(v!==S){S=il(Error(n(424)),c),c=n0(a,c,v,p,S);break e}else for(Ar=Qo(c.stateNode.containerInfo.firstChild),Ir=c,cn=!0,hs=null,p=hS(c,null,v,p),c.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling;else{if(nl(),v===S){c=fo(a,c,p);break e}ar(a,c,v,p)}c=c.child}return c;case 5:return bS(c),a===null&&lm(c),v=c.type,S=c.pendingProps,E=a!==null?a.memoizedProps:null,T=S.children,Xg(v,S)?T=null:E!==null&&Xg(v,E)&&(c.flags|=32),XS(a,c),ar(a,c,T,p),c.child;case 6:return a===null&&lm(c),null;case 13:return r0(a,c,p);case 4:return mm(c,c.stateNode.containerInfo),v=c.pendingProps,a===null?c.child=rl(c,null,v,p):ar(a,c,v,p),c.child;case 11:return v=c.type,S=c.pendingProps,S=c.elementType===v?S:gs(v,S),JS(a,c,v,S,p);case 7:return ar(a,c,c.pendingProps,p),c.child;case 8:return ar(a,c,c.pendingProps.children,p),c.child;case 12:return ar(a,c,c.pendingProps.children,p),c.child;case 10:e:{if(v=c.type._context,S=c.pendingProps,E=c.memoizedProps,T=S.value,Qt(sf,v._currentValue),v._currentValue=T,E!==null)if(ps(E.value,T)){if(E.children===S.children&&!yr.current){c=fo(a,c,p);break e}}else for(E=c.child,E!==null&&(E.return=c);E!==null;){var I=E.dependencies;if(I!==null){T=E.child;for(var $=I.firstContext;$!==null;){if($.context===v){if(E.tag===1){$=uo(-1,p&-p),$.tag=2;var ae=E.updateQueue;if(ae!==null){ae=ae.shared;var xe=ae.pending;xe===null?$.next=$:($.next=xe.next,xe.next=$),ae.pending=$}}E.lanes|=p,$=E.alternate,$!==null&&($.lanes|=p),pm(E.return,p,c),I.lanes|=p;break}$=$.next}}else if(E.tag===10)T=E.type===c.type?null:E.child;else if(E.tag===18){if(T=E.return,T===null)throw Error(n(341));T.lanes|=p,I=T.alternate,I!==null&&(I.lanes|=p),pm(T,p,c),T=E.sibling}else T=E.child;if(T!==null)T.return=E;else for(T=E;T!==null;){if(T===c){T=null;break}if(E=T.sibling,E!==null){E.return=T.return,T=E;break}T=T.return}E=T}ar(a,c,S.children,p),c=c.child}return c;case 9:return S=c.type,v=c.pendingProps.children,ol(c,p),S=Yr(S),v=v(S),c.flags|=1,ar(a,c,v,p),c.child;case 14:return v=c.type,S=gs(v,c.pendingProps),S=gs(v.type,S),QS(a,c,v,S,p);case 15:return ZS(a,c,c.type,c.pendingProps,p);case 17:return v=c.type,S=c.pendingProps,S=c.elementType===v?S:gs(v,S),vf(a,c),c.tag=1,br(v)?(a=!0,Yd(c)):a=!1,ol(c,p),US(c,v,S),Mm(c,v,S,p),Om(null,c,v,!0,a,p);case 19:return o0(a,c,p);case 22:return YS(a,c,p)}throw Error(n(156,c.tag))};function M0(a,c){return Nn(a,c)}function yD(a,c,p,v){this.tag=a,this.key=p,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=v,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ts(a,c,p,v){return new yD(a,c,p,v)}function Xm(a){return a=a.prototype,!(!a||!a.isReactComponent)}function bD(a){if(typeof a=="function")return Xm(a)?1:0;if(a!=null){if(a=a.$$typeof,a===V)return 11;if(a===ie)return 14}return 2}function ia(a,c){var p=a.alternate;return p===null?(p=ts(a.tag,c,a.key,a.mode),p.elementType=a.elementType,p.type=a.type,p.stateNode=a.stateNode,p.alternate=a,a.alternate=p):(p.pendingProps=c,p.type=a.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=a.flags&14680064,p.childLanes=a.childLanes,p.lanes=a.lanes,p.child=a.child,p.memoizedProps=a.memoizedProps,p.memoizedState=a.memoizedState,p.updateQueue=a.updateQueue,c=a.dependencies,p.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},p.sibling=a.sibling,p.index=a.index,p.ref=a.ref,p}function Nf(a,c,p,v,S,E){var T=2;if(v=a,typeof a=="function")Xm(a)&&(T=1);else if(typeof a=="string")T=5;else e:switch(a){case O:return ni(p.children,S,E,c);case D:T=8,S|=8;break;case z:return a=ts(12,p,c,S|2),a.elementType=z,a.lanes=E,a;case G:return a=ts(13,p,c,S),a.elementType=G,a.lanes=E,a;case W:return a=ts(19,p,c,S),a.elementType=W,a.lanes=E,a;case Y:return Mf(p,S,E,c);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case Q:T=10;break e;case pe:T=9;break e;case V:T=11;break e;case ie:T=14;break e;case re:T=16,v=null;break e}throw Error(n(130,a==null?a:typeof a,""))}return c=ts(T,p,c,S),c.elementType=a,c.type=v,c.lanes=E,c}function ni(a,c,p,v){return a=ts(7,a,v,c),a.lanes=p,a}function Mf(a,c,p,v){return a=ts(22,a,v,c),a.elementType=Y,a.lanes=p,a.stateNode={isHidden:!1},a}function ev(a,c,p){return a=ts(6,a,null,c),a.lanes=p,a}function tv(a,c,p){return c=ts(4,a.children!==null?a.children:[],a.key,c),c.lanes=p,c.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},c}function xD(a,c,p,v,S){this.tag=c,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ng(0),this.expirationTimes=Ng(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ng(0),this.identifierPrefix=v,this.onRecoverableError=S,this.mutableSourceEagerHydrationData=null}function nv(a,c,p,v,S,E,T,I,$){return a=new xD(a,c,p,I,$),c===1?(c=1,E===!0&&(c|=8)):c=0,E=ts(3,null,null,c),a.current=E,E.stateNode=a,E.memoizedState={element:v,isDehydrated:p,cache:null,transitions:null,pendingSuspenseBoundaries:null},gm(E),a}function wD(a,c,p){var v=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),cv.exports=fF(),cv.exports}var Q0;function pF(){if(Q0)return Ff;Q0=1;var e=tj();return Ff.createRoot=e.createRoot,Ff.hydrateRoot=e.hydrateRoot,Ff}var hF=pF();const gF=fd(hF),mF=(...e)=>{console?.warn&&(fi(e[0])&&(e[0]=`react-i18next:: ${e[0]}`),console.warn(...e))},Z0={},jy=(...e)=>{fi(e[0])&&Z0[e[0]]||(fi(e[0])&&(Z0[e[0]]=new Date),mF(...e))},nj=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},Y0=(e,t,n)=>{e.loadNamespaces(t,nj(e,n))},X0=(e,t,n,r)=>{fi(n)&&(n=[n]),n.forEach(s=>{e.options.ns.indexOf(s)<0&&e.options.ns.push(s)}),e.loadLanguages(t,nj(e,r))},vF=(e,t,n={})=>!t.languages||!t.languages.length?(jy("i18n.languages were undefined or empty",t.languages),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,s)=>{if(n.bindI18n?.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!s(r.isLanguageChangingTo,e))return!1}}),fi=e=>typeof e=="string",yF=e=>typeof e=="object"&&e!==null,bF=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,xF={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},wF=e=>xF[e],SF=e=>e.replace(bF,wF);let Ty={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:SF};const CF=(e={})=>{Ty={...Ty,...e}},EF=()=>Ty;let rj;const kF=e=>{rj=e},jF=()=>rj,TF={type:"3rdParty",init(e){CF(e.options.react),kF(e)}},sj=y.createContext();class NF{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]??=!0})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const MF=(e,t)=>{const n=y.useRef();return y.useEffect(()=>{n.current=e},[e,t]),n.current},oj=(e,t,n,r)=>e.getFixedT(t,n,r),_F=(e,t,n,r)=>y.useCallback(oj(e,t,n,r),[e,t,n,r]),Ve=(e,t={})=>{const{i18n:n}=t,{i18n:r,defaultNS:s}=y.useContext(sj)||{},o=n||r||jF();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new NF),!o){jy("You will need to pass in an i18next instance by using initReactI18next");const _=(N,O)=>fi(O)?O:yF(O)&&fi(O.defaultValue)?O.defaultValue:Array.isArray(N)?N[N.length-1]:N,R=[_,{},!1];return R.t=_,R.i18n={},R.ready=!1,R}o.options.react?.wait&&jy("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const l={...EF(),...o.options.react,...t},{useSuspense:u,keyPrefix:d}=l;let f=s||o.options?.defaultNS;f=fi(f)?[f]:f||["translation"],o.reportNamespaces.addUsedNamespaces?.(f);const h=(o.isInitialized||o.initializedStoreOnce)&&f.every(_=>vF(_,o,l)),m=_F(o,t.lng||null,l.nsMode==="fallback"?f:f[0],d),g=()=>m,x=()=>oj(o,t.lng||null,l.nsMode==="fallback"?f:f[0],d),[b,w]=y.useState(g);let C=f.join();t.lng&&(C=`${t.lng}${C}`);const k=MF(C),j=y.useRef(!0);y.useEffect(()=>{const{bindI18n:_,bindI18nStore:R}=l;j.current=!0,!h&&!u&&(t.lng?X0(o,t.lng,f,()=>{j.current&&w(x)}):Y0(o,f,()=>{j.current&&w(x)})),h&&k&&k!==C&&j.current&&w(x);const N=()=>{j.current&&w(x)};return _&&o?.on(_,N),R&&o?.store.on(R,N),()=>{j.current=!1,o&&_?.split(" ").forEach(O=>o.off(O,N)),R&&o&&R.split(" ").forEach(O=>o.store.off(O,N))}},[o,C]),y.useEffect(()=>{j.current&&h&&w(g)},[o,d,h]);const M=[b,o,h];if(M.t=b,M.i18n=o,M.ready=h,h||!h&&!u)return M;throw new Promise(_=>{t.lng?X0(o,t.lng,f,()=>_()):Y0(o,f,()=>_())})};function RF({i18n:e,defaultNS:t,children:n}){const r=y.useMemo(()=>({i18n:e,defaultNS:t}),[e,t]);return y.createElement(sj.Provider,{value:r},n)}var Ma=tj();const Ib=fd(Ma),PF=Bk({__proto__:null,default:Ib},[Ma]);/** + * @remix-run/router v1.18.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function mn(){return mn=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Ll(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function IF(){return Math.random().toString(36).substr(2,8)}function tC(e,t){return{usr:e.state,key:e.key,idx:t}}function Iu(e,t,n,r){return n===void 0&&(n=null),mn({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?_a(t):t,{state:n,key:t&&t.key||r||IF()})}function wi(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function _a(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function AF(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:o=!1}=r,l=s.history,u=_n.Pop,d=null,f=h();f==null&&(f=0,l.replaceState(mn({},l.state,{idx:f}),""));function h(){return(l.state||{idx:null}).idx}function m(){u=_n.Pop;let C=h(),k=C==null?null:C-f;f=C,d&&d({action:u,location:w.location,delta:k})}function g(C,k){u=_n.Push;let j=Iu(w.location,C,k);f=h()+1;let M=tC(j,f),_=w.createHref(j);try{l.pushState(M,"",_)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;s.location.assign(_)}o&&d&&d({action:u,location:w.location,delta:1})}function x(C,k){u=_n.Replace;let j=Iu(w.location,C,k);f=h();let M=tC(j,f),_=w.createHref(j);l.replaceState(M,"",_),o&&d&&d({action:u,location:w.location,delta:0})}function b(C){let k=s.location.origin!=="null"?s.location.origin:s.location.href,j=typeof C=="string"?C:wi(C);return j=j.replace(/ $/,"%20"),Ct(k,"No window.location.(origin|href) available to create URL for href: "+j),new URL(j,k)}let w={get action(){return u},get location(){return e(s,l)},listen(C){if(d)throw new Error("A history only accepts one active listener");return s.addEventListener(eC,m),d=C,()=>{s.removeEventListener(eC,m),d=null}},createHref(C){return t(s,C)},createURL:b,encodeLocation(C){let k=b(C);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:g,replace:x,go(C){return l.go(C)}};return w}var Zt;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Zt||(Zt={}));const DF=new Set(["lazy","caseSensitive","path","id","index","children"]);function FF(e){return e.index===!0}function Au(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((s,o)=>{let l=[...n,String(o)],u=typeof s.id=="string"?s.id:l.join("-");if(Ct(s.index!==!0||!s.children,"Cannot specify children on an index route"),Ct(!r[u],'Found a route id collision on id "'+u+`". Route id's must be globally unique within Data Router usages`),FF(s)){let d=mn({},s,t(s),{id:u});return r[u]=d,d}else{let d=mn({},s,t(s),{id:u,children:void 0});return r[u]=d,s.children&&(d.children=Au(s.children,t,l,r)),d}})}function oi(e,t,n){return n===void 0&&(n="/"),cp(e,t,n,!1)}function cp(e,t,n,r){let s=typeof t=="string"?_a(t):t,o=Xl(s.pathname||"/",n);if(o==null)return null;let l=aj(e);$F(l);let u=null;for(let d=0;u==null&&d{let d={relativePath:u===void 0?o.path||"":u,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};d.relativePath.startsWith("/")&&(Ct(d.relativePath.startsWith(r),'Absolute route path "'+d.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),d.relativePath=d.relativePath.slice(r.length));let f=To([r,d.relativePath]),h=n.concat(d);o.children&&o.children.length>0&&(Ct(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),aj(o.children,t,h,f)),!(o.path==null&&!o.index)&&t.push({path:f,score:KF(f,o.index),routesMeta:h})};return e.forEach((o,l)=>{var u;if(o.path===""||!((u=o.path)!=null&&u.includes("?")))s(o,l);else for(let d of ij(o.path))s(o,l,d)}),t}function ij(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return s?[o,""]:[o];let l=ij(r.join("/")),u=[];return u.push(...l.map(d=>d===""?o:[o,d].join("/"))),s&&u.push(...l),u.map(d=>e.startsWith("/")&&d===""?"/":d)}function $F(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:WF(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const BF=/^:[\w-]+$/,zF=3,UF=2,VF=1,HF=10,qF=-2,nC=e=>e==="*";function KF(e,t){let n=e.split("/"),r=n.length;return n.some(nC)&&(r+=qF),t&&(r+=UF),n.filter(s=>!nC(s)).reduce((s,o)=>s+(BF.test(o)?zF:o===""?VF:HF),r)}function WF(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function GF(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,s={},o="/",l=[];for(let u=0;u{let{paramName:g,isOptional:x}=h;if(g==="*"){let w=u[m]||"";l=o.slice(0,o.length-w.length).replace(/(.)\/+$/,"$1")}const b=u[m];return x&&!b?f[g]=void 0:f[g]=(b||"").replace(/%2F/g,"/"),f},{}),pathname:o,pathnameBase:l,pattern:e}}function JF(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Ll(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,u,d)=>(r.push({paramName:u,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function QF(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ll(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Xl(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function ZF(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?_a(e):e;return{pathname:n?n.startsWith("/")?n:YF(n,t):t,search:e2(r),hash:t2(s)}}function YF(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function fv(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function lj(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function hh(e,t){let n=lj(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function gh(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=_a(e):(s=mn({},e),Ct(!s.pathname||!s.pathname.includes("?"),fv("?","pathname","search",s)),Ct(!s.pathname||!s.pathname.includes("#"),fv("#","pathname","hash",s)),Ct(!s.search||!s.search.includes("#"),fv("#","search","hash",s)));let o=e===""||s.pathname==="",l=o?"/":s.pathname,u;if(l==null)u=n;else{let m=t.length-1;if(!r&&l.startsWith("..")){let g=l.split("/");for(;g[0]==="..";)g.shift(),m-=1;s.pathname=g.join("/")}u=m>=0?t[m]:"/"}let d=ZF(s,u),f=l&&l!=="/"&&l.endsWith("/"),h=(o||l===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(f||h)&&(d.pathname+="/"),d}const To=e=>e.join("/").replace(/\/\/+/g,"/"),XF=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),e2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,t2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Ab{constructor(t,n,r,s){s===void 0&&(s=!1),this.status=t,this.statusText=n||"",this.internal=s,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function mh(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const cj=["post","put","patch","delete"],n2=new Set(cj),r2=["get",...cj],s2=new Set(r2),o2=new Set([301,302,303,307,308]),a2=new Set([307,308]),pv={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},i2={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},eu={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Db=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,l2=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),uj="remix-router-transitions";function c2(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;Ct(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let s;if(e.mapRouteProperties)s=e.mapRouteProperties;else if(e.detectErrorBoundary){let B=e.detectErrorBoundary;s=K=>({hasErrorBoundary:B(K)})}else s=l2;let o={},l=Au(e.routes,s,void 0,o),u,d=e.basename||"/",f=e.unstable_dataStrategy||h2,h=e.unstable_patchRoutesOnMiss,m=mn({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),g=null,x=new Set,b=null,w=null,C=null,k=e.hydrationData!=null,j=oi(l,e.history.location,d),M=null;if(j==null&&!h){let B=lr(404,{pathname:e.history.location.pathname}),{matches:K,route:oe}=pC(l);j=K,M={[oe.id]:B}}j&&h&&!e.hydrationData&&Ba(j,l,e.history.location.pathname).active&&(j=null);let _;if(!j)_=!1,j=[];else if(j.some(B=>B.route.lazy))_=!1;else if(!j.some(B=>B.route.loader))_=!0;else if(m.v7_partialHydration){let B=e.hydrationData?e.hydrationData.loaderData:null,K=e.hydrationData?e.hydrationData.errors:null,oe=ve=>ve.route.loader?typeof ve.route.loader=="function"&&ve.route.loader.hydrate===!0?!1:B&&B[ve.route.id]!==void 0||K&&K[ve.route.id]!==void 0:!0;if(K){let ve=j.findIndex(Oe=>K[Oe.route.id]!==void 0);_=j.slice(0,ve+1).every(oe)}else _=j.every(oe)}else _=e.hydrationData!=null;let R,N={historyAction:e.history.action,location:e.history.location,matches:j,initialized:_,navigation:pv,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||M,fetchers:new Map,blockers:new Map},O=_n.Pop,D=!1,z,Q=!1,pe=new Map,V=null,G=!1,W=!1,ie=[],re=[],Y=new Map,H=0,q=-1,he=new Map,A=new Set,F=new Map,fe=new Map,te=new Set,de=new Map,ge=new Map,Z=new Map,ye=!1;function Re(){if(g=e.history.listen(B=>{let{action:K,location:oe,delta:ve}=B;if(ye){ye=!1;return}Ll(ge.size===0||ve!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Oe=Gr({currentLocation:N.location,nextLocation:oe,historyAction:K});if(Oe&&ve!=null){ye=!0,e.history.go(ve*-1),vr(Oe,{state:"blocked",location:oe,proceed(){vr(Oe,{state:"proceeding",proceed:void 0,reset:void 0,location:oe}),e.history.go(ve)},reset(){let We=new Map(N.blockers);We.set(Oe,eu),Fe({blockers:We})}});return}return vn(K,oe)}),n){T2(t,pe);let B=()=>N2(t,pe);t.addEventListener("pagehide",B),V=()=>t.removeEventListener("pagehide",B)}return N.initialized||vn(_n.Pop,N.location,{initialHydration:!0}),R}function $e(){g&&g(),V&&V(),x.clear(),z&&z.abort(),N.fetchers.forEach((B,K)=>Qn(K)),N.blockers.forEach((B,K)=>mr(K))}function Ye(B){return x.add(B),()=>x.delete(B)}function Fe(B,K){K===void 0&&(K={}),N=mn({},N,B);let oe=[],ve=[];m.v7_fetcherPersist&&N.fetchers.forEach((Oe,We)=>{Oe.state==="idle"&&(te.has(We)?ve.push(We):oe.push(We))}),[...x].forEach(Oe=>Oe(N,{deletedFetchers:ve,unstable_viewTransitionOpts:K.viewTransitionOpts,unstable_flushSync:K.flushSync===!0})),m.v7_fetcherPersist&&(oe.forEach(Oe=>N.fetchers.delete(Oe)),ve.forEach(Oe=>Qn(Oe)))}function ft(B,K,oe){var ve,Oe;let{flushSync:We}=oe===void 0?{}:oe,st=N.actionData!=null&&N.navigation.formMethod!=null&&bs(N.navigation.formMethod)&&N.navigation.state==="loading"&&((ve=B.state)==null?void 0:ve._isRedirect)!==!0,Me;K.actionData?Object.keys(K.actionData).length>0?Me=K.actionData:Me=null:st?Me=N.actionData:Me=null;let ht=K.loaderData?dC(N.loaderData,K.loaderData,K.matches||[],K.errors):N.loaderData,Ge=N.blockers;Ge.size>0&&(Ge=new Map(Ge),Ge.forEach((Vt,Ht)=>Ge.set(Ht,eu)));let Xe=D===!0||N.navigation.formMethod!=null&&bs(N.navigation.formMethod)&&((Oe=B.state)==null?void 0:Oe._isRedirect)!==!0;u&&(l=u,u=void 0),G||O===_n.Pop||(O===_n.Push?e.history.push(B,B.state):O===_n.Replace&&e.history.replace(B,B.state));let Ut;if(O===_n.Pop){let Vt=pe.get(N.location.pathname);Vt&&Vt.has(B.pathname)?Ut={currentLocation:N.location,nextLocation:B}:pe.has(B.pathname)&&(Ut={currentLocation:B,nextLocation:N.location})}else if(Q){let Vt=pe.get(N.location.pathname);Vt?Vt.add(B.pathname):(Vt=new Set([B.pathname]),pe.set(N.location.pathname,Vt)),Ut={currentLocation:N.location,nextLocation:B}}Fe(mn({},K,{actionData:Me,loaderData:ht,historyAction:O,location:B,initialized:!0,navigation:pv,revalidation:"idle",restoreScrollPosition:yc(B,K.matches||N.matches),preventScrollReset:Xe,blockers:Ge}),{viewTransitionOpts:Ut,flushSync:We===!0}),O=_n.Pop,D=!1,Q=!1,G=!1,W=!1,ie=[],re=[]}async function ln(B,K){if(typeof B=="number"){e.history.go(B);return}let oe=Ny(N.location,N.matches,d,m.v7_prependBasename,B,m.v7_relativeSplatPath,K?.fromRouteId,K?.relative),{path:ve,submission:Oe,error:We}=sC(m.v7_normalizeFormMethod,!1,oe,K),st=N.location,Me=Iu(N.location,ve,K&&K.state);Me=mn({},Me,e.history.encodeLocation(Me));let ht=K&&K.replace!=null?K.replace:void 0,Ge=_n.Push;ht===!0?Ge=_n.Replace:ht===!1||Oe!=null&&bs(Oe.formMethod)&&Oe.formAction===N.location.pathname+N.location.search&&(Ge=_n.Replace);let Xe=K&&"preventScrollReset"in K?K.preventScrollReset===!0:void 0,Ut=(K&&K.unstable_flushSync)===!0,Vt=Gr({currentLocation:st,nextLocation:Me,historyAction:Ge});if(Vt){vr(Vt,{state:"blocked",location:Me,proceed(){vr(Vt,{state:"proceeding",proceed:void 0,reset:void 0,location:Me}),ln(B,K)},reset(){let Ht=new Map(N.blockers);Ht.set(Vt,eu),Fe({blockers:Ht})}});return}return await vn(Ge,Me,{submission:Oe,pendingError:We,preventScrollReset:Xe,replace:K&&K.replace,enableViewTransition:K&&K.unstable_viewTransition,flushSync:Ut})}function Sn(){if(yn(),Fe({revalidation:"loading"}),N.navigation.state!=="submitting"){if(N.navigation.state==="idle"){vn(N.historyAction,N.location,{startUninterruptedRevalidation:!0});return}vn(O||N.historyAction,N.navigation.location,{overrideNavigation:N.navigation})}}async function vn(B,K,oe){z&&z.abort(),z=null,O=B,G=(oe&&oe.startUninterruptedRevalidation)===!0,_d(N.location,N.matches),D=(oe&&oe.preventScrollReset)===!0,Q=(oe&&oe.enableViewTransition)===!0;let ve=u||l,Oe=oe&&oe.overrideNavigation,We=oi(ve,K,d),st=(oe&&oe.flushSync)===!0,Me=Ba(We,ve,K.pathname);if(Me.active&&Me.matches&&(We=Me.matches),!We){let{error:At,notFoundMatches:Nn,route:fn}=Jr(K.pathname);ft(K,{matches:Nn,loaderData:{},errors:{[fn.id]:At}},{flushSync:st});return}if(N.initialized&&!W&&x2(N.location,K)&&!(oe&&oe.submission&&bs(oe.submission.formMethod))){ft(K,{matches:We},{flushSync:st});return}z=new AbortController;let ht=fl(e.history,K,z.signal,oe&&oe.submission),Ge;if(oe&&oe.pendingError)Ge=[jl(We).route.id,{type:Zt.error,error:oe.pendingError}];else if(oe&&oe.submission&&bs(oe.submission.formMethod)){let At=await Cn(ht,K,oe.submission,We,Me.active,{replace:oe.replace,flushSync:st});if(At.shortCircuited)return;if(At.pendingActionResult){let[Nn,fn]=At.pendingActionResult;if(Br(fn)&&mh(fn.error)&&fn.error.status===404){z=null,ft(K,{matches:At.matches,loaderData:{},errors:{[Nn]:fn.error}});return}}We=At.matches||We,Ge=At.pendingActionResult,Oe=hv(K,oe.submission),st=!1,Me.active=!1,ht=fl(e.history,ht.url,ht.signal)}let{shortCircuited:Xe,matches:Ut,loaderData:Vt,errors:Ht}=await L(ht,K,We,Me.active,Oe,oe&&oe.submission,oe&&oe.fetcherSubmission,oe&&oe.replace,oe&&oe.initialHydration===!0,st,Ge);Xe||(z=null,ft(K,mn({matches:Ut||We},fC(Ge),{loaderData:Vt,errors:Ht})))}async function Cn(B,K,oe,ve,Oe,We){We===void 0&&(We={}),yn();let st=k2(K,oe);if(Fe({navigation:st},{flushSync:We.flushSync===!0}),Oe){let Ge=await za(ve,K.pathname,B.signal);if(Ge.type==="aborted")return{shortCircuited:!0};if(Ge.type==="error"){let{boundaryId:Xe,error:Ut}=_r(K.pathname,Ge);return{matches:Ge.partialMatches,pendingActionResult:[Xe,{type:Zt.error,error:Ut}]}}else if(Ge.matches)ve=Ge.matches;else{let{notFoundMatches:Xe,error:Ut,route:Vt}=Jr(K.pathname);return{matches:Xe,pendingActionResult:[Vt.id,{type:Zt.error,error:Ut}]}}}let Me,ht=gu(ve,K);if(!ht.route.action&&!ht.route.lazy)Me={type:Zt.error,error:lr(405,{method:B.method,pathname:K.pathname,routeId:ht.route.id})};else if(Me=(await bt("action",B,[ht],ve))[0],B.signal.aborted)return{shortCircuited:!0};if(ii(Me)){let Ge;return We&&We.replace!=null?Ge=We.replace:Ge=lC(Me.response.headers.get("Location"),new URL(B.url),d)===N.location.pathname+N.location.search,await Be(B,Me,{submission:oe,replace:Ge}),{shortCircuited:!0}}if(ai(Me))throw lr(400,{type:"defer-action"});if(Br(Me)){let Ge=jl(ve,ht.route.id);return(We&&We.replace)!==!0&&(O=_n.Push),{matches:ve,pendingActionResult:[Ge.route.id,Me]}}return{matches:ve,pendingActionResult:[ht.route.id,Me]}}async function L(B,K,oe,ve,Oe,We,st,Me,ht,Ge,Xe){let Ut=Oe||hv(K,We),Vt=We||st||mC(Ut),Ht=!G&&(!m.v7_partialHydration||!ht);if(ve){if(Ht){let Dt=X(Xe);Fe(mn({navigation:Ut},Dt!==void 0?{actionData:Dt}:{}),{flushSync:Ge})}let pt=await za(oe,K.pathname,B.signal);if(pt.type==="aborted")return{shortCircuited:!0};if(pt.type==="error"){let{boundaryId:Dt,error:or}=_r(K.pathname,pt);return{matches:pt.partialMatches,loaderData:{},errors:{[Dt]:or}}}else if(pt.matches)oe=pt.matches;else{let{error:Dt,notFoundMatches:or,route:Tt}=Jr(K.pathname);return{matches:or,loaderData:{},errors:{[Tt.id]:Dt}}}}let At=u||l,[Nn,fn]=oC(e.history,N,oe,Vt,K,m.v7_partialHydration&&ht===!0,m.v7_skipActionErrorRevalidation,W,ie,re,te,F,A,At,d,Xe);if(Rr(pt=>!(oe&&oe.some(Dt=>Dt.route.id===pt))||Nn&&Nn.some(Dt=>Dt.route.id===pt)),q=++H,Nn.length===0&&fn.length===0){let pt=ut();return ft(K,mn({matches:oe,loaderData:{},errors:Xe&&Br(Xe[1])?{[Xe[0]]:Xe[1].error}:null},fC(Xe),pt?{fetchers:new Map(N.fetchers)}:{}),{flushSync:Ge}),{shortCircuited:!0}}if(Ht){let pt={};if(!ve){pt.navigation=Ut;let Dt=X(Xe);Dt!==void 0&&(pt.actionData=Dt)}fn.length>0&&(pt.fetchers=ue(fn)),Fe(pt,{flushSync:Ge})}fn.forEach(pt=>{Y.has(pt.key)&&Bn(pt.key),pt.controller&&Y.set(pt.key,pt.controller)});let Va=()=>fn.forEach(pt=>Bn(pt.key));z&&z.signal.addEventListener("abort",Va);let{loaderResults:Os,fetcherResults:Gt}=await Wt(N.matches,oe,Nn,fn,B);if(B.signal.aborted)return{shortCircuited:!0};z&&z.signal.removeEventListener("abort",Va),fn.forEach(pt=>Y.delete(pt.key));let Vo=hC([...Os,...Gt]);if(Vo){if(Vo.idx>=Nn.length){let pt=fn[Vo.idx-Nn.length].key;A.add(pt)}return await Be(B,Vo.result,{replace:Me}),{shortCircuited:!0}}let{loaderData:Is,errors:Pr}=uC(N,oe,Nn,Os,Xe,fn,Gt,de);de.forEach((pt,Dt)=>{pt.subscribe(or=>{(or||pt.done)&&de.delete(Dt)})}),m.v7_partialHydration&&ht&&N.errors&&Object.entries(N.errors).filter(pt=>{let[Dt]=pt;return!Nn.some(or=>or.route.id===Dt)}).forEach(pt=>{let[Dt,or]=pt;Pr=Object.assign(Pr||{},{[Dt]:or})});let so=ut(),Vi=It(q),Ha=so||Vi||fn.length>0;return mn({matches:oe,loaderData:Is,errors:Pr},Ha?{fetchers:new Map(N.fetchers)}:{})}function X(B){if(B&&!Br(B[1]))return{[B[0]]:B[1].data};if(N.actionData)return Object.keys(N.actionData).length===0?null:N.actionData}function ue(B){return B.forEach(K=>{let oe=N.fetchers.get(K.key),ve=tu(void 0,oe?oe.data:void 0);N.fetchers.set(K.key,ve)}),new Map(N.fetchers)}function Ne(B,K,oe,ve){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Y.has(B)&&Bn(B);let Oe=(ve&&ve.unstable_flushSync)===!0,We=u||l,st=Ny(N.location,N.matches,d,m.v7_prependBasename,oe,m.v7_relativeSplatPath,K,ve?.relative),Me=oi(We,st,d),ht=Ba(Me,We,st);if(ht.active&&ht.matches&&(Me=ht.matches),!Me){En(B,K,lr(404,{pathname:st}),{flushSync:Oe});return}let{path:Ge,submission:Xe,error:Ut}=sC(m.v7_normalizeFormMethod,!0,st,ve);if(Ut){En(B,K,Ut,{flushSync:Oe});return}let Vt=gu(Me,Ge);if(D=(ve&&ve.preventScrollReset)===!0,Xe&&bs(Xe.formMethod)){je(B,K,Ge,Vt,Me,ht.active,Oe,Xe);return}F.set(B,{routeId:K,path:Ge}),Se(B,K,Ge,Vt,Me,ht.active,Oe,Xe)}async function je(B,K,oe,ve,Oe,We,st,Me){yn(),F.delete(B);function ht(Tt){if(!Tt.route.action&&!Tt.route.lazy){let fs=lr(405,{method:Me.formMethod,pathname:oe,routeId:K});return En(B,K,fs,{flushSync:st}),!0}return!1}if(!We&&ht(ve))return;let Ge=N.fetchers.get(B);bn(B,j2(Me,Ge),{flushSync:st});let Xe=new AbortController,Ut=fl(e.history,oe,Xe.signal,Me);if(We){let Tt=await za(Oe,oe,Ut.signal);if(Tt.type==="aborted")return;if(Tt.type==="error"){let{error:fs}=_r(oe,Tt);En(B,K,fs,{flushSync:st});return}else if(Tt.matches){if(Oe=Tt.matches,ve=gu(Oe,oe),ht(ve))return}else{En(B,K,lr(404,{pathname:oe}),{flushSync:st});return}}Y.set(B,Xe);let Vt=H,At=(await bt("action",Ut,[ve],Oe))[0];if(Ut.signal.aborted){Y.get(B)===Xe&&Y.delete(B);return}if(m.v7_fetcherPersist&&te.has(B)){if(ii(At)||Br(At)){bn(B,da(void 0));return}}else{if(ii(At))if(Y.delete(B),q>Vt){bn(B,da(void 0));return}else return A.add(B),bn(B,tu(Me)),Be(Ut,At,{fetcherSubmission:Me});if(Br(At)){En(B,K,At.error);return}}if(ai(At))throw lr(400,{type:"defer-action"});let Nn=N.navigation.location||N.location,fn=fl(e.history,Nn,Xe.signal),Va=u||l,Os=N.navigation.state!=="idle"?oi(Va,N.navigation.location,d):N.matches;Ct(Os,"Didn't find any matches after fetcher action");let Gt=++H;he.set(B,Gt);let Vo=tu(Me,At.data);N.fetchers.set(B,Vo);let[Is,Pr]=oC(e.history,N,Os,Me,Nn,!1,m.v7_skipActionErrorRevalidation,W,ie,re,te,F,A,Va,d,[ve.route.id,At]);Pr.filter(Tt=>Tt.key!==B).forEach(Tt=>{let fs=Tt.key,Rd=N.fetchers.get(fs),jg=tu(void 0,Rd?Rd.data:void 0);N.fetchers.set(fs,jg),Y.has(fs)&&Bn(fs),Tt.controller&&Y.set(fs,Tt.controller)}),Fe({fetchers:new Map(N.fetchers)});let so=()=>Pr.forEach(Tt=>Bn(Tt.key));Xe.signal.addEventListener("abort",so);let{loaderResults:Vi,fetcherResults:Ha}=await Wt(N.matches,Os,Is,Pr,fn);if(Xe.signal.aborted)return;Xe.signal.removeEventListener("abort",so),he.delete(B),Y.delete(B),Pr.forEach(Tt=>Y.delete(Tt.key));let pt=hC([...Vi,...Ha]);if(pt){if(pt.idx>=Is.length){let Tt=Pr[pt.idx-Is.length].key;A.add(Tt)}return Be(fn,pt.result)}let{loaderData:Dt,errors:or}=uC(N,N.matches,Is,Vi,void 0,Pr,Ha,de);if(N.fetchers.has(B)){let Tt=da(At.data);N.fetchers.set(B,Tt)}It(Gt),N.navigation.state==="loading"&&Gt>q?(Ct(O,"Expected pending action"),z&&z.abort(),ft(N.navigation.location,{matches:Os,loaderData:Dt,errors:or,fetchers:new Map(N.fetchers)})):(Fe({errors:or,loaderData:dC(N.loaderData,Dt,Os,or),fetchers:new Map(N.fetchers)}),W=!1)}async function Se(B,K,oe,ve,Oe,We,st,Me){let ht=N.fetchers.get(B);bn(B,tu(Me,ht?ht.data:void 0),{flushSync:st});let Ge=new AbortController,Xe=fl(e.history,oe,Ge.signal);if(We){let At=await za(Oe,oe,Xe.signal);if(At.type==="aborted")return;if(At.type==="error"){let{error:Nn}=_r(oe,At);En(B,K,Nn,{flushSync:st});return}else if(At.matches)Oe=At.matches,ve=gu(Oe,oe);else{En(B,K,lr(404,{pathname:oe}),{flushSync:st});return}}Y.set(B,Ge);let Ut=H,Ht=(await bt("loader",Xe,[ve],Oe))[0];if(ai(Ht)&&(Ht=await gj(Ht,Xe.signal,!0)||Ht),Y.get(B)===Ge&&Y.delete(B),!Xe.signal.aborted){if(te.has(B)){bn(B,da(void 0));return}if(ii(Ht))if(q>Ut){bn(B,da(void 0));return}else{A.add(B),await Be(Xe,Ht);return}if(Br(Ht)){En(B,K,Ht.error);return}Ct(!ai(Ht),"Unhandled fetcher deferred data"),bn(B,da(Ht.data))}}async function Be(B,K,oe){let{submission:ve,fetcherSubmission:Oe,replace:We}=oe===void 0?{}:oe;K.response.headers.has("X-Remix-Revalidate")&&(W=!0);let st=K.response.headers.get("Location");Ct(st,"Expected a Location header on the redirect Response"),st=lC(st,new URL(B.url),d);let Me=Iu(N.location,st,{_isRedirect:!0});if(n){let Ht=!1;if(K.response.headers.has("X-Remix-Reload-Document"))Ht=!0;else if(Db.test(st)){const At=e.history.createURL(st);Ht=At.origin!==t.location.origin||Xl(At.pathname,d)==null}if(Ht){We?t.location.replace(st):t.location.assign(st);return}}z=null;let ht=We===!0?_n.Replace:_n.Push,{formMethod:Ge,formAction:Xe,formEncType:Ut}=N.navigation;!ve&&!Oe&&Ge&&Xe&&Ut&&(ve=mC(N.navigation));let Vt=ve||Oe;if(a2.has(K.response.status)&&Vt&&bs(Vt.formMethod))await vn(ht,Me,{submission:mn({},Vt,{formAction:st}),preventScrollReset:D});else{let Ht=hv(Me,ve);await vn(ht,Me,{overrideNavigation:Ht,fetcherSubmission:Oe,preventScrollReset:D})}}async function bt(B,K,oe,ve){try{let Oe=await g2(f,B,K,oe,ve,o,s);return await Promise.all(Oe.map((We,st)=>{if(S2(We)){let Me=We.result;return{type:Zt.redirect,response:y2(Me,K,oe[st].route.id,ve,d,m.v7_relativeSplatPath)}}return v2(We)}))}catch(Oe){return oe.map(()=>({type:Zt.error,error:Oe}))}}async function Wt(B,K,oe,ve,Oe){let[We,...st]=await Promise.all([oe.length?bt("loader",Oe,oe,K):[],...ve.map(Me=>{if(Me.matches&&Me.match&&Me.controller){let ht=fl(e.history,Me.path,Me.controller.signal);return bt("loader",ht,[Me.match],Me.matches).then(Ge=>Ge[0])}else return Promise.resolve({type:Zt.error,error:lr(404,{pathname:Me.path})})})]);return await Promise.all([gC(B,oe,We,We.map(()=>Oe.signal),!1,N.loaderData),gC(B,ve.map(Me=>Me.match),st,ve.map(Me=>Me.controller?Me.controller.signal:null),!0)]),{loaderResults:We,fetcherResults:st}}function yn(){W=!0,ie.push(...Rr()),F.forEach((B,K)=>{Y.has(K)&&(re.push(K),Bn(K))})}function bn(B,K,oe){oe===void 0&&(oe={}),N.fetchers.set(B,K),Fe({fetchers:new Map(N.fetchers)},{flushSync:(oe&&oe.flushSync)===!0})}function En(B,K,oe,ve){ve===void 0&&(ve={});let Oe=jl(N.matches,K);Qn(B),Fe({errors:{[Oe.route.id]:oe},fetchers:new Map(N.fetchers)},{flushSync:(ve&&ve.flushSync)===!0})}function gr(B){return m.v7_fetcherPersist&&(fe.set(B,(fe.get(B)||0)+1),te.has(B)&&te.delete(B)),N.fetchers.get(B)||i2}function Qn(B){let K=N.fetchers.get(B);Y.has(B)&&!(K&&K.state==="loading"&&he.has(B))&&Bn(B),F.delete(B),he.delete(B),A.delete(B),te.delete(B),N.fetchers.delete(B)}function ro(B){if(m.v7_fetcherPersist){let K=(fe.get(B)||0)-1;K<=0?(fe.delete(B),te.add(B)):fe.set(B,K)}else Qn(B);Fe({fetchers:new Map(N.fetchers)})}function Bn(B){let K=Y.get(B);Ct(K,"Expected fetch controller: "+B),K.abort(),Y.delete(B)}function Te(B){for(let K of B){let oe=gr(K),ve=da(oe.data);N.fetchers.set(K,ve)}}function ut(){let B=[],K=!1;for(let oe of A){let ve=N.fetchers.get(oe);Ct(ve,"Expected fetcher: "+oe),ve.state==="loading"&&(A.delete(oe),B.push(oe),K=!0)}return Te(B),K}function It(B){let K=[];for(let[oe,ve]of he)if(ve0}function Tn(B,K){let oe=N.blockers.get(B)||eu;return ge.get(B)!==K&&ge.set(B,K),oe}function mr(B){N.blockers.delete(B),ge.delete(B)}function vr(B,K){let oe=N.blockers.get(B)||eu;Ct(oe.state==="unblocked"&&K.state==="blocked"||oe.state==="blocked"&&K.state==="blocked"||oe.state==="blocked"&&K.state==="proceeding"||oe.state==="blocked"&&K.state==="unblocked"||oe.state==="proceeding"&&K.state==="unblocked","Invalid blocker state transition: "+oe.state+" -> "+K.state);let ve=new Map(N.blockers);ve.set(B,K),Fe({blockers:ve})}function Gr(B){let{currentLocation:K,nextLocation:oe,historyAction:ve}=B;if(ge.size===0)return;ge.size>1&&Ll(!1,"A router only supports one blocker at a time");let Oe=Array.from(ge.entries()),[We,st]=Oe[Oe.length-1],Me=N.blockers.get(We);if(!(Me&&Me.state==="proceeding")&&st({currentLocation:K,nextLocation:oe,historyAction:ve}))return We}function Jr(B){let K=lr(404,{pathname:B}),oe=u||l,{matches:ve,route:Oe}=pC(oe);return Rr(),{notFoundMatches:ve,route:Oe,error:K}}function _r(B,K){return{boundaryId:jl(K.partialMatches).route.id,error:lr(400,{type:"route-discovery",pathname:B,message:K.error!=null&&"message"in K.error?K.error:String(K.error)})}}function Rr(B){let K=[];return de.forEach((oe,ve)=>{(!B||B(ve))&&(oe.cancel(),K.push(ve),de.delete(ve))}),K}function Uo(B,K,oe){if(b=B,C=K,w=oe||null,!k&&N.navigation===pv){k=!0;let ve=yc(N.location,N.matches);ve!=null&&Fe({restoreScrollPosition:ve})}return()=>{b=null,C=null,w=null}}function vc(B,K){return w&&w(B,K.map(ve=>LF(ve,N.loaderData)))||B.key}function _d(B,K){if(b&&C){let oe=vc(B,K);b[oe]=C()}}function yc(B,K){if(b){let oe=vc(B,K),ve=b[oe];if(typeof ve=="number")return ve}return null}function Ba(B,K,oe){if(h)if(B){let ve=B[B.length-1].route;if(ve.path&&(ve.path==="*"||ve.path.endsWith("/*")))return{active:!0,matches:cp(K,oe,d,!0)}}else return{active:!0,matches:cp(K,oe,d,!0)||[]};return{active:!1,matches:null}}async function za(B,K,oe){let ve=B,Oe=ve.length>0?ve[ve.length-1].route:null;for(;;){let We=u==null,st=u||l;try{await p2(h,K,ve,st,o,s,Z,oe)}catch(Xe){return{type:"error",error:Xe,partialMatches:ve}}finally{We&&(l=[...l])}if(oe.aborted)return{type:"aborted"};let Me=oi(st,K,d),ht=!1;if(Me){let Xe=Me[Me.length-1].route;if(Xe.index)return{type:"success",matches:Me};if(Xe.path&&Xe.path.length>0)if(Xe.path==="*")ht=!0;else return{type:"success",matches:Me}}let Ge=cp(st,K,d,!0);if(!Ge||ve.map(Xe=>Xe.route.id).join("-")===Ge.map(Xe=>Xe.route.id).join("-"))return{type:"success",matches:ht?Me:null};if(ve=Ge,Oe=ve[ve.length-1].route,Oe.path==="*")return{type:"success",matches:ve}}}function Ua(B){o={},u=Au(B,s,void 0,o)}function bc(B,K){let oe=u==null;fj(B,K,u||l,o,s),oe&&(l=[...l],Fe({}))}return R={get basename(){return d},get future(){return m},get state(){return N},get routes(){return l},get window(){return t},initialize:Re,subscribe:Ye,enableScrollRestoration:Uo,navigate:ln,fetch:Ne,revalidate:Sn,createHref:B=>e.history.createHref(B),encodeLocation:B=>e.history.encodeLocation(B),getFetcher:gr,deleteFetcher:ro,dispose:$e,getBlocker:Tn,deleteBlocker:mr,patchRoutes:bc,_internalFetchControllers:Y,_internalActiveDeferreds:de,_internalSetRoutes:Ua},R}function u2(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Ny(e,t,n,r,s,o,l,u){let d,f;if(l){d=[];for(let m of t)if(d.push(m),m.route.id===l){f=m;break}}else d=t,f=t[t.length-1];let h=gh(s||".",hh(d,o),Xl(e.pathname,n)||e.pathname,u==="path");return s==null&&(h.search=e.search,h.hash=e.hash),(s==null||s===""||s===".")&&f&&f.route.index&&!Fb(h.search)&&(h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(h.pathname=h.pathname==="/"?n:To([n,h.pathname])),wi(h)}function sC(e,t,n,r){if(!r||!u2(r))return{path:n};if(r.formMethod&&!E2(r.formMethod))return{path:n,error:lr(405,{method:r.formMethod})};let s=()=>({path:n,error:lr(400,{type:"invalid-body"})}),o=r.formMethod||"get",l=e?o.toUpperCase():o.toLowerCase(),u=pj(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!bs(l))return s();let g=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((x,b)=>{let[w,C]=b;return""+x+w+"="+C+` +`},""):String(r.body);return{path:n,submission:{formMethod:l,formAction:u,formEncType:r.formEncType,formData:void 0,json:void 0,text:g}}}else if(r.formEncType==="application/json"){if(!bs(l))return s();try{let g=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:l,formAction:u,formEncType:r.formEncType,formData:void 0,json:g,text:void 0}}}catch{return s()}}}Ct(typeof FormData=="function","FormData is not available in this environment");let d,f;if(r.formData)d=My(r.formData),f=r.formData;else if(r.body instanceof FormData)d=My(r.body),f=r.body;else if(r.body instanceof URLSearchParams)d=r.body,f=cC(d);else if(r.body==null)d=new URLSearchParams,f=new FormData;else try{d=new URLSearchParams(r.body),f=cC(d)}catch{return s()}let h={formMethod:l,formAction:u,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(bs(h.formMethod))return{path:n,submission:h};let m=_a(n);return t&&m.search&&Fb(m.search)&&d.append("index",""),m.search="?"+d,{path:wi(m),submission:h}}function d2(e,t){let n=e;if(t){let r=e.findIndex(s=>s.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function oC(e,t,n,r,s,o,l,u,d,f,h,m,g,x,b,w){let C=w?Br(w[1])?w[1].error:w[1].data:void 0,k=e.createURL(t.location),j=e.createURL(s),M=w&&Br(w[1])?w[0]:void 0,_=M?d2(n,M):n,R=w?w[1].statusCode:void 0,N=l&&R&&R>=400,O=_.filter((z,Q)=>{let{route:pe}=z;if(pe.lazy)return!0;if(pe.loader==null)return!1;if(o)return typeof pe.loader!="function"||pe.loader.hydrate?!0:t.loaderData[pe.id]===void 0&&(!t.errors||t.errors[pe.id]===void 0);if(f2(t.loaderData,t.matches[Q],z)||d.some(W=>W===z.route.id))return!0;let V=t.matches[Q],G=z;return aC(z,mn({currentUrl:k,currentParams:V.params,nextUrl:j,nextParams:G.params},r,{actionResult:C,actionStatus:R,defaultShouldRevalidate:N?!1:u||k.pathname+k.search===j.pathname+j.search||k.search!==j.search||dj(V,G)}))}),D=[];return m.forEach((z,Q)=>{if(o||!n.some(ie=>ie.route.id===z.routeId)||h.has(Q))return;let pe=oi(x,z.path,b);if(!pe){D.push({key:Q,routeId:z.routeId,path:z.path,matches:null,match:null,controller:null});return}let V=t.fetchers.get(Q),G=gu(pe,z.path),W=!1;g.has(Q)?W=!1:f.includes(Q)?W=!0:V&&V.state!=="idle"&&V.data===void 0?W=u:W=aC(G,mn({currentUrl:k,currentParams:t.matches[t.matches.length-1].params,nextUrl:j,nextParams:n[n.length-1].params},r,{actionResult:C,actionStatus:R,defaultShouldRevalidate:N?!1:u})),W&&D.push({key:Q,routeId:z.routeId,path:z.path,matches:pe,match:G,controller:new AbortController})}),[O,D]}function f2(e,t,n){let r=!t||n.route.id!==t.route.id,s=e[n.route.id]===void 0;return r||s}function dj(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function aC(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function p2(e,t,n,r,s,o,l,u){let d=[t,...n.map(f=>f.route.id)].join("-");try{let f=l.get(d);f||(f=e({path:t,matches:n,patch:(h,m)=>{u.aborted||fj(h,m,r,s,o)}}),l.set(d,f)),f&&w2(f)&&await f}finally{l.delete(d)}}function fj(e,t,n,r,s){if(e){var o;let l=r[e];Ct(l,"No route found to patch children into: routeId = "+e);let u=Au(t,s,[e,"patch",String(((o=l.children)==null?void 0:o.length)||"0")],r);l.children?l.children.push(...u):l.children=u}else{let l=Au(t,s,["patch",String(n.length||"0")],r);n.push(...l)}}async function iC(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let s=n[e.id];Ct(s,"No route found in manifest");let o={};for(let l in r){let d=s[l]!==void 0&&l!=="hasErrorBoundary";Ll(!d,'Route "'+s.id+'" has a static property "'+l+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+l+'" will be ignored.')),!d&&!DF.has(l)&&(o[l]=r[l])}Object.assign(s,o),Object.assign(s,mn({},t(s),{lazy:void 0}))}function h2(e){return Promise.all(e.matches.map(t=>t.resolve()))}async function g2(e,t,n,r,s,o,l,u){let d=r.reduce((m,g)=>m.add(g.route.id),new Set),f=new Set,h=await e({matches:s.map(m=>{let g=d.has(m.route.id);return mn({},m,{shouldLoad:g,resolve:b=>(f.add(m.route.id),g?m2(t,n,m,o,l,b,u):Promise.resolve({type:Zt.data,result:void 0}))})}),request:n,params:s[0].params,context:u});return s.forEach(m=>Ct(f.has(m.route.id),'`match.resolve()` was not called for route id "'+m.route.id+'". You must call `match.resolve()` on every match passed to `dataStrategy` to ensure all routes are properly loaded.')),h.filter((m,g)=>d.has(s[g].route.id))}async function m2(e,t,n,r,s,o,l){let u,d,f=h=>{let m,g=new Promise((w,C)=>m=C);d=()=>m(),t.signal.addEventListener("abort",d);let x=w=>typeof h!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):h({request:t,params:n.params,context:l},...w!==void 0?[w]:[]),b;return o?b=o(w=>x(w)):b=(async()=>{try{return{type:"data",result:await x()}}catch(w){return{type:"error",result:w}}})(),Promise.race([b,g])};try{let h=n.route[e];if(n.route.lazy)if(h){let m,[g]=await Promise.all([f(h).catch(x=>{m=x}),iC(n.route,s,r)]);if(m!==void 0)throw m;u=g}else if(await iC(n.route,s,r),h=n.route[e],h)u=await f(h);else if(e==="action"){let m=new URL(t.url),g=m.pathname+m.search;throw lr(405,{method:t.method,pathname:g,routeId:n.route.id})}else return{type:Zt.data,result:void 0};else if(h)u=await f(h);else{let m=new URL(t.url),g=m.pathname+m.search;throw lr(404,{pathname:g})}Ct(u.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(h){return{type:Zt.error,result:h}}finally{d&&t.signal.removeEventListener("abort",d)}return u}async function v2(e){let{result:t,type:n,status:r}=e;if(hj(t)){let l;try{let u=t.headers.get("Content-Type");u&&/\bapplication\/json\b/.test(u)?t.body==null?l=null:l=await t.json():l=await t.text()}catch(u){return{type:Zt.error,error:u}}return n===Zt.error?{type:Zt.error,error:new Ab(t.status,t.statusText,l),statusCode:t.status,headers:t.headers}:{type:Zt.data,data:l,statusCode:t.status,headers:t.headers}}if(n===Zt.error)return{type:Zt.error,error:t,statusCode:mh(t)?t.status:r};if(C2(t)){var s,o;return{type:Zt.deferred,deferredData:t,statusCode:(s=t.init)==null?void 0:s.status,headers:((o=t.init)==null?void 0:o.headers)&&new Headers(t.init.headers)}}return{type:Zt.data,data:t,statusCode:r}}function y2(e,t,n,r,s,o){let l=e.headers.get("Location");if(Ct(l,"Redirects returned/thrown from loaders/actions must have a Location header"),!Db.test(l)){let u=r.slice(0,r.findIndex(d=>d.route.id===n)+1);l=Ny(new URL(t.url),u,s,!0,l,o),e.headers.set("Location",l)}return e}function lC(e,t,n){if(Db.test(e)){let r=e,s=r.startsWith("//")?new URL(t.protocol+r):new URL(r),o=Xl(s.pathname,n)!=null;if(s.origin===t.origin&&o)return s.pathname+s.search+s.hash}return e}function fl(e,t,n,r){let s=e.createURL(pj(t)).toString(),o={signal:n};if(r&&bs(r.formMethod)){let{formMethod:l,formEncType:u}=r;o.method=l.toUpperCase(),u==="application/json"?(o.headers=new Headers({"Content-Type":u}),o.body=JSON.stringify(r.json)):u==="text/plain"?o.body=r.text:u==="application/x-www-form-urlencoded"&&r.formData?o.body=My(r.formData):o.body=r.formData}return new Request(s,o)}function My(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function cC(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function b2(e,t,n,r,s,o){let l={},u=null,d,f=!1,h={},m=r&&Br(r[1])?r[1].error:void 0;return n.forEach((g,x)=>{let b=t[x].route.id;if(Ct(!ii(g),"Cannot handle redirect results in processLoaderData"),Br(g)){let w=g.error;m!==void 0&&(w=m,m=void 0),u=u||{};{let C=jl(e,b);u[C.route.id]==null&&(u[C.route.id]=w)}l[b]=void 0,f||(f=!0,d=mh(g.error)?g.error.status:500),g.headers&&(h[b]=g.headers)}else ai(g)?(s.set(b,g.deferredData),l[b]=g.deferredData.data,g.statusCode!=null&&g.statusCode!==200&&!f&&(d=g.statusCode),g.headers&&(h[b]=g.headers)):(l[b]=g.data,g.statusCode&&g.statusCode!==200&&!f&&(d=g.statusCode),g.headers&&(h[b]=g.headers))}),m!==void 0&&r&&(u={[r[0]]:m},l[r[0]]=void 0),{loaderData:l,errors:u,statusCode:d||200,loaderHeaders:h}}function uC(e,t,n,r,s,o,l,u){let{loaderData:d,errors:f}=b2(t,n,r,s,u);for(let h=0;hr.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function pC(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function lr(e,t){let{pathname:n,routeId:r,method:s,type:o,message:l}=t===void 0?{}:t,u="Unknown Server Error",d="Unknown @remix-run/router error";return e===400?(u="Bad Request",o==="route-discovery"?d='Unable to match URL "'+n+'" - the `unstable_patchRoutesOnMiss()` '+(`function threw the following error: +`+l):s&&n&&r?d="You made a "+s+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":o==="defer-action"?d="defer() is not supported in actions":o==="invalid-body"&&(d="Unable to encode submission body")):e===403?(u="Forbidden",d='Route "'+r+'" does not match URL "'+n+'"'):e===404?(u="Not Found",d='No route matches URL "'+n+'"'):e===405&&(u="Method Not Allowed",s&&n&&r?d="You made a "+s.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":s&&(d='Invalid request method "'+s.toUpperCase()+'"')),new Ab(e||500,u,new Error(d),!0)}function hC(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(ii(n))return{result:n,idx:t}}}function pj(e){let t=typeof e=="string"?_a(e):e;return wi(mn({},t,{hash:""}))}function x2(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function w2(e){return typeof e=="object"&&e!=null&&"then"in e}function S2(e){return hj(e.result)&&o2.has(e.result.status)}function ai(e){return e.type===Zt.deferred}function Br(e){return e.type===Zt.error}function ii(e){return(e&&e.type)===Zt.redirect}function C2(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function hj(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function E2(e){return s2.has(e.toLowerCase())}function bs(e){return n2.has(e.toLowerCase())}async function gC(e,t,n,r,s,o){for(let l=0;lm.route.id===d.route.id),h=f!=null&&!dj(f,d)&&(o&&o[d.route.id])!==void 0;if(ai(u)&&(s||h)){let m=r[l];Ct(m,"Expected an AbortSignal for revalidating fetcher deferred result"),await gj(u,m,s).then(g=>{g&&(n[l]=g||n[l])})}}}async function gj(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:Zt.data,data:e.deferredData.unwrappedData}}catch(s){return{type:Zt.error,error:s}}return{type:Zt.data,data:e.deferredData.data}}}function Fb(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function gu(e,t){let n=typeof t=="string"?_a(t).search:t.search;if(e[e.length-1].route.index&&Fb(n||""))return e[e.length-1];let r=lj(e);return r[r.length-1]}function mC(e){let{formMethod:t,formAction:n,formEncType:r,text:s,formData:o,json:l}=e;if(!(!t||!n||!r)){if(s!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:s};if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(l!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:l,text:void 0}}}function hv(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function k2(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function tu(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function j2(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function da(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function T2(e,t){try{let n=e.sessionStorage.getItem(uj);if(n){let r=JSON.parse(n);for(let[s,o]of Object.entries(r||{}))o&&Array.isArray(o)&&t.set(s,new Set(o||[]))}}catch{}}function N2(e,t){if(t.size>0){let n={};for(let[r,s]of t)n[r]=[...s];try{e.sessionStorage.setItem(uj,JSON.stringify(n))}catch(r){Ll(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/** + * React Router v6.25.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Rp(){return Rp=Object.assign?Object.assign.bind():function(e){for(var t=1;t{u.current=!0}),y.useCallback(function(f,h){if(h===void 0&&(h={}),!u.current)return;if(typeof f=="number"){r.go(f);return}let m=gh(f,JSON.parse(l),o,h.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:To([t,m.pathname])),(h.replace?r.replace:r.push)(m,h.state,h)},[t,r,l,o,e])}function ls(){let{matches:e}=y.useContext(Po),t=e[e.length-1];return t?t.params:{}}function bj(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=y.useContext(Ra),{matches:s}=y.useContext(Po),{pathname:o}=Pi(),l=JSON.stringify(hh(s,r.v7_relativeSplatPath));return y.useMemo(()=>gh(e,JSON.parse(l),o,n==="path"),[e,l,o,n])}function R2(e,t,n,r){ec()||Ct(!1);let{navigator:s}=y.useContext(Ra),{matches:o}=y.useContext(Po),l=o[o.length-1],u=l?l.params:{};l&&l.pathname;let d=l?l.pathnameBase:"/";l&&l.route;let f=Pi(),h;h=f;let m=h.pathname||"/",g=m;if(d!=="/"){let w=d.replace(/^\//,"").split("/");g="/"+m.replace(/^\//,"").split("/").slice(w.length).join("/")}let x=oi(e,{pathname:g});return D2(x&&x.map(w=>Object.assign({},w,{params:Object.assign({},u,w.params),pathname:To([d,s.encodeLocation?s.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?d:To([d,s.encodeLocation?s.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),o,n,r)}function P2(){let e=B2(),t=mh(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),n?y.createElement("pre",{style:s},n):null,null)}const O2=y.createElement(P2,null);class I2 extends y.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?y.createElement(Po.Provider,{value:this.props.routeContext},y.createElement(vj.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function A2(e){let{routeContext:t,match:n,children:r}=e,s=y.useContext(vh);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),y.createElement(Po.Provider,{value:t},r)}function D2(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if((o=n)!=null&&o.errors)e=n.matches;else return null}let l=e,u=(s=n)==null?void 0:s.errors;if(u!=null){let h=l.findIndex(m=>m.route.id&&u?.[m.route.id]!==void 0);h>=0||Ct(!1),l=l.slice(0,Math.min(l.length,h+1))}let d=!1,f=-1;if(n&&r&&r.v7_partialHydration)for(let h=0;h=0?l=l.slice(0,f+1):l=[l[0]];break}}}return l.reduceRight((h,m,g)=>{let x,b=!1,w=null,C=null;n&&(x=u&&m.route.id?u[m.route.id]:void 0,w=m.route.errorElement||O2,d&&(f<0&&g===0?(U2("route-fallback"),b=!0,C=null):f===g&&(b=!0,C=m.route.hydrateFallbackElement||null)));let k=t.concat(l.slice(0,g+1)),j=()=>{let M;return x?M=w:b?M=C:m.route.Component?M=y.createElement(m.route.Component,null):m.route.element?M=m.route.element:M=h,y.createElement(A2,{match:m,routeContext:{outlet:h,matches:k,isDataRoute:n!=null},children:M})};return n&&(m.route.ErrorBoundary||m.route.errorElement||g===0)?y.createElement(I2,{location:n.location,revalidation:n.revalidation,component:w,error:x,children:j(),routeContext:{outlet:null,matches:k,isDataRoute:!0}}):j()},null)}var xj=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(xj||{}),wj=(function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e})(wj||{});function F2(e){let t=y.useContext(vh);return t||Ct(!1),t}function L2(e){let t=y.useContext(mj);return t||Ct(!1),t}function $2(e){let t=y.useContext(Po);return t||Ct(!1),t}function Sj(e){let t=$2(),n=t.matches[t.matches.length-1];return n.route.id||Ct(!1),n.route.id}function B2(){var e;let t=y.useContext(vj),n=L2(wj.UseRouteError),r=Sj();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function z2(){let{router:e}=F2(xj.UseNavigateStable),t=Sj(),n=y.useRef(!1);return yj(()=>{n.current=!0}),y.useCallback(function(s,o){o===void 0&&(o={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,Rp({fromRouteId:t},o)))},[e,t])}const vC={};function U2(e,t,n){vC[e]||(vC[e]=!0)}function Cj(e){let{to:t,replace:n,state:r,relative:s}=e;ec()||Ct(!1);let{future:o,static:l}=y.useContext(Ra),{matches:u}=y.useContext(Po),{pathname:d}=Pi(),f=dn(),h=gh(t,hh(u,o.v7_relativeSplatPath),d,s==="path"),m=JSON.stringify(h);return y.useEffect(()=>f(JSON.parse(m),{replace:n,state:r,relative:s}),[f,m,s,n,r]),null}function V2(e){let{basename:t="/",children:n=null,location:r,navigationType:s=_n.Pop,navigator:o,static:l=!1,future:u}=e;ec()&&Ct(!1);let d=t.replace(/^\/*/,"/"),f=y.useMemo(()=>({basename:d,navigator:o,static:l,future:Rp({v7_relativeSplatPath:!1},u)}),[d,u,o,l]);typeof r=="string"&&(r=_a(r));let{pathname:h="/",search:m="",hash:g="",state:x=null,key:b="default"}=r,w=y.useMemo(()=>{let C=Xl(h,d);return C==null?null:{location:{pathname:C,search:m,hash:g,state:x,key:b},navigationType:s}},[d,h,m,g,x,b,s]);return w==null?null:y.createElement(Ra.Provider,{value:f},y.createElement(Lb.Provider,{children:n,value:w}))}new Promise(()=>{});function H2(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:y.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:y.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:y.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** + * React Router DOM v6.25.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Du(){return Du=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function K2(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function W2(e,t){return e.button===0&&(!t||t==="_self")&&!K2(e)}function _y(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function G2(e,t){let n=_y(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(o=>{n.append(s,o)})}),n}const J2=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],Q2="6";try{window.__reactRouterVersion=Q2}catch{}function Z2(e,t){return c2({basename:void 0,future:Du({},void 0,{v7_prependBasename:!0}),history:OF({window:void 0}),hydrationData:Y2(),routes:e,mapRouteProperties:H2,unstable_dataStrategy:void 0,unstable_patchRoutesOnMiss:void 0,window:void 0}).initialize()}function Y2(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Du({},t,{errors:X2(t.errors)})),t}function X2(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,s]of t)if(s&&s.__type==="RouteErrorResponse")n[r]=new Ab(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let o=window[s.__subType];if(typeof o=="function")try{let l=new o(s.message);l.stack="",n[r]=l}catch{}}if(n[r]==null){let o=new Error(s.message);o.stack="",n[r]=o}}else n[r]=s;return n}const eL=y.createContext({isTransitioning:!1}),tL=y.createContext(new Map),nL="startTransition",yC=Yl[nL],rL="flushSync",bC=PF[rL];function sL(e){yC?yC(e):e()}function nu(e){bC?bC(e):e()}class oL{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function aL(e){let{fallbackElement:t,router:n,future:r}=e,[s,o]=y.useState(n.state),[l,u]=y.useState(),[d,f]=y.useState({isTransitioning:!1}),[h,m]=y.useState(),[g,x]=y.useState(),[b,w]=y.useState(),C=y.useRef(new Map),{v7_startTransition:k}=r||{},j=y.useCallback(D=>{k?sL(D):D()},[k]),M=y.useCallback((D,z)=>{let{deletedFetchers:Q,unstable_flushSync:pe,unstable_viewTransitionOpts:V}=z;Q.forEach(W=>C.current.delete(W)),D.fetchers.forEach((W,ie)=>{W.data!==void 0&&C.current.set(ie,W.data)});let G=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!V||G){pe?nu(()=>o(D)):j(()=>o(D));return}if(pe){nu(()=>{g&&(h&&h.resolve(),g.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:V.currentLocation,nextLocation:V.nextLocation})});let W=n.window.document.startViewTransition(()=>{nu(()=>o(D))});W.finished.finally(()=>{nu(()=>{m(void 0),x(void 0),u(void 0),f({isTransitioning:!1})})}),nu(()=>x(W));return}g?(h&&h.resolve(),g.skipTransition(),w({state:D,currentLocation:V.currentLocation,nextLocation:V.nextLocation})):(u(D),f({isTransitioning:!0,flushSync:!1,currentLocation:V.currentLocation,nextLocation:V.nextLocation}))},[n.window,g,h,C,j]);y.useLayoutEffect(()=>n.subscribe(M),[n,M]),y.useEffect(()=>{d.isTransitioning&&!d.flushSync&&m(new oL)},[d]),y.useEffect(()=>{if(h&&l&&n.window){let D=l,z=h.promise,Q=n.window.document.startViewTransition(async()=>{j(()=>o(D)),await z});Q.finished.finally(()=>{m(void 0),x(void 0),u(void 0),f({isTransitioning:!1})}),x(Q)}},[j,l,h,n.window]),y.useEffect(()=>{h&&l&&s.location.key===l.location.key&&h.resolve()},[h,g,s.location,l]),y.useEffect(()=>{!d.isTransitioning&&b&&(u(b.state),f({isTransitioning:!0,flushSync:!1,currentLocation:b.currentLocation,nextLocation:b.nextLocation}),w(void 0))},[d.isTransitioning,b]),y.useEffect(()=>{},[]);let _=y.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:D=>n.navigate(D),push:(D,z,Q)=>n.navigate(D,{state:z,preventScrollReset:Q?.preventScrollReset}),replace:(D,z,Q)=>n.navigate(D,{replace:!0,state:z,preventScrollReset:Q?.preventScrollReset})}),[n]),R=n.basename||"/",N=y.useMemo(()=>({router:n,navigator:_,static:!1,basename:R}),[n,_,R]),O=y.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return y.createElement(y.Fragment,null,y.createElement(vh.Provider,{value:N},y.createElement(mj.Provider,{value:s},y.createElement(tL.Provider,{value:C.current},y.createElement(eL.Provider,{value:d},y.createElement(V2,{basename:R,location:s.location,navigationType:s.historyAction,navigator:_,future:O},s.initialized||n.future.v7_partialHydration?y.createElement(iL,{routes:n.routes,future:n.future,state:s}):t))))),null)}const iL=y.memo(lL);function lL(e){let{routes:t,future:n,state:r}=e;return R2(t,void 0,r,n)}const cL=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",uL=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Fu=y.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:o,replace:l,state:u,target:d,to:f,preventScrollReset:h,unstable_viewTransition:m}=t,g=q2(t,J2),{basename:x}=y.useContext(Ra),b,w=!1;if(typeof f=="string"&&uL.test(f)&&(b=f,cL))try{let M=new URL(window.location.href),_=f.startsWith("//")?new URL(M.protocol+f):new URL(f),R=Xl(_.pathname,x);_.origin===M.origin&&R!=null?f=R+_.search+_.hash:w=!0}catch{}let C=M2(f,{relative:s}),k=dL(f,{replace:l,state:u,target:d,preventScrollReset:h,relative:s,unstable_viewTransition:m});function j(M){r&&r(M),M.defaultPrevented||k(M)}return y.createElement("a",Du({},g,{href:b||C,onClick:w||o?r:j,ref:n,target:d}))});var xC;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(xC||(xC={}));var wC;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(wC||(wC={}));function dL(e,t){let{target:n,replace:r,state:s,preventScrollReset:o,relative:l,unstable_viewTransition:u}=t===void 0?{}:t,d=dn(),f=Pi(),h=bj(e,{relative:l});return y.useCallback(m=>{if(W2(m,n)){m.preventDefault();let g=r!==void 0?r:wi(f)===wi(h);d(e,{replace:g,state:s,preventScrollReset:o,relative:l,unstable_viewTransition:u})}},[f,d,h,r,s,n,e,o,l,u])}function hd(e){let t=y.useRef(_y(e)),n=y.useRef(!1),r=Pi(),s=y.useMemo(()=>G2(r.search,n.current?null:t.current),[r.search]),o=dn(),l=y.useCallback((u,d)=>{const f=_y(typeof u=="function"?u(s):u);n.current=!0,o("?"+f,d)},[o,s]);return[s,l]}function Ej(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;ttypeof e=="number"&&!isNaN(e),pi=e=>typeof e=="string",Ur=e=>typeof e=="function",up=e=>pi(e)||Ur(e)?e:null,Ry=e=>y.isValidElement(e)||pi(e)||Ur(e)||Lu(e);function fL(e,t,n){n===void 0&&(n=300);const{scrollHeight:r,style:s}=e;requestAnimationFrame(()=>{s.minHeight="initial",s.height=r+"px",s.transition=`all ${n}ms`,requestAnimationFrame(()=>{s.height="0",s.padding="0",s.margin="0",setTimeout(t,n)})})}function yh(e){let{enter:t,exit:n,appendPosition:r=!1,collapse:s=!0,collapseDuration:o=300}=e;return function(l){let{children:u,position:d,preventExitTransition:f,done:h,nodeRef:m,isIn:g,playToast:x}=l;const b=r?`${t}--${d}`:t,w=r?`${n}--${d}`:n,C=y.useRef(0);return y.useLayoutEffect(()=>{const k=m.current,j=b.split(" "),M=_=>{_.target===m.current&&(x(),k.removeEventListener("animationend",M),k.removeEventListener("animationcancel",M),C.current===0&&_.type!=="animationcancel"&&k.classList.remove(...j))};k.classList.add(...j),k.addEventListener("animationend",M),k.addEventListener("animationcancel",M)},[]),y.useEffect(()=>{const k=m.current,j=()=>{k.removeEventListener("animationend",j),s?fL(k,h,o):h()};g||(f?j():(C.current=1,k.className+=` ${w}`,k.addEventListener("animationend",j)))},[g]),qe.createElement(qe.Fragment,null,u)}}function SC(e,t){return e!=null?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const ur=new Map;let $u=[];const Py=new Set,pL=e=>Py.forEach(t=>t(e)),kj=()=>ur.size>0;function jj(e,t){var n;if(t)return!((n=ur.get(t))==null||!n.isToastActive(e));let r=!1;return ur.forEach(s=>{s.isToastActive(e)&&(r=!0)}),r}function Tj(e,t){Ry(e)&&(kj()||$u.push({content:e,options:t}),ur.forEach(n=>{n.buildToast(e,t)}))}function CC(e,t){ur.forEach(n=>{t!=null&&t!=null&&t.containerId?t?.containerId===n.id&&n.toggle(e,t?.id):n.toggle(e,t?.id)})}function hL(e){const{subscribe:t,getSnapshot:n,setProps:r}=y.useRef((function(o){const l=o.containerId||1;return{subscribe(u){const d=(function(h,m,g){let x=1,b=0,w=[],C=[],k=[],j=m;const M=new Map,_=new Set,R=()=>{k=Array.from(M.values()),_.forEach(D=>D())},N=D=>{C=D==null?[]:C.filter(z=>z!==D),R()},O=D=>{const{toastId:z,onOpen:Q,updateId:pe,children:V}=D.props,G=pe==null;D.staleId&&M.delete(D.staleId),M.set(z,D),C=[...C,D.props.toastId].filter(W=>W!==D.staleId),R(),g(SC(D,G?"added":"updated")),G&&Ur(Q)&&Q(y.isValidElement(V)&&V.props)};return{id:h,props:j,observe:D=>(_.add(D),()=>_.delete(D)),toggle:(D,z)=>{M.forEach(Q=>{z!=null&&z!==Q.props.toastId||Ur(Q.toggle)&&Q.toggle(D)})},removeToast:N,toasts:M,clearQueue:()=>{b-=w.length,w=[]},buildToast:(D,z)=>{if((F=>{let{containerId:fe,toastId:te,updateId:de}=F;const ge=fe?fe!==h:h!==1,Z=M.has(te)&&de==null;return ge||Z})(z))return;const{toastId:Q,updateId:pe,data:V,staleId:G,delay:W}=z,ie=()=>{N(Q)},re=pe==null;re&&b++;const Y={...j,style:j.toastStyle,key:x++,...Object.fromEntries(Object.entries(z).filter(F=>{let[fe,te]=F;return te!=null})),toastId:Q,updateId:pe,data:V,closeToast:ie,isIn:!1,className:up(z.className||j.toastClassName),bodyClassName:up(z.bodyClassName||j.bodyClassName),progressClassName:up(z.progressClassName||j.progressClassName),autoClose:!z.isLoading&&(H=z.autoClose,q=j.autoClose,H===!1||Lu(H)&&H>0?H:q),deleteToast(){const F=M.get(Q),{onClose:fe,children:te}=F.props;Ur(fe)&&fe(y.isValidElement(te)&&te.props),g(SC(F,"removed")),M.delete(Q),b--,b<0&&(b=0),w.length>0?O(w.shift()):R()}};var H,q;Y.closeButton=j.closeButton,z.closeButton===!1||Ry(z.closeButton)?Y.closeButton=z.closeButton:z.closeButton===!0&&(Y.closeButton=!Ry(j.closeButton)||j.closeButton);let he=D;y.isValidElement(D)&&!pi(D.type)?he=y.cloneElement(D,{closeToast:ie,toastProps:Y,data:V}):Ur(D)&&(he=D({closeToast:ie,toastProps:Y,data:V}));const A={content:he,props:Y,staleId:G};j.limit&&j.limit>0&&b>j.limit&&re?w.push(A):Lu(W)?setTimeout(()=>{O(A)},W):O(A)},setProps(D){j=D},setToggle:(D,z)=>{M.get(D).toggle=z},isToastActive:D=>C.some(z=>z===D),getSnapshot:()=>j.newestOnTop?k.reverse():k}})(l,o,pL);ur.set(l,d);const f=d.observe(u);return $u.forEach(h=>Tj(h.content,h.options)),$u=[],()=>{f(),ur.delete(l)}},setProps(u){var d;(d=ur.get(l))==null||d.setProps(u)},getSnapshot(){var u;return(u=ur.get(l))==null?void 0:u.getSnapshot()}}})(e)).current;r(e);const s=y.useSyncExternalStore(t,n,n);return{getToastToRender:function(o){if(!s)return[];const l=new Map;return s.forEach(u=>{const{position:d}=u.props;l.has(d)||l.set(d,[]),l.get(d).push(u)}),Array.from(l,u=>o(u[0],u[1]))},isToastActive:jj,count:s?.length}}function gL(e){const[t,n]=y.useState(!1),[r,s]=y.useState(!1),o=y.useRef(null),l=y.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:u,pauseOnHover:d,closeToast:f,onClick:h,closeOnClick:m}=e;var g,x;function b(){n(!0)}function w(){n(!1)}function C(M){const _=o.current;l.canDrag&&_&&(l.didMove=!0,t&&w(),l.delta=e.draggableDirection==="x"?M.clientX-l.start:M.clientY-l.start,l.start!==M.clientX&&(l.canCloseOnClick=!1),_.style.transform=`translate3d(${e.draggableDirection==="x"?`${l.delta}px, var(--y)`:`0, calc(${l.delta}px + var(--y))`},0)`,_.style.opacity=""+(1-Math.abs(l.delta/l.removalDistance)))}function k(){document.removeEventListener("pointermove",C),document.removeEventListener("pointerup",k);const M=o.current;if(l.canDrag&&l.didMove&&M){if(l.canDrag=!1,Math.abs(l.delta)>l.removalDistance)return s(!0),e.closeToast(),void e.collapseAll();M.style.transition="transform 0.2s, opacity 0.2s",M.style.removeProperty("transform"),M.style.removeProperty("opacity")}}(x=ur.get((g={id:e.toastId,containerId:e.containerId,fn:n}).containerId||1))==null||x.setToggle(g.id,g.fn),y.useEffect(()=>{if(e.pauseOnFocusLoss)return document.hasFocus()||w(),window.addEventListener("focus",b),window.addEventListener("blur",w),()=>{window.removeEventListener("focus",b),window.removeEventListener("blur",w)}},[e.pauseOnFocusLoss]);const j={onPointerDown:function(M){if(e.draggable===!0||e.draggable===M.pointerType){l.didMove=!1,document.addEventListener("pointermove",C),document.addEventListener("pointerup",k);const _=o.current;l.canCloseOnClick=!0,l.canDrag=!0,_.style.transition="none",e.draggableDirection==="x"?(l.start=M.clientX,l.removalDistance=_.offsetWidth*(e.draggablePercent/100)):(l.start=M.clientY,l.removalDistance=_.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent)/100)}},onPointerUp:function(M){const{top:_,bottom:R,left:N,right:O}=o.current.getBoundingClientRect();M.nativeEvent.type!=="touchend"&&e.pauseOnHover&&M.clientX>=N&&M.clientX<=O&&M.clientY>=_&&M.clientY<=R?w():b()}};return u&&d&&(j.onMouseEnter=w,e.stacked||(j.onMouseLeave=b)),m&&(j.onClick=M=>{h&&h(M),l.canCloseOnClick&&f()}),{playToast:b,pauseToast:w,isRunning:t,preventExitTransition:r,toastRef:o,eventHandlers:j}}function mL(e){let{delay:t,isRunning:n,closeToast:r,type:s="default",hide:o,className:l,style:u,controlledProgress:d,progress:f,rtl:h,isIn:m,theme:g}=e;const x=o||d&&f===0,b={...u,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused"};d&&(b.transform=`scaleX(${f})`);const w=wo("Toastify__progress-bar",d?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${g}`,`Toastify__progress-bar--${s}`,{"Toastify__progress-bar--rtl":h}),C=Ur(l)?l({rtl:h,type:s,defaultClassName:w}):wo(w,l),k={[d&&f>=1?"onTransitionEnd":"onAnimationEnd"]:d&&f<1?null:()=>{m&&r()}};return qe.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":x},qe.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${g} Toastify__progress-bar--${s}`}),qe.createElement("div",{role:"progressbar","aria-hidden":x?"true":"false","aria-label":"notification timer",className:C,style:b,...k}))}let vL=1;const Nj=()=>""+vL++;function yL(e){return e&&(pi(e.toastId)||Lu(e.toastId))?e.toastId:Nj()}function ku(e,t){return Tj(e,t),t.toastId}function Pp(e,t){return{...t,type:t&&t.type||e,toastId:yL(t)}}function Lf(e){return(t,n)=>ku(t,Pp(e,n))}function me(e,t){return ku(e,Pp("default",t))}me.loading=(e,t)=>ku(e,Pp("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),me.promise=function(e,t,n){let r,{pending:s,error:o,success:l}=t;s&&(r=pi(s)?me.loading(s,n):me.loading(s.render,{...n,...s}));const u={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},d=(h,m,g)=>{if(m==null)return void me.dismiss(r);const x={type:h,...u,...n,data:g},b=pi(m)?{render:m}:m;return r?me.update(r,{...x,...b}):me(b.render,{...x,...b}),g},f=Ur(e)?e():e;return f.then(h=>d("success",l,h)).catch(h=>d("error",o,h)),f},me.success=Lf("success"),me.info=Lf("info"),me.error=Lf("error"),me.warning=Lf("warning"),me.warn=me.warning,me.dark=(e,t)=>ku(e,Pp("default",{theme:"dark",...t})),me.dismiss=function(e){(function(t){var n;if(kj()){if(t==null||pi(n=t)||Lu(n))ur.forEach(r=>{r.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){const r=ur.get(t.containerId);r?r.removeToast(t.id):ur.forEach(s=>{s.removeToast(t.id)})}}else $u=$u.filter(r=>t!=null&&r.options.toastId!==t)})(e)},me.clearWaitingQueue=function(e){e===void 0&&(e={}),ur.forEach(t=>{!t.props.limit||e.containerId&&t.id!==e.containerId||t.clearQueue()})},me.isActive=jj,me.update=function(e,t){t===void 0&&(t={});const n=((r,s)=>{var o;let{containerId:l}=s;return(o=ur.get(l||1))==null?void 0:o.toasts.get(r)})(e,t);if(n){const{props:r,content:s}=n,o={delay:100,...r,...t,toastId:t.toastId||e,updateId:Nj()};o.toastId!==e&&(o.staleId=e);const l=o.render||s;delete o.render,ku(l,o)}},me.done=e=>{me.update(e,{progress:1})},me.onChange=function(e){return Py.add(e),()=>{Py.delete(e)}},me.play=e=>CC(!0,e),me.pause=e=>CC(!1,e);const bL=typeof window<"u"?y.useLayoutEffect:y.useEffect,$f=e=>{let{theme:t,type:n,isLoading:r,...s}=e;return qe.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...s})},gv={info:function(e){return qe.createElement($f,{...e},qe.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return qe.createElement($f,{...e},qe.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return qe.createElement($f,{...e},qe.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return qe.createElement($f,{...e},qe.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return qe.createElement("div",{className:"Toastify__spinner"})}},xL=e=>{const{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:s,playToast:o}=gL(e),{closeButton:l,children:u,autoClose:d,onClick:f,type:h,hideProgressBar:m,closeToast:g,transition:x,position:b,className:w,style:C,bodyClassName:k,bodyStyle:j,progressClassName:M,progressStyle:_,updateId:R,role:N,progress:O,rtl:D,toastId:z,deleteToast:Q,isIn:pe,isLoading:V,closeOnClick:G,theme:W}=e,ie=wo("Toastify__toast",`Toastify__toast-theme--${W}`,`Toastify__toast--${h}`,{"Toastify__toast--rtl":D},{"Toastify__toast--close-on-click":G}),re=Ur(w)?w({rtl:D,position:b,type:h,defaultClassName:ie}):wo(ie,w),Y=(function(A){let{theme:F,type:fe,isLoading:te,icon:de}=A,ge=null;const Z={theme:F,type:fe};return de===!1||(Ur(de)?ge=de({...Z,isLoading:te}):y.isValidElement(de)?ge=y.cloneElement(de,Z):te?ge=gv.spinner():(ye=>ye in gv)(fe)&&(ge=gv[fe](Z))),ge})(e),H=!!O||!d,q={closeToast:g,type:h,theme:W};let he=null;return l===!1||(he=Ur(l)?l(q):y.isValidElement(l)?y.cloneElement(l,q):(function(A){let{closeToast:F,theme:fe,ariaLabel:te="close"}=A;return qe.createElement("button",{className:`Toastify__close-button Toastify__close-button--${fe}`,type:"button",onClick:de=>{de.stopPropagation(),F(de)},"aria-label":te},qe.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},qe.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))})(q)),qe.createElement(x,{isIn:pe,done:Q,position:b,preventExitTransition:n,nodeRef:r,playToast:o},qe.createElement("div",{id:z,onClick:f,"data-in":pe,className:re,...s,style:C,ref:r},qe.createElement("div",{...pe&&{role:N},className:Ur(k)?k({type:h}):wo("Toastify__toast-body",k),style:j},Y!=null&&qe.createElement("div",{className:wo("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!V})},Y),qe.createElement("div",null,u)),he,qe.createElement(mL,{...R&&!H?{key:`pb-${R}`}:{},rtl:D,theme:W,delay:d,isRunning:t,isIn:pe,closeToast:g,hide:m,type:h,style:_,className:M,controlledProgress:H,progress:O||0})))},bh=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},wL=yh(bh("bounce",!0));yh(bh("slide",!0));yh(bh("zoom"));yh(bh("flip"));const SL={position:"top-right",transition:wL,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function CL(e){let t={...SL,...e};const n=e.stacked,[r,s]=y.useState(!0),o=y.useRef(null),{getToastToRender:l,isToastActive:u,count:d}=hL(t),{className:f,style:h,rtl:m,containerId:g}=t;function x(w){const C=wo("Toastify__toast-container",`Toastify__toast-container--${w}`,{"Toastify__toast-container--rtl":m});return Ur(f)?f({position:w,rtl:m,defaultClassName:C}):wo(C,up(f))}function b(){n&&(s(!0),me.play())}return bL(()=>{if(n){var w;const C=o.current.querySelectorAll('[data-in="true"]'),k=12,j=(w=t.position)==null?void 0:w.includes("top");let M=0,_=0;Array.from(C).reverse().forEach((R,N)=>{const O=R;O.classList.add("Toastify__toast--stacked"),N>0&&(O.dataset.collapsed=`${r}`),O.dataset.pos||(O.dataset.pos=j?"top":"bot");const D=M*(r?.2:1)+(r?0:k*N);O.style.setProperty("--y",`${j?D:-1*D}px`),O.style.setProperty("--g",`${k}`),O.style.setProperty("--s",""+(1-(r?_:0))),M+=O.offsetHeight,_+=.025})}},[r,d,n]),qe.createElement("div",{ref:o,className:"Toastify",id:g,onMouseEnter:()=>{n&&(s(!1),me.pause())},onMouseLeave:b},l((w,C)=>{const k=C.length?{...h}:{...h,pointerEvents:"none"};return qe.createElement("div",{className:x(w),style:k,key:`container-${w}`},C.map(j=>{let{content:M,props:_}=j;return qe.createElement(xL,{..._,stacked:n,collapseAll:b,isIn:u(_.toastId,_.containerId),style:_.style,key:`toast-${_.key}`},M)}))}))}const EL={theme:"system",setTheme:()=>null},Mj=y.createContext(EL);function kL({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[s,o]=y.useState(()=>localStorage.getItem(n)||t);y.useEffect(()=>{const u=window.document.documentElement;if(u.classList.remove("light","dark"),s==="system"){const d=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";u.classList.add(d);return}u.classList.add(s)},[s]);const l={theme:s,setTheme:u=>{localStorage.setItem(n,u),o(u)}};return i.jsx(Mj.Provider,{...r,value:l,children:e})}const tc=()=>{const e=y.useContext(Mj);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};let mv=!1;const _j=new KD({defaultOptions:{queries:{staleTime:1e3*60*5,retry(e){return e>=3?(mv===!1&&(mv=!0,me.error("The application is taking longer than expected to load, please try again in a few minutes.",{onClose:()=>{mv=!1}})),!1):!0}}}});var jn=(e=>(e.API_URL="apiUrl",e.TOKEN="token",e.INSTANCE_ID="instanceId",e.INSTANCE_NAME="instanceName",e.INSTANCE_TOKEN="instanceToken",e.VERSION="version",e.FACEBOOK_APP_ID="facebookAppId",e.FACEBOOK_CONFIG_ID="facebookConfigId",e.FACEBOOK_USER_TOKEN="facebookUserToken",e.CLIENT_NAME="clientName",e))(jn||{});const Rj=async e=>{if(e.url){const t=e.url.endsWith("/")?e.url.slice(0,-1):e.url;localStorage.setItem("apiUrl",t)}e.token&&localStorage.setItem("token",e.token),e.version&&localStorage.setItem("version",e.version),e.facebookAppId&&localStorage.setItem("facebookAppId",e.facebookAppId),e.facebookConfigId&&localStorage.setItem("facebookConfigId",e.facebookConfigId),e.facebookUserToken&&localStorage.setItem("facebookUserToken",e.facebookUserToken),e.clientName&&localStorage.setItem("clientName",e.clientName)},Pj=()=>{localStorage.removeItem("apiUrl"),localStorage.removeItem("token"),localStorage.removeItem("version"),localStorage.removeItem("facebookAppId"),localStorage.removeItem("facebookConfigId"),localStorage.removeItem("facebookUserToken"),localStorage.removeItem("clientName")},dr=e=>localStorage.getItem(e),tn=({children:e})=>{const t=dr(jn.API_URL),n=dr(jn.TOKEN),r=dr(jn.VERSION);return!t||!n||!r?i.jsx(Cj,{to:"/manager/login"}):e},jL=({children:e})=>{const t=dr(jn.API_URL),n=dr(jn.TOKEN),r=dr(jn.VERSION);return t&&n&&r?i.jsx(Cj,{to:"/"}):e};function Oj(e,t){return function(){return e.apply(t,arguments)}}const{toString:TL}=Object.prototype,{getPrototypeOf:$b}=Object,{iterator:xh,toStringTag:Ij}=Symbol,wh=(e=>t=>{const n=TL.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Rs=e=>(e=e.toLowerCase(),t=>wh(t)===e),Sh=e=>t=>typeof t===e,{isArray:nc}=Array,$l=Sh("undefined");function gd(e){return e!==null&&!$l(e)&&e.constructor!==null&&!$l(e.constructor)&&jr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Aj=Rs("ArrayBuffer");function NL(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Aj(e.buffer),t}const ML=Sh("string"),jr=Sh("function"),Dj=Sh("number"),md=e=>e!==null&&typeof e=="object",_L=e=>e===!0||e===!1,dp=e=>{if(wh(e)!=="object")return!1;const t=$b(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Ij in e)&&!(xh in e)},RL=e=>{if(!md(e)||gd(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},PL=Rs("Date"),OL=Rs("File"),IL=Rs("Blob"),AL=Rs("FileList"),DL=e=>md(e)&&jr(e.pipe),FL=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||jr(e.append)&&((t=wh(e))==="formdata"||t==="object"&&jr(e.toString)&&e.toString()==="[object FormData]"))},LL=Rs("URLSearchParams"),[$L,BL,zL,UL]=["ReadableStream","Request","Response","Headers"].map(Rs),VL=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function vd(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),nc(e))for(r=0,s=e.length;r0;)if(s=n[r],t===s.toLowerCase())return s;return null}const li=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Lj=e=>!$l(e)&&e!==li;function Oy(){const{caseless:e,skipUndefined:t}=Lj(this)&&this||{},n={},r=(s,o)=>{const l=e&&Fj(n,o)||o;dp(n[l])&&dp(s)?n[l]=Oy(n[l],s):dp(s)?n[l]=Oy({},s):nc(s)?n[l]=s.slice():(!t||!$l(s))&&(n[l]=s)};for(let s=0,o=arguments.length;s(vd(t,(s,o)=>{n&&jr(s)?e[o]=Oj(s,n):e[o]=s},{allOwnKeys:r}),e),qL=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),KL=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},WL=(e,t,n,r)=>{let s,o,l;const u={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)l=s[o],(!r||r(l,e,t))&&!u[l]&&(t[l]=e[l],u[l]=!0);e=n!==!1&&$b(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},GL=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},JL=e=>{if(!e)return null;if(nc(e))return e;let t=e.length;if(!Dj(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},QL=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&$b(Uint8Array)),ZL=(e,t)=>{const r=(e&&e[xh]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},YL=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},XL=Rs("HTMLFormElement"),e4=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),EC=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),t4=Rs("RegExp"),$j=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};vd(n,(s,o)=>{let l;(l=t(s,o,e))!==!1&&(r[o]=l||s)}),Object.defineProperties(e,r)},n4=e=>{$j(e,(t,n)=>{if(jr(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(jr(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},r4=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return nc(e)?r(e):r(String(e).split(t)),n},s4=()=>{},o4=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function a4(e){return!!(e&&jr(e.append)&&e[Ij]==="FormData"&&e[xh])}const i4=e=>{const t=new Array(10),n=(r,s)=>{if(md(r)){if(t.indexOf(r)>=0)return;if(gd(r))return r;if(!("toJSON"in r)){t[s]=r;const o=nc(r)?[]:{};return vd(r,(l,u)=>{const d=n(l,s+1);!$l(d)&&(o[u]=d)}),t[s]=void 0,o}}return r};return n(e,0)},l4=Rs("AsyncFunction"),c4=e=>e&&(md(e)||jr(e))&&jr(e.then)&&jr(e.catch),Bj=((e,t)=>e?setImmediate:t?((n,r)=>(li.addEventListener("message",({source:s,data:o})=>{s===li&&o===n&&r.length&&r.shift()()},!1),s=>{r.push(s),li.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",jr(li.postMessage)),u4=typeof queueMicrotask<"u"?queueMicrotask.bind(li):typeof process<"u"&&process.nextTick||Bj,d4=e=>e!=null&&jr(e[xh]),ce={isArray:nc,isArrayBuffer:Aj,isBuffer:gd,isFormData:FL,isArrayBufferView:NL,isString:ML,isNumber:Dj,isBoolean:_L,isObject:md,isPlainObject:dp,isEmptyObject:RL,isReadableStream:$L,isRequest:BL,isResponse:zL,isHeaders:UL,isUndefined:$l,isDate:PL,isFile:OL,isBlob:IL,isRegExp:t4,isFunction:jr,isStream:DL,isURLSearchParams:LL,isTypedArray:QL,isFileList:AL,forEach:vd,merge:Oy,extend:HL,trim:VL,stripBOM:qL,inherits:KL,toFlatObject:WL,kindOf:wh,kindOfTest:Rs,endsWith:GL,toArray:JL,forEachEntry:ZL,matchAll:YL,isHTMLForm:XL,hasOwnProperty:EC,hasOwnProp:EC,reduceDescriptors:$j,freezeMethods:n4,toObjectSet:r4,toCamelCase:e4,noop:s4,toFiniteNumber:o4,findKey:Fj,global:li,isContextDefined:Lj,isSpecCompliantForm:a4,toJSONObject:i4,isAsyncFn:l4,isThenable:c4,setImmediate:Bj,asap:u4,isIterable:d4};function vt(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}ce.inherits(vt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ce.toJSONObject(this.config),code:this.code,status:this.status}}});const zj=vt.prototype,Uj={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Uj[e]={value:e}});Object.defineProperties(vt,Uj);Object.defineProperty(zj,"isAxiosError",{value:!0});vt.from=(e,t,n,r,s,o)=>{const l=Object.create(zj);ce.toFlatObject(e,l,function(h){return h!==Error.prototype},f=>f!=="isAxiosError");const u=e&&e.message?e.message:"Error",d=t==null&&e?e.code:t;return vt.call(l,u,d,n,r,s),e&&l.cause==null&&Object.defineProperty(l,"cause",{value:e,configurable:!0}),l.name=e&&e.name||"Error",o&&Object.assign(l,o),l};const f4=null;function Iy(e){return ce.isPlainObject(e)||ce.isArray(e)}function Vj(e){return ce.endsWith(e,"[]")?e.slice(0,-2):e}function kC(e,t,n){return e?e.concat(t).map(function(s,o){return s=Vj(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function p4(e){return ce.isArray(e)&&!e.some(Iy)}const h4=ce.toFlatObject(ce,{},null,function(t){return/^is[A-Z]/.test(t)});function Ch(e,t,n){if(!ce.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=ce.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,C){return!ce.isUndefined(C[w])});const r=n.metaTokens,s=n.visitor||h,o=n.dots,l=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&ce.isSpecCompliantForm(t);if(!ce.isFunction(s))throw new TypeError("visitor must be a function");function f(b){if(b===null)return"";if(ce.isDate(b))return b.toISOString();if(ce.isBoolean(b))return b.toString();if(!d&&ce.isBlob(b))throw new vt("Blob is not supported. Use a Buffer instead.");return ce.isArrayBuffer(b)||ce.isTypedArray(b)?d&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function h(b,w,C){let k=b;if(b&&!C&&typeof b=="object"){if(ce.endsWith(w,"{}"))w=r?w:w.slice(0,-2),b=JSON.stringify(b);else if(ce.isArray(b)&&p4(b)||(ce.isFileList(b)||ce.endsWith(w,"[]"))&&(k=ce.toArray(b)))return w=Vj(w),k.forEach(function(M,_){!(ce.isUndefined(M)||M===null)&&t.append(l===!0?kC([w],_,o):l===null?w:w+"[]",f(M))}),!1}return Iy(b)?!0:(t.append(kC(C,w,o),f(b)),!1)}const m=[],g=Object.assign(h4,{defaultVisitor:h,convertValue:f,isVisitable:Iy});function x(b,w){if(!ce.isUndefined(b)){if(m.indexOf(b)!==-1)throw Error("Circular reference detected in "+w.join("."));m.push(b),ce.forEach(b,function(k,j){(!(ce.isUndefined(k)||k===null)&&s.call(t,k,ce.isString(j)?j.trim():j,w,g))===!0&&x(k,w?w.concat(j):[j])}),m.pop()}}if(!ce.isObject(e))throw new TypeError("data must be an object");return x(e),t}function jC(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Bb(e,t){this._pairs=[],e&&Ch(e,this,t)}const Hj=Bb.prototype;Hj.append=function(t,n){this._pairs.push([t,n])};Hj.toString=function(t){const n=t?function(r){return t.call(this,r,jC)}:jC;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function g4(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function qj(e,t,n){if(!t)return e;const r=n&&n.encode||g4;ce.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let o;if(s?o=s(t,n):o=ce.isURLSearchParams(t)?t.toString():new Bb(t,n).toString(r),o){const l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class TC{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){ce.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Kj={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},m4=typeof URLSearchParams<"u"?URLSearchParams:Bb,v4=typeof FormData<"u"?FormData:null,y4=typeof Blob<"u"?Blob:null,b4={isBrowser:!0,classes:{URLSearchParams:m4,FormData:v4,Blob:y4},protocols:["http","https","file","blob","url","data"]},zb=typeof window<"u"&&typeof document<"u",Ay=typeof navigator=="object"&&navigator||void 0,x4=zb&&(!Ay||["ReactNative","NativeScript","NS"].indexOf(Ay.product)<0),w4=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",S4=zb&&window.location.href||"http://localhost",C4=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:zb,hasStandardBrowserEnv:x4,hasStandardBrowserWebWorkerEnv:w4,navigator:Ay,origin:S4},Symbol.toStringTag,{value:"Module"})),rr={...C4,...b4};function E4(e,t){return Ch(e,new rr.classes.URLSearchParams,{visitor:function(n,r,s,o){return rr.isNode&&ce.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function k4(e){return ce.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function j4(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r=n.length;return l=!l&&ce.isArray(s)?s.length:l,d?(ce.hasOwnProp(s,l)?s[l]=[s[l],r]:s[l]=r,!u):((!s[l]||!ce.isObject(s[l]))&&(s[l]=[]),t(n,r,s[l],o)&&ce.isArray(s[l])&&(s[l]=j4(s[l])),!u)}if(ce.isFormData(e)&&ce.isFunction(e.entries)){const n={};return ce.forEachEntry(e,(r,s)=>{t(k4(r),s,n,0)}),n}return null}function T4(e,t,n){if(ce.isString(e))try{return(t||JSON.parse)(e),ce.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const yd={transitional:Kj,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=ce.isObject(t);if(o&&ce.isHTMLForm(t)&&(t=new FormData(t)),ce.isFormData(t))return s?JSON.stringify(Wj(t)):t;if(ce.isArrayBuffer(t)||ce.isBuffer(t)||ce.isStream(t)||ce.isFile(t)||ce.isBlob(t)||ce.isReadableStream(t))return t;if(ce.isArrayBufferView(t))return t.buffer;if(ce.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return E4(t,this.formSerializer).toString();if((u=ce.isFileList(t))||r.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return Ch(u?{"files[]":t}:t,d&&new d,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),T4(t)):t}],transformResponse:[function(t){const n=this.transitional||yd.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(ce.isResponse(t)||ce.isReadableStream(t))return t;if(t&&ce.isString(t)&&(r&&!this.responseType||s)){const l=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(u){if(l)throw u.name==="SyntaxError"?vt.from(u,vt.ERR_BAD_RESPONSE,this,null,this.response):u}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:rr.classes.FormData,Blob:rr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ce.forEach(["delete","get","head","post","put","patch"],e=>{yd.headers[e]={}});const N4=ce.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),M4=e=>{const t={};let n,r,s;return e&&e.split(` +`).forEach(function(l){s=l.indexOf(":"),n=l.substring(0,s).trim().toLowerCase(),r=l.substring(s+1).trim(),!(!n||t[n]&&N4[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},NC=Symbol("internals");function ru(e){return e&&String(e).trim().toLowerCase()}function fp(e){return e===!1||e==null?e:ce.isArray(e)?e.map(fp):String(e)}function _4(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const R4=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function vv(e,t,n,r,s){if(ce.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!ce.isString(t)){if(ce.isString(r))return t.indexOf(r)!==-1;if(ce.isRegExp(r))return r.test(t)}}function P4(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function O4(e,t){const n=ce.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,l){return this[r].call(this,t,s,o,l)},configurable:!0})})}let Tr=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(u,d,f){const h=ru(d);if(!h)throw new Error("header name must be a non-empty string");const m=ce.findKey(s,h);(!m||s[m]===void 0||f===!0||f===void 0&&s[m]!==!1)&&(s[m||d]=fp(u))}const l=(u,d)=>ce.forEach(u,(f,h)=>o(f,h,d));if(ce.isPlainObject(t)||t instanceof this.constructor)l(t,n);else if(ce.isString(t)&&(t=t.trim())&&!R4(t))l(M4(t),n);else if(ce.isObject(t)&&ce.isIterable(t)){let u={},d,f;for(const h of t){if(!ce.isArray(h))throw TypeError("Object iterator must return a key-value pair");u[f=h[0]]=(d=u[f])?ce.isArray(d)?[...d,h[1]]:[d,h[1]]:h[1]}l(u,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=ru(t),t){const r=ce.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return _4(s);if(ce.isFunction(n))return n.call(this,s,r);if(ce.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=ru(t),t){const r=ce.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||vv(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(l){if(l=ru(l),l){const u=ce.findKey(r,l);u&&(!n||vv(r,r[u],u,n))&&(delete r[u],s=!0)}}return ce.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||vv(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return ce.forEach(this,(s,o)=>{const l=ce.findKey(r,o);if(l){n[l]=fp(s),delete n[o];return}const u=t?P4(o):String(o).trim();u!==o&&delete n[o],n[u]=fp(s),r[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return ce.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&ce.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` +`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[NC]=this[NC]={accessors:{}}).accessors,s=this.prototype;function o(l){const u=ru(l);r[u]||(O4(s,l),r[u]=!0)}return ce.isArray(t)?t.forEach(o):o(t),this}};Tr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ce.reduceDescriptors(Tr.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});ce.freezeMethods(Tr);function yv(e,t){const n=this||yd,r=t||n,s=Tr.from(r.headers);let o=r.data;return ce.forEach(e,function(u){o=u.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function Gj(e){return!!(e&&e.__CANCEL__)}function rc(e,t,n){vt.call(this,e??"canceled",vt.ERR_CANCELED,t,n),this.name="CanceledError"}ce.inherits(rc,vt,{__CANCEL__:!0});function Jj(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new vt("Request failed with status code "+n.status,[vt.ERR_BAD_REQUEST,vt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function I4(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function A4(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,l;return t=t!==void 0?t:1e3,function(d){const f=Date.now(),h=r[o];l||(l=f),n[s]=d,r[s]=f;let m=o,g=0;for(;m!==s;)g+=n[m++],m=m%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),f-l{n=h,s=null,o&&(clearTimeout(o),o=null),e(...f)};return[(...f)=>{const h=Date.now(),m=h-n;m>=r?l(f,h):(s=f,o||(o=setTimeout(()=>{o=null,l(s)},r-m)))},()=>s&&l(s)]}const Op=(e,t,n=3)=>{let r=0;const s=A4(50,250);return D4(o=>{const l=o.loaded,u=o.lengthComputable?o.total:void 0,d=l-r,f=s(d),h=l<=u;r=l;const m={loaded:l,total:u,progress:u?l/u:void 0,bytes:d,rate:f||void 0,estimated:f&&u&&h?(u-l)/f:void 0,event:o,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(m)},n)},MC=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},_C=e=>(...t)=>ce.asap(()=>e(...t)),F4=rr.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,rr.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(rr.origin),rr.navigator&&/(msie|trident)/i.test(rr.navigator.userAgent)):()=>!0,L4=rr.hasStandardBrowserEnv?{write(e,t,n,r,s,o){const l=[e+"="+encodeURIComponent(t)];ce.isNumber(n)&&l.push("expires="+new Date(n).toGMTString()),ce.isString(r)&&l.push("path="+r),ce.isString(s)&&l.push("domain="+s),o===!0&&l.push("secure"),document.cookie=l.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function $4(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function B4(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Qj(e,t,n){let r=!$4(t);return e&&(r||n==!1)?B4(e,t):t}const RC=e=>e instanceof Tr?{...e}:e;function Si(e,t){t=t||{};const n={};function r(f,h,m,g){return ce.isPlainObject(f)&&ce.isPlainObject(h)?ce.merge.call({caseless:g},f,h):ce.isPlainObject(h)?ce.merge({},h):ce.isArray(h)?h.slice():h}function s(f,h,m,g){if(ce.isUndefined(h)){if(!ce.isUndefined(f))return r(void 0,f,m,g)}else return r(f,h,m,g)}function o(f,h){if(!ce.isUndefined(h))return r(void 0,h)}function l(f,h){if(ce.isUndefined(h)){if(!ce.isUndefined(f))return r(void 0,f)}else return r(void 0,h)}function u(f,h,m){if(m in t)return r(f,h);if(m in e)return r(void 0,f)}const d={url:o,method:o,data:o,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:u,headers:(f,h,m)=>s(RC(f),RC(h),m,!0)};return ce.forEach(Object.keys({...e,...t}),function(h){const m=d[h]||s,g=m(e[h],t[h],h);ce.isUndefined(g)&&m!==u||(n[h]=g)}),n}const Zj=e=>{const t=Si({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:l,auth:u}=t;if(t.headers=l=Tr.from(l),t.url=qj(Qj(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),u&&l.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):""))),ce.isFormData(n)){if(rr.hasStandardBrowserEnv||rr.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if(ce.isFunction(n.getHeaders)){const d=n.getHeaders(),f=["content-type","content-length"];Object.entries(d).forEach(([h,m])=>{f.includes(h.toLowerCase())&&l.set(h,m)})}}if(rr.hasStandardBrowserEnv&&(r&&ce.isFunction(r)&&(r=r(t)),r||r!==!1&&F4(t.url))){const d=s&&o&&L4.read(o);d&&l.set(s,d)}return t},z4=typeof XMLHttpRequest<"u",U4=z4&&function(e){return new Promise(function(n,r){const s=Zj(e);let o=s.data;const l=Tr.from(s.headers).normalize();let{responseType:u,onUploadProgress:d,onDownloadProgress:f}=s,h,m,g,x,b;function w(){x&&x(),b&&b(),s.cancelToken&&s.cancelToken.unsubscribe(h),s.signal&&s.signal.removeEventListener("abort",h)}let C=new XMLHttpRequest;C.open(s.method.toUpperCase(),s.url,!0),C.timeout=s.timeout;function k(){if(!C)return;const M=Tr.from("getAllResponseHeaders"in C&&C.getAllResponseHeaders()),R={data:!u||u==="text"||u==="json"?C.responseText:C.response,status:C.status,statusText:C.statusText,headers:M,config:e,request:C};Jj(function(O){n(O),w()},function(O){r(O),w()},R),C=null}"onloadend"in C?C.onloadend=k:C.onreadystatechange=function(){!C||C.readyState!==4||C.status===0&&!(C.responseURL&&C.responseURL.indexOf("file:")===0)||setTimeout(k)},C.onabort=function(){C&&(r(new vt("Request aborted",vt.ECONNABORTED,e,C)),C=null)},C.onerror=function(_){const R=_&&_.message?_.message:"Network Error",N=new vt(R,vt.ERR_NETWORK,e,C);N.event=_||null,r(N),C=null},C.ontimeout=function(){let _=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const R=s.transitional||Kj;s.timeoutErrorMessage&&(_=s.timeoutErrorMessage),r(new vt(_,R.clarifyTimeoutError?vt.ETIMEDOUT:vt.ECONNABORTED,e,C)),C=null},o===void 0&&l.setContentType(null),"setRequestHeader"in C&&ce.forEach(l.toJSON(),function(_,R){C.setRequestHeader(R,_)}),ce.isUndefined(s.withCredentials)||(C.withCredentials=!!s.withCredentials),u&&u!=="json"&&(C.responseType=s.responseType),f&&([g,b]=Op(f,!0),C.addEventListener("progress",g)),d&&C.upload&&([m,x]=Op(d),C.upload.addEventListener("progress",m),C.upload.addEventListener("loadend",x)),(s.cancelToken||s.signal)&&(h=M=>{C&&(r(!M||M.type?new rc(null,e,C):M),C.abort(),C=null)},s.cancelToken&&s.cancelToken.subscribe(h),s.signal&&(s.signal.aborted?h():s.signal.addEventListener("abort",h)));const j=I4(s.url);if(j&&rr.protocols.indexOf(j)===-1){r(new vt("Unsupported protocol "+j+":",vt.ERR_BAD_REQUEST,e));return}C.send(o||null)})},V4=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const o=function(f){if(!s){s=!0,u();const h=f instanceof Error?f:this.reason;r.abort(h instanceof vt?h:new rc(h instanceof Error?h.message:h))}};let l=t&&setTimeout(()=>{l=null,o(new vt(`timeout ${t} of ms exceeded`,vt.ETIMEDOUT))},t);const u=()=>{e&&(l&&clearTimeout(l),l=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(o):f.removeEventListener("abort",o)}),e=null)};e.forEach(f=>f.addEventListener("abort",o));const{signal:d}=r;return d.unsubscribe=()=>ce.asap(u),d}},H4=function*(e,t){let n=e.byteLength;if(n{const s=q4(e,t);let o=0,l,u=d=>{l||(l=!0,r&&r(d))};return new ReadableStream({async pull(d){try{const{done:f,value:h}=await s.next();if(f){u(),d.close();return}let m=h.byteLength;if(n){let g=o+=m;n(g)}d.enqueue(new Uint8Array(h))}catch(f){throw u(f),f}},cancel(d){return u(d),s.return()}},{highWaterMark:2})},OC=64*1024,{isFunction:Bf}=ce,W4=(({Request:e,Response:t})=>({Request:e,Response:t}))(ce.global),{ReadableStream:IC,TextEncoder:AC}=ce.global,DC=(e,...t)=>{try{return!!e(...t)}catch{return!1}},G4=e=>{e=ce.merge.call({skipUndefined:!0},W4,e);const{fetch:t,Request:n,Response:r}=e,s=t?Bf(t):typeof fetch=="function",o=Bf(n),l=Bf(r);if(!s)return!1;const u=s&&Bf(IC),d=s&&(typeof AC=="function"?(b=>w=>b.encode(w))(new AC):async b=>new Uint8Array(await new n(b).arrayBuffer())),f=o&&u&&DC(()=>{let b=!1;const w=new n(rr.origin,{body:new IC,method:"POST",get duplex(){return b=!0,"half"}}).headers.has("Content-Type");return b&&!w}),h=l&&u&&DC(()=>ce.isReadableStream(new r("").body)),m={stream:h&&(b=>b.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(b=>{!m[b]&&(m[b]=(w,C)=>{let k=w&&w[b];if(k)return k.call(w);throw new vt(`Response type '${b}' is not supported`,vt.ERR_NOT_SUPPORT,C)})});const g=async b=>{if(b==null)return 0;if(ce.isBlob(b))return b.size;if(ce.isSpecCompliantForm(b))return(await new n(rr.origin,{method:"POST",body:b}).arrayBuffer()).byteLength;if(ce.isArrayBufferView(b)||ce.isArrayBuffer(b))return b.byteLength;if(ce.isURLSearchParams(b)&&(b=b+""),ce.isString(b))return(await d(b)).byteLength},x=async(b,w)=>{const C=ce.toFiniteNumber(b.getContentLength());return C??g(w)};return async b=>{let{url:w,method:C,data:k,signal:j,cancelToken:M,timeout:_,onDownloadProgress:R,onUploadProgress:N,responseType:O,headers:D,withCredentials:z="same-origin",fetchOptions:Q}=Zj(b),pe=t||fetch;O=O?(O+"").toLowerCase():"text";let V=V4([j,M&&M.toAbortSignal()],_),G=null;const W=V&&V.unsubscribe&&(()=>{V.unsubscribe()});let ie;try{if(N&&f&&C!=="get"&&C!=="head"&&(ie=await x(D,k))!==0){let A=new n(w,{method:"POST",body:k,duplex:"half"}),F;if(ce.isFormData(k)&&(F=A.headers.get("content-type"))&&D.setContentType(F),A.body){const[fe,te]=MC(ie,Op(_C(N)));k=PC(A.body,OC,fe,te)}}ce.isString(z)||(z=z?"include":"omit");const re=o&&"credentials"in n.prototype,Y={...Q,signal:V,method:C.toUpperCase(),headers:D.normalize().toJSON(),body:k,duplex:"half",credentials:re?z:void 0};G=o&&new n(w,Y);let H=await(o?pe(G,Q):pe(w,Y));const q=h&&(O==="stream"||O==="response");if(h&&(R||q&&W)){const A={};["status","statusText","headers"].forEach(de=>{A[de]=H[de]});const F=ce.toFiniteNumber(H.headers.get("content-length")),[fe,te]=R&&MC(F,Op(_C(R),!0))||[];H=new r(PC(H.body,OC,fe,()=>{te&&te(),W&&W()}),A)}O=O||"text";let he=await m[ce.findKey(m,O)||"text"](H,b);return!q&&W&&W(),await new Promise((A,F)=>{Jj(A,F,{data:he,headers:Tr.from(H.headers),status:H.status,statusText:H.statusText,config:b,request:G})})}catch(re){throw W&&W(),re&&re.name==="TypeError"&&/Load failed|fetch/i.test(re.message)?Object.assign(new vt("Network Error",vt.ERR_NETWORK,b,G),{cause:re.cause||re}):vt.from(re,re&&re.code,b,G)}}},J4=new Map,Yj=e=>{let t=e?e.env:{};const{fetch:n,Request:r,Response:s}=t,o=[r,s,n];let l=o.length,u=l,d,f,h=J4;for(;u--;)d=o[u],f=h.get(d),f===void 0&&h.set(d,f=u?new Map:G4(t)),h=f;return f};Yj();const Dy={http:f4,xhr:U4,fetch:{get:Yj}};ce.forEach(Dy,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const FC=e=>`- ${e}`,Q4=e=>ce.isFunction(e)||e===null||e===!1,Xj={getAdapter:(e,t)=>{e=ce.isArray(e)?e:[e];const{length:n}=e;let r,s;const o={};for(let l=0;l`adapter ${d} `+(f===!1?"is not supported by the environment":"is not available in the build"));let u=n?l.length>1?`since : +`+l.map(FC).join(` +`):" "+FC(l[0]):"as no adapter specified";throw new vt("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return s},adapters:Dy};function bv(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new rc(null,e)}function LC(e){return bv(e),e.headers=Tr.from(e.headers),e.data=yv.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Xj.getAdapter(e.adapter||yd.adapter,e)(e).then(function(r){return bv(e),r.data=yv.call(e,e.transformResponse,r),r.headers=Tr.from(r.headers),r},function(r){return Gj(r)||(bv(e),r&&r.response&&(r.response.data=yv.call(e,e.transformResponse,r.response),r.response.headers=Tr.from(r.response.headers))),Promise.reject(r)})}const eT="1.12.2",Eh={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Eh[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const $C={};Eh.transitional=function(t,n,r){function s(o,l){return"[Axios v"+eT+"] Transitional option '"+o+"'"+l+(r?". "+r:"")}return(o,l,u)=>{if(t===!1)throw new vt(s(l," has been removed"+(n?" in "+n:"")),vt.ERR_DEPRECATED);return n&&!$C[l]&&($C[l]=!0,console.warn(s(l," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,l,u):!0}};Eh.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Z4(e,t,n){if(typeof e!="object")throw new vt("options must be an object",vt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],l=t[o];if(l){const u=e[o],d=u===void 0||l(u,o,e);if(d!==!0)throw new vt("option "+o+" must be "+d,vt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new vt("Unknown option "+o,vt.ERR_BAD_OPTION)}}const pp={assertOptions:Z4,validators:Eh},$s=pp.validators;let hi=class{constructor(t){this.defaults=t||{},this.interceptors={request:new TC,response:new TC}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=` +`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Si(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&pp.assertOptions(r,{silentJSONParsing:$s.transitional($s.boolean),forcedJSONParsing:$s.transitional($s.boolean),clarifyTimeoutError:$s.transitional($s.boolean)},!1),s!=null&&(ce.isFunction(s)?n.paramsSerializer={serialize:s}:pp.assertOptions(s,{encode:$s.function,serialize:$s.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),pp.assertOptions(n,{baseUrl:$s.spelling("baseURL"),withXsrfToken:$s.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=o&&ce.merge(o.common,o[n.method]);o&&ce.forEach(["delete","get","head","post","put","patch","common"],b=>{delete o[b]}),n.headers=Tr.concat(l,o);const u=[];let d=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(n)===!1||(d=d&&w.synchronous,u.unshift(w.fulfilled,w.rejected))});const f=[];this.interceptors.response.forEach(function(w){f.push(w.fulfilled,w.rejected)});let h,m=0,g;if(!d){const b=[LC.bind(this),void 0];for(b.unshift(...u),b.push(...f),g=b.length,h=Promise.resolve(n);m{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const l=new Promise(u=>{r.subscribe(u),o=u}).then(s);return l.cancel=function(){r.unsubscribe(o)},l},t(function(o,l,u){r.reason||(r.reason=new rc(o,l,u),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new tT(function(s){t=s}),cancel:t}}};function X4(e){return function(n){return e.apply(null,n)}}function e$(e){return ce.isObject(e)&&e.isAxiosError===!0}const Fy={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Fy).forEach(([e,t])=>{Fy[t]=e});function nT(e){const t=new hi(e),n=Oj(hi.prototype.request,t);return ce.extend(n,hi.prototype,t,{allOwnKeys:!0}),ce.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return nT(Si(e,s))},n}const sn=nT(yd);sn.Axios=hi;sn.CanceledError=rc;sn.CancelToken=Y4;sn.isCancel=Gj;sn.VERSION=eT;sn.toFormData=Ch;sn.AxiosError=vt;sn.Cancel=sn.CanceledError;sn.all=function(t){return Promise.all(t)};sn.spread=X4;sn.isAxiosError=e$;sn.mergeConfig=Si;sn.AxiosHeaders=Tr;sn.formToJSON=e=>Wj(ce.isHTMLForm(e)?new FormData(e):e);sn.getAdapter=Xj.getAdapter;sn.HttpStatusCode=Fy;sn.default=sn;const{Axios:aie,AxiosError:iie,CanceledError:lie,isCancel:cie,CancelToken:uie,VERSION:die,all:fie,Cancel:pie,isAxiosError:rT,spread:hie,toFormData:gie,AxiosHeaders:mie,HttpStatusCode:vie,formToJSON:yie,getAdapter:bie,mergeConfig:xie}=sn,t$=e=>["auth","verifyServer",JSON.stringify(e)],sT=async({url:e})=>(await sn.get(`${e}/`)).data,n$=e=>{const{url:t,...n}=e;return mt({...n,queryKey:t$({url:t}),queryFn:()=>sT({url:t}),enabled:!!t})};function r$(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function kh(...e){return t=>e.forEach(n=>r$(n,t))}function Rt(...e){return y.useCallback(kh(...e),e)}var No=y.forwardRef((e,t)=>{const{children:n,...r}=e,s=y.Children.toArray(n),o=s.find(o$);if(o){const l=o.props.children,u=s.map(d=>d===o?y.Children.count(l)>1?y.Children.only(null):y.isValidElement(l)?l.props.children:null:d);return i.jsx(Ly,{...r,ref:t,children:y.isValidElement(l)?y.cloneElement(l,void 0,u):null})}return i.jsx(Ly,{...r,ref:t,children:n})});No.displayName="Slot";var Ly=y.forwardRef((e,t)=>{const{children:n,...r}=e;if(y.isValidElement(n)){const s=i$(n);return y.cloneElement(n,{...a$(r,n.props),ref:t?kh(t,s):s})}return y.Children.count(n)>1?y.Children.only(null):null});Ly.displayName="SlotClone";var s$=({children:e})=>i.jsx(i.Fragment,{children:e});function o$(e){return y.isValidElement(e)&&e.type===s$}function a$(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...u)=>{o(...u),s(...u)}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function i$(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function oT(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;ttypeof e=="boolean"?"".concat(e):e===0?"0":e,zC=l$,jh=(e,t)=>n=>{var r;if(t?.variants==null)return zC(e,n?.class,n?.className);const{variants:s,defaultVariants:o}=t,l=Object.keys(s).map(f=>{const h=n?.[f],m=o?.[f];if(h===null)return null;const g=BC(h)||BC(m);return s[f][g]}),u=n&&Object.entries(n).reduce((f,h)=>{let[m,g]=h;return g===void 0||(f[m]=g),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,h)=>{let{class:m,className:g,...x}=h;return Object.entries(x).every(b=>{let[w,C]=b;return Array.isArray(C)?C.includes({...o,...u}[w]):{...o,...u}[w]===C})?[...f,m,g]:f},[]);return zC(e,l,d,n?.class,n?.className)},Ub="-";function c$(e){const t=d$(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function s(l){const u=l.split(Ub);return u[0]===""&&u.length!==1&&u.shift(),aT(u,t)||u$(l)}function o(l,u){const d=n[l]||[];return u&&r[l]?[...d,...r[l]]:d}return{getClassGroupId:s,getConflictingClassGroupIds:o}}function aT(e,t){if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?aT(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(Ub);return t.validators.find(({validator:l})=>l(o))?.classGroupId}const UC=/^\[(.+)\]$/;function u$(e){if(UC.test(e)){const t=UC.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function d$(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return p$(Object.entries(e.classGroups),n).forEach(([o,l])=>{$y(l,r,o,t)}),r}function $y(e,t,n,r){e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:VC(t,s);o.classGroupId=n;return}if(typeof s=="function"){if(f$(s)){$y(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,l])=>{$y(l,VC(t,o),n,r)})})}function VC(e,t){let n=e;return t.split(Ub).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function f$(e){return e.isThemeGetter}function p$(e,t){return t?e.map(([n,r])=>{const s=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([l,u])=>[t+l,u])):o);return[n,s]}):e}function h$(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function s(o,l){n.set(o,l),t++,t>e&&(t=0,r=n,n=new Map)}return{get(o){let l=n.get(o);if(l!==void 0)return l;if((l=r.get(o))!==void 0)return s(o,l),l},set(o,l){n.has(o)?n.set(o,l):s(o,l)}}}const iT="!";function g$(e){const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],o=t.length;function l(u){const d=[];let f=0,h=0,m;for(let C=0;Ch?m-h:void 0;return{modifiers:d,hasImportantModifier:x,baseClassName:b,maybePostfixModifierPosition:w}}return n?function(d){return n({className:d,parseClassName:l})}:l}function m$(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function v$(e){return{cache:h$(e.cacheSize),parseClassName:g$(e),...c$(e)}}const y$=/\s+/;function b$(e,t){const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,o=new Set;return e.trim().split(y$).map(l=>{const{modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:h}=n(l);let m=!!h,g=r(m?f.substring(0,h):f);if(!g){if(!m)return{isTailwindClass:!1,originalClassName:l};if(g=r(f),!g)return{isTailwindClass:!1,originalClassName:l};m=!1}const x=m$(u).join(":");return{isTailwindClass:!0,modifierId:d?x+iT:x,classGroupId:g,originalClassName:l,hasPostfixModifier:m}}).reverse().filter(l=>{if(!l.isTailwindClass)return!0;const{modifierId:u,classGroupId:d,hasPostfixModifier:f}=l,h=u+d;return o.has(h)?!1:(o.add(h),s(d,f).forEach(m=>o.add(u+m)),!0)}).reverse().map(l=>l.originalClassName).join(" ")}function x$(){let e=0,t,n,r="";for(;em(h),e());return n=v$(f),r=n.cache.get,s=n.cache.set,o=u,u(d)}function u(d){const f=r(d);if(f)return f;const h=b$(d,n);return s(d,h),h}return function(){return o(x$.apply(null,arguments))}}function nn(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const cT=/^\[(?:([a-z-]+):)?(.+)\]$/i,S$=/^\d+\/\d+$/,C$=new Set(["px","full","screen"]),E$=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,k$=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,j$=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,T$=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,N$=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function ho(e){return ci(e)||C$.has(e)||S$.test(e)}function ca(e){return sc(e,"length",D$)}function ci(e){return!!e&&!Number.isNaN(Number(e))}function zf(e){return sc(e,"number",ci)}function su(e){return!!e&&Number.isInteger(Number(e))}function M$(e){return e.endsWith("%")&&ci(e.slice(0,-1))}function xt(e){return cT.test(e)}function ua(e){return E$.test(e)}const _$=new Set(["length","size","percentage"]);function R$(e){return sc(e,_$,uT)}function P$(e){return sc(e,"position",uT)}const O$=new Set(["image","url"]);function I$(e){return sc(e,O$,L$)}function A$(e){return sc(e,"",F$)}function ou(){return!0}function sc(e,t,n){const r=cT.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function D$(e){return k$.test(e)&&!j$.test(e)}function uT(){return!1}function F$(e){return T$.test(e)}function L$(e){return N$.test(e)}function $$(){const e=nn("colors"),t=nn("spacing"),n=nn("blur"),r=nn("brightness"),s=nn("borderColor"),o=nn("borderRadius"),l=nn("borderSpacing"),u=nn("borderWidth"),d=nn("contrast"),f=nn("grayscale"),h=nn("hueRotate"),m=nn("invert"),g=nn("gap"),x=nn("gradientColorStops"),b=nn("gradientColorStopPositions"),w=nn("inset"),C=nn("margin"),k=nn("opacity"),j=nn("padding"),M=nn("saturate"),_=nn("scale"),R=nn("sepia"),N=nn("skew"),O=nn("space"),D=nn("translate"),z=()=>["auto","contain","none"],Q=()=>["auto","hidden","clip","visible","scroll"],pe=()=>["auto",xt,t],V=()=>[xt,t],G=()=>["",ho,ca],W=()=>["auto",ci,xt],ie=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],re=()=>["solid","dashed","dotted","double","none"],Y=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],H=()=>["start","end","center","between","around","evenly","stretch"],q=()=>["","0",xt],he=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>[ci,zf],F=()=>[ci,xt];return{cacheSize:500,separator:":",theme:{colors:[ou],spacing:[ho,ca],blur:["none","",ua,xt],brightness:A(),borderColor:[e],borderRadius:["none","","full",ua,xt],borderSpacing:V(),borderWidth:G(),contrast:A(),grayscale:q(),hueRotate:F(),invert:q(),gap:V(),gradientColorStops:[e],gradientColorStopPositions:[M$,ca],inset:pe(),margin:pe(),opacity:A(),padding:V(),saturate:A(),scale:A(),sepia:q(),skew:F(),space:V(),translate:V()},classGroups:{aspect:[{aspect:["auto","square","video",xt]}],container:["container"],columns:[{columns:[ua]}],"break-after":[{"break-after":he()}],"break-before":[{"break-before":he()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ie(),xt]}],overflow:[{overflow:Q()}],"overflow-x":[{"overflow-x":Q()}],"overflow-y":[{"overflow-y":Q()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",su,xt]}],basis:[{basis:pe()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",xt]}],grow:[{grow:q()}],shrink:[{shrink:q()}],order:[{order:["first","last","none",su,xt]}],"grid-cols":[{"grid-cols":[ou]}],"col-start-end":[{col:["auto",{span:["full",su,xt]},xt]}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":[ou]}],"row-start-end":[{row:["auto",{span:[su,xt]},xt]}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",xt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",xt]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"justify-content":[{justify:["normal",...H()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...H(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...H(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[j]}],px:[{px:[j]}],py:[{py:[j]}],ps:[{ps:[j]}],pe:[{pe:[j]}],pt:[{pt:[j]}],pr:[{pr:[j]}],pb:[{pb:[j]}],pl:[{pl:[j]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[O]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[O]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",xt,t]}],"min-w":[{"min-w":[xt,t,"min","max","fit"]}],"max-w":[{"max-w":[xt,t,"none","full","min","max","fit","prose",{screen:[ua]},ua]}],h:[{h:[xt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[xt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[xt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[xt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ua,ca]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",zf]}],"font-family":[{font:[ou]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",xt]}],"line-clamp":[{"line-clamp":["none",ci,zf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ho,xt]}],"list-image":[{"list-image":["none",xt]}],"list-style-type":[{list:["none","disc","decimal",xt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[k]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[k]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ho,ca]}],"underline-offset":[{"underline-offset":["auto",ho,xt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:V()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",xt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",xt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[k]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ie(),P$]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",R$]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},I$]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[u]}],"border-w-x":[{"border-x":[u]}],"border-w-y":[{"border-y":[u]}],"border-w-s":[{"border-s":[u]}],"border-w-e":[{"border-e":[u]}],"border-w-t":[{"border-t":[u]}],"border-w-r":[{"border-r":[u]}],"border-w-b":[{"border-b":[u]}],"border-w-l":[{"border-l":[u]}],"border-opacity":[{"border-opacity":[k]}],"border-style":[{border:[...re(),"hidden"]}],"divide-x":[{"divide-x":[u]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[u]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[k]}],"divide-style":[{divide:re()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...re()]}],"outline-offset":[{"outline-offset":[ho,xt]}],"outline-w":[{outline:[ho,ca]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[k]}],"ring-offset-w":[{"ring-offset":[ho,ca]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ua,A$]}],"shadow-color":[{shadow:[ou]}],opacity:[{opacity:[k]}],"mix-blend":[{"mix-blend":[...Y(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Y()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",ua,xt]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[m]}],saturate:[{saturate:[M]}],sepia:[{sepia:[R]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[d]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[k]}],"backdrop-saturate":[{"backdrop-saturate":[M]}],"backdrop-sepia":[{"backdrop-sepia":[R]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",xt]}],duration:[{duration:F()}],ease:[{ease:["linear","in","out","in-out",xt]}],delay:[{delay:F()}],animate:[{animate:["none","spin","ping","pulse","bounce",xt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[_]}],"scale-x":[{"scale-x":[_]}],"scale-y":[{"scale-y":[_]}],rotate:[{rotate:[su,xt]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[N]}],"skew-y":[{"skew-y":[N]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",xt]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",xt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":V()}],"scroll-mx":[{"scroll-mx":V()}],"scroll-my":[{"scroll-my":V()}],"scroll-ms":[{"scroll-ms":V()}],"scroll-me":[{"scroll-me":V()}],"scroll-mt":[{"scroll-mt":V()}],"scroll-mr":[{"scroll-mr":V()}],"scroll-mb":[{"scroll-mb":V()}],"scroll-ml":[{"scroll-ml":V()}],"scroll-p":[{"scroll-p":V()}],"scroll-px":[{"scroll-px":V()}],"scroll-py":[{"scroll-py":V()}],"scroll-ps":[{"scroll-ps":V()}],"scroll-pe":[{"scroll-pe":V()}],"scroll-pt":[{"scroll-pt":V()}],"scroll-pr":[{"scroll-pr":V()}],"scroll-pb":[{"scroll-pb":V()}],"scroll-pl":[{"scroll-pl":V()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",xt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ho,ca,zf]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const B$=w$($$);function Ie(...e){return B$(wo(e))}const z$=jh("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",warning:"bg-amber-600 shadow-sm hover:bg-amber-600/90 data-active:bg-amber-600/90 text-foreground",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),se=y.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},o)=>{const l=r?No:"button";return i.jsx(l,{className:Ie(z$({variant:t,size:n,className:e})),ref:o,...s})});se.displayName="Button";function Vb(){const{t:e}=Ve(),t=dr(jn.API_URL),{data:n}=n$({url:t}),r=y.useMemo(()=>n?.clientName,[n]),s=y.useMemo(()=>n?.version,[n]),o=[{name:"Discord",url:"https://evolution-api.com/discord"},{name:"Postman",url:"https://evolution-api.com/postman"},{name:"GitHub",url:"https://github.com/EvolutionAPI/evolution-api"},{name:"Docs",url:"https://doc.evolution-api.com"}];return i.jsxs("footer",{className:"flex w-full flex-col items-center justify-between p-6 text-xs text-secondary-foreground sm:flex-row",children:[i.jsxs("div",{className:"flex items-center space-x-3 divide-x",children:[r&&r!==""&&i.jsxs("span",{children:[e("footer.clientName"),": ",i.jsx("strong",{children:r})]}),s&&s!==""&&i.jsxs("span",{className:"pl-3",children:[e("footer.version"),": ",i.jsx("strong",{children:s})]})]}),i.jsx("div",{className:"flex gap-2",children:o.map(l=>i.jsx(se,{variant:"link",asChild:!0,size:"sm",className:"text-xs",children:i.jsx("a",{href:l.url,target:"_blank",rel:"noopener noreferrer",children:l.name})},l.url))})]})}/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const U$=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),dT=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var V$={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const H$=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:l,...u},d)=>y.createElement("svg",{ref:d,...V$,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:dT("lucide",s),...u},[...l.map(([f,h])=>y.createElement(f,h)),...Array.isArray(o)?o:[o]]));/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Qe=(e,t)=>{const n=y.forwardRef(({className:r,...s},o)=>y.createElement(H$,{ref:o,iconNode:t,className:dT(`lucide-${U$(e)}`,r),...s}));return n.displayName=`${e}`,n};/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const HC=Qe("Apple",[["path",{d:"M12 20.94c1.5 0 2.75 1.06 4 1.06 3 0 6-8 6-12.22A4.91 4.91 0 0 0 17 5c-2.22 0-4 1.44-5 2-1-.56-2.78-2-5-2a4.9 4.9 0 0 0-5 4.78C2 14 5 22 8 22c1.25 0 2.5-1.06 4-1.06Z",key:"3s7exb"}],["path",{d:"M10 2c1 .5 2 2 2 5",key:"fcco2y"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Th=Qe("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const q$=Qe("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const K$=Qe("Car",[["path",{d:"M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2",key:"5owen"}],["circle",{cx:"7",cy:"17",r:"2",key:"u2ysq9"}],["path",{d:"M9 17h6",key:"r8uit2"}],["circle",{cx:"17",cy:"17",r:"2",key:"axvx0g"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fT=Qe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Nh=Qe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const W$=Qe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const G$=Qe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const J$=Qe("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Q$=Qe("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Oi=Qe("CircleStop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{width:"6",height:"6",x:"9",y:"9",key:"1wrtvo"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const pT=Qe("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Z$=Qe("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Y$=Qe("Club",[["path",{d:"M17.28 9.05a5.5 5.5 0 1 0-10.56 0A5.5 5.5 0 1 0 12 17.66a5.5 5.5 0 1 0 5.28-8.6Z",key:"27yuqz"}],["path",{d:"M12 17.66L12 22",key:"ogfahf"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Oo=Qe("Cog",[["path",{d:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",key:"sobvz5"}],["path",{d:"M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",key:"11i496"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const X$=Qe("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ii=Qe("Delete",[["path",{d:"M10 5a2 2 0 0 0-1.344.519l-6.328 5.74a1 1 0 0 0 0 1.481l6.328 5.741A2 2 0 0 0 10 19h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2z",key:"1yo7s0"}],["path",{d:"m12 9 6 6",key:"anjzzh"}],["path",{d:"m18 9-6 6",key:"1fp51s"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const eB=Qe("DoorOpen",[["path",{d:"M13 4h3a2 2 0 0 1 2 2v14",key:"hrm0s9"}],["path",{d:"M2 20h3",key:"1gaodv"}],["path",{d:"M13 20h9",key:"s90cdi"}],["path",{d:"M10 12v.01",key:"vx6srw"}],["path",{d:"M13 4.562v16.157a1 1 0 0 1-1.242.97L5 20V5.562a2 2 0 0 1 1.515-1.94l4-1A2 2 0 0 1 13 4.561Z",key:"199qr4"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Pa=Qe("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tB=Qe("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nB=Qe("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rB=Qe("FilePlus",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sB=Qe("FileQuestion",[["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Hb=Qe("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const oB=Qe("Flag",[["path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",key:"i9b6wo"}],["line",{x1:"4",x2:"4",y1:"22",y2:"15",key:"1cm3nv"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const aB=Qe("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const iB=Qe("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const lB=Qe("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const cB=Qe("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const uB=Qe("Images",[["path",{d:"M18 22H4a2 2 0 0 1-2-2V6",key:"pblm9e"}],["path",{d:"m22 13-1.296-1.296a2.41 2.41 0 0 0-3.408 0L11 18",key:"nf6bnh"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["rect",{width:"16",height:"16",x:"6",y:"2",rx:"2",key:"12espp"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const dB=Qe("IterationCcw",[["path",{d:"M20 10c0-4.4-3.6-8-8-8s-8 3.6-8 8 3.6 8 8 8h8",key:"4znkd0"}],["polyline",{points:"16 14 20 18 16 22",key:"11njsm"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fB=Qe("Languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const pB=Qe("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const hB=Qe("LifeBuoy",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.93 4.93 4.24 4.24",key:"1ymg45"}],["path",{d:"m14.83 9.17 4.24-4.24",key:"1cb5xl"}],["path",{d:"m14.83 14.83 4.24 4.24",key:"q42g0n"}],["path",{d:"m9.17 14.83-4.24 4.24",key:"bqpfvv"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gB=Qe("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ai=Qe("ListCollapse",[["path",{d:"m3 10 2.5-2.5L3 5",key:"i6eama"}],["path",{d:"m3 19 2.5-2.5L3 14",key:"w2gmor"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const mB=Qe("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const vB=Qe("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const yB=Qe("MapPin",[["path",{d:"M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z",key:"2oe9fu"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Bl=Qe("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const hT=Qe("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bB=Qe("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Di=Qe("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Fi=Qe("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const cs=Qe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ip=Qe("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Li=Qe("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const xB=Qe("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gT=Qe("Smile",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wB=Qe("Sparkle",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const SB=Qe("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const CB=Qe("Sticker",[["path",{d:"M15.5 3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h14a2 2 0 0 0 2-2V8.5L15.5 3Z",key:"1wis1t"}],["path",{d:"M14 3v4a2 2 0 0 0 2 2h4",key:"36rjfy"}],["path",{d:"M8 13h.01",key:"1sbv64"}],["path",{d:"M16 13h.01",key:"wip0gl"}],["path",{d:"M10 16s.8 1 2 1c1.3 0 2-1 2-1",key:"1vvgv3"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const EB=Qe("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const kB=Qe("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ap=Qe("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const jB=Qe("UsersRound",[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const TB=Qe("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qb=Qe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** + * @license lucide-react v0.408.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const mT=Qe("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),Ee=sn.create({timeout:3e4});Ee.interceptors.request.use(async e=>{const t=dr(jn.API_URL);if(t&&(e.baseURL=t.toString()),!e.headers.apiKey||e.headers.apiKey===""){const n=dr(jn.INSTANCE_TOKEN);n&&(e.headers.apikey=`${n}`)}return e},e=>Promise.reject(e));const bd=sn.create({timeout:3e4});bd.interceptors.request.use(async e=>{const t=dr(jn.API_URL);if(t&&(e.baseURL=t.toString()),!e.headers.apiKey||e.headers.apiKey===""){const n=dr(jn.TOKEN);n&&(e.headers.apikey=`${n}`)}return e},e=>Promise.reject(e));const NB=e=>["instance","fetchInstance",JSON.stringify(e)],MB=async({instanceId:e})=>{const t=await bd.get("/instance/fetchInstances",{params:{instanceId:e}});return Array.isArray(t.data)?t.data[0]:t.data},vT=e=>{const{instanceId:t,...n}=e;return mt({...n,queryKey:NB({instanceId:t}),queryFn:()=>MB({instanceId:t}),enabled:!!t})};function Ue(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e?.(s),n===!1||!s.defaultPrevented)return t?.(s)}}function _B(e,t){const n=y.createContext(t);function r(o){const{children:l,...u}=o,d=y.useMemo(()=>u,Object.values(u));return i.jsx(n.Provider,{value:d,children:l})}function s(o){const l=y.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return r.displayName=e+"Provider",[r,s]}function us(e,t=[]){let n=[];function r(o,l){const u=y.createContext(l),d=n.length;n=[...n,l];function f(m){const{scope:g,children:x,...b}=m,w=g?.[e][d]||u,C=y.useMemo(()=>b,Object.values(b));return i.jsx(w.Provider,{value:C,children:x})}function h(m,g){const x=g?.[e][d]||u,b=y.useContext(x);if(b)return b;if(l!==void 0)return l;throw new Error(`\`${m}\` must be used within \`${o}\``)}return f.displayName=o+"Provider",[f,h]}const s=()=>{const o=n.map(l=>y.createContext(l));return function(u){const d=u?.[e]||o;return y.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return s.scopeName=e,[r,RB(s,...t)]}function RB(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=r.reduce((u,{useScope:d,scopeName:f})=>{const m=d(o)[`__scope${f}`];return{...u,...m}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function Rn(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>t.current?.(...n),[])}function ya({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,s]=PB({defaultProp:t,onChange:n}),o=e!==void 0,l=o?e:r,u=Rn(n),d=y.useCallback(f=>{if(o){const m=typeof f=="function"?f(e):f;m!==e&&u(m)}else s(f)},[o,e,s,u]);return[l,d]}function PB({defaultProp:e,onChange:t}){const n=y.useState(e),[r]=n,s=y.useRef(r),o=Rn(t);return y.useEffect(()=>{s.current!==r&&(o(r),s.current=r)},[r,s,o]),n}var OB=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],rt=OB.reduce((e,t)=>{const n=y.forwardRef((r,s)=>{const{asChild:o,...l}=r,u=o?No:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(u,{...l,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function yT(e,t){e&&Ma.flushSync(()=>e.dispatchEvent(t))}function Kb(e){const t=e+"CollectionProvider",[n,r]=us(t),[s,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=x=>{const{scope:b,children:w}=x,C=qe.useRef(null),k=qe.useRef(new Map).current;return i.jsx(s,{scope:b,itemMap:k,collectionRef:C,children:w})};l.displayName=t;const u=e+"CollectionSlot",d=qe.forwardRef((x,b)=>{const{scope:w,children:C}=x,k=o(u,w),j=Rt(b,k.collectionRef);return i.jsx(No,{ref:j,children:C})});d.displayName=u;const f=e+"CollectionItemSlot",h="data-radix-collection-item",m=qe.forwardRef((x,b)=>{const{scope:w,children:C,...k}=x,j=qe.useRef(null),M=Rt(b,j),_=o(f,w);return qe.useEffect(()=>(_.itemMap.set(j,{ref:j,...k}),()=>void _.itemMap.delete(j))),i.jsx(No,{[h]:"",ref:M,children:C})});m.displayName=f;function g(x){const b=o(e+"CollectionConsumer",x);return qe.useCallback(()=>{const C=b.collectionRef.current;if(!C)return[];const k=Array.from(C.querySelectorAll(`[${h}]`));return Array.from(b.itemMap.values()).sort((_,R)=>k.indexOf(_.ref.current)-k.indexOf(R.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:l,Slot:d,ItemSlot:m},g,r]}var IB=y.createContext(void 0);function xd(e){const t=y.useContext(IB);return e||t||"ltr"}function AB(e,t=globalThis?.document){const n=Rn(e);y.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var DB="DismissableLayer",By="dismissableLayer.update",FB="dismissableLayer.pointerDownOutside",LB="dismissableLayer.focusOutside",qC,bT=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Mh=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:l,onDismiss:u,...d}=e,f=y.useContext(bT),[h,m]=y.useState(null),g=h?.ownerDocument??globalThis?.document,[,x]=y.useState({}),b=Rt(t,O=>m(O)),w=Array.from(f.layers),[C]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),k=w.indexOf(C),j=h?w.indexOf(h):-1,M=f.layersWithOutsidePointerEventsDisabled.size>0,_=j>=k,R=zB(O=>{const D=O.target,z=[...f.branches].some(Q=>Q.contains(D));!_||z||(s?.(O),l?.(O),O.defaultPrevented||u?.())},g),N=UB(O=>{const D=O.target;[...f.branches].some(Q=>Q.contains(D))||(o?.(O),l?.(O),O.defaultPrevented||u?.())},g);return AB(O=>{j===f.layers.size-1&&(r?.(O),!O.defaultPrevented&&u&&(O.preventDefault(),u()))},g),y.useEffect(()=>{if(h)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(qC=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),KC(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=qC)}},[h,g,n,f]),y.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),KC())},[h,f]),y.useEffect(()=>{const O=()=>x({});return document.addEventListener(By,O),()=>document.removeEventListener(By,O)},[]),i.jsx(rt.div,{...d,ref:b,style:{pointerEvents:M?_?"auto":"none":void 0,...e.style},onFocusCapture:Ue(e.onFocusCapture,N.onFocusCapture),onBlurCapture:Ue(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:Ue(e.onPointerDownCapture,R.onPointerDownCapture)})});Mh.displayName=DB;var $B="DismissableLayerBranch",BB=y.forwardRef((e,t)=>{const n=y.useContext(bT),r=y.useRef(null),s=Rt(t,r);return y.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),i.jsx(rt.div,{...e,ref:s})});BB.displayName=$B;function zB(e,t=globalThis?.document){const n=Rn(e),r=y.useRef(!1),s=y.useRef(()=>{});return y.useEffect(()=>{const o=u=>{if(u.target&&!r.current){let d=function(){xT(FB,n,f,{discrete:!0})};const f={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=d,t.addEventListener("click",s.current,{once:!0})):d()}else t.removeEventListener("click",s.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function UB(e,t=globalThis?.document){const n=Rn(e),r=y.useRef(!1);return y.useEffect(()=>{const s=o=>{o.target&&!r.current&&xT(LB,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function KC(){const e=new CustomEvent(By);document.dispatchEvent(e)}function xT(e,t,n,{discrete:r}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?yT(s,o):s.dispatchEvent(o)}var xv=0;function Wb(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??WC()),document.body.insertAdjacentElement("beforeend",e[1]??WC()),xv++,()=>{xv===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),xv--}},[])}function WC(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var wv="focusScope.autoFocusOnMount",Sv="focusScope.autoFocusOnUnmount",GC={bubbles:!1,cancelable:!0},VB="FocusScope",_h=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...l}=e,[u,d]=y.useState(null),f=Rn(s),h=Rn(o),m=y.useRef(null),g=Rt(t,w=>d(w)),x=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let w=function(M){if(x.paused||!u)return;const _=M.target;u.contains(_)?m.current=_:fa(m.current,{select:!0})},C=function(M){if(x.paused||!u)return;const _=M.relatedTarget;_!==null&&(u.contains(_)||fa(m.current,{select:!0}))},k=function(M){if(document.activeElement===document.body)for(const R of M)R.removedNodes.length>0&&fa(u)};document.addEventListener("focusin",w),document.addEventListener("focusout",C);const j=new MutationObserver(k);return u&&j.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",C),j.disconnect()}}},[r,u,x.paused]),y.useEffect(()=>{if(u){QC.add(x);const w=document.activeElement;if(!u.contains(w)){const k=new CustomEvent(wv,GC);u.addEventListener(wv,f),u.dispatchEvent(k),k.defaultPrevented||(HB(JB(wT(u)),{select:!0}),document.activeElement===w&&fa(u))}return()=>{u.removeEventListener(wv,f),setTimeout(()=>{const k=new CustomEvent(Sv,GC);u.addEventListener(Sv,h),u.dispatchEvent(k),k.defaultPrevented||fa(w??document.body,{select:!0}),u.removeEventListener(Sv,h),QC.remove(x)},0)}}},[u,f,h,x]);const b=y.useCallback(w=>{if(!n&&!r||x.paused)return;const C=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,k=document.activeElement;if(C&&k){const j=w.currentTarget,[M,_]=qB(j);M&&_?!w.shiftKey&&k===_?(w.preventDefault(),n&&fa(M,{select:!0})):w.shiftKey&&k===M&&(w.preventDefault(),n&&fa(_,{select:!0})):k===j&&w.preventDefault()}},[n,r,x.paused]);return i.jsx(rt.div,{tabIndex:-1,...l,ref:g,onKeyDown:b})});_h.displayName=VB;function HB(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(fa(r,{select:t}),document.activeElement!==n)return}function qB(e){const t=wT(e),n=JC(t,e),r=JC(t.reverse(),e);return[n,r]}function wT(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function JC(e,t){for(const n of e)if(!KB(n,{upTo:t}))return n}function KB(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function WB(e){return e instanceof HTMLInputElement&&"select"in e}function fa(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&WB(e)&&t&&e.select()}}var QC=GB();function GB(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=ZC(e,t),e.unshift(t)},remove(t){e=ZC(e,t),e[0]?.resume()}}}function ZC(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function JB(e){return e.filter(t=>t.tagName!=="A")}var Ln=globalThis?.document?y.useLayoutEffect:()=>{},QB=Yl.useId||(()=>{}),ZB=0;function Es(e){const[t,n]=y.useState(QB());return Ln(()=>{n(r=>r??String(ZB++))},[e]),t?`radix-${t}`:""}const YB=["top","right","bottom","left"],Hs=Math.min,zr=Math.max,Dp=Math.round,Uf=Math.floor,ba=e=>({x:e,y:e}),XB={left:"right",right:"left",bottom:"top",top:"bottom"},e3={start:"end",end:"start"};function zy(e,t,n){return zr(e,Hs(t,n))}function Mo(e,t){return typeof e=="function"?e(t):e}function _o(e){return e.split("-")[0]}function oc(e){return e.split("-")[1]}function Gb(e){return e==="x"?"y":"x"}function Jb(e){return e==="y"?"height":"width"}function xa(e){return["top","bottom"].includes(_o(e))?"y":"x"}function Qb(e){return Gb(xa(e))}function t3(e,t,n){n===void 0&&(n=!1);const r=oc(e),s=Qb(e),o=Jb(s);let l=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=Fp(l)),[l,Fp(l)]}function n3(e){const t=Fp(e);return[Uy(e),t,Uy(t)]}function Uy(e){return e.replace(/start|end/g,t=>e3[t])}function r3(e,t,n){const r=["left","right"],s=["right","left"],o=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?s:r:t?r:s;case"left":case"right":return t?o:l;default:return[]}}function s3(e,t,n,r){const s=oc(e);let o=r3(_o(e),n==="start",r);return s&&(o=o.map(l=>l+"-"+s),t&&(o=o.concat(o.map(Uy)))),o}function Fp(e){return e.replace(/left|right|bottom|top/g,t=>XB[t])}function o3(e){return{top:0,right:0,bottom:0,left:0,...e}}function ST(e){return typeof e!="number"?o3(e):{top:e,right:e,bottom:e,left:e}}function Lp(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function YC(e,t,n){let{reference:r,floating:s}=e;const o=xa(t),l=Qb(t),u=Jb(l),d=_o(t),f=o==="y",h=r.x+r.width/2-s.width/2,m=r.y+r.height/2-s.height/2,g=r[u]/2-s[u]/2;let x;switch(d){case"top":x={x:h,y:r.y-s.height};break;case"bottom":x={x:h,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:m};break;case"left":x={x:r.x-s.width,y:m};break;default:x={x:r.x,y:r.y}}switch(oc(t)){case"start":x[l]-=g*(n&&f?-1:1);break;case"end":x[l]+=g*(n&&f?-1:1);break}return x}const a3=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:l}=n,u=o.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(t));let f=await l.getElementRects({reference:e,floating:t,strategy:s}),{x:h,y:m}=YC(f,r,d),g=r,x={},b=0;for(let w=0;w({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:o,platform:l,elements:u,middlewareData:d}=t,{element:f,padding:h=0}=Mo(e,t)||{};if(f==null)return{};const m=ST(h),g={x:n,y:r},x=Qb(s),b=Jb(x),w=await l.getDimensions(f),C=x==="y",k=C?"top":"left",j=C?"bottom":"right",M=C?"clientHeight":"clientWidth",_=o.reference[b]+o.reference[x]-g[x]-o.floating[b],R=g[x]-o.reference[x],N=await(l.getOffsetParent==null?void 0:l.getOffsetParent(f));let O=N?N[M]:0;(!O||!await(l.isElement==null?void 0:l.isElement(N)))&&(O=u.floating[M]||o.floating[b]);const D=_/2-R/2,z=O/2-w[b]/2-1,Q=Hs(m[k],z),pe=Hs(m[j],z),V=Q,G=O-w[b]-pe,W=O/2-w[b]/2+D,ie=zy(V,W,G),re=!d.arrow&&oc(s)!=null&&W!==ie&&o.reference[b]/2-(WW<=0)){var pe,V;const W=(((pe=o.flip)==null?void 0:pe.index)||0)+1,ie=O[W];if(ie)return{data:{index:W,overflows:Q},reset:{placement:ie}};let re=(V=Q.filter(Y=>Y.overflows[0]<=0).sort((Y,H)=>Y.overflows[1]-H.overflows[1])[0])==null?void 0:V.placement;if(!re)switch(x){case"bestFit":{var G;const Y=(G=Q.filter(H=>{if(N){const q=xa(H.placement);return q===j||q==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(q=>q>0).reduce((q,he)=>q+he,0)]).sort((H,q)=>H[1]-q[1])[0])==null?void 0:G[0];Y&&(re=Y);break}case"initialPlacement":re=u;break}if(s!==re)return{reset:{placement:re}}}return{}}}};function XC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function e1(e){return YB.some(t=>e[t]>=0)}const c3=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=Mo(e,t);switch(r){case"referenceHidden":{const o=await Bu(t,{...s,elementContext:"reference"}),l=XC(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:e1(l)}}}case"escaped":{const o=await Bu(t,{...s,altBoundary:!0}),l=XC(o,n.floating);return{data:{escapedOffsets:l,escaped:e1(l)}}}default:return{}}}}};async function u3(e,t){const{placement:n,platform:r,elements:s}=e,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),l=_o(n),u=oc(n),d=xa(n)==="y",f=["left","top"].includes(l)?-1:1,h=o&&d?-1:1,m=Mo(t,e);let{mainAxis:g,crossAxis:x,alignmentAxis:b}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...m};return u&&typeof b=="number"&&(x=u==="end"?b*-1:b),d?{x:x*h,y:g*f}:{x:g*f,y:x*h}}const d3=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:o,placement:l,middlewareData:u}=t,d=await u3(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:s+d.x,y:o+d.y,data:{...d,placement:l}}}}},f3=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:u={fn:C=>{let{x:k,y:j}=C;return{x:k,y:j}}},...d}=Mo(e,t),f={x:n,y:r},h=await Bu(t,d),m=xa(_o(s)),g=Gb(m);let x=f[g],b=f[m];if(o){const C=g==="y"?"top":"left",k=g==="y"?"bottom":"right",j=x+h[C],M=x-h[k];x=zy(j,x,M)}if(l){const C=m==="y"?"top":"left",k=m==="y"?"bottom":"right",j=b+h[C],M=b-h[k];b=zy(j,b,M)}const w=u.fn({...t,[g]:x,[m]:b});return{...w,data:{x:w.x-n,y:w.y-r}}}}},p3=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:o,middlewareData:l}=t,{offset:u=0,mainAxis:d=!0,crossAxis:f=!0}=Mo(e,t),h={x:n,y:r},m=xa(s),g=Gb(m);let x=h[g],b=h[m];const w=Mo(u,t),C=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(d){const M=g==="y"?"height":"width",_=o.reference[g]-o.floating[M]+C.mainAxis,R=o.reference[g]+o.reference[M]-C.mainAxis;x<_?x=_:x>R&&(x=R)}if(f){var k,j;const M=g==="y"?"width":"height",_=["top","left"].includes(_o(s)),R=o.reference[m]-o.floating[M]+(_&&((k=l.offset)==null?void 0:k[m])||0)+(_?0:C.crossAxis),N=o.reference[m]+o.reference[M]+(_?0:((j=l.offset)==null?void 0:j[m])||0)-(_?C.crossAxis:0);bN&&(b=N)}return{[g]:x,[m]:b}}}},h3=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:s,elements:o}=t,{apply:l=()=>{},...u}=Mo(e,t),d=await Bu(t,u),f=_o(n),h=oc(n),m=xa(n)==="y",{width:g,height:x}=r.floating;let b,w;f==="top"||f==="bottom"?(b=f,w=h===(await(s.isRTL==null?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(w=f,b=h==="end"?"top":"bottom");const C=x-d.top-d.bottom,k=g-d.left-d.right,j=Hs(x-d[b],C),M=Hs(g-d[w],k),_=!t.middlewareData.shift;let R=j,N=M;if(m?N=h||_?Hs(M,k):k:R=h||_?Hs(j,C):C,_&&!h){const D=zr(d.left,0),z=zr(d.right,0),Q=zr(d.top,0),pe=zr(d.bottom,0);m?N=g-2*(D!==0||z!==0?D+z:zr(d.left,d.right)):R=x-2*(Q!==0||pe!==0?Q+pe:zr(d.top,d.bottom))}await l({...t,availableWidth:N,availableHeight:R});const O=await s.getDimensions(o.floating);return g!==O.width||x!==O.height?{reset:{rects:!0}}:{}}}};function ac(e){return CT(e)?(e.nodeName||"").toLowerCase():"#document"}function Vr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Io(e){var t;return(t=(CT(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function CT(e){return e instanceof Node||e instanceof Vr(e).Node}function Gs(e){return e instanceof Element||e instanceof Vr(e).Element}function Js(e){return e instanceof HTMLElement||e instanceof Vr(e).HTMLElement}function t1(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Vr(e).ShadowRoot}function wd(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Ns(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(s)}function g3(e){return["table","td","th"].includes(ac(e))}function Rh(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Zb(e){const t=Yb(),n=Ns(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function m3(e){let t=wa(e);for(;Js(t)&&!zl(t);){if(Rh(t))return null;if(Zb(t))return t;t=wa(t)}return null}function Yb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function zl(e){return["html","body","#document"].includes(ac(e))}function Ns(e){return Vr(e).getComputedStyle(e)}function Ph(e){return Gs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function wa(e){if(ac(e)==="html")return e;const t=e.assignedSlot||e.parentNode||t1(e)&&e.host||Io(e);return t1(t)?t.host:t}function ET(e){const t=wa(e);return zl(t)?e.ownerDocument?e.ownerDocument.body:e.body:Js(t)&&wd(t)?t:ET(t)}function zu(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=ET(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),l=Vr(s);return o?t.concat(l,l.visualViewport||[],wd(s)?s:[],l.frameElement&&n?zu(l.frameElement):[]):t.concat(s,zu(s,[],n))}function kT(e){const t=Ns(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Js(e),o=s?e.offsetWidth:n,l=s?e.offsetHeight:r,u=Dp(n)!==o||Dp(r)!==l;return u&&(n=o,r=l),{width:n,height:r,$:u}}function Xb(e){return Gs(e)?e:e.contextElement}function Rl(e){const t=Xb(e);if(!Js(t))return ba(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=kT(t);let l=(o?Dp(n.width):n.width)/r,u=(o?Dp(n.height):n.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const v3=ba(0);function jT(e){const t=Vr(e);return!Yb()||!t.visualViewport?v3:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function y3(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Vr(e)?!1:t}function Ci(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=Xb(e);let l=ba(1);t&&(r?Gs(r)&&(l=Rl(r)):l=Rl(e));const u=y3(o,n,r)?jT(o):ba(0);let d=(s.left+u.x)/l.x,f=(s.top+u.y)/l.y,h=s.width/l.x,m=s.height/l.y;if(o){const g=Vr(o),x=r&&Gs(r)?Vr(r):r;let b=g,w=b.frameElement;for(;w&&r&&x!==b;){const C=Rl(w),k=w.getBoundingClientRect(),j=Ns(w),M=k.left+(w.clientLeft+parseFloat(j.paddingLeft))*C.x,_=k.top+(w.clientTop+parseFloat(j.paddingTop))*C.y;d*=C.x,f*=C.y,h*=C.x,m*=C.y,d+=M,f+=_,b=Vr(w),w=b.frameElement}}return Lp({width:h,height:m,x:d,y:f})}function b3(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",l=Io(r),u=t?Rh(t.floating):!1;if(r===l||u&&o)return n;let d={scrollLeft:0,scrollTop:0},f=ba(1);const h=ba(0),m=Js(r);if((m||!m&&!o)&&((ac(r)!=="body"||wd(l))&&(d=Ph(r)),Js(r))){const g=Ci(r);f=Rl(r),h.x=g.x+r.clientLeft,h.y=g.y+r.clientTop}return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+h.x,y:n.y*f.y-d.scrollTop*f.y+h.y}}function x3(e){return Array.from(e.getClientRects())}function TT(e){return Ci(Io(e)).left+Ph(e).scrollLeft}function w3(e){const t=Io(e),n=Ph(e),r=e.ownerDocument.body,s=zr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=zr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+TT(e);const u=-n.scrollTop;return Ns(r).direction==="rtl"&&(l+=zr(t.clientWidth,r.clientWidth)-s),{width:s,height:o,x:l,y:u}}function S3(e,t){const n=Vr(e),r=Io(e),s=n.visualViewport;let o=r.clientWidth,l=r.clientHeight,u=0,d=0;if(s){o=s.width,l=s.height;const f=Yb();(!f||f&&t==="fixed")&&(u=s.offsetLeft,d=s.offsetTop)}return{width:o,height:l,x:u,y:d}}function C3(e,t){const n=Ci(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,o=Js(e)?Rl(e):ba(1),l=e.clientWidth*o.x,u=e.clientHeight*o.y,d=s*o.x,f=r*o.y;return{width:l,height:u,x:d,y:f}}function n1(e,t,n){let r;if(t==="viewport")r=S3(e,n);else if(t==="document")r=w3(Io(e));else if(Gs(t))r=C3(t,n);else{const s=jT(e);r={...t,x:t.x-s.x,y:t.y-s.y}}return Lp(r)}function NT(e,t){const n=wa(e);return n===t||!Gs(n)||zl(n)?!1:Ns(n).position==="fixed"||NT(n,t)}function E3(e,t){const n=t.get(e);if(n)return n;let r=zu(e,[],!1).filter(u=>Gs(u)&&ac(u)!=="body"),s=null;const o=Ns(e).position==="fixed";let l=o?wa(e):e;for(;Gs(l)&&!zl(l);){const u=Ns(l),d=Zb(l);!d&&u.position==="fixed"&&(s=null),(o?!d&&!s:!d&&u.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||wd(l)&&!d&&NT(e,l))?r=r.filter(h=>h!==l):s=u,l=wa(l)}return t.set(e,r),r}function k3(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const l=[...n==="clippingAncestors"?Rh(t)?[]:E3(t,this._c):[].concat(n),r],u=l[0],d=l.reduce((f,h)=>{const m=n1(t,h,s);return f.top=zr(m.top,f.top),f.right=Hs(m.right,f.right),f.bottom=Hs(m.bottom,f.bottom),f.left=zr(m.left,f.left),f},n1(t,u,s));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function j3(e){const{width:t,height:n}=kT(e);return{width:t,height:n}}function T3(e,t,n){const r=Js(t),s=Io(t),o=n==="fixed",l=Ci(e,!0,o,t);let u={scrollLeft:0,scrollTop:0};const d=ba(0);if(r||!r&&!o)if((ac(t)!=="body"||wd(s))&&(u=Ph(t)),r){const m=Ci(t,!0,o,t);d.x=m.x+t.clientLeft,d.y=m.y+t.clientTop}else s&&(d.x=TT(s));const f=l.left+u.scrollLeft-d.x,h=l.top+u.scrollTop-d.y;return{x:f,y:h,width:l.width,height:l.height}}function Cv(e){return Ns(e).position==="static"}function r1(e,t){return!Js(e)||Ns(e).position==="fixed"?null:t?t(e):e.offsetParent}function MT(e,t){const n=Vr(e);if(Rh(e))return n;if(!Js(e)){let s=wa(e);for(;s&&!zl(s);){if(Gs(s)&&!Cv(s))return s;s=wa(s)}return n}let r=r1(e,t);for(;r&&g3(r)&&Cv(r);)r=r1(r,t);return r&&zl(r)&&Cv(r)&&!Zb(r)?n:r||m3(e)||n}const N3=async function(e){const t=this.getOffsetParent||MT,n=this.getDimensions,r=await n(e.floating);return{reference:T3(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function M3(e){return Ns(e).direction==="rtl"}const _3={convertOffsetParentRelativeRectToViewportRelativeRect:b3,getDocumentElement:Io,getClippingRect:k3,getOffsetParent:MT,getElementRects:N3,getClientRects:x3,getDimensions:j3,getScale:Rl,isElement:Gs,isRTL:M3};function R3(e,t){let n=null,r;const s=Io(e);function o(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function l(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),o();const{left:f,top:h,width:m,height:g}=e.getBoundingClientRect();if(u||t(),!m||!g)return;const x=Uf(h),b=Uf(s.clientWidth-(f+m)),w=Uf(s.clientHeight-(h+g)),C=Uf(f),j={rootMargin:-x+"px "+-b+"px "+-w+"px "+-C+"px",threshold:zr(0,Hs(1,d))||1};let M=!0;function _(R){const N=R[0].intersectionRatio;if(N!==d){if(!M)return l();N?l(!1,N):r=setTimeout(()=>{l(!1,1e-7)},1e3)}M=!1}try{n=new IntersectionObserver(_,{...j,root:s.ownerDocument})}catch{n=new IntersectionObserver(_,j)}n.observe(e)}return l(!0),o}function _T(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=Xb(e),h=s||o?[...f?zu(f):[],...zu(t)]:[];h.forEach(k=>{s&&k.addEventListener("scroll",n,{passive:!0}),o&&k.addEventListener("resize",n)});const m=f&&u?R3(f,n):null;let g=-1,x=null;l&&(x=new ResizeObserver(k=>{let[j]=k;j&&j.target===f&&x&&(x.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var M;(M=x)==null||M.observe(t)})),n()}),f&&!d&&x.observe(f),x.observe(t));let b,w=d?Ci(e):null;d&&C();function C(){const k=Ci(e);w&&(k.x!==w.x||k.y!==w.y||k.width!==w.width||k.height!==w.height)&&n(),w=k,b=requestAnimationFrame(C)}return n(),()=>{var k;h.forEach(j=>{s&&j.removeEventListener("scroll",n),o&&j.removeEventListener("resize",n)}),m?.(),(k=x)==null||k.disconnect(),x=null,d&&cancelAnimationFrame(b)}}const P3=d3,O3=f3,I3=l3,A3=h3,D3=c3,s1=i3,F3=p3,L3=(e,t,n)=>{const r=new Map,s={platform:_3,...n},o={...s.platform,_c:r};return a3(e,t,{...s,platform:o})};var hp=typeof document<"u"?y.useLayoutEffect:y.useEffect;function $p(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!$p(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const o=s[r];if(!(o==="_owner"&&e.$$typeof)&&!$p(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function RT(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function o1(e,t){const n=RT(e);return Math.round(t*n)/n}function a1(e){const t=y.useRef(e);return hp(()=>{t.current=e}),t}function PT(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:o,floating:l}={},transform:u=!0,whileElementsMounted:d,open:f}=e,[h,m]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,x]=y.useState(r);$p(g,r)||x(r);const[b,w]=y.useState(null),[C,k]=y.useState(null),j=y.useCallback(Y=>{Y!==N.current&&(N.current=Y,w(Y))},[]),M=y.useCallback(Y=>{Y!==O.current&&(O.current=Y,k(Y))},[]),_=o||b,R=l||C,N=y.useRef(null),O=y.useRef(null),D=y.useRef(h),z=d!=null,Q=a1(d),pe=a1(s),V=y.useCallback(()=>{if(!N.current||!O.current)return;const Y={placement:t,strategy:n,middleware:g};pe.current&&(Y.platform=pe.current),L3(N.current,O.current,Y).then(H=>{const q={...H,isPositioned:!0};G.current&&!$p(D.current,q)&&(D.current=q,Ma.flushSync(()=>{m(q)}))})},[g,t,n,pe]);hp(()=>{f===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,m(Y=>({...Y,isPositioned:!1})))},[f]);const G=y.useRef(!1);hp(()=>(G.current=!0,()=>{G.current=!1}),[]),hp(()=>{if(_&&(N.current=_),R&&(O.current=R),_&&R){if(Q.current)return Q.current(_,R,V);V()}},[_,R,V,Q,z]);const W=y.useMemo(()=>({reference:N,floating:O,setReference:j,setFloating:M}),[j,M]),ie=y.useMemo(()=>({reference:_,floating:R}),[_,R]),re=y.useMemo(()=>{const Y={position:n,left:0,top:0};if(!ie.floating)return Y;const H=o1(ie.floating,h.x),q=o1(ie.floating,h.y);return u?{...Y,transform:"translate("+H+"px, "+q+"px)",...RT(ie.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:q}},[n,u,ie.floating,h.x,h.y]);return y.useMemo(()=>({...h,update:V,refs:W,elements:ie,floatingStyles:re}),[h,V,W,ie,re])}const $3=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?s1({element:r.current,padding:s}).fn(n):{}:r?s1({element:r,padding:s}).fn(n):{}}}},OT=(e,t)=>({...P3(e),options:[e,t]}),IT=(e,t)=>({...O3(e),options:[e,t]}),AT=(e,t)=>({...F3(e),options:[e,t]}),DT=(e,t)=>({...I3(e),options:[e,t]}),FT=(e,t)=>({...A3(e),options:[e,t]}),LT=(e,t)=>({...D3(e),options:[e,t]}),$T=(e,t)=>({...$3(e),options:[e,t]});var B3="Arrow",BT=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...o}=e;return i.jsx(rt.svg,{...o,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:i.jsx("polygon",{points:"0,0 30,0 15,10"})})});BT.displayName=B3;var z3=BT;function zT(e){const[t,n]=y.useState(void 0);return Ln(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let l,u;if("borderBoxSize"in o){const d=o.borderBoxSize,f=Array.isArray(d)?d[0]:d;l=f.inlineSize,u=f.blockSize}else l=e.offsetWidth,u=e.offsetHeight;n({width:l,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var ex="Popper",[UT,Oh]=us(ex),[U3,VT]=UT(ex),HT=e=>{const{__scopePopper:t,children:n}=e,[r,s]=y.useState(null);return i.jsx(U3,{scope:t,anchor:r,onAnchorChange:s,children:n})};HT.displayName=ex;var qT="PopperAnchor",KT=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,o=VT(qT,n),l=y.useRef(null),u=Rt(t,l);return y.useEffect(()=>{o.onAnchorChange(r?.current||l.current)}),r?null:i.jsx(rt.div,{...s,ref:u})});KT.displayName=qT;var tx="PopperContent",[V3,H3]=UT(tx),WT=y.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:h=0,sticky:m="partial",hideWhenDetached:g=!1,updatePositionStrategy:x="optimized",onPlaced:b,...w}=e,C=VT(tx,n),[k,j]=y.useState(null),M=Rt(t,Z=>j(Z)),[_,R]=y.useState(null),N=zT(_),O=N?.width??0,D=N?.height??0,z=r+(o!=="center"?"-"+o:""),Q=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},pe=Array.isArray(f)?f:[f],V=pe.length>0,G={padding:Q,boundary:pe.filter(K3),altBoundary:V},{refs:W,floatingStyles:ie,placement:re,isPositioned:Y,middlewareData:H}=PT({strategy:"fixed",placement:z,whileElementsMounted:(...Z)=>_T(...Z,{animationFrame:x==="always"}),elements:{reference:C.anchor},middleware:[OT({mainAxis:s+D,alignmentAxis:l}),d&&IT({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?AT():void 0,...G}),d&&DT({...G}),FT({...G,apply:({elements:Z,rects:ye,availableWidth:Re,availableHeight:$e})=>{const{width:Ye,height:Fe}=ye.reference,ft=Z.floating.style;ft.setProperty("--radix-popper-available-width",`${Re}px`),ft.setProperty("--radix-popper-available-height",`${$e}px`),ft.setProperty("--radix-popper-anchor-width",`${Ye}px`),ft.setProperty("--radix-popper-anchor-height",`${Fe}px`)}}),_&&$T({element:_,padding:u}),W3({arrowWidth:O,arrowHeight:D}),g&<({strategy:"referenceHidden",...G})]}),[q,he]=QT(re),A=Rn(b);Ln(()=>{Y&&A?.()},[Y,A]);const F=H.arrow?.x,fe=H.arrow?.y,te=H.arrow?.centerOffset!==0,[de,ge]=y.useState();return Ln(()=>{k&&ge(window.getComputedStyle(k).zIndex)},[k]),i.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...ie,transform:Y?ie.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:de,"--radix-popper-transform-origin":[H.transformOrigin?.x,H.transformOrigin?.y].join(" "),...H.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i.jsx(V3,{scope:n,placedSide:q,onArrowChange:R,arrowX:F,arrowY:fe,shouldHideArrow:te,children:i.jsx(rt.div,{"data-side":q,"data-align":he,...w,ref:M,style:{...w.style,animation:Y?void 0:"none"}})})})});WT.displayName=tx;var GT="PopperArrow",q3={top:"bottom",right:"left",bottom:"top",left:"right"},JT=y.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,o=H3(GT,r),l=q3[o.placedSide];return i.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:i.jsx(z3,{...s,ref:n,style:{...s.style,display:"block"}})})});JT.displayName=GT;function K3(e){return e!==null}var W3=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:s}=t,l=s.arrow?.centerOffset!==0,u=l?0:e.arrowWidth,d=l?0:e.arrowHeight,[f,h]=QT(n),m={start:"0%",center:"50%",end:"100%"}[h],g=(s.arrow?.x??0)+u/2,x=(s.arrow?.y??0)+d/2;let b="",w="";return f==="bottom"?(b=l?m:`${g}px`,w=`${-d}px`):f==="top"?(b=l?m:`${g}px`,w=`${r.floating.height+d}px`):f==="right"?(b=`${-d}px`,w=l?m:`${x}px`):f==="left"&&(b=`${r.floating.width+d}px`,w=l?m:`${x}px`),{data:{x:b,y:w}}}});function QT(e){const[t,n="center"]=e.split("-");return[t,n]}var ZT=HT,YT=KT,XT=WT,eN=JT,G3="Portal",Ih=y.forwardRef((e,t)=>{const{container:n,...r}=e,[s,o]=y.useState(!1);Ln(()=>o(!0),[]);const l=n||s&&globalThis?.document?.body;return l?Ib.createPortal(i.jsx(rt.div,{...r,ref:t}),l):null});Ih.displayName=G3;function J3(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var Mr=e=>{const{present:t,children:n}=e,r=Q3(t),s=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),o=Rt(r.ref,Z3(s));return typeof n=="function"||r.isPresent?y.cloneElement(s,{ref:o}):null};Mr.displayName="Presence";function Q3(e){const[t,n]=y.useState(),r=y.useRef({}),s=y.useRef(e),o=y.useRef("none"),l=e?"mounted":"unmounted",[u,d]=J3(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const f=Vf(r.current);o.current=u==="mounted"?f:"none"},[u]),Ln(()=>{const f=r.current,h=s.current;if(h!==e){const g=o.current,x=Vf(f);e?d("MOUNT"):x==="none"||f?.display==="none"?d("UNMOUNT"):d(h&&g!==x?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,d]),Ln(()=>{if(t){const f=m=>{const x=Vf(r.current).includes(m.animationName);m.target===t&&x&&Ma.flushSync(()=>d("ANIMATION_END"))},h=m=>{m.target===t&&(o.current=Vf(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:y.useCallback(f=>{f&&(r.current=getComputedStyle(f)),n(f)},[])}}function Vf(e){return e?.animationName||"none"}function Z3(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ev="rovingFocusGroup.onEntryFocus",Y3={bubbles:!1,cancelable:!0},Ah="RovingFocusGroup",[Vy,tN,X3]=Kb(Ah),[ez,Dh]=us(Ah,[X3]),[tz,nz]=ez(Ah),nN=y.forwardRef((e,t)=>i.jsx(Vy.Provider,{scope:e.__scopeRovingFocusGroup,children:i.jsx(Vy.Slot,{scope:e.__scopeRovingFocusGroup,children:i.jsx(rz,{...e,ref:t})})}));nN.displayName=Ah;var rz=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:h=!1,...m}=e,g=y.useRef(null),x=Rt(t,g),b=xd(o),[w=null,C]=ya({prop:l,defaultProp:u,onChange:d}),[k,j]=y.useState(!1),M=Rn(f),_=tN(n),R=y.useRef(!1),[N,O]=y.useState(0);return y.useEffect(()=>{const D=g.current;if(D)return D.addEventListener(Ev,M),()=>D.removeEventListener(Ev,M)},[M]),i.jsx(tz,{scope:n,orientation:r,dir:b,loop:s,currentTabStopId:w,onItemFocus:y.useCallback(D=>C(D),[C]),onItemShiftTab:y.useCallback(()=>j(!0),[]),onFocusableItemAdd:y.useCallback(()=>O(D=>D+1),[]),onFocusableItemRemove:y.useCallback(()=>O(D=>D-1),[]),children:i.jsx(rt.div,{tabIndex:k||N===0?-1:0,"data-orientation":r,...m,ref:x,style:{outline:"none",...e.style},onMouseDown:Ue(e.onMouseDown,()=>{R.current=!0}),onFocus:Ue(e.onFocus,D=>{const z=!R.current;if(D.target===D.currentTarget&&z&&!k){const Q=new CustomEvent(Ev,Y3);if(D.currentTarget.dispatchEvent(Q),!Q.defaultPrevented){const pe=_().filter(re=>re.focusable),V=pe.find(re=>re.active),G=pe.find(re=>re.id===w),ie=[V,G,...pe].filter(Boolean).map(re=>re.ref.current);oN(ie,h)}}R.current=!1}),onBlur:Ue(e.onBlur,()=>j(!1))})})}),rN="RovingFocusGroupItem",sN=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:o,...l}=e,u=Es(),d=o||u,f=nz(rN,n),h=f.currentTabStopId===d,m=tN(n),{onFocusableItemAdd:g,onFocusableItemRemove:x}=f;return y.useEffect(()=>{if(r)return g(),()=>x()},[r,g,x]),i.jsx(Vy.ItemSlot,{scope:n,id:d,focusable:r,active:s,children:i.jsx(rt.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...l,ref:t,onMouseDown:Ue(e.onMouseDown,b=>{r?f.onItemFocus(d):b.preventDefault()}),onFocus:Ue(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:Ue(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){f.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const w=az(b,f.orientation,f.dir);if(w!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let k=m().filter(j=>j.focusable).map(j=>j.ref.current);if(w==="last")k.reverse();else if(w==="prev"||w==="next"){w==="prev"&&k.reverse();const j=k.indexOf(b.currentTarget);k=f.loop?iz(k,j+1):k.slice(j+1)}setTimeout(()=>oN(k))}})})})});sN.displayName=rN;var sz={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function oz(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function az(e,t,n){const r=oz(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return sz[r]}function oN(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function iz(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var aN=nN,iN=sN,lz=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},pl=new WeakMap,Hf=new WeakMap,qf={},kv=0,lN=function(e){return e&&(e.host||lN(e.parentNode))},cz=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=lN(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},uz=function(e,t,n,r){var s=cz(t,Array.isArray(e)?e:[e]);qf[n]||(qf[n]=new WeakMap);var o=qf[n],l=[],u=new Set,d=new Set(s),f=function(m){!m||u.has(m)||(u.add(m),f(m.parentNode))};s.forEach(f);var h=function(m){!m||d.has(m)||Array.prototype.forEach.call(m.children,function(g){if(u.has(g))h(g);else try{var x=g.getAttribute(r),b=x!==null&&x!=="false",w=(pl.get(g)||0)+1,C=(o.get(g)||0)+1;pl.set(g,w),o.set(g,C),l.push(g),w===1&&b&&Hf.set(g,!0),C===1&&g.setAttribute(n,"true"),b||g.setAttribute(r,"true")}catch(k){console.error("aria-hidden: cannot operate on ",g,k)}})};return h(t),u.clear(),kv++,function(){l.forEach(function(m){var g=pl.get(m)-1,x=o.get(m)-1;pl.set(m,g),o.set(m,x),g||(Hf.has(m)||m.removeAttribute(r),Hf.delete(m)),x||m.removeAttribute(n)}),kv--,kv||(pl=new WeakMap,pl=new WeakMap,Hf=new WeakMap,qf={})}},nx=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=lz(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),uz(r,s,n,"aria-hidden")):function(){return null}},zs=function(){return zs=Object.assign||function(t){for(var n,r=1,s=arguments.length;r"u")return Tz;var t=Nz(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},_z=fN(),Pl="data-scroll-locked",Rz=function(e,t,n,r){var s=e.left,o=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),` + .`.concat(fz,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(u,"px ").concat(r,`; + } + body[`).concat(Pl,`] { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(s,`px; + padding-top: `).concat(o,`px; + padding-right: `).concat(l,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(u,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(gp,` { + right: `).concat(u,"px ").concat(r,`; + } + + .`).concat(mp,` { + margin-right: `).concat(u,"px ").concat(r,`; + } + + .`).concat(gp," .").concat(gp,` { + right: 0 `).concat(r,`; + } + + .`).concat(mp," .").concat(mp,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(Pl,`] { + `).concat(pz,": ").concat(u,`px; + } +`)},l1=function(){var e=parseInt(document.body.getAttribute(Pl)||"0",10);return isFinite(e)?e:0},Pz=function(){y.useEffect(function(){return document.body.setAttribute(Pl,(l1()+1).toString()),function(){var e=l1()-1;e<=0?document.body.removeAttribute(Pl):document.body.setAttribute(Pl,e.toString())}},[])},Oz=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;Pz();var o=y.useMemo(function(){return Mz(s)},[s]);return y.createElement(_z,{styles:Rz(o,!t,s,n?"":"!important")})},Hy=!1;if(typeof window<"u")try{var Kf=Object.defineProperty({},"passive",{get:function(){return Hy=!0,!0}});window.addEventListener("test",Kf,Kf),window.removeEventListener("test",Kf,Kf)}catch{Hy=!1}var hl=Hy?{passive:!1}:!1,Iz=function(e){return e.tagName==="TEXTAREA"},pN=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Iz(e)&&n[t]==="visible")},Az=function(e){return pN(e,"overflowY")},Dz=function(e){return pN(e,"overflowX")},c1=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=hN(e,r);if(s){var o=gN(e,r),l=o[1],u=o[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Fz=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Lz=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},hN=function(e,t){return e==="v"?Az(t):Dz(t)},gN=function(e,t){return e==="v"?Fz(t):Lz(t)},$z=function(e,t){return e==="h"&&t==="rtl"?-1:1},Bz=function(e,t,n,r,s){var o=$z(e,window.getComputedStyle(t).direction),l=o*r,u=n.target,d=t.contains(u),f=!1,h=l>0,m=0,g=0;do{var x=gN(e,u),b=x[0],w=x[1],C=x[2],k=w-C-o*b;(b||k)&&hN(e,u)&&(m+=k,g+=b),u instanceof ShadowRoot?u=u.host:u=u.parentNode}while(!d&&u!==document.body||d&&(t.contains(u)||t===u));return(h&&Math.abs(m)<1||!h&&Math.abs(g)<1)&&(f=!0),f},Wf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},u1=function(e){return[e.deltaX,e.deltaY]},d1=function(e){return e&&"current"in e?e.current:e},zz=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Uz=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},Vz=0,gl=[];function Hz(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),s=y.useState(Vz++)[0],o=y.useState(fN)[0],l=y.useRef(e);y.useEffect(function(){l.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var w=dz([e.lockRef.current],(e.shards||[]).map(d1),!0).filter(Boolean);return w.forEach(function(C){return C.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),w.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var u=y.useCallback(function(w,C){if("touches"in w&&w.touches.length===2)return!l.current.allowPinchZoom;var k=Wf(w),j=n.current,M="deltaX"in w?w.deltaX:j[0]-k[0],_="deltaY"in w?w.deltaY:j[1]-k[1],R,N=w.target,O=Math.abs(M)>Math.abs(_)?"h":"v";if("touches"in w&&O==="h"&&N.type==="range")return!1;var D=c1(O,N);if(!D)return!0;if(D?R=O:(R=O==="v"?"h":"v",D=c1(O,N)),!D)return!1;if(!r.current&&"changedTouches"in w&&(M||_)&&(r.current=R),!R)return!0;var z=r.current||R;return Bz(z,C,w,z==="h"?M:_)},[]),d=y.useCallback(function(w){var C=w;if(!(!gl.length||gl[gl.length-1]!==o)){var k="deltaY"in C?u1(C):Wf(C),j=t.current.filter(function(R){return R.name===C.type&&(R.target===C.target||C.target===R.shadowParent)&&zz(R.delta,k)})[0];if(j&&j.should){C.cancelable&&C.preventDefault();return}if(!j){var M=(l.current.shards||[]).map(d1).filter(Boolean).filter(function(R){return R.contains(C.target)}),_=M.length>0?u(C,M[0]):!l.current.noIsolation;_&&C.cancelable&&C.preventDefault()}}},[]),f=y.useCallback(function(w,C,k,j){var M={name:w,delta:C,target:k,should:j,shadowParent:qz(k)};t.current.push(M),setTimeout(function(){t.current=t.current.filter(function(_){return _!==M})},1)},[]),h=y.useCallback(function(w){n.current=Wf(w),r.current=void 0},[]),m=y.useCallback(function(w){f(w.type,u1(w),w.target,u(w,e.lockRef.current))},[]),g=y.useCallback(function(w){f(w.type,Wf(w),w.target,u(w,e.lockRef.current))},[]);y.useEffect(function(){return gl.push(o),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:g}),document.addEventListener("wheel",d,hl),document.addEventListener("touchmove",d,hl),document.addEventListener("touchstart",h,hl),function(){gl=gl.filter(function(w){return w!==o}),document.removeEventListener("wheel",d,hl),document.removeEventListener("touchmove",d,hl),document.removeEventListener("touchstart",h,hl)}},[]);var x=e.removeScrollBar,b=e.inert;return y.createElement(y.Fragment,null,b?y.createElement(o,{styles:Uz(s)}):null,x?y.createElement(Oz,{gapMode:e.gapMode}):null)}function qz(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Kz=xz(dN,Hz);var Lh=y.forwardRef(function(e,t){return y.createElement(Fh,zs({},e,{ref:t,sideCar:Kz}))});Lh.classNames=Fh.classNames;var qy=["Enter"," "],Wz=["ArrowDown","PageUp","Home"],mN=["ArrowUp","PageDown","End"],Gz=[...Wz,...mN],Jz={ltr:[...qy,"ArrowRight"],rtl:[...qy,"ArrowLeft"]},Qz={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Sd="Menu",[Uu,Zz,Yz]=Kb(Sd),[$i,vN]=us(Sd,[Yz,Oh,Dh]),$h=Oh(),yN=Dh(),[Xz,Bi]=$i(Sd),[eU,Cd]=$i(Sd),bN=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:o,modal:l=!0}=e,u=$h(t),[d,f]=y.useState(null),h=y.useRef(!1),m=Rn(o),g=xd(s);return y.useEffect(()=>{const x=()=>{h.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>h.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),i.jsx(ZT,{...u,children:i.jsx(Xz,{scope:t,open:n,onOpenChange:m,content:d,onContentChange:f,children:i.jsx(eU,{scope:t,onClose:y.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:h,dir:g,modal:l,children:r})})})};bN.displayName=Sd;var tU="MenuAnchor",rx=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=$h(n);return i.jsx(YT,{...s,...r,ref:t})});rx.displayName=tU;var sx="MenuPortal",[nU,xN]=$i(sx,{forceMount:void 0}),wN=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,o=Bi(sx,t);return i.jsx(nU,{scope:t,forceMount:n,children:i.jsx(Mr,{present:n||o.open,children:i.jsx(Ih,{asChild:!0,container:s,children:r})})})};wN.displayName=sx;var is="MenuContent",[rU,ox]=$i(is),SN=y.forwardRef((e,t)=>{const n=xN(is,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=Bi(is,e.__scopeMenu),l=Cd(is,e.__scopeMenu);return i.jsx(Uu.Provider,{scope:e.__scopeMenu,children:i.jsx(Mr,{present:r||o.open,children:i.jsx(Uu.Slot,{scope:e.__scopeMenu,children:l.modal?i.jsx(sU,{...s,ref:t}):i.jsx(oU,{...s,ref:t})})})})}),sU=y.forwardRef((e,t)=>{const n=Bi(is,e.__scopeMenu),r=y.useRef(null),s=Rt(t,r);return y.useEffect(()=>{const o=r.current;if(o)return nx(o)},[]),i.jsx(ax,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ue(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),oU=y.forwardRef((e,t)=>{const n=Bi(is,e.__scopeMenu);return i.jsx(ax,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),ax=y.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:u,onEntryFocus:d,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:g,onDismiss:x,disableOutsideScroll:b,...w}=e,C=Bi(is,n),k=Cd(is,n),j=$h(n),M=yN(n),_=Zz(n),[R,N]=y.useState(null),O=y.useRef(null),D=Rt(t,O,C.onContentChange),z=y.useRef(0),Q=y.useRef(""),pe=y.useRef(0),V=y.useRef(null),G=y.useRef("right"),W=y.useRef(0),ie=b?Lh:y.Fragment,re=b?{as:No,allowPinchZoom:!0}:void 0,Y=q=>{const he=Q.current+q,A=_().filter(Z=>!Z.disabled),F=document.activeElement,fe=A.find(Z=>Z.ref.current===F)?.textValue,te=A.map(Z=>Z.textValue),de=vU(te,he,fe),ge=A.find(Z=>Z.textValue===de)?.ref.current;(function Z(ye){Q.current=ye,window.clearTimeout(z.current),ye!==""&&(z.current=window.setTimeout(()=>Z(""),1e3))})(he),ge&&setTimeout(()=>ge.focus())};y.useEffect(()=>()=>window.clearTimeout(z.current),[]),Wb();const H=y.useCallback(q=>G.current===V.current?.side&&bU(q,V.current?.area),[]);return i.jsx(rU,{scope:n,searchRef:Q,onItemEnter:y.useCallback(q=>{H(q)&&q.preventDefault()},[H]),onItemLeave:y.useCallback(q=>{H(q)||(O.current?.focus(),N(null))},[H]),onTriggerLeave:y.useCallback(q=>{H(q)&&q.preventDefault()},[H]),pointerGraceTimerRef:pe,onPointerGraceIntentChange:y.useCallback(q=>{V.current=q},[]),children:i.jsx(ie,{...re,children:i.jsx(_h,{asChild:!0,trapped:s,onMountAutoFocus:Ue(o,q=>{q.preventDefault(),O.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:i.jsx(Mh,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:g,onDismiss:x,children:i.jsx(aN,{asChild:!0,...M,dir:k.dir,orientation:"vertical",loop:r,currentTabStopId:R,onCurrentTabStopIdChange:N,onEntryFocus:Ue(d,q=>{k.isUsingKeyboardRef.current||q.preventDefault()}),preventScrollOnEntryFocus:!0,children:i.jsx(XT,{role:"menu","aria-orientation":"vertical","data-state":LN(C.open),"data-radix-menu-content":"",dir:k.dir,...j,...w,ref:D,style:{outline:"none",...w.style},onKeyDown:Ue(w.onKeyDown,q=>{const A=q.target.closest("[data-radix-menu-content]")===q.currentTarget,F=q.ctrlKey||q.altKey||q.metaKey,fe=q.key.length===1;A&&(q.key==="Tab"&&q.preventDefault(),!F&&fe&&Y(q.key));const te=O.current;if(q.target!==te||!Gz.includes(q.key))return;q.preventDefault();const ge=_().filter(Z=>!Z.disabled).map(Z=>Z.ref.current);mN.includes(q.key)&&ge.reverse(),gU(ge)}),onBlur:Ue(e.onBlur,q=>{q.currentTarget.contains(q.target)||(window.clearTimeout(z.current),Q.current="")}),onPointerMove:Ue(e.onPointerMove,Vu(q=>{const he=q.target,A=W.current!==q.clientX;if(q.currentTarget.contains(he)&&A){const F=q.clientX>W.current?"right":"left";G.current=F,W.current=q.clientX}}))})})})})})})});SN.displayName=is;var aU="MenuGroup",ix=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(rt.div,{role:"group",...r,ref:t})});ix.displayName=aU;var iU="MenuLabel",CN=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(rt.div,{...r,ref:t})});CN.displayName=iU;var Bp="MenuItem",f1="menu.itemSelect",Bh=y.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,o=y.useRef(null),l=Cd(Bp,e.__scopeMenu),u=ox(Bp,e.__scopeMenu),d=Rt(t,o),f=y.useRef(!1),h=()=>{const m=o.current;if(!n&&m){const g=new CustomEvent(f1,{bubbles:!0,cancelable:!0});m.addEventListener(f1,x=>r?.(x),{once:!0}),yT(m,g),g.defaultPrevented?f.current=!1:l.onClose()}};return i.jsx(EN,{...s,ref:d,disabled:n,onClick:Ue(e.onClick,h),onPointerDown:m=>{e.onPointerDown?.(m),f.current=!0},onPointerUp:Ue(e.onPointerUp,m=>{f.current||m.currentTarget?.click()}),onKeyDown:Ue(e.onKeyDown,m=>{const g=u.searchRef.current!=="";n||g&&m.key===" "||qy.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});Bh.displayName=Bp;var EN=y.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...o}=e,l=ox(Bp,n),u=yN(n),d=y.useRef(null),f=Rt(t,d),[h,m]=y.useState(!1),[g,x]=y.useState("");return y.useEffect(()=>{const b=d.current;b&&x((b.textContent??"").trim())},[o.children]),i.jsx(Uu.ItemSlot,{scope:n,disabled:r,textValue:s??g,children:i.jsx(iN,{asChild:!0,...u,focusable:!r,children:i.jsx(rt.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:f,onPointerMove:Ue(e.onPointerMove,Vu(b=>{r?l.onItemLeave(b):(l.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ue(e.onPointerLeave,Vu(b=>l.onItemLeave(b))),onFocus:Ue(e.onFocus,()=>m(!0)),onBlur:Ue(e.onBlur,()=>m(!1))})})})}),lU="MenuCheckboxItem",kN=y.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return i.jsx(_N,{scope:e.__scopeMenu,checked:n,children:i.jsx(Bh,{role:"menuitemcheckbox","aria-checked":zp(n)?"mixed":n,...s,ref:t,"data-state":cx(n),onSelect:Ue(s.onSelect,()=>r?.(zp(n)?!0:!n),{checkForDefaultPrevented:!1})})})});kN.displayName=lU;var jN="MenuRadioGroup",[cU,uU]=$i(jN,{value:void 0,onValueChange:()=>{}}),TN=y.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,o=Rn(r);return i.jsx(cU,{scope:e.__scopeMenu,value:n,onValueChange:o,children:i.jsx(ix,{...s,ref:t})})});TN.displayName=jN;var NN="MenuRadioItem",MN=y.forwardRef((e,t)=>{const{value:n,...r}=e,s=uU(NN,e.__scopeMenu),o=n===s.value;return i.jsx(_N,{scope:e.__scopeMenu,checked:o,children:i.jsx(Bh,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":cx(o),onSelect:Ue(r.onSelect,()=>s.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});MN.displayName=NN;var lx="MenuItemIndicator",[_N,dU]=$i(lx,{checked:!1}),RN=y.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,o=dU(lx,n);return i.jsx(Mr,{present:r||zp(o.checked)||o.checked===!0,children:i.jsx(rt.span,{...s,ref:t,"data-state":cx(o.checked)})})});RN.displayName=lx;var fU="MenuSeparator",PN=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return i.jsx(rt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});PN.displayName=fU;var pU="MenuArrow",ON=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=$h(n);return i.jsx(eN,{...s,...r,ref:t})});ON.displayName=pU;var hU="MenuSub",[wie,IN]=$i(hU),mu="MenuSubTrigger",AN=y.forwardRef((e,t)=>{const n=Bi(mu,e.__scopeMenu),r=Cd(mu,e.__scopeMenu),s=IN(mu,e.__scopeMenu),o=ox(mu,e.__scopeMenu),l=y.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:d}=o,f={__scopeMenu:e.__scopeMenu},h=y.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return y.useEffect(()=>h,[h]),y.useEffect(()=>{const m=u.current;return()=>{window.clearTimeout(m),d(null)}},[u,d]),i.jsx(rx,{asChild:!0,...f,children:i.jsx(EN,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":LN(n.open),...e,ref:kh(t,s.onTriggerChange),onClick:m=>{e.onClick?.(m),!(e.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ue(e.onPointerMove,Vu(m=>{o.onItemEnter(m),!m.defaultPrevented&&!e.disabled&&!n.open&&!l.current&&(o.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),h()},100))})),onPointerLeave:Ue(e.onPointerLeave,Vu(m=>{h();const g=n.content?.getBoundingClientRect();if(g){const x=n.content?.dataset.side,b=x==="right",w=b?-5:5,C=g[b?"left":"right"],k=g[b?"right":"left"];o.onPointerGraceIntentChange({area:[{x:m.clientX+w,y:m.clientY},{x:C,y:g.top},{x:k,y:g.top},{x:k,y:g.bottom},{x:C,y:g.bottom}],side:x}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(m),m.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Ue(e.onKeyDown,m=>{const g=o.searchRef.current!=="";e.disabled||g&&m.key===" "||Jz[r.dir].includes(m.key)&&(n.onOpenChange(!0),n.content?.focus(),m.preventDefault())})})})});AN.displayName=mu;var DN="MenuSubContent",FN=y.forwardRef((e,t)=>{const n=xN(is,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=Bi(is,e.__scopeMenu),l=Cd(is,e.__scopeMenu),u=IN(DN,e.__scopeMenu),d=y.useRef(null),f=Rt(t,d);return i.jsx(Uu.Provider,{scope:e.__scopeMenu,children:i.jsx(Mr,{present:r||o.open,children:i.jsx(Uu.Slot,{scope:e.__scopeMenu,children:i.jsx(ax,{id:u.contentId,"aria-labelledby":u.triggerId,...s,ref:f,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{l.isUsingKeyboardRef.current&&d.current?.focus(),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:Ue(e.onFocusOutside,h=>{h.target!==u.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Ue(e.onEscapeKeyDown,h=>{l.onClose(),h.preventDefault()}),onKeyDown:Ue(e.onKeyDown,h=>{const m=h.currentTarget.contains(h.target),g=Qz[l.dir].includes(h.key);m&&g&&(o.onOpenChange(!1),u.trigger?.focus(),h.preventDefault())})})})})})});FN.displayName=DN;function LN(e){return e?"open":"closed"}function zp(e){return e==="indeterminate"}function cx(e){return zp(e)?"indeterminate":e?"checked":"unchecked"}function gU(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function mU(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function vU(e,t,n){const s=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=mU(e,Math.max(o,0));s.length===1&&(l=l.filter(f=>f!==n));const d=l.find(f=>f.toLowerCase().startsWith(s.toLowerCase()));return d!==n?d:void 0}function yU(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,l=t.length-1;or!=h>r&&n<(f-u)*(r-d)/(h-d)+u&&(s=!s)}return s}function bU(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return yU(n,t)}function Vu(e){return t=>t.pointerType==="mouse"?e(t):void 0}var xU=bN,wU=rx,SU=wN,CU=SN,EU=ix,kU=CN,jU=Bh,TU=kN,NU=TN,MU=MN,_U=RN,RU=PN,PU=ON,OU=AN,IU=FN,ux="DropdownMenu",[AU]=us(ux,[vN]),pr=vN(),[DU,$N]=AU(ux),dx=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:o,onOpenChange:l,modal:u=!0}=e,d=pr(t),f=y.useRef(null),[h=!1,m]=ya({prop:s,defaultProp:o,onChange:l});return i.jsx(DU,{scope:t,triggerId:Es(),triggerRef:f,contentId:Es(),open:h,onOpenChange:m,onOpenToggle:y.useCallback(()=>m(g=>!g),[m]),modal:u,children:i.jsx(xU,{...d,open:h,onOpenChange:m,dir:r,modal:u,children:n})})};dx.displayName=ux;var BN="DropdownMenuTrigger",fx=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,o=$N(BN,n),l=pr(n);return i.jsx(wU,{asChild:!0,...l,children:i.jsx(rt.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:kh(t,o.triggerRef),onPointerDown:Ue(e.onPointerDown,u=>{!r&&u.button===0&&u.ctrlKey===!1&&(o.onOpenToggle(),o.open||u.preventDefault())}),onKeyDown:Ue(e.onKeyDown,u=>{r||(["Enter"," "].includes(u.key)&&o.onOpenToggle(),u.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})});fx.displayName=BN;var FU="DropdownMenuPortal",zN=e=>{const{__scopeDropdownMenu:t,...n}=e,r=pr(t);return i.jsx(SU,{...r,...n})};zN.displayName=FU;var UN="DropdownMenuContent",VN=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=$N(UN,n),o=pr(n),l=y.useRef(!1);return i.jsx(CU,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...r,ref:t,onCloseAutoFocus:Ue(e.onCloseAutoFocus,u=>{l.current||s.triggerRef.current?.focus(),l.current=!1,u.preventDefault()}),onInteractOutside:Ue(e.onInteractOutside,u=>{const d=u.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0,h=d.button===2||f;(!s.modal||h)&&(l.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});VN.displayName=UN;var LU="DropdownMenuGroup",$U=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=pr(n);return i.jsx(EU,{...s,...r,ref:t})});$U.displayName=LU;var BU="DropdownMenuLabel",HN=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=pr(n);return i.jsx(kU,{...s,...r,ref:t})});HN.displayName=BU;var zU="DropdownMenuItem",qN=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=pr(n);return i.jsx(jU,{...s,...r,ref:t})});qN.displayName=zU;var UU="DropdownMenuCheckboxItem",KN=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=pr(n);return i.jsx(TU,{...s,...r,ref:t})});KN.displayName=UU;var VU="DropdownMenuRadioGroup",HU=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=pr(n);return i.jsx(NU,{...s,...r,ref:t})});HU.displayName=VU;var qU="DropdownMenuRadioItem",WN=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=pr(n);return i.jsx(MU,{...s,...r,ref:t})});WN.displayName=qU;var KU="DropdownMenuItemIndicator",GN=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=pr(n);return i.jsx(_U,{...s,...r,ref:t})});GN.displayName=KU;var WU="DropdownMenuSeparator",JN=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=pr(n);return i.jsx(RU,{...s,...r,ref:t})});JN.displayName=WU;var GU="DropdownMenuArrow",JU=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=pr(n);return i.jsx(PU,{...s,...r,ref:t})});JU.displayName=GU;var QU="DropdownMenuSubTrigger",QN=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=pr(n);return i.jsx(OU,{...s,...r,ref:t})});QN.displayName=QU;var ZU="DropdownMenuSubContent",ZN=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=pr(n);return i.jsx(IU,{...s,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});ZN.displayName=ZU;var YU=dx,XU=fx,e5=zN,YN=VN,XN=HN,eM=qN,tM=KN,nM=WN,rM=GN,Oa=JN,sM=QN,oM=ZN;const Kr=YU,Wr=XU,t5=y.forwardRef(({className:e,inset:t,children:n,...r},s)=>i.jsxs(sM,{ref:s,className:Ie("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,i.jsx(W$,{className:"ml-auto h-4 w-4"})]}));t5.displayName=sM.displayName;const n5=y.forwardRef(({className:e,...t},n)=>i.jsx(oM,{ref:n,className:Ie("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));n5.displayName=oM.displayName;const hr=y.forwardRef(({className:e,sideOffset:t=4,...n},r)=>i.jsx(e5,{children:i.jsx(YN,{ref:r,sideOffset:t,className:Ie("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));hr.displayName=YN.displayName;const wt=y.forwardRef(({className:e,inset:t,...n},r)=>i.jsx(eM,{ref:r,className:Ie("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));wt.displayName=eM.displayName;const aM=y.forwardRef(({className:e,children:t,checked:n,...r},s)=>i.jsxs(tM,{ref:s,className:Ie("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(rM,{children:i.jsx(fT,{className:"h-4 w-4"})})}),t]}));aM.displayName=tM.displayName;const r5=y.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(nM,{ref:r,className:Ie("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(rM,{children:i.jsx(Z$,{className:"h-2 w-2 fill-current"})})}),t]}));r5.displayName=nM.displayName;const Ao=y.forwardRef(({className:e,inset:t,...n},r)=>i.jsx(XN,{ref:r,className:Ie("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Ao.displayName=XN.displayName;const Xs=y.forwardRef(({className:e,...t},n)=>i.jsx(Oa,{ref:n,className:Ie("-mx-1 my-1 h-px bg-muted",e),...t}));Xs.displayName=Oa.displayName;function iM(){const{t:e,i18n:t}=Ve(),n=r=>{t.changeLanguage(r),localStorage.setItem("i18nextLng",r),window.location.reload()};return i.jsxs(Kr,{children:[i.jsx(Wr,{asChild:!0,children:i.jsxs(se,{variant:"outline",size:"icon",children:[i.jsx(fB,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all"}),i.jsx("span",{className:"sr-only",children:e("header.theme.label")})]})}),i.jsxs(hr,{align:"end",children:[i.jsx(wt,{className:t.language==="pt-BR"?"font-bold":"",onClick:()=>n("pt-BR"),children:e("header.language.portuguese")}),i.jsx(wt,{className:t.language==="en-US"?"font-bold":"",onClick:()=>n("en-US"),children:e("header.language.english")}),i.jsx(wt,{className:t.language==="es-ES"?"font-bold":"",onClick:()=>n("es-ES"),children:e("header.language.spanish")}),i.jsx(wt,{className:t.language==="fr-FR"?"font-bold":"",onClick:()=>n("fr-FR"),children:e("header.language.french")})]})]})}function lM(){const{t:e}=Ve(),{setTheme:t}=tc();return i.jsxs(Kr,{children:[i.jsx(Wr,{asChild:!0,children:i.jsxs(se,{variant:"outline",size:"icon",children:[i.jsx(EB,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),i.jsx(bB,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),i.jsx("span",{className:"sr-only",children:e("header.theme.label")})]})}),i.jsxs(hr,{align:"end",children:[i.jsx(wt,{onClick:()=>t("light"),children:e("header.theme.light")}),i.jsx(wt,{onClick:()=>t("dark"),children:e("header.theme.dark")}),i.jsx(wt,{onClick:()=>t("system"),children:e("header.theme.system")})]})]})}var px="Avatar",[s5]=us(px),[o5,cM]=s5(px),uM=y.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[s,o]=y.useState("idle");return i.jsx(o5,{scope:n,imageLoadingStatus:s,onImageLoadingStatusChange:o,children:i.jsx(rt.span,{...r,ref:t})})});uM.displayName=px;var dM="AvatarImage",fM=y.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:s=()=>{},...o}=e,l=cM(dM,n),u=a5(r),d=Rn(f=>{s(f),l.onImageLoadingStatusChange(f)});return Ln(()=>{u!=="idle"&&d(u)},[u,d]),u==="loaded"?i.jsx(rt.img,{...o,ref:t,src:r}):null});fM.displayName=dM;var pM="AvatarFallback",hM=y.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...s}=e,o=cM(pM,n),[l,u]=y.useState(r===void 0);return y.useEffect(()=>{if(r!==void 0){const d=window.setTimeout(()=>u(!0),r);return()=>window.clearTimeout(d)}},[r]),l&&o.imageLoadingStatus!=="loaded"?i.jsx(rt.span,{...s,ref:t}):null});hM.displayName=pM;function a5(e){const[t,n]=y.useState("idle");return Ln(()=>{if(!e){n("error");return}let r=!0;const s=new window.Image,o=l=>()=>{r&&n(l)};return n("loading"),s.onload=o("loaded"),s.onerror=o("error"),s.src=e,()=>{r=!1}},[e]),t}var gM=uM,mM=fM,vM=hM;const Ei=y.forwardRef(({className:e,...t},n)=>i.jsx(gM,{ref:n,className:Ie("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Ei.displayName=gM.displayName;const ki=y.forwardRef(({className:e,...t},n)=>i.jsx(mM,{ref:n,className:Ie("aspect-square h-full w-full",e),...t}));ki.displayName=mM.displayName;const Up=y.forwardRef(({className:e,...t},n)=>i.jsx(vM,{ref:n,className:Ie("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Up.displayName=vM.displayName;var hx="Dialog",[yM]=us(hx),[i5,Ps]=yM(hx),bM=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:l=!0}=e,u=y.useRef(null),d=y.useRef(null),[f=!1,h]=ya({prop:r,defaultProp:s,onChange:o});return i.jsx(i5,{scope:t,triggerRef:u,contentRef:d,contentId:Es(),titleId:Es(),descriptionId:Es(),open:f,onOpenChange:h,onOpenToggle:y.useCallback(()=>h(m=>!m),[h]),modal:l,children:n})};bM.displayName=hx;var xM="DialogTrigger",wM=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ps(xM,n),o=Rt(t,s.triggerRef);return i.jsx(rt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":vx(s.open),...r,ref:o,onClick:Ue(e.onClick,s.onOpenToggle)})});wM.displayName=xM;var gx="DialogPortal",[l5,SM]=yM(gx,{forceMount:void 0}),CM=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=Ps(gx,t);return i.jsx(l5,{scope:t,forceMount:n,children:y.Children.map(r,l=>i.jsx(Mr,{present:n||o.open,children:i.jsx(Ih,{asChild:!0,container:s,children:l})}))})};CM.displayName=gx;var Vp="DialogOverlay",EM=y.forwardRef((e,t)=>{const n=SM(Vp,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Ps(Vp,e.__scopeDialog);return o.modal?i.jsx(Mr,{present:r||o.open,children:i.jsx(c5,{...s,ref:t})}):null});EM.displayName=Vp;var c5=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ps(Vp,n);return i.jsx(Lh,{as:No,allowPinchZoom:!0,shards:[s.contentRef],children:i.jsx(rt.div,{"data-state":vx(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ji="DialogContent",kM=y.forwardRef((e,t)=>{const n=SM(ji,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Ps(ji,e.__scopeDialog);return i.jsx(Mr,{present:r||o.open,children:o.modal?i.jsx(u5,{...s,ref:t}):i.jsx(d5,{...s,ref:t})})});kM.displayName=ji;var u5=y.forwardRef((e,t)=>{const n=Ps(ji,e.__scopeDialog),r=y.useRef(null),s=Rt(t,n.contentRef,r);return y.useEffect(()=>{const o=r.current;if(o)return nx(o)},[]),i.jsx(jM,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ue(e.onCloseAutoFocus,o=>{o.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Ue(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&o.preventDefault()}),onFocusOutside:Ue(e.onFocusOutside,o=>o.preventDefault())})}),d5=y.forwardRef((e,t)=>{const n=Ps(ji,e.__scopeDialog),r=y.useRef(!1),s=y.useRef(!1);return i.jsx(jM,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=o.target;n.triggerRef.current?.contains(l)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),jM=y.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...l}=e,u=Ps(ji,n),d=y.useRef(null),f=Rt(t,d);return Wb(),i.jsxs(i.Fragment,{children:[i.jsx(_h,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:i.jsx(Mh,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":vx(u.open),...l,ref:f,onDismiss:()=>u.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(f5,{titleId:u.titleId}),i.jsx(h5,{contentRef:d,descriptionId:u.descriptionId})]})]})}),mx="DialogTitle",TM=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ps(mx,n);return i.jsx(rt.h2,{id:s.titleId,...r,ref:t})});TM.displayName=mx;var NM="DialogDescription",MM=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ps(NM,n);return i.jsx(rt.p,{id:s.descriptionId,...r,ref:t})});MM.displayName=NM;var _M="DialogClose",RM=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ps(_M,n);return i.jsx(rt.button,{type:"button",...r,ref:t,onClick:Ue(e.onClick,()=>s.onOpenChange(!1))})});RM.displayName=_M;function vx(e){return e?"open":"closed"}var PM="DialogTitleWarning",[Sie,OM]=_B(PM,{contentName:ji,titleName:mx,docsSlug:"dialog"}),f5=({titleId:e})=>{const t=OM(PM),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. + +If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. + +For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return y.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},p5="DialogDescriptionWarning",h5=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${OM(p5).contentName}}.`;return y.useEffect(()=>{const s=e.current?.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},g5=bM,m5=wM,v5=CM,IM=EM,AM=kM,DM=TM,FM=MM,LM=RM;const Pt=g5,Bt=m5,y5=v5,$M=LM,BM=y.forwardRef(({className:e,...t},n)=>i.jsx(IM,{ref:n,className:Ie("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));BM.displayName=IM.displayName;const Nt=y.forwardRef(({className:e,children:t,closeBtn:n=!0,...r},s)=>i.jsx(y5,{children:i.jsx(BM,{className:"fixed inset-0 grid place-items-center overflow-y-auto",children:i.jsxs(AM,{ref:s,className:Ie("relative z-50 grid w-full max-w-lg gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:m-4 sm:rounded-lg md:w-full",e),...r,children:[t,n&&i.jsxs(LM,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[i.jsx(qb,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})})}));Nt.displayName=AM.displayName;const Mt=({className:e,...t})=>i.jsx("div",{className:Ie("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Mt.displayName="DialogHeader";const Yt=({className:e,...t})=>i.jsx("div",{className:Ie("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Yt.displayName="DialogFooter";const zt=y.forwardRef(({className:e,...t},n)=>i.jsx(DM,{ref:n,className:Ie("text-lg font-semibold leading-none tracking-tight",e),...t}));zt.displayName=DM.displayName;const eo=y.forwardRef(({className:e,...t},n)=>i.jsx(FM,{ref:n,className:Ie("text-sm text-muted-foreground",e),...t}));eo.displayName=FM.displayName;function zM({instanceId:e}){const[t,n]=y.useState(!1),r=dn(),{theme:s}=tc(),o=()=>{Pj(),r("/manager/login")},l=()=>{r("/manager/")},{data:u}=vT({instanceId:e});return i.jsxs("header",{className:"flex items-center justify-between px-4 py-2",children:[i.jsx(Fu,{to:"/manager",onClick:l,className:"flex h-8 items-center gap-4",children:i.jsx("img",{src:s==="dark"?"https://evolution-api.com/files/evo/evolution-logo-white.svg":"https://evolution-api.com/files/evo/evolution-logo.svg",alt:"Logo",className:"h-full"})}),i.jsxs("div",{className:"flex items-center gap-4",children:[e&&i.jsx(Ei,{className:"h-8 w-8",children:i.jsx(ki,{src:u?.profilePicUrl||"/assets/images/evolution-logo.png",alt:u?.name})}),i.jsx(iM,{}),i.jsx(lM,{}),i.jsx(se,{onClick:()=>n(!0),variant:"destructive",size:"icon",children:i.jsx(eB,{size:"18"})})]}),t&&i.jsx(Pt,{onOpenChange:n,open:t,children:i.jsxs(Nt,{children:[i.jsx($M,{}),i.jsx(Mt,{children:"Deseja realmente sair?"}),i.jsx(Yt,{children:i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx(se,{onClick:()=>n(!1),size:"sm",variant:"outline",children:"Cancelar"}),i.jsx(se,{onClick:o,variant:"destructive",children:"Sair"})]})})]})})]})}const UM=y.createContext(null),ct=()=>{const e=y.useContext(UM);if(!e)throw new Error("useInstance must be used within an InstanceProvider");return e},VM=({children:e})=>{const t=ls(),[n,r]=y.useState(null),{data:s,refetch:o}=vT({instanceId:n});return y.useEffect(()=>{t.instanceId?r(t.instanceId):r(null)},[t]),i.jsx(UM.Provider,{value:{instance:s??null,reloadInstance:async()=>{await o()}},children:e})};var yx="Collapsible",[b5]=us(yx),[x5,bx]=b5(yx),HM=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:o,onOpenChange:l,...u}=e,[d=!1,f]=ya({prop:r,defaultProp:s,onChange:l});return i.jsx(x5,{scope:n,disabled:o,contentId:Es(),open:d,onOpenToggle:y.useCallback(()=>f(h=>!h),[f]),children:i.jsx(rt.div,{"data-state":wx(d),"data-disabled":o?"":void 0,...u,ref:t})})});HM.displayName=yx;var qM="CollapsibleTrigger",KM=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=bx(qM,n);return i.jsx(rt.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":wx(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:Ue(e.onClick,s.onOpenToggle)})});KM.displayName=qM;var xx="CollapsibleContent",WM=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=bx(xx,e.__scopeCollapsible);return i.jsx(Mr,{present:n||s.open,children:({present:o})=>i.jsx(w5,{...r,ref:t,present:o})})});WM.displayName=xx;var w5=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...o}=e,l=bx(xx,n),[u,d]=y.useState(r),f=y.useRef(null),h=Rt(t,f),m=y.useRef(0),g=m.current,x=y.useRef(0),b=x.current,w=l.open||u,C=y.useRef(w),k=y.useRef();return y.useEffect(()=>{const j=requestAnimationFrame(()=>C.current=!1);return()=>cancelAnimationFrame(j)},[]),Ln(()=>{const j=f.current;if(j){k.current=k.current||{transitionDuration:j.style.transitionDuration,animationName:j.style.animationName},j.style.transitionDuration="0s",j.style.animationName="none";const M=j.getBoundingClientRect();m.current=M.height,x.current=M.width,C.current||(j.style.transitionDuration=k.current.transitionDuration,j.style.animationName=k.current.animationName),d(r)}},[l.open,r]),i.jsx(rt.div,{"data-state":wx(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!w,...o,ref:h,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:w&&s})});function wx(e){return e?"open":"closed"}var S5=HM;const C5=S5,E5=KM,k5=WM;function j5(){const{t:e}=Ve(),t=y.useMemo(()=>[{id:"dashboard",title:e("sidebar.dashboard"),icon:pB,path:"dashboard"},{id:"chat",title:e("sidebar.chat"),icon:Bl,path:"chat"},{navLabel:!0,title:e("sidebar.configurations"),icon:Oo,children:[{id:"settings",title:e("sidebar.settings"),path:"settings"},{id:"proxy",title:e("sidebar.proxy"),path:"proxy"}]},{title:e("sidebar.events"),icon:dB,children:[{id:"webhook",title:e("sidebar.webhook"),path:"webhook"},{id:"websocket",title:e("sidebar.websocket"),path:"websocket"},{id:"rabbitmq",title:e("sidebar.rabbitmq"),path:"rabbitmq"},{id:"sqs",title:e("sidebar.sqs"),path:"sqs"}]},{title:e("sidebar.integrations"),icon:mT,children:[{id:"evoai",title:e("sidebar.evoai"),path:"evoai"},{id:"n8n",title:e("sidebar.n8n"),path:"n8n"},{id:"evolutionBot",title:e("sidebar.evolutionBot"),path:"evolutionBot"},{id:"chatwoot",title:e("sidebar.chatwoot"),path:"chatwoot"},{id:"typebot",title:e("sidebar.typebot"),path:"typebot"},{id:"openai",title:e("sidebar.openai"),path:"openai"},{id:"dify",title:e("sidebar.dify"),path:"dify"},{id:"flowise",title:e("sidebar.flowise"),path:"flowise"}]},{id:"documentation",title:e("sidebar.documentation"),icon:sB,link:"https://doc.evolution-api.com",divider:!0},{id:"postman",title:e("sidebar.postman"),icon:Q$,link:"https://evolution-api.com/postman"},{id:"discord",title:e("sidebar.discord"),icon:Bl,link:"https://evolution-api.com/discord"},{id:"support-premium",title:e("sidebar.supportPremium"),icon:hB,link:"https://evolution-api.com/suporte-pro"}],[e]),n=dn(),{pathname:r}=Pi(),{instance:s}=ct(),o=u=>{!u||!s||(u.path&&n(`/manager/instance/${s.id}/${u.path}`),u.link&&window.open(u.link,"_blank"))},l=y.useMemo(()=>t.map(u=>({...u,children:"children"in u?u.children?.map(d=>({...d,isActive:"path"in d?r.includes(d.path):!1})):void 0,isActive:"path"in u&&u.path?r.includes(u.path):!1})).map(u=>({...u,isActive:u.isActive||"children"in u&&u.children?.some(d=>d.isActive)})),[t,r]);return i.jsx("ul",{className:"flex h-full w-full flex-col gap-2 border-r border-border px-2",children:l.map(u=>i.jsx("li",{className:"divider"in u?"mt-auto":void 0,children:u.children?i.jsxs(C5,{defaultOpen:u.isActive,children:[i.jsx(E5,{asChild:!0,children:i.jsxs(se,{className:Ie("flex w-full items-center justify-start gap-2"),variant:u.isActive?"secondary":"link",children:[u.icon&&i.jsx(u.icon,{size:"15"}),i.jsx("span",{children:u.title}),i.jsx(Nh,{size:"15",className:"ml-auto"})]})}),i.jsx(k5,{children:i.jsx("ul",{className:"my-4 ml-6 flex flex-col gap-2 text-sm",children:u.children.map(d=>i.jsx("li",{children:i.jsx("button",{onClick:()=>o(d),className:Ie(d.isActive?"text-foreground":"text-muted-foreground"),children:i.jsx("span",{className:"nav-label",children:d.title})})},d.id))})})]}):i.jsxs(se,{className:Ie("relative flex w-full items-center justify-start gap-2",u.isActive&&"pointer-events-none"),variant:u.isActive?"secondary":"link",children:["link"in u&&i.jsx("a",{href:u.link,target:"_blank",rel:"noreferrer",className:"absolute inset-0 h-full w-full"}),"path"in u&&i.jsx(Fu,{to:`/manager/instance/${s?.id}/${u.path}`,className:"absolute inset-0 h-full w-full"}),u.icon&&i.jsx(u.icon,{size:"15"}),i.jsx("span",{children:u.title})]})},u.title))})}function Ky(e,[t,n]){return Math.min(n,Math.max(t,e))}function T5(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var Sx="ScrollArea",[GM]=us(Sx),[N5,ds]=GM(Sx),JM=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:o=600,...l}=e,[u,d]=y.useState(null),[f,h]=y.useState(null),[m,g]=y.useState(null),[x,b]=y.useState(null),[w,C]=y.useState(null),[k,j]=y.useState(0),[M,_]=y.useState(0),[R,N]=y.useState(!1),[O,D]=y.useState(!1),z=Rt(t,pe=>d(pe)),Q=xd(s);return i.jsx(N5,{scope:n,type:r,dir:Q,scrollHideDelay:o,scrollArea:u,viewport:f,onViewportChange:h,content:m,onContentChange:g,scrollbarX:x,onScrollbarXChange:b,scrollbarXEnabled:R,onScrollbarXEnabledChange:N,scrollbarY:w,onScrollbarYChange:C,scrollbarYEnabled:O,onScrollbarYEnabledChange:D,onCornerWidthChange:j,onCornerHeightChange:_,children:i.jsx(rt.div,{dir:Q,...l,ref:z,style:{position:"relative","--radix-scroll-area-corner-width":k+"px","--radix-scroll-area-corner-height":M+"px",...e.style}})})});JM.displayName=Sx;var QM="ScrollAreaViewport",ZM=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:s,...o}=e,l=ds(QM,n),u=y.useRef(null),d=Rt(t,u,l.onViewportChange);return i.jsxs(i.Fragment,{children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),i.jsx(rt.div,{"data-radix-scroll-area-viewport":"",...o,ref:d,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...e.style},children:i.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});ZM.displayName=QM;var to="ScrollAreaScrollbar",Cx=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=ds(to,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:l}=s,u=e.orientation==="horizontal";return y.useEffect(()=>(u?o(!0):l(!0),()=>{u?o(!1):l(!1)}),[u,o,l]),s.type==="hover"?i.jsx(M5,{...r,ref:t,forceMount:n}):s.type==="scroll"?i.jsx(_5,{...r,ref:t,forceMount:n}):s.type==="auto"?i.jsx(YM,{...r,ref:t,forceMount:n}):s.type==="always"?i.jsx(Ex,{...r,ref:t}):null});Cx.displayName=to;var M5=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=ds(to,e.__scopeScrollArea),[o,l]=y.useState(!1);return y.useEffect(()=>{const u=s.scrollArea;let d=0;if(u){const f=()=>{window.clearTimeout(d),l(!0)},h=()=>{d=window.setTimeout(()=>l(!1),s.scrollHideDelay)};return u.addEventListener("pointerenter",f),u.addEventListener("pointerleave",h),()=>{window.clearTimeout(d),u.removeEventListener("pointerenter",f),u.removeEventListener("pointerleave",h)}}},[s.scrollArea,s.scrollHideDelay]),i.jsx(Mr,{present:n||o,children:i.jsx(YM,{"data-state":o?"visible":"hidden",...r,ref:t})})}),_5=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=ds(to,e.__scopeScrollArea),o=e.orientation==="horizontal",l=Uh(()=>d("SCROLL_END"),100),[u,d]=T5("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return y.useEffect(()=>{if(u==="idle"){const f=window.setTimeout(()=>d("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(f)}},[u,s.scrollHideDelay,d]),y.useEffect(()=>{const f=s.viewport,h=o?"scrollLeft":"scrollTop";if(f){let m=f[h];const g=()=>{const x=f[h];m!==x&&(d("SCROLL"),l()),m=x};return f.addEventListener("scroll",g),()=>f.removeEventListener("scroll",g)}},[s.viewport,o,d,l]),i.jsx(Mr,{present:n||u!=="hidden",children:i.jsx(Ex,{"data-state":u==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ue(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:Ue(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),YM=y.forwardRef((e,t)=>{const n=ds(to,e.__scopeScrollArea),{forceMount:r,...s}=e,[o,l]=y.useState(!1),u=e.orientation==="horizontal",d=Uh(()=>{if(n.viewport){const f=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,s=ds(to,e.__scopeScrollArea),o=y.useRef(null),l=y.useRef(0),[u,d]=y.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=r_(u.viewport,u.content),h={...r,sizes:u,onSizesChange:d,hasThumb:f>0&&f<1,onThumbChange:g=>o.current=g,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:g=>l.current=g};function m(g,x){return D5(g,l.current,u,x)}return n==="horizontal"?i.jsx(R5,{...h,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const g=s.viewport.scrollLeft,x=p1(g,u,s.dir);o.current.style.transform=`translate3d(${x}px, 0, 0)`}},onWheelScroll:g=>{s.viewport&&(s.viewport.scrollLeft=g)},onDragScroll:g=>{s.viewport&&(s.viewport.scrollLeft=m(g,s.dir))}}):n==="vertical"?i.jsx(P5,{...h,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const g=s.viewport.scrollTop,x=p1(g,u);o.current.style.transform=`translate3d(0, ${x}px, 0)`}},onWheelScroll:g=>{s.viewport&&(s.viewport.scrollTop=g)},onDragScroll:g=>{s.viewport&&(s.viewport.scrollTop=m(g))}}):null}),R5=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,o=ds(to,e.__scopeScrollArea),[l,u]=y.useState(),d=y.useRef(null),f=Rt(t,d,o.onScrollbarXChange);return y.useEffect(()=>{d.current&&u(getComputedStyle(d.current))},[d]),i.jsx(e_,{"data-orientation":"horizontal",...s,ref:f,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":zh(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,m)=>{if(o.viewport){const g=o.viewport.scrollLeft+h.deltaX;e.onWheelScroll(g),o_(g,m)&&h.preventDefault()}},onResize:()=>{d.current&&o.viewport&&l&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:qp(l.paddingLeft),paddingEnd:qp(l.paddingRight)}})}})}),P5=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,o=ds(to,e.__scopeScrollArea),[l,u]=y.useState(),d=y.useRef(null),f=Rt(t,d,o.onScrollbarYChange);return y.useEffect(()=>{d.current&&u(getComputedStyle(d.current))},[d]),i.jsx(e_,{"data-orientation":"vertical",...s,ref:f,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":zh(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,m)=>{if(o.viewport){const g=o.viewport.scrollTop+h.deltaY;e.onWheelScroll(g),o_(g,m)&&h.preventDefault()}},onResize:()=>{d.current&&o.viewport&&l&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:qp(l.paddingTop),paddingEnd:qp(l.paddingBottom)}})}})}),[O5,XM]=GM(to),e_=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:o,onThumbPointerUp:l,onThumbPointerDown:u,onThumbPositionChange:d,onDragScroll:f,onWheelScroll:h,onResize:m,...g}=e,x=ds(to,n),[b,w]=y.useState(null),C=Rt(t,z=>w(z)),k=y.useRef(null),j=y.useRef(""),M=x.viewport,_=r.content-r.viewport,R=Rn(h),N=Rn(d),O=Uh(m,10);function D(z){if(k.current){const Q=z.clientX-k.current.left,pe=z.clientY-k.current.top;f({x:Q,y:pe})}}return y.useEffect(()=>{const z=Q=>{const pe=Q.target;b?.contains(pe)&&R(Q,_)};return document.addEventListener("wheel",z,{passive:!1}),()=>document.removeEventListener("wheel",z,{passive:!1})},[M,b,_,R]),y.useEffect(N,[r,N]),Ul(b,O),Ul(x.content,O),i.jsx(O5,{scope:n,scrollbar:b,hasThumb:s,onThumbChange:Rn(o),onThumbPointerUp:Rn(l),onThumbPositionChange:N,onThumbPointerDown:Rn(u),children:i.jsx(rt.div,{...g,ref:C,style:{position:"absolute",...g.style},onPointerDown:Ue(e.onPointerDown,z=>{z.button===0&&(z.target.setPointerCapture(z.pointerId),k.current=b.getBoundingClientRect(),j.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",x.viewport&&(x.viewport.style.scrollBehavior="auto"),D(z))}),onPointerMove:Ue(e.onPointerMove,D),onPointerUp:Ue(e.onPointerUp,z=>{const Q=z.target;Q.hasPointerCapture(z.pointerId)&&Q.releasePointerCapture(z.pointerId),document.body.style.webkitUserSelect=j.current,x.viewport&&(x.viewport.style.scrollBehavior=""),k.current=null})})})}),Hp="ScrollAreaThumb",t_=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=XM(Hp,e.__scopeScrollArea);return i.jsx(Mr,{present:n||s.hasThumb,children:i.jsx(I5,{ref:t,...r})})}),I5=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...s}=e,o=ds(Hp,n),l=XM(Hp,n),{onThumbPositionChange:u}=l,d=Rt(t,m=>l.onThumbChange(m)),f=y.useRef(),h=Uh(()=>{f.current&&(f.current(),f.current=void 0)},100);return y.useEffect(()=>{const m=o.viewport;if(m){const g=()=>{if(h(),!f.current){const x=F5(m,u);f.current=x,u()}};return u(),m.addEventListener("scroll",g),()=>m.removeEventListener("scroll",g)}},[o.viewport,h,u]),i.jsx(rt.div,{"data-state":l.hasThumb?"visible":"hidden",...s,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Ue(e.onPointerDownCapture,m=>{const x=m.target.getBoundingClientRect(),b=m.clientX-x.left,w=m.clientY-x.top;l.onThumbPointerDown({x:b,y:w})}),onPointerUp:Ue(e.onPointerUp,l.onThumbPointerUp)})});t_.displayName=Hp;var kx="ScrollAreaCorner",n_=y.forwardRef((e,t)=>{const n=ds(kx,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?i.jsx(A5,{...e,ref:t}):null});n_.displayName=kx;var A5=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,s=ds(kx,n),[o,l]=y.useState(0),[u,d]=y.useState(0),f=!!(o&&u);return Ul(s.scrollbarX,()=>{const h=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(h),d(h)}),Ul(s.scrollbarY,()=>{const h=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(h),l(h)}),f?i.jsx(rt.div,{...r,ref:t,style:{width:o,height:u,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function qp(e){return e?parseInt(e,10):0}function r_(e,t){const n=e/t;return isNaN(n)?0:n}function zh(e){const t=r_(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function D5(e,t,n,r="ltr"){const s=zh(n),o=s/2,l=t||o,u=s-l,d=n.scrollbar.paddingStart+l,f=n.scrollbar.size-n.scrollbar.paddingEnd-u,h=n.content-n.viewport,m=r==="ltr"?[0,h]:[h*-1,0];return s_([d,f],m)(e)}function p1(e,t,n="ltr"){const r=zh(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-s,l=t.content-t.viewport,u=o-r,d=n==="ltr"?[0,l]:[l*-1,0],f=Ky(e,d);return s_([0,l],[0,u])(f)}function s_(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function o_(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function s(){const o={left:e.scrollLeft,top:e.scrollTop},l=n.left!==o.left,u=n.top!==o.top;(l||u)&&t(),n=o,r=window.requestAnimationFrame(s)})(),()=>window.cancelAnimationFrame(r)};function Uh(e,t){const n=Rn(e),r=y.useRef(0);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),y.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Ul(e,t){const n=Rn(t);Ln(()=>{let r=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(e),()=>{window.cancelAnimationFrame(r),s.unobserve(e)}}},[e,n])}var a_=JM,L5=ZM,$5=n_;const Wy=y.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(a_,{ref:r,className:Ie("relative overflow-hidden",e),...n,children:[i.jsx(L5,{className:"h-full w-full rounded-[inherit] [&>div[style]]:!block [&>div[style]]:h-full",children:t}),i.jsx(i_,{}),i.jsx($5,{})]}));Wy.displayName=a_.displayName;const i_=y.forwardRef(({className:e,orientation:t="vertical",...n},r)=>i.jsx(Cx,{ref:r,orientation:t,className:Ie("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 border-t border-t-transparent p-[1px]",e),...n,children:i.jsx(t_,{className:Ie("relative rounded-full bg-border",t==="vertical"&&"flex-1")})}));i_.displayName=Cx.displayName;function un({children:e}){const{instanceId:t}=ls();return i.jsx(VM,{children:i.jsxs("div",{className:"flex h-screen flex-col",children:[i.jsx(zM,{instanceId:t}),i.jsxs("div",{className:"flex min-h-[calc(100vh_-_56px)] flex-1 flex-col md:flex-row",children:[i.jsx(Wy,{className:"mr-2 py-6 md:w-64",children:i.jsx("div",{className:"flex h-full",children:i.jsx(j5,{})})}),i.jsx(Wy,{className:"w-full",children:i.jsxs("div",{className:"flex h-full flex-col",children:[i.jsx("div",{className:"my-2 flex flex-1 flex-col gap-2 pl-2 pr-4",children:e}),i.jsx(Vb,{})]})})]})]})})}function B5({children:e}){return i.jsxs("div",{className:"flex h-full min-h-screen flex-col",children:[i.jsx(zM,{}),i.jsx("main",{className:"flex-1",children:e}),i.jsx(Vb,{})]})}const z5=jh("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground",warning:"border-transparent bg-amber-600 text-amber-100 hover:bg-amber-600/80"}},defaultVariants:{variant:"default"}});function vu({className:e,variant:t,...n}){return i.jsx("div",{className:Ie(z5({variant:t}),e),...n})}function l_({status:e}){const{t}=Ve();return e?e==="open"?i.jsx(vu,{children:t("status.open")}):e==="connecting"?i.jsx(vu,{variant:"warning",children:t("status.connecting")}):e==="close"||e==="closed"?i.jsx(vu,{variant:"destructive",children:t("status.closed")}):i.jsx(vu,{variant:"secondary",children:e}):null}const U5=e=>{navigator.clipboard.writeText(e),me.success("Copiado para a área de transferência")};function c_({token:e,className:t}){const[n,r]=y.useState(!1);return i.jsxs("div",{className:Ie("flex items-center gap-3 truncate rounded-sm bg-primary/20 px-2 py-1",t),children:[i.jsx("pre",{className:"block truncate text-xs",children:n?e:e?.replace(/\w/g,"*")}),i.jsx(se,{variant:"ghost",size:"icon",onClick:()=>{U5(e)},children:i.jsx(X$,{size:"15"})}),i.jsx(se,{variant:"ghost",size:"icon",onClick:()=>{r(s=>!s)},children:n?i.jsx(tB,{size:"15"}):i.jsx(nB,{size:"15"})})]})}const So=y.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:Ie("flex flex-col rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));So.displayName="Card";const Co=y.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:Ie("flex flex-col space-y-1.5 p-6",e),...t}));Co.displayName="CardHeader";const gi=y.forwardRef(({className:e,...t},n)=>i.jsx("h3",{ref:n,className:Ie("text-2xl font-semibold leading-none tracking-tight",e),...t}));gi.displayName="CardTitle";const Kp=y.forwardRef(({className:e,...t},n)=>i.jsx("p",{ref:n,className:Ie("text-sm text-muted-foreground",e),...t}));Kp.displayName="CardDescription";const Eo=y.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:Ie("p-6 pt-0",e),...t}));Eo.displayName="CardContent";const Vh=y.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:Ie("flex items-center p-6 pt-0",e),...t}));Vh.displayName="CardFooter";const u_="flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",ne=y.forwardRef(({className:e,type:t,...n},r)=>i.jsx("input",{type:t,className:Ie(u_,e),ref:r,...n}));ne.displayName="Input";const V5=["instance","fetchInstances"],H5=async()=>(await bd.get("/instance/fetchInstances")).data,q5=e=>mt({...e,queryKey:V5,queryFn:()=>H5()});function nt(e,t){const n=Ob(),r=cF({mutationFn:e});return(s,o)=>r.mutateAsync(s,{onSuccess:async(l,u,d)=>{t?.invalidateKeys&&await Promise.all(t.invalidateKeys.map(f=>n.invalidateQueries({queryKey:f}))),o?.onSuccess?.(l,u,d)},onError(l,u,d){o?.onError?.(l,u,d)},onSettled(l,u,d,f){o?.onSettled?.(l,u,d,f)}})}const K5=async e=>(await bd.post("/instance/create",e)).data,W5=async e=>(await Ee.post(`/instance/restart/${e}`)).data,G5=async e=>(await Ee.delete(`/instance/logout/${e}`)).data,J5=async e=>(await bd.delete(`/instance/delete/${e}`)).data,Q5=async({instanceName:e,token:t,number:n})=>(await Ee.get(`/instance/connect/${e}`,{headers:{apikey:t},params:{number:n}})).data,Z5=async({instanceName:e,token:t,data:n})=>(await Ee.post(`/settings/set/${e}`,n,{headers:{apikey:t}})).data;function Hh(){const e=nt(Q5,{invalidateKeys:[["instance","fetchInstance"],["instance","fetchInstances"]]}),t=nt(Z5,{invalidateKeys:[["instance","fetchSettings"]]}),n=nt(J5,{invalidateKeys:[["instance","fetchInstance"],["instance","fetchInstances"]]}),r=nt(G5,{invalidateKeys:[["instance","fetchInstance"],["instance","fetchInstances"]]}),s=nt(W5,{invalidateKeys:[["instance","fetchInstance"],["instance","fetchInstances"]]}),o=nt(K5,{invalidateKeys:[["instance","fetchInstances"]]});return{connect:e,updateSettings:t,deleteInstance:n,logout:r,restart:s,createInstance:o}}var Ed=e=>e.type==="checkbox",Tl=e=>e instanceof Date,cr=e=>e==null;const d_=e=>typeof e=="object";var $n=e=>!cr(e)&&!Array.isArray(e)&&d_(e)&&!Tl(e),f_=e=>$n(e)&&e.target?Ed(e.target)?e.target.checked:e.target.value:e,Y5=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,p_=(e,t)=>e.has(Y5(t)),X5=e=>{const t=e.constructor&&e.constructor.prototype;return $n(t)&&t.hasOwnProperty("isPrototypeOf")},jx=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Er(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(jx&&(e instanceof Blob||e instanceof FileList))&&(n||$n(e)))if(t=n?[]:{},!n&&!X5(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=Er(e[r]));else return e;return t}var qh=e=>Array.isArray(e)?e.filter(Boolean):[],wn=e=>e===void 0,_e=(e,t,n)=>{if(!t||!$n(e))return n;const r=qh(t.split(/[,[\].]+?/)).reduce((s,o)=>cr(s)?s:s[o],e);return wn(r)||r===e?wn(e[t])?n:e[t]:r},Us=e=>typeof e=="boolean",Tx=e=>/^\w*$/.test(e),h_=e=>qh(e.replace(/["|']|\]/g,"").split(/\.|\[/)),qt=(e,t,n)=>{let r=-1;const s=Tx(t)?[t]:h_(t),o=s.length,l=o-1;for(;++rqe.useContext(g_),Gn=e=>{const{children:t,...n}=e;return qe.createElement(g_.Provider,{value:n},t)};var m_=(e,t,n,r=!0)=>{const s={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(s,o,{get:()=>{const l=o;return t._proxyFormState[l]!==Ss.all&&(t._proxyFormState[l]=!r||Ss.all),n&&(n[l]=!0),e[l]}});return s},Lr=e=>$n(e)&&!Object.keys(e).length,v_=(e,t,n,r)=>{n(e);const{name:s,...o}=e;return Lr(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(l=>t[l]===(!r||Ss.all))},ju=e=>Array.isArray(e)?e:[e],y_=(e,t,n)=>!e||!t||e===t||ju(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function Nx(e){const t=qe.useRef(e);t.current=e,qe.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function e6(e){const t=Kh(),{control:n=t.control,disabled:r,name:s,exact:o}=e||{},[l,u]=qe.useState(n._formState),d=qe.useRef(!0),f=qe.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),h=qe.useRef(s);return h.current=s,Nx({disabled:r,next:m=>d.current&&y_(h.current,m.name,o)&&v_(m,f.current,n._updateFormState)&&u({...n._formState,...m}),subject:n._subjects.state}),qe.useEffect(()=>(d.current=!0,f.current.isValid&&n._updateValid(!0),()=>{d.current=!1}),[n]),m_(l,n,f.current,!1)}var qs=e=>typeof e=="string",b_=(e,t,n,r,s)=>qs(e)?(r&&t.watch.add(e),_e(n,e,s)):Array.isArray(e)?e.map(o=>(r&&t.watch.add(o),_e(n,o))):(r&&(t.watchAll=!0),n);function t6(e){const t=Kh(),{control:n=t.control,name:r,defaultValue:s,disabled:o,exact:l}=e||{},u=qe.useRef(r);u.current=r,Nx({disabled:o,subject:n._subjects.values,next:h=>{y_(u.current,h.name,l)&&f(Er(b_(u.current,n._names,h.values||n._formValues,!1,s)))}});const[d,f]=qe.useState(n._getWatch(r,s));return qe.useEffect(()=>n._removeUnmounted()),d}function n6(e){const t=Kh(),{name:n,disabled:r,control:s=t.control,shouldUnregister:o}=e,l=p_(s._names.array,n),u=t6({control:s,name:n,defaultValue:_e(s._formValues,n,_e(s._defaultValues,n,e.defaultValue)),exact:!0}),d=e6({control:s,name:n}),f=qe.useRef(s.register(n,{...e.rules,value:u,...Us(e.disabled)?{disabled:e.disabled}:{}}));return qe.useEffect(()=>{const h=s._options.shouldUnregister||o,m=(g,x)=>{const b=_e(s._fields,g);b&&b._f&&(b._f.mount=x)};if(m(n,!0),h){const g=Er(_e(s._options.defaultValues,n));qt(s._defaultValues,n,g),wn(_e(s._formValues,n))&&qt(s._formValues,n,g)}return()=>{(l?h&&!s._state.action:h)?s.unregister(n):m(n,!1)}},[n,s,l,o]),qe.useEffect(()=>{_e(s._fields,n)&&s._updateDisabledField({disabled:r,fields:s._fields,name:n,value:_e(s._fields,n)._f.value})},[r,n,s]),{field:{name:n,value:u,...Us(r)||d.disabled?{disabled:d.disabled||r}:{},onChange:qe.useCallback(h=>f.current.onChange({target:{value:f_(h),name:n},type:Wp.CHANGE}),[n]),onBlur:qe.useCallback(()=>f.current.onBlur({target:{value:_e(s._formValues,n),name:n},type:Wp.BLUR}),[n,s]),ref:h=>{const m=_e(s._fields,n);m&&h&&(m._f.ref={focus:()=>h.focus(),select:()=>h.select(),setCustomValidity:g=>h.setCustomValidity(g),reportValidity:()=>h.reportValidity()})}},formState:d,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!_e(d.errors,n)},isDirty:{enumerable:!0,get:()=>!!_e(d.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!_e(d.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!_e(d.validatingFields,n)},error:{enumerable:!0,get:()=>_e(d.errors,n)}})}}const r6=e=>e.render(n6(e));var x_=(e,t,n,r,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:s||!0}}:{},h1=e=>({isOnSubmit:!e||e===Ss.onSubmit,isOnBlur:e===Ss.onBlur,isOnChange:e===Ss.onChange,isOnAll:e===Ss.all,isOnTouch:e===Ss.onTouched}),g1=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Tu=(e,t,n,r)=>{for(const s of n||Object.keys(e)){const o=_e(e,s);if(o){const{_f:l,...u}=o;if(l){if(l.refs&&l.refs[0]&&t(l.refs[0],s)&&!r)break;if(l.ref&&t(l.ref,l.name)&&!r)break;Tu(u,t)}else $n(u)&&Tu(u,t)}}};var s6=(e,t,n)=>{const r=ju(_e(e,n));return qt(r,"root",t[n]),qt(e,n,r),e},Mx=e=>e.type==="file",ga=e=>typeof e=="function",Gp=e=>{if(!jx)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},vp=e=>qs(e),_x=e=>e.type==="radio",Jp=e=>e instanceof RegExp;const m1={value:!1,isValid:!1},v1={value:!0,isValid:!0};var w_=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!wn(e[0].attributes.value)?wn(e[0].value)||e[0].value===""?v1:{value:e[0].value,isValid:!0}:v1:m1}return m1};const y1={isValid:!1,value:null};var S_=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,y1):y1;function b1(e,t,n="validate"){if(vp(e)||Array.isArray(e)&&e.every(vp)||Us(e)&&!e)return{type:n,message:vp(e)?e:"",ref:t}}var ml=e=>$n(e)&&!Jp(e)?e:{value:e,message:""},x1=async(e,t,n,r,s)=>{const{ref:o,refs:l,required:u,maxLength:d,minLength:f,min:h,max:m,pattern:g,validate:x,name:b,valueAsNumber:w,mount:C,disabled:k}=e._f,j=_e(t,b);if(!C||k)return{};const M=l?l[0]:o,_=V=>{r&&M.reportValidity&&(M.setCustomValidity(Us(V)?"":V||""),M.reportValidity())},R={},N=_x(o),O=Ed(o),D=N||O,z=(w||Mx(o))&&wn(o.value)&&wn(j)||Gp(o)&&o.value===""||j===""||Array.isArray(j)&&!j.length,Q=x_.bind(null,b,n,R),pe=(V,G,W,ie=go.maxLength,re=go.minLength)=>{const Y=V?G:W;R[b]={type:V?ie:re,message:Y,ref:o,...Q(V?ie:re,Y)}};if(s?!Array.isArray(j)||!j.length:u&&(!D&&(z||cr(j))||Us(j)&&!j||O&&!w_(l).isValid||N&&!S_(l).isValid)){const{value:V,message:G}=vp(u)?{value:!!u,message:u}:ml(u);if(V&&(R[b]={type:go.required,message:G,ref:M,...Q(go.required,G)},!n))return _(G),R}if(!z&&(!cr(h)||!cr(m))){let V,G;const W=ml(m),ie=ml(h);if(!cr(j)&&!isNaN(j)){const re=o.valueAsNumber||j&&+j;cr(W.value)||(V=re>W.value),cr(ie.value)||(G=renew Date(new Date().toDateString()+" "+he),H=o.type=="time",q=o.type=="week";qs(W.value)&&j&&(V=H?Y(j)>Y(W.value):q?j>W.value:re>new Date(W.value)),qs(ie.value)&&j&&(G=H?Y(j)+V.value,ie=!cr(G.value)&&j.length<+G.value;if((W||ie)&&(pe(W,V.message,G.message),!n))return _(R[b].message),R}if(g&&!z&&qs(j)){const{value:V,message:G}=ml(g);if(Jp(V)&&!j.match(V)&&(R[b]={type:go.pattern,message:G,ref:o,...Q(go.pattern,G)},!n))return _(G),R}if(x){if(ga(x)){const V=await x(j,t),G=b1(V,M);if(G&&(R[b]={...G,...Q(go.validate,G.message)},!n))return _(G.message),R}else if($n(x)){let V={};for(const G in x){if(!Lr(V)&&!n)break;const W=b1(await x[G](j,t),M,G);W&&(V={...W,...Q(G,W.message)},_(W.message),n&&(R[b]=V))}if(!Lr(V)&&(R[b]={ref:M,...V},!n))return R}}return _(!0),R};function o6(e,t){const n=t.slice(0,-1).length;let r=0;for(;r{let e=[];return{get observers(){return e},next:s=>{for(const o of e)o.next&&o.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(o=>o!==s)}}),unsubscribe:()=>{e=[]}}},Qp=e=>cr(e)||!d_(e);function ui(e,t){if(Qp(e)||Qp(t))return e===t;if(Tl(e)&&Tl(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const s of n){const o=e[s];if(!r.includes(s))return!1;if(s!=="ref"){const l=t[s];if(Tl(o)&&Tl(l)||$n(o)&&$n(l)||Array.isArray(o)&&Array.isArray(l)?!ui(o,l):o!==l)return!1}}return!0}var C_=e=>e.type==="select-multiple",i6=e=>_x(e)||Ed(e),_v=e=>Gp(e)&&e.isConnected,E_=e=>{for(const t in e)if(ga(e[t]))return!0;return!1};function Zp(e,t={}){const n=Array.isArray(e);if($n(e)||n)for(const r in e)Array.isArray(e[r])||$n(e[r])&&!E_(e[r])?(t[r]=Array.isArray(e[r])?[]:{},Zp(e[r],t[r])):cr(e[r])||(t[r]=!0);return t}function k_(e,t,n){const r=Array.isArray(e);if($n(e)||r)for(const s in e)Array.isArray(e[s])||$n(e[s])&&!E_(e[s])?wn(t)||Qp(n[s])?n[s]=Array.isArray(e[s])?Zp(e[s],[]):{...Zp(e[s])}:k_(e[s],cr(t)?{}:t[s],n[s]):n[s]=!ui(e[s],t[s]);return n}var Gf=(e,t)=>k_(e,t,Zp(t)),j_=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>wn(e)?e:t?e===""?NaN:e&&+e:n&&qs(e)?new Date(e):r?r(e):e;function Rv(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return Mx(t)?t.files:_x(t)?S_(e.refs).value:C_(t)?[...t.selectedOptions].map(({value:n})=>n):Ed(t)?w_(e.refs).value:j_(wn(t.value)?e.ref.value:t.value,e)}var l6=(e,t,n,r)=>{const s={};for(const o of e){const l=_e(t,o);l&&qt(s,o,l._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:r}},au=e=>wn(e)?e:Jp(e)?e.source:$n(e)?Jp(e.value)?e.value.source:e.value:e,c6=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function w1(e,t,n){const r=_e(e,n);if(r||Tx(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const o=s.join("."),l=_e(t,o),u=_e(e,o);if(l&&!Array.isArray(l)&&n!==o)return{name:n};if(u&&u.type)return{name:o,error:u};s.pop()}return{name:n}}var u6=(e,t,n,r,s)=>s.isOnAll?!1:!n&&s.isOnTouch?!(t||e):(n?r.isOnBlur:s.isOnBlur)?!e:(n?r.isOnChange:s.isOnChange)?e:!0,d6=(e,t)=>!qh(_e(e,t)).length&&Dn(e,t);const f6={mode:Ss.onSubmit,reValidateMode:Ss.onChange,shouldFocusError:!0};function p6(e={}){let t={...f6,...e},n={submitCount:0,isDirty:!1,isLoading:ga(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},s=$n(t.defaultValues)||$n(t.values)?Er(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:Er(s),l={action:!1,mount:!1,watch:!1},u={mount:new Set,unMount:new Set,array:new Set,watch:new Set},d,f=0;const h={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},m={values:Mv(),array:Mv(),state:Mv()},g=h1(t.mode),x=h1(t.reValidateMode),b=t.criteriaMode===Ss.all,w=L=>X=>{clearTimeout(f),f=setTimeout(L,X)},C=async L=>{if(h.isValid||L){const X=t.resolver?Lr((await D()).errors):await Q(r,!0);X!==n.isValid&&m.state.next({isValid:X})}},k=(L,X)=>{(h.isValidating||h.validatingFields)&&((L||Array.from(u.mount)).forEach(ue=>{ue&&(X?qt(n.validatingFields,ue,X):Dn(n.validatingFields,ue))}),m.state.next({validatingFields:n.validatingFields,isValidating:!Lr(n.validatingFields)}))},j=(L,X=[],ue,Ne,je=!0,Se=!0)=>{if(Ne&&ue){if(l.action=!0,Se&&Array.isArray(_e(r,L))){const Be=ue(_e(r,L),Ne.argA,Ne.argB);je&&qt(r,L,Be)}if(Se&&Array.isArray(_e(n.errors,L))){const Be=ue(_e(n.errors,L),Ne.argA,Ne.argB);je&&qt(n.errors,L,Be),d6(n.errors,L)}if(h.touchedFields&&Se&&Array.isArray(_e(n.touchedFields,L))){const Be=ue(_e(n.touchedFields,L),Ne.argA,Ne.argB);je&&qt(n.touchedFields,L,Be)}h.dirtyFields&&(n.dirtyFields=Gf(s,o)),m.state.next({name:L,isDirty:V(L,X),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else qt(o,L,X)},M=(L,X)=>{qt(n.errors,L,X),m.state.next({errors:n.errors})},_=L=>{n.errors=L,m.state.next({errors:n.errors,isValid:!1})},R=(L,X,ue,Ne)=>{const je=_e(r,L);if(je){const Se=_e(o,L,wn(ue)?_e(s,L):ue);wn(Se)||Ne&&Ne.defaultChecked||X?qt(o,L,X?Se:Rv(je._f)):ie(L,Se),l.mount&&C()}},N=(L,X,ue,Ne,je)=>{let Se=!1,Be=!1;const bt={name:L},Wt=!!(_e(r,L)&&_e(r,L)._f&&_e(r,L)._f.disabled);if(!ue||Ne){h.isDirty&&(Be=n.isDirty,n.isDirty=bt.isDirty=V(),Se=Be!==bt.isDirty);const yn=Wt||ui(_e(s,L),X);Be=!!(!Wt&&_e(n.dirtyFields,L)),yn||Wt?Dn(n.dirtyFields,L):qt(n.dirtyFields,L,!0),bt.dirtyFields=n.dirtyFields,Se=Se||h.dirtyFields&&Be!==!yn}if(ue){const yn=_e(n.touchedFields,L);yn||(qt(n.touchedFields,L,ue),bt.touchedFields=n.touchedFields,Se=Se||h.touchedFields&&yn!==ue)}return Se&&je&&m.state.next(bt),Se?bt:{}},O=(L,X,ue,Ne)=>{const je=_e(n.errors,L),Se=h.isValid&&Us(X)&&n.isValid!==X;if(e.delayError&&ue?(d=w(()=>M(L,ue)),d(e.delayError)):(clearTimeout(f),d=null,ue?qt(n.errors,L,ue):Dn(n.errors,L)),(ue?!ui(je,ue):je)||!Lr(Ne)||Se){const Be={...Ne,...Se&&Us(X)?{isValid:X}:{},errors:n.errors,name:L};n={...n,...Be},m.state.next(Be)}},D=async L=>{k(L,!0);const X=await t.resolver(o,t.context,l6(L||u.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return k(L),X},z=async L=>{const{errors:X}=await D(L);if(L)for(const ue of L){const Ne=_e(X,ue);Ne?qt(n.errors,ue,Ne):Dn(n.errors,ue)}else n.errors=X;return X},Q=async(L,X,ue={valid:!0})=>{for(const Ne in L){const je=L[Ne];if(je){const{_f:Se,...Be}=je;if(Se){const bt=u.array.has(Se.name);k([Ne],!0);const Wt=await x1(je,o,b,t.shouldUseNativeValidation&&!X,bt);if(k([Ne]),Wt[Se.name]&&(ue.valid=!1,X))break;!X&&(_e(Wt,Se.name)?bt?s6(n.errors,Wt,Se.name):qt(n.errors,Se.name,Wt[Se.name]):Dn(n.errors,Se.name))}Be&&await Q(Be,X,ue)}}return ue.valid},pe=()=>{for(const L of u.unMount){const X=_e(r,L);X&&(X._f.refs?X._f.refs.every(ue=>!_v(ue)):!_v(X._f.ref))&&ge(L)}u.unMount=new Set},V=(L,X)=>(L&&X&&qt(o,L,X),!ui(A(),s)),G=(L,X,ue)=>b_(L,u,{...l.mount?o:wn(X)?s:qs(L)?{[L]:X}:X},ue,X),W=L=>qh(_e(l.mount?o:s,L,e.shouldUnregister?_e(s,L,[]):[])),ie=(L,X,ue={})=>{const Ne=_e(r,L);let je=X;if(Ne){const Se=Ne._f;Se&&(!Se.disabled&&qt(o,L,j_(X,Se)),je=Gp(Se.ref)&&cr(X)?"":X,C_(Se.ref)?[...Se.ref.options].forEach(Be=>Be.selected=je.includes(Be.value)):Se.refs?Ed(Se.ref)?Se.refs.length>1?Se.refs.forEach(Be=>(!Be.defaultChecked||!Be.disabled)&&(Be.checked=Array.isArray(je)?!!je.find(bt=>bt===Be.value):je===Be.value)):Se.refs[0]&&(Se.refs[0].checked=!!je):Se.refs.forEach(Be=>Be.checked=Be.value===je):Mx(Se.ref)?Se.ref.value="":(Se.ref.value=je,Se.ref.type||m.values.next({name:L,values:{...o}})))}(ue.shouldDirty||ue.shouldTouch)&&N(L,je,ue.shouldTouch,ue.shouldDirty,!0),ue.shouldValidate&&he(L)},re=(L,X,ue)=>{for(const Ne in X){const je=X[Ne],Se=`${L}.${Ne}`,Be=_e(r,Se);(u.array.has(L)||!Qp(je)||Be&&!Be._f)&&!Tl(je)?re(Se,je,ue):ie(Se,je,ue)}},Y=(L,X,ue={})=>{const Ne=_e(r,L),je=u.array.has(L),Se=Er(X);qt(o,L,Se),je?(m.array.next({name:L,values:{...o}}),(h.isDirty||h.dirtyFields)&&ue.shouldDirty&&m.state.next({name:L,dirtyFields:Gf(s,o),isDirty:V(L,Se)})):Ne&&!Ne._f&&!cr(Se)?re(L,Se,ue):ie(L,Se,ue),g1(L,u)&&m.state.next({...n}),m.values.next({name:l.mount?L:void 0,values:{...o}})},H=async L=>{l.mount=!0;const X=L.target;let ue=X.name,Ne=!0;const je=_e(r,ue),Se=()=>X.type?Rv(je._f):f_(L),Be=bt=>{Ne=Number.isNaN(bt)||bt===_e(o,ue,bt)};if(je){let bt,Wt;const yn=Se(),bn=L.type===Wp.BLUR||L.type===Wp.FOCUS_OUT,En=!c6(je._f)&&!t.resolver&&!_e(n.errors,ue)&&!je._f.deps||u6(bn,_e(n.touchedFields,ue),n.isSubmitted,x,g),gr=g1(ue,u,bn);qt(o,ue,yn),bn?(je._f.onBlur&&je._f.onBlur(L),d&&d(0)):je._f.onChange&&je._f.onChange(L);const Qn=N(ue,yn,bn,!1),ro=!Lr(Qn)||gr;if(!bn&&m.values.next({name:ue,type:L.type,values:{...o}}),En)return h.isValid&&C(),ro&&m.state.next({name:ue,...gr?{}:Qn});if(!bn&&gr&&m.state.next({...n}),t.resolver){const{errors:Bn}=await D([ue]);if(Be(yn),Ne){const Te=w1(n.errors,r,ue),ut=w1(Bn,r,Te.name||ue);bt=ut.error,ue=ut.name,Wt=Lr(Bn)}}else k([ue],!0),bt=(await x1(je,o,b,t.shouldUseNativeValidation))[ue],k([ue]),Be(yn),Ne&&(bt?Wt=!1:h.isValid&&(Wt=await Q(r,!0)));Ne&&(je._f.deps&&he(je._f.deps),O(ue,Wt,bt,Qn))}},q=(L,X)=>{if(_e(n.errors,X)&&L.focus)return L.focus(),1},he=async(L,X={})=>{let ue,Ne;const je=ju(L);if(t.resolver){const Se=await z(wn(L)?L:je);ue=Lr(Se),Ne=L?!je.some(Be=>_e(Se,Be)):ue}else L?(Ne=(await Promise.all(je.map(async Se=>{const Be=_e(r,Se);return await Q(Be&&Be._f?{[Se]:Be}:Be)}))).every(Boolean),!(!Ne&&!n.isValid)&&C()):Ne=ue=await Q(r);return m.state.next({...!qs(L)||h.isValid&&ue!==n.isValid?{}:{name:L},...t.resolver||!L?{isValid:ue}:{},errors:n.errors}),X.shouldFocus&&!Ne&&Tu(r,q,L?je:u.mount),Ne},A=L=>{const X={...l.mount?o:s};return wn(L)?X:qs(L)?_e(X,L):L.map(ue=>_e(X,ue))},F=(L,X)=>({invalid:!!_e((X||n).errors,L),isDirty:!!_e((X||n).dirtyFields,L),error:_e((X||n).errors,L),isValidating:!!_e(n.validatingFields,L),isTouched:!!_e((X||n).touchedFields,L)}),fe=L=>{L&&ju(L).forEach(X=>Dn(n.errors,X)),m.state.next({errors:L?n.errors:{}})},te=(L,X,ue)=>{const Ne=(_e(r,L,{_f:{}})._f||{}).ref,je=_e(n.errors,L)||{},{ref:Se,message:Be,type:bt,...Wt}=je;qt(n.errors,L,{...Wt,...X,ref:Ne}),m.state.next({name:L,errors:n.errors,isValid:!1}),ue&&ue.shouldFocus&&Ne&&Ne.focus&&Ne.focus()},de=(L,X)=>ga(L)?m.values.subscribe({next:ue=>L(G(void 0,X),ue)}):G(L,X,!0),ge=(L,X={})=>{for(const ue of L?ju(L):u.mount)u.mount.delete(ue),u.array.delete(ue),X.keepValue||(Dn(r,ue),Dn(o,ue)),!X.keepError&&Dn(n.errors,ue),!X.keepDirty&&Dn(n.dirtyFields,ue),!X.keepTouched&&Dn(n.touchedFields,ue),!X.keepIsValidating&&Dn(n.validatingFields,ue),!t.shouldUnregister&&!X.keepDefaultValue&&Dn(s,ue);m.values.next({values:{...o}}),m.state.next({...n,...X.keepDirty?{isDirty:V()}:{}}),!X.keepIsValid&&C()},Z=({disabled:L,name:X,field:ue,fields:Ne,value:je})=>{if(Us(L)&&l.mount||L){const Se=L?void 0:wn(je)?Rv(ue?ue._f:_e(Ne,X)._f):je;qt(o,X,Se),N(X,Se,!1,!1,!0)}},ye=(L,X={})=>{let ue=_e(r,L);const Ne=Us(X.disabled);return qt(r,L,{...ue||{},_f:{...ue&&ue._f?ue._f:{ref:{name:L}},name:L,mount:!0,...X}}),u.mount.add(L),ue?Z({field:ue,disabled:X.disabled,name:L,value:X.value}):R(L,!0,X.value),{...Ne?{disabled:X.disabled}:{},...t.progressive?{required:!!X.required,min:au(X.min),max:au(X.max),minLength:au(X.minLength),maxLength:au(X.maxLength),pattern:au(X.pattern)}:{},name:L,onChange:H,onBlur:H,ref:je=>{if(je){ye(L,X),ue=_e(r,L);const Se=wn(je.value)&&je.querySelectorAll&&je.querySelectorAll("input,select,textarea")[0]||je,Be=i6(Se),bt=ue._f.refs||[];if(Be?bt.find(Wt=>Wt===Se):Se===ue._f.ref)return;qt(r,L,{_f:{...ue._f,...Be?{refs:[...bt.filter(_v),Se,...Array.isArray(_e(s,L))?[{}]:[]],ref:{type:Se.type,name:L}}:{ref:Se}}}),R(L,!1,void 0,Se)}else ue=_e(r,L,{}),ue._f&&(ue._f.mount=!1),(t.shouldUnregister||X.shouldUnregister)&&!(p_(u.array,L)&&l.action)&&u.unMount.add(L)}}},Re=()=>t.shouldFocusError&&Tu(r,q,u.mount),$e=L=>{Us(L)&&(m.state.next({disabled:L}),Tu(r,(X,ue)=>{const Ne=_e(r,ue);Ne&&(X.disabled=Ne._f.disabled||L,Array.isArray(Ne._f.refs)&&Ne._f.refs.forEach(je=>{je.disabled=Ne._f.disabled||L}))},0,!1))},Ye=(L,X)=>async ue=>{let Ne;ue&&(ue.preventDefault&&ue.preventDefault(),ue.persist&&ue.persist());let je=Er(o);if(m.state.next({isSubmitting:!0}),t.resolver){const{errors:Se,values:Be}=await D();n.errors=Se,je=Be}else await Q(r);if(Dn(n.errors,"root"),Lr(n.errors)){m.state.next({errors:{}});try{await L(je,ue)}catch(Se){Ne=Se}}else X&&await X({...n.errors},ue),Re(),setTimeout(Re);if(m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Lr(n.errors)&&!Ne,submitCount:n.submitCount+1,errors:n.errors}),Ne)throw Ne},Fe=(L,X={})=>{_e(r,L)&&(wn(X.defaultValue)?Y(L,Er(_e(s,L))):(Y(L,X.defaultValue),qt(s,L,Er(X.defaultValue))),X.keepTouched||Dn(n.touchedFields,L),X.keepDirty||(Dn(n.dirtyFields,L),n.isDirty=X.defaultValue?V(L,Er(_e(s,L))):V()),X.keepError||(Dn(n.errors,L),h.isValid&&C()),m.state.next({...n}))},ft=(L,X={})=>{const ue=L?Er(L):s,Ne=Er(ue),je=Lr(L),Se=je?s:Ne;if(X.keepDefaultValues||(s=ue),!X.keepValues){if(X.keepDirtyValues)for(const Be of u.mount)_e(n.dirtyFields,Be)?qt(Se,Be,_e(o,Be)):Y(Be,_e(Se,Be));else{if(jx&&wn(L))for(const Be of u.mount){const bt=_e(r,Be);if(bt&&bt._f){const Wt=Array.isArray(bt._f.refs)?bt._f.refs[0]:bt._f.ref;if(Gp(Wt)){const yn=Wt.closest("form");if(yn){yn.reset();break}}}}r={}}o=e.shouldUnregister?X.keepDefaultValues?Er(s):{}:Er(Se),m.array.next({values:{...Se}}),m.values.next({values:{...Se}})}u={mount:X.keepDirtyValues?u.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},l.mount=!h.isValid||!!X.keepIsValid||!!X.keepDirtyValues,l.watch=!!e.shouldUnregister,m.state.next({submitCount:X.keepSubmitCount?n.submitCount:0,isDirty:je?!1:X.keepDirty?n.isDirty:!!(X.keepDefaultValues&&!ui(L,s)),isSubmitted:X.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:je?{}:X.keepDirtyValues?X.keepDefaultValues&&o?Gf(s,o):n.dirtyFields:X.keepDefaultValues&&L?Gf(s,L):X.keepDirty?n.dirtyFields:{},touchedFields:X.keepTouched?n.touchedFields:{},errors:X.keepErrors?n.errors:{},isSubmitSuccessful:X.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},ln=(L,X)=>ft(ga(L)?L(o):L,X);return{control:{register:ye,unregister:ge,getFieldState:F,handleSubmit:Ye,setError:te,_executeSchema:D,_getWatch:G,_getDirty:V,_updateValid:C,_removeUnmounted:pe,_updateFieldArray:j,_updateDisabledField:Z,_getFieldArray:W,_reset:ft,_resetDefaultValues:()=>ga(t.defaultValues)&&t.defaultValues().then(L=>{ln(L,t.resetOptions),m.state.next({isLoading:!1})}),_updateFormState:L=>{n={...n,...L}},_disableForm:$e,_subjects:m,_proxyFormState:h,_setErrors:_,get _fields(){return r},get _formValues(){return o},get _state(){return l},set _state(L){l=L},get _defaultValues(){return s},get _names(){return u},set _names(L){u=L},get _formState(){return n},set _formState(L){n=L},get _options(){return t},set _options(L){t={...t,...L}}},trigger:he,register:ye,handleSubmit:Ye,watch:de,setValue:Y,getValues:A,reset:ln,resetField:Fe,clearErrors:fe,unregister:ge,setError:te,setFocus:(L,X={})=>{const ue=_e(r,L),Ne=ue&&ue._f;if(Ne){const je=Ne.refs?Ne.refs[0]:Ne.ref;je.focus&&(je.focus(),X.shouldSelect&&je.select())}},getFieldState:F}}function on(e={}){const t=qe.useRef(),n=qe.useRef(),[r,s]=qe.useState({isDirty:!1,isValidating:!1,isLoading:ga(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:ga(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...p6(e),formState:r});const o=t.current.control;return o._options=e,Nx({subject:o._subjects.state,next:l=>{v_(l,o._proxyFormState,o._updateFormState,!0)&&s({...o._formState})}}),qe.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),qe.useEffect(()=>{if(o._proxyFormState.isDirty){const l=o._getDirty();l!==r.isDirty&&o._subjects.state.next({isDirty:l})}},[o,r.isDirty]),qe.useEffect(()=>{e.values&&!ui(e.values,n.current)?(o._reset(e.values,o._options.resetOptions),n.current=e.values,s(l=>({...l}))):o._resetDefaultValues()},[e.values,o]),qe.useEffect(()=>{e.errors&&o._setErrors(e.errors)},[e.errors,o]),qe.useEffect(()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),qe.useEffect(()=>{e.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})},[e.shouldUnregister,o]),t.current.formState=m_(r,o),t.current}const S1=(e,t,n)=>{if(e&&"reportValidity"in e){const r=_e(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},T_=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?S1(r.ref,n,e):r.refs&&r.refs.forEach(s=>S1(s,n,e))}},h6=(e,t)=>{t.shouldUseNativeValidation&&T_(e,t);const n={};for(const r in e){const s=_e(t.fields,r),o=Object.assign(e[r]||{},{ref:s&&s.ref});if(g6(t.names||Object.keys(e),r)){const l=Object.assign({},_e(n,r));qt(l,"root",o),qt(n,r,l)}else qt(n,r,o)}return n},g6=(e,t)=>e.some(n=>n.startsWith(t+"."));var m6=function(e,t){for(var n={};e.length;){var r=e[0],s=r.code,o=r.message,l=r.path.join(".");if(!n[l])if("unionErrors"in r){var u=r.unionErrors[0].errors[0];n[l]={message:u.message,type:u.code}}else n[l]={message:o,type:s};if("unionErrors"in r&&r.unionErrors.forEach(function(h){return h.errors.forEach(function(m){return e.push(m)})}),t){var d=n[l].types,f=d&&d[r.code];n[l]=x_(l,t,n,s,f?[].concat(f,r.message):r.message)}e.shift()}return n},an=function(e,t,n){return n===void 0&&(n={}),function(r,s,o){try{return Promise.resolve((function(l,u){try{var d=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(f){return o.shouldUseNativeValidation&&T_({},o),{errors:{},values:n.raw?r:f}})}catch(f){return u(f)}return d&&d.then?d.then(void 0,u):d})(0,function(l){if((function(u){return Array.isArray(u?.errors)})(l))return{values:{},errors:h6(m6(l.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw l}))}catch(l){return Promise.reject(l)}}},Wn=[];for(var Pv=0;Pv<256;++Pv)Wn.push((Pv+256).toString(16).slice(1));function v6(e,t=0){return(Wn[e[t+0]]+Wn[e[t+1]]+Wn[e[t+2]]+Wn[e[t+3]]+"-"+Wn[e[t+4]]+Wn[e[t+5]]+"-"+Wn[e[t+6]]+Wn[e[t+7]]+"-"+Wn[e[t+8]]+Wn[e[t+9]]+"-"+Wn[e[t+10]]+Wn[e[t+11]]+Wn[e[t+12]]+Wn[e[t+13]]+Wn[e[t+14]]+Wn[e[t+15]]).toLowerCase()}var Jf,y6=new Uint8Array(16);function b6(){if(!Jf&&(Jf=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Jf))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Jf(y6)}var x6=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const C1={randomUUID:x6};function E1(e,t,n){if(C1.randomUUID&&!e)return C1.randomUUID();e=e||{};var r=e.random||(e.rng||b6)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,v6(r)}var Ot;(function(e){e.assertEqual=s=>s;function t(s){}e.assertIs=t;function n(s){throw new Error}e.assertNever=n,e.arrayToEnum=s=>{const o={};for(const l of s)o[l]=l;return o},e.getValidEnumValues=s=>{const o=e.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),l={};for(const u of o)l[u]=s[u];return e.objectValues(l)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const l in s)Object.prototype.hasOwnProperty.call(s,l)&&o.push(l);return o},e.find=(s,o)=>{for(const l of s)if(o(l))return l},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function r(s,o=" | "){return s.map(l=>typeof l=="string"?`'${l}'`:l).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(Ot||(Ot={}));var Gy;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Gy||(Gy={}));const Le=Ot.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),pa=e=>{switch(typeof e){case"undefined":return Le.undefined;case"string":return Le.string;case"number":return isNaN(e)?Le.nan:Le.number;case"boolean":return Le.boolean;case"function":return Le.function;case"bigint":return Le.bigint;case"symbol":return Le.symbol;case"object":return Array.isArray(e)?Le.array:e===null?Le.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Le.promise:typeof Map<"u"&&e instanceof Map?Le.map:typeof Set<"u"&&e instanceof Set?Le.set:typeof Date<"u"&&e instanceof Date?Le.date:Le.object;default:return Le.unknown}},Ce=Ot.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),w6=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Hr extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(o){return o.message},r={_errors:[]},s=o=>{for(const l of o.issues)if(l.code==="invalid_union")l.unionErrors.map(s);else if(l.code==="invalid_return_type")s(l.returnTypeError);else if(l.code==="invalid_arguments")s(l.argumentsError);else if(l.path.length===0)r._errors.push(n(l));else{let u=r,d=0;for(;dn.message){const n={},r=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Hr.create=e=>new Hr(e);const Vl=(e,t)=>{let n;switch(e.code){case Ce.invalid_type:e.received===Le.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Ce.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ot.jsonStringifyReplacer)}`;break;case Ce.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ot.joinValues(e.keys,", ")}`;break;case Ce.invalid_union:n="Invalid input";break;case Ce.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ot.joinValues(e.options)}`;break;case Ce.invalid_enum_value:n=`Invalid enum value. Expected ${Ot.joinValues(e.options)}, received '${e.received}'`;break;case Ce.invalid_arguments:n="Invalid function arguments";break;case Ce.invalid_return_type:n="Invalid function return type";break;case Ce.invalid_date:n="Invalid date";break;case Ce.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Ot.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Ce.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Ce.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Ce.custom:n="Invalid input";break;case Ce.invalid_intersection_types:n="Intersection results could not be merged";break;case Ce.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Ce.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ot.assertNever(e)}return{message:n}};let N_=Vl;function S6(e){N_=e}function Yp(){return N_}const Xp=e=>{const{data:t,path:n,errorMaps:r,issueData:s}=e,o=[...n,...s.path||[]],l={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let u="";const d=r.filter(f=>!!f).slice().reverse();for(const f of d)u=f(l,{data:t,defaultError:u}).message;return{...s,path:o,message:u}},C6=[];function Ae(e,t){const n=Yp(),r=Xp({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Vl?void 0:Vl].filter(s=>!!s)});e.common.issues.push(r)}class sr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const s of n){if(s.status==="aborted")return lt;s.status==="dirty"&&t.dirty(),r.push(s.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const s of n){const o=await s.key,l=await s.value;r.push({key:o,value:l})}return sr.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const s of n){const{key:o,value:l}=s;if(o.status==="aborted"||l.status==="aborted")return lt;o.status==="dirty"&&t.dirty(),l.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof l.value<"u"||s.alwaysSet)&&(r[o.value]=l.value)}return{status:t.value,value:r}}}const lt=Object.freeze({status:"aborted"}),Nl=e=>({status:"dirty",value:e}),fr=e=>({status:"valid",value:e}),Jy=e=>e.status==="aborted",Qy=e=>e.status==="dirty",Hu=e=>e.status==="valid",qu=e=>typeof Promise<"u"&&e instanceof Promise;function eh(e,t,n,r){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function M_(e,t,n,r,s){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var Ze;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Ze||(Ze={}));var yu,bu;class Qs{constructor(t,n,r,s){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const k1=(e,t)=>{if(Hu(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Hr(e.common.issues);return this._error=n,this._error}}};function yt(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:s}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(l,u)=>{var d,f;const{message:h}=e;return l.code==="invalid_enum_value"?{message:h??u.defaultError}:typeof u.data>"u"?{message:(d=h??r)!==null&&d!==void 0?d:u.defaultError}:l.code!=="invalid_type"?{message:u.defaultError}:{message:(f=h??n)!==null&&f!==void 0?f:u.defaultError}},description:s}}class St{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return pa(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:pa(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new sr,ctx:{common:t.parent.common,data:t.data,parsedType:pa(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(qu(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const s={common:{issues:[],async:(r=n?.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:pa(t)},o=this._parseSync({data:t,path:s.path,parent:s});return k1(s,o)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:pa(t)},s=this._parse({data:t,path:r.path,parent:r}),o=await(qu(s)?s:Promise.resolve(s));return k1(r,o)}refine(t,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,o)=>{const l=t(s),u=()=>o.addIssue({code:Ce.custom,...r(s)});return typeof Promise<"u"&&l instanceof Promise?l.then(d=>d?!0:(u(),!1)):l?!0:(u(),!1)})}refinement(t,n){return this._refinement((r,s)=>t(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(t){return new Ms({schema:this,typeName:it.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Ws.create(this,this._def)}nullable(){return ka.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ks.create(this,this._def)}promise(){return ql.create(this,this._def)}or(t){return Ju.create([this,t],this._def)}and(t){return Qu.create(this,t,this._def)}transform(t){return new Ms({...yt(this._def),schema:this,typeName:it.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new td({...yt(this._def),innerType:this,defaultValue:n,typeName:it.ZodDefault})}brand(){return new Rx({typeName:it.ZodBranded,type:this,...yt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new nd({...yt(this._def),innerType:this,catchValue:n,typeName:it.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return kd.create(this,t)}readonly(){return rd.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const E6=/^c[^\s-]{8,}$/i,k6=/^[0-9a-z]+$/,j6=/^[0-9A-HJKMNP-TV-Z]{26}$/,T6=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,N6=/^[a-z0-9_-]{21}$/i,M6=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,_6=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,R6="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ov;const P6=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,O6=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,I6=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,__="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",A6=new RegExp(`^${__}$`);function R_(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function D6(e){return new RegExp(`^${R_(e)}$`)}function P_(e){let t=`${__}T${R_(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function F6(e,t){return!!((t==="v4"||!t)&&P6.test(e)||(t==="v6"||!t)&&O6.test(e))}class Cs extends St{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Le.string){const o=this._getOrReturnCtx(t);return Ae(o,{code:Ce.invalid_type,expected:Le.string,received:o.parsedType}),lt}const r=new sr;let s;for(const o of this._def.checks)if(o.kind==="min")t.data.lengtho.value&&(s=this._getOrReturnCtx(t,s),Ae(s,{code:Ce.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const l=t.data.length>o.value,u=t.data.lengtht.test(s),{validation:n,code:Ce.invalid_string,...Ze.errToObj(r)})}_addCheck(t){return new Cs({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ze.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ze.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ze.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ze.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ze.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ze.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ze.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ze.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ze.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ze.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:(n=t?.offset)!==null&&n!==void 0?n:!1,local:(r=t?.local)!==null&&r!==void 0?r:!1,...Ze.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...Ze.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...Ze.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ze.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...Ze.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ze.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ze.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ze.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ze.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ze.errToObj(n)})}nonempty(t){return this.min(1,Ze.errToObj(t))}trim(){return new Cs({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Cs({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Cs({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new Cs({checks:[],typeName:it.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...yt(e)})};function L6(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r,o=parseInt(e.toFixed(s).replace(".","")),l=parseInt(t.toFixed(s).replace(".",""));return o%l/Math.pow(10,s)}class Sa extends St{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Le.number){const o=this._getOrReturnCtx(t);return Ae(o,{code:Ce.invalid_type,expected:Le.number,received:o.parsedType}),lt}let r;const s=new sr;for(const o of this._def.checks)o.kind==="int"?Ot.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Ae(r,{code:Ce.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),Ae(r,{code:Ce.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?L6(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),Ae(r,{code:Ce.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Ae(r,{code:Ce.not_finite,message:o.message}),s.dirty()):Ot.assertNever(o);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ze.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ze.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ze.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ze.toString(n))}setLimit(t,n,r,s){return new Sa({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ze.toString(s)}]})}_addCheck(t){return new Sa({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ze.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ze.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ze.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ze.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ze.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ze.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ze.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ze.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ze.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuet.kind==="int"||t.kind==="multipleOf"&&Ot.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.valuenew Sa({checks:[],typeName:it.ZodNumber,coerce:e?.coerce||!1,...yt(e)});class Ca extends St{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==Le.bigint){const o=this._getOrReturnCtx(t);return Ae(o,{code:Ce.invalid_type,expected:Le.bigint,received:o.parsedType}),lt}let r;const s=new sr;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),Ae(r,{code:Ce.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Ae(r,{code:Ce.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):Ot.assertNever(o);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ze.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ze.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ze.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ze.toString(n))}setLimit(t,n,r,s){return new Ca({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ze.toString(s)}]})}_addCheck(t){return new Ca({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ze.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ze.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ze.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ze.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ze.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new Ca({checks:[],typeName:it.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...yt(e)})};class Ku extends St{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Le.boolean){const r=this._getOrReturnCtx(t);return Ae(r,{code:Ce.invalid_type,expected:Le.boolean,received:r.parsedType}),lt}return fr(t.data)}}Ku.create=e=>new Ku({typeName:it.ZodBoolean,coerce:e?.coerce||!1,...yt(e)});class Ti extends St{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Le.date){const o=this._getOrReturnCtx(t);return Ae(o,{code:Ce.invalid_type,expected:Le.date,received:o.parsedType}),lt}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return Ae(o,{code:Ce.invalid_date}),lt}const r=new sr;let s;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()o.value&&(s=this._getOrReturnCtx(t,s),Ae(s,{code:Ce.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Ot.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Ti({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ze.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ze.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuenew Ti({checks:[],coerce:e?.coerce||!1,typeName:it.ZodDate,...yt(e)});class th extends St{_parse(t){if(this._getType(t)!==Le.symbol){const r=this._getOrReturnCtx(t);return Ae(r,{code:Ce.invalid_type,expected:Le.symbol,received:r.parsedType}),lt}return fr(t.data)}}th.create=e=>new th({typeName:it.ZodSymbol,...yt(e)});class Wu extends St{_parse(t){if(this._getType(t)!==Le.undefined){const r=this._getOrReturnCtx(t);return Ae(r,{code:Ce.invalid_type,expected:Le.undefined,received:r.parsedType}),lt}return fr(t.data)}}Wu.create=e=>new Wu({typeName:it.ZodUndefined,...yt(e)});class Gu extends St{_parse(t){if(this._getType(t)!==Le.null){const r=this._getOrReturnCtx(t);return Ae(r,{code:Ce.invalid_type,expected:Le.null,received:r.parsedType}),lt}return fr(t.data)}}Gu.create=e=>new Gu({typeName:it.ZodNull,...yt(e)});class Hl extends St{constructor(){super(...arguments),this._any=!0}_parse(t){return fr(t.data)}}Hl.create=e=>new Hl({typeName:it.ZodAny,...yt(e)});class mi extends St{constructor(){super(...arguments),this._unknown=!0}_parse(t){return fr(t.data)}}mi.create=e=>new mi({typeName:it.ZodUnknown,...yt(e)});class Ro extends St{_parse(t){const n=this._getOrReturnCtx(t);return Ae(n,{code:Ce.invalid_type,expected:Le.never,received:n.parsedType}),lt}}Ro.create=e=>new Ro({typeName:it.ZodNever,...yt(e)});class nh extends St{_parse(t){if(this._getType(t)!==Le.undefined){const r=this._getOrReturnCtx(t);return Ae(r,{code:Ce.invalid_type,expected:Le.void,received:r.parsedType}),lt}return fr(t.data)}}nh.create=e=>new nh({typeName:it.ZodVoid,...yt(e)});class ks extends St{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==Le.array)return Ae(n,{code:Ce.invalid_type,expected:Le.array,received:n.parsedType}),lt;if(s.exactLength!==null){const l=n.data.length>s.exactLength.value,u=n.data.lengths.maxLength.value&&(Ae(n,{code:Ce.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((l,u)=>s.type._parseAsync(new Qs(n,l,n.path,u)))).then(l=>sr.mergeArray(r,l));const o=[...n.data].map((l,u)=>s.type._parseSync(new Qs(n,l,n.path,u)));return sr.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new ks({...this._def,minLength:{value:t,message:Ze.toString(n)}})}max(t,n){return new ks({...this._def,maxLength:{value:t,message:Ze.toString(n)}})}length(t,n){return new ks({...this._def,exactLength:{value:t,message:Ze.toString(n)}})}nonempty(t){return this.min(1,t)}}ks.create=(e,t)=>new ks({type:e,minLength:null,maxLength:null,exactLength:null,typeName:it.ZodArray,...yt(t)});function El(e){if(e instanceof gn){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Ws.create(El(r))}return new gn({...e._def,shape:()=>t})}else return e instanceof ks?new ks({...e._def,type:El(e.element)}):e instanceof Ws?Ws.create(El(e.unwrap())):e instanceof ka?ka.create(El(e.unwrap())):e instanceof Zs?Zs.create(e.items.map(t=>El(t))):e}class gn extends St{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Ot.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==Le.object){const f=this._getOrReturnCtx(t);return Ae(f,{code:Ce.invalid_type,expected:Le.object,received:f.parsedType}),lt}const{status:r,ctx:s}=this._processInputParams(t),{shape:o,keys:l}=this._getCached(),u=[];if(!(this._def.catchall instanceof Ro&&this._def.unknownKeys==="strip"))for(const f in s.data)l.includes(f)||u.push(f);const d=[];for(const f of l){const h=o[f],m=s.data[f];d.push({key:{status:"valid",value:f},value:h._parse(new Qs(s,m,s.path,f)),alwaysSet:f in s.data})}if(this._def.catchall instanceof Ro){const f=this._def.unknownKeys;if(f==="passthrough")for(const h of u)d.push({key:{status:"valid",value:h},value:{status:"valid",value:s.data[h]}});else if(f==="strict")u.length>0&&(Ae(s,{code:Ce.unrecognized_keys,keys:u}),r.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const h of u){const m=s.data[h];d.push({key:{status:"valid",value:h},value:f._parse(new Qs(s,m,s.path,h)),alwaysSet:h in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const f=[];for(const h of d){const m=await h.key,g=await h.value;f.push({key:m,value:g,alwaysSet:h.alwaysSet})}return f}).then(f=>sr.mergeObjectSync(r,f)):sr.mergeObjectSync(r,d)}get shape(){return this._def.shape()}strict(t){return Ze.errToObj,new gn({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var s,o,l,u;const d=(l=(o=(s=this._def).errorMap)===null||o===void 0?void 0:o.call(s,n,r).message)!==null&&l!==void 0?l:r.defaultError;return n.code==="unrecognized_keys"?{message:(u=Ze.errToObj(t).message)!==null&&u!==void 0?u:d}:{message:d}}}:{}})}strip(){return new gn({...this._def,unknownKeys:"strip"})}passthrough(){return new gn({...this._def,unknownKeys:"passthrough"})}extend(t){return new gn({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new gn({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:it.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new gn({...this._def,catchall:t})}pick(t){const n={};return Ot.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new gn({...this._def,shape:()=>n})}omit(t){const n={};return Ot.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new gn({...this._def,shape:()=>n})}deepPartial(){return El(this)}partial(t){const n={};return Ot.objectKeys(this.shape).forEach(r=>{const s=this.shape[r];t&&!t[r]?n[r]=s:n[r]=s.optional()}),new gn({...this._def,shape:()=>n})}required(t){const n={};return Ot.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Ws;)o=o._def.innerType;n[r]=o}}),new gn({...this._def,shape:()=>n})}keyof(){return O_(Ot.objectKeys(this.shape))}}gn.create=(e,t)=>new gn({shape:()=>e,unknownKeys:"strip",catchall:Ro.create(),typeName:it.ZodObject,...yt(t)});gn.strictCreate=(e,t)=>new gn({shape:()=>e,unknownKeys:"strict",catchall:Ro.create(),typeName:it.ZodObject,...yt(t)});gn.lazycreate=(e,t)=>new gn({shape:e,unknownKeys:"strip",catchall:Ro.create(),typeName:it.ZodObject,...yt(t)});class Ju extends St{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function s(o){for(const u of o)if(u.result.status==="valid")return u.result;for(const u of o)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const l=o.map(u=>new Hr(u.ctx.common.issues));return Ae(n,{code:Ce.invalid_union,unionErrors:l}),lt}if(n.common.async)return Promise.all(r.map(async o=>{const l={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:l}),ctx:l}})).then(s);{let o;const l=[];for(const d of r){const f={...n,common:{...n.common,issues:[]},parent:null},h=d._parseSync({data:n.data,path:n.path,parent:f});if(h.status==="valid")return h;h.status==="dirty"&&!o&&(o={result:h,ctx:f}),f.common.issues.length&&l.push(f.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const u=l.map(d=>new Hr(d));return Ae(n,{code:Ce.invalid_union,unionErrors:u}),lt}}get options(){return this._def.options}}Ju.create=(e,t)=>new Ju({options:e,typeName:it.ZodUnion,...yt(t)});const mo=e=>e instanceof Yu?mo(e.schema):e instanceof Ms?mo(e.innerType()):e instanceof Xu?[e.value]:e instanceof Ea?e.options:e instanceof ed?Ot.objectValues(e.enum):e instanceof td?mo(e._def.innerType):e instanceof Wu?[void 0]:e instanceof Gu?[null]:e instanceof Ws?[void 0,...mo(e.unwrap())]:e instanceof ka?[null,...mo(e.unwrap())]:e instanceof Rx||e instanceof rd?mo(e.unwrap()):e instanceof nd?mo(e._def.innerType):[];class Wh extends St{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Le.object)return Ae(n,{code:Ce.invalid_type,expected:Le.object,received:n.parsedType}),lt;const r=this.discriminator,s=n.data[r],o=this.optionsMap.get(s);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(Ae(n,{code:Ce.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),lt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const s=new Map;for(const o of n){const l=mo(o.shape[t]);if(!l.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const u of l){if(s.has(u))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(u)}`);s.set(u,o)}}return new Wh({typeName:it.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:s,...yt(r)})}}function Zy(e,t){const n=pa(e),r=pa(t);if(e===t)return{valid:!0,data:e};if(n===Le.object&&r===Le.object){const s=Ot.objectKeys(t),o=Ot.objectKeys(e).filter(u=>s.indexOf(u)!==-1),l={...e,...t};for(const u of o){const d=Zy(e[u],t[u]);if(!d.valid)return{valid:!1};l[u]=d.data}return{valid:!0,data:l}}else if(n===Le.array&&r===Le.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let o=0;o{if(Jy(o)||Jy(l))return lt;const u=Zy(o.value,l.value);return u.valid?((Qy(o)||Qy(l))&&n.dirty(),{status:n.value,value:u.data}):(Ae(r,{code:Ce.invalid_intersection_types}),lt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,l])=>s(o,l)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Qu.create=(e,t,n)=>new Qu({left:e,right:t,typeName:it.ZodIntersection,...yt(n)});class Zs extends St{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Le.array)return Ae(r,{code:Ce.invalid_type,expected:Le.array,received:r.parsedType}),lt;if(r.data.lengththis._def.items.length&&(Ae(r,{code:Ce.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((l,u)=>{const d=this._def.items[u]||this._def.rest;return d?d._parse(new Qs(r,l,r.path,u)):null}).filter(l=>!!l);return r.common.async?Promise.all(o).then(l=>sr.mergeArray(n,l)):sr.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new Zs({...this._def,rest:t})}}Zs.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Zs({items:e,typeName:it.ZodTuple,rest:null,...yt(t)})};class Zu extends St{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Le.object)return Ae(r,{code:Ce.invalid_type,expected:Le.object,received:r.parsedType}),lt;const s=[],o=this._def.keyType,l=this._def.valueType;for(const u in r.data)s.push({key:o._parse(new Qs(r,u,r.path,u)),value:l._parse(new Qs(r,r.data[u],r.path,u)),alwaysSet:u in r.data});return r.common.async?sr.mergeObjectAsync(n,s):sr.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof St?new Zu({keyType:t,valueType:n,typeName:it.ZodRecord,...yt(r)}):new Zu({keyType:Cs.create(),valueType:t,typeName:it.ZodRecord,...yt(n)})}}class rh extends St{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Le.map)return Ae(r,{code:Ce.invalid_type,expected:Le.map,received:r.parsedType}),lt;const s=this._def.keyType,o=this._def.valueType,l=[...r.data.entries()].map(([u,d],f)=>({key:s._parse(new Qs(r,u,r.path,[f,"key"])),value:o._parse(new Qs(r,d,r.path,[f,"value"]))}));if(r.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const d of l){const f=await d.key,h=await d.value;if(f.status==="aborted"||h.status==="aborted")return lt;(f.status==="dirty"||h.status==="dirty")&&n.dirty(),u.set(f.value,h.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const d of l){const f=d.key,h=d.value;if(f.status==="aborted"||h.status==="aborted")return lt;(f.status==="dirty"||h.status==="dirty")&&n.dirty(),u.set(f.value,h.value)}return{status:n.value,value:u}}}}rh.create=(e,t,n)=>new rh({valueType:t,keyType:e,typeName:it.ZodMap,...yt(n)});class Ni extends St{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Le.set)return Ae(r,{code:Ce.invalid_type,expected:Le.set,received:r.parsedType}),lt;const s=this._def;s.minSize!==null&&r.data.sizes.maxSize.value&&(Ae(r,{code:Ce.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const o=this._def.valueType;function l(d){const f=new Set;for(const h of d){if(h.status==="aborted")return lt;h.status==="dirty"&&n.dirty(),f.add(h.value)}return{status:n.value,value:f}}const u=[...r.data.values()].map((d,f)=>o._parse(new Qs(r,d,r.path,f)));return r.common.async?Promise.all(u).then(d=>l(d)):l(u)}min(t,n){return new Ni({...this._def,minSize:{value:t,message:Ze.toString(n)}})}max(t,n){return new Ni({...this._def,maxSize:{value:t,message:Ze.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Ni.create=(e,t)=>new Ni({valueType:e,minSize:null,maxSize:null,typeName:it.ZodSet,...yt(t)});class Ol extends St{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Le.function)return Ae(n,{code:Ce.invalid_type,expected:Le.function,received:n.parsedType}),lt;function r(u,d){return Xp({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Yp(),Vl].filter(f=>!!f),issueData:{code:Ce.invalid_arguments,argumentsError:d}})}function s(u,d){return Xp({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Yp(),Vl].filter(f=>!!f),issueData:{code:Ce.invalid_return_type,returnTypeError:d}})}const o={errorMap:n.common.contextualErrorMap},l=n.data;if(this._def.returns instanceof ql){const u=this;return fr(async function(...d){const f=new Hr([]),h=await u._def.args.parseAsync(d,o).catch(x=>{throw f.addIssue(r(d,x)),f}),m=await Reflect.apply(l,this,h);return await u._def.returns._def.type.parseAsync(m,o).catch(x=>{throw f.addIssue(s(m,x)),f})})}else{const u=this;return fr(function(...d){const f=u._def.args.safeParse(d,o);if(!f.success)throw new Hr([r(d,f.error)]);const h=Reflect.apply(l,this,f.data),m=u._def.returns.safeParse(h,o);if(!m.success)throw new Hr([s(h,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Ol({...this._def,args:Zs.create(t).rest(mi.create())})}returns(t){return new Ol({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Ol({args:t||Zs.create([]).rest(mi.create()),returns:n||mi.create(),typeName:it.ZodFunction,...yt(r)})}}class Yu extends St{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Yu.create=(e,t)=>new Yu({getter:e,typeName:it.ZodLazy,...yt(t)});class Xu extends St{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Ae(n,{received:n.data,code:Ce.invalid_literal,expected:this._def.value}),lt}return{status:"valid",value:t.data}}get value(){return this._def.value}}Xu.create=(e,t)=>new Xu({value:e,typeName:it.ZodLiteral,...yt(t)});function O_(e,t){return new Ea({values:e,typeName:it.ZodEnum,...yt(t)})}class Ea extends St{constructor(){super(...arguments),yu.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Ae(n,{expected:Ot.joinValues(r),received:n.parsedType,code:Ce.invalid_type}),lt}if(eh(this,yu)||M_(this,yu,new Set(this._def.values)),!eh(this,yu).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return Ae(n,{received:n.data,code:Ce.invalid_enum_value,options:r}),lt}return fr(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return Ea.create(t,{...this._def,...n})}exclude(t,n=this._def){return Ea.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}yu=new WeakMap;Ea.create=O_;class ed extends St{constructor(){super(...arguments),bu.set(this,void 0)}_parse(t){const n=Ot.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Le.string&&r.parsedType!==Le.number){const s=Ot.objectValues(n);return Ae(r,{expected:Ot.joinValues(s),received:r.parsedType,code:Ce.invalid_type}),lt}if(eh(this,bu)||M_(this,bu,new Set(Ot.getValidEnumValues(this._def.values))),!eh(this,bu).has(t.data)){const s=Ot.objectValues(n);return Ae(r,{received:r.data,code:Ce.invalid_enum_value,options:s}),lt}return fr(t.data)}get enum(){return this._def.values}}bu=new WeakMap;ed.create=(e,t)=>new ed({values:e,typeName:it.ZodNativeEnum,...yt(t)});class ql extends St{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Le.promise&&n.common.async===!1)return Ae(n,{code:Ce.invalid_type,expected:Le.promise,received:n.parsedType}),lt;const r=n.parsedType===Le.promise?n.data:Promise.resolve(n.data);return fr(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}ql.create=(e,t)=>new ql({type:e,typeName:it.ZodPromise,...yt(t)});class Ms extends St{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===it.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=this._def.effect||null,o={addIssue:l=>{Ae(r,l),l.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){const l=s.transform(r.data,o);if(r.common.async)return Promise.resolve(l).then(async u=>{if(n.value==="aborted")return lt;const d=await this._def.schema._parseAsync({data:u,path:r.path,parent:r});return d.status==="aborted"?lt:d.status==="dirty"||n.value==="dirty"?Nl(d.value):d});{if(n.value==="aborted")return lt;const u=this._def.schema._parseSync({data:l,path:r.path,parent:r});return u.status==="aborted"?lt:u.status==="dirty"||n.value==="dirty"?Nl(u.value):u}}if(s.type==="refinement"){const l=u=>{const d=s.refinement(u,o);if(r.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(r.common.async===!1){const u=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return u.status==="aborted"?lt:(u.status==="dirty"&&n.dirty(),l(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>u.status==="aborted"?lt:(u.status==="dirty"&&n.dirty(),l(u.value).then(()=>({status:n.value,value:u.value}))))}if(s.type==="transform")if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Hu(l))return l;const u=s.transform(l.value,o);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>Hu(l)?Promise.resolve(s.transform(l.value,o)).then(u=>({status:n.value,value:u})):l);Ot.assertNever(s)}}Ms.create=(e,t,n)=>new Ms({schema:e,typeName:it.ZodEffects,effect:t,...yt(n)});Ms.createWithPreprocess=(e,t,n)=>new Ms({schema:t,effect:{type:"preprocess",transform:e},typeName:it.ZodEffects,...yt(n)});class Ws extends St{_parse(t){return this._getType(t)===Le.undefined?fr(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Ws.create=(e,t)=>new Ws({innerType:e,typeName:it.ZodOptional,...yt(t)});class ka extends St{_parse(t){return this._getType(t)===Le.null?fr(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ka.create=(e,t)=>new ka({innerType:e,typeName:it.ZodNullable,...yt(t)});class td extends St{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Le.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}td.create=(e,t)=>new td({innerType:e,typeName:it.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...yt(t)});class nd extends St{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return qu(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Hr(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Hr(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}nd.create=(e,t)=>new nd({innerType:e,typeName:it.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...yt(t)});class sh extends St{_parse(t){if(this._getType(t)!==Le.nan){const r=this._getOrReturnCtx(t);return Ae(r,{code:Ce.invalid_type,expected:Le.nan,received:r.parsedType}),lt}return{status:"valid",value:t.data}}}sh.create=e=>new sh({typeName:it.ZodNaN,...yt(e)});const $6=Symbol("zod_brand");class Rx extends St{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class kd extends St{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?lt:o.status==="dirty"?(n.dirty(),Nl(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?lt:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(t,n){return new kd({in:t,out:n,typeName:it.ZodPipeline})}}class rd extends St{_parse(t){const n=this._def.innerType._parse(t),r=s=>(Hu(s)&&(s.value=Object.freeze(s.value)),s);return qu(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}rd.create=(e,t)=>new rd({innerType:e,typeName:it.ZodReadonly,...yt(t)});function I_(e,t={},n){return e?Hl.create().superRefine((r,s)=>{var o,l;if(!e(r)){const u=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,d=(l=(o=u.fatal)!==null&&o!==void 0?o:n)!==null&&l!==void 0?l:!0,f=typeof u=="string"?{message:u}:u;s.addIssue({code:"custom",...f,fatal:d})}}):Hl.create()}const B6={object:gn.lazycreate};var it;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(it||(it={}));const z6=(e,t={message:`Input not instance of ${e.name}`})=>I_(n=>n instanceof e,t),A_=Cs.create,D_=Sa.create,U6=sh.create,V6=Ca.create,F_=Ku.create,H6=Ti.create,q6=th.create,K6=Wu.create,W6=Gu.create,G6=Hl.create,J6=mi.create,Q6=Ro.create,Z6=nh.create,Y6=ks.create,X6=gn.create,e8=gn.strictCreate,t8=Ju.create,n8=Wh.create,r8=Qu.create,s8=Zs.create,o8=Zu.create,a8=rh.create,i8=Ni.create,l8=Ol.create,c8=Yu.create,u8=Xu.create,d8=Ea.create,f8=ed.create,p8=ql.create,j1=Ms.create,h8=Ws.create,g8=ka.create,m8=Ms.createWithPreprocess,v8=kd.create,y8=()=>A_().optional(),b8=()=>D_().optional(),x8=()=>F_().optional(),w8={string:(e=>Cs.create({...e,coerce:!0})),number:(e=>Sa.create({...e,coerce:!0})),boolean:(e=>Ku.create({...e,coerce:!0})),bigint:(e=>Ca.create({...e,coerce:!0})),date:(e=>Ti.create({...e,coerce:!0}))},S8=lt;var P=Object.freeze({__proto__:null,defaultErrorMap:Vl,setErrorMap:S6,getErrorMap:Yp,makeIssue:Xp,EMPTY_PATH:C6,addIssueToContext:Ae,ParseStatus:sr,INVALID:lt,DIRTY:Nl,OK:fr,isAborted:Jy,isDirty:Qy,isValid:Hu,isAsync:qu,get util(){return Ot},get objectUtil(){return Gy},ZodParsedType:Le,getParsedType:pa,ZodType:St,datetimeRegex:P_,ZodString:Cs,ZodNumber:Sa,ZodBigInt:Ca,ZodBoolean:Ku,ZodDate:Ti,ZodSymbol:th,ZodUndefined:Wu,ZodNull:Gu,ZodAny:Hl,ZodUnknown:mi,ZodNever:Ro,ZodVoid:nh,ZodArray:ks,ZodObject:gn,ZodUnion:Ju,ZodDiscriminatedUnion:Wh,ZodIntersection:Qu,ZodTuple:Zs,ZodRecord:Zu,ZodMap:rh,ZodSet:Ni,ZodFunction:Ol,ZodLazy:Yu,ZodLiteral:Xu,ZodEnum:Ea,ZodNativeEnum:ed,ZodPromise:ql,ZodEffects:Ms,ZodTransformer:Ms,ZodOptional:Ws,ZodNullable:ka,ZodDefault:td,ZodCatch:nd,ZodNaN:sh,BRAND:$6,ZodBranded:Rx,ZodPipeline:kd,ZodReadonly:rd,custom:I_,Schema:St,ZodSchema:St,late:B6,get ZodFirstPartyTypeKind(){return it},coerce:w8,any:G6,array:Y6,bigint:V6,boolean:F_,date:H6,discriminatedUnion:n8,effect:j1,enum:d8,function:l8,instanceof:z6,intersection:r8,lazy:c8,literal:u8,map:a8,nan:U6,nativeEnum:f8,never:Q6,null:W6,nullable:g8,number:D_,object:X6,oboolean:x8,onumber:b8,optional:h8,ostring:y8,pipeline:v8,preprocess:m8,promise:p8,record:o8,set:i8,strictObject:e8,string:A_,symbol:q6,transformer:j1,tuple:s8,undefined:K6,union:t8,unknown:J6,void:Z6,NEVER:S8,ZodIssueCode:Ce,quotelessJson:w6,ZodError:Hr}),L_=y.createContext({dragDropManager:void 0}),os;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(os||(os={}));function gt(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),s=2;s-1})}var T8={type:Px,payload:{clientOffset:null,sourceClientOffset:null}};function N8(e){return function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{publishSource:!0},s=r.publishSource,o=s===void 0?!0:s,l=r.clientOffset,u=r.getSourceClientOffset,d=e.getMonitor(),f=e.getRegistry();e.dispatch(T1(l)),M8(n,d,f);var h=P8(n,d);if(h===null){e.dispatch(T8);return}var m=null;if(l){if(!u)throw new Error("getSourceClientOffset must be defined");_8(u),m=u(h)}e.dispatch(T1(l,m));var g=f.getSource(h),x=g.beginDrag(d,h);if(x!=null){R8(x),f.pinSource(h);var b=f.getSourceType(h);return{type:Gh,payload:{itemType:b,item:x,sourceId:h,clientOffset:l||null,sourceClientOffset:m||null,isSourcePublic:!!o}}}}}function M8(e,t,n){gt(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(r){gt(n.getSource(r),"Expected sourceIds to be registered.")})}function _8(e){gt(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function R8(e){gt($_(e),"Item must be an object.")}function P8(e,t){for(var n=null,r=e.length-1;r>=0;r--)if(t.canDragSource(e[r])){n=e[r];break}return n}function O8(e){return function(){var n=e.getMonitor();if(n.isDragging())return{type:Ox}}}function Yy(e,t){return t===null?e===null:Array.isArray(e)?e.some(function(n){return n===t}):e===t}function I8(e){return function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=r.clientOffset;A8(n);var o=n.slice(0),l=e.getMonitor(),u=e.getRegistry();D8(o,l,u);var d=l.getItemType();return F8(o,u,d),L8(o,l,u),{type:Jh,payload:{targetIds:o,clientOffset:s||null}}}}function A8(e){gt(Array.isArray(e),"Expected targetIds to be an array.")}function D8(e,t,n){gt(t.isDragging(),"Cannot call hover while not dragging."),gt(!t.didDrop(),"Cannot call hover after drop.");for(var r=0;r=0;r--){var s=e[r],o=t.getTargetType(s);Yy(o,n)||e.splice(r,1)}}function L8(e,t,n){e.forEach(function(r){var s=n.getTarget(r);s.hover(t,r)})}function N1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function M1(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{},r=e.getMonitor(),s=e.getRegistry();z8(r);var o=H8(r);o.forEach(function(l,u){var d=U8(l,u,s,r),f={type:Qh,payload:{dropResult:M1(M1({},n),d)}};e.dispatch(f)})}}function z8(e){gt(e.isDragging(),"Cannot call drop while not dragging."),gt(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function U8(e,t,n,r){var s=n.getTarget(e),o=s?s.drop(r,e):void 0;return V8(o),typeof o>"u"&&(o=t===0?{}:r.getDropResult()),o}function V8(e){gt(typeof e>"u"||$_(e),"Drop result must either be an object or undefined.")}function H8(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function q8(e){return function(){var n=e.getMonitor(),r=e.getRegistry();K8(n);var s=n.getSourceId();if(s!=null){var o=r.getSource(s,!0);o.endDrag(n,s),r.unpinSource()}return{type:Zh}}}function K8(e){gt(e.isDragging(),"Cannot call endDrag while not dragging.")}function W8(e){return{beginDrag:N8(e),publishDragSource:O8(e),hover:I8(e),drop:B8(e),endDrag:q8(e)}}function G8(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function J8(e,t){for(var n=0;n0;r.backend&&(s&&!r.isSetUp?(r.backend.setup(),r.isSetUp=!0):!s&&r.isSetUp&&(r.backend.teardown(),r.isSetUp=!1))}),this.store=t,this.monitor=n,t.subscribe(this.handleRefCountChange)}return Q8(e,[{key:"receiveBackend",value:function(n){this.backend=n}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var n=this,r=this.store.dispatch;function s(l){return function(){for(var u=arguments.length,d=new Array(u),f=0;f"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(ns(1));return n(B_)(e,t)}if(typeof e!="function")throw new Error(ns(2));var s=e,o=t,l=[],u=l,d=!1;function f(){u===l&&(u=l.slice())}function h(){if(d)throw new Error(ns(3));return o}function m(w){if(typeof w!="function")throw new Error(ns(4));if(d)throw new Error(ns(5));var C=!0;return f(),u.push(w),function(){if(C){if(d)throw new Error(ns(6));C=!1,f();var j=u.indexOf(w);u.splice(j,1),l=null}}}function g(w){if(!Y8(w))throw new Error(ns(7));if(typeof w.type>"u")throw new Error(ns(8));if(d)throw new Error(ns(9));try{d=!0,o=s(o,w)}finally{d=!1}for(var C=l=u,k=0;k2&&arguments[2]!==void 0?arguments[2]:X8;if(e.length!==t.length)return!1;for(var r=0;r0&&arguments[0]!==void 0?arguments[0]:A1,t=arguments.length>1?arguments[1]:void 0,n=t.payload;switch(t.type){case Px:case Gh:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case Jh:return eV(e.clientOffset,n.clientOffset)?e:I1(I1({},e),{},{clientOffset:n.clientOffset});case Zh:case Qh:return A1;default:return e}}var Ix="dnd-core/ADD_SOURCE",Ax="dnd-core/ADD_TARGET",Dx="dnd-core/REMOVE_SOURCE",Yh="dnd-core/REMOVE_TARGET";function sV(e){return{type:Ix,payload:{sourceId:e}}}function oV(e){return{type:Ax,payload:{targetId:e}}}function aV(e){return{type:Dx,payload:{sourceId:e}}}function iV(e){return{type:Yh,payload:{targetId:e}}}function D1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function rs(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:cV,t=arguments.length>1?arguments[1]:void 0,n=t.payload;switch(t.type){case Gh:return rs(rs({},e),{},{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case Ox:return rs(rs({},e),{},{isSourcePublic:!0});case Jh:return rs(rs({},e),{},{targetIds:n.targetIds});case Yh:return e.targetIds.indexOf(n.targetId)===-1?e:rs(rs({},e),{},{targetIds:E8(e.targetIds,n.targetId)});case Qh:return rs(rs({},e),{},{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case Zh:return rs(rs({},e),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function dV(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ix:case Ax:return e+1;case Dx:case Yh:return e-1;default:return e}}var oh=[],Fx=[];oh.__IS_NONE__=!0;Fx.__IS_ALL__=!0;function fV(e,t){if(e===oh)return!1;if(e===Fx||typeof t>"u")return!0;var n=j8(t,e);return n.length>0}function pV(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case Jh:break;case Ix:case Ax:case Yh:case Dx:return oh;case Gh:case Ox:case Zh:case Qh:default:return Fx}var t=e.payload,n=t.targetIds,r=n===void 0?[]:n,s=t.prevTargetIds,o=s===void 0?[]:s,l=k8(r,o),u=l.length>0||!tV(r,o);if(!u)return oh;var d=o[o.length-1],f=r[r.length-1];return d!==f&&(d&&l.push(d),f&&l.push(f)),l}function hV(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e+1}function F1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function L1(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:pV(e.dirtyHandlerIds,{type:t.type,payload:L1(L1({},t.payload),{},{prevTargetIds:C8(e,"dragOperation.targetIds",[])})}),dragOffset:rV(e.dragOffset,t),refCount:dV(e.refCount,t),dragOperation:uV(e.dragOperation,t),stateId:hV(e.stateId)}}function vV(e,t){return{x:e.x+t.x,y:e.y+t.y}}function z_(e,t){return{x:e.x-t.x,y:e.y-t.y}}function yV(e){var t=e.clientOffset,n=e.initialClientOffset,r=e.initialSourceClientOffset;return!t||!n||!r?null:z_(vV(t,r),n)}function bV(e){var t=e.clientOffset,n=e.initialClientOffset;return!t||!n?null:z_(t,n)}function xV(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wV(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0},o=s.handlerIds;gt(typeof n=="function","listener must be a function."),gt(typeof o>"u"||Array.isArray(o),"handlerIds, when specified, must be an array of strings.");var l=this.store.getState().stateId,u=function(){var f=r.store.getState(),h=f.stateId;try{var m=h===l||h===l+1&&!fV(f.dirtyHandlerIds,o);m||n()}finally{l=h}};return this.store.subscribe(u)}},{key:"subscribeToOffsetChange",value:function(n){var r=this;gt(typeof n=="function","listener must be a function.");var s=this.store.getState().dragOffset,o=function(){var u=r.store.getState().dragOffset;u!==s&&(s=u,n())};return this.store.subscribe(o)}},{key:"canDragSource",value:function(n){if(!n)return!1;var r=this.registry.getSource(n);return gt(r,"Expected to find a valid source. sourceId=".concat(n)),this.isDragging()?!1:r.canDrag(this,n)}},{key:"canDropOnTarget",value:function(n){if(!n)return!1;var r=this.registry.getTarget(n);if(gt(r,"Expected to find a valid target. targetId=".concat(n)),!this.isDragging()||this.didDrop())return!1;var s=this.registry.getTargetType(n),o=this.getItemType();return Yy(s,o)&&r.canDrop(this,n)}},{key:"isDragging",value:function(){return!!this.getItemType()}},{key:"isDraggingSource",value:function(n){if(!n)return!1;var r=this.registry.getSource(n,!0);if(gt(r,"Expected to find a valid source. sourceId=".concat(n)),!this.isDragging()||!this.isSourcePublic())return!1;var s=this.registry.getSourceType(n),o=this.getItemType();return s!==o?!1:r.isDragging(this,n)}},{key:"isOverTarget",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shallow:!1};if(!n)return!1;var s=r.shallow;if(!this.isDragging())return!1;var o=this.registry.getTargetType(n),l=this.getItemType();if(l&&!Yy(o,l))return!1;var u=this.getTargetIds();if(!u.length)return!1;var d=u.indexOf(n);return s?d===u.length-1:d>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return!!this.store.getState().dragOperation.isSourcePublic}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return yV(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return bV(this.store.getState().dragOffset)}}]),e})(),EV=0;function kV(){return EV++}function bp(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?bp=function(n){return typeof n}:bp=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},bp(e)}function jV(e){gt(typeof e.canDrag=="function","Expected canDrag to be a function."),gt(typeof e.beginDrag=="function","Expected beginDrag to be a function."),gt(typeof e.endDrag=="function","Expected endDrag to be a function.")}function TV(e){gt(typeof e.canDrop=="function","Expected canDrop to be a function."),gt(typeof e.hover=="function","Expected hover to be a function."),gt(typeof e.drop=="function","Expected beginDrag to be a function.")}function Xy(e,t){if(t&&Array.isArray(e)){e.forEach(function(n){return Xy(n,!1)});return}gt(typeof e=="string"||bp(e)==="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}const B1=typeof global<"u"?global:self,U_=B1.MutationObserver||B1.WebKitMutationObserver;function V_(e){return function(){const n=setTimeout(s,0),r=setInterval(s,50);function s(){clearTimeout(n),clearInterval(r),e()}}}function NV(e){let t=1;const n=new U_(e),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}const MV=typeof U_=="function"?NV:V_;class _V{enqueueTask(t){const{queue:n,requestFlush:r}=this;n.length||(r(),this.flushing=!0),n[n.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.indexthis.capacity){for(let r=0,s=t.length-this.index;r{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=MV(this.flush),this.requestErrorThrow=V_(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class RV{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,n){this.onError=t,this.release=n,this.task=null}}class PV{create(t){const n=this.freeTasks,r=n.length?n.pop():new RV(this.onError,s=>n[n.length]=s);return r.task=t,r}constructor(t){this.onError=t,this.freeTasks=[]}}const H_=new _V,OV=new PV(H_.registerPendingError);function IV(e){H_.enqueueTask(OV.create(e))}function AV(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function DV(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:!1;gt(this.isSourceId(n),"Expected a valid source ID.");var s=r&&n===this.pinnedSourceId,o=s?this.pinnedSource:this.dragSources.get(n);return o}},{key:"getTarget",value:function(n){return gt(this.isTargetId(n),"Expected a valid target ID."),this.dropTargets.get(n)}},{key:"getSourceType",value:function(n){return gt(this.isSourceId(n),"Expected a valid source ID."),this.types.get(n)}},{key:"getTargetType",value:function(n){return gt(this.isTargetId(n),"Expected a valid target ID."),this.types.get(n)}},{key:"isSourceId",value:function(n){var r=U1(n);return r===os.SOURCE}},{key:"isTargetId",value:function(n){var r=U1(n);return r===os.TARGET}},{key:"removeSource",value:function(n){var r=this;gt(this.getSource(n),"Expected an existing source."),this.store.dispatch(aV(n)),IV(function(){r.dragSources.delete(n),r.types.delete(n)})}},{key:"removeTarget",value:function(n){gt(this.getTarget(n),"Expected an existing target."),this.store.dispatch(iV(n)),this.dropTargets.delete(n),this.types.delete(n)}},{key:"pinSource",value:function(n){var r=this.getSource(n);gt(r,"Expected an existing source."),this.pinnedSourceId=n,this.pinnedSource=r}},{key:"unpinSource",value:function(){gt(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(n,r,s){var o=VV(n);return this.types.set(o,r),n===os.SOURCE?this.dragSources.set(o,s):n===os.TARGET&&this.dropTargets.set(o,s),o}}]),e})();function qV(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,s=KV(r),o=new CV(s,new HV(s)),l=new Z8(s,o),u=e(l,t,n);return l.receiveBackend(u),l}function KV(e){var t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return B_(mV,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}var WV=["children"];function GV(e,t){return YV(e)||ZV(e,t)||QV(e,t)||JV()}function JV(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function QV(e,t){if(e){if(typeof e=="string")return H1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return H1(e,t)}}function H1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function eH(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,o;for(o=0;o=0)&&(n[s]=e[s]);return n}var q1=0,xp=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),tH=y.memo(function(t){var n=t.children,r=XV(t,WV),s=nH(r),o=GV(s,2),l=o[0],u=o[1];return y.useEffect(function(){if(u){var d=q_();return++q1,function(){--q1===0&&(d[xp]=null)}}},[]),i.jsx(L_.Provider,Object.assign({value:l},{children:n}),void 0)});function nH(e){if("manager"in e){var t={dragDropManager:e.manager};return[t,!1]}var n=rH(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[n,r]}function rH(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:q_(),n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,s=t;return s[xp]||(s[xp]={dragDropManager:qV(e,t,n,r)}),s[xp]}function q_(){return typeof global<"u"?global:window}function sH(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oH(e,t){for(var n=0;n, or turn it into a ")+"drag source or a drop target itself.")}}function pH(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!y.isValidElement(t)){var r=t;return e(r,n),r}var s=t;fH(s);var o=n?function(l){return e(l,n)}:e;return hH(s,o)}}function K_(e){var t={};return Object.keys(e).forEach(function(n){var r=e[n];if(n.endsWith("Ref"))t[n]=e[n];else{var s=pH(r);t[n]=function(){return s}}}),t}function G1(e,t){typeof e=="function"?e(t):e.current=t}function hH(e,t){var n=e.ref;return gt(typeof n!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a or
. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?y.cloneElement(e,{ref:function(s){G1(n,s),G1(t,s)}}):y.cloneElement(e,{ref:t})}function wp(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?wp=function(n){return typeof n}:wp=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},wp(e)}function eb(e){return e!==null&&wp(e)==="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function tb(e,t,n,r){var s=void 0;if(s!==void 0)return!!s;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;var o=Object.keys(e),l=Object.keys(t);if(o.length!==l.length)return!1;for(var u=Object.prototype.hasOwnProperty.bind(t),d=0;de.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0}},{key:"leave",value:function(n){var r=this.entered.length;return this.entered=Eq(this.entered.filter(this.isNodeInDocument),n),r>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),e})(),_q=J_(function(){return/firefox/i.test(navigator.userAgent)}),Q_=J_(function(){return!!window.safari});function Rq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pq(e,t){for(var n=0;nn)h=m-1;else return s[m]}d=Math.max(0,h);var x=n-r[d],b=x*x;return s[d]+o[d]*x+l[d]*b+u[d]*x*b}}]),e})(),Iq=1;function Z_(e){var t=e.nodeType===Iq?e:e.parentElement;if(!t)return null;var n=t.getBoundingClientRect(),r=n.top,s=n.left;return{x:s,y:r}}function Qf(e){return{x:e.clientX,y:e.clientY}}function Aq(e){var t;return e.nodeName==="IMG"&&(_q()||!((t=document.documentElement)!==null&&t!==void 0&&t.contains(e)))}function Dq(e,t,n,r){var s=e?t.width:n,o=e?t.height:r;return Q_()&&e&&(o/=window.devicePixelRatio,s/=window.devicePixelRatio),{dragPreviewWidth:s,dragPreviewHeight:o}}function Fq(e,t,n,r,s){var o=Aq(t),l=o?e:t,u=Z_(l),d={x:n.x-u.x,y:n.y-u.y},f=e.offsetWidth,h=e.offsetHeight,m=r.anchorX,g=r.anchorY,x=Dq(o,t,f,h),b=x.dragPreviewWidth,w=x.dragPreviewHeight,C=function(){var O=new nE([0,.5,1],[d.y,d.y/h*w,d.y+w-h]),D=O.interpolate(g);return Q_()&&o&&(D+=(window.devicePixelRatio-1)*w),D},k=function(){var O=new nE([0,.5,1],[d.x,d.x/f*b,d.x+b-f]);return O.interpolate(m)},j=s.offsetX,M=s.offsetY,_=j===0||j,R=M===0||M;return{x:_?j:k(),y:R?M:C()}}var Y_="__NATIVE_FILE__",X_="__NATIVE_URL__",eR="__NATIVE_TEXT__",tR="__NATIVE_HTML__";const rE=Object.freeze(Object.defineProperty({__proto__:null,FILE:Y_,HTML:tR,TEXT:eR,URL:X_},Symbol.toStringTag,{value:"Module"}));function $v(e,t,n){var r=t.reduce(function(s,o){return s||e.getData(o)},"");return r??n}var yl;function Zf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var rb=(yl={},Zf(yl,Y_,{exposeProperties:{files:function(t){return Array.prototype.slice.call(t.files)},items:function(t){return t.items},dataTransfer:function(t){return t}},matchesTypes:["Files"]}),Zf(yl,tR,{exposeProperties:{html:function(t,n){return $v(t,n,"")},dataTransfer:function(t){return t}},matchesTypes:["Html","text/html"]}),Zf(yl,X_,{exposeProperties:{urls:function(t,n){return $v(t,n,"").split(` +`)},dataTransfer:function(t){return t}},matchesTypes:["Url","text/uri-list"]}),Zf(yl,eR,{exposeProperties:{text:function(t,n){return $v(t,n,"")},dataTransfer:function(t){return t}},matchesTypes:["Text","text/plain"]}),yl);function Lq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $q(e,t){for(var n=0;n-1})})[0]||null}function Vq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Hq(e,t){for(var n=0;n0&&s.actions.hover(l,{clientOffset:Qf(o)});var u=l.some(function(d){return s.monitor.canDropOnTarget(d)});u&&(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=s.getCurrentDropEffect()))}}),jt(this,"handleTopDragOverCapture",function(){s.dragOverTargetIds=[]}),jt(this,"handleTopDragOver",function(o){var l=s.dragOverTargetIds;if(s.dragOverTargetIds=[],!s.monitor.isDragging()){o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none");return}s.altKeyPressed=o.altKey,s.lastClientOffset=Qf(o),s.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(s.hoverRafId=requestAnimationFrame(function(){s.monitor.isDragging()&&s.actions.hover(l||[],{clientOffset:s.lastClientOffset}),s.hoverRafId=null}));var u=(l||[]).some(function(d){return s.monitor.canDropOnTarget(d)});u?(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=s.getCurrentDropEffect())):s.isDraggingNativeItem()?o.preventDefault():(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none"))}),jt(this,"handleTopDragLeaveCapture",function(o){s.isDraggingNativeItem()&&o.preventDefault();var l=s.enterLeaveCounter.leave(o.target);l&&s.isDraggingNativeItem()&&setTimeout(function(){return s.endDragNativeItem()},0)}),jt(this,"handleTopDropCapture",function(o){if(s.dropTargetIds=[],s.isDraggingNativeItem()){var l;o.preventDefault(),(l=s.currentNativeSource)===null||l===void 0||l.loadDataTransfer(o.dataTransfer)}else Bv(o.dataTransfer)&&o.preventDefault();s.enterLeaveCounter.reset()}),jt(this,"handleTopDrop",function(o){var l=s.dropTargetIds;s.dropTargetIds=[],s.actions.hover(l,{clientOffset:Qf(o)}),s.actions.drop({dropEffect:s.getCurrentDropEffect()}),s.isDraggingNativeItem()?s.endDragNativeItem():s.monitor.isDragging()&&s.actions.endDrag()}),jt(this,"handleSelectStart",function(o){var l=o.target;typeof l.dragDrop=="function"&&(l.tagName==="INPUT"||l.tagName==="SELECT"||l.tagName==="TEXTAREA"||l.isContentEditable||(o.preventDefault(),l.dragDrop()))}),this.options=new Kq(n,r),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new Mq(this.isNodeInDocument)}return Jq(e,[{key:"profile",value:function(){var n,r;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((n=this.dragStartSourceIds)===null||n===void 0?void 0:n.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((r=this.dragOverTargetIds)===null||r===void 0?void 0:r.length)||0}}},{key:"window",get:function(){return this.options.window}},{key:"document",get:function(){return this.options.document}},{key:"rootElement",get:function(){return this.options.rootElement}},{key:"setup",value:function(){var n=this.rootElement;if(n!==void 0){if(n.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");n.__isReactDndBackendSetUp=!0,this.addEventListeners(n)}}},{key:"teardown",value:function(){var n=this.rootElement;if(n!==void 0&&(n.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var r;(r=this.window)===null||r===void 0||r.cancelAnimationFrame(this.asyncEndDragFrameId)}}},{key:"connectDragPreview",value:function(n,r,s){var o=this;return this.sourcePreviewNodeOptions.set(n,s),this.sourcePreviewNodes.set(n,r),function(){o.sourcePreviewNodes.delete(n),o.sourcePreviewNodeOptions.delete(n)}}},{key:"connectDragSource",value:function(n,r,s){var o=this;this.sourceNodes.set(n,r),this.sourceNodeOptions.set(n,s);var l=function(f){return o.handleDragStart(f,n)},u=function(f){return o.handleSelectStart(f)};return r.setAttribute("draggable","true"),r.addEventListener("dragstart",l),r.addEventListener("selectstart",u),function(){o.sourceNodes.delete(n),o.sourceNodeOptions.delete(n),r.removeEventListener("dragstart",l),r.removeEventListener("selectstart",u),r.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(n,r){var s=this,o=function(f){return s.handleDragEnter(f,n)},l=function(f){return s.handleDragOver(f,n)},u=function(f){return s.handleDrop(f,n)};return r.addEventListener("dragenter",o),r.addEventListener("dragover",l),r.addEventListener("drop",u),function(){r.removeEventListener("dragenter",o),r.removeEventListener("dragover",l),r.removeEventListener("drop",u)}}},{key:"addEventListeners",value:function(n){n.addEventListener&&(n.addEventListener("dragstart",this.handleTopDragStart),n.addEventListener("dragstart",this.handleTopDragStartCapture,!0),n.addEventListener("dragend",this.handleTopDragEndCapture,!0),n.addEventListener("dragenter",this.handleTopDragEnter),n.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),n.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),n.addEventListener("dragover",this.handleTopDragOver),n.addEventListener("dragover",this.handleTopDragOverCapture,!0),n.addEventListener("drop",this.handleTopDrop),n.addEventListener("drop",this.handleTopDropCapture,!0))}},{key:"removeEventListeners",value:function(n){n.removeEventListener&&(n.removeEventListener("dragstart",this.handleTopDragStart),n.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),n.removeEventListener("dragend",this.handleTopDragEndCapture,!0),n.removeEventListener("dragenter",this.handleTopDragEnter),n.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),n.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),n.removeEventListener("dragover",this.handleTopDragOver),n.removeEventListener("dragover",this.handleTopDragOverCapture,!0),n.removeEventListener("drop",this.handleTopDrop),n.removeEventListener("drop",this.handleTopDropCapture,!0))}},{key:"getCurrentSourceNodeOptions",value:function(){var n=this.monitor.getSourceId(),r=this.sourceNodeOptions.get(n);return aE({dropEffect:this.altKeyPressed?"copy":"move"},r||{})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var n=this.monitor.getSourceId(),r=this.sourcePreviewNodeOptions.get(n);return aE({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}},{key:"isDraggingNativeItem",value:function(){var n=this.monitor.getItemType();return Object.keys(rE).some(function(r){return rE[r]===n})}},{key:"beginDragNativeItem",value:function(n,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=Uq(n,r),this.currentNativeHandle=this.registry.addSource(n,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(n){var r=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=n;var s=1e3;this.mouseMoveTimeoutTimer=setTimeout(function(){var o;return(o=r.rootElement)===null||o===void 0?void 0:o.addEventListener("mousemove",r.endDragIfSourceWasRemovedFromDOM,!0)},s)}},{key:"clearCurrentDragSourceNode",value:function(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var n;(n=this.window)===null||n===void 0||n.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}},{key:"handleDragStart",value:function(n,r){n.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(r))}},{key:"handleDragEnter",value:function(n,r){this.dragEnterTargetIds.unshift(r)}},{key:"handleDragOver",value:function(n,r){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(r)}},{key:"handleDrop",value:function(n,r){this.dropTargetIds.unshift(r)}}]),e})(),Zq=function(t,n,r){return new Qq(t,n,r)},Yq=Object.create,nR=Object.defineProperty,Xq=Object.getOwnPropertyDescriptor,rR=Object.getOwnPropertyNames,e7=Object.getPrototypeOf,t7=Object.prototype.hasOwnProperty,n7=(e,t)=>function(){return t||(0,e[rR(e)[0]])((t={exports:{}}).exports,t),t.exports},r7=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of rR(t))!t7.call(e,s)&&s!==n&&nR(e,s,{get:()=>t[s],enumerable:!(r=Xq(t,s))||r.enumerable});return e},sR=(e,t,n)=>(n=e!=null?Yq(e7(e)):{},r7(nR(n,"default",{value:e,enumerable:!0}),e)),oR=n7({"node_modules/classnames/index.js"(e,t){(function(){var n={}.hasOwnProperty;function r(){for(var s=[],o=0;o-1}var dK=uK,fK=9007199254740991,pK=/^(?:0|[1-9]\d*)$/;function hK(e,t){var n=typeof e;return t=t??fK,!!t&&(n=="number"||n!="symbol"&&pK.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=vK}var fR=yK;function bK(e){return e!=null&&fR(e.length)&&!uR(e)}var xK=bK,wK=Object.prototype;function SK(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||wK;return e===n}var CK=SK;function EK(e,t){for(var n=-1,r=Array(e);++n-1}var t9=e9;function n9(e,t){var n=this.__data__,r=Xh(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var r9=n9;function dc(e){var t=-1,n=e==null?0:e.length;for(this.clear();++tu))return!1;var f=o.get(e),h=o.get(t);if(f&&h)return f==t&&h==e;var m=-1,g=!0,x=n&uG?new bR:void 0;for(o.set(e,t),o.set(t,e);++m":">",'"':""","'":"'"},VG=S9(UG),HG=VG,CR=/[&<>"']/g,qG=RegExp(CR.source);function KG(e){return e=yR(e),e&&qG.test(e)?e.replace(CR,HG):e}var WG=KG,ER=/[\\^$.*+?()[\]{}|]/g,GG=RegExp(ER.source);function JG(e){return e=yR(e),e&&GG.test(e)?e.replace(ER,"\\$&"):e}var QG=JG;function ZG(e,t){return $G(e,t)}var YG=ZG,XG=1/0,eJ=Al&&1/Lx(new Al([,-0]))[1]==XG?function(e){return new Al(e)}:tK,tJ=eJ,nJ=200;function rJ(e,t,n){var r=-1,s=dK,o=e.length,l=!0,u=[],d=u;if(n)l=!1,s=zG;else if(o>=nJ){var f=t?null:tJ(e);if(f)return Lx(f);l=!1,s=xR,d=new bR}else d=t?[]:u;e:for(;++ri.jsx("button",{className:e.classNames.clearAll,onClick:e.onClick,children:"Clear all"}),lJ=iJ,cJ=(e,t)=>{const n=t.offsetHeight,r=e.offsetHeight,s=e.offsetTop-t.scrollTop;s+r>=n?t.scrollTop+=s-n+r:s<0&&(t.scrollTop+=s)},lb=(e,t,n,r)=>typeof r=="function"?r(e):e.length>=t&&n,uJ=e=>{const t=y.createRef(),{labelField:n,minQueryLength:r,isFocused:s,classNames:o,selectedIndex:l,query:u}=e;y.useEffect(()=>{if(!t.current)return;const m=t.current.querySelector(`.${o.activeSuggestion}`);m&&cJ(m,t.current)},[l]);const d=(m,g)=>{const x=g.trim().replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&"),{[n]:b}=m;return{__html:b.replace(RegExp(x,"gi"),w=>`${WG(w)}`)}},f=(m,g)=>typeof e.renderSuggestion=="function"?e.renderSuggestion(m,g):i.jsx("span",{dangerouslySetInnerHTML:d(m,g)}),h=e.suggestions.map((m,g)=>i.jsx("li",{onMouseDown:e.handleClick.bind(null,g),onTouchStart:e.handleClick.bind(null,g),onMouseOver:e.handleHover.bind(null,g),className:g===e.selectedIndex?e.classNames.activeSuggestion:"",children:f(m,e.query)},g));return h.length===0||!lb(u,r||2,s,e.shouldRenderSuggestions)?null:i.jsx("div",{ref:t,className:o.suggestions,"data-testid":"suggestions",children:i.jsxs("ul",{children:[" ",h," "]})})},dJ=(e,t)=>{const{query:n,minQueryLength:r=2,isFocused:s,suggestions:o}=t;return!!(e.isFocused===s&&YG(e.suggestions,o)&&lb(n,r,s,t.shouldRenderSuggestions)===lb(e.query,e.minQueryLength??2,e.isFocused,e.shouldRenderSuggestions)&&e.selectedIndex===t.selectedIndex)},fJ=y.memo(uJ,dJ),pJ=fJ,hJ=sR(oR()),gJ=sR(oR());function mJ(e){const t=e.map(r=>{const s=r-48*Math.floor(r/48);return String.fromCharCode(96<=r?s:r)}).join(""),n=QG(t);return new RegExp(`[${n}]+`)}function vJ(e){switch(e){case Vs.ENTER:return[10,13];case Vs.TAB:return 9;case Vs.COMMA:return 188;case Vs.SPACE:return 32;case Vs.SEMICOLON:return 186;default:return 0}}function PE(e){const{moveTag:t,readOnly:n,allowDragDrop:r}=e;return t!==void 0&&!n&&r}function yJ(e){const{readOnly:t,allowDragDrop:n}=e;return!t&&n}var bJ=e=>{const{readOnly:t,removeComponent:n,onRemove:r,className:s,tag:o,index:l}=e,u=f=>{if(Il.ENTER.includes(f.keyCode)||f.keyCode===Il.SPACE){f.preventDefault(),f.stopPropagation();return}f.keyCode===Il.BACKSPACE&&r(f)};if(t)return i.jsx("span",{});const d=`Tag at index ${l} with value ${o.id} focussed. Press backspace to remove`;if(n){const f=n;return i.jsx(f,{"data-testid":"remove",onRemove:r,onKeyDown:u,className:s,"aria-label":d,tag:o,index:l})}return i.jsx("button",{"data-testid":"remove",onClick:r,onKeyDown:u,className:s,type:"button","aria-label":d,children:i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",height:"12",width:"12",fill:"#fff",children:i.jsx("path",{d:"M376.6 84.5c11.3-13.6 9.5-33.8-4.1-45.1s-33.8-9.5-45.1 4.1L192 206 56.6 43.5C45.3 29.9 25.1 28.1 11.5 39.4S-3.9 70.9 7.4 84.5L150.3 256 7.4 427.5c-11.3 13.6-9.5 33.8 4.1 45.1s33.8 9.5 45.1-4.1L192 306 327.4 468.5c11.3 13.6 31.5 15.4 45.1 4.1s15.4-31.5 4.1-45.1L233.7 256 376.6 84.5z"})})})},xJ=bJ,OE={TAG:"tag"},wJ=e=>{const t=y.useRef(null),{readOnly:n=!1,tag:r,classNames:s,index:o,moveTag:l,allowDragDrop:u=!0,labelField:d="text",tags:f}=e,[{isDragging:h},m]=iq(()=>({type:OE.TAG,collect:C=>({isDragging:!!C.isDragging()}),item:e,canDrag:()=>PE({moveTag:l,readOnly:n,allowDragDrop:u})}),[f]),[,g]=Cq(()=>({accept:OE.TAG,drop:C=>{const k=C.index,j=o;k!==j&&e?.moveTag?.(k,j)},canDrop:C=>yJ(C)}),[f]);m(g(t));const x=e.tag[d],{className:b=""}=r,w=h?0:1;return i.jsxs("span",{ref:t,className:(0,gJ.default)("tag-wrapper",s.tag,b),style:{opacity:w,cursor:PE({moveTag:l,readOnly:n,allowDragDrop:u})?"move":"auto"},"data-testid":"tag",onClick:e.onTagClicked,onTouchStart:e.onTagClicked,children:[x,i.jsx(xJ,{tag:e.tag,className:s.remove,removeComponent:e.removeComponent,onRemove:e.onDelete,readOnly:n,index:o})]})},SJ=e=>{const{autofocus:t,autoFocus:n,readOnly:r,labelField:s,allowDeleteFromEmptyInput:o,allowAdditionFromPaste:l,allowDragDrop:u,minQueryLength:d,shouldRenderSuggestions:f,removeComponent:h,autocomplete:m,inline:g,maxTags:x,allowUnique:b,editable:w,placeholder:C,delimiters:k,separators:j,tags:M,inputFieldPosition:_,inputProps:R,classNames:N,maxLength:O,inputValue:D,clearAll:z}=e,[Q,pe]=y.useState(e.suggestions),[V,G]=y.useState(""),[W,ie]=y.useState(!1),[re,Y]=y.useState(-1),[H,q]=y.useState(!1),[he,A]=y.useState(""),[F,fe]=y.useState(-1),[te,de]=y.useState(""),ge=y.createRef(),Z=y.useRef(null),ye=y.useRef(null);y.useEffect(()=>{k.length&&console.warn("[Deprecation] The delimiters prop is deprecated and will be removed in v7.x.x, please use separators instead. If you have any concerns regarding this, please share your thoughts in https://github.com/react-tags/react-tags/issues/960")},[]),y.useEffect(()=>{typeof g<"u"&&console.warn("[Deprecation] The inline attribute is deprecated and will be removed in v7.x.x, please use inputFieldPosition instead.")},[g]),y.useEffect(()=>{typeof t<"u"&&console.warn("[Deprecated] autofocus prop will be removed in 7.x so please migrate to autoFocus prop."),(t||n&&t!==!1)&&!r&&Ye()},[n,n,r]),y.useEffect(()=>{vn()},[V,e.suggestions]);const Re=Te=>{let ut=e.suggestions.slice();if(b){const mr=M.map(vr=>vr.id.trim().toLowerCase());ut=ut.filter(vr=>!mr.includes(vr.id.toLowerCase()))}if(e.handleFilterSuggestions)return e.handleFilterSuggestions(Te,ut);const It=ut.filter(mr=>$e(Te,mr)===0),Tn=ut.filter(mr=>$e(Te,mr)>0);return It.concat(Tn)},$e=(Te,ut)=>ut[s].toLowerCase().indexOf(Te.toLowerCase()),Ye=()=>{G(""),Z.current&&(Z.current.value="",Z.current.focus())},Fe=(Te,ut)=>{ut.preventDefault(),ut.stopPropagation();const It=M.slice();It.length!==0&&(de(""),e?.handleDelete?.(Te,ut),ft(Te,It))},ft=(Te,ut)=>{if(!ge?.current)return;const It=ge.current.querySelectorAll(".ReactTags__remove");let Tn="";Te===0&&ut.length>1?(Tn=`Tag at index ${Te} with value ${ut[Te].id} deleted. Tag at index 0 with value ${ut[1].id} focussed. Press backspace to remove`,It[0].focus()):Te>0?(Tn=`Tag at index ${Te} with value ${ut[Te].id} deleted. Tag at index ${Te-1} with value ${ut[Te-1].id} focussed. Press backspace to remove`,It[Te-1].focus()):(Tn=`Tag at index ${Te} with value ${ut[Te].id} deleted. Input focussed. Press enter to add a new tag`,Z.current?.focus()),A(Tn)},ln=(Te,ut,It)=>{r||(w&&(fe(Te),G(ut[s]),ye.current?.focus()),e.handleTagClick?.(Te,It))},Sn=Te=>{e.handleInputChange&&e.handleInputChange(Te.target.value,Te);const ut=Te.target.value.trim();G(ut)},vn=()=>{const Te=Re(V);pe(Te),Y(re>=Te.length?Te.length-1:re)},Cn=Te=>{const ut=Te.target.value;e.handleInputFocus&&e.handleInputFocus(ut,Te),ie(!0)},L=Te=>{const ut=Te.target.value;e.handleInputBlur&&(e.handleInputBlur(ut,Te),Z.current&&(Z.current.value="")),ie(!1),fe(-1)},X=Te=>{if(Te.key==="Escape"&&(Te.preventDefault(),Te.stopPropagation(),Y(-1),q(!1),pe([]),fe(-1)),(j.indexOf(Te.key)!==-1||k.indexOf(Te.keyCode)!==-1)&&!Te.shiftKey){(Te.keyCode!==Il.TAB||V!=="")&&Te.preventDefault();const ut=H&&re!==-1?Q[re]:{id:V.trim(),[s]:V.trim(),className:""};Object.keys(ut)&&je(ut)}Te.key==="Backspace"&&V===""&&(o||_===cu.INLINE)&&Fe(M.length-1,Te),Te.keyCode===Il.UP_ARROW&&(Te.preventDefault(),Y(re<=0?Q.length-1:re-1),q(!0)),Te.keyCode===Il.DOWN_ARROW&&(Te.preventDefault(),q(!0),Q.length===0?Y(-1):Y((re+1)%Q.length))},ue=()=>x&&M.length>=x,Ne=Te=>{if(!l)return;if(ue()){de(lE.TAG_LIMIT),Ye();return}de(""),Te.preventDefault();const ut=Te.clipboardData||window.clipboardData,It=ut.getData("text"),{maxLength:Tn=It.length}=e,mr=Math.min(Tn,It.length),vr=ut.getData("text").substr(0,mr);let Gr=k;j.length&&(Gr=[],j.forEach(Rr=>{const Uo=vJ(Rr);Array.isArray(Uo)?Gr=[...Gr,...Uo]:Gr.push(Uo)}));const Jr=mJ(Gr),_r=vr.split(Jr).map(Rr=>Rr.trim());aJ(_r).forEach(Rr=>je({id:Rr.trim(),[s]:Rr.trim(),className:""}))},je=Te=>{if(!Te.id||!Te[s])return;if(F===-1){if(ue()){de(lE.TAG_LIMIT),Ye();return}de("")}const ut=M.map(It=>It.id.toLowerCase());if(!(b&&ut.indexOf(Te.id.trim().toLowerCase())>=0)){if(m){const It=Re(Te[s]);console.warn("[Deprecation] The autocomplete prop will be removed in 7.x to simplify the integration and make it more intutive. If you have any concerns regarding this, please share your thoughts in https://github.com/react-tags/react-tags/issues/949"),(m===1&&It.length===1||m===!0&&It.length)&&(Te=It[0])}F!==-1&&e.onTagUpdate?e.onTagUpdate(F,Te):e?.handleAddition?.(Te),G(""),q(!1),Y(-1),fe(-1),Ye()}},Se=Te=>{je(Q[Te])},Be=()=>{e.onClearAll&&e.onClearAll(),de(""),Ye()},bt=Te=>{Y(Te),q(!0)},Wt=(Te,ut)=>{const It=M[Te];e?.handleDrag?.(It,Te,ut)},bn=(()=>{const Te={...iE,...e.classNames};return M.map((ut,It)=>i.jsx(y.Fragment,{children:F===It?i.jsx("div",{className:Te.editTagInput,children:i.jsx("input",{ref:Tn=>{ye.current=Tn},onFocus:Cn,value:V,onChange:Sn,onKeyDown:X,onBlur:L,className:Te.editTagInputField,onPaste:Ne,"data-testid":"tag-edit"})}):i.jsx(wJ,{index:It,tag:ut,tags:M,labelField:s,onDelete:Tn=>Fe(It,Tn),moveTag:u?Wt:void 0,removeComponent:h,onTagClicked:Tn=>ln(It,ut,Tn),readOnly:r,classNames:Te,allowDragDrop:u})},It))})(),En={...iE,...N},{name:gr,id:Qn}=e,ro=g===!1?cu.BOTTOM:_,Bn=r?null:i.jsxs("div",{className:En.tagInput,children:[i.jsx("input",{...R,ref:Te=>{Z.current=Te},className:En.tagInputField,type:"text",placeholder:C,"aria-label":C,onFocus:Cn,onBlur:L,onChange:Sn,onKeyDown:X,onPaste:Ne,name:gr,id:Qn,maxLength:O,value:D,"data-automation":"input","data-testid":"input"}),i.jsx(pJ,{query:V.trim(),suggestions:Q,labelField:s,selectedIndex:re,handleClick:Se,handleHover:bt,minQueryLength:d,shouldRenderSuggestions:f,isFocused:W,classNames:En,renderSuggestion:e.renderSuggestion}),z&&M.length>0&&i.jsx(lJ,{classNames:En,onClick:Be}),te&&i.jsxs("div",{"data-testid":"error",className:"ReactTags__error",children:[i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",height:"24",width:"24",fill:"#e03131",children:i.jsx("path",{d:"M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"})}),te]})]});return i.jsxs("div",{className:(0,hJ.default)(En.tags,"react-tags-wrapper"),ref:ge,children:[i.jsx("p",{role:"alert",className:"sr-only",style:{position:"absolute",overflow:"hidden",clip:"rect(0 0 0 0)",margin:"-1px",padding:0,width:"1px",height:"1px",border:0},children:he}),ro===cu.TOP&&Bn,i.jsxs("div",{className:En.selected,children:[bn,ro===cu.INLINE&&Bn]}),ro===cu.BOTTOM&&Bn]})},CJ=SJ,EJ=e=>{const{placeholder:t=s7,labelField:n=o7,suggestions:r=[],delimiters:s=[],separators:o=e.delimiters?.length?[]:[Vs.ENTER,Vs.TAB],autofocus:l,autoFocus:u=!0,inline:d,inputFieldPosition:f="inline",allowDeleteFromEmptyInput:h=!1,allowAdditionFromPaste:m=!0,autocomplete:g=!1,readOnly:x=!1,allowUnique:b=!0,allowDragDrop:w=!0,tags:C=[],inputProps:k={},editable:j=!1,clearAll:M=!1,handleDelete:_,handleAddition:R,onTagUpdate:N,handleDrag:O,handleFilterSuggestions:D,handleTagClick:z,handleInputChange:Q,handleInputFocus:pe,handleInputBlur:V,minQueryLength:G,shouldRenderSuggestions:W,removeComponent:ie,onClearAll:re,classNames:Y,name:H,id:q,maxLength:he,inputValue:A,maxTags:F,renderSuggestion:fe}=e;return i.jsx(CJ,{placeholder:t,labelField:n,suggestions:r,delimiters:s,separators:o,autofocus:l,autoFocus:u,inline:d,inputFieldPosition:f,allowDeleteFromEmptyInput:h,allowAdditionFromPaste:m,autocomplete:g,readOnly:x,allowUnique:b,allowDragDrop:w,tags:C,inputProps:k,editable:j,clearAll:M,handleDelete:_,handleAddition:R,onTagUpdate:N,handleDrag:O,handleFilterSuggestions:D,handleTagClick:z,handleInputChange:Q,handleInputFocus:pe,handleInputBlur:V,minQueryLength:G,shouldRenderSuggestions:W,removeComponent:ie,onClearAll:re,classNames:Y,name:H,id:q,maxLength:he,inputValue:A,maxTags:F,renderSuggestion:fe})},kJ=({...e})=>i.jsx(tH,{backend:Zq,children:i.jsx(EJ,{...e})});/*! Bundled license information: + +classnames/index.js: + (*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames + *) + +lodash-es/lodash.js: + (** + * @license + * Lodash (Custom Build) + * Build: `lodash modularize exports="es" -o ./` + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + *) +*/var jJ="Label",kR=y.forwardRef((e,t)=>i.jsx(rt.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));kR.displayName=jJ;var jR=kR;const TJ=jh("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),TR=y.forwardRef(({className:e,...t},n)=>i.jsx(jR,{ref:n,className:Ie(TJ(),e),...t}));TR.displayName=jR.displayName;function NR(e){const t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var NJ="VisuallyHidden",MR=y.forwardRef((e,t)=>i.jsx(rt.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));MR.displayName=NJ;var MJ=[" ","Enter","ArrowUp","ArrowDown"],_J=[" ","Enter"],jd="Select",[ng,rg,RJ]=Kb(jd),[hc]=us(jd,[RJ,Oh]),sg=Oh(),[PJ,Ia]=hc(jd),[OJ,IJ]=hc(jd),_R=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:o,value:l,defaultValue:u,onValueChange:d,dir:f,name:h,autoComplete:m,disabled:g,required:x}=e,b=sg(t),[w,C]=y.useState(null),[k,j]=y.useState(null),[M,_]=y.useState(!1),R=xd(f),[N=!1,O]=ya({prop:r,defaultProp:s,onChange:o}),[D,z]=ya({prop:l,defaultProp:u,onChange:d}),Q=y.useRef(null),pe=w?!!w.closest("form"):!0,[V,G]=y.useState(new Set),W=Array.from(V).map(ie=>ie.props.value).join(";");return i.jsx(ZT,{...b,children:i.jsxs(PJ,{required:x,scope:t,trigger:w,onTriggerChange:C,valueNode:k,onValueNodeChange:j,valueNodeHasChildren:M,onValueNodeHasChildrenChange:_,contentId:Es(),value:D,onValueChange:z,open:N,onOpenChange:O,dir:R,triggerPointerDownPosRef:Q,disabled:g,children:[i.jsx(ng.Provider,{scope:t,children:i.jsx(OJ,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(ie=>{G(re=>new Set(re).add(ie))},[]),onNativeOptionRemove:y.useCallback(ie=>{G(re=>{const Y=new Set(re);return Y.delete(ie),Y})},[]),children:n})}),pe?i.jsxs(tP,{"aria-hidden":!0,required:x,tabIndex:-1,name:h,autoComplete:m,value:D,onChange:ie=>z(ie.target.value),disabled:g,children:[D===void 0?i.jsx("option",{value:""}):null,Array.from(V)]},W):null]})})};_R.displayName=jd;var RR="SelectTrigger",PR=y.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,o=sg(n),l=Ia(RR,n),u=l.disabled||r,d=Rt(t,l.onTriggerChange),f=rg(n),[h,m,g]=nP(b=>{const w=f().filter(j=>!j.disabled),C=w.find(j=>j.value===l.value),k=rP(w,b,C);k!==void 0&&l.onValueChange(k.value)}),x=()=>{u||(l.onOpenChange(!0),g())};return i.jsx(YT,{asChild:!0,...o,children:i.jsx(rt.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":eP(l.value)?"":void 0,...s,ref:d,onClick:Ue(s.onClick,b=>{b.currentTarget.focus()}),onPointerDown:Ue(s.onPointerDown,b=>{const w=b.target;w.hasPointerCapture(b.pointerId)&&w.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&(x(),l.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)},b.preventDefault())}),onKeyDown:Ue(s.onKeyDown,b=>{const w=h.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&m(b.key),!(w&&b.key===" ")&&MJ.includes(b.key)&&(x(),b.preventDefault())})})})});PR.displayName=RR;var OR="SelectValue",IR=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:o,placeholder:l="",...u}=e,d=Ia(OR,n),{onValueNodeHasChildrenChange:f}=d,h=o!==void 0,m=Rt(t,d.onValueNodeChange);return Ln(()=>{f(h)},[f,h]),i.jsx(rt.span,{...u,ref:m,style:{pointerEvents:"none"},children:eP(d.value)?i.jsx(i.Fragment,{children:l}):o})});IR.displayName=OR;var AJ="SelectIcon",AR=y.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return i.jsx(rt.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});AR.displayName=AJ;var DJ="SelectPortal",DR=e=>i.jsx(Ih,{asChild:!0,...e});DR.displayName=DJ;var _i="SelectContent",FR=y.forwardRef((e,t)=>{const n=Ia(_i,e.__scopeSelect),[r,s]=y.useState();if(Ln(()=>{s(new DocumentFragment)},[]),!n.open){const o=r;return o?Ma.createPortal(i.jsx(LR,{scope:e.__scopeSelect,children:i.jsx(ng.Slot,{scope:e.__scopeSelect,children:i.jsx("div",{children:e.children})})}),o):null}return i.jsx($R,{...e,ref:t})});FR.displayName=_i;var vo=10,[LR,Aa]=hc(_i),FJ="SelectContentImpl",$R=y.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:l,side:u,sideOffset:d,align:f,alignOffset:h,arrowPadding:m,collisionBoundary:g,collisionPadding:x,sticky:b,hideWhenDetached:w,avoidCollisions:C,...k}=e,j=Ia(_i,n),[M,_]=y.useState(null),[R,N]=y.useState(null),O=Rt(t,Z=>_(Z)),[D,z]=y.useState(null),[Q,pe]=y.useState(null),V=rg(n),[G,W]=y.useState(!1),ie=y.useRef(!1);y.useEffect(()=>{if(M)return nx(M)},[M]),Wb();const re=y.useCallback(Z=>{const[ye,...Re]=V().map(Fe=>Fe.ref.current),[$e]=Re.slice(-1),Ye=document.activeElement;for(const Fe of Z)if(Fe===Ye||(Fe?.scrollIntoView({block:"nearest"}),Fe===ye&&R&&(R.scrollTop=0),Fe===$e&&R&&(R.scrollTop=R.scrollHeight),Fe?.focus(),document.activeElement!==Ye))return},[V,R]),Y=y.useCallback(()=>re([D,M]),[re,D,M]);y.useEffect(()=>{G&&Y()},[G,Y]);const{onOpenChange:H,triggerPointerDownPosRef:q}=j;y.useEffect(()=>{if(M){let Z={x:0,y:0};const ye=$e=>{Z={x:Math.abs(Math.round($e.pageX)-(q.current?.x??0)),y:Math.abs(Math.round($e.pageY)-(q.current?.y??0))}},Re=$e=>{Z.x<=10&&Z.y<=10?$e.preventDefault():M.contains($e.target)||H(!1),document.removeEventListener("pointermove",ye),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",ye),document.addEventListener("pointerup",Re,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ye),document.removeEventListener("pointerup",Re,{capture:!0})}}},[M,H,q]),y.useEffect(()=>{const Z=()=>H(!1);return window.addEventListener("blur",Z),window.addEventListener("resize",Z),()=>{window.removeEventListener("blur",Z),window.removeEventListener("resize",Z)}},[H]);const[he,A]=nP(Z=>{const ye=V().filter(Ye=>!Ye.disabled),Re=ye.find(Ye=>Ye.ref.current===document.activeElement),$e=rP(ye,Z,Re);$e&&setTimeout(()=>$e.ref.current.focus())}),F=y.useCallback((Z,ye,Re)=>{const $e=!ie.current&&!Re;(j.value!==void 0&&j.value===ye||$e)&&(z(Z),$e&&(ie.current=!0))},[j.value]),fe=y.useCallback(()=>M?.focus(),[M]),te=y.useCallback((Z,ye,Re)=>{const $e=!ie.current&&!Re;(j.value!==void 0&&j.value===ye||$e)&&pe(Z)},[j.value]),de=r==="popper"?cb:BR,ge=de===cb?{side:u,sideOffset:d,align:f,alignOffset:h,arrowPadding:m,collisionBoundary:g,collisionPadding:x,sticky:b,hideWhenDetached:w,avoidCollisions:C}:{};return i.jsx(LR,{scope:n,content:M,viewport:R,onViewportChange:N,itemRefCallback:F,selectedItem:D,onItemLeave:fe,itemTextRefCallback:te,focusSelectedItem:Y,selectedItemText:Q,position:r,isPositioned:G,searchRef:he,children:i.jsx(Lh,{as:No,allowPinchZoom:!0,children:i.jsx(_h,{asChild:!0,trapped:j.open,onMountAutoFocus:Z=>{Z.preventDefault()},onUnmountAutoFocus:Ue(s,Z=>{j.trigger?.focus({preventScroll:!0}),Z.preventDefault()}),children:i.jsx(Mh,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:Z=>Z.preventDefault(),onDismiss:()=>j.onOpenChange(!1),children:i.jsx(de,{role:"listbox",id:j.contentId,"data-state":j.open?"open":"closed",dir:j.dir,onContextMenu:Z=>Z.preventDefault(),...k,...ge,onPlaced:()=>W(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...k.style},onKeyDown:Ue(k.onKeyDown,Z=>{const ye=Z.ctrlKey||Z.altKey||Z.metaKey;if(Z.key==="Tab"&&Z.preventDefault(),!ye&&Z.key.length===1&&A(Z.key),["ArrowUp","ArrowDown","Home","End"].includes(Z.key)){let $e=V().filter(Ye=>!Ye.disabled).map(Ye=>Ye.ref.current);if(["ArrowUp","End"].includes(Z.key)&&($e=$e.slice().reverse()),["ArrowUp","ArrowDown"].includes(Z.key)){const Ye=Z.target,Fe=$e.indexOf(Ye);$e=$e.slice(Fe+1)}setTimeout(()=>re($e)),Z.preventDefault()}})})})})})})});$R.displayName=FJ;var LJ="SelectItemAlignedPosition",BR=y.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,o=Ia(_i,n),l=Aa(_i,n),[u,d]=y.useState(null),[f,h]=y.useState(null),m=Rt(t,O=>h(O)),g=rg(n),x=y.useRef(!1),b=y.useRef(!0),{viewport:w,selectedItem:C,selectedItemText:k,focusSelectedItem:j}=l,M=y.useCallback(()=>{if(o.trigger&&o.valueNode&&u&&f&&w&&C&&k){const O=o.trigger.getBoundingClientRect(),D=f.getBoundingClientRect(),z=o.valueNode.getBoundingClientRect(),Q=k.getBoundingClientRect();if(o.dir!=="rtl"){const Ye=Q.left-D.left,Fe=z.left-Ye,ft=O.left-Fe,ln=O.width+ft,Sn=Math.max(ln,D.width),vn=window.innerWidth-vo,Cn=Ky(Fe,[vo,vn-Sn]);u.style.minWidth=ln+"px",u.style.left=Cn+"px"}else{const Ye=D.right-Q.right,Fe=window.innerWidth-z.right-Ye,ft=window.innerWidth-O.right-Fe,ln=O.width+ft,Sn=Math.max(ln,D.width),vn=window.innerWidth-vo,Cn=Ky(Fe,[vo,vn-Sn]);u.style.minWidth=ln+"px",u.style.right=Cn+"px"}const pe=g(),V=window.innerHeight-vo*2,G=w.scrollHeight,W=window.getComputedStyle(f),ie=parseInt(W.borderTopWidth,10),re=parseInt(W.paddingTop,10),Y=parseInt(W.borderBottomWidth,10),H=parseInt(W.paddingBottom,10),q=ie+re+G+H+Y,he=Math.min(C.offsetHeight*5,q),A=window.getComputedStyle(w),F=parseInt(A.paddingTop,10),fe=parseInt(A.paddingBottom,10),te=O.top+O.height/2-vo,de=V-te,ge=C.offsetHeight/2,Z=C.offsetTop+ge,ye=ie+re+Z,Re=q-ye;if(ye<=te){const Ye=C===pe[pe.length-1].ref.current;u.style.bottom="0px";const Fe=f.clientHeight-w.offsetTop-w.offsetHeight,ft=Math.max(de,ge+(Ye?fe:0)+Fe+Y),ln=ye+ft;u.style.height=ln+"px"}else{const Ye=C===pe[0].ref.current;u.style.top="0px";const ft=Math.max(te,ie+w.offsetTop+(Ye?F:0)+ge)+Re;u.style.height=ft+"px",w.scrollTop=ye-te+w.offsetTop}u.style.margin=`${vo}px 0`,u.style.minHeight=he+"px",u.style.maxHeight=V+"px",r?.(),requestAnimationFrame(()=>x.current=!0)}},[g,o.trigger,o.valueNode,u,f,w,C,k,o.dir,r]);Ln(()=>M(),[M]);const[_,R]=y.useState();Ln(()=>{f&&R(window.getComputedStyle(f).zIndex)},[f]);const N=y.useCallback(O=>{O&&b.current===!0&&(M(),j?.(),b.current=!1)},[M,j]);return i.jsx(BJ,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:x,onScrollButtonChange:N,children:i.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:i.jsx(rt.div,{...s,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});BR.displayName=LJ;var $J="SelectPopperPosition",cb=y.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=vo,...o}=e,l=sg(n);return i.jsx(XT,{...l,...o,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});cb.displayName=$J;var[BJ,$x]=hc(_i,{}),ub="SelectViewport",zR=y.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,o=Aa(ub,n),l=$x(ub,n),u=Rt(t,o.onViewportChange),d=y.useRef(0);return i.jsxs(i.Fragment,{children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),i.jsx(ng.Slot,{scope:n,children:i.jsx(rt.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:u,style:{position:"relative",flex:1,overflow:"auto",...s.style},onScroll:Ue(s.onScroll,f=>{const h=f.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:g}=l;if(g?.current&&m){const x=Math.abs(d.current-h.scrollTop);if(x>0){const b=window.innerHeight-vo*2,w=parseFloat(m.style.minHeight),C=parseFloat(m.style.height),k=Math.max(w,C);if(k0?_:0,m.style.justifyContent="flex-end")}}}d.current=h.scrollTop})})})]})});zR.displayName=ub;var UR="SelectGroup",[zJ,UJ]=hc(UR),VJ=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Es();return i.jsx(zJ,{scope:n,id:s,children:i.jsx(rt.div,{role:"group","aria-labelledby":s,...r,ref:t})})});VJ.displayName=UR;var VR="SelectLabel",HR=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=UJ(VR,n);return i.jsx(rt.div,{id:s.id,...r,ref:t})});HR.displayName=VR;var ih="SelectItem",[HJ,qR]=hc(ih),KR=y.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:o,...l}=e,u=Ia(ih,n),d=Aa(ih,n),f=u.value===r,[h,m]=y.useState(o??""),[g,x]=y.useState(!1),b=Rt(t,k=>d.itemRefCallback?.(k,r,s)),w=Es(),C=()=>{s||(u.onValueChange(r),u.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return i.jsx(HJ,{scope:n,value:r,disabled:s,textId:w,isSelected:f,onItemTextChange:y.useCallback(k=>{m(j=>j||(k?.textContent??"").trim())},[]),children:i.jsx(ng.ItemSlot,{scope:n,value:r,disabled:s,textValue:h,children:i.jsx(rt.div,{role:"option","aria-labelledby":w,"data-highlighted":g?"":void 0,"aria-selected":f&&g,"data-state":f?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...l,ref:b,onFocus:Ue(l.onFocus,()=>x(!0)),onBlur:Ue(l.onBlur,()=>x(!1)),onPointerUp:Ue(l.onPointerUp,C),onPointerMove:Ue(l.onPointerMove,k=>{s?d.onItemLeave?.():k.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ue(l.onPointerLeave,k=>{k.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:Ue(l.onKeyDown,k=>{d.searchRef?.current!==""&&k.key===" "||(_J.includes(k.key)&&C(),k.key===" "&&k.preventDefault())})})})})});KR.displayName=ih;var xu="SelectItemText",WR=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...o}=e,l=Ia(xu,n),u=Aa(xu,n),d=qR(xu,n),f=IJ(xu,n),[h,m]=y.useState(null),g=Rt(t,k=>m(k),d.onItemTextChange,k=>u.itemTextRefCallback?.(k,d.value,d.disabled)),x=h?.textContent,b=y.useMemo(()=>i.jsx("option",{value:d.value,disabled:d.disabled,children:x},d.value),[d.disabled,d.value,x]),{onNativeOptionAdd:w,onNativeOptionRemove:C}=f;return Ln(()=>(w(b),()=>C(b)),[w,C,b]),i.jsxs(i.Fragment,{children:[i.jsx(rt.span,{id:d.textId,...o,ref:g}),d.isSelected&&l.valueNode&&!l.valueNodeHasChildren?Ma.createPortal(o.children,l.valueNode):null]})});WR.displayName=xu;var GR="SelectItemIndicator",JR=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return qR(GR,n).isSelected?i.jsx(rt.span,{"aria-hidden":!0,...r,ref:t}):null});JR.displayName=GR;var db="SelectScrollUpButton",QR=y.forwardRef((e,t)=>{const n=Aa(db,e.__scopeSelect),r=$x(db,e.__scopeSelect),[s,o]=y.useState(!1),l=Rt(t,r.onScrollButtonChange);return Ln(()=>{if(n.viewport&&n.isPositioned){let u=function(){const f=d.scrollTop>0;o(f)};const d=n.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),s?i.jsx(YR,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=n;u&&d&&(u.scrollTop=u.scrollTop-d.offsetHeight)}}):null});QR.displayName=db;var fb="SelectScrollDownButton",ZR=y.forwardRef((e,t)=>{const n=Aa(fb,e.__scopeSelect),r=$x(fb,e.__scopeSelect),[s,o]=y.useState(!1),l=Rt(t,r.onScrollButtonChange);return Ln(()=>{if(n.viewport&&n.isPositioned){let u=function(){const f=d.scrollHeight-d.clientHeight,h=Math.ceil(d.scrollTop)d.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),s?i.jsx(YR,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=n;u&&d&&(u.scrollTop=u.scrollTop+d.offsetHeight)}}):null});ZR.displayName=fb;var YR=y.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,o=Aa("SelectScrollButton",n),l=y.useRef(null),u=rg(n),d=y.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return y.useEffect(()=>()=>d(),[d]),Ln(()=>{u().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[u]),i.jsx(rt.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Ue(s.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:Ue(s.onPointerMove,()=>{o.onItemLeave?.(),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:Ue(s.onPointerLeave,()=>{d()})})}),qJ="SelectSeparator",XR=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return i.jsx(rt.div,{"aria-hidden":!0,...r,ref:t})});XR.displayName=qJ;var pb="SelectArrow",KJ=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=sg(n),o=Ia(pb,n),l=Aa(pb,n);return o.open&&l.position==="popper"?i.jsx(eN,{...s,...r,ref:t}):null});KJ.displayName=pb;function eP(e){return e===""||e===void 0}var tP=y.forwardRef((e,t)=>{const{value:n,...r}=e,s=y.useRef(null),o=Rt(t,s),l=NR(n);return y.useEffect(()=>{const u=s.current,d=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(d,"value").set;if(l!==n&&h){const m=new Event("change",{bubbles:!0});h.call(u,n),u.dispatchEvent(m)}},[l,n]),i.jsx(MR,{asChild:!0,children:i.jsx("select",{...r,ref:o,defaultValue:n})})});tP.displayName="BubbleSelect";function nP(e){const t=Rn(e),n=y.useRef(""),r=y.useRef(0),s=y.useCallback(l=>{const u=n.current+l;t(u),(function d(f){n.current=f,window.clearTimeout(r.current),f!==""&&(r.current=window.setTimeout(()=>d(""),1e3))})(u)},[t]),o=y.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,o]}function rP(e,t,n){const s=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=WJ(e,Math.max(o,0));s.length===1&&(l=l.filter(f=>f!==n));const d=l.find(f=>f.textValue.toLowerCase().startsWith(s.toLowerCase()));return d!==n?d:void 0}function WJ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var GJ=_R,sP=PR,JJ=IR,QJ=AR,ZJ=DR,oP=FR,YJ=zR,aP=HR,iP=KR,XJ=WR,eQ=JR,lP=QR,cP=ZR,uP=XR;const tQ=GJ,nQ=JJ,dP=y.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(sP,{ref:r,className:Ie("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-default disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,i.jsx(QJ,{asChild:!0,children:i.jsx(Nh,{className:"h-4 w-4 opacity-50"})})]}));dP.displayName=sP.displayName;const fP=y.forwardRef(({className:e,...t},n)=>i.jsx(lP,{ref:n,className:Ie("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(G$,{className:"h-4 w-4"})}));fP.displayName=lP.displayName;const pP=y.forwardRef(({className:e,...t},n)=>i.jsx(cP,{ref:n,className:Ie("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(Nh,{className:"h-4 w-4"})}));pP.displayName=cP.displayName;const hP=y.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>i.jsx(ZJ,{children:i.jsxs(oP,{ref:s,className:Ie("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[i.jsx(fP,{}),i.jsx(YJ,{className:Ie("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),i.jsx(pP,{})]})}));hP.displayName=oP.displayName;const rQ=y.forwardRef(({className:e,...t},n)=>i.jsx(aP,{ref:n,className:Ie("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));rQ.displayName=aP.displayName;const gP=y.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(iP,{ref:r,className:Ie("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(eQ,{children:i.jsx(fT,{className:"h-4 w-4"})})}),i.jsx(XJ,{children:t})]}));gP.displayName=iP.displayName;const sQ=y.forwardRef(({className:e,...t},n)=>i.jsx(uP,{ref:n,className:Ie("-mx-1 my-1 h-px bg-muted",e),...t}));sQ.displayName=uP.displayName;var Bx="Switch",[oQ]=us(Bx),[aQ,iQ]=oQ(Bx),mP=y.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:o,required:l,disabled:u,value:d="on",onCheckedChange:f,...h}=e,[m,g]=y.useState(null),x=Rt(t,j=>g(j)),b=y.useRef(!1),w=m?!!m.closest("form"):!0,[C=!1,k]=ya({prop:s,defaultProp:o,onChange:f});return i.jsxs(aQ,{scope:n,checked:C,disabled:u,children:[i.jsx(rt.button,{type:"button",role:"switch","aria-checked":C,"aria-required":l,"data-state":bP(C),"data-disabled":u?"":void 0,disabled:u,value:d,...h,ref:x,onClick:Ue(e.onClick,j=>{k(M=>!M),w&&(b.current=j.isPropagationStopped(),b.current||j.stopPropagation())})}),w&&i.jsx(lQ,{control:m,bubbles:!b.current,name:r,value:d,checked:C,required:l,disabled:u,style:{transform:"translateX(-100%)"}})]})});mP.displayName=Bx;var vP="SwitchThumb",yP=y.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=iQ(vP,n);return i.jsx(rt.span,{"data-state":bP(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});yP.displayName=vP;var lQ=e=>{const{control:t,checked:n,bubbles:r=!0,...s}=e,o=y.useRef(null),l=NR(n),u=zT(t);return y.useEffect(()=>{const d=o.current,f=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(f,"checked").set;if(l!==n&&m){const g=new Event("click",{bubbles:r});m.call(d,n),d.dispatchEvent(g)}},[l,n,r]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:o,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function bP(e){return e?"checked":"unchecked"}var xP=mP,cQ=yP;const gc=y.forwardRef(({className:e,...t},n)=>i.jsx(xP,{className:Ie("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-slate-400",e),...t,ref:n,children:i.jsx(cQ,{className:Ie("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));gc.displayName=xP.displayName;const Fo=Gn,wP=y.createContext({}),Lo=({...e})=>i.jsx(wP.Provider,{value:{name:e.name},children:i.jsx(r6,{...e})}),og=()=>{const e=y.useContext(wP),t=y.useContext(SP),{getFieldState:n,formState:r}=Kh(),s=n(e.name,r);if(!e)throw new Error("useFormField should be used within ");const{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...s}},SP=y.createContext({}),no=y.forwardRef(({className:e,...t},n)=>{const r=y.useId();return i.jsx(SP.Provider,{value:{id:r},children:i.jsx("div",{ref:n,className:Ie("space-y-2",e),...t})})});no.displayName="FormItem";const Nr=y.forwardRef(({className:e,...t},n)=>{const{error:r,formItemId:s}=og();return i.jsx(TR,{ref:n,className:Ie(r&&"text-rose-600",e),htmlFor:s,...t})});Nr.displayName="FormLabel";const _s=y.forwardRef(({...e},t)=>{const{error:n,formItemId:r,formDescriptionId:s,formMessageId:o}=og();return i.jsx(No,{ref:t,id:r,"aria-describedby":n?`${s} ${o}`:`${s}`,"aria-invalid":!!n,...e})});_s.displayName="FormControl";const ag=y.forwardRef(({className:e,...t},n)=>{const{formDescriptionId:r}=og();return i.jsx("p",{ref:n,id:r,className:Ie("text-sm text-muted-foreground",e),...t})});ag.displayName="FormDescription";const Td=y.forwardRef(({className:e,children:t,...n},r)=>{const{error:s,formMessageId:o}=og(),l=s?String(s?.message):t;return l?i.jsx("p",{ref:r,id:o,className:Ie("text-sm font-medium text-rose-600",e),...n,children:l}):null});Td.displayName="FormMessage";const le=({name:e,label:t,children:n,required:r,readOnly:s,className:o,...l})=>i.jsx(Lo,{...l,name:e,render:({field:u})=>i.jsxs(no,{className:o,children:[t&&i.jsxs(Nr,{children:[t,r&&i.jsx("span",{className:"ml-2 text-rose-600",children:"*"})]}),i.jsx(_s,{children:y.isValidElement(n)&&y.cloneElement(n,{...u,value:u.value??"",required:r,readOnly:s,checked:u.value,onCheckedChange:u.onChange})}),i.jsx(Td,{})]})}),Pe=({name:e,label:t,required:n,className:r,helper:s,reverse:o,...l})=>i.jsx(Lo,{...l,name:e,render:({field:u})=>i.jsxs(no,{className:Ie("flex items-center gap-3",o&&"flex-row-reverse justify-end",r),children:[i.jsx("div",{className:"flex flex-col gap-2",children:t&&i.jsxs(Nr,{children:[i.jsxs("p",{className:"break-all",children:[t,n&&i.jsx("span",{className:"ml-2 text-rose-600",children:"*"})]}),s&&i.jsx(ag,{className:"mt-2",children:s})]})}),i.jsx(_s,{children:i.jsx(gc,{checked:u.value,onCheckedChange:u.onChange,required:n})}),i.jsx(Td,{})]})}),Jt=({name:e,label:t,helper:n,required:r,options:s,placeholder:o,disabled:l,...u})=>i.jsx(Lo,{...u,name:e,render:({field:d})=>i.jsxs(no,{children:[t&&i.jsxs(Nr,{children:[t,r&&i.jsx("span",{className:"ml-2 text-rose-600",children:"*"})]}),i.jsx(_s,{children:i.jsxs(tQ,{onValueChange:d.onChange,defaultValue:d.value,disabled:l,children:[i.jsx(_s,{children:i.jsx(dP,{children:i.jsx(nQ,{placeholder:o})})}),i.jsx(hP,{children:s.map(f=>i.jsx(gP,{value:f.value,children:f.label},f.value))})]})}),n&&i.jsx(ag,{children:n}),i.jsx(Td,{})]})}),Da=({name:e,label:t,helper:n,required:r,placeholder:s,...o})=>i.jsx(Lo,{...o,name:e,render:({field:l})=>{let u=[];return Array.isArray(l.value)&&(u=l.value),i.jsxs(no,{children:[t&&i.jsxs(Nr,{children:[t,r&&i.jsx("span",{className:"ml-2 text-rose-600",children:"*"})]}),i.jsx(_s,{children:i.jsx(kJ,{tags:u.map(d=>({id:d,text:d,className:""})),handleDelete:d=>l.onChange(u.filter((f,h)=>h!==d)),handleAddition:d=>l.onChange([...u,d.id]),inputFieldPosition:"bottom",placeholder:s,autoFocus:!1,allowDragDrop:!1,separators:[Vs.ENTER,Vs.TAB,Vs.COMMA],classNames:{tags:"tagsClass",tagInput:"tagInputClass",tagInputField:u_,selected:"my-2 flex flex-wrap gap-2",tag:"flex items-center gap-2 px-2 py-1 bg-primary/30 rounded-md text-xs",remove:"[&>svg]:fill-rose-600 hover:[&>svg]:fill-rose-700",suggestions:"suggestionsClass",activeSuggestion:"activeSuggestionClass",editTagInput:"editTagInputClass",editTagInputField:"editTagInputFieldClass",clearAll:"clearAllClass"}})}),n&&i.jsx(ag,{children:n}),i.jsx(Td,{})]})}}),Kv=P.string().optional().transform(e=>e===""?void 0:e),uQ=P.object({name:P.string(),token:Kv,number:Kv,businessId:Kv,integration:P.enum(["WHATSAPP-BUSINESS","WHATSAPP-BAILEYS","EVOLUTION"])});function dQ({resetTable:e}){const{t}=Ve(),{createInstance:n}=Hh(),[r,s]=y.useState(!1),o=[{value:"WHATSAPP-BAILEYS",label:t("instance.form.integration.baileys")},{value:"WHATSAPP-BUSINESS",label:t("instance.form.integration.whatsapp")},{value:"EVOLUTION",label:t("instance.form.integration.evolution")}],l=on({resolver:an(uQ),defaultValues:{name:"",integration:"WHATSAPP-BAILEYS",token:E1().replace("-","").toUpperCase(),number:"",businessId:""}}),u=l.watch("integration"),d=async h=>{try{const m={instanceName:h.name,integration:h.integration,token:h.token===""?null:h.token,number:h.number===""?null:h.number,businessId:h.businessId===""?null:h.businessId};await n(m),me.success(t("toast.instance.created")),s(!1),f(),e()}catch(m){console.error("Error:",m),me.error(`Error : ${m?.response?.data?.response?.message}`)}},f=()=>{l.reset({name:"",integration:"WHATSAPP-BAILEYS",token:E1().replace("-","").toLocaleUpperCase(),number:"",businessId:""})};return i.jsxs(Pt,{open:r,onOpenChange:s,children:[i.jsx(Bt,{asChild:!0,children:i.jsxs(se,{variant:"default",size:"sm",children:[t("instance.button.create")," ",i.jsx(cs,{size:"18"})]})}),i.jsxs(Nt,{className:"sm:max-w-[650px]",onCloseAutoFocus:f,children:[i.jsx(Mt,{children:i.jsx(zt,{children:t("instance.modal.title")})}),i.jsx(Gn,{...l,children:i.jsxs("form",{onSubmit:l.handleSubmit(d),className:"grid gap-4 py-4",children:[i.jsx(le,{required:!0,name:"name",label:t("instance.form.name"),children:i.jsx(ne,{})}),i.jsx(Jt,{name:"integration",label:t("instance.form.integration.label"),options:o}),i.jsx(le,{required:!0,name:"token",label:t("instance.form.token"),children:i.jsx(ne,{})}),i.jsx(le,{name:"number",label:t("instance.form.number"),children:i.jsx(ne,{type:"tel"})}),u==="WHATSAPP-BUSINESS"&&i.jsx(le,{required:!0,name:"businessId",label:t("instance.form.businessId"),children:i.jsx(ne,{})}),i.jsx(Yt,{children:i.jsx(se,{type:"submit",children:t("instance.button.save")})})]})})]})]})}function bo(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e?.(s),n===!1||!s.defaultPrevented)return t?.(s)}}function IE(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function CP(...e){return t=>{let n=!1;const r=e.map(s=>{const o=IE(s,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let s=0;s{const{scope:g,children:x,...b}=m,w=g?.[e]?.[d]||u,C=y.useMemo(()=>b,Object.values(b));return i.jsx(w.Provider,{value:C,children:x})};f.displayName=o+"Provider";function h(m,g){const x=g?.[e]?.[d]||u,b=y.useContext(x);if(b)return b;if(l!==void 0)return l;throw new Error(`\`${m}\` must be used within \`${o}\``)}return[f,h]}const s=()=>{const o=n.map(l=>y.createContext(l));return function(u){const d=u?.[e]||o;return y.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return s.scopeName=e,[r,fQ(s,...t)]}function fQ(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=r.reduce((u,{useScope:d,scopeName:f})=>{const m=d(o)[`__scope${f}`];return{...u,...m}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function pQ(e){const t=hQ(e),n=y.forwardRef((r,s)=>{const{children:o,...l}=r,u=y.Children.toArray(o),d=u.find(mQ);if(d){const f=d.props.children,h=u.map(m=>m===d?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:m);return i.jsx(t,{...l,ref:s,children:y.isValidElement(f)?y.cloneElement(f,void 0,h):null})}return i.jsx(t,{...l,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}function hQ(e){const t=y.forwardRef((n,r)=>{const{children:s,...o}=n;if(y.isValidElement(s)){const l=yQ(s),u=vQ(o,s.props);return s.type!==y.Fragment&&(u.ref=r?CP(r,l):l),y.cloneElement(s,u)}return y.Children.count(s)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var kP=Symbol("radix.slottable");function gQ(e){const t=({children:n})=>i.jsx(i.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=kP,t}function mQ(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===kP}function vQ(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...u)=>{const d=o(...u);return s(...u),d}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function yQ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var bQ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Fa=bQ.reduce((e,t)=>{const n=pQ(`Primitive.${t}`),r=y.forwardRef((s,o)=>{const{asChild:l,...u}=s,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(d,{...u,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function xQ(e,t){e&&Ma.flushSync(()=>e.dispatchEvent(t))}function ig(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>t.current?.(...n),[])}function wQ(e,t=globalThis?.document){const n=ig(e);y.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var SQ="DismissableLayer",hb="dismissableLayer.update",CQ="dismissableLayer.pointerDownOutside",EQ="dismissableLayer.focusOutside",AE,jP=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),TP=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:l,onDismiss:u,...d}=e,f=y.useContext(jP),[h,m]=y.useState(null),g=h?.ownerDocument??globalThis?.document,[,x]=y.useState({}),b=Ui(t,O=>m(O)),w=Array.from(f.layers),[C]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),k=w.indexOf(C),j=h?w.indexOf(h):-1,M=f.layersWithOutsidePointerEventsDisabled.size>0,_=j>=k,R=TQ(O=>{const D=O.target,z=[...f.branches].some(Q=>Q.contains(D));!_||z||(s?.(O),l?.(O),O.defaultPrevented||u?.())},g),N=NQ(O=>{const D=O.target;[...f.branches].some(Q=>Q.contains(D))||(o?.(O),l?.(O),O.defaultPrevented||u?.())},g);return wQ(O=>{j===f.layers.size-1&&(r?.(O),!O.defaultPrevented&&u&&(O.preventDefault(),u()))},g),y.useEffect(()=>{if(h)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(AE=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),DE(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=AE)}},[h,g,n,f]),y.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),DE())},[h,f]),y.useEffect(()=>{const O=()=>x({});return document.addEventListener(hb,O),()=>document.removeEventListener(hb,O)},[]),i.jsx(Fa.div,{...d,ref:b,style:{pointerEvents:M?_?"auto":"none":void 0,...e.style},onFocusCapture:bo(e.onFocusCapture,N.onFocusCapture),onBlurCapture:bo(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:bo(e.onPointerDownCapture,R.onPointerDownCapture)})});TP.displayName=SQ;var kQ="DismissableLayerBranch",jQ=y.forwardRef((e,t)=>{const n=y.useContext(jP),r=y.useRef(null),s=Ui(t,r);return y.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),i.jsx(Fa.div,{...e,ref:s})});jQ.displayName=kQ;function TQ(e,t=globalThis?.document){const n=ig(e),r=y.useRef(!1),s=y.useRef(()=>{});return y.useEffect(()=>{const o=u=>{if(u.target&&!r.current){let d=function(){NP(CQ,n,f,{discrete:!0})};const f={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=d,t.addEventListener("click",s.current,{once:!0})):d()}else t.removeEventListener("click",s.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function NQ(e,t=globalThis?.document){const n=ig(e),r=y.useRef(!1);return y.useEffect(()=>{const s=o=>{o.target&&!r.current&&NP(EQ,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function DE(){const e=new CustomEvent(hb);document.dispatchEvent(e)}function NP(e,t,n,{discrete:r}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?xQ(s,o):s.dispatchEvent(o)}var Ta=globalThis?.document?y.useLayoutEffect:()=>{},MQ=Yl[" useId ".trim().toString()]||(()=>{}),_Q=0;function RQ(e){const[t,n]=y.useState(MQ());return Ta(()=>{n(r=>r??String(_Q++))},[e]),t?`radix-${t}`:""}var PQ="Arrow",MP=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...o}=e;return i.jsx(Fa.svg,{...o,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:i.jsx("polygon",{points:"0,0 30,0 15,10"})})});MP.displayName=PQ;var OQ=MP;function IQ(e){const[t,n]=y.useState(void 0);return Ta(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let l,u;if("borderBoxSize"in o){const d=o.borderBoxSize,f=Array.isArray(d)?d[0]:d;l=f.inlineSize,u=f.blockSize}else l=e.offsetWidth,u=e.offsetHeight;n({width:l,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var zx="Popper",[_P,RP]=EP(zx),[AQ,PP]=_P(zx),OP=e=>{const{__scopePopper:t,children:n}=e,[r,s]=y.useState(null);return i.jsx(AQ,{scope:t,anchor:r,onAnchorChange:s,children:n})};OP.displayName=zx;var IP="PopperAnchor",AP=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,o=PP(IP,n),l=y.useRef(null),u=Ui(t,l),d=y.useRef(null);return y.useEffect(()=>{const f=d.current;d.current=r?.current||l.current,f!==d.current&&o.onAnchorChange(d.current)}),r?null:i.jsx(Fa.div,{...s,ref:u})});AP.displayName=IP;var Ux="PopperContent",[DQ,FQ]=_P(Ux),DP=y.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:h=0,sticky:m="partial",hideWhenDetached:g=!1,updatePositionStrategy:x="optimized",onPlaced:b,...w}=e,C=PP(Ux,n),[k,j]=y.useState(null),M=Ui(t,Z=>j(Z)),[_,R]=y.useState(null),N=IQ(_),O=N?.width??0,D=N?.height??0,z=r+(o!=="center"?"-"+o:""),Q=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},pe=Array.isArray(f)?f:[f],V=pe.length>0,G={padding:Q,boundary:pe.filter($Q),altBoundary:V},{refs:W,floatingStyles:ie,placement:re,isPositioned:Y,middlewareData:H}=PT({strategy:"fixed",placement:z,whileElementsMounted:(...Z)=>_T(...Z,{animationFrame:x==="always"}),elements:{reference:C.anchor},middleware:[OT({mainAxis:s+D,alignmentAxis:l}),d&&IT({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?AT():void 0,...G}),d&&DT({...G}),FT({...G,apply:({elements:Z,rects:ye,availableWidth:Re,availableHeight:$e})=>{const{width:Ye,height:Fe}=ye.reference,ft=Z.floating.style;ft.setProperty("--radix-popper-available-width",`${Re}px`),ft.setProperty("--radix-popper-available-height",`${$e}px`),ft.setProperty("--radix-popper-anchor-width",`${Ye}px`),ft.setProperty("--radix-popper-anchor-height",`${Fe}px`)}}),_&&$T({element:_,padding:u}),BQ({arrowWidth:O,arrowHeight:D}),g&<({strategy:"referenceHidden",...G})]}),[q,he]=$P(re),A=ig(b);Ta(()=>{Y&&A?.()},[Y,A]);const F=H.arrow?.x,fe=H.arrow?.y,te=H.arrow?.centerOffset!==0,[de,ge]=y.useState();return Ta(()=>{k&&ge(window.getComputedStyle(k).zIndex)},[k]),i.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...ie,transform:Y?ie.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:de,"--radix-popper-transform-origin":[H.transformOrigin?.x,H.transformOrigin?.y].join(" "),...H.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i.jsx(DQ,{scope:n,placedSide:q,onArrowChange:R,arrowX:F,arrowY:fe,shouldHideArrow:te,children:i.jsx(Fa.div,{"data-side":q,"data-align":he,...w,ref:M,style:{...w.style,animation:Y?void 0:"none"}})})})});DP.displayName=Ux;var FP="PopperArrow",LQ={top:"bottom",right:"left",bottom:"top",left:"right"},LP=y.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,o=FQ(FP,r),l=LQ[o.placedSide];return i.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:i.jsx(OQ,{...s,ref:n,style:{...s.style,display:"block"}})})});LP.displayName=FP;function $Q(e){return e!==null}var BQ=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:s}=t,l=s.arrow?.centerOffset!==0,u=l?0:e.arrowWidth,d=l?0:e.arrowHeight,[f,h]=$P(n),m={start:"0%",center:"50%",end:"100%"}[h],g=(s.arrow?.x??0)+u/2,x=(s.arrow?.y??0)+d/2;let b="",w="";return f==="bottom"?(b=l?m:`${g}px`,w=`${-d}px`):f==="top"?(b=l?m:`${g}px`,w=`${r.floating.height+d}px`):f==="right"?(b=`${-d}px`,w=l?m:`${x}px`):f==="left"&&(b=`${r.floating.width+d}px`,w=l?m:`${x}px`),{data:{x:b,y:w}}}});function $P(e){const[t,n="center"]=e.split("-");return[t,n]}var zQ=OP,UQ=AP,VQ=DP,HQ=LP,qQ="Portal",BP=y.forwardRef((e,t)=>{const{container:n,...r}=e,[s,o]=y.useState(!1);Ta(()=>o(!0),[]);const l=n||s&&globalThis?.document?.body;return l?Ib.createPortal(i.jsx(Fa.div,{...r,ref:t}),l):null});BP.displayName=qQ;function KQ(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var Vx=e=>{const{present:t,children:n}=e,r=WQ(t),s=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),o=Ui(r.ref,GQ(s));return typeof n=="function"||r.isPresent?y.cloneElement(s,{ref:o}):null};Vx.displayName="Presence";function WQ(e){const[t,n]=y.useState(),r=y.useRef(null),s=y.useRef(e),o=y.useRef("none"),l=e?"mounted":"unmounted",[u,d]=KQ(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const f=Xf(r.current);o.current=u==="mounted"?f:"none"},[u]),Ta(()=>{const f=r.current,h=s.current;if(h!==e){const g=o.current,x=Xf(f);e?d("MOUNT"):x==="none"||f?.display==="none"?d("UNMOUNT"):d(h&&g!==x?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,d]),Ta(()=>{if(t){let f;const h=t.ownerDocument.defaultView??window,m=x=>{const w=Xf(r.current).includes(CSS.escape(x.animationName));if(x.target===t&&w&&(d("ANIMATION_END"),!s.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",f=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},g=x=>{x.target===t&&(o.current=Xf(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{h.clearTimeout(f),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:y.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function Xf(e){return e?.animationName||"none"}function GQ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var JQ=Yl[" useInsertionEffect ".trim().toString()]||Ta;function QQ({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,o,l]=ZQ({defaultProp:t,onChange:n}),u=e!==void 0,d=u?e:s;{const h=y.useRef(e!==void 0);y.useEffect(()=>{const m=h.current;m!==u&&console.warn(`${r} is changing from ${m?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=u},[u,r])}const f=y.useCallback(h=>{if(u){const m=YQ(h)?h(e):h;m!==e&&l.current?.(m)}else o(h)},[u,e,o,l]);return[d,f]}function ZQ({defaultProp:e,onChange:t}){const[n,r]=y.useState(e),s=y.useRef(n),o=y.useRef(t);return JQ(()=>{o.current=t},[t]),y.useEffect(()=>{s.current!==n&&(o.current?.(n),s.current=n)},[n,s]),[n,r,o]}function YQ(e){return typeof e=="function"}var XQ=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),eZ="VisuallyHidden",zP=y.forwardRef((e,t)=>i.jsx(Fa.span,{...e,ref:t,style:{...XQ,...e.style}}));zP.displayName=eZ;var tZ=zP,[lg]=EP("Tooltip",[RP]),cg=RP(),UP="TooltipProvider",nZ=700,gb="tooltip.open",[rZ,Hx]=lg(UP),VP=e=>{const{__scopeTooltip:t,delayDuration:n=nZ,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:o}=e,l=y.useRef(!0),u=y.useRef(!1),d=y.useRef(0);return y.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),i.jsx(rZ,{scope:t,isOpenDelayedRef:l,delayDuration:n,onOpen:y.useCallback(()=>{window.clearTimeout(d.current),l.current=!1},[]),onClose:y.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:y.useCallback(f=>{u.current=f},[]),disableHoverableContent:s,children:o})};VP.displayName=UP;var id="Tooltip",[sZ,Nd]=lg(id),HP=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:o,disableHoverableContent:l,delayDuration:u}=e,d=Hx(id,e.__scopeTooltip),f=cg(t),[h,m]=y.useState(null),g=RQ(),x=y.useRef(0),b=l??d.disableHoverableContent,w=u??d.delayDuration,C=y.useRef(!1),[k,j]=QQ({prop:r,defaultProp:s??!1,onChange:O=>{O?(d.onOpen(),document.dispatchEvent(new CustomEvent(gb))):d.onClose(),o?.(O)},caller:id}),M=y.useMemo(()=>k?C.current?"delayed-open":"instant-open":"closed",[k]),_=y.useCallback(()=>{window.clearTimeout(x.current),x.current=0,C.current=!1,j(!0)},[j]),R=y.useCallback(()=>{window.clearTimeout(x.current),x.current=0,j(!1)},[j]),N=y.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{C.current=!0,j(!0),x.current=0},w)},[w,j]);return y.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),i.jsx(zQ,{...f,children:i.jsx(sZ,{scope:t,contentId:g,open:k,stateAttribute:M,trigger:h,onTriggerChange:m,onTriggerEnter:y.useCallback(()=>{d.isOpenDelayedRef.current?N():_()},[d.isOpenDelayedRef,N,_]),onTriggerLeave:y.useCallback(()=>{b?R():(window.clearTimeout(x.current),x.current=0)},[R,b]),onOpen:_,onClose:R,disableHoverableContent:b,children:n})})};HP.displayName=id;var mb="TooltipTrigger",qP=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Nd(mb,n),o=Hx(mb,n),l=cg(n),u=y.useRef(null),d=Ui(t,u,s.onTriggerChange),f=y.useRef(!1),h=y.useRef(!1),m=y.useCallback(()=>f.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),i.jsx(UQ,{asChild:!0,...l,children:i.jsx(Fa.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:d,onPointerMove:bo(e.onPointerMove,g=>{g.pointerType!=="touch"&&!h.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),h.current=!0)}),onPointerLeave:bo(e.onPointerLeave,()=>{s.onTriggerLeave(),h.current=!1}),onPointerDown:bo(e.onPointerDown,()=>{s.open&&s.onClose(),f.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:bo(e.onFocus,()=>{f.current||s.onOpen()}),onBlur:bo(e.onBlur,s.onClose),onClick:bo(e.onClick,s.onClose)})})});qP.displayName=mb;var qx="TooltipPortal",[oZ,aZ]=lg(qx,{forceMount:void 0}),KP=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,o=Nd(qx,t);return i.jsx(oZ,{scope:t,forceMount:n,children:i.jsx(Vx,{present:n||o.open,children:i.jsx(BP,{asChild:!0,container:s,children:r})})})};KP.displayName=qx;var Wl="TooltipContent",WP=y.forwardRef((e,t)=>{const n=aZ(Wl,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...o}=e,l=Nd(Wl,e.__scopeTooltip);return i.jsx(Vx,{present:r||l.open,children:l.disableHoverableContent?i.jsx(GP,{side:s,...o,ref:t}):i.jsx(iZ,{side:s,...o,ref:t})})}),iZ=y.forwardRef((e,t)=>{const n=Nd(Wl,e.__scopeTooltip),r=Hx(Wl,e.__scopeTooltip),s=y.useRef(null),o=Ui(t,s),[l,u]=y.useState(null),{trigger:d,onClose:f}=n,h=s.current,{onPointerInTransitChange:m}=r,g=y.useCallback(()=>{u(null),m(!1)},[m]),x=y.useCallback((b,w)=>{const C=b.currentTarget,k={x:b.clientX,y:b.clientY},j=dZ(k,C.getBoundingClientRect()),M=fZ(k,j),_=pZ(w.getBoundingClientRect()),R=gZ([...M,..._]);u(R),m(!0)},[m]);return y.useEffect(()=>()=>g(),[g]),y.useEffect(()=>{if(d&&h){const b=C=>x(C,h),w=C=>x(C,d);return d.addEventListener("pointerleave",b),h.addEventListener("pointerleave",w),()=>{d.removeEventListener("pointerleave",b),h.removeEventListener("pointerleave",w)}}},[d,h,x,g]),y.useEffect(()=>{if(l){const b=w=>{const C=w.target,k={x:w.clientX,y:w.clientY},j=d?.contains(C)||h?.contains(C),M=!hZ(k,l);j?g():M&&(g(),f())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[d,h,l,f,g]),i.jsx(GP,{...e,ref:o})}),[lZ,cZ]=lg(id,{isInside:!1}),uZ=gQ("TooltipContent"),GP=y.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:l,...u}=e,d=Nd(Wl,n),f=cg(n),{onClose:h}=d;return y.useEffect(()=>(document.addEventListener(gb,h),()=>document.removeEventListener(gb,h)),[h]),y.useEffect(()=>{if(d.trigger){const m=g=>{g.target?.contains(d.trigger)&&h()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[d.trigger,h]),i.jsx(TP,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:m=>m.preventDefault(),onDismiss:h,children:i.jsxs(VQ,{"data-state":d.stateAttribute,...f,...u,ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[i.jsx(uZ,{children:r}),i.jsx(lZ,{scope:n,isInside:!0,children:i.jsx(tZ,{id:d.contentId,role:"tooltip",children:s||r})})]})})});WP.displayName=Wl;var JP="TooltipArrow",QP=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=cg(n);return cZ(JP,n).isInside?null:i.jsx(HQ,{...s,...r,ref:t})});QP.displayName=JP;function dZ(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,s,o)){case o:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function fZ(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function pZ(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function hZ(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,l=t.length-1;or!=g>r&&n<(m-f)*(r-h)/(g-h)+f&&(s=!s)}return s}function gZ(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),mZ(t)}function mZ(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const o=t[t.length-1],l=t[t.length-2];if((o.x-l.x)*(s.y-l.y)>=(o.y-l.y)*(s.x-l.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const o=n[n.length-1],l=n[n.length-2];if((o.x-l.x)*(s.y-l.y)>=(o.y-l.y)*(s.x-l.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var vZ=VP,yZ=HP,bZ=qP,xZ=KP,wZ=WP,SZ=QP;function FE({content:e,children:t,side:n="top"}){return i.jsx(vZ,{delayDuration:200,children:i.jsxs(yZ,{children:[i.jsx(bZ,{asChild:!0,children:t}),i.jsx(xZ,{children:i.jsxs(wZ,{side:n,className:` + rounded px-3 py-1.5 text-sm z-50 border shadow-lg + bg-gray-100 text-gray-900 border-gray-300 + dark:bg-gray-800 dark:text-gray-100 dark:border-gray-700 + `,children:[e,i.jsx(SZ,{className:"fill-gray-100 dark:fill-gray-800",width:18,height:9})]})})]})})}function CZ(){const{t:e}=Ve(),[t,n]=y.useState(null),{deleteInstance:r,logout:s}=Hh(),{data:o,refetch:l}=q5(),[u,d]=y.useState([]),[f,h]=y.useState("all"),[m,g]=y.useState(""),x=async()=>{await l()},b=async k=>{n(null),d([...u,k]);try{try{await s(k)}catch(j){console.error("Error logout:",j)}await r(k),await new Promise(j=>setTimeout(j,1e3)),x()}catch(j){console.error("Error instance delete:",j),me.error(`Error : ${j?.response?.data?.response?.message}`)}finally{d(u.filter(j=>j!==k))}},w=y.useMemo(()=>{let k=o?[...o]:[];return f!=="all"&&(k=k.filter(j=>j.connectionStatus===f)),m!==""&&(k=k.filter(j=>j.name.toLowerCase().includes(m.toLowerCase()))),k},[o,m,f]),C=[{value:"all",label:e("status.all")},{value:"close",label:e("status.closed")},{value:"connecting",label:e("status.connecting")},{value:"open",label:e("status.open")}];return i.jsxs("div",{className:"my-4 px-4",children:[i.jsxs("div",{className:"flex w-full items-center justify-between",children:[i.jsx("h2",{className:"text-lg",children:e("dashboard.title")}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(se,{variant:"outline",size:"icon",children:i.jsx(Ip,{onClick:x,size:"20"})}),i.jsx(dQ,{resetTable:x})]})]}),i.jsxs("div",{className:"my-4 flex items-center justify-between gap-3 px-4",children:[i.jsx("div",{className:"flex-1",children:i.jsx(ne,{placeholder:e("dashboard.search"),value:m,onChange:k=>g(k.target.value)})}),i.jsxs(Kr,{children:[i.jsx(Wr,{asChild:!0,children:i.jsxs(se,{variant:"secondary",children:[e("dashboard.status")," ",i.jsx(J$,{size:"15"})]})}),i.jsx(hr,{children:C.map(k=>i.jsx(aM,{checked:f===k.value,onCheckedChange:j=>{j&&h(k.value)},children:k.label},k.value))})]})]}),i.jsx("main",{className:"grid gap-6 sm:grid-cols-2 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:w.length>0&&Array.isArray(w)?w.map(k=>i.jsxs(So,{children:[i.jsx(Co,{children:i.jsxs(Fu,{to:`/manager/instance/${k.id}/dashboard`,className:"flex w-full flex-row items-center justify-between gap-4",children:[i.jsx(FE,{content:k.name,side:"top",children:i.jsx("h3",{className:"text-wrap font-semibold truncate",children:k.name})}),i.jsx(FE,{content:e("dashboard.settings"),side:"top",children:i.jsx(se,{variant:"ghost",size:"icon",children:i.jsx(Oo,{className:"card-icon",size:"20"})})})]})}),i.jsxs(Eo,{className:"flex-1 space-y-6",children:[i.jsx(c_,{token:k.token}),i.jsxs("div",{className:"flex w-full flex-wrap",children:[i.jsx("div",{className:"flex flex-1 gap-2",children:k.profileName&&i.jsxs(i.Fragment,{children:[i.jsx(Ei,{children:i.jsx(ki,{src:k.profilePicUrl,alt:""})}),i.jsxs("div",{className:"space-y-1",children:[i.jsx("strong",{children:k.profileName}),i.jsx("p",{className:"text-sm text-muted-foreground",children:k.ownerJid&&k.ownerJid.split("@")[0]})]})]})}),i.jsxs("div",{className:"flex items-center justify-end gap-4 text-sm",children:[i.jsxs("div",{className:"flex flex-col items-center justify-center gap-1",children:[i.jsx(pT,{className:"text-muted-foreground",size:"20"}),i.jsx("span",{children:new Intl.NumberFormat("pt-BR").format(k?._count?.Contact||0)})]}),i.jsxs("div",{className:"flex flex-col items-center justify-center gap-1",children:[i.jsx(Bl,{className:"text-muted-foreground",size:"20"}),i.jsx("span",{children:new Intl.NumberFormat("pt-BR").format(k?._count?.Message||0)})]})]})]})]}),i.jsxs(Vh,{className:"justify-between",children:[i.jsx(l_,{status:k.connectionStatus}),i.jsx(se,{variant:"destructive",size:"sm",onClick:()=>n(k.name),disabled:u.includes(k.name),children:u.includes(k.name)?i.jsx("span",{children:e("button.deleting")}):i.jsx("span",{children:e("button.delete")})})]})]},k.id)):i.jsx("p",{children:e("dashboard.instancesNotFound")})}),!!t&&i.jsx(Pt,{onOpenChange:()=>n(null),open:!0,children:i.jsxs(Nt,{children:[i.jsx($M,{}),i.jsx(Mt,{children:e("modal.delete.title")}),i.jsx("p",{children:e("modal.delete.message",{instanceName:t})}),i.jsx(Yt,{children:i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx(se,{onClick:()=>n(null),size:"sm",variant:"outline",children:e("button.cancel")}),i.jsx(se,{onClick:()=>b(t),variant:"destructive",children:e("button.delete")})]})})]})})]})}const{createElement:Gl,createContext:EZ,forwardRef:ZP,useCallback:Fr,useContext:YP,useEffect:vi,useImperativeHandle:XP,useLayoutEffect:kZ,useMemo:jZ,useRef:kr,useState:Mu}=Yl,LE=Yl.useId,TZ=kZ,ug=EZ(null);ug.displayName="PanelGroupContext";const yi=TZ,NZ=typeof LE=="function"?LE:()=>null;let MZ=0;function Kx(e=null){const t=NZ(),n=kr(e||t||null);return n.current===null&&(n.current=""+MZ++),e??n.current}function eO({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:s,forwardedRef:o,id:l,maxSize:u,minSize:d,onCollapse:f,onExpand:h,onResize:m,order:g,style:x,tagName:b="div",...w}){const C=YP(ug);if(C===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:k,expandPanel:j,getPanelSize:M,getPanelStyle:_,groupId:R,isPanelCollapsed:N,reevaluatePanelConstraints:O,registerPanel:D,resizePanel:z,unregisterPanel:Q}=C,pe=Kx(l),V=kr({callbacks:{onCollapse:f,onExpand:h,onResize:m},constraints:{collapsedSize:n,collapsible:r,defaultSize:s,maxSize:u,minSize:d},id:pe,idIsFromProps:l!==void 0,order:g});kr({didLogMissingDefaultSizeWarning:!1}),yi(()=>{const{callbacks:W,constraints:ie}=V.current,re={...ie};V.current.id=pe,V.current.idIsFromProps=l!==void 0,V.current.order=g,W.onCollapse=f,W.onExpand=h,W.onResize=m,ie.collapsedSize=n,ie.collapsible=r,ie.defaultSize=s,ie.maxSize=u,ie.minSize=d,(re.collapsedSize!==ie.collapsedSize||re.collapsible!==ie.collapsible||re.maxSize!==ie.maxSize||re.minSize!==ie.minSize)&&O(V.current,re)}),yi(()=>{const W=V.current;return D(W),()=>{Q(W)}},[g,pe,D,Q]),XP(o,()=>({collapse:()=>{k(V.current)},expand:W=>{j(V.current,W)},getId(){return pe},getSize(){return M(V.current)},isCollapsed(){return N(V.current)},isExpanded(){return!N(V.current)},resize:W=>{z(V.current,W)}}),[k,j,M,N,pe,z]);const G=_(V.current,s);return Gl(b,{...w,children:e,className:t,id:l,style:{...G,...x},"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-group-id":R,"data-panel-id":pe,"data-panel-size":parseFloat(""+G.flexGrow).toFixed(1)})}const tO=ZP((e,t)=>Gl(eO,{...e,forwardedRef:t}));eO.displayName="Panel";tO.displayName="forwardRef(Panel)";let vb=null,di=null;function _Z(e,t){if(t){const n=(t&aO)!==0,r=(t&iO)!==0,s=(t&lO)!==0,o=(t&cO)!==0;if(n)return s?"se-resize":o?"ne-resize":"e-resize";if(r)return s?"sw-resize":o?"nw-resize":"w-resize";if(s)return"s-resize";if(o)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function RZ(){di!==null&&(document.head.removeChild(di),vb=null,di=null)}function Wv(e,t){const n=_Z(e,t);vb!==n&&(vb=n,di===null&&(di=document.createElement("style"),document.head.appendChild(di)),di.innerHTML=`*{cursor: ${n}!important;}`)}function nO(e){return e.type==="keydown"}function rO(e){return e.type.startsWith("pointer")}function sO(e){return e.type.startsWith("mouse")}function dg(e){if(rO(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(sO(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function PZ(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function OZ(e,t,n){return e.xt.x&&e.yt.y}function IZ(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:zE(e),b:zE(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;kt(r,"Stacking order can only be calculated for elements with a common ancestor");const s={a:BE($E(n.a)),b:BE($E(n.b))};if(s.a===s.b){const o=r.childNodes,l={a:n.a.at(-1),b:n.b.at(-1)};let u=o.length;for(;u--;){const d=o[u];if(d===l.a)return 1;if(d===l.b)return-1}}return Math.sign(s.a-s.b)}const AZ=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function DZ(e){var t;const n=getComputedStyle((t=oO(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function FZ(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||DZ(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||AZ.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function $E(e){let t=e.length;for(;t--;){const n=e[t];if(kt(n,"Missing node"),FZ(n))return n}return null}function BE(e){return e&&Number(getComputedStyle(e).zIndex)||0}function zE(e){const t=[];for(;e;)t.push(e),e=oO(e);return t}function oO(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const aO=1,iO=2,lO=4,cO=8,LZ=PZ()==="coarse";let js=[],ld=!1,ha=new Map,fg=new Map;const cd=new Set;function $Z(e,t,n,r,s){var o;const{ownerDocument:l}=t,u={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:s},d=(o=ha.get(l))!==null&&o!==void 0?o:0;return ha.set(l,d+1),cd.add(u),lh(),function(){var h;fg.delete(e),cd.delete(u);const m=(h=ha.get(l))!==null&&h!==void 0?h:1;if(ha.set(l,m-1),lh(),m===1&&ha.delete(l),js.includes(u)){const g=js.indexOf(u);g>=0&&js.splice(g,1),Gx()}}}function UE(e){const{target:t}=e,{x:n,y:r}=dg(e);ld=!0,Wx({target:t,x:n,y:r}),lh(),js.length>0&&(ch("down",e),e.preventDefault(),e.stopPropagation())}function du(e){const{x:t,y:n}=dg(e);if(e.buttons===0&&(ld=!1,ch("up",e)),!ld){const{target:r}=e;Wx({target:r,x:t,y:n})}ch("move",e),Gx(),js.length>0&&e.preventDefault()}function bl(e){const{target:t}=e,{x:n,y:r}=dg(e);fg.clear(),ld=!1,js.length>0&&e.preventDefault(),ch("up",e),Wx({target:t,x:n,y:r}),Gx(),lh()}function Wx({target:e,x:t,y:n}){js.splice(0);let r=null;e instanceof HTMLElement&&(r=e),cd.forEach(s=>{const{element:o,hitAreaMargins:l}=s,u=o.getBoundingClientRect(),{bottom:d,left:f,right:h,top:m}=u,g=LZ?l.coarse:l.fine;if(t>=f-g&&t<=h+g&&n>=m-g&&n<=d+g){if(r!==null&&o!==r&&!o.contains(r)&&!r.contains(o)&&IZ(r,o)>0){let b=r,w=!1;for(;b&&!b.contains(o);){if(OZ(b.getBoundingClientRect(),u)){w=!0;break}b=b.parentElement}if(w)return}js.push(s)}})}function Gv(e,t){fg.set(e,t)}function Gx(){let e=!1,t=!1;js.forEach(r=>{const{direction:s}=r;s==="horizontal"?e=!0:t=!0});let n=0;fg.forEach(r=>{n|=r}),e&&t?Wv("intersection",n):e?Wv("horizontal",n):t?Wv("vertical",n):RZ()}function lh(){ha.forEach((e,t)=>{const{body:n}=t;n.removeEventListener("contextmenu",bl),n.removeEventListener("pointerdown",UE),n.removeEventListener("pointerleave",du),n.removeEventListener("pointermove",du)}),window.removeEventListener("pointerup",bl),window.removeEventListener("pointercancel",bl),cd.size>0&&(ld?(js.length>0&&ha.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("contextmenu",bl),n.addEventListener("pointerleave",du),n.addEventListener("pointermove",du))}),window.addEventListener("pointerup",bl),window.addEventListener("pointercancel",bl)):ha.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("pointerdown",UE,{capture:!0}),n.addEventListener("pointermove",du))}))}function ch(e,t){cd.forEach(n=>{const{setResizeHandlerState:r}=n,s=js.includes(n);r(e,s,t)})}function kt(e,t){if(!e)throw console.error(t),Error(t)}const Jx=10;function Ri(e,t,n=Jx){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function xo(e,t,n=Jx){return Ri(e,t,n)===0}function $r(e,t,n){return Ri(e,t,n)===0}function BZ(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r0&&(e=e<0?0-k:k)}}}{const m=e<0?u:d,g=n[m];kt(g,`No panel constraints found for index ${m}`);const{collapsedSize:x=0,collapsible:b,minSize:w=0}=g;if(b){const C=t[m];if(kt(C!=null,`Previous layout not found for panel index ${m}`),$r(C,w)){const k=C-x;Ri(k,Math.abs(e))>0&&(e=e<0?0-k:k)}}}}{const m=e<0?1:-1;let g=e<0?d:u,x=0;for(;;){const w=t[g];kt(w!=null,`Previous layout not found for panel index ${g}`);const k=Ml({panelConstraints:n,panelIndex:g,size:100})-w;if(x+=k,g+=m,g<0||g>=n.length)break}const b=Math.min(Math.abs(e),Math.abs(x));e=e<0?0-b:b}{let g=e<0?u:d;for(;g>=0&&g=0))break;e<0?g--:g++}}if(BZ(s,l))return s;{const m=e<0?d:u,g=t[m];kt(g!=null,`Previous layout not found for panel index ${m}`);const x=g+f,b=Ml({panelConstraints:n,panelIndex:m,size:x});if(l[m]=b,!$r(b,x)){let w=x-b,k=e<0?d:u;for(;k>=0&&k0?k--:k++}}}const h=l.reduce((m,g)=>g+m,0);return $r(h,100)?l:s}function zZ({layout:e,panelsArray:t,pivotIndices:n}){let r=0,s=100,o=0,l=0;const u=n[0];kt(u!=null,"No pivot index found"),t.forEach((m,g)=>{const{constraints:x}=m,{maxSize:b=100,minSize:w=0}=x;g===u?(r=w,s=b):(o+=w,l+=b)});const d=Math.min(s,100-o),f=Math.max(r,100-l),h=e[u];return{valueMax:d,valueMin:f,valueNow:h}}function ud(e,t=document){return Array.from(t.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function uO(e,t,n=document){const s=ud(e,n).findIndex(o=>o.getAttribute("data-panel-resize-handle-id")===t);return s??null}function dO(e,t,n){const r=uO(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function fO(e,t=document){var n;if(t instanceof HTMLElement&&(t==null||(n=t.dataset)===null||n===void 0?void 0:n.panelGroupId)==e)return t;const r=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function pg(e,t=document){const n=t.querySelector(`[data-panel-resize-handle-id="${e}"]`);return n||null}function UZ(e,t,n,r=document){var s,o,l,u;const d=pg(t,r),f=ud(e,r),h=d?f.indexOf(d):-1,m=(s=(o=n[h])===null||o===void 0?void 0:o.id)!==null&&s!==void 0?s:null,g=(l=(u=n[h+1])===null||u===void 0?void 0:u.id)!==null&&l!==void 0?l:null;return[m,g]}function VZ({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:s,panelGroupElement:o,setLayout:l}){kr({didWarnAboutMissingResizeHandle:!1}),yi(()=>{if(!o)return;const u=ud(n,o);for(let d=0;d{u.forEach((d,f)=>{d.removeAttribute("aria-controls"),d.removeAttribute("aria-valuemax"),d.removeAttribute("aria-valuemin"),d.removeAttribute("aria-valuenow")})}},[n,r,s,o]),vi(()=>{if(!o)return;const u=t.current;kt(u,"Eager values not found");const{panelDataArray:d}=u,f=fO(n,o);kt(f!=null,`No group found for id "${n}"`);const h=ud(n,o);kt(h,`No resize handles found for group id "${n}"`);const m=h.map(g=>{const x=g.getAttribute("data-panel-resize-handle-id");kt(x,"Resize handle element has no handle id attribute");const[b,w]=UZ(n,x,d,o);if(b==null||w==null)return()=>{};const C=k=>{if(!k.defaultPrevented)switch(k.key){case"Enter":{k.preventDefault();const j=d.findIndex(M=>M.id===b);if(j>=0){const M=d[j];kt(M,`No panel data found for index ${j}`);const _=r[j],{collapsedSize:R=0,collapsible:N,minSize:O=0}=M.constraints;if(_!=null&&N){const D=wu({delta:$r(_,R)?O-R:R-_,initialLayout:r,panelConstraints:d.map(z=>z.constraints),pivotIndices:dO(n,x,o),prevLayout:r,trigger:"keyboard"});r!==D&&l(D)}}break}}};return g.addEventListener("keydown",C),()=>{g.removeEventListener("keydown",C)}});return()=>{m.forEach(g=>g())}},[o,e,t,n,r,s,l])}function VE(e,t){if(e.length!==t.length)return!1;for(let n=0;no.constraints);let r=0,s=100;for(let o=0;o{const o=e[s];kt(o,`Panel data not found for index ${s}`);const{callbacks:l,constraints:u,id:d}=o,{collapsedSize:f=0,collapsible:h}=u,m=n[d];if(m==null||r!==m){n[d]=r;const{onCollapse:g,onExpand:x,onResize:b}=l;b&&b(r,m),h&&(g||x)&&(x&&(m==null||xo(m,f))&&!xo(r,f)&&x(),g&&(m==null||!xo(m,f))&&xo(r,f)&&g())}})}function ep(e,t){if(e.length!==t.length)return!1;for(let n=0;n{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...s)},t)}}function HE(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function hO(e){return`react-resizable-panels:${e}`}function gO(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:s,order:o}=t;return s?r:o?`${o}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function mO(e,t){try{const n=hO(e),r=t.getItem(n);if(r){const s=JSON.parse(r);if(typeof s=="object"&&s!=null)return s}}catch{}return null}function JZ(e,t,n){var r,s;const o=(r=mO(e,n))!==null&&r!==void 0?r:{},l=gO(t);return(s=o[l])!==null&&s!==void 0?s:null}function QZ(e,t,n,r,s){var o;const l=hO(e),u=gO(t),d=(o=mO(e,s))!==null&&o!==void 0?o:{};d[u]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{s.setItem(l,JSON.stringify(d))}catch(f){console.error(f)}}function qE({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((o,l)=>o+l,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(o=>`${o}%`).join(", ")}`);if(!$r(r,100))for(let o=0;o(HE(Su),Su.getItem(e)),setItem:(e,t)=>{HE(Su),Su.setItem(e,t)}},KE={};function vO({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:s,id:o=null,onLayout:l=null,keyboardResizeBy:u=null,storage:d=Su,style:f,tagName:h="div",...m}){const g=Kx(o),x=kr(null),[b,w]=Mu(null),[C,k]=Mu([]),j=kr({}),M=kr(new Map),_=kr(0),R=kr({autoSaveId:e,direction:r,dragState:b,id:g,keyboardResizeBy:u,onLayout:l,storage:d}),N=kr({layout:C,panelDataArray:[],panelDataArrayChanged:!1});kr({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),XP(s,()=>({getId:()=>R.current.id,getLayout:()=>{const{layout:F}=N.current;return F},setLayout:F=>{const{onLayout:fe}=R.current,{layout:te,panelDataArray:de}=N.current,ge=qE({layout:F,panelConstraints:de.map(Z=>Z.constraints)});VE(te,ge)||(k(ge),N.current.layout=ge,fe&&fe(ge),xl(de,ge,j.current))}}),[]),yi(()=>{R.current.autoSaveId=e,R.current.direction=r,R.current.dragState=b,R.current.id=g,R.current.onLayout=l,R.current.storage=d}),VZ({committedValuesRef:R,eagerValuesRef:N,groupId:g,layout:C,panelDataArray:N.current.panelDataArray,setLayout:k,panelGroupElement:x.current}),vi(()=>{const{panelDataArray:F}=N.current;if(e){if(C.length===0||C.length!==F.length)return;let fe=KE[e];fe==null&&(fe=GZ(QZ,ZZ),KE[e]=fe);const te=[...F],de=new Map(M.current);fe(e,te,de,C,d)}},[e,C,d]),vi(()=>{});const O=Fr(F=>{const{onLayout:fe}=R.current,{layout:te,panelDataArray:de}=N.current;if(F.constraints.collapsible){const ge=de.map($e=>$e.constraints),{collapsedSize:Z=0,panelSize:ye,pivotIndices:Re}=ri(de,F,te);if(kt(ye!=null,`Panel size not found for panel "${F.id}"`),!xo(ye,Z)){M.current.set(F.id,ye);const Ye=kl(de,F)===de.length-1?ye-Z:Z-ye,Fe=wu({delta:Ye,initialLayout:te,panelConstraints:ge,pivotIndices:Re,prevLayout:te,trigger:"imperative-api"});ep(te,Fe)||(k(Fe),N.current.layout=Fe,fe&&fe(Fe),xl(de,Fe,j.current))}}},[]),D=Fr((F,fe)=>{const{onLayout:te}=R.current,{layout:de,panelDataArray:ge}=N.current;if(F.constraints.collapsible){const Z=ge.map(ft=>ft.constraints),{collapsedSize:ye=0,panelSize:Re=0,minSize:$e=0,pivotIndices:Ye}=ri(ge,F,de),Fe=fe??$e;if(xo(Re,ye)){const ft=M.current.get(F.id),ln=ft!=null&&ft>=Fe?ft:Fe,vn=kl(ge,F)===ge.length-1?Re-ln:ln-Re,Cn=wu({delta:vn,initialLayout:de,panelConstraints:Z,pivotIndices:Ye,prevLayout:de,trigger:"imperative-api"});ep(de,Cn)||(k(Cn),N.current.layout=Cn,te&&te(Cn),xl(ge,Cn,j.current))}}},[]),z=Fr(F=>{const{layout:fe,panelDataArray:te}=N.current,{panelSize:de}=ri(te,F,fe);return kt(de!=null,`Panel size not found for panel "${F.id}"`),de},[]),Q=Fr((F,fe)=>{const{panelDataArray:te}=N.current,de=kl(te,F);return WZ({defaultSize:fe,dragState:b,layout:C,panelData:te,panelIndex:de})},[b,C]),pe=Fr(F=>{const{layout:fe,panelDataArray:te}=N.current,{collapsedSize:de=0,collapsible:ge,panelSize:Z}=ri(te,F,fe);return kt(Z!=null,`Panel size not found for panel "${F.id}"`),ge===!0&&xo(Z,de)},[]),V=Fr(F=>{const{layout:fe,panelDataArray:te}=N.current,{collapsedSize:de=0,collapsible:ge,panelSize:Z}=ri(te,F,fe);return kt(Z!=null,`Panel size not found for panel "${F.id}"`),!ge||Ri(Z,de)>0},[]),G=Fr(F=>{const{panelDataArray:fe}=N.current;fe.push(F),fe.sort((te,de)=>{const ge=te.order,Z=de.order;return ge==null&&Z==null?0:ge==null?-1:Z==null?1:ge-Z}),N.current.panelDataArrayChanged=!0},[]);yi(()=>{if(N.current.panelDataArrayChanged){N.current.panelDataArrayChanged=!1;const{autoSaveId:F,onLayout:fe,storage:te}=R.current,{layout:de,panelDataArray:ge}=N.current;let Z=null;if(F){const Re=JZ(F,ge,te);Re&&(M.current=new Map(Object.entries(Re.expandToSizes)),Z=Re.layout)}Z==null&&(Z=KZ({panelDataArray:ge}));const ye=qE({layout:Z,panelConstraints:ge.map(Re=>Re.constraints)});VE(de,ye)||(k(ye),N.current.layout=ye,fe&&fe(ye),xl(ge,ye,j.current))}}),yi(()=>{const F=N.current;return()=>{F.layout=[]}},[]);const W=Fr(F=>function(te){te.preventDefault();const de=x.current;if(!de)return()=>null;const{direction:ge,dragState:Z,id:ye,keyboardResizeBy:Re,onLayout:$e}=R.current,{layout:Ye,panelDataArray:Fe}=N.current,{initialLayout:ft}=Z??{},ln=dO(ye,F,de);let Sn=qZ(te,F,ge,Z,Re,de);const vn=ge==="horizontal";document.dir==="rtl"&&vn&&(Sn=-Sn);const Cn=Fe.map(ue=>ue.constraints),L=wu({delta:Sn,initialLayout:ft??Ye,panelConstraints:Cn,pivotIndices:ln,prevLayout:Ye,trigger:nO(te)?"keyboard":"mouse-or-touch"}),X=!ep(Ye,L);(rO(te)||sO(te))&&_.current!=Sn&&(_.current=Sn,X?Gv(F,0):vn?Gv(F,Sn<0?aO:iO):Gv(F,Sn<0?lO:cO)),X&&(k(L),N.current.layout=L,$e&&$e(L),xl(Fe,L,j.current))},[]),ie=Fr((F,fe)=>{const{onLayout:te}=R.current,{layout:de,panelDataArray:ge}=N.current,Z=ge.map(ft=>ft.constraints),{panelSize:ye,pivotIndices:Re}=ri(ge,F,de);kt(ye!=null,`Panel size not found for panel "${F.id}"`);const Ye=kl(ge,F)===ge.length-1?ye-fe:fe-ye,Fe=wu({delta:Ye,initialLayout:de,panelConstraints:Z,pivotIndices:Re,prevLayout:de,trigger:"imperative-api"});ep(de,Fe)||(k(Fe),N.current.layout=Fe,te&&te(Fe),xl(ge,Fe,j.current))},[]),re=Fr((F,fe)=>{const{layout:te,panelDataArray:de}=N.current,{collapsedSize:ge=0,collapsible:Z}=fe,{collapsedSize:ye=0,collapsible:Re,maxSize:$e=100,minSize:Ye=0}=F.constraints,{panelSize:Fe}=ri(de,F,te);Fe!=null&&(Z&&Re&&xo(Fe,ge)?xo(ge,ye)||ie(F,ye):Fe$e&&ie(F,$e))},[ie]),Y=Fr((F,fe)=>{const{direction:te}=R.current,{layout:de}=N.current;if(!x.current)return;const ge=pg(F,x.current);kt(ge,`Drag handle element not found for id "${F}"`);const Z=pO(te,fe);w({dragHandleId:F,dragHandleRect:ge.getBoundingClientRect(),initialCursorPosition:Z,initialLayout:de})},[]),H=Fr(()=>{w(null)},[]),q=Fr(F=>{const{panelDataArray:fe}=N.current,te=kl(fe,F);te>=0&&(fe.splice(te,1),delete j.current[F.id],N.current.panelDataArrayChanged=!0)},[]),he=jZ(()=>({collapsePanel:O,direction:r,dragState:b,expandPanel:D,getPanelSize:z,getPanelStyle:Q,groupId:g,isPanelCollapsed:pe,isPanelExpanded:V,reevaluatePanelConstraints:re,registerPanel:G,registerResizeHandle:W,resizePanel:ie,startDragging:Y,stopDragging:H,unregisterPanel:q,panelGroupElement:x.current}),[O,b,r,D,z,Q,g,pe,V,re,G,W,ie,Y,H,q]),A={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return Gl(ug.Provider,{value:he},Gl(h,{...m,children:t,className:n,id:o,ref:x,style:{...A,...f},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":g}))}const yO=ZP((e,t)=>Gl(vO,{...e,forwardedRef:t}));vO.displayName="PanelGroup";yO.displayName="forwardRef(PanelGroup)";function kl(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function ri(e,t,n){const r=kl(e,t),o=r===e.length-1?[r-1,r]:[r,r+1],l=n[r];return{...t.constraints,panelSize:l,pivotIndices:o}}function YZ({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){vi(()=>{if(e||n==null||r==null)return;const s=pg(t,r);if(s==null)return;const o=l=>{if(!l.defaultPrevented)switch(l.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{l.preventDefault(),n(l);break}case"F6":{l.preventDefault();const u=s.getAttribute("data-panel-group-id");kt(u,`No group element found for id "${u}"`);const d=ud(u,r),f=uO(u,t,r);kt(f!==null,`No resize element found for id "${t}"`);const h=l.shiftKey?f>0?f-1:d.length-1:f+1{s.removeEventListener("keydown",o)}},[r,e,t,n])}function bO({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:s,onBlur:o,onDragging:l,onFocus:u,style:d={},tabIndex:f=0,tagName:h="div",...m}){var g,x;const b=kr(null),w=kr({onDragging:l});vi(()=>{w.current.onDragging=l});const C=YP(ug);if(C===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:k,groupId:j,registerResizeHandle:M,startDragging:_,stopDragging:R,panelGroupElement:N}=C,O=Kx(s),[D,z]=Mu("inactive"),[Q,pe]=Mu(!1),[V,G]=Mu(null),W=kr({state:D});yi(()=>{W.current.state=D}),vi(()=>{if(n)G(null);else{const H=M(O);G(()=>H)}},[n,O,M]);const ie=(g=r?.coarse)!==null&&g!==void 0?g:15,re=(x=r?.fine)!==null&&x!==void 0?x:5;return vi(()=>{if(n||V==null)return;const H=b.current;return kt(H,"Element ref not attached"),$Z(O,H,k,{coarse:ie,fine:re},(he,A,F)=>{if(A)switch(he){case"down":{z("drag"),_(O,F);const{onDragging:fe}=w.current;fe&&fe(!0);break}case"move":{const{state:fe}=W.current;fe!=="drag"&&z("hover"),V(F);break}case"up":{z("hover"),R();const{onDragging:fe}=w.current;fe&&fe(!1);break}}else z("inactive")})},[ie,k,n,re,M,O,V,_,R]),YZ({disabled:n,handleId:O,resizeHandler:V,panelGroupElement:N}),Gl(h,{...m,children:e,className:t,id:s,onBlur:()=>{pe(!1),o?.()},onFocus:()=>{pe(!0),u?.()},ref:b,role:"separator",style:{...{touchAction:"none",userSelect:"none"},...d},tabIndex:f,"data-panel-group-direction":k,"data-panel-group-id":j,"data-resize-handle":"","data-resize-handle-active":D==="drag"?"pointer":Q?"keyboard":void 0,"data-resize-handle-state":D,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":O})}bO.displayName="PanelResizeHandle";const $o=({className:e,...t})=>i.jsx(yO,{className:Ie("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),Hn=tO,Bo=({withHandle:e,className:t,...n})=>i.jsx(bO,{className:Ie("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 after:bg-border focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),...n,children:e&&i.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:i.jsx(lB,{className:"h-2.5 w-2.5"})})});var Qx="Tabs",[XZ]=us(Qx,[Dh]),xO=Dh(),[eY,Zx]=XZ(Qx),wO=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:o,orientation:l="horizontal",dir:u,activationMode:d="automatic",...f}=e,h=xd(u),[m,g]=ya({prop:r,onChange:s,defaultProp:o});return i.jsx(eY,{scope:n,baseId:Es(),value:m,onValueChange:g,orientation:l,dir:h,activationMode:d,children:i.jsx(rt.div,{dir:h,"data-orientation":l,...f,ref:t})})});wO.displayName=Qx;var SO="TabsList",CO=y.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,o=Zx(SO,n),l=xO(n);return i.jsx(aN,{asChild:!0,...l,orientation:o.orientation,dir:o.dir,loop:r,children:i.jsx(rt.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});CO.displayName=SO;var EO="TabsTrigger",kO=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...o}=e,l=Zx(EO,n),u=xO(n),d=NO(l.baseId,r),f=MO(l.baseId,r),h=r===l.value;return i.jsx(iN,{asChild:!0,...u,focusable:!s,active:h,children:i.jsx(rt.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":f,"data-state":h?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:d,...o,ref:t,onMouseDown:Ue(e.onMouseDown,m=>{!s&&m.button===0&&m.ctrlKey===!1?l.onValueChange(r):m.preventDefault()}),onKeyDown:Ue(e.onKeyDown,m=>{[" ","Enter"].includes(m.key)&&l.onValueChange(r)}),onFocus:Ue(e.onFocus,()=>{const m=l.activationMode!=="manual";!h&&!s&&m&&l.onValueChange(r)})})})});kO.displayName=EO;var jO="TabsContent",TO=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:o,...l}=e,u=Zx(jO,n),d=NO(u.baseId,r),f=MO(u.baseId,r),h=r===u.value,m=y.useRef(h);return y.useEffect(()=>{const g=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(g)},[]),i.jsx(Mr,{present:s||h,children:({present:g})=>i.jsx(rt.div,{"data-state":h?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":d,hidden:!g,id:f,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:m.current?"0s":void 0},children:g&&o})})});TO.displayName=jO;function NO(e,t){return`${e}-trigger-${t}`}function MO(e,t){return`${e}-content-${t}`}var tY=wO,_O=CO,RO=kO,PO=TO;const Yx=tY,hg=y.forwardRef(({className:e,...t},n)=>i.jsx(_O,{ref:n,className:Ie("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));hg.displayName=_O.displayName;const Jl=y.forwardRef(({className:e,...t},n)=>i.jsx(RO,{ref:n,className:Ie("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Jl.displayName=RO.displayName;const Ql=y.forwardRef(({className:e,...t},n)=>i.jsx(PO,{ref:n,className:Ie("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Ql.displayName=PO.displayName;const nY=e=>["chats","findChats",JSON.stringify(e)],rY=async({instanceName:e})=>(await Ee.post(`/chat/findChats/${e}`,{where:{}})).data,sY=e=>{const{instanceName:t,...n}=e;return mt({...n,queryKey:nY({instanceName:t}),queryFn:()=>rY({instanceName:t}),enabled:!!t})};function zo(e){const t=o=>typeof window<"u"?window.matchMedia(o).matches:!1,[n,r]=y.useState(t(e));function s(){r(t(e))}return y.useEffect(()=>{const o=window.matchMedia(e);return s(),o.addListener?o.addListener(s):o.addEventListener("change",s),()=>{o.removeListener?o.removeListener(s):o.removeEventListener("change",s)}},[e]),n}const Ys=Object.create(null);Ys.open="0";Ys.close="1";Ys.ping="2";Ys.pong="3";Ys.message="4";Ys.upgrade="5";Ys.noop="6";const Cp=Object.create(null);Object.keys(Ys).forEach(e=>{Cp[Ys[e]]=e});const yb={type:"error",data:"parser error"},OO=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",IO=typeof ArrayBuffer=="function",AO=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Xx=({type:e,data:t},n,r)=>OO&&t instanceof Blob?n?r(t):WE(t,r):IO&&(t instanceof ArrayBuffer||AO(t))?n?r(t):WE(new Blob([t]),r):r(Ys[e]+(t||"")),WE=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function GE(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Jv;function oY(e,t){if(OO&&e.data instanceof Blob)return e.data.arrayBuffer().then(GE).then(t);if(IO&&(e.data instanceof ArrayBuffer||AO(e.data)))return t(GE(e.data));Xx(e,!1,n=>{Jv||(Jv=new TextEncoder),t(Jv.encode(n))})}const JE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Cu=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e{let t=e.length*.75,n=e.length,r,s=0,o,l,u,d;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const f=new ArrayBuffer(t),h=new Uint8Array(f);for(r=0;r>4,h[s++]=(l&15)<<4|u>>2,h[s++]=(u&3)<<6|d&63;return f},iY=typeof ArrayBuffer=="function",ew=(e,t)=>{if(typeof e!="string")return{type:"message",data:DO(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:lY(e.substring(1),t)}:Cp[n]?e.length>1?{type:Cp[n],data:e.substring(1)}:{type:Cp[n]}:yb},lY=(e,t)=>{if(iY){const n=aY(e);return DO(n,t)}else return{base64:!0,data:e}},DO=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},FO="",cY=(e,t)=>{const n=e.length,r=new Array(n);let s=0;e.forEach((o,l)=>{Xx(o,!1,u=>{r[l]=u,++s===n&&t(r.join(FO))})})},uY=(e,t)=>{const n=e.split(FO),r=[];for(let s=0;s{const r=n.length;let s;if(r<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,r);else if(r<65536){s=new Uint8Array(3);const o=new DataView(s.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{s=new Uint8Array(9);const o=new DataView(s.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(s[0]|=128),t.enqueue(s),t.enqueue(n)})}})}let Qv;function tp(e){return e.reduce((t,n)=>t+n.length,0)}function np(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let s=0;sMath.pow(2,21)-1){u.enqueue(yb);break}s=h*Math.pow(2,32)+f.getUint32(4),r=3}else{if(tp(n)e){u.enqueue(yb);break}}}})}const LO=4;function Pn(e){if(e)return pY(e)}function pY(e){for(var t in Pn.prototype)e[t]=Pn.prototype[t];return e}Pn.prototype.on=Pn.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Pn.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Pn.prototype.off=Pn.prototype.removeListener=Pn.prototype.removeAllListeners=Pn.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,s=0;sPromise.resolve().then(t):(t,n)=>n(t,0),as=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),hY="arraybuffer";function $O(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const gY=as.setTimeout,mY=as.clearTimeout;function mg(e,t){t.useNativeTimers?(e.setTimeoutFn=gY.bind(as),e.clearTimeoutFn=mY.bind(as)):(e.setTimeoutFn=as.setTimeout.bind(as),e.clearTimeoutFn=as.clearTimeout.bind(as))}const vY=1.33;function yY(e){return typeof e=="string"?bY(e):Math.ceil((e.byteLength||e.size)*vY)}function bY(e){let t=0,n=0;for(let r=0,s=e.length;r=57344?n+=3:(r++,n+=4);return n}function BO(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function xY(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function wY(e){let t={},n=e.split("&");for(let r=0,s=n.length;r{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};uY(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,cY(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=BO()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let zO=!1;try{zO=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const EY=zO;function kY(){}class jY extends CY{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(s,o)=>{this.onError("xhr post error",s,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}let Dl=class Ep extends Pn{constructor(t,n,r){super(),this.createRequest=t,mg(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=$O(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let s in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(s)&&r.setRequestHeader(s,this._opts.extraHeaders[s])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var s;r.readyState===3&&((s=this._opts.cookieJar)===null||s===void 0||s.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(s){this.setTimeoutFn(()=>{this._onError(s)},0);return}typeof document<"u"&&(this._index=Ep.requestsCount++,Ep.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=kY,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Ep.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};Dl.requestsCount=0;Dl.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",QE);else if(typeof addEventListener=="function"){const e="onpagehide"in as?"pagehide":"unload";addEventListener(e,QE,!1)}}function QE(){for(let e in Dl.requests)Dl.requests.hasOwnProperty(e)&&Dl.requests[e].abort()}const TY=(function(){const e=UO({xdomain:!1});return e&&e.responseType!==null})();class NY extends jY{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=TY&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Dl(UO,this.uri(),t)}}function UO(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||EY))return new XMLHttpRequest}catch{}if(!t)try{return new as[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const VO=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class MY extends tw{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=VO?{}:$O(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n{try{this.doWrite(r,o)}catch{}s&&gg(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=BO()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Zv=as.WebSocket||as.MozWebSocket;class _Y extends MY{createSocket(t,n,r){return VO?new Zv(t,n,r):n?new Zv(t,n):new Zv(t)}doWrite(t,n){this.ws.send(n)}}class RY extends tw{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=fY(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),s=dY();s.readable.pipeTo(t.writable),this._writer=s.writable.getWriter();const o=()=>{r.read().then(({done:u,value:d})=>{u||(this.onPacket(d),o())}).catch(u=>{})};o();const l={type:"open"};this.query.sid&&(l.data=`{"sid":"${this.query.sid}"}`),this._writer.write(l).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n{s&&gg(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const PY={websocket:_Y,webtransport:RY,polling:NY},OY=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,IY=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function bb(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let s=OY.exec(e||""),o={},l=14;for(;l--;)o[IY[l]]=s[l]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=AY(o,o.path),o.queryKey=DY(o,o.query),o}function AY(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function DY(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,s,o){s&&(n[s]=o)}),n}const xb=typeof addEventListener=="function"&&typeof removeEventListener=="function",kp=[];xb&&addEventListener("offline",()=>{kp.forEach(e=>e())},!1);class va extends Pn{constructor(t,n){if(super(),this.binaryType=hY,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=bb(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=bb(n.host).host);mg(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const s=r.prototype.name;this.transports.push(s),this._transportsByName[s]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=wY(this.opts.query)),xb&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},kp.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=LO,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&va.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",va.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,gg(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,s){if(typeof n=="function"&&(s=n,n=void 0),typeof r=="function"&&(s=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),s&&this.once("flush",s),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(va.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),xb&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=kp.indexOf(this._offlineEventListener);r!==-1&&kp.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}va.protocol=LO;class FY extends va{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",m=>{if(!r)if(m.type==="pong"&&m.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;va.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(h(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const g=new Error("probe error");g.transport=n.name,this.emitReserved("upgradeError",g)}}))};function o(){r||(r=!0,h(),n.close(),n=null)}const l=m=>{const g=new Error("probe error: "+m);g.transport=n.name,o(),this.emitReserved("upgradeError",g)};function u(){l("transport closed")}function d(){l("socket closed")}function f(m){n&&m.name!==n.name&&o()}const h=()=>{n.removeListener("open",s),n.removeListener("error",l),n.removeListener("close",u),this.off("close",d),this.off("upgrading",f)};n.once("open",s),n.once("error",l),n.once("close",u),this.once("close",d),this.once("upgrading",f),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;rPY[s]).filter(s=>!!s)),super(t,r)}};function $Y(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=bb(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const BY=typeof ArrayBuffer=="function",zY=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,HO=Object.prototype.toString,UY=typeof Blob=="function"||typeof Blob<"u"&&HO.call(Blob)==="[object BlobConstructor]",VY=typeof File=="function"||typeof File<"u"&&HO.call(File)==="[object FileConstructor]";function nw(e){return BY&&(e instanceof ArrayBuffer||zY(e))||UY&&e instanceof Blob||VY&&e instanceof File}function jp(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n=0&&e.num{delete this.acks[t];for(let u=0;u{this.io.clearTimeoutFn(o),n.apply(this,u)};l.withError=!0,this.acks[t]=l}emitWithAck(t,...n){return new Promise((r,s)=>{const o=(l,u)=>l?s(l):r(u);o.withError=!0,n.push(o),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((s,...o)=>r!==this._queue[0]?void 0:(s!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(s)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:_t.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case _t.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case _t.EVENT:case _t.BINARY_EVENT:this.onevent(t);break;case _t.ACK:case _t.BINARY_ACK:this.onack(t);break;case _t.DISCONNECT:this.ondisconnect();break;case _t.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...s){r||(r=!0,n.packet({type:_t.ACK,id:t,data:s}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:_t.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r0&&e.jitter<=1?e.jitter:0,this.attempts=0}mc.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0};mc.prototype.reset=function(){this.attempts=0};mc.prototype.setMin=function(e){this.ms=e};mc.prototype.setMax=function(e){this.max=e};mc.prototype.setJitter=function(e){this.jitter=e};class Cb extends Pn{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,mg(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new mc({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const s=n.parser||QY;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new LY(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const s=xs(n,"open",function(){r.onopen(),t&&t()}),o=u=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",u),t?t(u):this.maybeReconnectOnOpen()},l=xs(n,"error",o);if(this._timeout!==!1){const u=this._timeout,d=this.setTimeoutFn(()=>{s(),o(new Error("timeout")),n.close()},u);this.opts.autoUnref&&d.unref(),this.subs.push(()=>{this.clearTimeoutFn(d)})}return this.subs.push(s),this.subs.push(l),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(xs(t,"ping",this.onping.bind(this)),xs(t,"data",this.ondata.bind(this)),xs(t,"error",this.onerror.bind(this)),xs(t,"close",this.onclose.bind(this)),xs(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){gg(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new qO(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;rt()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(s=>{s?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",s)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const fu={};function Tp(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=$Y(e,t.path||"/socket.io"),r=n.source,s=n.id,o=n.path,l=fu[s]&&o in fu[s].nsps,u=t.forceNew||t["force new connection"]||t.multiplex===!1||l;let d;return u?d=new Cb(r,t):(fu[s]||(fu[s]=new Cb(r,t)),d=fu[s]),n.query&&!t.query&&(t.query=n.queryKey),d.socket(n.path,t)}Object.assign(Tp,{Manager:Cb,Socket:qO,io:Tp,connect:Tp});const _u=new Map,sw=e=>{if(_u.has(e)){const n=_u.get(e);return YE(n)}const t=Tp(e,{transports:["websocket","polling"],autoConnect:!1,reconnection:!0,reconnectionAttempts:5,reconnectionDelay:1e3,timeout:2e4});return _u.set(e,t),t.on("connect",()=>{console.log(`✅ WebSocket connected to ${e}`)}),t.on("disconnect",n=>{console.log(`❌ WebSocket disconnected from ${e}:`,n)}),t.on("connect_error",n=>{console.error(`🚫 WebSocket connection error to ${e}:`,n)}),t.on("reconnect",n=>{console.log(`🔄 WebSocket reconnected to ${e} after ${n} attempts`)}),t.on("reconnect_error",n=>{console.error(`🔄❌ WebSocket reconnection error to ${e}:`,n)}),YE(t)},ow=e=>{for(const[t,n]of _u.entries())if(n===e||e._socket===n){console.log(`🔌 Disconnecting socket for ${t}`),n.disconnect(),_u.delete(t);break}},YE=e=>({on:(t,n)=>{e.on(t,n)},off:t=>{e.off(t)},connect:()=>{e.connected||e.connect()},disconnect:()=>{e.disconnect()}}),bi=y.forwardRef(({className:e,...t},n)=>i.jsx("textarea",{className:Ie("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));bi.displayName="Textarea";const YY=e=>["chats","findChats",JSON.stringify(e)],XY=async({instanceName:e,remoteJid:t})=>{const n=await Ee.post(`/chat/findChats/${e}`,{where:{remoteJid:t}});return Array.isArray(n.data)?n.data[0]:n.data},eX=e=>{const{instanceName:t,remoteJid:n,...r}=e;return mt({...r,queryKey:YY({instanceName:t,remoteJid:n}),queryFn:()=>XY({instanceName:t,remoteJid:n}),enabled:!!t&&!!n})},tX=e=>["chats","findMessages",JSON.stringify(e)],nX=async({instanceName:e,remoteJid:t})=>{const n=await Ee.post(`/chat/findMessages/${e}`,{where:{key:{remoteJid:t}}});return n.data?.messages?.records?n.data.messages.records:n.data},rX=e=>{const{instanceName:t,remoteJid:n,...r}=e;return mt({...r,queryKey:tX({instanceName:t,remoteJid:n}),queryFn:()=>nX({instanceName:t,remoteJid:n}),enabled:!!t&&!!n})},sX=async({instanceName:e,token:t,data:n})=>(await Ee.post(`/message/sendText/${e}`,n,{headers:{apikey:t,"content-type":"application/json"}})).data,oX=async({instanceName:e,token:t,data:n})=>{try{const r={number:n.number,mediatype:n.mediaMessage.mediatype,mimetype:n.mediaMessage.mimetype,caption:n.mediaMessage.caption,media:n.mediaMessage.media,fileName:n.mediaMessage.fileName};return(await Ee.post(`/message/sendMedia/${e}`,r,{headers:{apikey:t,"content-type":"application/json"}})).data}catch(r){throw console.error("Erro ao enviar mídia:",r),r}},aX=async({instanceName:e,token:t,data:n})=>{try{const r={number:n.number,audioMessage:{audio:n.audioMessage.audio},options:n.options};return(await Ee.post(`/message/sendWhatsAppAudio/${e}`,r,{headers:{apikey:t,"content-type":"application/json"}})).data}catch(r){throw console.error("Erro ao enviar áudio:",r),r}};function KO(){return{sendText:nt(sX,{invalidateKeys:[["chats","findMessages"],["chats","findChats"]]})}}function WO(){return{sendMedia:nt(oX)}}function iX(){return{sendAudio:nt(aX)}}const GO=y.createContext({backgroundColor:"",textForegroundColor:"",primaryColor:"",fromMeBubbleColor:"",fromMeForegroundColor:"",fromOtherBubbleColor:"",fromOtherForegroundColor:"",fromMeQuotedBubbleColor:"",fromOtherQuotedBubbleColor:"",inputBackgroundColor:"",inputTextForegroundColor:"",inputIconsMainColor:""});function lX({children:e}){const[t]=hd(),{theme:n}=tc(),r=t.get("backgroundColor"),s=t.get("textForegroundColor"),o=t.get("primaryColor"),l=t.get("fromMeBubbleColor"),u=t.get("fromMeForegroundColor"),d=t.get("fromOtherBubbleColor"),f=t.get("fromOtherForegroundColor"),h=t.get("fromMeQuotedBubbleColor"),m=t.get("fromOtherQuotedBubbleColor"),g=t.get("inputBackgroundColor"),x=t.get("inputTextForegroundColor"),b=t.get("inputIconsMainColor"),w=()=>n==="dark"?"#0f0f0f":"#faf9fa",C=()=>n==="dark"?"#faf9fa":"#020202",k=()=>n==="dark"?"#0b332a":"#e0f0f0",j=()=>n==="dark"?"#0b332a":"#c8fff2",M=()=>n==="dark"?"#ffffff":"#020202",_=()=>n==="dark"?"#1d2724":"#e0f0f0",R=()=>n==="dark"?"#ffffff":"#020202",N=()=>n==="dark"?"#161616":"#e0f0f0",O=()=>n==="dark"?"#faf9fa":"#020202",D=()=>n==="dark"?"#1f463d":"#aff7e6",z=()=>n==="dark"?"#0f1413":"#d2e2e2",Q=()=>n==="dark"?"#0e6451":"#0b332a";return i.jsx(GO.Provider,{value:{backgroundColor:r||w(),textForegroundColor:s||C(),primaryColor:o||k(),fromMeBubbleColor:l||j(),fromMeForegroundColor:u||M(),fromOtherBubbleColor:d||_(),fromOtherForegroundColor:f||R(),fromMeQuotedBubbleColor:h||D(),fromOtherQuotedBubbleColor:m||z(),inputBackgroundColor:g||N(),inputTextForegroundColor:x||O(),inputIconsMainColor:b||Q()},children:e})}const La=()=>y.useContext(GO),JO=({setSelectedMedia:e})=>{const{t}=Ve(),{inputIconsMainColor:n}=La(),r=y.useRef(null),s=y.useRef(null),[o,l]=y.useState(!1),u=m=>{const g=m.target.files?.[0];if(!g){e(null);return}const x=g.type.split("/")[0],b=g.size/(1024*1024);switch(x){case"audio":if(b>16){me.error(t("chat.media.errors.audioSize"));return}break;case"image":if(b>5){me.error(t("chat.media.errors.imageSize"));return}break;case"video":if(b>16){me.error(t("chat.media.errors.videoSize"));return}break;case"application":case"text":if(b>100){me.error(t("chat.media.errors.documentSize"));return}break;default:me.error(t("chat.media.errors.unsupportedType"));return}e(g)},d=m=>{m.preventDefault(),r.current&&r.current.click()},f=m=>{m.preventDefault(),s.current&&s.current.click()},h=["text/plain","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/zip","application/x-rar-compressed","application/x-7z-compressed"];return i.jsx(i.Fragment,{children:i.jsxs(Kr,{open:o,onOpenChange:l,children:[i.jsx(Wr,{asChild:!0,children:i.jsxs(se,{type:"button",variant:"ghost",size:"icon",className:"rounded-full p-2",children:[i.jsx(cs,{className:"h-6 w-6",style:{color:n}}),i.jsx("span",{className:"sr-only",children:t("chat.media.attach")})]})}),i.jsxs(hr,{align:"end",children:[i.jsx("input",{ref:s,type:"file",accept:h.join(", "),onChange:u,className:"hidden"}),i.jsxs(wt,{onClick:f,children:[i.jsx(rB,{className:"mr-2 h-4 w-4"}),t("chat.media.document")]}),i.jsx("input",{ref:r,type:"file",accept:"image/*, video/*",onChange:u,className:"hidden"}),i.jsxs(wt,{onClick:d,children:[i.jsx(uB,{className:"mr-2 h-4 w-4"}),t("chat.media.photosAndVideos")]})]})]})})},QO=({selectedMedia:e,setSelectedMedia:t})=>{const{t:n}=Ve(),r=()=>{t(null)},s=l=>l.type.includes("image")?i.jsx("img",{className:"w-80 rounded-lg",src:URL.createObjectURL(l),alt:n("chat.media.selectedMedia.imageAlt"),style:{maxHeight:"400px",objectFit:"contain"}}):l.type.includes("video")?i.jsx("div",{className:"flex items-center justify-center",children:i.jsx("video",{className:"w-80 rounded-lg object-cover",src:URL.createObjectURL(l),controls:!0})}):i.jsx("div",{className:"flex items-center justify-center",children:i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx(Hb,{className:"h-6 w-6"}),n("chat.media.selectedMedia.file")]})}),o=l=>{const u=["B","KB","MB","GB","TB"];let d=0;for(;l>1024;)l/=1024,d++;return`${l.toFixed(2)} ${u[d]}`};return i.jsxs("div",{className:"relative flex items-center rounded-lg bg-[#e0f0f0] dark:bg-[#1d2724] dark:text-white",children:[i.jsx("div",{className:"absolute h-full w-1 rounded-l-lg bg-blue-700 dark:bg-blue-300"}),i.jsxs("div",{className:"flex w-full flex-col items-center justify-center gap-6 p-4 pl-4",children:[e&&s(e),i.jsxs("div",{className:"flex flex-col items-center justify-center gap-2",children:[i.jsx("span",{className:"text-sm font-medium",children:e?.name||n("chat.media.selectedMedia.selectedFile")}),i.jsx("span",{className:"text-xs text-gray-500",children:o(e?.size||0)})]})]}),i.jsx(se,{size:"icon",variant:"ghost",className:"ml-auto h-10 w-10 rounded-full",onClick:r,children:i.jsx(qb,{className:"h-6 w-6"})})]})},XE=e=>{const t=new Date,n=new Date(t);n.setDate(n.getDate()-1);const r=new Date(e);return r.toDateString()===t.toDateString()?"Hoje":r.toDateString()===n.toDateString()?"Ontem":Math.floor((t.getTime()-r.getTime())/(1e3*60*60*24))<7?r.toLocaleDateString("pt-BR",{weekday:"long"}):r.toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit",year:"numeric"})},Yv=e=>{try{if(!e.messageTimestamp)return new Date;if(typeof e.messageTimestamp=="object"){const n=[e.messageTimestamp.low,e.messageTimestamp.seconds,e.messageTimestamp.timestamp,e.messageTimestamp.time,e.messageTimestamp.value].find(r=>typeof r=="number"&&!isNaN(r))||Date.now()/1e3;return new Date(n*1e3)}else if(isNaN(Number(e.messageTimestamp))){if(typeof e.messageTimestamp=="string"&&e.messageTimestamp.includes("T"))return new Date(e.messageTimestamp)}else{const t=Number(e.messageTimestamp);return t>1e12?new Date(t):new Date(t*1e3)}return new Date}catch{return new Date}},cX=({date:e})=>i.jsx("div",{className:"flex items-center justify-center py-4",children:i.jsx("div",{className:"rounded-full bg-muted px-3 py-1",children:i.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:e})})}),uX=e=>{if(!e)return"";if(typeof e=="string")try{const t=JSON.parse(e);return t.conversation||t.text||e}catch{return e}return typeof e=="object"?e.conversation||e.text||"":String(e)},ek=({message:e})=>{const t=e.messageType;switch(t){case"conversation":if(e.message.contactMessage){const d=e.message.contactMessage;return i.jsxs("div",{className:"p-3 bg-muted rounded-lg max-w-xs",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx("div",{className:"text-xl",children:"👤"}),i.jsx("span",{className:"font-medium",children:"Contact"})]}),d.displayName&&i.jsx("p",{className:"text-sm font-medium",children:d.displayName}),d.vcard&&i.jsx("p",{className:"text-xs text-muted-foreground",children:"Contact card"})]})}if(e.message.locationMessage){const d=e.message.locationMessage;return i.jsxs("div",{className:"p-3 bg-muted rounded-lg max-w-xs",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx("div",{className:"text-xl",children:"📍"}),i.jsx("span",{className:"font-medium",children:"Location"})]}),d.name&&i.jsx("p",{className:"text-sm font-medium",children:d.name}),d.address&&i.jsx("p",{className:"text-xs text-muted-foreground",children:d.address}),d.degreesLatitude&&d.degreesLongitude&&i.jsx("a",{href:`https://maps.google.com/?q=${d.degreesLatitude},${d.degreesLongitude}`,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline text-sm mt-1 inline-block",children:"View on Maps"})]})}return i.jsx("span",{children:uX(e.message)});case"extendedTextMessage":return i.jsx("span",{children:e.message.conversation??e.message.extendedTextMessage?.text});case"imageMessage":const r=(e.message.base64?e.message.base64.startsWith("data:")?e.message.base64:`data:image/jpeg;base64,${e.message.base64}`:null)||e.message.mediaUrl;return i.jsxs("div",{className:"flex flex-col gap-2",children:[r?i.jsx("img",{src:r,alt:"Image",className:"rounded-lg max-w-full h-auto",style:{maxWidth:"400px",maxHeight:"400px",objectFit:"contain"},loading:"lazy"}):i.jsxs("div",{className:"rounded bg-muted p-4 max-w-xs",children:[i.jsx("p",{className:"text-center text-muted-foreground",children:"Image couldn't be loaded"}),i.jsx("p",{className:"text-center text-xs text-muted-foreground mt-1",children:"Missing base64 data and mediaUrl"})]}),e.message.imageMessage?.caption&&i.jsx("p",{className:"text-sm",children:e.message.imageMessage.caption})]});case"videoMessage":const o=(e.message.base64?e.message.base64.startsWith("data:")?e.message.base64:`data:video/mp4;base64,${e.message.base64}`:null)||e.message.mediaUrl;return i.jsxs("div",{className:"flex flex-col gap-2",children:[o?i.jsx("video",{src:o,controls:!0,className:"rounded-lg max-w-full h-auto",style:{maxWidth:"400px",maxHeight:"400px"}}):i.jsxs("div",{className:"rounded bg-muted p-4 max-w-xs",children:[i.jsx("p",{className:"text-center text-muted-foreground",children:"Video couldn't be loaded"}),i.jsx("p",{className:"text-center text-xs text-muted-foreground mt-1",children:"Missing base64 data and mediaUrl"})]}),e.message.videoMessage?.caption&&i.jsx("p",{className:"text-sm",children:e.message.videoMessage.caption})]});case"audioMessage":const u=(e.message.base64?e.message.base64.startsWith("data:")?e.message.base64:`data:audio/mpeg;base64,${e.message.base64}`:null)||e.message.mediaUrl;return u?i.jsxs("audio",{controls:!0,className:"w-full max-w-xs",children:[i.jsx("source",{src:u,type:"audio/mpeg"}),"Your browser does not support the audio element."]}):i.jsxs("div",{className:"rounded bg-muted p-4 max-w-xs",children:[i.jsx("p",{className:"text-center text-muted-foreground",children:"Audio couldn't be loaded"}),i.jsx("p",{className:"text-center text-xs text-muted-foreground mt-1",children:"Missing base64 data and mediaUrl"})]});case"documentMessage":return i.jsxs("div",{className:"flex items-center gap-2 p-3 bg-muted rounded-lg max-w-xs",children:[i.jsx("div",{className:"text-2xl",children:"📄"}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("p",{className:"font-medium truncate",children:e.message.documentMessage?.fileName||"Document"}),e.message.documentMessage?.fileLength&&i.jsxs("p",{className:"text-xs text-muted-foreground",children:[(e.message.documentMessage.fileLength/1024/1024).toFixed(2)," MB"]})]})]});case"stickerMessage":return i.jsx("img",{src:e.message.mediaUrl,alt:"Sticker",className:"max-w-32 max-h-32 object-contain"});default:return i.jsx("div",{className:"text-xs text-muted-foreground bg-muted p-2 rounded max-w-xs",children:i.jsxs("details",{children:[i.jsxs("summary",{children:["Unknown message type: ",t]}),i.jsx("pre",{className:"mt-2 whitespace-pre-wrap break-all text-xs",children:JSON.stringify(e.message,null,2)})]})})}};function ZO({textareaRef:e,handleTextareaChange:t,textareaHeight:n,lastMessageRef:r,scrollToBottom:s}){const{instance:o}=ct(),[l,u]=y.useState(""),[d,f]=y.useState(!1),[h,m]=y.useState(null),[g,x]=y.useState([]),{sendText:b}=KO(),{sendMedia:w}=WO(),{remoteJid:C}=ls(),k=async()=>{if(!(!l.trim()||!C||!o?.name||!o?.token||d))try{f(!0),await b({instanceName:o.name,token:o.token,data:{number:C,text:l.trim()}}),u(""),e.current&&(e.current.value="",t())}catch(G){console.error("Error sending message:",G)}finally{f(!1)}},j=async()=>{if(!(!h||!C||!o?.name||!o?.token||d))try{f(!0);const G=await new Promise((W,ie)=>{const re=new FileReader;re.readAsDataURL(h),re.onload=()=>{const H=re.result.split(",")[1];W(H)},re.onerror=ie});await w({instanceName:o.name,token:o.token,data:{number:C,mediaMessage:{mediatype:h.type.split("/")[0]==="application"?"document":h.type.split("/")[0],mimetype:h.type,caption:l.trim(),media:G,fileName:h.name}}}),m(null),u(""),e.current&&(e.current.value="",t())}catch(G){console.error("Error sending media:",G)}finally{f(!1)}},M=async()=>{h?await j():await k()},_=G=>{G.key==="Enter"&&!G.shiftKey&&(G.preventDefault(),M())},R=G=>{u(G.target.value),t()},{data:N}=eX({remoteJid:C,instanceName:o?.name}),{data:O,isSuccess:D}=rX({remoteJid:C,instanceName:o?.name}),z=y.useMemo(()=>{if(!O)return g;const G=new Map;return O.forEach(W=>G.set(W.key.id,W)),g.forEach(W=>{G.set(W.key.id,W)}),Array.from(G.values())},[O,g]);y.useEffect(()=>{if(!o?.name||!C)return;const G=dr(jn.API_URL);if(!G){console.error("API URL not found in localStorage");return}const W=sw(G),ie=(Y,H)=>{if(!o||H.instance!==o.name||H?.data?.key?.remoteJid!==C)return;const q=H.data;x(he=>{const A=he.findIndex(F=>F.key.id===q.key.id);if(A!==-1){const F=[...he];return F[A]=q,F}else return[...he,q]})},re=Y=>{o&&Y.instance===o.name&&console.log("Received message status update:",Y)};return W.on("messages.upsert",Y=>{ie("messages.upsert",Y)}),W.on("send.message",Y=>{ie("send.message",Y)}),W.on("messages.update",Y=>{re(Y)}),W.connect(),()=>{W.off("messages.upsert"),W.off("send.message"),W.off("messages.update"),ow(W)}},[o?.name,C]);const Q=y.useMemo(()=>{if(!z)return[];const G=[...z].sort((Y,H)=>{const q=Yv(Y).getTime(),he=Yv(H).getTime();return q-he}),W=[];let ie="",re=[];return G.forEach(Y=>{const q=Yv(Y).toDateString();q!==ie?(re.length>0&&W.push({date:XE(new Date(ie)),messages:re}),ie=q,re=[Y]):re.push(Y)}),re.length>0&&W.push({date:XE(new Date(ie)),messages:re}),W},[z]);y.useEffect(()=>{D&&z&&s()},[D,z,s]),y.useEffect(()=>{m(null),u(""),x([]),e.current&&(e.current.value="",t())},[C]);const pe=G=>i.jsx("div",{className:"bubble-right",children:i.jsx("div",{className:"flex items-start gap-4 self-end",children:i.jsx("div",{className:"grid gap-1",children:i.jsx("div",{className:"bubble",children:i.jsx(ek,{message:G})})})})},G.id),V=G=>i.jsx("div",{className:"bubble-left",children:i.jsx("div",{className:"flex items-start gap-4",children:i.jsx("div",{className:"grid gap-1",children:i.jsx("div",{className:"bubble",children:i.jsx(ek,{message:G})})})})},G.id);return i.jsxs("div",{className:"flex h-full flex-col",children:[i.jsx("div",{className:"sticky top-0 bg-background border-b border-border p-3",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs(Ei,{className:"h-10 w-10",children:[i.jsx(ki,{src:N?.profilePicUrl,alt:N?.pushName||N?.remoteJid?.split("@")[0]}),i.jsx(Up,{className:"bg-slate-700 text-slate-300 border border-slate-600",children:i.jsx(Ap,{className:"h-5 w-5"})})]}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("div",{className:"font-medium text-sm truncate",children:N?.pushName||N?.remoteJid?.split("@")[0]}),i.jsx("div",{className:"text-xs text-muted-foreground truncate",children:N?.remoteJid?.split("@")[0]})]}),i.jsxs(dx,{children:[i.jsx(fx,{asChild:!0,children:i.jsx(se,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:i.jsx(Nh,{className:"h-4 w-4"})})}),i.jsxs(hr,{align:"start",className:"max-w-[300px]",children:[i.jsxs(wt,{className:"items-start gap-2",children:[i.jsx(wB,{className:"mr-2 h-4 w-4 shrink-0 translate-y-1"}),i.jsxs("div",{children:[i.jsx("div",{className:"font-medium",children:"GPT-4"}),i.jsx("div",{className:"text-muted-foreground/80",children:"With DALL-E, browsing and analysis. Limit 40 messages / 3 hours"})]})]}),i.jsx(Xs,{}),i.jsxs(wt,{className:"items-start gap-2",children:[i.jsx(mT,{className:"mr-2 h-4 w-4 shrink-0 translate-y-1"}),i.jsxs("div",{children:[i.jsx("div",{className:"font-medium",children:"GPT-3"}),i.jsx("div",{className:"text-muted-foreground/80",children:"Great for everyday tasks"})]})]})]})]})]})}),i.jsxs("div",{className:"message-container mx-auto flex max-w-4xl flex-1 flex-col gap-2 overflow-y-auto px-2",children:[Q.map((G,W)=>i.jsxs("div",{children:[i.jsx(cX,{date:G.date}),i.jsx("div",{className:"flex flex-col gap-2",children:G.messages.map(ie=>ie.key.fromMe?pe(ie):V(ie))})]},W)),i.jsx("div",{ref:r})]}),i.jsxs("div",{className:"sticky bottom-0 mx-auto flex w-full max-w-2xl flex-col gap-1.5 bg-background px-2 py-2",children:[h&&i.jsx(QO,{selectedMedia:h,setSelectedMedia:m}),i.jsxs("div",{className:"flex items-center rounded-3xl border border-border bg-background px-2 py-1",children:[o&&i.jsx(JO,{instance:o,setSelectedMedia:m}),i.jsx(bi,{placeholder:"Enviar mensagem...",name:"message",id:"message",rows:1,ref:e,value:l,onChange:R,onKeyDown:_,disabled:d,style:{height:n},className:"min-h-0 w-full resize-none border-none p-3 focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-transparent focus-visible:ring-offset-0 focus-visible:ring-offset-transparent"}),i.jsxs(se,{type:"button",size:"icon",onClick:M,disabled:!l.trim()&&!h||d,className:"rounded-full p-2 disabled:opacity-50",children:[i.jsx(Th,{className:"h-6 w-6"}),i.jsx("span",{className:"sr-only",children:"Enviar"})]})]})]})]})}const dX=e=>e.split("@")[0];function tk(){const e=zo("(min-width: 768px)"),t=y.useRef(null),[n]=y.useState("auto"),r=y.useRef(null),{instance:s}=ct(),[o,l]=y.useState([]),{data:u,isSuccess:d}=sY({instanceName:s?.name}),f=qe.useMemo(()=>{if(!u)return o;const C=new Map;return u.forEach(k=>C.set(k.remoteJid,k)),o.forEach(k=>{const j=C.get(k.remoteJid);j?C.set(k.remoteJid,{...j,...k}):C.set(k.remoteJid,k)}),Array.from(C.values())},[u,o]),{instanceId:h,remoteJid:m}=ls(),g=dn();y.useEffect(()=>{if(!s?.name)return;const C=dr(jn.API_URL);if(!C){console.error("API URL not found in localStorage");return}const k=sw(C),j=(M,_)=>{if(!s||_.instance!==s.name)return;const R=_?.data?.key?.remoteJid;R&&l(N=>{const O=N.findIndex(z=>z.remoteJid===R),D={id:R,remoteJid:R,pushName:_?.data?.pushName||dX(R),profilePicUrl:_?.data?.key?.profilePictureUrl||"",..._?.data};if(O!==-1){const z=[...N];return z[O]={...z[O],...D},z}else return[...N,D]})};return k.on("messages.upsert",M=>{j("messages.upsert",M)}),k.on("send.message",M=>{j("send.message",M)}),k.connect(),()=>{k.off("messages.upsert"),k.off("send.message"),ow(k)}},[s?.name]);const x=y.useCallback(()=>{t.current&&t.current.scrollIntoView({})},[]),b=()=>{if(r.current){r.current.style.height="auto";const C=r.current.scrollHeight,j=parseInt(getComputedStyle(r.current).lineHeight)*10;r.current.style.height=`${Math.min(C,j)}px`}};y.useEffect(()=>{d&&x()},[d,x]);const w=C=>{g(`/manager/instance/${h}/chat/${C}`)};return i.jsx("div",{className:"h-[calc(100vh-160px)] overflow-hidden",children:i.jsxs($o,{direction:e?"horizontal":"vertical",className:"h-full",children:[i.jsx(Hn,{defaultSize:20,children:i.jsxs("div",{className:"hidden h-full flex-col bg-background text-foreground md:flex",children:[i.jsx("div",{className:"flex-shrink-0 p-2",children:i.jsxs(se,{variant:"ghost",className:"w-full justify-start gap-2 px-2 text-left",children:[i.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-full",children:i.jsx(Bl,{className:"h-4 w-4"})}),i.jsx("div",{className:"grow overflow-hidden text-ellipsis whitespace-nowrap text-sm",children:"Chat"}),i.jsx(cs,{className:"h-4 w-4"})]})}),i.jsxs(Yx,{defaultValue:"contacts",className:"flex flex-col flex-1 min-h-0",children:[i.jsxs(hg,{className:"tabs-chat flex-shrink-0",children:[i.jsx(Jl,{value:"contacts",children:"Contatos"}),i.jsx(Jl,{value:"groups",children:"Grupos"})]}),i.jsx(Ql,{value:"contacts",className:"flex-1 overflow-hidden",children:i.jsx("div",{className:"h-full overflow-auto",children:i.jsxs("div",{className:"grid gap-1 p-2 text-foreground",children:[i.jsx("div",{className:"px-2 text-xs font-medium text-muted-foreground",children:"Contatos"}),u?.map(C=>C.remoteJid.includes("@s.whatsapp.net")&&i.jsxs(Fu,{to:"#",onClick:()=>w(C.remoteJid),className:`chat-item flex items-center overflow-hidden truncate whitespace-nowrap rounded-md border-b border-gray-600/50 p-2 text-sm transition-colors hover:bg-muted/50 ${m===C.remoteJid?"active":""}`,children:[i.jsx("span",{className:"chat-avatar mr-2",children:i.jsxs(Ei,{className:"h-8 w-8",children:[i.jsx(ki,{src:C.profilePicUrl,alt:C.pushName||C.remoteJid.split("@")[0]}),i.jsx(Up,{className:"bg-slate-700 text-slate-300 border border-slate-600",children:i.jsx(Ap,{className:"h-5 w-5"})})]})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:"chat-title block font-medium",children:C.pushName||C.remoteJid.split("@")[0]}),i.jsx("span",{className:"chat-description block text-xs text-gray-500",children:C.remoteJid.split("@")[0]})]})]},C.id))]})})}),i.jsx(Ql,{value:"groups",className:"flex-1 overflow-hidden",children:i.jsx("div",{className:"h-full overflow-auto",children:i.jsx("div",{className:"grid gap-1 p-2 text-foreground",children:f?.map(C=>C.remoteJid.includes("@g.us")&&i.jsxs(Fu,{to:"#",onClick:()=>w(C.remoteJid),className:`chat-item flex items-center overflow-hidden truncate whitespace-nowrap rounded-md border-b border-gray-600/50 p-2 text-sm transition-colors hover:bg-muted/50 ${m===C.remoteJid?"active":""}`,children:[i.jsx("span",{className:"chat-avatar mr-2",children:i.jsxs(Ei,{className:"h-8 w-8",children:[i.jsx(ki,{src:C.profilePicUrl,alt:C.pushName||C.remoteJid.split("@")[0]}),i.jsx(Up,{className:"bg-slate-700 text-slate-300 border border-slate-600",children:i.jsx(Ap,{className:"h-5 w-5"})})]})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:"chat-title block font-medium",children:C.pushName||C.remoteJid.split("@")[0]}),i.jsx("span",{className:"chat-description block text-xs text-gray-500",children:C.remoteJid})]})]},C.id))})})})]})]})}),i.jsx(Bo,{withHandle:!0,className:"border border-black"}),i.jsx(Hn,{children:m&&i.jsx(ZO,{textareaRef:r,handleTextareaChange:b,textareaHeight:n,lastMessageRef:t,scrollToBottom:x})})]})})}const fX=e=>["chatwoot","fetchChatwoot",JSON.stringify(e)],pX=async({instanceName:e,token:t})=>(await Ee.get(`/chatwoot/find/${e}`,{headers:{apiKey:t}})).data,hX=e=>{const{instanceName:t,token:n,...r}=e;return mt({...r,queryKey:fX({instanceName:t,token:n}),queryFn:()=>pX({instanceName:t,token:n}),enabled:!!t})},gX=async({instanceName:e,token:t,data:n})=>(await Ee.post(`/chatwoot/set/${e}`,n,{headers:{apikey:t}})).data;function mX(){return{createChatwoot:nt(gX,{invalidateKeys:[["chatwoot","fetchChatwoot"]]})}}const rp=P.string().optional().transform(e=>e===""?void 0:e),vX=P.object({enabled:P.boolean(),accountId:P.string(),token:P.string(),url:P.string(),signMsg:P.boolean().optional(),signDelimiter:rp,nameInbox:rp,organization:rp,logo:rp,reopenConversation:P.boolean().optional(),conversationPending:P.boolean().optional(),mergeBrazilContacts:P.boolean().optional(),importContacts:P.boolean().optional(),importMessages:P.boolean().optional(),daysLimitImportMessages:P.coerce.number().optional(),autoCreate:P.boolean(),ignoreJids:P.array(P.string()).default([])});function yX(){const{t:e}=Ve(),{instance:t}=ct(),[,n]=y.useState(!1),{createChatwoot:r}=mX(),{data:s}=hX({instanceName:t?.name,token:t?.token}),o=on({resolver:an(vX),defaultValues:{enabled:!0,accountId:"",token:"",url:"",signMsg:!0,signDelimiter:"\\n",nameInbox:"",organization:"",logo:"",reopenConversation:!0,conversationPending:!1,mergeBrazilContacts:!0,importContacts:!1,importMessages:!1,daysLimitImportMessages:7,autoCreate:!0,ignoreJids:[]}});y.useEffect(()=>{if(s){o.setValue("ignoreJids",s.ignoreJids||[]);const u={enabled:s.enabled,accountId:s.accountId,token:s.token,url:s.url,signMsg:s.signMsg||!1,signDelimiter:s.signDelimiter||"\\n",nameInbox:s.nameInbox||"",organization:s.organization||"",logo:s.logo||"",reopenConversation:s.reopenConversation||!1,conversationPending:s.conversationPending||!1,mergeBrazilContacts:s.mergeBrazilContacts||!1,importContacts:s.importContacts||!1,importMessages:s.importMessages||!1,daysLimitImportMessages:s.daysLimitImportMessages||7,autoCreate:s.autoCreate||!1,ignoreJids:s.ignoreJids};o.reset(u)}},[s,o]);const l=async u=>{if(!t)return;n(!0);const d={enabled:u.enabled,accountId:u.accountId,token:u.token,url:u.url,signMsg:u.signMsg||!1,signDelimiter:u.signDelimiter||"\\n",nameInbox:u.nameInbox||"",organization:u.organization||"",logo:u.logo||"",reopenConversation:u.reopenConversation||!1,conversationPending:u.conversationPending||!1,mergeBrazilContacts:u.mergeBrazilContacts||!1,importContacts:u.importContacts||!1,importMessages:u.importMessages||!1,daysLimitImportMessages:u.daysLimitImportMessages||7,autoCreate:u.autoCreate,ignoreJids:u.ignoreJids};await r({instanceName:t.name,token:t.token,data:d},{onSuccess:()=>{me.success(e("chatwoot.toast.success"))},onError:f=>{console.error(e("chatwoot.toast.error"),f),rT(f)?me.error(`Error: ${f?.response?.data?.response?.message}`):me.error(e("chatwoot.toast.error"))},onSettled:()=>{n(!1)}})};return i.jsx(i.Fragment,{children:i.jsx(Fo,{...o,children:i.jsxs("form",{onSubmit:o.handleSubmit(l),className:"w-full space-y-6",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("chatwoot.title")}),i.jsx(Oa,{className:"my-4"}),i.jsxs("div",{className:"mx-4 space-y-2 divide-y [&>*]:px-4 [&>*]:py-2",children:[i.jsx(Pe,{name:"enabled",label:e("chatwoot.form.enabled.label"),className:"w-full justify-between",helper:e("chatwoot.form.enabled.description")}),i.jsx(le,{name:"url",label:e("chatwoot.form.url.label"),children:i.jsx(ne,{})}),i.jsx(le,{name:"accountId",label:e("chatwoot.form.accountId.label"),children:i.jsx(ne,{})}),i.jsx(le,{name:"token",label:e("chatwoot.form.token.label"),children:i.jsx(ne,{type:"password"})}),i.jsx(Pe,{name:"signMsg",label:e("chatwoot.form.signMsg.label"),className:"w-full justify-between",helper:e("chatwoot.form.signMsg.description")}),i.jsx(le,{name:"signDelimiter",label:e("chatwoot.form.signDelimiter.label"),children:i.jsx(ne,{})}),i.jsx(le,{name:"nameInbox",label:e("chatwoot.form.nameInbox.label"),children:i.jsx(ne,{})}),i.jsx(le,{name:"organization",label:e("chatwoot.form.organization.label"),children:i.jsx(ne,{})}),i.jsx(le,{name:"logo",label:e("chatwoot.form.logo.label"),children:i.jsx(ne,{})}),i.jsx(Pe,{name:"conversationPending",label:e("chatwoot.form.conversationPending.label"),className:"w-full justify-between",helper:e("chatwoot.form.conversationPending.description")}),i.jsx(Pe,{name:"reopenConversation",label:e("chatwoot.form.reopenConversation.label"),className:"w-full justify-between",helper:e("chatwoot.form.reopenConversation.description")}),i.jsx(Pe,{name:"importContacts",label:e("chatwoot.form.importContacts.label"),className:"w-full justify-between",helper:e("chatwoot.form.importContacts.description")}),i.jsx(Pe,{name:"importMessages",label:e("chatwoot.form.importMessages.label"),className:"w-full justify-between",helper:e("chatwoot.form.importMessages.description")}),i.jsx(le,{name:"daysLimitImportMessages",label:e("chatwoot.form.daysLimitImportMessages.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(Da,{name:"ignoreJids",label:e("chatwoot.form.ignoreJids.label"),placeholder:e("chatwoot.form.ignoreJids.placeholder")}),i.jsx(Pe,{name:"autoCreate",label:e("chatwoot.form.autoCreate.label"),className:"w-full justify-between",helper:e("chatwoot.form.autoCreate.description")})]})]}),i.jsx("div",{className:"mx-4 flex justify-end",children:i.jsx(se,{type:"submit",children:e("chatwoot.button.save")})})]})})})}var wl={},Xv={exports:{}},ey,nk;function bX(){if(nk)return ey;nk=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ey=e,ey}var ty,rk;function xX(){if(rk)return ty;rk=1;var e=bX();function t(){}function n(){}return n.resetWarningCache=t,ty=function(){function r(l,u,d,f,h,m){if(m!==e){var g=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw g.name="Invariant Violation",g}}r.isRequired=r;function s(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:s,element:r,elementType:r,instanceOf:s,node:r,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},ty}var sk;function YO(){return sk||(sk=1,Xv.exports=xX()()),Xv.exports}var ny,ok;function XO(){return ok||(ok=1,ny={L:1,M:0,Q:3,H:2}),ny}var ry,ak;function eI(){return ak||(ak=1,ry={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8}),ry}var sy,ik;function wX(){if(ik)return sy;ik=1;var e=eI();function t(n){this.mode=e.MODE_8BIT_BYTE,this.data=n}return t.prototype={getLength:function(n){return this.data.length},write:function(n){for(var r=0;r>>7-t%8&1)==1},put:function(t,n){for(var r=0;r>>n-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){var n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),t&&(this.buffer[n]|=128>>>this.length%8),this.length++}},ay=e,ay}var iy,uk;function tI(){if(uk)return iy;uk=1;for(var e={glog:function(n){if(n<1)throw new Error("glog("+n+")");return e.LOG_TABLE[n]},gexp:function(n){for(;n<0;)n+=255;for(;n>=256;)n-=255;return e.EXP_TABLE[n]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},t=0;t<8;t++)e.EXP_TABLE[t]=1<=0;)l^=s.G15<=0;)l^=s.G18<>>=1;return l},getPatternPosition:function(o){return s.PATTERN_POSITION_TABLE[o-1]},getMask:function(o,l,u){switch(o){case r.PATTERN000:return(l+u)%2==0;case r.PATTERN001:return l%2==0;case r.PATTERN010:return u%3==0;case r.PATTERN011:return(l+u)%3==0;case r.PATTERN100:return(Math.floor(l/2)+Math.floor(u/3))%2==0;case r.PATTERN101:return l*u%2+l*u%3==0;case r.PATTERN110:return(l*u%2+l*u%3)%2==0;case r.PATTERN111:return(l*u%3+(l+u)%2)%2==0;default:throw new Error("bad maskPattern:"+o)}},getErrorCorrectPolynomial:function(o){for(var l=new t([1],0),u=0;u5&&(u+=3+h-5)}for(var d=0;d=7&&this.setupTypeNumber(u),this.dataCache==null&&(this.dataCache=o.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,d)},l.setupPositionProbePattern=function(u,d){for(var f=-1;f<=7;f++)if(!(u+f<=-1||this.moduleCount<=u+f))for(var h=-1;h<=7;h++)d+h<=-1||this.moduleCount<=d+h||(0<=f&&f<=6&&(h==0||h==6)||0<=h&&h<=6&&(f==0||f==6)||2<=f&&f<=4&&2<=h&&h<=4?this.modules[u+f][d+h]=!0:this.modules[u+f][d+h]=!1)},l.getBestMaskPattern=function(){for(var u=0,d=0,f=0;f<8;f++){this.makeImpl(!0,f);var h=r.getLostPoint(this);(f==0||u>h)&&(u=h,d=f)}return d},l.createMovieClip=function(u,d,f){var h=u.createEmptyMovieClip(d,f),m=1;this.make();for(var g=0;g>f&1)==1;this.modules[Math.floor(f/3)][f%3+this.moduleCount-8-3]=h}for(var f=0;f<18;f++){var h=!u&&(d>>f&1)==1;this.modules[f%3+this.moduleCount-8-3][Math.floor(f/3)]=h}},l.setupTypeInfo=function(u,d){for(var f=this.errorCorrectLevel<<3|d,h=r.getBCHTypeInfo(f),m=0;m<15;m++){var g=!u&&(h>>m&1)==1;m<6?this.modules[m][8]=g:m<8?this.modules[m+1][8]=g:this.modules[this.moduleCount-15+m][8]=g}for(var m=0;m<15;m++){var g=!u&&(h>>m&1)==1;m<8?this.modules[8][this.moduleCount-m-1]=g:m<9?this.modules[8][15-m-1+1]=g:this.modules[8][15-m-1]=g}this.modules[this.moduleCount-8][8]=!u},l.mapData=function(u,d){for(var f=-1,h=this.moduleCount-1,m=7,g=0,x=this.moduleCount-1;x>0;x-=2)for(x==6&&x--;;){for(var b=0;b<2;b++)if(this.modules[h][x-b]==null){var w=!1;g>>m&1)==1);var C=r.getMask(d,h,x-b);C&&(w=!w),this.modules[h][x-b]=w,m--,m==-1&&(g++,m=7)}if(h+=f,h<0||this.moduleCount<=h){h-=f,f=-f;break}}},o.PAD0=236,o.PAD1=17,o.createData=function(u,d,f){for(var h=t.getRSBlocks(u,d),m=new n,g=0;gb*8)throw new Error("code length overflow. ("+m.getLengthInBits()+">"+b*8+")");for(m.getLengthInBits()+4<=b*8&&m.put(0,4);m.getLengthInBits()%8!=0;)m.putBit(!1);for(;!(m.getLengthInBits()>=b*8||(m.put(o.PAD0,8),m.getLengthInBits()>=b*8));)m.put(o.PAD1,8);return o.createBytes(m,h)},o.createBytes=function(u,d){for(var f=0,h=0,m=0,g=new Array(d.length),x=new Array(d.length),b=0;b=0?_.get(R):0}}for(var N=0,k=0;k=0||Object.prototype.hasOwnProperty.call(f,g)&&(m[g]=f[g]);return m}var u={bgColor:n.default.oneOfType([n.default.object,n.default.string]).isRequired,bgD:n.default.string.isRequired,fgColor:n.default.oneOfType([n.default.object,n.default.string]).isRequired,fgD:n.default.string.isRequired,size:n.default.number.isRequired,title:n.default.string,viewBoxSize:n.default.number.isRequired,xmlns:n.default.string},d=(0,r.forwardRef)(function(f,h){var m=f.bgColor,g=f.bgD,x=f.fgD,b=f.fgColor,w=f.size,C=f.title,k=f.viewBoxSize,j=f.xmlns,M=j===void 0?"http://www.w3.org/2000/svg":j,_=l(f,["bgColor","bgD","fgD","fgColor","size","title","viewBoxSize","xmlns"]);return s.default.createElement("svg",e({},_,{height:w,ref:h,viewBox:"0 0 "+k+" "+k,width:w,xmlns:M}),C?s.default.createElement("title",null,C):null,s.default.createElement("path",{d:g,fill:m}),s.default.createElement("path",{d:x,fill:b}))});return d.displayName="QRCodeSvg",d.propTypes=u,sp.default=d,sp}var gk;function TX(){if(gk)return wl;gk=1,Object.defineProperty(wl,"__esModule",{value:!0}),wl.QRCode=void 0;var e=Object.assign||function(w){for(var C=1;C=0||Object.prototype.hasOwnProperty.call(w,j)&&(k[j]=w[j]);return k}var x={bgColor:n.default.oneOfType([n.default.object,n.default.string]),fgColor:n.default.oneOfType([n.default.object,n.default.string]),level:n.default.string,size:n.default.number,value:n.default.string.isRequired},b=(0,u.forwardRef)(function(w,C){var k=w.bgColor,j=k===void 0?"#FFFFFF":k,M=w.fgColor,_=M===void 0?"#000000":M,R=w.level,N=R===void 0?"L":R,O=w.size,D=O===void 0?256:O,z=w.value,Q=g(w,["bgColor","fgColor","level","size","value"]),pe=new l.default(-1,s.default[N]);pe.addData(z),pe.make();var V=pe.modules;return d.default.createElement(h.default,e({},Q,{bgColor:j,bgD:V.map(function(G,W){return G.map(function(ie,re){return ie?"":"M "+re+" "+W+" l 1 0 0 1 -1 0 Z"}).join(" ")}).join(" "),fgColor:_,fgD:V.map(function(G,W){return G.map(function(ie,re){return ie?"M "+re+" "+W+" l 1 0 0 1 -1 0 Z":""}).join(" ")}).join(" "),ref:C,size:D,viewBoxSize:V.length}))});return wl.QRCode=b,b.displayName="QRCode",b.propTypes=x,wl.default=b,wl}var NX=TX();const MX=fd(NX),_X=jh("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7 space-y-1 [&_strong]:text-foreground",{variants:{variant:{default:"border-zinc-500/20 bg-zinc-50/50 dark:border-zinc-500/30 dark:bg-zinc-500/10 text-zinc-900 dark:text-zinc-300 [&>svg]:text-zinc-400 dark:[&>svg]:text-zinc-300",destructive:"border-red-500/20 bg-red-50/50 dark:border-red-500/30 dark:bg-red-500/10 text-red-900 dark:text-red-200 [&>svg]:text-red-600 dark:[&>svg]:text-red-400/80",warning:"border-amber-500/20 bg-amber-50/50 dark:border-amber-500/30 dark:bg-amber-500/10 text-amber-900 dark:text-amber-200 [&>svg]:text-amber-500",info:"border-sky-500/20 bg-sky-50/50 dark:border-sky-500/30 dark:bg-sky-500/10 text-sky-900 dark:text-sky-200 [&>svg]:text-sky-500",success:"border-emerald-500/20 bg-emerald-50/50 dark:border-emerald-500/30 dark:bg-emerald-500/10 text-emerald-900 dark:text-emerald-200 [&>svg]:text-emerald-600 dark:[&>svg]:text-emerald-400/80"}},defaultVariants:{variant:"default"}}),rI=y.forwardRef(({className:e,variant:t,...n},r)=>i.jsx("div",{ref:r,role:"alert",className:Ie(_X({variant:t}),e),...n}));rI.displayName="Alert";const sI=y.forwardRef(({className:e,...t},n)=>i.jsx("h5",{ref:n,className:Ie("font-medium leading-none tracking-tight",e),...t}));sI.displayName="AlertTitle";const RX=y.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:Ie("text-sm [&_p]:leading-relaxed",e),...t}));RX.displayName="AlertDescription";const On=({size:e=45,className:t,...n})=>i.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"},children:i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,...n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:Ie("animate-spin",t),children:i.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})});function PX(){const{t:e,i18n:t}=Ve(),n=new Intl.NumberFormat(t.language),[r,s]=y.useState(null),[o,l]=y.useState(""),u=dr(jn.TOKEN),{theme:d}=tc(),{connect:f,logout:h,restart:m}=Hh(),{instance:g,reloadInstance:x}=ct();y.useEffect(()=>{g&&(localStorage.setItem(jn.INSTANCE_ID,g.id),localStorage.setItem(jn.INSTANCE_NAME,g.name),localStorage.setItem(jn.INSTANCE_TOKEN,g.token))},[g]);const b=async()=>{await x()},w=async R=>{try{await m(R),await x()}catch(N){console.error("Error:",N)}},C=async R=>{try{await h(R),await x()}catch(N){console.error("Error:",N)}},k=async(R,N)=>{try{if(s(null),!u){console.error("Token not found.");return}if(N){const O=await f({instanceName:R,token:u,number:g?.number});l(O.pairingCode)}else{const O=await f({instanceName:R,token:u});s(O.code)}}catch(O){console.error("Error:",O)}},j=async()=>{s(null),l(""),await x()},M=y.useMemo(()=>g?{contacts:g._count?.Contact||0,chats:g._count?.Chat||0,messages:g._count?.Message||0}:{contacts:0,chats:0,messages:0},[g]),_=y.useMemo(()=>d==="dark"?"#fff":d==="light"?"#000":"#189d68",[d]);return g?i.jsxs("main",{className:"flex flex-col gap-8",children:[i.jsx("section",{children:i.jsxs(So,{children:[i.jsx(Co,{children:i.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[i.jsx("h2",{className:"break-all text-lg font-semibold",children:g.name}),i.jsx(l_,{status:g.connectionStatus})]})}),i.jsxs(Eo,{className:"flex flex-col items-start space-y-6",children:[i.jsx("div",{className:"flex w-full flex-1",children:i.jsx(c_,{token:g.token})}),g.profileName&&i.jsxs("div",{className:"flex flex-1 gap-2",children:[i.jsx(Ei,{children:i.jsx(ki,{src:g.profilePicUrl,alt:""})}),i.jsxs("div",{className:"space-y-1",children:[i.jsx("strong",{children:g.profileName}),i.jsx("p",{className:"break-all text-sm text-muted-foreground",children:g.ownerJid})]})]}),g.connectionStatus!=="open"&&i.jsxs(rI,{variant:"warning",className:"flex flex-wrap items-center justify-between gap-3",children:[i.jsx(sI,{className:"text-lg font-bold tracking-wide",children:e("instance.dashboard.alert")}),i.jsxs(Pt,{children:[i.jsx(Bt,{onClick:()=>k(g.name,!1),asChild:!0,children:i.jsx(se,{variant:"warning",children:e("instance.dashboard.button.qrcode.label")})}),i.jsxs(Nt,{onCloseAutoFocus:j,children:[i.jsx(Mt,{children:e("instance.dashboard.button.qrcode.title")}),i.jsx("div",{className:"flex items-center justify-center",children:r&&i.jsx(MX,{value:r,size:256,bgColor:"transparent",fgColor:_,className:"rounded-sm"})})]})]}),g.number&&i.jsxs(Pt,{children:[i.jsx(Bt,{className:"connect-code-button",onClick:()=>k(g.name,!0),children:e("instance.dashboard.button.pairingCode.label")}),i.jsx(Nt,{onCloseAutoFocus:j,children:i.jsx(Mt,{children:i.jsx(eo,{children:o?i.jsxs("div",{className:"py-3",children:[i.jsx("p",{className:"text-center",children:i.jsx("strong",{children:e("instance.dashboard.button.pairingCode.title")})}),i.jsxs("p",{className:"pairing-code text-center",children:[o.substring(0,4),"-",o.substring(4,8)]})]}):i.jsx(On,{})})})})]})]})]}),i.jsxs(Vh,{className:"flex flex-wrap items-center justify-end gap-3",children:[i.jsx(se,{variant:"outline",className:"refresh-button",size:"icon",onClick:b,children:i.jsx(Ip,{size:"20"})}),i.jsx(se,{className:"action-button",variant:"secondary",onClick:()=>w(g.name),children:e("instance.dashboard.button.restart").toUpperCase()}),i.jsx(se,{variant:"destructive",onClick:()=>C(g.name),disabled:g.connectionStatus==="close",children:e("instance.dashboard.button.disconnect").toUpperCase()})]})]})}),i.jsxs("section",{className:"grid grid-cols-[repeat(auto-fit,_minmax(15rem,_1fr))] gap-6",children:[i.jsxs(So,{className:"instance-card",children:[i.jsx(Co,{children:i.jsxs(gi,{className:"flex items-center gap-2",children:[i.jsx(pT,{size:"20"}),e("instance.dashboard.contacts")]})}),i.jsx(Eo,{children:n.format(M.contacts)})]}),i.jsxs(So,{className:"instance-card",children:[i.jsx(Co,{children:i.jsxs(gi,{className:"flex items-center gap-2",children:[i.jsx(jB,{size:"20"}),e("instance.dashboard.chats")]})}),i.jsx(Eo,{children:n.format(M.chats)})]}),i.jsxs(So,{className:"instance-card",children:[i.jsx(Co,{children:i.jsxs(gi,{className:"flex items-center gap-2",children:[i.jsx(Bl,{size:"20"}),e("instance.dashboard.messages")]})}),i.jsx(Eo,{children:n.format(M.messages)})]})]})]}):i.jsx(On,{})}var OX="Separator",mk="horizontal",IX=["horizontal","vertical"],oI=y.forwardRef((e,t)=>{const{decorative:n,orientation:r=mk,...s}=e,o=AX(r)?r:mk,u=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return i.jsx(rt.div,{"data-orientation":o,...u,...s,ref:t})});oI.displayName=OX;function AX(e){return IX.includes(e)}var aI=oI;const $t=y.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},s)=>i.jsx(aI,{ref:s,decorative:n,orientation:t,className:Ie("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));$t.displayName=aI.displayName;const DX=e=>["dify","fetchDify",JSON.stringify(e)],FX=async({instanceName:e,token:t})=>(await Ee.get(`/dify/find/${e}`,{headers:{apikey:t}})).data,iI=e=>{const{instanceName:t,token:n,...r}=e;return mt({...r,queryKey:DX({instanceName:t,token:n}),queryFn:()=>FX({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},LX=async({instanceName:e,token:t,data:n})=>(await Ee.post(`/dify/create/${e}`,n,{headers:{apikey:t}})).data,$X=async({instanceName:e,difyId:t,data:n})=>(await Ee.put(`/dify/update/${t}/${e}`,n)).data,BX=async({instanceName:e,difyId:t})=>(await Ee.delete(`/dify/delete/${t}/${e}`)).data,zX=async({instanceName:e,token:t,data:n})=>(await Ee.post(`/dify/settings/${e}`,n,{headers:{apikey:t}})).data,UX=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await Ee.post(`/dify/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function vg(){const e=nt(zX,{invalidateKeys:[["dify","fetchDefaultSettings"]]}),t=nt(UX,{invalidateKeys:[["dify","getDify"],["dify","fetchSessions"]]}),n=nt(BX,{invalidateKeys:[["dify","getDify"],["dify","fetchDify"],["dify","fetchSessions"]]}),r=nt($X,{invalidateKeys:[["dify","getDify"],["dify","fetchDify"],["dify","fetchSessions"]]}),s=nt(LX,{invalidateKeys:[["dify","fetchDify"]]});return{setDefaultSettingsDify:e,changeStatusDify:t,deleteDify:n,updateDify:r,createDify:s}}const VX=e=>["dify","fetchDefaultSettings",JSON.stringify(e)],HX=async({instanceName:e,token:t})=>(await Ee.get(`/dify/fetchSettings/${e}`,{headers:{apikey:t}})).data,qX=e=>{const{instanceName:t,token:n,...r}=e;return mt({...r,queryKey:VX({instanceName:t,token:n}),queryFn:()=>HX({instanceName:t,token:n}),enabled:!!t})},KX=P.object({expire:P.string(),keywordFinish:P.string(),delayMessage:P.string(),unknownMessage:P.string(),listeningFromMe:P.boolean(),stopBotFromMe:P.boolean(),keepOpen:P.boolean(),debounceTime:P.string(),ignoreJids:P.array(P.string()).default([]),difyIdFallback:P.union([P.null(),P.string()]).optional(),splitMessages:P.boolean(),timePerChar:P.string()});function WX(){const{t:e}=Ve(),{instance:t}=ct(),{setDefaultSettingsDify:n}=vg(),[r,s]=y.useState(!1),{data:o,refetch:l}=iI({instanceName:t?.name,token:t?.token,enabled:r}),{data:u,refetch:d}=qX({instanceName:t?.name,token:t?.token}),f=on({resolver:an(KX),defaultValues:{expire:"0",keywordFinish:e("dify.form.examples.keywordFinish"),delayMessage:"1000",unknownMessage:e("dify.form.examples.unknownMessage"),listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:"0",ignoreJids:[],difyIdFallback:void 0,splitMessages:!1,timePerChar:"0"}});y.useEffect(()=>{u&&f.reset({expire:u?.expire?u.expire.toString():"0",keywordFinish:u.keywordFinish,delayMessage:u.delayMessage?u.delayMessage.toString():"0",unknownMessage:u.unknownMessage,listeningFromMe:u.listeningFromMe,stopBotFromMe:u.stopBotFromMe,keepOpen:u.keepOpen,debounceTime:u.debounceTime?u.debounceTime.toString():"0",ignoreJids:u.ignoreJids,difyIdFallback:u.difyIdFallback,splitMessages:u.splitMessages,timePerChar:u.timePerChar?u.timePerChar.toString():"0"})},[u]);const h=async g=>{try{if(!t||!t.name)throw new Error("instance not found.");const x={expire:parseInt(g.expire),keywordFinish:g.keywordFinish,delayMessage:parseInt(g.delayMessage),unknownMessage:g.unknownMessage,listeningFromMe:g.listeningFromMe,stopBotFromMe:g.stopBotFromMe,keepOpen:g.keepOpen,debounceTime:parseInt(g.debounceTime),difyIdFallback:g.difyIdFallback||void 0,ignoreJids:g.ignoreJids,splitMessages:g.splitMessages,timePerChar:parseInt(g.timePerChar)};await n({instanceName:t.name,token:t.token,data:x}),me.success(e("dify.toast.defaultSettings.success"))}catch(x){console.error("Error:",x),me.error(`Error: ${x?.response?.data?.response?.message}`)}};function m(){d(),l()}return i.jsxs(Pt,{open:r,onOpenChange:s,children:[i.jsx(Bt,{asChild:!0,children:i.jsxs(se,{variant:"secondary",size:"sm",children:[i.jsx(Oo,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:e("dify.defaultSettings")})]})}),i.jsxs(Nt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:m,children:[i.jsx(Mt,{children:i.jsx(zt,{children:e("dify.defaultSettings")})}),i.jsx(Gn,{...f,children:i.jsxs("form",{className:"w-full space-y-6",onSubmit:f.handleSubmit(h),children:[i.jsx("div",{children:i.jsxs("div",{className:"space-y-4",children:[i.jsx(Jt,{name:"difyIdFallback",label:e("dify.form.difyIdFallback.label"),options:o?.filter(g=>!!g.id).map(g=>({label:g.description,value:g.id}))??[]}),i.jsx(le,{name:"expire",label:e("dify.form.expire.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(le,{name:"keywordFinish",label:e("dify.form.keywordFinish.label"),children:i.jsx(ne,{})}),i.jsx(le,{name:"delayMessage",label:e("dify.form.delayMessage.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(le,{name:"unknownMessage",label:e("dify.form.unknownMessage.label"),children:i.jsx(ne,{})}),i.jsx(Pe,{name:"listeningFromMe",label:e("dify.form.listeningFromMe.label"),reverse:!0}),i.jsx(Pe,{name:"stopBotFromMe",label:e("dify.form.stopBotFromMe.label"),reverse:!0}),i.jsx(Pe,{name:"keepOpen",label:e("dify.form.keepOpen.label"),reverse:!0}),i.jsx(le,{name:"debounceTime",label:e("dify.form.debounceTime.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(Pe,{name:"splitMessages",label:e("dify.form.splitMessages.label"),reverse:!0}),i.jsx(le,{name:"timePerChar",label:e("dify.form.timePerChar.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(Da,{name:"ignoreJids",label:e("dify.form.ignoreJids.label"),placeholder:e("dify.form.ignoreJids.placeholder")})]})}),i.jsx(Yt,{children:i.jsx(se,{type:"submit",children:e("dify.button.save")})})]})})]})]})}/** + * table-core + * + * Copyright (c) TanStack + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function ma(e,t){return typeof e=="function"?e(t):e}function qr(e,t){return n=>{t.setState(r=>({...r,[e]:ma(n,r[e])}))}}function yg(e){return e instanceof Function}function GX(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function lI(e,t){const n=[],r=s=>{s.forEach(o=>{n.push(o);const l=t(o);l!=null&&l.length&&r(l)})};return r(e),n}function ot(e,t,n){let r=[],s;return o=>{let l;n.key&&n.debug&&(l=Date.now());const u=e(o);if(!(u.length!==r.length||u.some((h,m)=>r[m]!==h)))return s;r=u;let f;if(n.key&&n.debug&&(f=Date.now()),s=t(...u),n==null||n.onChange==null||n.onChange(s),n.key&&n.debug&&n!=null&&n.debug()){const h=Math.round((Date.now()-l)*100)/100,m=Math.round((Date.now()-f)*100)/100,g=m/16,x=(b,w)=>{for(b=String(b);b.length{var s;return(s=e?.debugAll)!=null?s:e[t]},key:!1,onChange:r}}function JX(e,t,n,r){const s=()=>{var l;return(l=o.getValue())!=null?l:e.options.renderFallbackValue},o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:s,getContext:ot(()=>[e,n,t,o],(l,u,d,f)=>({table:l,column:u,row:d,cell:f,getValue:f.getValue,renderValue:f.renderValue}),at(e.options,"debugCells"))};return e._features.forEach(l=>{l.createCell==null||l.createCell(o,n,t,e)},{}),o}function QX(e,t,n,r){var s,o;const u={...e._getDefaultColumnDef(),...t},d=u.accessorKey;let f=(s=(o=u.id)!=null?o:d?typeof String.prototype.replaceAll=="function"?d.replaceAll(".","_"):d.replace(/\./g,"_"):void 0)!=null?s:typeof u.header=="string"?u.header:void 0,h;if(u.accessorFn?h=u.accessorFn:d&&(d.includes(".")?h=g=>{let x=g;for(const w of d.split(".")){var b;x=(b=x)==null?void 0:b[w]}return x}:h=g=>g[u.accessorKey]),!f)throw new Error;let m={id:`${String(f)}`,accessorFn:h,parent:r,depth:n,columnDef:u,columns:[],getFlatColumns:ot(()=>[!0],()=>{var g;return[m,...(g=m.columns)==null?void 0:g.flatMap(x=>x.getFlatColumns())]},at(e.options,"debugColumns")),getLeafColumns:ot(()=>[e._getOrderColumnsFn()],g=>{var x;if((x=m.columns)!=null&&x.length){let b=m.columns.flatMap(w=>w.getLeafColumns());return g(b)}return[m]},at(e.options,"debugColumns"))};for(const g of e._features)g.createColumn==null||g.createColumn(m,e);return m}const nr="debugHeaders";function vk(e,t,n){var r;let o={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const l=[],u=d=>{d.subHeaders&&d.subHeaders.length&&d.subHeaders.map(u),l.push(d)};return u(o),l},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(l=>{l.createHeader==null||l.createHeader(o,e)}),o}const ZX={createTable:e=>{e.getHeaderGroups=ot(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,s)=>{var o,l;const u=(o=r?.map(m=>n.find(g=>g.id===m)).filter(Boolean))!=null?o:[],d=(l=s?.map(m=>n.find(g=>g.id===m)).filter(Boolean))!=null?l:[],f=n.filter(m=>!(r!=null&&r.includes(m.id))&&!(s!=null&&s.includes(m.id)));return op(t,[...u,...f,...d],e)},at(e.options,nr)),e.getCenterHeaderGroups=ot(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,s)=>(n=n.filter(o=>!(r!=null&&r.includes(o.id))&&!(s!=null&&s.includes(o.id))),op(t,n,e,"center")),at(e.options,nr)),e.getLeftHeaderGroups=ot(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var s;const o=(s=r?.map(l=>n.find(u=>u.id===l)).filter(Boolean))!=null?s:[];return op(t,o,e,"left")},at(e.options,nr)),e.getRightHeaderGroups=ot(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var s;const o=(s=r?.map(l=>n.find(u=>u.id===l)).filter(Boolean))!=null?s:[];return op(t,o,e,"right")},at(e.options,nr)),e.getFooterGroups=ot(()=>[e.getHeaderGroups()],t=>[...t].reverse(),at(e.options,nr)),e.getLeftFooterGroups=ot(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),at(e.options,nr)),e.getCenterFooterGroups=ot(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),at(e.options,nr)),e.getRightFooterGroups=ot(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),at(e.options,nr)),e.getFlatHeaders=ot(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),at(e.options,nr)),e.getLeftFlatHeaders=ot(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),at(e.options,nr)),e.getCenterFlatHeaders=ot(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),at(e.options,nr)),e.getRightFlatHeaders=ot(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),at(e.options,nr)),e.getCenterLeafHeaders=ot(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),at(e.options,nr)),e.getLeftLeafHeaders=ot(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),at(e.options,nr)),e.getRightLeafHeaders=ot(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),at(e.options,nr)),e.getLeafHeaders=ot(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var s,o,l,u,d,f;return[...(s=(o=t[0])==null?void 0:o.headers)!=null?s:[],...(l=(u=n[0])==null?void 0:u.headers)!=null?l:[],...(d=(f=r[0])==null?void 0:f.headers)!=null?d:[]].map(h=>h.getLeafHeaders()).flat()},at(e.options,nr))}};function op(e,t,n,r){var s,o;let l=0;const u=function(g,x){x===void 0&&(x=1),l=Math.max(l,x),g.filter(b=>b.getIsVisible()).forEach(b=>{var w;(w=b.columns)!=null&&w.length&&u(b.columns,x+1)},0)};u(e);let d=[];const f=(g,x)=>{const b={depth:x,id:[r,`${x}`].filter(Boolean).join("_"),headers:[]},w=[];g.forEach(C=>{const k=[...w].reverse()[0],j=C.column.depth===b.depth;let M,_=!1;if(j&&C.column.parent?M=C.column.parent:(M=C.column,_=!0),k&&k?.column===M)k.subHeaders.push(C);else{const R=vk(n,M,{id:[r,x,M.id,C?.id].filter(Boolean).join("_"),isPlaceholder:_,placeholderId:_?`${w.filter(N=>N.column===M).length}`:void 0,depth:x,index:w.length});R.subHeaders.push(C),w.push(R)}b.headers.push(C),C.headerGroup=b}),d.push(b),x>0&&f(w,x-1)},h=t.map((g,x)=>vk(n,g,{depth:l,index:x}));f(h,l-1),d.reverse();const m=g=>g.filter(b=>b.column.getIsVisible()).map(b=>{let w=0,C=0,k=[0];b.subHeaders&&b.subHeaders.length?(k=[],m(b.subHeaders).forEach(M=>{let{colSpan:_,rowSpan:R}=M;w+=_,k.push(R)})):w=1;const j=Math.min(...k);return C=C+j,b.colSpan=w,b.rowSpan=C,{colSpan:w,rowSpan:C}});return m((s=(o=d[0])==null?void 0:o.headers)!=null?s:[]),d}const bg=(e,t,n,r,s,o,l)=>{let u={id:t,index:r,original:n,depth:s,parentId:l,_valuesCache:{},_uniqueValuesCache:{},getValue:d=>{if(u._valuesCache.hasOwnProperty(d))return u._valuesCache[d];const f=e.getColumn(d);if(f!=null&&f.accessorFn)return u._valuesCache[d]=f.accessorFn(u.original,r),u._valuesCache[d]},getUniqueValues:d=>{if(u._uniqueValuesCache.hasOwnProperty(d))return u._uniqueValuesCache[d];const f=e.getColumn(d);if(f!=null&&f.accessorFn)return f.columnDef.getUniqueValues?(u._uniqueValuesCache[d]=f.columnDef.getUniqueValues(u.original,r),u._uniqueValuesCache[d]):(u._uniqueValuesCache[d]=[u.getValue(d)],u._uniqueValuesCache[d])},renderValue:d=>{var f;return(f=u.getValue(d))!=null?f:e.options.renderFallbackValue},subRows:o??[],getLeafRows:()=>lI(u.subRows,d=>d.subRows),getParentRow:()=>u.parentId?e.getRow(u.parentId,!0):void 0,getParentRows:()=>{let d=[],f=u;for(;;){const h=f.getParentRow();if(!h)break;d.push(h),f=h}return d.reverse()},getAllCells:ot(()=>[e.getAllLeafColumns()],d=>d.map(f=>JX(e,u,f,f.id)),at(e.options,"debugRows")),_getAllCellsByColumnId:ot(()=>[u.getAllCells()],d=>d.reduce((f,h)=>(f[h.column.id]=h,f),{}),at(e.options,"debugRows"))};for(let d=0;d{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},cI=(e,t,n)=>{var r;const s=n.toLowerCase();return!!(!((r=e.getValue(t))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(s))};cI.autoRemove=e=>Ts(e);const uI=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};uI.autoRemove=e=>Ts(e);const dI=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};dI.autoRemove=e=>Ts(e);const fI=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};fI.autoRemove=e=>Ts(e)||!(e!=null&&e.length);const pI=(e,t,n)=>!n.some(r=>{var s;return!((s=e.getValue(t))!=null&&s.includes(r))});pI.autoRemove=e=>Ts(e)||!(e!=null&&e.length);const hI=(e,t,n)=>n.some(r=>{var s;return(s=e.getValue(t))==null?void 0:s.includes(r)});hI.autoRemove=e=>Ts(e)||!(e!=null&&e.length);const gI=(e,t,n)=>e.getValue(t)===n;gI.autoRemove=e=>Ts(e);const mI=(e,t,n)=>e.getValue(t)==n;mI.autoRemove=e=>Ts(e);const aw=(e,t,n)=>{let[r,s]=n;const o=e.getValue(t);return o>=r&&o<=s};aw.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,s=typeof n!="number"?parseFloat(n):n,o=t===null||Number.isNaN(r)?-1/0:r,l=n===null||Number.isNaN(s)?1/0:s;if(o>l){const u=o;o=l,l=u}return[o,l]};aw.autoRemove=e=>Ts(e)||Ts(e[0])&&Ts(e[1]);const yo={includesString:cI,includesStringSensitive:uI,equalsString:dI,arrIncludes:fI,arrIncludesAll:pI,arrIncludesSome:hI,equals:gI,weakEquals:mI,inNumberRange:aw};function Ts(e){return e==null||e===""}const XX={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:qr("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);return typeof r=="string"?yo.includesString:typeof r=="number"?yo.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?yo.equals:Array.isArray(r)?yo.arrIncludes:yo.weakEquals},e.getFilterFn=()=>{var n,r;return yg(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:yo[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,s;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(s=>s.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const s=e.getFilterFn(),o=r?.find(h=>h.id===e.id),l=ma(n,o?o.value:void 0);if(yk(s,l,e)){var u;return(u=r?.filter(h=>h.id!==e.id))!=null?u:[]}const d={id:e.id,value:l};if(o){var f;return(f=r?.map(h=>h.id===e.id?d:h))!=null?f:[]}return r!=null&&r.length?[...r,d]:[d]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=s=>{var o;return(o=ma(t,s))==null?void 0:o.filter(l=>{const u=n.find(d=>d.id===l.id);if(u){const d=u.getFilterFn();if(yk(d,l.value,u))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function yk(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const eee=(e,t,n)=>n.reduce((r,s)=>{const o=s.getValue(e);return r+(typeof o=="number"?o:0)},0),tee=(e,t,n)=>{let r;return n.forEach(s=>{const o=s.getValue(e);o!=null&&(r>o||r===void 0&&o>=o)&&(r=o)}),r},nee=(e,t,n)=>{let r;return n.forEach(s=>{const o=s.getValue(e);o!=null&&(r=o)&&(r=o)}),r},ree=(e,t,n)=>{let r,s;return n.forEach(o=>{const l=o.getValue(e);l!=null&&(r===void 0?l>=l&&(r=s=l):(r>l&&(r=l),s{let n=0,r=0;if(t.forEach(s=>{let o=s.getValue(e);o!=null&&(o=+o)>=o&&(++n,r+=o)}),n)return r/n},oee=(e,t)=>{if(!t.length)return;const n=t.map(o=>o.getValue(e));if(!GX(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),s=n.sort((o,l)=>o-l);return n.length%2!==0?s[r]:(s[r-1]+s[r])/2},aee=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),iee=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,lee=(e,t)=>t.length,dy={sum:eee,min:tee,max:nee,extent:ree,mean:see,median:oee,unique:aee,uniqueCount:iee,count:lee},cee={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:qr("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);if(typeof r=="number")return dy.sum;if(Object.prototype.toString.call(r)==="[object Date]")return dy.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return yg(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:dy[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var s;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((s=n.subRows)!=null&&s.length)}}};function uee(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(o=>!t.includes(o.id));return n==="remove"?r:[...t.map(o=>e.find(l=>l.id===o)).filter(Boolean),...r]}const dee={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:qr("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=ot(n=>[Ru(t,n)],n=>n.findIndex(r=>r.id===e.id),at(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=Ru(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const s=Ru(t,n);return((r=s[s.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=ot(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>s=>{let o=[];if(!(t!=null&&t.length))o=s;else{const l=[...t],u=[...s];for(;u.length&&l.length;){const d=l.shift(),f=u.findIndex(h=>h.id===d);f>-1&&o.push(u.splice(f,1)[0])}o=[...o,...u]}return uee(o,n,r)},at(e.options,"debugTable"))}},fy=()=>({left:[],right:[]}),fee={getInitialState:e=>({columnPinning:fy(),...e}),getDefaultOptions:e=>({onColumnPinningChange:qr("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(s=>s.id).filter(Boolean);t.setColumnPinning(s=>{var o,l;if(n==="right"){var u,d;return{left:((u=s?.left)!=null?u:[]).filter(m=>!(r!=null&&r.includes(m))),right:[...((d=s?.right)!=null?d:[]).filter(m=>!(r!=null&&r.includes(m))),...r]}}if(n==="left"){var f,h;return{left:[...((f=s?.left)!=null?f:[]).filter(m=>!(r!=null&&r.includes(m))),...r],right:((h=s?.right)!=null?h:[]).filter(m=>!(r!=null&&r.includes(m)))}}return{left:((o=s?.left)!=null?o:[]).filter(m=>!(r!=null&&r.includes(m))),right:((l=s?.right)!=null?l:[]).filter(m=>!(r!=null&&r.includes(m)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var s,o,l;return((s=r.columnDef.enablePinning)!=null?s:!0)&&((o=(l=t.options.enableColumnPinning)!=null?l:t.options.enablePinning)!=null?o:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(u=>u.id),{left:r,right:s}=t.getState().columnPinning,o=n.some(u=>r?.includes(u)),l=n.some(u=>s?.includes(u));return o?"left":l?"right":!1},e.getPinnedIndex=()=>{var n,r;const s=e.getIsPinned();return s?(n=(r=t.getState().columnPinning)==null||(r=r[s])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=ot(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,s)=>{const o=[...r??[],...s??[]];return n.filter(l=>!o.includes(l.column.id))},at(t.options,"debugRows")),e.getLeftVisibleCells=ot(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(o=>n.find(l=>l.column.id===o)).filter(Boolean).map(o=>({...o,position:"left"})),at(t.options,"debugRows")),e.getRightVisibleCells=ot(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(o=>n.find(l=>l.column.id===o)).filter(Boolean).map(o=>({...o,position:"right"})),at(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?fy():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:fy())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var s,o;return!!((s=r.left)!=null&&s.length||(o=r.right)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=ot(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),at(e.options,"debugColumns")),e.getRightLeafColumns=ot(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),at(e.options,"debugColumns")),e.getCenterLeafColumns=ot(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const s=[...n??[],...r??[]];return t.filter(o=>!s.includes(o.id))},at(e.options,"debugColumns"))}},ap={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},py=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),pee={getDefaultColumnDef:()=>ap,getInitialState:e=>({columnSizing:{},columnSizingInfo:py(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:qr("columnSizing",e),onColumnSizingInfoChange:qr("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,s;const o=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:ap.minSize,(r=o??e.columnDef.size)!=null?r:ap.size),(s=e.columnDef.maxSize)!=null?s:ap.maxSize)},e.getStart=ot(n=>[n,Ru(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((s,o)=>s+o.getSize(),0),at(t.options,"debugColumns")),e.getAfter=ot(n=>[n,Ru(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((s,o)=>s+o.getSize(),0),at(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...s}=n;return s})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=s=>{if(s.subHeaders.length)s.subHeaders.forEach(r);else{var o;n+=(o=s.column.getSize())!=null?o:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),s=r?.getCanResize();return o=>{if(!r||!s||(o.persist==null||o.persist(),hy(o)&&o.touches&&o.touches.length>1))return;const l=e.getSize(),u=e?e.getLeafHeaders().map(k=>[k.column.id,k.column.getSize()]):[[r.id,r.getSize()]],d=hy(o)?Math.round(o.touches[0].clientX):o.clientX,f={},h=(k,j)=>{typeof j=="number"&&(t.setColumnSizingInfo(M=>{var _,R;const N=t.options.columnResizeDirection==="rtl"?-1:1,O=(j-((_=M?.startOffset)!=null?_:0))*N,D=Math.max(O/((R=M?.startSize)!=null?R:0),-.999999);return M.columnSizingStart.forEach(z=>{let[Q,pe]=z;f[Q]=Math.round(Math.max(pe+pe*D,0)*100)/100}),{...M,deltaOffset:O,deltaPercentage:D}}),(t.options.columnResizeMode==="onChange"||k==="end")&&t.setColumnSizing(M=>({...M,...f})))},m=k=>h("move",k),g=k=>{h("end",k),t.setColumnSizingInfo(j=>({...j,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},x=n||typeof document<"u"?document:null,b={moveHandler:k=>m(k.clientX),upHandler:k=>{x?.removeEventListener("mousemove",b.moveHandler),x?.removeEventListener("mouseup",b.upHandler),g(k.clientX)}},w={moveHandler:k=>(k.cancelable&&(k.preventDefault(),k.stopPropagation()),m(k.touches[0].clientX),!1),upHandler:k=>{var j;x?.removeEventListener("touchmove",w.moveHandler),x?.removeEventListener("touchend",w.upHandler),k.cancelable&&(k.preventDefault(),k.stopPropagation()),g((j=k.touches[0])==null?void 0:j.clientX)}},C=hee()?{passive:!1}:!1;hy(o)?(x?.addEventListener("touchmove",w.moveHandler,C),x?.addEventListener("touchend",w.upHandler,C)):(x?.addEventListener("mousemove",b.moveHandler,C),x?.addEventListener("mouseup",b.upHandler,C)),t.setColumnSizingInfo(k=>({...k,startOffset:d,startSize:l,deltaOffset:0,deltaPercentage:0,columnSizingStart:u,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?py():(n=e.initialState.columnSizingInfo)!=null?n:py())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0}}};let ip=null;function hee(){if(typeof ip=="boolean")return ip;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return ip=e,ip}function hy(e){return e.type==="touchstart"}const gee={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:qr("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const s=e.columns;return(n=s.length?s.some(o=>o.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=ot(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),at(t.options,"debugRows")),e.getVisibleCells=ot(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,s)=>[...n,...r,...s],at(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>ot(()=>[r(),r().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(o=>o.getIsVisible==null?void 0:o.getIsVisible()),at(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((s,o)=>({...s,[o.id]:n||!(o.getCanHide!=null&&o.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function Ru(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const mee={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},vee={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:qr("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,s,o;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&((o=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?o:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>yo.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return yg(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:yo[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},yee={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:qr("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,s;if(!t){e._queue(()=>{t=!0});return}if((r=(s=e.options.autoResetAll)!=null?s:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var s,o;e.setExpanded(r?{}:(s=(o=e.initialState)==null?void 0:o.expanded)!=null?s:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(s=>!s.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(o=>{const l=o.split(".");r=Math.max(r,l.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var s;const o=r===!0?!0:!!(r!=null&&r[e.id]);let l={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(u=>{l[u]=!0}):l=r,n=(s=n)!=null?s:!o,!o&&n)return{...l,[e.id]:!0};if(o&&!n){const{[e.id]:u,...d}=l;return d}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r?.[e.id])},e.getCanExpand=()=>{var n,r,s;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((s=e.subRows)!=null&&s.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},Eb=0,kb=10,gy=()=>({pageIndex:Eb,pageSize:kb}),bee={getInitialState:e=>({...e,pagination:{...gy(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:qr("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,s;if(!t){e._queue(()=>{t=!0});return}if((r=(s=e.options.autoResetAll)!=null?s:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const s=o=>ma(r,o);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(s)},e.resetPagination=r=>{var s;e.setPagination(r?gy():(s=e.initialState.pagination)!=null?s:gy())},e.setPageIndex=r=>{e.setPagination(s=>{let o=ma(r,s.pageIndex);const l=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,l)),{...s,pageIndex:o}})},e.resetPageIndex=r=>{var s,o;e.setPageIndex(r?Eb:(s=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageIndex)!=null?s:Eb)},e.resetPageSize=r=>{var s,o;e.setPageSize(r?kb:(s=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageSize)!=null?s:kb)},e.setPageSize=r=>{e.setPagination(s=>{const o=Math.max(1,ma(r,s.pageSize)),l=s.pageSize*s.pageIndex,u=Math.floor(l/o);return{...s,pageIndex:u,pageSize:o}})},e.setPageCount=r=>e.setPagination(s=>{var o;let l=ma(r,(o=e.options.pageCount)!=null?o:-1);return typeof l=="number"&&(l=Math.max(-1,l)),{...s,pageCount:l}}),e.getPageOptions=ot(()=>[e.getPageCount()],r=>{let s=[];return r&&r>0&&(s=[...new Array(r)].fill(null).map((o,l)=>l)),s},at(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,s=e.getPageCount();return s===-1?!0:s===0?!1:re.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},my=()=>({top:[],bottom:[]}),xee={getInitialState:e=>({rowPinning:my(),...e}),getDefaultOptions:e=>({onRowPinningChange:qr("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,s)=>{const o=r?e.getLeafRows().map(d=>{let{id:f}=d;return f}):[],l=s?e.getParentRows().map(d=>{let{id:f}=d;return f}):[],u=new Set([...l,e.id,...o]);t.setRowPinning(d=>{var f,h;if(n==="bottom"){var m,g;return{top:((m=d?.top)!=null?m:[]).filter(w=>!(u!=null&&u.has(w))),bottom:[...((g=d?.bottom)!=null?g:[]).filter(w=>!(u!=null&&u.has(w))),...Array.from(u)]}}if(n==="top"){var x,b;return{top:[...((x=d?.top)!=null?x:[]).filter(w=>!(u!=null&&u.has(w))),...Array.from(u)],bottom:((b=d?.bottom)!=null?b:[]).filter(w=>!(u!=null&&u.has(w)))}}return{top:((f=d?.top)!=null?f:[]).filter(w=>!(u!=null&&u.has(w))),bottom:((h=d?.bottom)!=null?h:[]).filter(w=>!(u!=null&&u.has(w)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:s}=t.options;return typeof r=="function"?r(e):(n=r??s)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:s}=t.getState().rowPinning,o=n.some(u=>r?.includes(u)),l=n.some(u=>s?.includes(u));return o?"top":l?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const s=e.getIsPinned();if(!s)return-1;const o=(n=s==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(l=>{let{id:u}=l;return u});return(r=o?.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?my():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:my())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var s,o;return!!((s=r.top)!=null&&s.length||(o=r.bottom)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var s;return((s=e.options.keepPinnedRows)==null||s?(n??[]).map(l=>{const u=e.getRow(l,!0);return u.getIsAllParentsExpanded()?u:null}):(n??[]).map(l=>t.find(u=>u.id===l))).filter(Boolean).map(l=>({...l,position:r}))},e.getTopRows=ot(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),at(e.options,"debugRows")),e.getBottomRows=ot(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),at(e.options,"debugRows")),e.getCenterRows=ot(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const s=new Set([...n??[],...r??[]]);return t.filter(o=>!s.has(o.id))},at(e.options,"debugRows"))}},wee={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:qr("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},s=e.getPreGroupedRowModel().flatRows;return t?s.forEach(o=>{o.getCanSelect()&&(r[o.id]=!0)}):s.forEach(o=>{delete r[o.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),s={...n};return e.getRowModel().rows.forEach(o=>{jb(s,o.id,r,!0,e)}),s}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=ot(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?vy(e,n):{rows:[],flatRows:[],rowsById:{}},at(e.options,"debugTable")),e.getFilteredSelectedRowModel=ot(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?vy(e,n):{rows:[],flatRows:[],rowsById:{}},at(e.options,"debugTable")),e.getGroupedSelectedRowModel=ot(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?vy(e,n):{rows:[],flatRows:[],rowsById:{}},at(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(s=>s.getCanSelect()&&!n[s.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(s=>s.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(s=>!n[s.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const s=e.getIsSelected();t.setRowSelection(o=>{var l;if(n=typeof n<"u"?n:!s,e.getCanSelect()&&s===n)return o;const u={...o};return jb(u,e.id,n,(l=r?.selectChildren)!=null?l:!0,t),u})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return iw(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Tb(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Tb(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var s;n&&e.toggleSelected((s=r.target)==null?void 0:s.checked)}}}},jb=(e,t,n,r,s)=>{var o;const l=s.getRow(t,!0);n?(l.getCanMultiSelect()||Object.keys(e).forEach(u=>delete e[u]),l.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(o=l.subRows)!=null&&o.length&&l.getCanSelectSubRows()&&l.subRows.forEach(u=>jb(e,u.id,n,r,s))};function vy(e,t){const n=e.getState().rowSelection,r=[],s={},o=function(l,u){return l.map(d=>{var f;const h=iw(d,n);if(h&&(r.push(d),s[d.id]=d),(f=d.subRows)!=null&&f.length&&(d={...d,subRows:o(d.subRows)}),h)return d}).filter(Boolean)};return{rows:o(t.rows),flatRows:r,rowsById:s}}function iw(e,t){var n;return(n=t[e.id])!=null?n:!1}function Tb(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let s=!0,o=!1;return e.subRows.forEach(l=>{if(!(o&&!s)&&(l.getCanSelect()&&(iw(l,t)?o=!0:s=!1),l.subRows&&l.subRows.length)){const u=Tb(l,t);u==="all"?o=!0:(u==="some"&&(o=!0),s=!1)}}),s?"all":o?"some":!1}const Nb=/([0-9]+)/gm,See=(e,t,n)=>vI(Na(e.getValue(n)).toLowerCase(),Na(t.getValue(n)).toLowerCase()),Cee=(e,t,n)=>vI(Na(e.getValue(n)),Na(t.getValue(n))),Eee=(e,t,n)=>lw(Na(e.getValue(n)).toLowerCase(),Na(t.getValue(n)).toLowerCase()),kee=(e,t,n)=>lw(Na(e.getValue(n)),Na(t.getValue(n))),jee=(e,t,n)=>{const r=e.getValue(n),s=t.getValue(n);return r>s?1:rlw(e.getValue(n),t.getValue(n));function lw(e,t){return e===t?0:e>t?1:-1}function Na(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function vI(e,t){const n=e.split(Nb).filter(Boolean),r=t.split(Nb).filter(Boolean);for(;n.length&&r.length;){const s=n.shift(),o=r.shift(),l=parseInt(s,10),u=parseInt(o,10),d=[l,u].sort();if(isNaN(d[0])){if(s>o)return 1;if(o>s)return-1;continue}if(isNaN(d[1]))return isNaN(l)?-1:1;if(l>u)return 1;if(u>l)return-1}return n.length-r.length}const pu={alphanumeric:See,alphanumericCaseSensitive:Cee,text:Eee,textCaseSensitive:kee,datetime:jee,basic:Tee},Nee={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:qr("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const s of n){const o=s?.getValue(e.id);if(Object.prototype.toString.call(o)==="[object Date]")return pu.datetime;if(typeof o=="string"&&(r=!0,o.split(Nb).length>1))return pu.alphanumeric}return r?pu.text:pu.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof n?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return yg(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:pu[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const s=e.getNextSortingOrder(),o=typeof n<"u"&&n!==null;t.setSorting(l=>{const u=l?.find(x=>x.id===e.id),d=l?.findIndex(x=>x.id===e.id);let f=[],h,m=o?n:s==="desc";if(l!=null&&l.length&&e.getCanMultiSort()&&r?u?h="toggle":h="add":l!=null&&l.length&&d!==l.length-1?h="replace":u?h="toggle":h="replace",h==="toggle"&&(o||s||(h="remove")),h==="add"){var g;f=[...l,{id:e.id,desc:m}],f.splice(0,f.length-((g=t.options.maxMultiSortColCount)!=null?g:Number.MAX_SAFE_INTEGER))}else h==="toggle"?f=l.map(x=>x.id===e.id?{...x,desc:m}:x):h==="remove"?f=l.filter(x=>x.id!==e.id):f=[{id:e.id,desc:m}];return f})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,s;const o=e.getFirstSortDir(),l=e.getIsSorted();return l?l!==o&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(s=t.options.enableMultiRemove)!=null)||s)?!1:l==="desc"?"asc":"desc":o},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(s=>s.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(s=>s.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},Mee=[ZX,gee,dee,fee,YX,XX,mee,vee,Nee,cee,yee,bee,xee,wee,pee];function _ee(e){var t,n;const r=[...Mee,...(t=e._features)!=null?t:[]];let s={_features:r};const o=s._features.reduce((g,x)=>Object.assign(g,x.getDefaultOptions==null?void 0:x.getDefaultOptions(s)),{}),l=g=>s.options.mergeOptions?s.options.mergeOptions(o,g):{...o,...g};let d={...{},...(n=e.initialState)!=null?n:{}};s._features.forEach(g=>{var x;d=(x=g.getInitialState==null?void 0:g.getInitialState(d))!=null?x:d});const f=[];let h=!1;const m={_features:r,options:{...o,...e},initialState:d,_queue:g=>{f.push(g),h||(h=!0,Promise.resolve().then(()=>{for(;f.length;)f.shift()();h=!1}).catch(x=>setTimeout(()=>{throw x})))},reset:()=>{s.setState(s.initialState)},setOptions:g=>{const x=ma(g,s.options);s.options=l(x)},getState:()=>s.options.state,setState:g=>{s.options.onStateChange==null||s.options.onStateChange(g)},_getRowId:(g,x,b)=>{var w;return(w=s.options.getRowId==null?void 0:s.options.getRowId(g,x,b))!=null?w:`${b?[b.id,x].join("."):x}`},getCoreRowModel:()=>(s._getCoreRowModel||(s._getCoreRowModel=s.options.getCoreRowModel(s)),s._getCoreRowModel()),getRowModel:()=>s.getPaginationRowModel(),getRow:(g,x)=>{let b=(x?s.getPrePaginationRowModel():s.getRowModel()).rowsById[g];if(!b&&(b=s.getCoreRowModel().rowsById[g],!b))throw new Error;return b},_getDefaultColumnDef:ot(()=>[s.options.defaultColumn],g=>{var x;return g=(x=g)!=null?x:{},{header:b=>{const w=b.header.column.columnDef;return w.accessorKey?w.accessorKey:w.accessorFn?w.id:null},cell:b=>{var w,C;return(w=(C=b.renderValue())==null||C.toString==null?void 0:C.toString())!=null?w:null},...s._features.reduce((b,w)=>Object.assign(b,w.getDefaultColumnDef==null?void 0:w.getDefaultColumnDef()),{}),...g}},at(e,"debugColumns")),_getColumnDefs:()=>s.options.columns,getAllColumns:ot(()=>[s._getColumnDefs()],g=>{const x=function(b,w,C){return C===void 0&&(C=0),b.map(k=>{const j=QX(s,k,C,w),M=k;return j.columns=M.columns?x(M.columns,j,C+1):[],j})};return x(g)},at(e,"debugColumns")),getAllFlatColumns:ot(()=>[s.getAllColumns()],g=>g.flatMap(x=>x.getFlatColumns()),at(e,"debugColumns")),_getAllFlatColumnsById:ot(()=>[s.getAllFlatColumns()],g=>g.reduce((x,b)=>(x[b.id]=b,x),{}),at(e,"debugColumns")),getAllLeafColumns:ot(()=>[s.getAllColumns(),s._getOrderColumnsFn()],(g,x)=>{let b=g.flatMap(w=>w.getLeafColumns());return x(b)},at(e,"debugColumns")),getColumn:g=>s._getAllFlatColumnsById()[g]};Object.assign(s,m);for(let g=0;got(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(s,o,l){o===void 0&&(o=0);const u=[];for(let f=0;fe._autoResetPageIndex()))}function Pee(e,t,n){return n.options.filterFromLeafRows?Oee(e,t,n):Iee(e,t,n)}function Oee(e,t,n){var r;const s=[],o={},l=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,u=function(d,f){f===void 0&&(f=0);const h=[];for(let g=0;got(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let g=0;g{var x;const b=e.getColumn(g.id);if(!b)return;const w=b.getFilterFn();w&&s.push({id:g.id,filterFn:w,resolvedValue:(x=w.resolveFilterValue==null?void 0:w.resolveFilterValue(g.value))!=null?x:g.value})});const l=(n??[]).map(g=>g.id),u=e.getGlobalFilterFn(),d=e.getAllLeafColumns().filter(g=>g.getCanGlobalFilter());r&&u&&d.length&&(l.push("__global__"),d.forEach(g=>{var x;o.push({id:g.id,filterFn:u,resolvedValue:(x=u.resolveFilterValue==null?void 0:u.resolveFilterValue(r))!=null?x:r})}));let f,h;for(let g=0;g{x.columnFiltersMeta[w]=C})}if(o.length){for(let b=0;b{x.columnFiltersMeta[w]=C})){x.columnFilters.__global__=!0;break}}x.columnFilters.__global__!==!0&&(x.columnFilters.__global__=!1)}}const m=g=>{for(let x=0;xe._autoResetPageIndex()))}function Dee(){return e=>ot(()=>[e.getState().grouping,e.getPreGroupedRowModel()],(t,n)=>{if(!n.rows.length||!t.length)return n.rows.forEach(d=>{d.depth=0,d.parentId=void 0}),n;const r=t.filter(d=>e.getColumn(d)),s=[],o={},l=function(d,f,h){if(f===void 0&&(f=0),f>=r.length)return d.map(b=>(b.depth=f,s.push(b),o[b.id]=b,b.subRows&&(b.subRows=l(b.subRows,f+1,b.id)),b));const m=r[f],g=Fee(d,m);return Array.from(g.entries()).map((b,w)=>{let[C,k]=b,j=`${m}:${C}`;j=h?`${h}>${j}`:j;const M=l(k,f+1,j);M.forEach(N=>{N.parentId=j});const _=f?lI(k,N=>N.subRows):k,R=bg(e,j,_[0].original,w,f,void 0,h);return Object.assign(R,{groupingColumnId:m,groupingValue:C,subRows:M,leafRows:_,getValue:N=>{if(r.includes(N)){if(R._valuesCache.hasOwnProperty(N))return R._valuesCache[N];if(k[0]){var O;R._valuesCache[N]=(O=k[0].getValue(N))!=null?O:void 0}return R._valuesCache[N]}if(R._groupingValuesCache.hasOwnProperty(N))return R._groupingValuesCache[N];const D=e.getColumn(N),z=D?.getAggregationFn();if(z)return R._groupingValuesCache[N]=z(N,_,k),R._groupingValuesCache[N]}}),M.forEach(N=>{s.push(N),o[N.id]=N}),R})},u=l(n.rows,0);return u.forEach(d=>{s.push(d),o[d.id]=d}),{rows:u,flatRows:s,rowsById:o}},at(e.options,"debugTable","getGroupedRowModel",()=>{e._queue(()=>{e._autoResetExpanded(),e._autoResetPageIndex()})}))}function Fee(e,t){const n=new Map;return e.reduce((r,s)=>{const o=`${s.getGroupingValue(t)}`,l=r.get(o);return l?l.push(s):r.set(o,[s]),r},n)}function Lee(){return e=>ot(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,s=[],o=r.filter(d=>{var f;return(f=e.getColumn(d.id))==null?void 0:f.getCanSort()}),l={};o.forEach(d=>{const f=e.getColumn(d.id);f&&(l[d.id]={sortUndefined:f.columnDef.sortUndefined,invertSorting:f.columnDef.invertSorting,sortingFn:f.getSortingFn()})});const u=d=>{const f=d.map(h=>({...h}));return f.sort((h,m)=>{for(let x=0;x{var m;s.push(h),(m=h.subRows)!=null&&m.length&&(h.subRows=u(h.subRows))}),f};return{rows:u(n.rows),flatRows:s,rowsById:n.rowsById}},at(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/** + * react-table + * + * Copyright (c) TanStack + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function bk(e,t){return e?$ee(e)?y.createElement(e,t):e:null}function $ee(e){return Bee(e)||typeof e=="function"||zee(e)}function Bee(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function zee(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Uee(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=y.useState(()=>({current:_ee(t)})),[r,s]=y.useState(()=>n.current.initialState);return n.current.setOptions(o=>({...o,...e,state:{...r,...e.state},onStateChange:l=>{s(l),e.onStateChange==null||e.onStateChange(l)}})),n.current}const yI=y.forwardRef(({className:e,...t},n)=>i.jsx("div",{className:"relative w-full overflow-auto",children:i.jsx("table",{ref:n,className:Ie("w-full caption-bottom text-sm",e),...t})}));yI.displayName="Table";const bI=y.forwardRef(({className:e,...t},n)=>i.jsx("thead",{ref:n,className:Ie("[&_tr]:border-b",e),...t}));bI.displayName="TableHeader";const xI=y.forwardRef(({className:e,...t},n)=>i.jsx("tbody",{ref:n,className:Ie("[&_tr:last-child]:border-0",e),...t}));xI.displayName="TableBody";const Vee=y.forwardRef(({className:e,...t},n)=>i.jsx("tfoot",{ref:n,className:Ie("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));Vee.displayName="TableFooter";const Eu=y.forwardRef(({className:e,...t},n)=>i.jsx("tr",{ref:n,className:Ie("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Eu.displayName="TableRow";const wI=y.forwardRef(({className:e,...t},n)=>i.jsx("th",{ref:n,className:Ie("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));wI.displayName="TableHead";const Np=y.forwardRef(({className:e,...t},n)=>i.jsx("td",{ref:n,className:Ie("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Np.displayName="TableCell";const Hee=y.forwardRef(({className:e,...t},n)=>i.jsx("caption",{ref:n,className:Ie("mt-4 text-sm text-muted-foreground",e),...t}));Hee.displayName="TableCaption";function $a({columns:e,data:t,isLoading:n,loadingMessage:r,noResultsMessage:s,enableHeaders:o=!0,className:l,highlightedRows:u,...d}){const f=Uee({...d,data:t,columns:e,getCoreRowModel:Ree(),getFilteredRowModel:Aee(),getGroupedRowModel:Dee(),getSortedRowModel:Lee()});return i.jsx("div",{className:Ie("rounded-md border",l),children:i.jsxs(yI,{children:[o&&i.jsx(bI,{children:f.getHeaderGroups().map(h=>i.jsx(Eu,{children:h.headers.map(m=>i.jsx(wI,{children:m.isPlaceholder?null:bk(m.column.columnDef.header,m.getContext())},m.id))},h.id))}),i.jsx(xI,{children:n?i.jsx(Eu,{children:i.jsx(Np,{colSpan:e.length,className:"h-24 text-center text-muted-foreground",children:r??"Carregando..."})}):i.jsx(i.Fragment,{children:f.getRowModel().rows?.length?f.getRowModel().rows.map(h=>i.jsx(Eu,{"data-state":h.getIsSelected()?"selected":u?.includes(h.id)?"highlighted":"",children:h.getVisibleCells().map(m=>i.jsx(Np,{children:bk(m.column.columnDef.cell,m.getContext())},m.id))},h.id)):i.jsx(Eu,{children:i.jsx(Np,{colSpan:e.length,className:"h-24 text-center",children:s??"Nenhum resultado encontrado!"})})})})]})})}const qee=e=>["dify","fetchSessions",JSON.stringify(e)],Kee=async({difyId:e,instanceName:t})=>(await Ee.get(`/dify/fetchSessions/${e}/${t}`)).data,Wee=e=>{const{difyId:t,instanceName:n,...r}=e;return mt({...r,queryKey:qee({difyId:t,instanceName:n}),queryFn:()=>Kee({difyId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0),staleTime:1e3*10})};function SI({difyId:e}){const{t}=Ve(),{instance:n}=ct(),{changeStatusDify:r}=vg(),[s,o]=y.useState([]),{data:l,refetch:u}=Wee({difyId:e,instanceName:n?.name}),[d,f]=y.useState(!1),[h,m]=y.useState("");function g(){u()}const x=async(w,C)=>{try{if(!n)return;await r({instanceName:n.name,token:n.token,remoteJid:w,status:C}),me.success(t("dify.toast.success.status")),g()}catch(k){console.error("Error:",k),me.error(`Error : ${k?.response?.data?.response?.message}`)}},b=[{accessorKey:"remoteJid",header:()=>i.jsx("div",{className:"text-center",children:t("dify.sessions.table.remoteJid")}),cell:({row:w})=>i.jsx("div",{children:w.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>i.jsx("div",{className:"text-center",children:t("dify.sessions.table.pushName")}),cell:({row:w})=>i.jsx("div",{children:w.getValue("pushName")})},{accessorKey:"sessionId",header:()=>i.jsx("div",{className:"text-center",children:t("dify.sessions.table.sessionId")}),cell:({row:w})=>i.jsx("div",{children:w.getValue("sessionId")})},{accessorKey:"status",header:()=>i.jsx("div",{className:"text-center",children:t("dify.sessions.table.status")}),cell:({row:w})=>i.jsx("div",{children:w.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:w})=>{const C=w.original;return i.jsxs(Kr,{children:[i.jsx(Wr,{asChild:!0,children:i.jsxs(se,{variant:"ghost",className:"h-8 w-8 p-0",children:[i.jsx("span",{className:"sr-only",children:t("dify.sessions.table.actions.title")}),i.jsx(Pa,{className:"h-4 w-4"})]})}),i.jsxs(hr,{align:"end",children:[i.jsx(Ao,{children:t("dify.sessions.table.actions.title")}),i.jsx(Xs,{}),C.status!=="opened"&&i.jsxs(wt,{onClick:()=>x(C.remoteJid,"opened"),children:[i.jsx(Fi,{className:"mr-2 h-4 w-4"}),t("dify.sessions.table.actions.open")]}),C.status!=="paused"&&C.status!=="closed"&&i.jsxs(wt,{onClick:()=>x(C.remoteJid,"paused"),children:[i.jsx(Di,{className:"mr-2 h-4 w-4"}),t("dify.sessions.table.actions.pause")]}),C.status!=="closed"&&i.jsxs(wt,{onClick:()=>x(C.remoteJid,"closed"),children:[i.jsx(Oi,{className:"mr-2 h-4 w-4"}),t("dify.sessions.table.actions.close")]}),i.jsxs(wt,{onClick:()=>x(C.remoteJid,"delete"),children:[i.jsx(Ii,{className:"mr-2 h-4 w-4"}),t("dify.sessions.table.actions.delete")]})]})]})}}];return i.jsxs(Pt,{open:d,onOpenChange:f,children:[i.jsx(Bt,{asChild:!0,children:i.jsxs(se,{variant:"secondary",size:"sm",children:[i.jsx(Ai,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:t("dify.sessions.label")})]})}),i.jsxs(Nt,{className:"overflow-y-auto sm:max-w-[950px]",onCloseAutoFocus:g,children:[i.jsx(Mt,{children:i.jsx(zt,{children:t("dify.sessions.label")})}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between gap-6 p-5",children:[i.jsx(ne,{placeholder:t("dify.sessions.search"),value:h,onChange:w=>m(w.target.value)}),i.jsx(se,{variant:"outline",onClick:g,size:"icon",children:i.jsx(Li,{})})]}),i.jsx($a,{columns:b,data:l??[],onSortingChange:o,state:{sorting:s,globalFilter:h},onGlobalFilterChange:m,enableGlobalFilter:!0,noResultsMessage:t("dify.sessions.table.none")})]})]})]})}const Gee=P.object({enabled:P.boolean(),description:P.string(),botType:P.string(),apiUrl:P.string(),apiKey:P.string(),triggerType:P.string(),triggerOperator:P.string().optional(),triggerValue:P.string().optional(),expire:P.coerce.number().optional(),keywordFinish:P.string().optional(),delayMessage:P.coerce.number().optional(),unknownMessage:P.string().optional(),listeningFromMe:P.boolean().optional(),stopBotFromMe:P.boolean().optional(),keepOpen:P.boolean().optional(),debounceTime:P.coerce.number().optional(),splitMessages:P.boolean().optional(),timePerChar:P.coerce.number().optional()});function CI({initialData:e,onSubmit:t,handleDelete:n,difyId:r,isModal:s=!1,isLoading:o=!1,openDeletionDialog:l=!1,setOpenDeletionDialog:u=()=>{}}){const{t:d}=Ve(),f=on({resolver:an(Gee),defaultValues:e||{enabled:!0,description:"",botType:"chatBot",apiUrl:"",apiKey:"",triggerType:"keyword",triggerOperator:"contains",triggerValue:"",expire:0,keywordFinish:"",delayMessage:0,unknownMessage:"",listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0,splitMessages:!1,timePerChar:0}}),h=f.watch("triggerType");return i.jsx(Gn,{...f,children:i.jsxs("form",{onSubmit:f.handleSubmit(t),className:"w-full space-y-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx(Pe,{name:"enabled",label:d("dify.form.enabled.label"),reverse:!0}),i.jsx(le,{name:"description",label:d("dify.form.description.label"),required:!0,children:i.jsx(ne,{})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:d("dify.form.difySettings.label")}),i.jsx($t,{})]}),i.jsx(Jt,{name:"botType",label:d("dify.form.botType.label"),options:[{label:d("dify.form.botType.chatBot"),value:"chatBot"},{label:d("dify.form.botType.textGenerator"),value:"textGenerator"},{label:d("dify.form.botType.agent"),value:"agent"},{label:d("dify.form.botType.workflow"),value:"workflow"}]}),i.jsx(le,{name:"apiUrl",label:d("dify.form.apiUrl.label"),required:!0,children:i.jsx(ne,{})}),i.jsx(le,{name:"apiKey",label:d("dify.form.apiKey.label"),required:!0,children:i.jsx(ne,{type:"password"})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:d("dify.form.triggerSettings.label")}),i.jsx($t,{})]}),i.jsx(Jt,{name:"triggerType",label:d("dify.form.triggerType.label"),options:[{label:d("dify.form.triggerType.keyword"),value:"keyword"},{label:d("dify.form.triggerType.all"),value:"all"},{label:d("dify.form.triggerType.advanced"),value:"advanced"},{label:d("dify.form.triggerType.none"),value:"none"}]}),h==="keyword"&&i.jsxs(i.Fragment,{children:[i.jsx(Jt,{name:"triggerOperator",label:d("dify.form.triggerOperator.label"),options:[{label:d("dify.form.triggerOperator.contains"),value:"contains"},{label:d("dify.form.triggerOperator.equals"),value:"equals"},{label:d("dify.form.triggerOperator.startsWith"),value:"startsWith"},{label:d("dify.form.triggerOperator.endsWith"),value:"endsWith"},{label:d("dify.form.triggerOperator.regex"),value:"regex"}]}),i.jsx(le,{name:"triggerValue",label:d("dify.form.triggerValue.label"),children:i.jsx(ne,{})})]}),h==="advanced"&&i.jsx(le,{name:"triggerValue",label:d("dify.form.triggerConditions.label"),children:i.jsx(ne,{})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:d("dify.form.generalSettings.label")}),i.jsx($t,{})]}),i.jsx(le,{name:"expire",label:d("dify.form.expire.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(le,{name:"keywordFinish",label:d("dify.form.keywordFinish.label"),children:i.jsx(ne,{})}),i.jsx(le,{name:"delayMessage",label:d("dify.form.delayMessage.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(le,{name:"unknownMessage",label:d("dify.form.unknownMessage.label"),children:i.jsx(ne,{})}),i.jsx(Pe,{name:"listeningFromMe",label:d("dify.form.listeningFromMe.label"),reverse:!0}),i.jsx(Pe,{name:"stopBotFromMe",label:d("dify.form.stopBotFromMe.label"),reverse:!0}),i.jsx(Pe,{name:"keepOpen",label:d("dify.form.keepOpen.label"),reverse:!0}),i.jsx(le,{name:"debounceTime",label:d("dify.form.debounceTime.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(Pe,{name:"splitMessages",label:d("dify.form.splitMessages.label"),reverse:!0}),f.watch("splitMessages")&&i.jsx(le,{name:"timePerChar",label:d("dify.form.timePerChar.label"),children:i.jsx(ne,{type:"number"})})]}),s&&i.jsx(Yt,{children:i.jsx(se,{disabled:o,type:"submit",children:d(o?"dify.button.saving":"dify.button.save")})}),!s&&i.jsxs("div",{children:[i.jsx(SI,{difyId:r}),i.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[i.jsxs(Pt,{open:l,onOpenChange:u,children:[i.jsx(Bt,{asChild:!0,children:i.jsx(se,{variant:"destructive",size:"sm",children:d("dify.button.delete")})}),i.jsx(Nt,{children:i.jsxs(Mt,{children:[i.jsx(zt,{children:d("modal.delete.title")}),i.jsx(eo,{children:d("modal.delete.messageSingle")}),i.jsxs(Yt,{children:[i.jsx(se,{size:"sm",variant:"outline",onClick:()=>u(!1),children:d("button.cancel")}),i.jsx(se,{variant:"destructive",onClick:n,children:d("button.delete")})]})]})})]}),i.jsx(se,{disabled:o,type:"submit",children:d(o?"dify.button.saving":"dify.button.update")})]})]})]})})}function Jee({resetTable:e}){const{t}=Ve(),{instance:n}=ct(),[r,s]=y.useState(!1),[o,l]=y.useState(!1),{createDify:u}=vg(),d=async f=>{try{if(!n||!n.name)throw new Error("instance not found");s(!0);const h={enabled:f.enabled,description:f.description,botType:f.botType,apiUrl:f.apiUrl,apiKey:f.apiKey,triggerType:f.triggerType,triggerOperator:f.triggerOperator||"",triggerValue:f.triggerValue||"",expire:f.expire||0,keywordFinish:f.keywordFinish||"",delayMessage:f.delayMessage||0,unknownMessage:f.unknownMessage||"",listeningFromMe:f.listeningFromMe||!1,stopBotFromMe:f.stopBotFromMe||!1,keepOpen:f.keepOpen||!1,debounceTime:f.debounceTime||0,splitMessages:f.splitMessages||!1,timePerChar:f.timePerChar||0};await u({instanceName:n.name,token:n.token,data:h}),me.success(t("dify.toast.success.create")),l(!1),e()}catch(h){console.error("Error:",h),me.error(`Error: ${h?.response?.data?.response?.message}`)}finally{s(!1)}};return i.jsxs(Pt,{open:o,onOpenChange:l,children:[i.jsx(Bt,{asChild:!0,children:i.jsxs(se,{size:"sm",children:[i.jsx(cs,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:t("dify.button.create")})]})}),i.jsxs(Nt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[i.jsx(Mt,{children:i.jsx(zt,{children:t("dify.form.title")})}),i.jsx(CI,{onSubmit:d,isModal:!0,isLoading:r})]})]})}const Qee=e=>["dify","getDify",JSON.stringify(e)],Zee=async({difyId:e,instanceName:t})=>(await Ee.get(`/dify/fetch/${e}/${t}`)).data,Yee=e=>{const{difyId:t,instanceName:n,...r}=e;return mt({...r,queryKey:Qee({difyId:t,instanceName:n}),queryFn:()=>Zee({difyId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0)})};function Xee({difyId:e,resetTable:t}){const{t:n}=Ve(),{instance:r}=ct(),s=dn(),[o,l]=y.useState(!1),{deleteDify:u,updateDify:d}=vg(),{data:f,isLoading:h}=Yee({difyId:e,instanceName:r?.name}),m=y.useMemo(()=>({enabled:!!f?.enabled,description:f?.description??"",botType:f?.botType??"",apiUrl:f?.apiUrl??"",apiKey:f?.apiKey??"",triggerType:f?.triggerType??"",triggerOperator:f?.triggerOperator??"",triggerValue:f?.triggerValue??"",expire:f?.expire??0,keywordFinish:f?.keywordFinish??"",delayMessage:f?.delayMessage??0,unknownMessage:f?.unknownMessage??"",listeningFromMe:!!f?.listeningFromMe,stopBotFromMe:!!f?.stopBotFromMe,keepOpen:!!f?.keepOpen,debounceTime:f?.debounceTime??0,splitMessages:f?.splitMessages??!1,timePerChar:f?.timePerChar??0}),[f?.apiKey,f?.apiUrl,f?.botType,f?.debounceTime,f?.delayMessage,f?.description,f?.enabled,f?.expire,f?.keepOpen,f?.keywordFinish,f?.listeningFromMe,f?.stopBotFromMe,f?.triggerOperator,f?.triggerType,f?.triggerValue,f?.unknownMessage,f?.splitMessages,f?.timePerChar]),g=async b=>{try{if(r&&r.name&&e){const w={enabled:b.enabled,description:b.description,botType:b.botType,apiUrl:b.apiUrl,apiKey:b.apiKey,triggerType:b.triggerType,triggerOperator:b.triggerOperator||"",triggerValue:b.triggerValue||"",expire:b.expire||0,keywordFinish:b.keywordFinish||"",delayMessage:b.delayMessage||1e3,unknownMessage:b.unknownMessage||"",listeningFromMe:b.listeningFromMe||!1,stopBotFromMe:b.stopBotFromMe||!1,keepOpen:b.keepOpen||!1,debounceTime:b.debounceTime||0,splitMessages:b.splitMessages||!1,timePerChar:b.timePerChar||0};await d({instanceName:r.name,difyId:e,data:w}),me.success(n("dify.toast.success.update")),t(),s(`/manager/instance/${r.id}/dify/${e}`)}else console.error("Token not found")}catch(w){console.error("Error:",w),me.error(`Error: ${w?.response?.data?.response?.message}`)}},x=async()=>{try{r&&r.name&&e?(await u({instanceName:r.name,difyId:e}),me.success(n("dify.toast.success.delete")),l(!1),t(),s(`/manager/instance/${r.id}/dify`)):console.error("instance not found")}catch(b){console.error("Erro ao excluir dify:",b)}};return h?i.jsx(On,{}):i.jsx("div",{className:"m-4",children:i.jsx(CI,{initialData:m,onSubmit:g,difyId:e,handleDelete:x,isModal:!1,isLoading:h,openDeletionDialog:o,setOpenDeletionDialog:l})})}function xk(){const{t:e}=Ve(),t=zo("(min-width: 768px)"),{instance:n}=ct(),{difyId:r}=ls(),{data:s,refetch:o,isLoading:l}=iI({instanceName:n?.name}),u=dn(),d=h=>{n&&u(`/manager/instance/${n.id}/dify/${h}`)},f=()=>{o()};return i.jsxs("main",{className:"pt-5",children:[i.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[i.jsx("h3",{className:"text-lg font-medium",children:e("dify.title")}),i.jsxs("div",{className:"flex items-center justify-end gap-2",children:[i.jsx(SI,{}),i.jsx(WX,{}),i.jsx(Jee,{resetTable:f})]})]}),i.jsx($t,{className:"my-4"}),i.jsxs($o,{direction:t?"horizontal":"vertical",children:[i.jsx(Hn,{defaultSize:35,className:"pr-4",children:i.jsx("div",{className:"flex flex-col gap-3",children:l?i.jsx(On,{}):i.jsx(i.Fragment,{children:s&&s.length>0&&Array.isArray(s)?s.map(h=>i.jsxs(se,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>d(`${h.id}`),variant:r===h.id?"secondary":"outline",children:[i.jsx("h4",{className:"text-base",children:h.description||h.id}),i.jsx("p",{className:"text-sm font-normal text-muted-foreground",children:h.botType})]},h.id)):i.jsx(se,{variant:"link",children:e("dify.table.none")})})})}),r&&i.jsxs(i.Fragment,{children:[i.jsx(Bo,{withHandle:!0,className:"border border-border"}),i.jsx(Hn,{children:i.jsx(Xee,{difyId:r,resetTable:f})})]})]})]})}const EI=y.createContext({instance:null,isLoading:!0,error:null});function ete({children:e}){const[t]=hd(),[n,r]=y.useState(null),[s,o]=y.useState(!0),[l,u]=y.useState(null);return y.useEffect(()=>{(async()=>{const f=t.get("token"),h=t.get("instanceName"),m=t.get("apiUrl");if(!f||!h||!m){u("Token, instanceName e apiUrl são obrigatórios"),o(!1);return}try{const g=m.endsWith("/")?m.slice(0,-1):m;localStorage.setItem(jn.API_URL,g),localStorage.setItem(jn.INSTANCE_TOKEN,f);const{data:x}=await sn.get(`${g}/instance/fetchInstances?instanceName=${h}`,{headers:{apikey:f}});console.log("API Response:",x),x&&Array.isArray(x)&&x.length>0?r(x[0]):u("Instância não encontrada")}catch{u("Erro ao validar token ou buscar instância")}finally{o(!1)}})()},[t]),i.jsx(EI.Provider,{value:{instance:n,isLoading:s,error:l},children:e})}const cw=()=>y.useContext(EI),uw=y.createContext({}),tte=({children:e})=>{const[t,n]=y.useState(null);return i.jsx(uw.Provider,{value:{replyingMessage:t,setReplyingMessage:n},children:e})},nte=e=>{const t=Math.floor(e/60),n=e%60,r=t<10?`${t}`:t,s=n<10?`0${n}`:n;return`${r}:${s}`},wk=200,rte=({imageMessage:e})=>i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("img",{src:e?.mediaUrl,alt:"Quoted message",width:100,height:100}),i.jsx(cB,{className:"mr-2 h-4 w-4 text-muted-foreground"})]}),i.jsx("span",{className:"inline-block max-w-40 overflow-hidden overflow-ellipsis whitespace-nowrap text-sm text-muted-foreground",children:e.caption})]}),ste=({videoMessage:e})=>i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("img",{src:e?.mediaUrl,alt:"Quoted message",width:100,height:100}),i.jsx(TB,{className:"mr-2 h-4 w-4 text-muted-foreground"})]}),i.jsx("span",{className:"inline-block max-w-40 overflow-hidden overflow-ellipsis whitespace-nowrap text-sm text-muted-foreground",children:e.caption})]}),ote=({audioMessage:e})=>i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(hT,{className:"h-6 w-6 text-muted-foreground"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:nte(e.seconds)})]}),i.jsx("span",{className:"inline-block max-w-40 overflow-hidden overflow-ellipsis whitespace-nowrap text-sm text-muted-foreground",children:e.fileName})]}),ate=({stickerMessage:e})=>i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("img",{src:e.mediaUrl,alt:"Sticker",width:100,height:100}),i.jsx(CB,{className:"h-6 w-6 text-muted-foreground"})]}),ite=({documentMessage:e})=>i.jsx("div",{className:"flex flex-col gap-2",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Hb,{className:"h-6 w-6 text-muted-foreground"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:e.fileName})]})}),lte=({documentMessage:e})=>i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Hb,{className:"h-6 w-6 text-muted-foreground"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:e.fileName})]}),i.jsx("span",{className:"inline-block max-w-40 overflow-hidden overflow-ellipsis whitespace-nowrap text-sm text-muted-foreground",children:e.caption})]}),cte=({contactMessage:e})=>i.jsx("div",{className:"flex flex-col gap-2",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Ap,{className:"h-6 w-6 text-muted-foreground"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:e.displayName})]})}),ute=({locationMessage:e})=>i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(yB,{className:"h-6 w-6 text-muted-foreground"}),i.jsx("span",{className:"text-sm text-muted-foreground",children:e.name})]}),i.jsx("span",{className:"inline-block max-w-40 text-sm text-muted-foreground",children:e.address})]}),dte=({conversation:e})=>i.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap text-sm text-muted-foreground",children:e.length>wk?`${e.substring(0,wk)}...`:e}),fte=({chat:e})=>{const{replyingMessage:t,setReplyingMessage:n}=y.useContext(uw),r=()=>{n(null)},s=f=>f?.conversation?f.conversation:f?.viewOnceMessage?.message?.interactiveMessage?.body?.text?f.viewOnceMessage.message.interactiveMessage.body.text:"",o=()=>t?.key.fromMe?"Você":e?.pushName,l=()=>{if(t?.messageType==="imageMessage")return i.jsx(rte,{imageMessage:{caption:t?.message.imageMessage.caption,mediaUrl:t?.message.mediaUrl}});if(t?.messageType==="videoMessage")return i.jsx(ste,{videoMessage:{caption:t?.message.videoMessage.caption,mediaUrl:t?.message.mediaUrl}});if(t?.messageType==="audioMessage")return i.jsx(ote,{audioMessage:t?.message.audioMessage});if(t?.messageType==="stickerMessage")return i.jsx(ate,{stickerMessage:t?.message});if(t?.messageType==="documentMessage")return i.jsx(ite,{documentMessage:{name:t?.message.documentMessage.name,mediaUrl:t?.message.mediaUrl}});if(t?.messageType==="documentWithCaptionMessage")return i.jsx(lte,{documentMessage:{name:t?.message.documentWithCaptionMessage.message.documentMessage.name,caption:t?.message.documentWithCaptionMessage.message.documentMessage.caption,mediaUrl:t?.message.mediaUrl}});if(t?.messageType==="contactMessage")return i.jsx(cte,{contactMessage:t?.message.contactMessage});if(t?.messageType==="locationMessage")return i.jsx(ute,{locationMessage:t?.message.locationMessage});if(t?.messageType==="conversation"||t?.messageType==="interactiveMessage"||t?.messageType==="extendedTextMessage")return i.jsx(dte,{conversation:s(t?.message)})},{inputIconsMainColor:u,inputBackgroundColor:d}=La();return i.jsxs("div",{className:"relative flex items-center overflow-hidden rounded-lg dark:text-white",style:{backgroundColor:d},children:[i.jsx("div",{className:`absolute h-full w-1 rounded-l-lg ${t?.key.fromMe?"bg-blue-700 dark:bg-blue-300":"bg-blue-100"}`}),i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2 p-2 pl-4",children:[i.jsx("span",{className:`text-sm font-bold ${t?.key.fromMe?"text-blue-700 dark:text-blue-300":"text-blue-600"}`,children:o()}),l()]}),i.jsx(se,{size:"icon",variant:"ghost",className:"ml-auto h-10 w-10 shrink-0 rounded-full",onClick:r,style:{backgroundColor:d,color:u},children:i.jsx(qb,{className:"h-6 w-6"})})]})},yy=[{name:"Smileys",icon:gT,emojis:["😀","😃","😄","😁","😆","😅","😂","🤣","😊","😇"]},{name:"Natureza",icon:HC,emojis:["🌿","🌱","🌳","🌴","🌵","🌷","🌸","🌹","🌺","🌻"]},{name:"Comida",icon:HC,emojis:["🍎","🍐","🍊","🍋","🍌","🍉","🍇","🍓","🍒","🍑"]},{name:"Atividades",icon:Y$,emojis:["⚽️","🏀","🏈","⚾️","🎾","🏐","🏉","🎱","🏓","🏸"]},{name:"Viagem",icon:K$,emojis:["🚗","🚕","🚙","🚌","🚎","🏎","🚓","🚑","🚒","🚐"]},{name:"Objetos",icon:gB,emojis:["💡","🔦","🕯","🧳","⌛️","⏳","🌡","🧪","🧬","🔬"]},{name:"Símbolos",icon:oB,emojis:["❤️","🧡","💛","💚","💙","💜","🖤","🤍","🤎","💔"]}];function pte({handleEmojiClick:e}){const{inputIconsMainColor:t}=La(),n=r=>yy.find(o=>o.name===r)?.emojis||[];return i.jsxs(Kr,{children:[i.jsx(Wr,{asChild:!0,children:i.jsxs(se,{type:"button",variant:"ghost",size:"icon",className:"rounded-full p-2",children:[i.jsx(gT,{className:"h-6 w-6",style:{color:t}}),i.jsx("span",{className:"sr-only",children:"Emojis"})]})}),i.jsx(hr,{className:"bg-background p-2",align:"end",children:i.jsxs(Yx,{defaultValue:"Smileys",className:"w-full",children:[i.jsx(hg,{className:"grid grid-cols-8 gap-2",children:yy.map(r=>i.jsx(Jl,{value:r.name,children:i.jsx(r.icon,{className:"h-5 w-5"})},r.name))}),yy.map(r=>i.jsx(Ql,{value:r.name,children:i.jsx("div",{className:"grid grid-cols-8 gap-2",children:n(r.name).map((s,o)=>i.jsx(se,{variant:"ghost",className:"h-12 p-2 text-2xl",onClick:()=>e(s),children:s},o))})},r.name))]})})]})}const hte=({isSendingMessage:e,isRecording:t,audioBlob:n,elapsedTime:r,startRecording:s,stopRecording:o,clearRecording:l,sendAudioMessage:u,disabled:d})=>{const{inputIconsMainColor:f}=La();return i.jsxs("div",{className:"flex items-center gap-2",children:[t&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(se,{type:"button",size:"icon",variant:"ghost",className:"rounded-full p-2",onClick:o,children:i.jsx(SB,{className:"h-6 w-6 text-[#b03f3f]"})}),i.jsxs("span",{children:[r,"s"]})]}),n&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(se,{type:"button",size:"icon",variant:"ghost",className:"rounded-full p-2",disabled:e,onClick:l,children:i.jsx(kB,{className:"h-6 w-6 text-[#b03f3f]"})}),i.jsx("audio",{controls:!0,src:URL.createObjectURL(n)})]}),i.jsx(se,{type:"button",size:"icon",variant:"ghost",className:"rounded-full p-2",disabled:e||t||d,onClick:n?u:s,children:e?i.jsx(On,{className:"h-6 w-6",style:{color:f}}):n?i.jsx(Th,{className:"h-6 w-6",style:{color:f}}):i.jsx(hT,{className:"h-6 w-6",style:{color:f}})})]})},gte=({isSendingMessage:e,sendMessage:t,disabled:n})=>{const{inputIconsMainColor:r}=La();return i.jsx(se,{type:"button",size:"icon",variant:"ghost",className:"rounded-full p-2",onClick:t,disabled:e||n,children:e?i.jsx(On,{className:"h-6 w-6",style:{color:r}}):i.jsx(Th,{className:"h-6 w-6",style:{color:r}})})},mte=({chat:e})=>{const[t]=hd(),{inputBackgroundColor:n,inputTextForegroundColor:r}=La(),s=t.get("remoteJid"),{instance:o}=cw(),{sendText:l}=KO(),{sendMedia:u}=WO(),{sendAudio:d}=iX(),{replyingMessage:f,setReplyingMessage:h}=y.useContext(uw),m=y.useRef(null),g=y.useRef(null),x=y.useRef(null),[b,w]=y.useState(""),[C,k]=y.useState(!1),[j,M]=y.useState(null),[_,R]=y.useState(!1),[N,O]=y.useState(null),[D,z]=y.useState(0),{t:Q}=Ve();y.useEffect(()=>{h(null),M(null)},[s,h,M]);const pe=te=>{if(w(te.target.value),m.current){m.current.style.height="auto";const de=m.current.scrollHeight,Z=parseInt(getComputedStyle(m.current).lineHeight)*10;m.current.style.height=`${Math.min(de,Z)}px`}},V=te=>{if(w(de=>de+te),m.current){m.current.style.height="auto";const de=m.current.scrollHeight,Z=parseInt(getComputedStyle(m.current).lineHeight)*10;m.current.style.height=`${Math.min(de,Z)}px`}},G=async()=>{try{R(!0);const te=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:44100,echoCancellation:!0,noiseSuppression:!0}});let de="";const ge=["audio/aac","audio/mp4","audio/mpeg","audio/amr","audio/ogg","audio/opus"];for(const Re of ge)if(MediaRecorder.isTypeSupported(Re)){de=Re;break}if(!de)throw new Error("Nenhum formato aceito pela Meta disponível");const Z=new MediaRecorder(te,{mimeType:de,audioBitsPerSecond:128e3});x.current=Z;const ye=[];Z.ondataavailable=Re=>{Re.data.size>0&&ye.push(Re.data)},Z.onstop=()=>{const Re=new Blob(ye,{type:de}),$e=new File([Re],`audio.${de.split("/")[1]}`,{type:de,lastModified:Date.now()});O($e)},Z.start(),g.current=setInterval(()=>{z(Re=>Re+1)},1e3)}catch(te){console.error("Erro ao iniciar gravação:",te),me.error(Q("chat.toast.recordingError")),R(!1)}},W=()=>{x.current&&(x.current.stop(),g.current&&clearInterval(g.current),R(!1))},ie=()=>{O(null),z(0)},re=te=>{console.error("Error to send message",te),me.error(rT(te)?`${Q("chat.toast.error")}: ${te?.response?.data?.response?.message}`:Q("chat.toast.sendError"))},Y=()=>{k(!1),h(null)},H=async()=>{if(!o?.name||!o?.token||!s)return;const te={instanceName:o.name,token:o.token,data:{number:s,text:b}};await l(te,{onSuccess:()=>{w(""),m.current&&(m.current.style.height="auto")},onError:re,onSettled:Y})},q=async()=>{if(!(!o?.name||!o?.token||!j||!s)){k(!0);try{const te=await new Promise((ge,Z)=>{const ye=new FileReader;ye.readAsDataURL(j),ye.onload=()=>{const $e=ye.result.split(",")[1];ge($e)},ye.onerror=Z}),de={instanceName:o.name,token:o.token,data:{number:s,mediaMessage:{mediatype:j.type.split("/")[0]==="application"?"document":j.type.split("/")[0],mimetype:j.type,caption:b,media:te,fileName:j.name}}};await u(de,{onSuccess:()=>{M(null),w(""),m.current&&(m.current.style.height="auto")},onError:re,onSettled:Y})}catch(te){console.error("Error converting media to base64:",te),re(te),k(!1)}}},he=async()=>{if(!(!o?.name||!o?.token||!N||!s)){k(!0);try{const te=await new Promise((ge,Z)=>{const ye=new FileReader;ye.readAsDataURL(N),ye.onload=()=>{const $e=ye.result.split(",")[1];ge($e)},ye.onerror=Z}),de={instanceName:o.name,token:o.token,data:{number:s,audioMessage:{audio:te}}};await d(de,{onSuccess:()=>{O(null),z(0)},onError:re,onSettled:Y})}catch(te){console.error("Error converting audio to base64:",te),re(te),k(!1)}}},A=async()=>{k(!0),j?await q():await H()},F=()=>!b&&!j?i.jsx(hte,{isSendingMessage:C,isRecording:_,audioBlob:N,elapsedTime:D,startRecording:G,stopRecording:W,clearRecording:ie,sendAudioMessage:he}):i.jsx(gte,{isSendingMessage:C,sendMessage:A}),fe=()=>_||N?F():i.jsxs(i.Fragment,{children:[i.jsx(pte,{handleEmojiClick:V}),i.jsx(JO,{instance:o,setSelectedMedia:M}),i.jsx(bi,{placeholder:Q("chat.message.placeholder"),name:"message",id:"message",rows:1,ref:m,value:b,onChange:pe,onKeyDown:te=>{!te.shiftKey&&te.key==="Enter"&&!C&&(te.preventDefault(),A())},className:"min-h-0 w-full resize-none rounded-lg border-none p-3 focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-transparent focus-visible:ring-offset-0 focus-visible:ring-offset-transparent",style:{backgroundColor:n,color:r}}),F()]});return o?i.jsxs("div",{className:"input-container",children:[j&&i.jsx(QO,{selectedMedia:j,setSelectedMedia:M}),f&&i.jsx(fte,{chat:e}),i.jsx("div",{className:`flex items-end ${(_||N)&&"justify-end"} rounded-3xl px-4 py-1`,style:{backgroundColor:n,color:r},children:fe()})]}):i.jsx("div",{className:"flex h-full items-center justify-center",children:i.jsx("p",{className:"text-muted-foreground",children:Q("chat.noInstance")||"Nenhuma instância selecionada"})})},vte=P.object({remoteJid:P.string().min(1)});function yte({onSuccess:e}){const{t}=Ve(),{primaryColor:n}=La(),r=on({resolver:an(vte),defaultValues:{remoteJid:""}}),s=o=>{e(o)};return i.jsx(Fo,{...r,children:i.jsxs("form",{onSubmit:r.handleSubmit(s),children:[i.jsx(Lo,{control:r.control,name:"remoteJid",render:({field:o})=>i.jsxs(no,{children:[i.jsx(Nr,{children:t("chat.newChat.contact")}),i.jsx(_s,{children:i.jsx(ne,{type:"text",placeholder:t("chat.newChat.placeholder"),...o})})]})}),i.jsx("div",{className:"flex justify-end",children:i.jsx(se,{type:"submit",className:"mt-4",style:{backgroundColor:n},children:t("chat.newChat.submit")})})]})})}function bte({isOpen:e,setIsOpen:t}){const[n]=hd(),{t:r}=Ve(),s=dn(),o=l=>{const u=new URLSearchParams(n);u.set("remoteJid",l.remoteJid),s(`/manager/embed-chat?${u.toString()}`),t(!1)};return i.jsx(Pt,{open:e,onOpenChange:t,children:i.jsxs(Nt,{className:"max-w-2xl",children:[i.jsxs(Mt,{children:[i.jsx(zt,{children:r("chat.newChat.title")}),i.jsx(eo,{children:r("chat.newChat.description")})]}),i.jsx(yte,{onSuccess:o})]})})}const by=e=>e?e.replace("@s.whatsapp.net","").replace("@g.us",""):"";function xte(){const[e]=hd(),{backgroundColor:t,textForegroundColor:n,primaryColor:r}=La(),s=zo("(min-width: 768px)"),{t:o}=Ve(),l=dn(),u=e.get("token"),{remoteJid:d}=ls(),f=d||e.get("remoteJid"),[h,m]=y.useState([]),g=y.useRef(null),x=y.useRef(null),[b,w]=y.useState(null),[C,k]=y.useState(!1),{instance:j}=cw(),M=R=>{const N=new URLSearchParams(e);l(`/manager/embed-chat/${encodeURIComponent(R.remoteJid||R.id)}?${N.toString()}`)};y.useEffect(()=>{if(!j?.name)return;let R=!0;return(async()=>{try{const{data:O}=await Ee.post(`/chat/findChats/${j.name}`,{where:{}},{headers:{apikey:u||j.token}});R&&m(O||[])}catch(O){R&&(console.error("Erro ao buscar chats:",O),me.error("Erro ao buscar chats"))}})(),()=>{R=!1}},[j?.name,u]),y.useEffect(()=>{if(!j)return;const R=dr(jn.API_URL);if(!R){console.error("API URL not found in localStorage");return}const N=localStorage.getItem("accessToken");u&&localStorage.setItem("accessToken",u);const O=sw(R);function D(z,Q){j&&Q.instance===j.name&&m(pe=>{const V=Q?.data?.key?.remoteJid,G=pe.findIndex(re=>re.remoteJid&&re.remoteJid===V||re.id&&re.id===V),W=G!==-1?pe[G]:null,ie={id:V,remoteJid:V,pushName:W?.pushName||Q?.data?.pushName||by(V),profilePicUrl:W?.profilePicUrl||Q?.data?.key?.profilePictureUrl||"https://as2.ftcdn.net/jpg/05/89/93/27/1000_F_589932782_vQAEAZhHnq1QCGu5ikwrYaQD0Mmurm0N.jpg",updatedAt:new Date().toISOString(),labels:W?.labels||[],createdAt:W?.createdAt||new Date().toISOString(),instanceId:j.id};if(G!==-1){const re=[...pe];return re[G]={...W,updatedAt:ie.updatedAt},re}else return[...pe,ie]})}return O.on("messages.upsert",z=>{D("messages.upsert",z)}),O.on("send.message",z=>{D("send.message",z)}),O.on("messages.update",z=>{}),O.connect(),()=>{O.off("messages.upsert"),O.off("send.message"),O.off("messages.update"),ow(O),u?localStorage.setItem("accessToken",N||""):localStorage.removeItem("accessToken")}},[j,f,u]),y.useEffect(()=>{if(f){const R=h.find(N=>N.id===f);w(R||null)}},[f,h]);const _={backgroundColor:t,color:n};return i.jsx("div",{className:"relative h-full",style:_,children:i.jsxs($o,{direction:s?"horizontal":"vertical",children:[i.jsx(Hn,{defaultSize:30,minSize:20,maxSize:60,children:i.jsxs("div",{className:"hidden flex-col gap-2 text-foreground md:flex",style:_,children:[i.jsx("div",{className:"sticky top-0 p-2",children:i.jsxs(se,{variant:"ghost",className:"w-full justify-start gap-2 px-2 text-left",onClick:()=>k(!0),style:{backgroundColor:r,color:n},children:[i.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-full",children:i.jsx(Bl,{className:"h-4 w-4"})}),i.jsx("div",{className:"grow overflow-hidden text-ellipsis whitespace-nowrap text-sm",children:o("chat.title")}),i.jsx(cs,{className:"h-4 w-4"})]})}),i.jsxs(Yx,{defaultValue:"contacts",children:[i.jsxs(hg,{className:"tabs-chat",children:[i.jsx(Jl,{value:"contacts",className:"data-[state=active]:bg-primary data-[state=active]:text-primary-foreground",style:{"--primary":r||"#e2e8f0","--primary-foreground":n||"#000000"},children:o("chat.contacts")}),i.jsx(Jl,{value:"groups",className:"data-[state=active]:bg-primary data-[state=active]:text-primary-foreground",style:{"--primary":r||"#e2e8f0","--primary-foreground":n||"#000000"},children:o("chat.groups")})]}),i.jsx(Ql,{value:"contacts",children:i.jsx("div",{className:"contacts-container",children:i.jsxs("div",{className:"grid gap-1 p-2 text-foreground",children:[i.jsx("div",{className:"px-2 text-xs font-medium text-muted-foreground",children:o("chat.contacts")}),h?.sort((R,N)=>new Date(N.lastMessage.messageTimestamp).getTime()-new Date(R.lastMessage.messageTimestamp).getTime()).map(R=>R?.id&&!R.id.includes("@g.us")&&i.jsxs("div",{onClick:()=>M(R),className:"chat-item flex cursor-pointer items-center overflow-hidden rounded-md p-2 text-sm transition-colors",style:{backgroundColor:f===R.id?r:""},children:[i.jsx("span",{className:"chat-avatar mr-2",children:i.jsx("img",{src:R.profilePicUrl||"https://as2.ftcdn.net/jpg/05/89/93/27/1000_F_589932782_vQAEAZhHnq1QCGu5ikwrYaQD0Mmurm0N.jpg",alt:"Avatar",className:"h-12 w-12 rounded-full"})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"chat-title font-medium",style:{color:n},children:R.pushName||by(R.id)}),i.jsx("span",{className:"text-xs",style:{color:n}})]}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsxs("span",{className:"text-xs font-bold",style:{color:n},children:[o("chat.recent"),":"," "]}),i.jsx("span",{className:"block truncate text-xs",style:{color:n}})]})]})]},R.id))]})})}),i.jsx(Ql,{value:"groups",children:i.jsx("div",{className:"contacts-container",children:i.jsxs("div",{className:"grid gap-1 p-2 text-foreground",children:[i.jsx("div",{className:"px-2 text-xs font-medium text-muted-foreground",children:o("chat.groups")}),h?.sort((R,N)=>new Date(N.lastMessage.messageTimestamp).getTime()-new Date(R.lastMessage.messageTimestamp).getTime()).map(R=>R?.id&&R.id.includes("@g.us")&&i.jsxs("div",{onClick:()=>M(R),className:"chat-item flex cursor-pointer items-center overflow-hidden rounded-md p-2 text-sm transition-colors",style:{backgroundColor:f===R.id?r:""},children:[i.jsx("span",{className:"chat-avatar mr-2",children:i.jsx("img",{src:R.profilePicUrl||"https://as2.ftcdn.net/jpg/05/89/93/27/1000_F_589932782_vQAEAZhHnq1QCGu5ikwrYaQD0Mmurm0N.jpg",alt:"Avatar",className:"h-12 w-12 rounded-full"})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"chat-title font-medium",children:R.pushName}),i.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400"})]}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsxs("span",{className:"text-xs font-bold text-gray-500 dark:text-gray-400",children:[o("chat.recent")," "]}),i.jsx("span",{className:"block truncate text-xs text-gray-500"})]})]})]},R.id))]})})})]})]})}),i.jsx(Bo,{withHandle:!0}),i.jsxs(Hn,{style:_,children:[f&&i.jsx(tte,{children:i.jsxs("div",{className:"flex h-full flex-col justify-between",style:_,children:[i.jsx("div",{className:"flex items-center gap-3 p-3",children:i.jsxs("div",{className:"flex flex-1 items-center gap-3",children:[i.jsx("img",{src:b?.profilePicUrl||"https://as2.ftcdn.net/jpg/05/89/93/27/1000_F_589932782_vQAEAZhHnq1QCGu5ikwrYaQD0Mmurm0N.jpg",alt:"Avatar",className:"h-10 w-10 rounded-full"}),i.jsx("div",{className:"flex flex-col",children:i.jsx("span",{className:"font-medium",children:b?.pushName||by(f)})})]})}),i.jsx(ZO,{textareaRef:g,handleTextareaChange:()=>{},textareaHeight:"auto",lastMessageRef:x,scrollToBottom:()=>{x.current&&x.current.scrollIntoView({behavior:"smooth"})}}),i.jsx(mte,{chat:b})]})}),i.jsx(bte,{isOpen:C,setIsOpen:k})]})]})})}function wte(){const{instance:e,isLoading:t,error:n}=cw();return t?i.jsx("div",{className:"flex h-screen items-center justify-center",children:i.jsx(On,{})}):n?i.jsx("div",{className:"flex h-screen items-center justify-center",children:i.jsx("div",{className:"rounded-md bg-red-50 p-4 dark:bg-red-900",children:i.jsx("span",{className:"text-red-800 dark:text-red-200",children:n})})}):e?i.jsx("div",{className:"h-screen",children:i.jsx(xte,{})}):null}function Sk(){return i.jsx(Yk,{client:_j,children:i.jsx(VM,{children:i.jsx(ete,{children:i.jsx(lX,{children:i.jsx(wte,{})})})})})}const Ste=e=>["evoai","fetchEvoai",JSON.stringify(e)],Cte=async({instanceName:e,token:t})=>(await Ee.get(`/evoai/find/${e}`,{headers:{apikey:t}})).data,kI=e=>{const{instanceName:t,token:n,...r}=e;return mt({...r,queryKey:Ste({instanceName:t,token:n}),queryFn:()=>Cte({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},Ete=async({instanceName:e,token:t,data:n})=>(await Ee.post(`/evoai/create/${e}`,n,{headers:{apikey:t}})).data,kte=async({instanceName:e,evoaiId:t,data:n})=>(await Ee.put(`/evoai/update/${t}/${e}`,n)).data,jte=async({instanceName:e,evoaiId:t})=>(await Ee.delete(`/evoai/delete/${t}/${e}`)).data,Tte=async({instanceName:e,token:t,data:n})=>(await Ee.post(`/evoai/settings/${e}`,n,{headers:{apikey:t}})).data,Nte=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await Ee.post(`/evoai/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function xg(){const e=nt(Tte,{invalidateKeys:[["evoai","fetchDefaultSettings"]]}),t=nt(Nte,{invalidateKeys:[["evoai","getEvoai"],["evoai","fetchSessions"]]}),n=nt(jte,{invalidateKeys:[["evoai","getEvoai"],["evoai","fetchEvoai"],["evoai","fetchSessions"]]}),r=nt(kte,{invalidateKeys:[["evoai","getEvoai"],["evoai","fetchEvoai"],["evoai","fetchSessions"]]}),s=nt(Ete,{invalidateKeys:[["evoai","fetchEvoai"]]});return{setDefaultSettingsEvoai:e,changeStatusEvoai:t,deleteEvoai:n,updateEvoai:r,createEvoai:s}}const Mte=e=>["evoai","fetchDefaultSettings",JSON.stringify(e)],_te=async({instanceName:e,token:t})=>(await Ee.get(`/evoai/fetchSettings/${e}`,{headers:{apikey:t}})).data,Rte=e=>{const{instanceName:t,token:n,...r}=e;return mt({...r,queryKey:Mte({instanceName:t,token:n}),queryFn:()=>_te({instanceName:t,token:n}),enabled:!!t})},Pte=P.object({expire:P.string(),keywordFinish:P.string(),delayMessage:P.string(),unknownMessage:P.string(),listeningFromMe:P.boolean(),stopBotFromMe:P.boolean(),keepOpen:P.boolean(),debounceTime:P.string(),ignoreJids:P.array(P.string()).default([]),evoaiIdFallback:P.union([P.null(),P.string()]).optional(),splitMessages:P.boolean(),timePerChar:P.string()});function Ote(){const{t:e}=Ve(),{instance:t}=ct(),{setDefaultSettingsEvoai:n}=xg(),[r,s]=y.useState(!1),{data:o,refetch:l}=kI({instanceName:t?.name,token:t?.token,enabled:r}),{data:u,refetch:d}=Rte({instanceName:t?.name,token:t?.token}),f=on({resolver:an(Pte),defaultValues:{expire:"0",keywordFinish:e("evoai.form.examples.keywordFinish"),delayMessage:"1000",unknownMessage:e("evoai.form.examples.unknownMessage"),listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:"0",ignoreJids:[],evoaiIdFallback:void 0,splitMessages:!1,timePerChar:"0"}});y.useEffect(()=>{u&&f.reset({expire:u?.expire?u.expire.toString():"0",keywordFinish:u.keywordFinish,delayMessage:u.delayMessage?u.delayMessage.toString():"0",unknownMessage:u.unknownMessage,listeningFromMe:u.listeningFromMe,stopBotFromMe:u.stopBotFromMe,keepOpen:u.keepOpen,debounceTime:u.debounceTime?u.debounceTime.toString():"0",ignoreJids:u.ignoreJids,evoaiIdFallback:u.evoaiIdFallback,splitMessages:u.splitMessages,timePerChar:u.timePerChar?u.timePerChar.toString():"0"})},[u]);const h=async g=>{try{if(!t||!t.name)throw new Error("instance not found.");const x={expire:parseInt(g.expire),keywordFinish:g.keywordFinish,delayMessage:parseInt(g.delayMessage),unknownMessage:g.unknownMessage,listeningFromMe:g.listeningFromMe,stopBotFromMe:g.stopBotFromMe,keepOpen:g.keepOpen,debounceTime:parseInt(g.debounceTime),evoaiIdFallback:g.evoaiIdFallback||void 0,ignoreJids:g.ignoreJids,splitMessages:g.splitMessages,timePerChar:parseInt(g.timePerChar)};await n({instanceName:t.name,token:t.token,data:x}),me.success(e("evoai.toast.defaultSettings.success"))}catch(x){console.error("Error:",x),me.error(`Error: ${x?.response?.data?.response?.message}`)}};function m(){d(),l()}return i.jsxs(Pt,{open:r,onOpenChange:s,children:[i.jsx(Bt,{asChild:!0,children:i.jsxs(se,{variant:"secondary",size:"sm",children:[i.jsx(Oo,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:e("evoai.defaultSettings")})]})}),i.jsxs(Nt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:m,children:[i.jsx(Mt,{children:i.jsx(zt,{children:e("evoai.defaultSettings")})}),i.jsx(Gn,{...f,children:i.jsxs("form",{className:"w-full space-y-6",onSubmit:f.handleSubmit(h),children:[i.jsx("div",{children:i.jsxs("div",{className:"space-y-4",children:[i.jsx(Jt,{name:"evoaiIdFallback",label:e("evoai.form.evoaiIdFallback.label"),options:o?.filter(g=>!!g.id).map(g=>({label:g.description,value:g.id}))??[]}),i.jsx(le,{name:"expire",label:e("evoai.form.expire.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(le,{name:"keywordFinish",label:e("evoai.form.keywordFinish.label"),children:i.jsx(ne,{})}),i.jsx(le,{name:"delayMessage",label:e("evoai.form.delayMessage.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(le,{name:"unknownMessage",label:e("evoai.form.unknownMessage.label"),children:i.jsx(ne,{})}),i.jsx(Pe,{name:"listeningFromMe",label:e("evoai.form.listeningFromMe.label"),reverse:!0}),i.jsx(Pe,{name:"stopBotFromMe",label:e("evoai.form.stopBotFromMe.label"),reverse:!0}),i.jsx(Pe,{name:"keepOpen",label:e("evoai.form.keepOpen.label"),reverse:!0}),i.jsx(le,{name:"debounceTime",label:e("evoai.form.debounceTime.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(Pe,{name:"splitMessages",label:e("evoai.form.splitMessages.label"),reverse:!0}),i.jsx(le,{name:"timePerChar",label:e("evoai.form.timePerChar.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(Da,{name:"ignoreJids",label:e("evoai.form.ignoreJids.label"),placeholder:e("evoai.form.ignoreJids.placeholder")})]})}),i.jsx(Yt,{children:i.jsx(se,{type:"submit",children:e("evoai.button.save")})})]})})]})]})}const Ite=e=>["evoai","fetchSessions",JSON.stringify(e)],Ate=async({evoaiId:e,instanceName:t})=>(await Ee.get(`/evoai/fetchSessions/${e}/${t}`)).data,Dte=e=>{const{evoaiId:t,instanceName:n,...r}=e;return mt({...r,queryKey:Ite({evoaiId:t,instanceName:n}),queryFn:()=>Ate({evoaiId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0),staleTime:1e3*10})};function jI({evoaiId:e}){const{t}=Ve(),{instance:n}=ct(),{changeStatusEvoai:r}=xg(),[s,o]=y.useState([]),{data:l,refetch:u}=Dte({evoaiId:e,instanceName:n?.name}),[d,f]=y.useState(!1),[h,m]=y.useState("");function g(){u()}const x=async(w,C)=>{try{if(!n)return;await r({instanceName:n.name,token:n.token,remoteJid:w,status:C}),me.success(t("evoai.toast.success.status")),g()}catch(k){console.error("Error:",k),me.error(`Error : ${k?.response?.data?.response?.message}`)}},b=[{accessorKey:"remoteJid",header:()=>i.jsx("div",{className:"text-center",children:t("evoai.sessions.table.remoteJid")}),cell:({row:w})=>i.jsx("div",{children:w.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>i.jsx("div",{className:"text-center",children:t("evoai.sessions.table.pushName")}),cell:({row:w})=>i.jsx("div",{children:w.getValue("pushName")})},{accessorKey:"sessionId",header:()=>i.jsx("div",{className:"text-center",children:t("evoai.sessions.table.sessionId")}),cell:({row:w})=>i.jsx("div",{children:w.getValue("sessionId")})},{accessorKey:"status",header:()=>i.jsx("div",{className:"text-center",children:t("evoai.sessions.table.status")}),cell:({row:w})=>i.jsx("div",{children:w.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:w})=>{const C=w.original;return i.jsxs(Kr,{children:[i.jsx(Wr,{asChild:!0,children:i.jsxs(se,{variant:"ghost",className:"h-8 w-8 p-0",children:[i.jsx("span",{className:"sr-only",children:t("evoai.sessions.table.actions.title")}),i.jsx(Pa,{className:"h-4 w-4"})]})}),i.jsxs(hr,{align:"end",children:[i.jsx(Ao,{children:t("evoai.sessions.table.actions.title")}),i.jsx(Xs,{}),C.status!=="opened"&&i.jsxs(wt,{onClick:()=>x(C.remoteJid,"opened"),children:[i.jsx(Fi,{className:"mr-2 h-4 w-4"}),t("evoai.sessions.table.actions.open")]}),C.status!=="paused"&&C.status!=="closed"&&i.jsxs(wt,{onClick:()=>x(C.remoteJid,"paused"),children:[i.jsx(Di,{className:"mr-2 h-4 w-4"}),t("evoai.sessions.table.actions.pause")]}),C.status!=="closed"&&i.jsxs(wt,{onClick:()=>x(C.remoteJid,"closed"),children:[i.jsx(Oi,{className:"mr-2 h-4 w-4"}),t("evoai.sessions.table.actions.close")]}),i.jsxs(wt,{onClick:()=>x(C.remoteJid,"delete"),children:[i.jsx(Ii,{className:"mr-2 h-4 w-4"}),t("evoai.sessions.table.actions.delete")]})]})]})}}];return i.jsxs(Pt,{open:d,onOpenChange:f,children:[i.jsx(Bt,{asChild:!0,children:i.jsxs(se,{variant:"secondary",size:"sm",children:[i.jsx(Ai,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:t("evoai.sessions.label")})]})}),i.jsxs(Nt,{className:"overflow-y-auto sm:max-w-[950px]",onCloseAutoFocus:g,children:[i.jsx(Mt,{children:i.jsx(zt,{children:t("evoai.sessions.label")})}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between gap-6 p-5",children:[i.jsx(ne,{placeholder:t("evoai.sessions.search"),value:h,onChange:w=>m(w.target.value)}),i.jsx(se,{variant:"outline",onClick:g,size:"icon",children:i.jsx(Li,{})})]}),i.jsx($a,{columns:b,data:l??[],onSortingChange:o,state:{sorting:s,globalFilter:h},onGlobalFilterChange:m,enableGlobalFilter:!0,noResultsMessage:t("evoai.sessions.table.none")})]})]})]})}const Fte=P.object({enabled:P.boolean(),description:P.string(),agentUrl:P.string(),apiKey:P.string(),triggerType:P.string(),triggerOperator:P.string().optional(),triggerValue:P.string().optional(),expire:P.coerce.number().optional(),keywordFinish:P.string().optional(),delayMessage:P.coerce.number().optional(),unknownMessage:P.string().optional(),listeningFromMe:P.boolean().optional(),stopBotFromMe:P.boolean().optional(),keepOpen:P.boolean().optional(),debounceTime:P.coerce.number().optional(),splitMessages:P.boolean().optional(),timePerChar:P.coerce.number().optional()});function TI({initialData:e,onSubmit:t,handleDelete:n,evoaiId:r,isModal:s=!1,isLoading:o=!1,openDeletionDialog:l=!1,setOpenDeletionDialog:u=()=>{}}){const{t:d}=Ve(),f=on({resolver:an(Fte),defaultValues:e||{enabled:!0,description:"",agentUrl:"",apiKey:"",triggerType:"keyword",triggerOperator:"contains",triggerValue:"",expire:0,keywordFinish:"",delayMessage:0,unknownMessage:"",listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0,splitMessages:!1,timePerChar:0}}),h=f.watch("triggerType");return i.jsx(Gn,{...f,children:i.jsxs("form",{onSubmit:f.handleSubmit(t),className:"w-full space-y-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx(Pe,{name:"enabled",label:d("evoai.form.enabled.label"),reverse:!0}),i.jsx(le,{name:"description",label:d("evoai.form.description.label"),children:i.jsx(ne,{})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:d("evoai.form.evoaiSettings.label")}),i.jsx($t,{})]}),i.jsx(le,{name:"agentUrl",label:d("evoai.form.agentUrl.label"),required:!0,children:i.jsx(ne,{})}),i.jsx(le,{name:"apiKey",label:d("evoai.form.apiKey.label"),className:"flex-1",children:i.jsx(ne,{type:"password"})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:d("evoai.form.triggerSettings.label")}),i.jsx($t,{})]}),i.jsx(Jt,{name:"triggerType",label:d("evoai.form.triggerType.label"),options:[{label:d("evoai.form.triggerType.keyword"),value:"keyword"},{label:d("evoai.form.triggerType.all"),value:"all"},{label:d("evoai.form.triggerType.advanced"),value:"advanced"},{label:d("evoai.form.triggerType.none"),value:"none"}]}),h==="keyword"&&i.jsxs(i.Fragment,{children:[i.jsx(Jt,{name:"triggerOperator",label:d("evoai.form.triggerOperator.label"),options:[{label:d("evoai.form.triggerOperator.contains"),value:"contains"},{label:d("evoai.form.triggerOperator.equals"),value:"equals"},{label:d("evoai.form.triggerOperator.startsWith"),value:"startsWith"},{label:d("evoai.form.triggerOperator.endsWith"),value:"endsWith"},{label:d("evoai.form.triggerOperator.regex"),value:"regex"}]}),i.jsx(le,{name:"triggerValue",label:d("evoai.form.triggerValue.label"),children:i.jsx(ne,{})})]}),h==="advanced"&&i.jsx(le,{name:"triggerValue",label:d("evoai.form.triggerConditions.label"),children:i.jsx(ne,{})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:d("evoai.form.generalSettings.label")}),i.jsx($t,{})]}),i.jsx(le,{name:"expire",label:d("evoai.form.expire.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(le,{name:"keywordFinish",label:d("evoai.form.keywordFinish.label"),children:i.jsx(ne,{})}),i.jsx(le,{name:"delayMessage",label:d("evoai.form.delayMessage.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(le,{name:"unknownMessage",label:d("evoai.form.unknownMessage.label"),children:i.jsx(ne,{})}),i.jsx(Pe,{name:"listeningFromMe",label:d("evoai.form.listeningFromMe.label"),reverse:!0}),i.jsx(Pe,{name:"stopBotFromMe",label:d("evoai.form.stopBotFromMe.label"),reverse:!0}),i.jsx(Pe,{name:"keepOpen",label:d("evoai.form.keepOpen.label"),reverse:!0}),i.jsx(le,{name:"debounceTime",label:d("evoai.form.debounceTime.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(Pe,{name:"splitMessages",label:d("evoai.form.splitMessages.label"),reverse:!0}),f.watch("splitMessages")&&i.jsx(le,{name:"timePerChar",label:d("evoai.form.timePerChar.label"),children:i.jsx(ne,{type:"number"})})]}),s&&i.jsx(Yt,{children:i.jsx(se,{disabled:o,type:"submit",children:d(o?"evoai.button.saving":"evoai.button.save")})}),!s&&i.jsxs("div",{children:[i.jsx(jI,{evoaiId:r}),i.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[i.jsxs(Pt,{open:l,onOpenChange:u,children:[i.jsx(Bt,{asChild:!0,children:i.jsx(se,{variant:"destructive",size:"sm",children:d("evoai.button.delete")})}),i.jsx(Nt,{children:i.jsxs(Mt,{children:[i.jsx(zt,{children:d("modal.delete.title")}),i.jsx(eo,{children:d("modal.delete.messageSingle")}),i.jsxs(Yt,{children:[i.jsx(se,{size:"sm",variant:"outline",onClick:()=>u(!1),children:d("button.cancel")}),i.jsx(se,{variant:"destructive",onClick:n,children:d("button.delete")})]})]})})]}),i.jsx(se,{disabled:o,type:"submit",children:d(o?"evoai.button.saving":"evoai.button.update")})]})]})]})})}function Lte({resetTable:e}){const{t}=Ve(),{instance:n}=ct(),[r,s]=y.useState(!1),[o,l]=y.useState(!1),{createEvoai:u}=xg(),d=async f=>{try{if(!n||!n.name)throw new Error("instance not found");s(!0);const h={enabled:f.enabled,description:f.description,agentUrl:f.agentUrl,apiKey:f.apiKey,triggerType:f.triggerType,triggerOperator:f.triggerOperator||"",triggerValue:f.triggerValue||"",expire:f.expire||0,keywordFinish:f.keywordFinish||"",delayMessage:f.delayMessage||0,unknownMessage:f.unknownMessage||"",listeningFromMe:f.listeningFromMe||!1,stopBotFromMe:f.stopBotFromMe||!1,keepOpen:f.keepOpen||!1,debounceTime:f.debounceTime||0,splitMessages:f.splitMessages||!1,timePerChar:f.timePerChar||0};await u({instanceName:n.name,token:n.token,data:h}),me.success(t("evoai.toast.success.create")),l(!1),e()}catch(h){console.error("Error:",h),me.error(`Error: ${h?.response?.data?.response?.message}`)}finally{s(!1)}};return i.jsxs(Pt,{open:o,onOpenChange:l,children:[i.jsx(Bt,{asChild:!0,children:i.jsxs(se,{size:"sm",children:[i.jsx(cs,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:t("evoai.button.create")})]})}),i.jsxs(Nt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[i.jsx(Mt,{children:i.jsx(zt,{children:t("evoai.form.title")})}),i.jsx(TI,{onSubmit:d,isModal:!0,isLoading:r})]})]})}const $te=e=>["evoai","getEvoai",JSON.stringify(e)],Bte=async({evoaiId:e,instanceName:t})=>(await Ee.get(`/evoai/fetch/${e}/${t}`)).data,zte=e=>{const{evoaiId:t,instanceName:n,...r}=e;return mt({...r,queryKey:$te({evoaiId:t,instanceName:n}),queryFn:()=>Bte({evoaiId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0)})};function Ute({evoaiId:e,resetTable:t}){const{t:n}=Ve(),{instance:r}=ct(),s=dn(),[o,l]=y.useState(!1),{deleteEvoai:u,updateEvoai:d}=xg(),{data:f,isLoading:h}=zte({evoaiId:e,instanceName:r?.name}),m=y.useMemo(()=>({enabled:!!f?.enabled,description:f?.description??"",agentUrl:f?.agentUrl??"",apiKey:f?.apiKey??"",triggerType:f?.triggerType??"",triggerOperator:f?.triggerOperator??"",triggerValue:f?.triggerValue??"",expire:f?.expire??0,keywordFinish:f?.keywordFinish??"",delayMessage:f?.delayMessage??0,unknownMessage:f?.unknownMessage??"",listeningFromMe:!!f?.listeningFromMe,stopBotFromMe:!!f?.stopBotFromMe,keepOpen:!!f?.keepOpen,debounceTime:f?.debounceTime??0,splitMessages:f?.splitMessages??!1,timePerChar:f?.timePerChar??0}),[f?.agentUrl,f?.apiKey,f?.debounceTime,f?.delayMessage,f?.description,f?.enabled,f?.expire,f?.keepOpen,f?.keywordFinish,f?.listeningFromMe,f?.stopBotFromMe,f?.triggerOperator,f?.triggerType,f?.triggerValue,f?.unknownMessage,f?.splitMessages,f?.timePerChar]),g=async b=>{try{if(r&&r.name&&e){const w={enabled:b.enabled,description:b.description,agentUrl:b.agentUrl,apiKey:b.apiKey,triggerType:b.triggerType,triggerOperator:b.triggerOperator||"",triggerValue:b.triggerValue||"",expire:b.expire||0,keywordFinish:b.keywordFinish||"",delayMessage:b.delayMessage||1e3,unknownMessage:b.unknownMessage||"",listeningFromMe:b.listeningFromMe||!1,stopBotFromMe:b.stopBotFromMe||!1,keepOpen:b.keepOpen||!1,debounceTime:b.debounceTime||0,splitMessages:b.splitMessages||!1,timePerChar:b.timePerChar||0};await d({instanceName:r.name,evoaiId:e,data:w}),me.success(n("evoai.toast.success.update")),t(),s(`/manager/instance/${r.id}/evoai/${e}`)}else console.error("Token not found")}catch(w){console.error("Error:",w),me.error(`Error: ${w?.response?.data?.response?.message}`)}},x=async()=>{try{r&&r.name&&e?(await u({instanceName:r.name,evoaiId:e}),me.success(n("evoai.toast.success.delete")),l(!1),t(),s(`/manager/instance/${r.id}/evoai`)):console.error("instance not found")}catch(b){console.error("Erro ao excluir evoai:",b)}};return h?i.jsx(On,{}):i.jsx("div",{className:"m-4",children:i.jsx(TI,{initialData:m,onSubmit:g,evoaiId:e,handleDelete:x,isModal:!1,isLoading:h,openDeletionDialog:o,setOpenDeletionDialog:l})})}function Ck(){const{t:e}=Ve(),t=zo("(min-width: 768px)"),{instance:n}=ct(),{evoaiId:r}=ls(),{data:s,refetch:o,isLoading:l}=kI({instanceName:n?.name}),u=dn(),d=h=>{n&&u(`/manager/instance/${n.id}/evoai/${h}`)},f=()=>{o()};return i.jsxs("main",{className:"pt-5",children:[i.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[i.jsx("h3",{className:"text-lg font-medium",children:e("evoai.title")}),i.jsxs("div",{className:"flex items-center justify-end gap-2",children:[i.jsx(jI,{}),i.jsx(Ote,{}),i.jsx(Lte,{resetTable:f})]})]}),i.jsx($t,{className:"my-4"}),i.jsxs($o,{direction:t?"horizontal":"vertical",children:[i.jsx(Hn,{defaultSize:35,className:"pr-4",children:i.jsx("div",{className:"flex flex-col gap-3",children:l?i.jsx(On,{}):i.jsx(i.Fragment,{children:s&&s.length>0&&Array.isArray(s)?s.map(h=>i.jsx(se,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>d(`${h.id}`),variant:r===h.id?"secondary":"outline",children:i.jsx("h4",{className:"text-base",children:h.description||h.id})},h.id)):i.jsx(se,{variant:"link",children:e("evoai.table.none")})})})}),r&&i.jsxs(i.Fragment,{children:[i.jsx(Bo,{withHandle:!0,className:"border border-border"}),i.jsx(Hn,{children:i.jsx(Ute,{evoaiId:r,resetTable:f})})]})]})]})}const Vte=e=>["evolutionBot","findEvolutionBot",JSON.stringify(e)],Hte=async({instanceName:e,token:t})=>(await Ee.get(`/evolutionBot/find/${e}`,{headers:{apiKey:t}})).data,NI=e=>{const{instanceName:t,token:n,...r}=e;return mt({...r,queryKey:Vte({instanceName:t}),queryFn:()=>Hte({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},qte=e=>["evolutionBot","fetchDefaultSettings",JSON.stringify(e)],Kte=async({instanceName:e,token:t})=>{const n=await Ee.get(`/evolutionBot/fetchSettings/${e}`,{headers:{apiKey:t}});return Array.isArray(n.data)?n.data[0]:n.data},Wte=e=>{const{instanceName:t,token:n,...r}=e;return mt({...r,queryKey:qte({instanceName:t}),queryFn:()=>Kte({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},Gte=async({instanceName:e,token:t,data:n})=>(await Ee.post(`/evolutionBot/create/${e}`,n,{headers:{apikey:t}})).data,Jte=async({instanceName:e,token:t,evolutionBotId:n,data:r})=>(await Ee.put(`/evolutionBot/update/${n}/${e}`,r,{headers:{apikey:t}})).data,Qte=async({instanceName:e,evolutionBotId:t})=>(await Ee.delete(`/evolutionBot/delete/${t}/${e}`)).data,Zte=async({instanceName:e,token:t,data:n})=>(await Ee.post(`/evolutionBot/settings/${e}`,n,{headers:{apikey:t}})).data,Yte=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await Ee.post(`/evolutionBot/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function wg(){const e=nt(Zte,{invalidateKeys:[["evolutionBot","fetchDefaultSettings"]]}),t=nt(Yte,{invalidateKeys:[["evolutionBot","getEvolutionBot"],["evolutionBot","fetchSessions"]]}),n=nt(Qte,{invalidateKeys:[["evolutionBot","getEvolutionBot"],["evolutionBot","findEvolutionBot"],["evolutionBot","fetchSessions"]]}),r=nt(Jte,{invalidateKeys:[["evolutionBot","getEvolutionBot"],["evolutionBot","findEvolutionBot"],["evolutionBot","fetchSessions"]]}),s=nt(Gte,{invalidateKeys:[["evolutionBot","findEvolutionBot"]]});return{setDefaultSettingsEvolutionBot:e,changeStatusEvolutionBot:t,deleteEvolutionBot:n,updateEvolutionBot:r,createEvolutionBot:s}}const Xte=P.object({expire:P.string(),keywordFinish:P.string(),delayMessage:P.string(),unknownMessage:P.string(),listeningFromMe:P.boolean(),stopBotFromMe:P.boolean(),keepOpen:P.boolean(),debounceTime:P.string(),ignoreJids:P.array(P.string()).default([]),botIdFallback:P.union([P.null(),P.string()]).optional(),splitMessages:P.boolean(),timePerChar:P.string()});function ene(){const{t:e}=Ve(),{instance:t}=ct(),[n,r]=y.useState(!1),{data:s,refetch:o}=Wte({instanceName:t?.name,enabled:n}),{data:l,refetch:u}=NI({instanceName:t?.name,enabled:n}),{setDefaultSettingsEvolutionBot:d}=wg(),f=on({resolver:an(Xte),defaultValues:{expire:"0",keywordFinish:e("evolutionBot.form.examples.keywordFinish"),delayMessage:"1000",unknownMessage:e("evolutionBot.form.examples.unknownMessage"),listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:"0",ignoreJids:[],botIdFallback:void 0,splitMessages:!1,timePerChar:"0"}});y.useEffect(()=>{s&&f.reset({expire:s?.expire?s.expire.toString():"0",keywordFinish:s.keywordFinish,delayMessage:s.delayMessage?s.delayMessage.toString():"0",unknownMessage:s.unknownMessage,listeningFromMe:s.listeningFromMe,stopBotFromMe:s.stopBotFromMe,keepOpen:s.keepOpen,debounceTime:s.debounceTime?s.debounceTime.toString():"0",ignoreJids:s.ignoreJids,botIdFallback:s.botIdFallback,splitMessages:s.splitMessages,timePerChar:s.timePerChar?s.timePerChar.toString():"0"})},[s]);const h=async g=>{try{if(!t||!t.name)throw new Error("instance not found.");const x={expire:parseInt(g.expire),keywordFinish:g.keywordFinish,delayMessage:parseInt(g.delayMessage),unknownMessage:g.unknownMessage,listeningFromMe:g.listeningFromMe,stopBotFromMe:g.stopBotFromMe,keepOpen:g.keepOpen,debounceTime:parseInt(g.debounceTime),botIdFallback:g.botIdFallback||void 0,ignoreJids:g.ignoreJids,splitMessages:g.splitMessages,timePerChar:parseInt(g.timePerChar)};await d({instanceName:t.name,token:t.token,data:x}),me.success(e("evolutionBot.toast.defaultSettings.success"))}catch(x){console.error("Error:",x),me.error(`Error: ${x?.response?.data?.response?.message}`)}};function m(){o(),u()}return i.jsxs(Pt,{open:n,onOpenChange:r,children:[i.jsx(Bt,{asChild:!0,children:i.jsxs(se,{variant:"secondary",size:"sm",children:[i.jsx(Oo,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:e("evolutionBot.defaultSettings")})]})}),i.jsxs(Nt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:m,children:[i.jsx(Mt,{children:i.jsx(zt,{children:e("evolutionBot.defaultSettings")})}),i.jsx(Gn,{...f,children:i.jsxs("form",{className:"w-full space-y-6",onSubmit:f.handleSubmit(h),children:[i.jsx("div",{children:i.jsxs("div",{className:"space-y-4",children:[i.jsx(Jt,{name:"botIdFallback",label:e("evolutionBot.form.botIdFallback.label"),options:l?.filter(g=>!!g.id).map(g=>({label:g.description,value:g.id}))??[]}),i.jsx(le,{name:"expire",label:e("evolutionBot.form.expire.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(le,{name:"keywordFinish",label:e("evolutionBot.form.keywordFinish.label"),children:i.jsx(ne,{})}),i.jsx(le,{name:"delayMessage",label:e("evolutionBot.form.delayMessage.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(le,{name:"unknownMessage",label:e("evolutionBot.form.unknownMessage.label"),children:i.jsx(ne,{})}),i.jsx(Pe,{name:"listeningFromMe",label:e("evolutionBot.form.listeningFromMe.label"),reverse:!0}),i.jsx(Pe,{name:"stopBotFromMe",label:e("evolutionBot.form.stopBotFromMe.label"),reverse:!0}),i.jsx(Pe,{name:"keepOpen",label:e("evolutionBot.form.keepOpen.label"),reverse:!0}),i.jsx(le,{name:"debounceTime",label:e("evolutionBot.form.debounceTime.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(Pe,{name:"splitMessages",label:e("evolutionBot.form.splitMessages.label"),reverse:!0}),f.watch("splitMessages")&&i.jsx(le,{name:"timePerChar",label:e("evolutionBot.form.timePerChar.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(Da,{name:"ignoreJids",label:e("evolutionBot.form.ignoreJids.label"),placeholder:e("evolutionBot.form.ignoreJids.placeholder")})]})}),i.jsx(Yt,{children:i.jsx(se,{type:"submit",children:e("evolutionBot.button.save")})})]})})]})]})}const tne=e=>["evolutionBot","fetchSessions",JSON.stringify(e)],nne=async({instanceName:e,evolutionBotId:t,token:n})=>(await Ee.get(`/evolutionBot/fetchSessions/${t}/${e}`,{headers:{apiKey:n}})).data,rne=e=>{const{instanceName:t,token:n,evolutionBotId:r,...s}=e;return mt({...s,queryKey:tne({instanceName:t}),queryFn:()=>nne({instanceName:t,token:n,evolutionBotId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function MI({evolutionBotId:e}){const{t}=Ve(),{instance:n}=ct(),[r,s]=y.useState([]),[o,l]=y.useState(!1),[u,d]=y.useState(""),{data:f,refetch:h}=rne({instanceName:n?.name,evolutionBotId:e,enabled:o}),{changeStatusEvolutionBot:m}=wg();function g(){h()}const x=async(w,C)=>{try{if(!n)return;await m({instanceName:n.name,token:n.token,remoteJid:w,status:C}),me.success(t("evolutionBot.toast.success.status")),g()}catch(k){console.error("Error:",k),me.error(`Error : ${k?.response?.data?.response?.message}`)}},b=[{accessorKey:"remoteJid",header:()=>i.jsx("div",{className:"text-center",children:t("evolutionBot.sessions.table.remoteJid")}),cell:({row:w})=>i.jsx("div",{children:w.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>i.jsx("div",{className:"text-center",children:t("evolutionBot.sessions.table.pushName")}),cell:({row:w})=>i.jsx("div",{children:w.getValue("pushName")})},{accessorKey:"sessionId",header:()=>i.jsx("div",{className:"text-center",children:t("evolutionBot.sessions.table.sessionId")}),cell:({row:w})=>i.jsx("div",{children:w.getValue("sessionId")})},{accessorKey:"status",header:()=>i.jsx("div",{className:"text-center",children:t("evolutionBot.sessions.table.status")}),cell:({row:w})=>i.jsx("div",{children:w.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:w})=>{const C=w.original;return i.jsxs(Kr,{children:[i.jsx(Wr,{asChild:!0,children:i.jsxs(se,{variant:"ghost",className:"h-8 w-8 p-0",children:[i.jsx("span",{className:"sr-only",children:t("evolutionBot.sessions.table.actions.title")}),i.jsx(Pa,{className:"h-4 w-4"})]})}),i.jsxs(hr,{align:"end",children:[i.jsx(Ao,{children:t("evolutionBot.sessions.table.actions.title")}),i.jsx(Xs,{}),C.status!=="opened"&&i.jsxs(wt,{onClick:()=>x(C.remoteJid,"opened"),children:[i.jsx(Fi,{className:"mr-2 h-4 w-4"}),t("evolutionBot.sessions.table.actions.open")]}),C.status!=="paused"&&C.status!=="closed"&&i.jsxs(wt,{onClick:()=>x(C.remoteJid,"paused"),children:[i.jsx(Di,{className:"mr-2 h-4 w-4"}),t("evolutionBot.sessions.table.actions.pause")]}),C.status!=="closed"&&i.jsxs(wt,{onClick:()=>x(C.remoteJid,"closed"),children:[i.jsx(Oi,{className:"mr-2 h-4 w-4"}),t("evolutionBot.sessions.table.actions.close")]}),i.jsxs(wt,{onClick:()=>x(C.remoteJid,"delete"),children:[i.jsx(Ii,{className:"mr-2 h-4 w-4"}),t("evolutionBot.sessions.table.actions.delete")]})]})]})}}];return i.jsxs(Pt,{open:o,onOpenChange:l,children:[i.jsx(Bt,{asChild:!0,children:i.jsxs(se,{variant:"secondary",size:"sm",children:[i.jsx(Ai,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:t("evolutionBot.sessions.label")})]})}),i.jsxs(Nt,{className:"overflow-y-auto sm:max-w-[950px]",onCloseAutoFocus:g,children:[i.jsx(Mt,{children:i.jsx(zt,{children:t("evolutionBot.sessions.label")})}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between gap-6 p-5",children:[i.jsx(ne,{placeholder:t("evolutionBot.sessions.search"),value:u,onChange:w=>d(w.target.value)}),i.jsx(se,{variant:"outline",onClick:g,size:"icon",children:i.jsx(Li,{})})]}),i.jsx($a,{columns:b,data:f??[],onSortingChange:s,state:{sorting:r,globalFilter:u},onGlobalFilterChange:d,enableGlobalFilter:!0,noResultsMessage:t("evolutionBot.sessions.table.none")})]})]})]})}const sne=P.object({enabled:P.boolean(),description:P.string(),apiUrl:P.string(),apiKey:P.string().optional(),triggerType:P.string(),triggerOperator:P.string().optional(),triggerValue:P.string().optional(),expire:P.coerce.number().optional(),keywordFinish:P.string().optional(),delayMessage:P.coerce.number().optional(),unknownMessage:P.string().optional(),listeningFromMe:P.boolean().optional(),stopBotFromMe:P.boolean().optional(),keepOpen:P.boolean().optional(),debounceTime:P.coerce.number().optional(),splitMessages:P.boolean().optional(),timePerChar:P.coerce.number().optional()});function _I({initialData:e,onSubmit:t,handleDelete:n,evolutionBotId:r,isModal:s=!1,isLoading:o=!1,openDeletionDialog:l=!1,setOpenDeletionDialog:u=()=>{}}){const{t:d}=Ve(),f=on({resolver:an(sne),defaultValues:e||{enabled:!0,description:"",apiUrl:"",apiKey:"",triggerType:"keyword",triggerOperator:"contains",triggerValue:"",expire:0,keywordFinish:"",delayMessage:0,unknownMessage:"",listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0,splitMessages:!1,timePerChar:0}}),h=f.watch("triggerType");return i.jsx(Gn,{...f,children:i.jsxs("form",{onSubmit:f.handleSubmit(t),className:"w-full space-y-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx(Pe,{name:"enabled",label:d("evolutionBot.form.enabled.label"),reverse:!0}),i.jsx(le,{name:"description",label:d("evolutionBot.form.description.label"),required:!0,children:i.jsx(ne,{})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:d("evolutionBot.form.evolutionBotSettings.label")}),i.jsx($t,{})]}),i.jsx(le,{name:"apiUrl",label:d("evolutionBot.form.apiUrl.label"),required:!0,children:i.jsx(ne,{})}),i.jsx(le,{name:"apiKey",label:d("evolutionBot.form.apiKey.label"),children:i.jsx(ne,{type:"password"})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:d("evolutionBot.form.triggerSettings.label")}),i.jsx($t,{})]}),i.jsx(Jt,{name:"triggerType",label:d("evolutionBot.form.triggerType.label"),options:[{label:d("evolutionBot.form.triggerType.keyword"),value:"keyword"},{label:d("evolutionBot.form.triggerType.all"),value:"all"},{label:d("evolutionBot.form.triggerType.advanced"),value:"advanced"},{label:d("evolutionBot.form.triggerType.none"),value:"none"}]}),h==="keyword"&&i.jsxs(i.Fragment,{children:[i.jsx(Jt,{name:"triggerOperator",label:d("evolutionBot.form.triggerOperator.label"),options:[{label:d("evolutionBot.form.triggerOperator.contains"),value:"contains"},{label:d("evolutionBot.form.triggerOperator.equals"),value:"equals"},{label:d("evolutionBot.form.triggerOperator.startsWith"),value:"startsWith"},{label:d("evolutionBot.form.triggerOperator.endsWith"),value:"endsWith"},{label:d("evolutionBot.form.triggerOperator.regex"),value:"regex"}]}),i.jsx(le,{name:"triggerValue",label:d("evolutionBot.form.triggerValue.label"),children:i.jsx(ne,{})})]}),h==="advanced"&&i.jsx(le,{name:"triggerValue",label:d("evolutionBot.form.triggerConditions.label"),children:i.jsx(ne,{})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:d("evolutionBot.form.generalSettings.label")}),i.jsx($t,{})]}),i.jsx(le,{name:"expire",label:d("evolutionBot.form.expire.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(le,{name:"keywordFinish",label:d("evolutionBot.form.keywordFinish.label"),children:i.jsx(ne,{})}),i.jsx(le,{name:"delayMessage",label:d("evolutionBot.form.delayMessage.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(le,{name:"unknownMessage",label:d("evolutionBot.form.unknownMessage.label"),children:i.jsx(ne,{})}),i.jsx(Pe,{name:"listeningFromMe",label:d("evolutionBot.form.listeningFromMe.label"),reverse:!0}),i.jsx(Pe,{name:"stopBotFromMe",label:d("evolutionBot.form.stopBotFromMe.label"),reverse:!0}),i.jsx(Pe,{name:"keepOpen",label:d("evolutionBot.form.keepOpen.label"),reverse:!0}),i.jsx(le,{name:"debounceTime",label:d("evolutionBot.form.debounceTime.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(Pe,{name:"splitMessages",label:d("evolutionBot.form.splitMessages.label"),reverse:!0}),f.watch("splitMessages")&&i.jsx(le,{name:"timePerChar",label:d("evolutionBot.form.timePerChar.label"),children:i.jsx(ne,{type:"number"})})]}),s&&i.jsx(Yt,{children:i.jsx(se,{disabled:o,type:"submit",children:d(o?"evolutionBot.button.saving":"evolutionBot.button.save")})}),!s&&i.jsxs("div",{children:[i.jsx(MI,{evolutionBotId:r}),i.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[i.jsxs(Pt,{open:l,onOpenChange:u,children:[i.jsx(Bt,{asChild:!0,children:i.jsx(se,{variant:"destructive",size:"sm",children:d("dify.button.delete")})}),i.jsx(Nt,{children:i.jsxs(Mt,{children:[i.jsx(zt,{children:d("modal.delete.title")}),i.jsx(eo,{children:d("modal.delete.messageSingle")}),i.jsxs(Yt,{children:[i.jsx(se,{size:"sm",variant:"outline",onClick:()=>u(!1),children:d("button.cancel")}),i.jsx(se,{variant:"destructive",onClick:n,children:d("button.delete")})]})]})})]}),i.jsx(se,{disabled:o,type:"submit",children:d(o?"evolutionBot.button.saving":"evolutionBot.button.update")})]})]})]})})}function one({resetTable:e}){const{t}=Ve(),{instance:n}=ct(),[r,s]=y.useState(!1),[o,l]=y.useState(!1),{createEvolutionBot:u}=wg(),d=async f=>{try{if(!n||!n.name)throw new Error("instance not found");s(!0);const h={enabled:f.enabled,description:f.description,apiUrl:f.apiUrl,apiKey:f.apiKey,triggerType:f.triggerType,triggerOperator:f.triggerOperator||"",triggerValue:f.triggerValue||"",expire:f.expire||0,keywordFinish:f.keywordFinish||"",delayMessage:f.delayMessage||0,unknownMessage:f.unknownMessage||"",listeningFromMe:f.listeningFromMe||!1,stopBotFromMe:f.stopBotFromMe||!1,keepOpen:f.keepOpen||!1,debounceTime:f.debounceTime||0,splitMessages:f.splitMessages||!1,timePerChar:f.timePerChar?f.timePerChar:0};await u({instanceName:n.name,token:n.token,data:h}),me.success(t("evolutionBot.toast.success.create")),l(!1),e()}catch(h){console.error("Error:",h),me.error(`Error: ${h?.response?.data?.response?.message}`)}finally{s(!1)}};return i.jsxs(Pt,{open:o,onOpenChange:l,children:[i.jsx(Bt,{asChild:!0,children:i.jsxs(se,{size:"sm",children:[i.jsx(cs,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:t("evolutionBot.button.create")})]})}),i.jsxs(Nt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[i.jsx(Mt,{children:i.jsx(zt,{children:t("evolutionBot.form.title")})}),i.jsx(_I,{onSubmit:d,isModal:!0,isLoading:r})]})]})}const ane=e=>["evolutionBot","getEvolutionBot",JSON.stringify(e)],ine=async({instanceName:e,token:t,evolutionBotId:n})=>{const r=await Ee.get(`/evolutionBot/fetch/${n}/${e}`,{headers:{apiKey:t}});return Array.isArray(r.data)?r.data[0]:r.data},lne=e=>{const{instanceName:t,token:n,evolutionBotId:r,...s}=e;return mt({...s,queryKey:ane({instanceName:t}),queryFn:()=>ine({instanceName:t,token:n,evolutionBotId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function cne({evolutionBotId:e,resetTable:t}){const{t:n}=Ve(),{instance:r}=ct(),s=dn(),[o,l]=y.useState(!1),{deleteEvolutionBot:u,updateEvolutionBot:d}=wg(),{data:f,isLoading:h}=lne({instanceName:r?.name,evolutionBotId:e}),m=y.useMemo(()=>({enabled:f?.enabled??!0,description:f?.description??"",apiUrl:f?.apiUrl??"",apiKey:f?.apiKey??"",triggerType:f?.triggerType??"",triggerOperator:f?.triggerOperator??"",triggerValue:f?.triggerValue,expire:f?.expire??0,keywordFinish:f?.keywordFinish,delayMessage:f?.delayMessage??0,unknownMessage:f?.unknownMessage,listeningFromMe:f?.listeningFromMe,stopBotFromMe:!!f?.stopBotFromMe,keepOpen:!!f?.keepOpen,debounceTime:f?.debounceTime??0,splitMessages:f?.splitMessages??!1,timePerChar:f?.timePerChar?f?.timePerChar:0}),[f?.apiKey,f?.apiUrl,f?.debounceTime,f?.delayMessage,f?.description,f?.enabled,f?.expire,f?.keepOpen,f?.keywordFinish,f?.listeningFromMe,f?.stopBotFromMe,f?.triggerOperator,f?.triggerType,f?.triggerValue,f?.unknownMessage,f?.splitMessages,f?.timePerChar]),g=async b=>{try{if(r&&r.name&&e){const w={enabled:b.enabled,description:b.description,apiUrl:b.apiUrl,apiKey:b.apiKey,triggerType:b.triggerType,triggerOperator:b.triggerOperator||"",triggerValue:b.triggerValue||"",expire:b.expire||0,keywordFinish:b.keywordFinish||"",delayMessage:b.delayMessage||1e3,unknownMessage:b.unknownMessage||"",listeningFromMe:b.listeningFromMe||!1,stopBotFromMe:b.stopBotFromMe||!1,keepOpen:b.keepOpen||!1,debounceTime:b.debounceTime||0,splitMessages:b.splitMessages||!1,timePerChar:b.timePerChar?b.timePerChar:0};await d({instanceName:r.name,evolutionBotId:e,data:w}),me.success(n("evolutionBot.toast.success.update")),t(),s(`/manager/instance/${r.id}/evolutionBot/${e}`)}else console.error("Token not found")}catch(w){console.error("Error:",w),me.error(`Error: ${w?.response?.data?.response?.message}`)}},x=async()=>{try{r&&r.name&&e?(await u({instanceName:r.name,evolutionBotId:e}),me.success(n("evolutionBot.toast.success.delete")),l(!1),t(),s(`/manager/instance/${r.id}/evolutionBot`)):console.error("instance not found")}catch(b){console.error("Erro ao excluir evolutionBot:",b)}};return h?i.jsx(On,{}):i.jsx("div",{className:"m-4",children:i.jsx(_I,{initialData:m,onSubmit:g,evolutionBotId:e,handleDelete:x,isModal:!1,openDeletionDialog:o,setOpenDeletionDialog:l})})}function Ek(){const{t:e}=Ve(),t=zo("(min-width: 768px)"),{instance:n}=ct(),{evolutionBotId:r}=ls(),{data:s,isLoading:o,refetch:l}=NI({instanceName:n?.name}),u=dn(),d=h=>{n&&u(`/manager/instance/${n.id}/evolutionBot/${h}`)},f=()=>{l()};return i.jsxs("main",{className:"pt-5",children:[i.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[i.jsx("h3",{className:"text-lg font-medium",children:e("evolutionBot.title")}),i.jsxs("div",{className:"flex items-center justify-end gap-2",children:[i.jsx(MI,{}),i.jsx(ene,{}),i.jsx(one,{resetTable:f})]})]}),i.jsx($t,{className:"my-4"}),i.jsxs($o,{direction:t?"horizontal":"vertical",children:[i.jsx(Hn,{defaultSize:35,className:"pr-4",children:i.jsx("div",{className:"flex flex-col gap-3",children:o?i.jsx(On,{}):i.jsx(i.Fragment,{children:s&&s.length>0&&Array.isArray(s)?s.map(h=>i.jsx(se,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>d(`${h.id}`),variant:r===h.id?"secondary":"outline",children:i.jsx("h4",{className:"text-base",children:h.description||h.id})},h.id)):i.jsx(se,{variant:"link",children:e("evolutionBot.table.none")})})})}),r&&i.jsxs(i.Fragment,{children:[i.jsx(Bo,{withHandle:!0,className:"border border-border"}),i.jsx(Hn,{children:i.jsx(cne,{evolutionBotId:r,resetTable:f})})]})]})]})}const une=e=>["flowise","findFlowise",JSON.stringify(e)],dne=async({instanceName:e,token:t})=>(await Ee.get(`/flowise/find/${e}`,{headers:{apiKey:t}})).data,RI=e=>{const{instanceName:t,token:n,...r}=e;return mt({...r,queryKey:une({instanceName:t}),queryFn:()=>dne({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},fne=e=>["flowise","fetchDefaultSettings",JSON.stringify(e)],pne=async({instanceName:e,token:t})=>{const n=await Ee.get(`/flowise/fetchSettings/${e}`,{headers:{apiKey:t}});return Array.isArray(n.data)?n.data[0]:n.data},hne=e=>{const{instanceName:t,token:n,...r}=e;return mt({...r,queryKey:fne({instanceName:t}),queryFn:()=>pne({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},gne=async({instanceName:e,token:t,data:n})=>(await Ee.post(`/flowise/create/${e}`,n,{headers:{apikey:t}})).data,mne=async({instanceName:e,flowiseId:t,data:n})=>(await Ee.put(`/flowise/update/${t}/${e}`,n)).data,vne=async({instanceName:e,flowiseId:t})=>(await Ee.delete(`/flowise/delete/${t}/${e}`)).data,yne=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await Ee.post(`/flowise/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data,bne=async({instanceName:e,token:t,data:n})=>(await Ee.post(`/flowise/settings/${e}`,n,{headers:{apikey:t}})).data;function Sg(){const e=nt(bne,{invalidateKeys:[["flowise","fetchDefaultSettings"]]}),t=nt(yne,{invalidateKeys:[["flowise","getFlowise"],["flowise","fetchSessions"]]}),n=nt(vne,{invalidateKeys:[["flowise","getFlowise"],["flowise","findFlowise"],["flowise","fetchSessions"]]}),r=nt(mne,{invalidateKeys:[["flowise","getFlowise"],["flowise","findFlowise"],["flowise","fetchSessions"]]}),s=nt(gne,{invalidateKeys:[["flowise","findFlowise"]]});return{setDefaultSettingsFlowise:e,changeStatusFlowise:t,deleteFlowise:n,updateFlowise:r,createFlowise:s}}const xne=P.object({expire:P.string(),keywordFinish:P.string(),delayMessage:P.string(),unknownMessage:P.string(),listeningFromMe:P.boolean(),stopBotFromMe:P.boolean(),keepOpen:P.boolean(),debounceTime:P.string(),ignoreJids:P.array(P.string()).default([]),flowiseIdFallback:P.union([P.null(),P.string()]).optional(),splitMessages:P.boolean(),timePerChar:P.string()});function wne(){const{t:e}=Ve(),{instance:t}=ct(),{setDefaultSettingsFlowise:n}=Sg(),[r,s]=y.useState(!1),{data:o,refetch:l}=hne({instanceName:t?.name,enabled:r}),{data:u,refetch:d}=RI({instanceName:t?.name,enabled:r}),f=on({resolver:an(xne),defaultValues:{expire:"0",keywordFinish:e("flowise.form.examples.keywordFinish"),delayMessage:"1000",unknownMessage:e("flowise.form.examples.unknownMessage"),listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:"0",ignoreJids:[],flowiseIdFallback:void 0,splitMessages:!1,timePerChar:"0"}});y.useEffect(()=>{o&&f.reset({expire:o?.expire?o.expire.toString():"0",keywordFinish:o.keywordFinish,delayMessage:o.delayMessage?o.delayMessage.toString():"0",unknownMessage:o.unknownMessage,listeningFromMe:o.listeningFromMe,stopBotFromMe:o.stopBotFromMe,keepOpen:o.keepOpen,debounceTime:o.debounceTime?o.debounceTime.toString():"0",ignoreJids:o.ignoreJids,flowiseIdFallback:o.flowiseIdFallback,splitMessages:o.splitMessages,timePerChar:o.timePerChar?o.timePerChar.toString():"0"})},[o]);const h=async g=>{try{if(!t||!t.name)throw new Error("instance not found.");const x={expire:parseInt(g.expire),keywordFinish:g.keywordFinish,delayMessage:parseInt(g.delayMessage),unknownMessage:g.unknownMessage,listeningFromMe:g.listeningFromMe,stopBotFromMe:g.stopBotFromMe,keepOpen:g.keepOpen,debounceTime:parseInt(g.debounceTime),flowiseIdFallback:g.flowiseIdFallback||void 0,ignoreJids:g.ignoreJids,splitMessages:g.splitMessages,timePerChar:parseInt(g.timePerChar)};await n({instanceName:t.name,token:t.token,data:x}),me.success(e("flowise.toast.defaultSettings.success"))}catch(x){console.error("Error:",x),me.error(`Error: ${x?.response?.data?.response?.message}`)}};function m(){l(),d()}return i.jsxs(Pt,{open:r,onOpenChange:s,children:[i.jsx(Bt,{asChild:!0,children:i.jsxs(se,{variant:"secondary",size:"sm",children:[i.jsx(Oo,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:e("flowise.defaultSettings")})]})}),i.jsxs(Nt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:m,children:[i.jsx(Mt,{children:i.jsx(zt,{children:e("flowise.defaultSettings")})}),i.jsx(Gn,{...f,children:i.jsxs("form",{className:"w-full space-y-6",onSubmit:f.handleSubmit(h),children:[i.jsx("div",{children:i.jsxs("div",{className:"space-y-4",children:[i.jsx(Jt,{name:"flowiseIdFallback",label:e("flowise.form.flowiseIdFallback.label"),options:u?.filter(g=>!!g.id).map(g=>({label:g.description,value:g.id}))??[]}),i.jsx(le,{name:"expire",label:e("flowise.form.expire.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(le,{name:"keywordFinish",label:e("flowise.form.keywordFinish.label"),children:i.jsx(ne,{})}),i.jsx(le,{name:"delayMessage",label:e("flowise.form.delayMessage.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(le,{name:"unknownMessage",label:e("flowise.form.unknownMessage.label"),children:i.jsx(ne,{})}),i.jsx(Pe,{name:"listeningFromMe",label:e("flowise.form.listeningFromMe.label"),reverse:!0}),i.jsx(Pe,{name:"stopBotFromMe",label:e("flowise.form.stopBotFromMe.label"),reverse:!0}),i.jsx(Pe,{name:"keepOpen",label:e("flowise.form.keepOpen.label"),reverse:!0}),i.jsx(le,{name:"debounceTime",label:e("flowise.form.debounceTime.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(Pe,{name:"splitMessages",label:e("flowise.form.splitMessages.label"),reverse:!0}),f.watch("splitMessages")&&i.jsx(le,{name:"timePerChar",label:e("flowise.form.timePerChar.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(Da,{name:"ignoreJids",label:e("flowise.form.ignoreJids.label"),placeholder:e("flowise.form.ignoreJids.placeholder")})]})}),i.jsx(Yt,{children:i.jsx(se,{type:"submit",children:e("flowise.button.save")})})]})})]})]})}const Sne=e=>["flowise","fetchSessions",JSON.stringify(e)],Cne=async({instanceName:e,flowiseId:t,token:n})=>(await Ee.get(`/flowise/fetchSessions/${t}/${e}`,{headers:{apiKey:n}})).data,Ene=e=>{const{instanceName:t,token:n,flowiseId:r,...s}=e;return mt({...s,queryKey:Sne({instanceName:t}),queryFn:()=>Cne({instanceName:t,token:n,flowiseId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function PI({flowiseId:e}){const{t}=Ve(),{instance:n}=ct(),{changeStatusFlowise:r}=Sg(),[s,o]=y.useState([]),[l,u]=y.useState(!1),[d,f]=y.useState(""),{data:h,refetch:m}=Ene({instanceName:n?.name,flowiseId:e,enabled:l});function g(){m()}const x=async(w,C)=>{try{if(!n)return;await r({instanceName:n.name,token:n.token,remoteJid:w,status:C}),me.success(t("flowise.toast.success.status")),g()}catch(k){console.error("Error:",k),me.error(`Error : ${k?.response?.data?.response?.message}`)}},b=[{accessorKey:"remoteJid",header:()=>i.jsx("div",{className:"text-center",children:t("flowise.sessions.table.remoteJid")}),cell:({row:w})=>i.jsx("div",{children:w.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>i.jsx("div",{className:"text-center",children:t("flowise.sessions.table.pushName")}),cell:({row:w})=>i.jsx("div",{children:w.getValue("pushName")})},{accessorKey:"sessionId",header:()=>i.jsx("div",{className:"text-center",children:t("flowise.sessions.table.sessionId")}),cell:({row:w})=>i.jsx("div",{children:w.getValue("sessionId")})},{accessorKey:"status",header:()=>i.jsx("div",{className:"text-center",children:t("flowise.sessions.table.status")}),cell:({row:w})=>i.jsx("div",{children:w.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:w})=>{const C=w.original;return i.jsxs(Kr,{children:[i.jsx(Wr,{asChild:!0,children:i.jsxs(se,{variant:"ghost",className:"h-8 w-8 p-0",children:[i.jsx("span",{className:"sr-only",children:t("flowise.sessions.table.actions.title")}),i.jsx(Pa,{className:"h-4 w-4"})]})}),i.jsxs(hr,{align:"end",children:[i.jsx(Ao,{children:t("flowise.sessions.table.actions.title")}),i.jsx(Xs,{}),C.status!=="opened"&&i.jsxs(wt,{onClick:()=>x(C.remoteJid,"opened"),children:[i.jsx(Fi,{className:"mr-2 h-4 w-4"}),t("flowise.sessions.table.actions.open")]}),C.status!=="paused"&&C.status!=="closed"&&i.jsxs(wt,{onClick:()=>x(C.remoteJid,"paused"),children:[i.jsx(Di,{className:"mr-2 h-4 w-4"}),t("flowise.sessions.table.actions.pause")]}),C.status!=="closed"&&i.jsxs(wt,{onClick:()=>x(C.remoteJid,"closed"),children:[i.jsx(Oi,{className:"mr-2 h-4 w-4"}),t("flowise.sessions.table.actions.close")]}),i.jsxs(wt,{onClick:()=>x(C.remoteJid,"delete"),children:[i.jsx(Ii,{className:"mr-2 h-4 w-4"}),t("flowise.sessions.table.actions.delete")]})]})]})}}];return i.jsxs(Pt,{open:l,onOpenChange:u,children:[i.jsx(Bt,{asChild:!0,children:i.jsxs(se,{variant:"secondary",size:"sm",children:[i.jsx(Ai,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:t("flowise.sessions.label")})]})}),i.jsxs(Nt,{className:"overflow-y-auto sm:max-w-[950px]",onCloseAutoFocus:g,children:[i.jsx(Mt,{children:i.jsx(zt,{children:t("flowise.sessions.label")})}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between gap-6 p-5",children:[i.jsx(ne,{placeholder:t("flowise.sessions.search"),value:d,onChange:w=>f(w.target.value)}),i.jsx(se,{variant:"outline",onClick:g,size:"icon",children:i.jsx(Li,{})})]}),i.jsx($a,{columns:b,data:h??[],onSortingChange:o,state:{sorting:s,globalFilter:d},onGlobalFilterChange:f,enableGlobalFilter:!0,noResultsMessage:t("flowise.sessions.table.none")})]})]})]})}const kne=P.object({enabled:P.boolean(),description:P.string(),apiUrl:P.string(),apiKey:P.string().optional(),triggerType:P.string(),triggerOperator:P.string().optional(),triggerValue:P.string().optional(),expire:P.coerce.number().optional(),keywordFinish:P.string().optional(),delayMessage:P.coerce.number().optional(),unknownMessage:P.string().optional(),listeningFromMe:P.boolean().optional(),stopBotFromMe:P.boolean().optional(),keepOpen:P.boolean().optional(),debounceTime:P.coerce.number().optional(),splitMessages:P.boolean().optional(),timePerChar:P.coerce.number().optional()});function OI({initialData:e,onSubmit:t,handleDelete:n,flowiseId:r,isModal:s=!1,isLoading:o=!1,openDeletionDialog:l=!1,setOpenDeletionDialog:u=()=>{}}){const{t:d}=Ve(),f=on({resolver:an(kne),defaultValues:e||{enabled:!0,description:"",apiUrl:"",apiKey:"",triggerType:"keyword",triggerOperator:"contains",triggerValue:"",expire:0,keywordFinish:"",delayMessage:0,unknownMessage:"",listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0,splitMessages:!1,timePerChar:0}}),h=f.watch("triggerType");return i.jsx(Gn,{...f,children:i.jsxs("form",{onSubmit:f.handleSubmit(t),className:"w-full space-y-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx(Pe,{name:"enabled",label:d("flowise.form.enabled.label"),reverse:!0}),i.jsx(le,{name:"description",label:d("flowise.form.description.label"),required:!0,children:i.jsx(ne,{})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:d("flowise.form.flowiseSettings.label")}),i.jsx($t,{})]}),i.jsx(le,{name:"apiUrl",label:d("flowise.form.apiUrl.label"),required:!0,children:i.jsx(ne,{})}),i.jsx(le,{name:"apiKey",label:d("flowise.form.apiKey.label"),children:i.jsx(ne,{type:"password"})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:d("flowise.form.triggerSettings.label")}),i.jsx($t,{})]}),i.jsx(Jt,{name:"triggerType",label:d("flowise.form.triggerType.label"),options:[{label:d("flowise.form.triggerType.keyword"),value:"keyword"},{label:d("flowise.form.triggerType.all"),value:"all"},{label:d("flowise.form.triggerType.advanced"),value:"advanced"},{label:d("flowise.form.triggerType.none"),value:"none"}]}),h==="keyword"&&i.jsxs(i.Fragment,{children:[i.jsx(Jt,{name:"triggerOperator",label:d("flowise.form.triggerOperator.label"),options:[{label:d("flowise.form.triggerOperator.contains"),value:"contains"},{label:d("flowise.form.triggerOperator.equals"),value:"equals"},{label:d("flowise.form.triggerOperator.startsWith"),value:"startsWith"},{label:d("flowise.form.triggerOperator.endsWith"),value:"endsWith"},{label:d("flowise.form.triggerOperator.regex"),value:"regex"}]}),i.jsx(le,{name:"triggerValue",label:d("flowise.form.triggerValue.label"),children:i.jsx(ne,{})})]}),h==="advanced"&&i.jsx(le,{name:"triggerValue",label:d("flowise.form.triggerConditions.label"),children:i.jsx(ne,{})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:d("flowise.form.generalSettings.label")}),i.jsx($t,{})]}),i.jsx(le,{name:"expire",label:d("flowise.form.expire.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(le,{name:"keywordFinish",label:d("flowise.form.keywordFinish.label"),children:i.jsx(ne,{})}),i.jsx(le,{name:"delayMessage",label:d("flowise.form.delayMessage.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(le,{name:"unknownMessage",label:d("flowise.form.unknownMessage.label"),children:i.jsx(ne,{})}),i.jsx(Pe,{name:"listeningFromMe",label:d("flowise.form.listeningFromMe.label"),reverse:!0}),i.jsx(Pe,{name:"stopBotFromMe",label:d("flowise.form.stopBotFromMe.label"),reverse:!0}),i.jsx(Pe,{name:"keepOpen",label:d("flowise.form.keepOpen.label"),reverse:!0}),i.jsx(le,{name:"debounceTime",label:d("flowise.form.debounceTime.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(Pe,{name:"splitMessages",label:d("flowise.form.splitMessages.label"),reverse:!0}),f.watch("splitMessages")&&i.jsx(le,{name:"timePerChar",label:d("flowise.form.timePerChar.label"),children:i.jsx(ne,{type:"number"})})]}),s&&i.jsx(Yt,{children:i.jsx(se,{disabled:o,type:"submit",children:d(o?"flowise.button.saving":"flowise.button.save")})}),!s&&i.jsxs("div",{children:[i.jsx(PI,{flowiseId:r}),i.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[i.jsxs(Pt,{open:l,onOpenChange:u,children:[i.jsx(Bt,{asChild:!0,children:i.jsx(se,{variant:"destructive",size:"sm",children:d("dify.button.delete")})}),i.jsx(Nt,{children:i.jsxs(Mt,{children:[i.jsx(zt,{children:d("modal.delete.title")}),i.jsx(eo,{children:d("modal.delete.messageSingle")}),i.jsxs(Yt,{children:[i.jsx(se,{size:"sm",variant:"outline",onClick:()=>u(!1),children:d("button.cancel")}),i.jsx(se,{variant:"destructive",onClick:n,children:d("button.delete")})]})]})})]}),i.jsx(se,{disabled:o,type:"submit",children:d(o?"flowise.button.saving":"flowise.button.update")})]})]})]})})}function jne({resetTable:e}){const{t}=Ve(),{instance:n}=ct(),{createFlowise:r}=Sg(),[s,o]=y.useState(!1),[l,u]=y.useState(!1),d=async f=>{try{if(!n||!n.name)throw new Error("instance not found");o(!0);const h={enabled:f.enabled,description:f.description,apiUrl:f.apiUrl,apiKey:f.apiKey,triggerType:f.triggerType,triggerOperator:f.triggerOperator||"",triggerValue:f.triggerValue||"",expire:f.expire||0,keywordFinish:f.keywordFinish||"",delayMessage:f.delayMessage||0,unknownMessage:f.unknownMessage||"",listeningFromMe:f.listeningFromMe||!1,stopBotFromMe:f.stopBotFromMe||!1,keepOpen:f.keepOpen||!1,debounceTime:f.debounceTime||0,splitMessages:f.splitMessages||!1,timePerChar:f.timePerChar||0};await r({instanceName:n.name,token:n.token,data:h}),me.success(t("flowise.toast.success.create")),u(!1),e()}catch(h){console.error("Error:",h),me.error(`Error: ${h?.response?.data?.response?.message}`)}finally{o(!1)}};return i.jsxs(Pt,{open:l,onOpenChange:u,children:[i.jsx(Bt,{asChild:!0,children:i.jsxs(se,{size:"sm",children:[i.jsx(cs,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:t("flowise.button.create")})]})}),i.jsxs(Nt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[i.jsx(Mt,{children:i.jsx(zt,{children:t("flowise.form.title")})}),i.jsx(OI,{onSubmit:d,isModal:!0,isLoading:s})]})]})}const Tne=e=>["flowise","getFlowise",JSON.stringify(e)],Nne=async({instanceName:e,token:t,flowiseId:n})=>{const r=await Ee.get(`/flowise/fetch/${n}/${e}`,{headers:{apiKey:t}});return Array.isArray(r.data)?r.data[0]:r.data},Mne=e=>{const{instanceName:t,token:n,flowiseId:r,...s}=e;return mt({...s,queryKey:Tne({instanceName:t}),queryFn:()=>Nne({instanceName:t,token:n,flowiseId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function _ne({flowiseId:e,resetTable:t}){const{t:n}=Ve(),{instance:r}=ct(),s=dn(),[o,l]=y.useState(!1),{deleteFlowise:u,updateFlowise:d}=Sg(),{data:f,isLoading:h}=Mne({instanceName:r?.name,flowiseId:e}),m=y.useMemo(()=>({enabled:f?.enabled??!0,description:f?.description??"",apiUrl:f?.apiUrl??"",apiKey:f?.apiKey??"",triggerType:f?.triggerType??"",triggerOperator:f?.triggerOperator??"",triggerValue:f?.triggerValue,expire:f?.expire??0,keywordFinish:f?.keywordFinish,delayMessage:f?.delayMessage??0,unknownMessage:f?.unknownMessage,listeningFromMe:f?.listeningFromMe,stopBotFromMe:f?.stopBotFromMe,keepOpen:f?.keepOpen,debounceTime:f?.debounceTime??0,splitMessages:f?.splitMessages??!1,timePerChar:f?.timePerChar??0}),[f?.apiKey,f?.apiUrl,f?.debounceTime,f?.delayMessage,f?.description,f?.enabled,f?.expire,f?.keepOpen,f?.keywordFinish,f?.listeningFromMe,f?.stopBotFromMe,f?.triggerOperator,f?.triggerType,f?.triggerValue,f?.unknownMessage,f?.splitMessages,f?.timePerChar]),g=async b=>{try{if(r&&r.name&&e){const w={enabled:b.enabled,description:b.description,apiUrl:b.apiUrl,apiKey:b.apiKey,triggerType:b.triggerType,triggerOperator:b.triggerOperator||"",triggerValue:b.triggerValue||"",expire:b.expire||0,keywordFinish:b.keywordFinish||"",delayMessage:b.delayMessage||1e3,unknownMessage:b.unknownMessage||"",listeningFromMe:b.listeningFromMe||!1,stopBotFromMe:b.stopBotFromMe||!1,keepOpen:b.keepOpen||!1,debounceTime:b.debounceTime||0,splitMessages:b.splitMessages||!1,timePerChar:b.timePerChar||0};await d({instanceName:r.name,flowiseId:e,data:w}),me.success(n("flowise.toast.success.update")),t(),s(`/manager/instance/${r.id}/flowise/${e}`)}else console.error("Token not found")}catch(w){console.error("Error:",w),me.error(`Error: ${w?.response?.data?.response?.message}`)}},x=async()=>{try{r&&r.name&&e?(await u({instanceName:r.name,flowiseId:e}),me.success(n("flowise.toast.success.delete")),l(!1),t(),s(`/manager/instance/${r.id}/flowise`)):console.error("instance not found")}catch(b){console.error("Erro ao excluir dify:",b)}};return h?i.jsx(On,{}):i.jsx("div",{className:"m-4",children:i.jsx(OI,{initialData:m,onSubmit:g,flowiseId:e,handleDelete:x,isModal:!1,isLoading:h,openDeletionDialog:o,setOpenDeletionDialog:l})})}function kk(){const{t:e}=Ve(),t=zo("(min-width: 768px)"),{instance:n}=ct(),{flowiseId:r}=ls(),{data:s,isLoading:o,refetch:l}=RI({instanceName:n?.name}),u=dn(),d=h=>{n&&u(`/manager/instance/${n.id}/flowise/${h}`)},f=()=>{l()};return i.jsxs("main",{className:"pt-5",children:[i.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[i.jsx("h3",{className:"text-lg font-medium",children:e("flowise.title")}),i.jsxs("div",{className:"flex items-center justify-end gap-2",children:[i.jsx(PI,{}),i.jsx(wne,{}),i.jsx(jne,{resetTable:f})]})]}),i.jsx($t,{className:"my-4"}),i.jsxs($o,{direction:t?"horizontal":"vertical",children:[i.jsx(Hn,{defaultSize:35,className:"pr-4",children:i.jsx("div",{className:"flex flex-col gap-3",children:o?i.jsx(On,{}):i.jsx(i.Fragment,{children:s&&s.length>0&&Array.isArray(s)?s.map(h=>i.jsx(se,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>d(`${h.id}`),variant:r===h.id?"secondary":"outline",children:i.jsx("h4",{className:"text-base",children:h.description||h.id})},h.id)):i.jsx(se,{variant:"link",children:e("flowise.table.none")})})})}),r&&i.jsxs(i.Fragment,{children:[i.jsx(Bo,{withHandle:!0,className:"border border-border"}),i.jsx(Hn,{children:i.jsx(_ne,{flowiseId:r,resetTable:f})})]})]})]})}const Rne=e=>["n8n","fetchN8n",JSON.stringify(e)],Pne=async({instanceName:e,token:t})=>(await Ee.get(`/n8n/find/${e}`,{headers:{apikey:t}})).data,II=e=>{const{instanceName:t,token:n,...r}=e;return mt({...r,queryKey:Rne({instanceName:t,token:n}),queryFn:()=>Pne({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},One=async({instanceName:e,token:t,data:n})=>(await Ee.post(`/n8n/create/${e}`,n,{headers:{apikey:t}})).data,Ine=async({instanceName:e,n8nId:t,data:n})=>(await Ee.put(`/n8n/update/${t}/${e}`,n)).data,Ane=async({instanceName:e,n8nId:t})=>(await Ee.delete(`/n8n/delete/${t}/${e}`)).data,Dne=async({instanceName:e,token:t,data:n})=>(await Ee.post(`/n8n/settings/${e}`,n,{headers:{apikey:t}})).data,Fne=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await Ee.post(`/n8n/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function Cg(){const e=nt(Dne,{invalidateKeys:[["n8n","fetchDefaultSettings"]]}),t=nt(Fne,{invalidateKeys:[["n8n","getN8n"],["n8n","fetchSessions"]]}),n=nt(Ane,{invalidateKeys:[["n8n","getN8n"],["n8n","fetchN8n"],["n8n","fetchSessions"]]}),r=nt(Ine,{invalidateKeys:[["n8n","getN8n"],["n8n","fetchN8n"],["n8n","fetchSessions"]]}),s=nt(One,{invalidateKeys:[["n8n","fetchN8n"]]});return{setDefaultSettingsN8n:e,changeStatusN8n:t,deleteN8n:n,updateN8n:r,createN8n:s}}const Lne=e=>["n8n","fetchDefaultSettings",JSON.stringify(e)],$ne=async({instanceName:e,token:t})=>(await Ee.get(`/n8n/fetchSettings/${e}`,{headers:{apikey:t}})).data,Bne=e=>{const{instanceName:t,token:n,...r}=e;return mt({...r,queryKey:Lne({instanceName:t,token:n}),queryFn:()=>$ne({instanceName:t,token:n}),enabled:!!t})},zne=P.object({expire:P.string(),keywordFinish:P.string(),delayMessage:P.string(),unknownMessage:P.string(),listeningFromMe:P.boolean(),stopBotFromMe:P.boolean(),keepOpen:P.boolean(),debounceTime:P.string(),ignoreJids:P.array(P.string()).default([]),n8nIdFallback:P.union([P.null(),P.string()]).optional(),splitMessages:P.boolean(),timePerChar:P.string()});function Une(){const{t:e}=Ve(),{instance:t}=ct(),{setDefaultSettingsN8n:n}=Cg(),[r,s]=y.useState(!1),{data:o,refetch:l}=II({instanceName:t?.name,token:t?.token,enabled:r}),{data:u,refetch:d}=Bne({instanceName:t?.name,token:t?.token}),f=on({resolver:an(zne),defaultValues:{expire:"0",keywordFinish:e("n8n.form.examples.keywordFinish"),delayMessage:"1000",unknownMessage:e("n8n.form.examples.unknownMessage"),listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:"0",ignoreJids:[],n8nIdFallback:void 0,splitMessages:!1,timePerChar:"0"}});y.useEffect(()=>{u&&f.reset({expire:u?.expire?u.expire.toString():"0",keywordFinish:u.keywordFinish,delayMessage:u.delayMessage?u.delayMessage.toString():"0",unknownMessage:u.unknownMessage,listeningFromMe:u.listeningFromMe,stopBotFromMe:u.stopBotFromMe,keepOpen:u.keepOpen,debounceTime:u.debounceTime?u.debounceTime.toString():"0",ignoreJids:u.ignoreJids,n8nIdFallback:u.n8nIdFallback,splitMessages:u.splitMessages,timePerChar:u.timePerChar?u.timePerChar.toString():"0"})},[u]);const h=async g=>{try{if(!t||!t.name)throw new Error("instance not found.");const x={expire:parseInt(g.expire),keywordFinish:g.keywordFinish,delayMessage:parseInt(g.delayMessage),unknownMessage:g.unknownMessage,listeningFromMe:g.listeningFromMe,stopBotFromMe:g.stopBotFromMe,keepOpen:g.keepOpen,debounceTime:parseInt(g.debounceTime),n8nIdFallback:g.n8nIdFallback||void 0,ignoreJids:g.ignoreJids,splitMessages:g.splitMessages,timePerChar:parseInt(g.timePerChar)};await n({instanceName:t.name,token:t.token,data:x}),me.success(e("n8n.toast.defaultSettings.success"))}catch(x){console.error("Error:",x),me.error(`Error: ${x?.response?.data?.response?.message}`)}};function m(){d(),l()}return i.jsxs(Pt,{open:r,onOpenChange:s,children:[i.jsx(Bt,{asChild:!0,children:i.jsxs(se,{variant:"secondary",size:"sm",children:[i.jsx(Oo,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:e("n8n.defaultSettings")})]})}),i.jsxs(Nt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:m,children:[i.jsx(Mt,{children:i.jsx(zt,{children:e("n8n.defaultSettings")})}),i.jsx(Gn,{...f,children:i.jsxs("form",{className:"w-full space-y-6",onSubmit:f.handleSubmit(h),children:[i.jsx("div",{children:i.jsxs("div",{className:"space-y-4",children:[i.jsx(Jt,{name:"n8nIdFallback",label:e("n8n.form.n8nIdFallback.label"),options:o?.filter(g=>!!g.id).map(g=>({label:g.description,value:g.id}))??[]}),i.jsx(le,{name:"expire",label:e("n8n.form.expire.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(le,{name:"keywordFinish",label:e("n8n.form.keywordFinish.label"),children:i.jsx(ne,{})}),i.jsx(le,{name:"delayMessage",label:e("n8n.form.delayMessage.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(le,{name:"unknownMessage",label:e("n8n.form.unknownMessage.label"),children:i.jsx(ne,{})}),i.jsx(Pe,{name:"listeningFromMe",label:e("n8n.form.listeningFromMe.label"),reverse:!0}),i.jsx(Pe,{name:"stopBotFromMe",label:e("n8n.form.stopBotFromMe.label"),reverse:!0}),i.jsx(Pe,{name:"keepOpen",label:e("n8n.form.keepOpen.label"),reverse:!0}),i.jsx(le,{name:"debounceTime",label:e("n8n.form.debounceTime.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(Pe,{name:"splitMessages",label:e("n8n.form.splitMessages.label"),reverse:!0}),i.jsx(le,{name:"timePerChar",label:e("n8n.form.timePerChar.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(Da,{name:"ignoreJids",label:e("n8n.form.ignoreJids.label"),placeholder:e("n8n.form.ignoreJids.placeholder")})]})}),i.jsx(Yt,{children:i.jsx(se,{type:"submit",children:e("n8n.button.save")})})]})})]})]})}const Vne=e=>["n8n","fetchSessions",JSON.stringify(e)],Hne=async({n8nId:e,instanceName:t})=>(await Ee.get(`/n8n/fetchSessions/${e}/${t}`)).data,qne=e=>{const{n8nId:t,instanceName:n,...r}=e;return mt({...r,queryKey:Vne({n8nId:t,instanceName:n}),queryFn:()=>Hne({n8nId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0),staleTime:1e3*10})};function AI({n8nId:e}){const{t}=Ve(),{instance:n}=ct(),{changeStatusN8n:r}=Cg(),[s,o]=y.useState([]),{data:l,refetch:u}=qne({n8nId:e,instanceName:n?.name}),[d,f]=y.useState(!1),[h,m]=y.useState("");function g(){u()}const x=async(w,C)=>{try{if(!n)return;await r({instanceName:n.name,token:n.token,remoteJid:w,status:C}),me.success(t("n8n.toast.success.status")),g()}catch(k){console.error("Error:",k),me.error(`Error : ${k?.response?.data?.response?.message}`)}},b=[{accessorKey:"remoteJid",header:()=>i.jsx("div",{className:"text-center",children:t("n8n.sessions.table.remoteJid")}),cell:({row:w})=>i.jsx("div",{children:w.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>i.jsx("div",{className:"text-center",children:t("n8n.sessions.table.pushName")}),cell:({row:w})=>i.jsx("div",{children:w.getValue("pushName")})},{accessorKey:"sessionId",header:()=>i.jsx("div",{className:"text-center",children:t("n8n.sessions.table.sessionId")}),cell:({row:w})=>i.jsx("div",{children:w.getValue("sessionId")})},{accessorKey:"status",header:()=>i.jsx("div",{className:"text-center",children:t("n8n.sessions.table.status")}),cell:({row:w})=>i.jsx("div",{children:w.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:w})=>{const C=w.original;return i.jsxs(Kr,{children:[i.jsx(Wr,{asChild:!0,children:i.jsxs(se,{variant:"ghost",className:"h-8 w-8 p-0",children:[i.jsx("span",{className:"sr-only",children:t("n8n.sessions.table.actions.title")}),i.jsx(Pa,{className:"h-4 w-4"})]})}),i.jsxs(hr,{align:"end",children:[i.jsx(Ao,{children:t("n8n.sessions.table.actions.title")}),i.jsx(Xs,{}),C.status!=="opened"&&i.jsxs(wt,{onClick:()=>x(C.remoteJid,"opened"),children:[i.jsx(Fi,{className:"mr-2 h-4 w-4"}),t("n8n.sessions.table.actions.open")]}),C.status!=="paused"&&C.status!=="closed"&&i.jsxs(wt,{onClick:()=>x(C.remoteJid,"paused"),children:[i.jsx(Di,{className:"mr-2 h-4 w-4"}),t("n8n.sessions.table.actions.pause")]}),C.status!=="closed"&&i.jsxs(wt,{onClick:()=>x(C.remoteJid,"closed"),children:[i.jsx(Oi,{className:"mr-2 h-4 w-4"}),t("n8n.sessions.table.actions.close")]}),i.jsxs(wt,{onClick:()=>x(C.remoteJid,"delete"),children:[i.jsx(Ii,{className:"mr-2 h-4 w-4"}),t("n8n.sessions.table.actions.delete")]})]})]})}}];return i.jsxs(Pt,{open:d,onOpenChange:f,children:[i.jsx(Bt,{asChild:!0,children:i.jsxs(se,{variant:"secondary",size:"sm",children:[i.jsx(Ai,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:t("n8n.sessions.label")})]})}),i.jsxs(Nt,{className:"overflow-y-auto sm:max-w-[950px]",onCloseAutoFocus:g,children:[i.jsx(Mt,{children:i.jsx(zt,{children:t("n8n.sessions.label")})}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between gap-6 p-5",children:[i.jsx(ne,{placeholder:t("n8n.sessions.search"),value:h,onChange:w=>m(w.target.value)}),i.jsx(se,{variant:"outline",onClick:g,size:"icon",children:i.jsx(Li,{})})]}),i.jsx($a,{columns:b,data:l??[],onSortingChange:o,state:{sorting:s,globalFilter:h},onGlobalFilterChange:m,enableGlobalFilter:!0,noResultsMessage:t("n8n.sessions.table.none")})]})]})]})}const Kne=P.object({enabled:P.boolean(),description:P.string(),webhookUrl:P.string(),basicAuthUser:P.string(),basicAuthPass:P.string(),triggerType:P.string(),triggerOperator:P.string().optional(),triggerValue:P.string().optional(),expire:P.coerce.number().optional(),keywordFinish:P.string().optional(),delayMessage:P.coerce.number().optional(),unknownMessage:P.string().optional(),listeningFromMe:P.boolean().optional(),stopBotFromMe:P.boolean().optional(),keepOpen:P.boolean().optional(),debounceTime:P.coerce.number().optional(),splitMessages:P.boolean().optional(),timePerChar:P.coerce.number().optional()});function DI({initialData:e,onSubmit:t,handleDelete:n,n8nId:r,isModal:s=!1,isLoading:o=!1,openDeletionDialog:l=!1,setOpenDeletionDialog:u=()=>{}}){const{t:d}=Ve(),f=on({resolver:an(Kne),defaultValues:e||{enabled:!0,description:"",webhookUrl:"",basicAuthUser:"",basicAuthPass:"",triggerType:"keyword",triggerOperator:"contains",triggerValue:"",expire:0,keywordFinish:"",delayMessage:0,unknownMessage:"",listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0,splitMessages:!1,timePerChar:0}}),h=f.watch("triggerType");return i.jsx(Gn,{...f,children:i.jsxs("form",{onSubmit:f.handleSubmit(t),className:"w-full space-y-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx(Pe,{name:"enabled",label:d("n8n.form.enabled.label"),reverse:!0}),i.jsx(le,{name:"description",label:d("n8n.form.description.label"),children:i.jsx(ne,{})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:d("n8n.form.n8nSettings.label")}),i.jsx($t,{})]}),i.jsx(le,{name:"webhookUrl",label:d("n8n.form.webhookUrl.label"),required:!0,children:i.jsx(ne,{})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:d("n8n.form.basicAuth.label")}),i.jsx($t,{})]}),i.jsxs("div",{className:"flex w-full flex-row gap-4",children:[i.jsx(le,{name:"basicAuthUser",label:d("n8n.form.basicAuthUser.label"),className:"flex-1",children:i.jsx(ne,{})}),i.jsx(le,{name:"basicAuthPass",label:d("n8n.form.basicAuthPass.label"),className:"flex-1",children:i.jsx(ne,{type:"password"})})]}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:d("n8n.form.triggerSettings.label")}),i.jsx($t,{})]}),i.jsx(Jt,{name:"triggerType",label:d("n8n.form.triggerType.label"),options:[{label:d("n8n.form.triggerType.keyword"),value:"keyword"},{label:d("n8n.form.triggerType.all"),value:"all"},{label:d("n8n.form.triggerType.advanced"),value:"advanced"},{label:d("n8n.form.triggerType.none"),value:"none"}]}),h==="keyword"&&i.jsxs(i.Fragment,{children:[i.jsx(Jt,{name:"triggerOperator",label:d("n8n.form.triggerOperator.label"),options:[{label:d("n8n.form.triggerOperator.contains"),value:"contains"},{label:d("n8n.form.triggerOperator.equals"),value:"equals"},{label:d("n8n.form.triggerOperator.startsWith"),value:"startsWith"},{label:d("n8n.form.triggerOperator.endsWith"),value:"endsWith"},{label:d("n8n.form.triggerOperator.regex"),value:"regex"}]}),i.jsx(le,{name:"triggerValue",label:d("n8n.form.triggerValue.label"),children:i.jsx(ne,{})})]}),h==="advanced"&&i.jsx(le,{name:"triggerValue",label:d("n8n.form.triggerConditions.label"),children:i.jsx(ne,{})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:d("n8n.form.generalSettings.label")}),i.jsx($t,{})]}),i.jsx(le,{name:"expire",label:d("n8n.form.expire.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(le,{name:"keywordFinish",label:d("n8n.form.keywordFinish.label"),children:i.jsx(ne,{})}),i.jsx(le,{name:"delayMessage",label:d("n8n.form.delayMessage.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(le,{name:"unknownMessage",label:d("n8n.form.unknownMessage.label"),children:i.jsx(ne,{})}),i.jsx(Pe,{name:"listeningFromMe",label:d("n8n.form.listeningFromMe.label"),reverse:!0}),i.jsx(Pe,{name:"stopBotFromMe",label:d("n8n.form.stopBotFromMe.label"),reverse:!0}),i.jsx(Pe,{name:"keepOpen",label:d("n8n.form.keepOpen.label"),reverse:!0}),i.jsx(le,{name:"debounceTime",label:d("n8n.form.debounceTime.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(Pe,{name:"splitMessages",label:d("n8n.form.splitMessages.label"),reverse:!0}),f.watch("splitMessages")&&i.jsx(le,{name:"timePerChar",label:d("n8n.form.timePerChar.label"),children:i.jsx(ne,{type:"number"})})]}),s&&i.jsx(Yt,{children:i.jsx(se,{disabled:o,type:"submit",children:d(o?"n8n.button.saving":"n8n.button.save")})}),!s&&i.jsxs("div",{children:[i.jsx(AI,{n8nId:r}),i.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[i.jsxs(Pt,{open:l,onOpenChange:u,children:[i.jsx(Bt,{asChild:!0,children:i.jsx(se,{variant:"destructive",size:"sm",children:d("n8n.button.delete")})}),i.jsx(Nt,{children:i.jsxs(Mt,{children:[i.jsx(zt,{children:d("modal.delete.title")}),i.jsx(eo,{children:d("modal.delete.messageSingle")}),i.jsxs(Yt,{children:[i.jsx(se,{size:"sm",variant:"outline",onClick:()=>u(!1),children:d("button.cancel")}),i.jsx(se,{variant:"destructive",onClick:n,children:d("button.delete")})]})]})})]}),i.jsx(se,{disabled:o,type:"submit",children:d(o?"n8n.button.saving":"n8n.button.update")})]})]})]})})}function Wne({resetTable:e}){const{t}=Ve(),{instance:n}=ct(),[r,s]=y.useState(!1),[o,l]=y.useState(!1),{createN8n:u}=Cg(),d=async f=>{try{if(!n||!n.name)throw new Error("instance not found");s(!0);const h={enabled:f.enabled,description:f.description,webhookUrl:f.webhookUrl,basicAuthUser:f.basicAuthUser,basicAuthPass:f.basicAuthPass,triggerType:f.triggerType,triggerOperator:f.triggerOperator||"",triggerValue:f.triggerValue||"",expire:f.expire||0,keywordFinish:f.keywordFinish||"",delayMessage:f.delayMessage||0,unknownMessage:f.unknownMessage||"",listeningFromMe:f.listeningFromMe||!1,stopBotFromMe:f.stopBotFromMe||!1,keepOpen:f.keepOpen||!1,debounceTime:f.debounceTime||0,splitMessages:f.splitMessages||!1,timePerChar:f.timePerChar||0};await u({instanceName:n.name,token:n.token,data:h}),me.success(t("n8n.toast.success.create")),l(!1),e()}catch(h){console.error("Error:",h),me.error(`Error: ${h?.response?.data?.response?.message}`)}finally{s(!1)}};return i.jsxs(Pt,{open:o,onOpenChange:l,children:[i.jsx(Bt,{asChild:!0,children:i.jsxs(se,{size:"sm",children:[i.jsx(cs,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:t("n8n.button.create")})]})}),i.jsxs(Nt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[i.jsx(Mt,{children:i.jsx(zt,{children:t("n8n.form.title")})}),i.jsx(DI,{onSubmit:d,isModal:!0,isLoading:r})]})]})}const Gne=e=>["n8n","getN8n",JSON.stringify(e)],Jne=async({n8nId:e,instanceName:t})=>(await Ee.get(`/n8n/fetch/${e}/${t}`)).data,Qne=e=>{const{n8nId:t,instanceName:n,...r}=e;return mt({...r,queryKey:Gne({n8nId:t,instanceName:n}),queryFn:()=>Jne({n8nId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0)})};function Zne({n8nId:e,resetTable:t}){const{t:n}=Ve(),{instance:r}=ct(),s=dn(),[o,l]=y.useState(!1),{deleteN8n:u,updateN8n:d}=Cg(),{data:f,isLoading:h}=Qne({n8nId:e,instanceName:r?.name}),m=y.useMemo(()=>({enabled:!!f?.enabled,description:f?.description??"",webhookUrl:f?.webhookUrl??"",basicAuthUser:f?.basicAuthUser??"",basicAuthPass:f?.basicAuthPass??"",triggerType:f?.triggerType??"",triggerOperator:f?.triggerOperator??"",triggerValue:f?.triggerValue??"",expire:f?.expire??0,keywordFinish:f?.keywordFinish??"",delayMessage:f?.delayMessage??0,unknownMessage:f?.unknownMessage??"",listeningFromMe:!!f?.listeningFromMe,stopBotFromMe:!!f?.stopBotFromMe,keepOpen:!!f?.keepOpen,debounceTime:f?.debounceTime??0,splitMessages:f?.splitMessages??!1,timePerChar:f?.timePerChar??0}),[f?.webhookUrl,f?.basicAuthUser,f?.basicAuthPass,f?.debounceTime,f?.delayMessage,f?.description,f?.enabled,f?.expire,f?.keepOpen,f?.keywordFinish,f?.listeningFromMe,f?.stopBotFromMe,f?.triggerOperator,f?.triggerType,f?.triggerValue,f?.unknownMessage,f?.splitMessages,f?.timePerChar]),g=async b=>{try{if(r&&r.name&&e){const w={enabled:b.enabled,description:b.description,webhookUrl:b.webhookUrl,basicAuthUser:b.basicAuthUser,basicAuthPass:b.basicAuthPass,triggerType:b.triggerType,triggerOperator:b.triggerOperator||"",triggerValue:b.triggerValue||"",expire:b.expire||0,keywordFinish:b.keywordFinish||"",delayMessage:b.delayMessage||1e3,unknownMessage:b.unknownMessage||"",listeningFromMe:b.listeningFromMe||!1,stopBotFromMe:b.stopBotFromMe||!1,keepOpen:b.keepOpen||!1,debounceTime:b.debounceTime||0,splitMessages:b.splitMessages||!1,timePerChar:b.timePerChar||0};await d({instanceName:r.name,n8nId:e,data:w}),me.success(n("n8n.toast.success.update")),t(),s(`/manager/instance/${r.id}/n8n/${e}`)}else console.error("Token not found")}catch(w){console.error("Error:",w),me.error(`Error: ${w?.response?.data?.response?.message}`)}},x=async()=>{try{r&&r.name&&e?(await u({instanceName:r.name,n8nId:e}),me.success(n("n8n.toast.success.delete")),l(!1),t(),s(`/manager/instance/${r.id}/n8n`)):console.error("instance not found")}catch(b){console.error("Erro ao excluir n8n:",b)}};return h?i.jsx(On,{}):i.jsx("div",{className:"m-4",children:i.jsx(DI,{initialData:m,onSubmit:g,n8nId:e,handleDelete:x,isModal:!1,isLoading:h,openDeletionDialog:o,setOpenDeletionDialog:l})})}function jk(){const{t:e}=Ve(),t=zo("(min-width: 768px)"),{instance:n}=ct(),{n8nId:r}=ls(),{data:s,refetch:o,isLoading:l}=II({instanceName:n?.name}),u=dn(),d=h=>{n&&u(`/manager/instance/${n.id}/n8n/${h}`)},f=()=>{o()};return i.jsxs("main",{className:"pt-5",children:[i.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[i.jsx("h3",{className:"text-lg font-medium",children:e("n8n.title")}),i.jsxs("div",{className:"flex items-center justify-end gap-2",children:[i.jsx(AI,{}),i.jsx(Une,{}),i.jsx(Wne,{resetTable:f})]})]}),i.jsx($t,{className:"my-4"}),i.jsxs($o,{direction:t?"horizontal":"vertical",children:[i.jsx(Hn,{defaultSize:35,className:"pr-4",children:i.jsx("div",{className:"flex flex-col gap-3",children:l?i.jsx(On,{}):i.jsx(i.Fragment,{children:s&&s.length>0&&Array.isArray(s)?s.map(h=>i.jsx(se,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>d(`${h.id}`),variant:r===h.id?"secondary":"outline",children:i.jsx("h4",{className:"text-base",children:h.description||h.id})},h.id)):i.jsx(se,{variant:"link",children:e("n8n.table.none")})})})}),r&&i.jsxs(i.Fragment,{children:[i.jsx(Bo,{withHandle:!0,className:"border border-border"}),i.jsx(Hn,{children:i.jsx(Zne,{n8nId:r,resetTable:f})})]})]})]})}const Yne=e=>["openai","findOpenai",JSON.stringify(e)],Xne=async({instanceName:e,token:t})=>(await Ee.get(`/openai/find/${e}`,{headers:{apiKey:t}})).data,FI=e=>{const{instanceName:t,token:n,...r}=e;return mt({...r,queryKey:Yne({instanceName:t}),queryFn:()=>Xne({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},ere=e=>["openai","findOpenaiCreds",JSON.stringify(e)],tre=async({instanceName:e,token:t})=>(await Ee.get(`/openai/creds/${e}`,{headers:{apiKey:t}})).data,dw=e=>{const{instanceName:t,token:n,...r}=e;return mt({staleTime:1e3*60*60*6,...r,queryKey:ere({instanceName:t}),queryFn:()=>tre({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},nre=async({instanceName:e,token:t,data:n})=>(await Ee.post(`/openai/creds/${e}`,n,{headers:{apikey:t}})).data,rre=async({openaiCredsId:e,instanceName:t})=>(await Ee.delete(`/openai/creds/${e}/${t}`)).data,sre=async({instanceName:e,token:t,data:n})=>(await Ee.post(`/openai/create/${e}`,n,{headers:{apikey:t}})).data,ore=async({instanceName:e,token:t,openaiId:n,data:r})=>(await Ee.put(`/openai/update/${n}/${e}`,r,{headers:{apikey:t}})).data,are=async({instanceName:e,token:t,openaiId:n})=>(await Ee.delete(`/openai/delete/${n}/${e}`,{headers:{apikey:t}})).data,ire=async({instanceName:e,token:t,data:n})=>(await Ee.post(`/openai/settings/${e}`,n,{headers:{apikey:t}})).data,lre=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await Ee.post(`/openai/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function Md(){const e=nt(ire,{invalidateKeys:[["openai","fetchDefaultSettings"]]}),t=nt(lre,{invalidateKeys:[["openai","getOpenai"],["openai","fetchSessions"]]}),n=nt(are,{invalidateKeys:[["openai","getOpenai"],["openai","findOpenai"],["openai","fetchSessions"]]}),r=nt(ore,{invalidateKeys:[["openai","getOpenai"],["openai","findOpenai"],["openai","fetchSessions"]]}),s=nt(sre,{invalidateKeys:[["openai","findOpenai"]]}),o=nt(nre,{invalidateKeys:[["openai","findOpenaiCreds"]]}),l=nt(rre,{invalidateKeys:[["openai","findOpenaiCreds"]]});return{setDefaultSettingsOpenai:e,changeStatusOpenai:t,deleteOpenai:n,updateOpenai:r,createOpenai:s,createOpenaiCreds:o,deleteOpenaiCreds:l}}const cre=P.object({name:P.string(),apiKey:P.string()});function LI({onCredentialsUpdate:e,showText:t=!0}){const{t:n}=Ve(),{instance:r}=ct(),{createOpenaiCreds:s,deleteOpenaiCreds:o}=Md(),[l,u]=y.useState(!1),[d,f]=y.useState([]),{data:h}=dw({instanceName:r?.name,enabled:l}),m=on({resolver:an(cre),defaultValues:{name:"",apiKey:""}}),g=async w=>{try{if(!r||!r.name)throw new Error("instance not found.");const C={name:w.name,apiKey:w.apiKey};await s({instanceName:r.name,token:r.token,data:C}),me.success(n("openai.toast.success.credentialsCreate")),m.reset(),e&&e()}catch(C){console.error("Error:",C),me.error(`Error: ${C?.response?.data?.response?.message}`)}},x=async w=>{if(!r?.name){me.error("Instance not found.");return}try{await o({openaiCredsId:w,instanceName:r?.name}),me.success(n("openai.toast.success.credentialsDelete")),e&&e()}catch(C){console.error("Error:",C),me.error(`Error: ${C?.response?.data?.response?.message}`)}},b=[{accessorKey:"name",header:({column:w})=>i.jsxs(se,{variant:"ghost",onClick:()=>w.toggleSorting(w.getIsSorted()==="asc"),children:[n("openai.credentials.table.name"),i.jsx(q$,{className:"ml-2 h-4 w-4"})]}),cell:({row:w})=>i.jsx("div",{children:w.getValue("name")})},{accessorKey:"apiKey",header:()=>i.jsx("div",{className:"text-right",children:n("openai.credentials.table.apiKey")}),cell:({row:w})=>i.jsxs("div",{children:[`${w.getValue("apiKey")}`.slice(0,20),"..."]})},{id:"actions",enableHiding:!1,cell:({row:w})=>{const C=w.original;return i.jsxs(Kr,{children:[i.jsx(Wr,{asChild:!0,children:i.jsxs(se,{variant:"ghost",className:"h-8 w-8 p-0",children:[i.jsx("span",{className:"sr-only",children:n("openai.credentials.table.actions.title")}),i.jsx(Pa,{className:"h-4 w-4"})]})}),i.jsxs(hr,{align:"end",children:[i.jsx(Ao,{children:n("openai.credentials.table.actions.title")}),i.jsx(Xs,{}),i.jsx(wt,{onClick:()=>x(C.id),children:n("openai.credentials.table.actions.delete")})]})]})}}];return i.jsxs(Pt,{open:l,onOpenChange:u,children:[i.jsx(Bt,{asChild:!0,children:i.jsx(se,{variant:"secondary",size:"sm",type:"button",children:t?i.jsxs(i.Fragment,{children:[i.jsx(mB,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden md:inline",children:n("openai.credentials.title")})]}):i.jsx(cs,{size:16})})}),i.jsxs(Nt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[i.jsx(Mt,{children:i.jsx(zt,{children:n("openai.credentials.title")})}),i.jsx(Gn,{...m,children:i.jsx("div",{onClick:w=>w.stopPropagation(),onSubmit:w=>w.stopPropagation(),onKeyDown:w=>w.stopPropagation(),children:i.jsxs("form",{onSubmit:w=>{w.preventDefault(),w.stopPropagation(),m.handleSubmit(g)(w)},className:"w-full space-y-6",children:[i.jsx("div",{children:i.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[i.jsx(le,{name:"name",label:n("openai.credentials.table.name"),children:i.jsx(ne,{})}),i.jsx(le,{name:"apiKey",label:n("openai.credentials.table.apiKey"),children:i.jsx(ne,{type:"password"})})]})}),i.jsx(Yt,{children:i.jsx(se,{type:"submit",children:n("openai.button.save")})})]})})}),i.jsx($t,{}),i.jsx("div",{children:i.jsx($a,{columns:b,data:h??[],onSortingChange:f,state:{sorting:d},noResultsMessage:n("openai.credentials.table.none")})})]})]})}const ure=e=>["openai","fetchDefaultSettings",JSON.stringify(e)],dre=async({instanceName:e,token:t})=>{const n=await Ee.get(`/openai/fetchSettings/${e}`,{headers:{apiKey:t}});return Array.isArray(n.data)?n.data[0]:n.data},fre=e=>{const{instanceName:t,token:n,...r}=e;return mt({...r,queryKey:ure({instanceName:t}),queryFn:()=>dre({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},pre=P.object({openaiCredsId:P.string(),expire:P.coerce.number(),keywordFinish:P.string(),delayMessage:P.coerce.number().default(0),unknownMessage:P.string(),listeningFromMe:P.boolean(),stopBotFromMe:P.boolean(),keepOpen:P.boolean(),debounceTime:P.coerce.number(),speechToText:P.boolean(),ignoreJids:P.array(P.string()).default([]),openaiIdFallback:P.union([P.null(),P.string()]).optional(),splitMessages:P.boolean().optional(),timePerChar:P.coerce.number().optional()});function hre(){const{t:e}=Ve(),{instance:t}=ct(),{setDefaultSettingsOpenai:n}=Md(),[r,s]=y.useState(!1),{data:o,refetch:l}=fre({instanceName:t?.name,enabled:r}),{data:u,refetch:d}=FI({instanceName:t?.name,enabled:r}),{data:f}=dw({instanceName:t?.name,enabled:r}),h=on({resolver:an(pre),defaultValues:{openaiCredsId:"",expire:0,keywordFinish:e("openai.form.examples.keywordFinish"),delayMessage:1e3,unknownMessage:e("openai.form.examples.unknownMessage"),listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0,speechToText:!1,ignoreJids:[],openaiIdFallback:void 0,splitMessages:!1,timePerChar:0}});y.useEffect(()=>{o&&h.reset({openaiCredsId:o.openaiCredsId,expire:o?.expire??0,keywordFinish:o.keywordFinish,delayMessage:o.delayMessage??0,unknownMessage:o.unknownMessage,listeningFromMe:o.listeningFromMe,stopBotFromMe:o.stopBotFromMe,keepOpen:o.keepOpen,debounceTime:o.debounceTime??0,speechToText:o.speechToText,ignoreJids:o.ignoreJids,openaiIdFallback:o.openaiIdFallback,splitMessages:o.splitMessages,timePerChar:o.timePerChar??0})},[o]);const m=async x=>{try{if(!t||!t.name)throw new Error("instance not found.");const b={openaiCredsId:x.openaiCredsId,expire:x.expire,keywordFinish:x.keywordFinish,delayMessage:x.delayMessage,unknownMessage:x.unknownMessage,listeningFromMe:x.listeningFromMe,stopBotFromMe:x.stopBotFromMe,keepOpen:x.keepOpen,debounceTime:x.debounceTime,speechToText:x.speechToText,openaiIdFallback:x.openaiIdFallback||void 0,ignoreJids:x.ignoreJids,splitMessages:x.splitMessages,timePerChar:x.timePerChar};await n({instanceName:t.name,token:t.token,data:b}),me.success(e("openai.toast.defaultSettings.success"))}catch(b){console.error("Error:",b),me.error(`Error: ${b?.response?.data?.response?.message}`)}};function g(){l(),d()}return i.jsxs(Pt,{open:r,onOpenChange:s,children:[i.jsx(Bt,{asChild:!0,children:i.jsxs(se,{variant:"secondary",size:"sm",children:[i.jsx(Oo,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden md:inline",children:e("openai.defaultSettings")})]})}),i.jsxs(Nt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:g,children:[i.jsx(Mt,{children:i.jsx(zt,{children:e("openai.defaultSettings")})}),i.jsx(Gn,{...h,children:i.jsxs("form",{className:"w-full space-y-6",onSubmit:h.handleSubmit(m),children:[i.jsx("div",{children:i.jsxs("div",{className:"space-y-4",children:[i.jsx(Jt,{name:"openaiCredsId",label:e("openai.form.openaiCredsId.label"),options:f?.filter(x=>!!x.id).map(x=>({label:x.name?x.name:x.apiKey.substring(0,15)+"...",value:x.id}))||[]}),i.jsx(Jt,{name:"openaiIdFallback",label:e("openai.form.openaiIdFallback.label"),options:u?.filter(x=>!!x.id).map(x=>({label:x.description,value:x.id}))??[]}),i.jsx(le,{name:"expire",label:e("openai.form.expire.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(le,{name:"keywordFinish",label:e("openai.form.keywordFinish.label"),children:i.jsx(ne,{})}),i.jsx(le,{name:"delayMessage",label:e("openai.form.delayMessage.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(le,{name:"unknownMessage",label:e("openai.form.unknownMessage.label"),children:i.jsx(ne,{})}),i.jsx(Pe,{name:"listeningFromMe",label:e("openai.form.listeningFromMe.label"),reverse:!0}),i.jsx(Pe,{name:"stopBotFromMe",label:e("openai.form.stopBotFromMe.label"),reverse:!0}),i.jsx(Pe,{name:"keepOpen",label:e("openai.form.keepOpen.label"),reverse:!0}),i.jsx(Pe,{name:"speechToText",label:e("openai.form.speechToText.label"),reverse:!0}),i.jsx(le,{name:"debounceTime",label:e("openai.form.debounceTime.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(Pe,{name:"splitMessages",label:e("openai.form.splitMessages.label"),reverse:!0}),h.watch("splitMessages")&&i.jsx(le,{name:"timePerChar",label:e("openai.form.timePerChar.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(Da,{name:"ignoreJids",label:e("openai.form.ignoreJids.label"),placeholder:e("openai.form.ignoreJids.placeholder")})]})}),i.jsx(Yt,{children:i.jsx(se,{type:"submit",children:e("openai.button.save")})})]})})]})]})}const gre=e=>["openai","getModels",JSON.stringify(e)],mre=async({instanceName:e,openaiCredsId:t,token:n})=>{const r=t?{openaiCredsId:t}:{};return(await Ee.get(`/openai/getModels/${e}`,{headers:{apiKey:n},params:r})).data},vre=e=>{const{instanceName:t,openaiCredsId:n,token:r,...s}=e;return mt({staleTime:1e3*60*60*6,...s,queryKey:gre({instanceName:t,openaiCredsId:n}),queryFn:()=>mre({instanceName:t,openaiCredsId:n,token:r}),enabled:!!t&&!!n&&(e.enabled??!0)})},yre=e=>["openai","fetchSessions",JSON.stringify(e)],bre=async({instanceName:e,openaiId:t,token:n})=>(await Ee.get(`/openai/fetchSessions/${t}/${e}`,{headers:{apiKey:n}})).data,xre=e=>{const{instanceName:t,token:n,openaiId:r,...s}=e;return mt({...s,queryKey:yre({instanceName:t}),queryFn:()=>bre({instanceName:t,token:n,openaiId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function $I({openaiId:e}){const{t}=Ve(),{instance:n}=ct(),{changeStatusOpenai:r}=Md(),[s,o]=y.useState([]),[l,u]=y.useState(!1),{data:d,refetch:f}=xre({instanceName:n?.name,openaiId:e,enabled:l}),[h,m]=y.useState("");function g(){f()}const x=async(w,C)=>{try{if(!n)return;await r({instanceName:n.name,token:n.token,remoteJid:w,status:C}),me.success(t("openai.toast.success.status")),g()}catch(k){console.error("Error:",k),me.error(`Error : ${k?.response?.data?.response?.message}`)}},b=[{accessorKey:"remoteJid",header:()=>i.jsx("div",{className:"text-center",children:t("openai.sessions.table.remoteJid")}),cell:({row:w})=>i.jsx("div",{children:w.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>i.jsx("div",{className:"text-center",children:t("openai.sessions.table.pushName")}),cell:({row:w})=>i.jsx("div",{children:w.getValue("pushName")})},{accessorKey:"sessionId",header:()=>i.jsx("div",{className:"text-center",children:t("openai.sessions.table.sessionId")}),cell:({row:w})=>i.jsx("div",{children:w.getValue("sessionId")})},{accessorKey:"status",header:()=>i.jsx("div",{className:"text-center",children:t("openai.sessions.table.status")}),cell:({row:w})=>i.jsx("div",{children:w.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:w})=>{const C=w.original;return i.jsxs(Kr,{children:[i.jsx(Wr,{asChild:!0,children:i.jsxs(se,{variant:"ghost",size:"icon",children:[i.jsx("span",{className:"sr-only",children:t("openai.sessions.table.actions.title")}),i.jsx(Pa,{className:"h-4 w-4"})]})}),i.jsxs(hr,{align:"end",children:[i.jsx(Ao,{children:t("openai.sessions.table.actions.title")}),i.jsx(Xs,{}),C.status!=="opened"&&i.jsxs(wt,{onClick:()=>x(C.remoteJid,"opened"),children:[i.jsx(Fi,{className:"mr-2 h-4 w-4"}),t("openai.sessions.table.actions.open")]}),C.status!=="paused"&&C.status!=="closed"&&i.jsxs(wt,{onClick:()=>x(C.remoteJid,"paused"),children:[i.jsx(Di,{className:"mr-2 h-4 w-4"}),t("openai.sessions.table.actions.pause")]}),C.status!=="closed"&&i.jsxs(wt,{onClick:()=>x(C.remoteJid,"closed"),children:[i.jsx(Oi,{className:"mr-2 h-4 w-4"}),t("openai.sessions.table.actions.close")]}),i.jsxs(wt,{onClick:()=>x(C.remoteJid,"delete"),children:[i.jsx(Ii,{className:"mr-2 h-4 w-4"}),t("openai.sessions.table.actions.delete")]})]})]})}}];return i.jsxs(Pt,{open:l,onOpenChange:u,children:[i.jsx(Bt,{asChild:!0,children:i.jsxs(se,{variant:"secondary",size:"sm",children:[i.jsx(Ai,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden md:inline",children:t("openai.sessions.label")})]})}),i.jsxs(Nt,{className:"overflow-y-auto sm:max-w-[950px]",onCloseAutoFocus:g,children:[i.jsx(Mt,{children:i.jsx(zt,{children:t("openai.sessions.label")})}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between gap-6 p-5",children:[i.jsx(ne,{placeholder:t("openai.sessions.search"),value:h,onChange:w=>m(w.target.value)}),i.jsx(se,{variant:"outline",onClick:g,size:"icon",children:i.jsx(Li,{size:16})})]}),i.jsx($a,{columns:b,data:d??[],onSortingChange:o,state:{sorting:s,globalFilter:h},onGlobalFilterChange:m,enableGlobalFilter:!0,noResultsMessage:t("openai.sessions.table.none")})]})]})]})}const wre=P.object({enabled:P.boolean(),description:P.string(),openaiCredsId:P.string(),botType:P.string(),assistantId:P.string().optional(),functionUrl:P.string().optional(),model:P.string().optional(),systemMessages:P.string().optional(),assistantMessages:P.string().optional(),userMessages:P.string().optional(),maxTokens:P.coerce.number().optional(),triggerType:P.string(),triggerOperator:P.string().optional(),triggerValue:P.string().optional(),expire:P.coerce.number().optional(),keywordFinish:P.string().optional(),delayMessage:P.coerce.number().optional(),unknownMessage:P.string().optional(),listeningFromMe:P.boolean().optional(),stopBotFromMe:P.boolean().optional(),keepOpen:P.boolean().optional(),debounceTime:P.coerce.number().optional(),splitMessages:P.boolean().optional(),timePerChar:P.coerce.number().optional()});function BI({initialData:e,onSubmit:t,handleDelete:n,openaiId:r,isModal:s=!1,isLoading:o=!1,openDeletionDialog:l=!1,setOpenDeletionDialog:u=()=>{},open:d}){const{t:f}=Ve(),{instance:h}=ct(),[m,g]=y.useState(!1),{data:x,refetch:b}=dw({instanceName:h?.name,enabled:d}),w=on({resolver:an(wre),defaultValues:e||{enabled:!0,description:"",openaiCredsId:"",botType:"assistant",assistantId:"",functionUrl:"",model:"",systemMessages:"",assistantMessages:"",userMessages:"",maxTokens:0,triggerType:"keyword",triggerOperator:"contains",triggerValue:"",expire:0,keywordFinish:"",delayMessage:0,unknownMessage:"",listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0,splitMessages:!1,timePerChar:0}}),C=w.watch("botType"),k=w.watch("triggerType"),j=w.watch("openaiCredsId"),{data:M,isLoading:_,refetch:R}=vre({instanceName:h?.name,openaiCredsId:j,token:h?.token,enabled:m&&!!j}),N=()=>{j&&(g(!0),R())},O=()=>{b()};return i.jsx(Gn,{...w,children:i.jsxs("form",{onSubmit:w.handleSubmit(t),className:"w-full space-y-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx(Pe,{name:"enabled",label:f("openai.form.enabled.label"),reverse:!0}),i.jsx(le,{name:"description",label:f("openai.form.description.label"),required:!0,children:i.jsx(ne,{})}),i.jsx("div",{className:"space-y-2",children:i.jsxs("div",{className:"flex items-end gap-2",children:[i.jsx("div",{className:"flex-1",children:i.jsx(Jt,{name:"openaiCredsId",label:f("openai.form.openaiCredsId.label"),required:!0,options:x?.filter(D=>!!D.id).map(D=>({label:D.name?D.name:D.apiKey.substring(0,15)+"...",value:D.id}))??[]})}),i.jsx(LI,{onCredentialsUpdate:O,showText:!1})]})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:f("openai.form.openaiSettings.label")}),i.jsx($t,{})]}),i.jsx(Jt,{name:"botType",label:f("openai.form.botType.label"),required:!0,options:[{label:f("openai.form.botType.assistant"),value:"assistant"},{label:f("openai.form.botType.chatCompletion"),value:"chatCompletion"}]}),C==="assistant"&&i.jsxs(i.Fragment,{children:[i.jsx(le,{name:"assistantId",label:f("openai.form.assistantId.label"),required:!0,children:i.jsx(ne,{})}),i.jsx(le,{name:"functionUrl",label:f("openai.form.functionUrl.label"),required:!0,children:i.jsx(ne,{})})]}),C==="chatCompletion"&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"space-y-2",children:i.jsxs("div",{className:"flex items-end gap-2",children:[i.jsx("div",{className:"flex-1",children:i.jsx(Jt,{name:"model",label:f("openai.form.model.label"),required:!0,disabled:!M||M.length===0,options:M?.map(D=>({label:D.id,value:D.id}))??[]})}),i.jsx(se,{type:"button",variant:"outline",size:"sm",disabled:!j||_,onClick:N,className:"mb-2",children:_?i.jsxs(i.Fragment,{children:[i.jsx(Ip,{className:"mr-2 h-4 w-4 animate-spin"}),f("openai.button.loading")]}):i.jsxs(i.Fragment,{children:[i.jsx(Ip,{className:"mr-2 h-4 w-4"}),f("openai.button.loadModels")]})})]})}),i.jsx(le,{name:"systemMessages",label:f("openai.form.systemMessages.label"),children:i.jsx(bi,{})}),i.jsx(le,{name:"assistantMessages",label:f("openai.form.assistantMessages.label"),children:i.jsx(bi,{})}),i.jsx(le,{name:"userMessages",label:f("openai.form.userMessages.label"),children:i.jsx(bi,{})}),i.jsx(le,{name:"maxTokens",label:f("openai.form.maxTokens.label"),children:i.jsx(ne,{type:"number"})})]}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:f("openai.form.triggerSettings.label")}),i.jsx($t,{})]}),i.jsx(Jt,{name:"triggerType",label:f("openai.form.triggerType.label"),required:!0,options:[{label:f("openai.form.triggerType.keyword"),value:"keyword"},{label:f("openai.form.triggerType.all"),value:"all"},{label:f("openai.form.triggerType.advanced"),value:"advanced"},{label:f("openai.form.triggerType.none"),value:"none"}]}),k==="keyword"&&i.jsxs(i.Fragment,{children:[i.jsx(Jt,{name:"triggerOperator",label:f("openai.form.triggerOperator.label"),required:!0,options:[{label:f("openai.form.triggerOperator.contains"),value:"contains"},{label:f("openai.form.triggerOperator.equals"),value:"equals"},{label:f("openai.form.triggerOperator.startsWith"),value:"startsWith"},{label:f("openai.form.triggerOperator.endsWith"),value:"endsWith"},{label:f("openai.form.triggerOperator.regex"),value:"regex"}]}),i.jsx(le,{name:"triggerValue",label:f("openai.form.triggerValue.label"),required:!0,children:i.jsx(ne,{})})]}),k==="advanced"&&i.jsx(le,{name:"triggerValue",label:f("openai.form.triggerConditions.label"),required:!0,children:i.jsx(ne,{})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:f("openai.form.generalSettings.label")}),i.jsx($t,{})]}),i.jsx(le,{name:"expire",label:f("openai.form.expire.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(le,{name:"keywordFinish",label:f("openai.form.keywordFinish.label"),children:i.jsx(ne,{})}),i.jsx(le,{name:"delayMessage",label:f("openai.form.delayMessage.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(le,{name:"unknownMessage",label:f("openai.form.unknownMessage.label"),children:i.jsx(ne,{})}),i.jsx(Pe,{name:"listeningFromMe",label:f("openai.form.listeningFromMe.label"),reverse:!0}),i.jsx(Pe,{name:"stopBotFromMe",label:f("openai.form.stopBotFromMe.label"),reverse:!0}),i.jsx(Pe,{name:"keepOpen",label:f("openai.form.keepOpen.label"),reverse:!0}),i.jsx(le,{name:"debounceTime",label:f("openai.form.debounceTime.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(Pe,{name:"splitMessages",label:f("openai.form.splitMessages.label"),reverse:!0}),w.watch("splitMessages")&&i.jsx(le,{name:"timePerChar",label:f("openai.form.timePerChar.label"),children:i.jsx(ne,{type:"number"})})]}),s&&i.jsx(Yt,{children:i.jsx(se,{disabled:o,type:"submit",children:f(o?"openai.button.saving":"openai.button.save")})}),!s&&i.jsxs("div",{children:[i.jsx($I,{openaiId:r}),i.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[i.jsxs(Pt,{open:l,onOpenChange:u,children:[i.jsx(Bt,{asChild:!0,children:i.jsx(se,{variant:"destructive",size:"sm",children:f("dify.button.delete")})}),i.jsx(Nt,{children:i.jsxs(Mt,{children:[i.jsx(zt,{children:f("modal.delete.title")}),i.jsx(eo,{children:f("modal.delete.messageSingle")}),i.jsxs(Yt,{children:[i.jsx(se,{size:"sm",variant:"outline",onClick:()=>u(!1),children:f("button.cancel")}),i.jsx(se,{variant:"destructive",onClick:n,children:f("button.delete")})]})]})})]}),i.jsx(se,{disabled:o,type:"submit",children:f(o?"openai.button.saving":"openai.button.update")})]})]})]})})}function Sre({resetTable:e}){const{t}=Ve(),{instance:n}=ct(),{createOpenai:r}=Md(),[s,o]=y.useState(!1),[l,u]=y.useState(!1),d=async f=>{try{if(!n||!n.name)throw new Error("instance not found");o(!0);const h={enabled:f.enabled,description:f.description,openaiCredsId:f.openaiCredsId,botType:f.botType,assistantId:f.assistantId||"",functionUrl:f.functionUrl||"",model:f.model||"",systemMessages:[f.systemMessages||""],assistantMessages:[f.assistantMessages||""],userMessages:[f.userMessages||""],maxTokens:f.maxTokens||0,triggerType:f.triggerType,triggerOperator:f.triggerOperator||"",triggerValue:f.triggerValue||"",expire:f.expire||0,keywordFinish:f.keywordFinish||"",delayMessage:f.delayMessage||0,unknownMessage:f.unknownMessage||"",listeningFromMe:f.listeningFromMe||!1,stopBotFromMe:f.stopBotFromMe||!1,keepOpen:f.keepOpen||!1,debounceTime:f.debounceTime||0,splitMessages:f.splitMessages||!1,timePerChar:f.timePerChar||0};await r({instanceName:n.name,token:n.token,data:h}),me.success(t("openai.toast.success.create")),u(!1),e()}catch(h){console.error("Error:",h),me.error(`Error: ${h?.response?.data?.response?.message}`)}finally{o(!1)}};return i.jsxs(Pt,{open:l,onOpenChange:u,children:[i.jsx(Bt,{asChild:!0,children:i.jsxs(se,{size:"sm",children:[i.jsx(cs,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:t("openai.button.create")})]})}),i.jsxs(Nt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[i.jsx(Mt,{children:i.jsx(zt,{children:t("openai.form.title")})}),i.jsx(BI,{onSubmit:d,isModal:!0,isLoading:s,open:l})]})]})}const Cre=e=>["openai","getOpenai",JSON.stringify(e)],Ere=async({instanceName:e,token:t,openaiId:n})=>{const r=await Ee.get(`/openai/fetch/${n}/${e}`,{headers:{apiKey:t}});return Array.isArray(r.data)?r.data[0]:r.data},kre=e=>{const{instanceName:t,token:n,openaiId:r,...s}=e;return mt({...s,queryKey:Cre({instanceName:t}),queryFn:()=>Ere({instanceName:t,token:n,openaiId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function jre({openaiId:e,resetTable:t}){const{t:n}=Ve(),{instance:r}=ct(),s=dn(),[o,l]=y.useState(!1),{deleteOpenai:u,updateOpenai:d}=Md(),{data:f,isLoading:h}=kre({instanceName:r?.name,openaiId:e}),m=y.useMemo(()=>({enabled:f?.enabled??!0,description:f?.description??"",openaiCredsId:f?.openaiCredsId??"",botType:f?.botType??"",assistantId:f?.assistantId||"",functionUrl:f?.functionUrl||"",model:f?.model||"",systemMessages:Array.isArray(f?.systemMessages)?f?.systemMessages.join(", "):f?.systemMessages||"",assistantMessages:Array.isArray(f?.assistantMessages)?f?.assistantMessages.join(", "):f?.assistantMessages||"",userMessages:Array.isArray(f?.userMessages)?f?.userMessages.join(", "):f?.userMessages||"",maxTokens:f?.maxTokens||0,triggerType:f?.triggerType||"",triggerOperator:f?.triggerOperator||"",triggerValue:f?.triggerValue,expire:f?.expire||0,keywordFinish:f?.keywordFinish,delayMessage:f?.delayMessage||0,unknownMessage:f?.unknownMessage,listeningFromMe:f?.listeningFromMe,stopBotFromMe:f?.stopBotFromMe,keepOpen:f?.keepOpen,debounceTime:f?.debounceTime||0,splitMessages:f?.splitMessages||!1,timePerChar:f?.timePerChar||0}),[f?.assistantId,f?.assistantMessages,f?.botType,f?.debounceTime,f?.delayMessage,f?.description,f?.enabled,f?.expire,f?.functionUrl,f?.keepOpen,f?.keywordFinish,f?.listeningFromMe,f?.maxTokens,f?.model,f?.openaiCredsId,f?.stopBotFromMe,f?.systemMessages,f?.triggerOperator,f?.triggerType,f?.triggerValue,f?.unknownMessage,f?.userMessages,f?.splitMessages,f?.timePerChar]),g=async b=>{try{if(r&&r.name&&e){const w={enabled:b.enabled,description:b.description,openaiCredsId:b.openaiCredsId,botType:b.botType,assistantId:b.assistantId||"",functionUrl:b.functionUrl||"",model:b.model||"",systemMessages:[b.systemMessages||""],assistantMessages:[b.assistantMessages||""],userMessages:[b.userMessages||""],maxTokens:b.maxTokens||0,triggerType:b.triggerType,triggerOperator:b.triggerOperator||"",triggerValue:b.triggerValue||"",expire:b.expire||0,keywordFinish:b.keywordFinish||"",delayMessage:b.delayMessage||1e3,unknownMessage:b.unknownMessage||"",listeningFromMe:b.listeningFromMe||!1,stopBotFromMe:b.stopBotFromMe||!1,keepOpen:b.keepOpen||!1,debounceTime:b.debounceTime||0,splitMessages:b.splitMessages||!1,timePerChar:b.timePerChar||0};await d({instanceName:r.name,openaiId:e,data:w}),me.success(n("openai.toast.success.update")),t(),s(`/manager/instance/${r.id}/openai/${e}`)}else console.error("Token not found")}catch(w){console.error("Error:",w),me.error(`Error: ${w?.response?.data?.response?.message}`)}},x=async()=>{try{r&&r.name&&e?(await u({instanceName:r.name,openaiId:e}),me.success(n("openai.toast.success.delete")),l(!1),t(),s(`/manager/instance/${r.id}/openai`)):console.error("instance not found")}catch(b){console.error("Erro ao excluir dify:",b)}};return h?i.jsx(On,{}):i.jsx("div",{className:"m-4",children:i.jsx(BI,{initialData:m,onSubmit:g,openaiId:e,handleDelete:x,isModal:!1,isLoading:h,openDeletionDialog:o,setOpenDeletionDialog:l})})}function Tk(){const{t:e}=Ve(),t=zo("(min-width: 768px)"),{instance:n}=ct(),{botId:r}=ls(),{data:s,isLoading:o,refetch:l}=FI({instanceName:n?.name}),u=dn(),d=h=>{n&&u(`/manager/instance/${n.id}/openai/${h}`)},f=()=>{l()};return i.jsxs("main",{className:"pt-5",children:[i.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[i.jsx("h3",{className:"text-lg font-medium",children:e("openai.title")}),i.jsxs("div",{className:"flex items-center justify-end gap-2",children:[i.jsx($I,{}),i.jsx(hre,{}),i.jsx(LI,{}),i.jsx(Sre,{resetTable:f})]})]}),i.jsx($t,{className:"my-4"}),i.jsxs($o,{direction:t?"horizontal":"vertical",children:[i.jsx(Hn,{defaultSize:35,className:"pr-4",children:i.jsx("div",{className:"flex flex-col gap-3",children:o?i.jsx(On,{}):i.jsx(i.Fragment,{children:s&&s.length>0&&Array.isArray(s)?s.map(h=>i.jsxs(se,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>d(`${h.id}`),variant:r===h.id?"secondary":"outline",children:[i.jsx("h4",{className:"text-base",children:h.description||h.id}),i.jsx("p",{className:"text-sm font-normal text-muted-foreground",children:h.botType})]},h.id)):i.jsx(se,{variant:"link",children:e("openai.table.none")})})})}),r&&i.jsxs(i.Fragment,{children:[i.jsx(Bo,{withHandle:!0,className:"border border-border"}),i.jsx(Hn,{children:i.jsx(jre,{openaiId:r,resetTable:f})})]})]})]})}const Tre=e=>["proxy","fetchProxy",JSON.stringify(e)],Nre=async({instanceName:e,token:t})=>(await Ee.get(`/proxy/find/${e}`,{headers:{apiKey:t}})).data,Mre=e=>{const{instanceName:t,token:n,...r}=e;return mt({...r,queryKey:Tre({instanceName:t,token:n}),queryFn:()=>Nre({instanceName:t,token:n}),enabled:!!t})},_re=async({instanceName:e,token:t,data:n})=>(await Ee.post(`/proxy/set/${e}`,n,{headers:{apikey:t}})).data;function Rre(){return{createProxy:nt(_re,{invalidateKeys:[["proxy","fetchProxy"]]})}}const Pre=P.object({enabled:P.boolean(),host:P.string(),port:P.string(),protocol:P.string(),username:P.string(),password:P.string()});function Ore(){const{t:e}=Ve(),{instance:t}=ct(),[n,r]=y.useState(!1),{createProxy:s}=Rre(),{data:o}=Mre({instanceName:t?.name}),l=on({resolver:an(Pre),defaultValues:{enabled:!1,host:"",port:"",protocol:"http",username:"",password:""}});y.useEffect(()=>{o&&l.reset({enabled:o.enabled,host:o.host,port:o.port,protocol:o.protocol,username:o.username,password:o.password})},[o]);const u=async d=>{if(t){r(!0);try{const f={enabled:d.enabled,host:d.host,port:d.port,protocol:d.protocol,username:d.username,password:d.password};await s({instanceName:t.name,token:t.token,data:f}),me.success(e("proxy.toast.success"))}catch(f){console.error(e("proxy.toast.error"),f),me.error(`Error : ${f?.response?.data?.response?.message}`)}finally{r(!1)}}};return i.jsx(i.Fragment,{children:i.jsx(Fo,{...l,children:i.jsx("form",{onSubmit:l.handleSubmit(u),className:"w-full space-y-6",children:i.jsxs("div",{children:[i.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("proxy.title")}),i.jsx(Oa,{className:"my-4"}),i.jsxs("div",{className:"mx-4 space-y-2 divide-y [&>*]:p-4",children:[i.jsx(Pe,{name:"enabled",label:e("proxy.form.enabled.label"),className:"w-full justify-between",helper:e("proxy.form.enabled.description")}),i.jsxs("div",{className:"grid gap-4 sm:grid-cols-[10rem_1fr_10rem] md:gap-8",children:[i.jsx(le,{name:"protocol",label:e("proxy.form.protocol.label"),children:i.jsx(ne,{})}),i.jsx(le,{name:"host",label:e("proxy.form.host.label"),children:i.jsx(ne,{})}),i.jsx(le,{name:"port",label:e("proxy.form.port.label"),children:i.jsx(ne,{type:"number"})})]}),i.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 md:gap-8",children:[i.jsx(le,{name:"username",label:e("proxy.form.username.label"),children:i.jsx(ne,{})}),i.jsx(le,{name:"password",label:e("proxy.form.password.label"),children:i.jsx(ne,{type:"password"})})]}),i.jsx("div",{className:"flex justify-end px-4 pt-6",children:i.jsx(se,{type:"submit",disabled:n,children:e(n?"proxy.button.saving":"proxy.button.save")})})]})]})})})})}const Ire=e=>["rabbitmq","fetchRabbitmq",JSON.stringify(e)],Are=async({instanceName:e,token:t})=>(await Ee.get(`/rabbitmq/find/${e}`,{headers:{apiKey:t}})).data,Dre=e=>{const{instanceName:t,token:n,...r}=e;return mt({...r,queryKey:Ire({instanceName:t,token:n}),queryFn:()=>Are({instanceName:t,token:n}),enabled:!!t})},Fre=async({instanceName:e,token:t,data:n})=>(await Ee.post(`/rabbitmq/set/${e}`,{rabbitmq:n},{headers:{apikey:t}})).data;function Lre(){return{createRabbitmq:nt(Fre,{invalidateKeys:[["rabbitmq","fetchRabbitmq"]]})}}const $re=P.object({enabled:P.boolean(),events:P.array(P.string())});function Bre(){const{t:e}=Ve(),{instance:t}=ct(),[n,r]=y.useState(!1),{createRabbitmq:s}=Lre(),{data:o}=Dre({instanceName:t?.name,token:t?.token}),l=on({resolver:an($re),defaultValues:{enabled:!1,events:[]}});y.useEffect(()=>{o&&l.reset({enabled:o.enabled,events:o.events})},[o]);const u=async m=>{if(t){r(!0);try{const g={enabled:m.enabled,events:m.events};await s({instanceName:t.name,token:t.token,data:g}),me.success(e("rabbitmq.toast.success"))}catch(g){console.error(e("rabbitmq.toast.error"),g),me.error(`Error: ${g?.response?.data?.response?.message}`)}finally{r(!1)}}},d=["APPLICATION_STARTUP","QRCODE_UPDATED","MESSAGES_SET","MESSAGES_UPSERT","MESSAGES_UPDATE","MESSAGES_DELETE","SEND_MESSAGE","CONTACTS_SET","CONTACTS_UPSERT","CONTACTS_UPDATE","PRESENCE_UPDATE","CHATS_SET","CHATS_UPSERT","CHATS_UPDATE","CHATS_DELETE","GROUPS_UPSERT","GROUP_UPDATE","GROUP_PARTICIPANTS_UPDATE","CONNECTION_UPDATE","REMOVE_INSTANCE","LOGOUT_INSTANCE","LABELS_EDIT","LABELS_ASSOCIATION","CALL","TYPEBOT_START","TYPEBOT_CHANGE_STATUS"],f=()=>{l.setValue("events",d)},h=()=>{l.setValue("events",[])};return i.jsx(i.Fragment,{children:i.jsx(Fo,{...l,children:i.jsx("form",{onSubmit:l.handleSubmit(u),className:"w-full space-y-6",children:i.jsxs("div",{children:[i.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("rabbitmq.title")}),i.jsx(Oa,{className:"my-4"}),i.jsxs("div",{className:"mx-4 space-y-2 divide-y [&>*]:p-4",children:[i.jsx(Pe,{name:"enabled",label:e("rabbitmq.form.enabled.label"),className:"w-full justify-between",helper:e("rabbitmq.form.enabled.description")}),i.jsxs("div",{className:"mb-4 flex justify-between",children:[i.jsx(se,{variant:"outline",type:"button",onClick:f,children:e("button.markAll")}),i.jsx(se,{variant:"outline",type:"button",onClick:h,children:e("button.unMarkAll")})]}),i.jsx(Lo,{control:l.control,name:"events",render:({field:m})=>i.jsxs(no,{className:"flex flex-col",children:[i.jsx(Nr,{className:"my-2 text-lg",children:e("rabbitmq.form.events.label")}),i.jsx(_s,{children:i.jsx("div",{className:"flex flex-col gap-2 space-y-1 divide-y",children:d.sort((g,x)=>g.localeCompare(x)).map(g=>i.jsxs("div",{className:"flex items-center justify-between gap-3 pt-3",children:[i.jsx(Nr,{className:Ie("break-all",m.value.includes(g)?"text-foreground":"text-muted-foreground"),children:g}),i.jsx(gc,{checked:m.value.includes(g),onCheckedChange:x=>{x?m.onChange([...m.value,g]):m.onChange(m.value.filter(b=>b!==g))}})]},g))})})]})})]}),i.jsx("div",{className:"mx-4 flex justify-end pt-6",children:i.jsx(se,{type:"submit",disabled:n,children:e(n?"rabbitmq.button.saving":"rabbitmq.button.save")})})]})})})})}const zre=e=>["instance","fetchSettings",JSON.stringify(e)],Ure=async({instanceName:e,token:t})=>(await Ee.get(`/settings/find/${e}`,{headers:{apikey:t}})).data,Vre=e=>{const{instanceName:t,token:n,...r}=e;return mt({...r,queryKey:zre({instanceName:t,token:n}),queryFn:()=>Ure({instanceName:t,token:n}),enabled:!!t})},Hre=P.object({rejectCall:P.boolean(),msgCall:P.string().optional(),groupsIgnore:P.boolean(),alwaysOnline:P.boolean(),readMessages:P.boolean(),syncFullHistory:P.boolean(),readStatus:P.boolean()});function qre(){const{t:e}=Ve(),[t,n]=y.useState(!1),{instance:r}=ct(),{updateSettings:s}=Hh(),{data:o,isLoading:l}=Vre({instanceName:r?.name,token:r?.token}),u=on({resolver:an(Hre),defaultValues:{rejectCall:!1,msgCall:"",groupsIgnore:!1,alwaysOnline:!1,readMessages:!1,syncFullHistory:!1,readStatus:!1}});y.useEffect(()=>{o&&u.reset({rejectCall:o.rejectCall,msgCall:o.msgCall||"",groupsIgnore:o.groupsIgnore,alwaysOnline:o.alwaysOnline,readMessages:o.readMessages,syncFullHistory:o.syncFullHistory,readStatus:o.readStatus})},[u,o]);const d=async m=>{try{if(!r||!r.name)throw new Error("instance not found");n(!0);const g={rejectCall:m.rejectCall,msgCall:m.msgCall,groupsIgnore:m.groupsIgnore,alwaysOnline:m.alwaysOnline,readMessages:m.readMessages,syncFullHistory:m.syncFullHistory,readStatus:m.readStatus};await s({instanceName:r.name,token:r.token,data:g}),me.success(e("settings.toast.success"))}catch(g){console.error(e("settings.toast.success"),g),me.error(e("settings.toast.error"))}finally{n(!1)}},f=[{name:"groupsIgnore",label:e("settings.form.groupsIgnore.label"),description:e("settings.form.groupsIgnore.description")},{name:"alwaysOnline",label:e("settings.form.alwaysOnline.label"),description:e("settings.form.alwaysOnline.description")},{name:"readMessages",label:e("settings.form.readMessages.label"),description:e("settings.form.readMessages.description")},{name:"syncFullHistory",label:e("settings.form.syncFullHistory.label"),description:e("settings.form.syncFullHistory.description")},{name:"readStatus",label:e("settings.form.readStatus.label"),description:e("settings.form.readStatus.description")}],h=u.watch("rejectCall");return l?i.jsx(On,{}):i.jsx(i.Fragment,{children:i.jsx(Fo,{...u,children:i.jsx("form",{onSubmit:u.handleSubmit(d),className:"w-full space-y-6",children:i.jsxs("div",{children:[i.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("settings.title")}),i.jsx($t,{className:"my-4"}),i.jsxs("div",{className:"mx-4 space-y-2 divide-y",children:[i.jsxs("div",{className:"flex flex-col p-4",children:[i.jsx(Pe,{name:"rejectCall",label:e("settings.form.rejectCall.label"),className:"w-full justify-between",helper:e("settings.form.rejectCall.description")}),h&&i.jsx("div",{className:"mr-16 mt-2",children:i.jsx(le,{name:"msgCall",children:i.jsx(bi,{placeholder:e("settings.form.msgCall.description")})})})]}),f.map(m=>i.jsx("div",{className:"flex p-4",children:i.jsx(Pe,{name:m.name,label:m.label,className:"w-full justify-between",helper:m.description})},m.name)),i.jsx("div",{className:"flex justify-end pt-6",children:i.jsx(se,{type:"submit",disabled:t,children:e(t?"settings.button.saving":"settings.button.save")})})]})]})})})})}const Kre=e=>["sqs","fetchSqs",JSON.stringify(e)],Wre=async({instanceName:e,token:t})=>(await Ee.get(`/sqs/find/${e}`,{headers:{apiKey:t}})).data,Gre=e=>{const{instanceName:t,token:n,...r}=e;return mt({...r,queryKey:Kre({instanceName:t,token:n}),queryFn:()=>Wre({instanceName:t,token:n}),enabled:!!t})},Jre=async({instanceName:e,token:t,data:n})=>(await Ee.post(`/sqs/set/${e}`,{sqs:n},{headers:{apikey:t}})).data;function Qre(){return{createSqs:nt(Jre,{invalidateKeys:[["sqs","fetchSqs"]]})}}const Zre=P.object({enabled:P.boolean(),events:P.array(P.string())});function Yre(){const{t:e}=Ve(),{instance:t}=ct(),[n,r]=y.useState(!1),{createSqs:s}=Qre(),{data:o}=Gre({instanceName:t?.name,token:t?.token}),l=on({resolver:an(Zre),defaultValues:{enabled:!1,events:[]}});y.useEffect(()=>{o&&l.reset({enabled:o.enabled,events:o.events})},[o]);const u=async m=>{if(t){r(!0);try{const g={enabled:m.enabled,events:m.events};await s({instanceName:t.name,token:t.token,data:g}),me.success(e("sqs.toast.success"))}catch(g){console.error(e("sqs.toast.error"),g),me.error(`Error: ${g?.response?.data?.response?.message}`)}finally{r(!1)}}},d=["APPLICATION_STARTUP","QRCODE_UPDATED","MESSAGES_SET","MESSAGES_UPSERT","MESSAGES_UPDATE","MESSAGES_DELETE","SEND_MESSAGE","CONTACTS_SET","CONTACTS_UPSERT","CONTACTS_UPDATE","PRESENCE_UPDATE","CHATS_SET","CHATS_UPSERT","CHATS_UPDATE","CHATS_DELETE","GROUPS_UPSERT","GROUP_UPDATE","GROUP_PARTICIPANTS_UPDATE","CONNECTION_UPDATE","REMOVE_INSTANCE","LOGOUT_INSTANCE","LABELS_EDIT","LABELS_ASSOCIATION","CALL","TYPEBOT_START","TYPEBOT_CHANGE_STATUS"],f=()=>{l.setValue("events",d)},h=()=>{l.setValue("events",[])};return i.jsx(i.Fragment,{children:i.jsx(Fo,{...l,children:i.jsx("form",{onSubmit:l.handleSubmit(u),className:"w-full space-y-6",children:i.jsxs("div",{children:[i.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("sqs.title")}),i.jsx(Oa,{className:"my-4"}),i.jsxs("div",{className:"mx-4 space-y-2 divide-y [&>*]:p-4",children:[i.jsx(Pe,{name:"enabled",label:e("sqs.form.enabled.label"),className:"w-full justify-between",helper:e("sqs.form.enabled.description")}),i.jsxs("div",{className:"mb-4 flex justify-between",children:[i.jsx(se,{variant:"outline",type:"button",onClick:f,children:e("button.markAll")}),i.jsx(se,{variant:"outline",type:"button",onClick:h,children:e("button.unMarkAll")})]}),i.jsx(Lo,{control:l.control,name:"events",render:({field:m})=>i.jsxs(no,{className:"flex flex-col",children:[i.jsx(Nr,{className:"my-2 text-lg",children:e("sqs.form.events.label")}),i.jsx(_s,{children:i.jsx("div",{className:"flex flex-col gap-2 space-y-1 divide-y",children:d.sort((g,x)=>g.localeCompare(x)).map(g=>i.jsxs("div",{className:"flex items-center justify-between gap-3 pt-3",children:[i.jsx(Nr,{className:Ie("break-all",m.value.includes(g)?"text-foreground":"text-muted-foreground"),children:g}),i.jsx(gc,{checked:m.value.includes(g),onCheckedChange:x=>{x?m.onChange([...m.value,g]):m.onChange(m.value.filter(b=>b!==g))}})]},g))})})]})})]}),i.jsx("div",{className:"mx-4 flex justify-end pt-6",children:i.jsx(se,{type:"submit",disabled:n,children:e(n?"sqs.button.saving":"sqs.button.save")})})]})})})})}const Xre=e=>["typebot","findTypebot",JSON.stringify(e)],ese=async({instanceName:e,token:t})=>(await Ee.get(`/typebot/find/${e}`,{headers:{apiKey:t}})).data,zI=e=>{const{instanceName:t,token:n,...r}=e;return mt({...r,queryKey:Xre({instanceName:t}),queryFn:()=>ese({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},tse=e=>["typebot","fetchDefaultSettings",JSON.stringify(e)],nse=async({instanceName:e,token:t})=>{const n=await Ee.get(`/typebot/fetchSettings/${e}`,{headers:{apiKey:t}});return Array.isArray(n.data)?n.data[0]:n.data},rse=e=>{const{instanceName:t,token:n,...r}=e;return mt({...r,queryKey:tse({instanceName:t}),queryFn:()=>nse({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},sse=async({instanceName:e,token:t,data:n})=>(await Ee.post(`/typebot/create/${e}`,n,{headers:{apikey:t}})).data,ose=async({instanceName:e,token:t,typebotId:n,data:r})=>(await Ee.put(`/typebot/update/${n}/${e}`,r,{headers:{apikey:t}})).data,ase=async({instanceName:e,typebotId:t})=>(await Ee.delete(`/typebot/delete/${t}/${e}`)).data,ise=async({instanceName:e,token:t,data:n})=>(await Ee.post(`/typebot/settings/${e}`,n,{headers:{apikey:t}})).data,lse=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await Ee.post(`/typebot/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function Eg(){const e=nt(ise,{invalidateKeys:[["typebot","fetchDefaultSettings"]]}),t=nt(lse,{invalidateKeys:[["typebot","getTypebot"],["typebot","fetchSessions"]]}),n=nt(ase,{invalidateKeys:[["typebot","getTypebot"],["typebot","findTypebot"],["typebot","fetchSessions"]]}),r=nt(ose,{invalidateKeys:[["typebot","getTypebot"],["typebot","findTypebot"],["typebot","fetchSessions"]]}),s=nt(sse,{invalidateKeys:[["typebot","findTypebot"]]});return{setDefaultSettingsTypebot:e,changeStatusTypebot:t,deleteTypebot:n,updateTypebot:r,createTypebot:s}}const cse=P.object({expire:P.coerce.number(),keywordFinish:P.string(),delayMessage:P.coerce.number(),unknownMessage:P.string(),listeningFromMe:P.boolean(),stopBotFromMe:P.boolean(),keepOpen:P.boolean(),debounceTime:P.coerce.number()});function use(){const{t:e}=Ve(),{instance:t}=ct(),[n,r]=y.useState(!1),{setDefaultSettingsTypebot:s}=Eg(),{data:o,refetch:l}=rse({instanceName:t?.name,token:t?.token,enabled:n}),{data:u,refetch:d}=zI({instanceName:t?.name,token:t?.token,enabled:n}),f=on({resolver:an(cse),defaultValues:{expire:0,keywordFinish:e("typebot.form.examples.keywordFinish"),delayMessage:1e3,unknownMessage:e("typebot.form.examples.unknownMessage"),listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0}});y.useEffect(()=>{o&&f.reset({expire:o?.expire??0,keywordFinish:o.keywordFinish,delayMessage:o.delayMessage??0,unknownMessage:o.unknownMessage,listeningFromMe:o.listeningFromMe,stopBotFromMe:o.stopBotFromMe,keepOpen:o.keepOpen,debounceTime:o.debounceTime??0})},[o]);const h=async g=>{try{if(!t||!t.name)throw new Error("instance not found.");const x={expire:g.expire,keywordFinish:g.keywordFinish,delayMessage:g.delayMessage,unknownMessage:g.unknownMessage,listeningFromMe:g.listeningFromMe,stopBotFromMe:g.stopBotFromMe,keepOpen:g.keepOpen,debounceTime:g.debounceTime};await s({instanceName:t.name,token:t.token,data:x}),me.success(e("typebot.toast.defaultSettings.success"))}catch(x){console.error(e("typebot.toast.defaultSettings.error"),x),me.error(`Error: ${x?.response?.data?.response?.message}`)}};function m(){l(),d()}return i.jsxs(Pt,{open:n,onOpenChange:r,children:[i.jsx(Bt,{asChild:!0,children:i.jsxs(se,{variant:"secondary",size:"sm",children:[i.jsx(Oo,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:e("typebot.button.defaultSettings")})]})}),i.jsxs(Nt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:m,children:[i.jsx(Mt,{children:i.jsx(zt,{children:e("typebot.modal.defaultSettings.title")})}),i.jsx(Gn,{...f,children:i.jsxs("form",{className:"w-full space-y-6",onSubmit:f.handleSubmit(h),children:[i.jsx("div",{children:i.jsxs("div",{className:"space-y-4",children:[i.jsx(Jt,{name:"typebotIdFallback",label:e("typebot.form.typebotIdFallback.label"),options:u?.filter(g=>!!g.id).map(g=>({label:g.typebot,value:g.description}))??[]}),i.jsx(le,{name:"expire",label:e("typebot.form.expire.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(le,{name:"keywordFinish",label:e("typebot.form.keywordFinish.label"),children:i.jsx(ne,{})}),i.jsx(le,{name:"delayMessage",label:e("typebot.form.delayMessage.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(le,{name:"unknownMessage",label:e("typebot.form.unknownMessage.label"),children:i.jsx(ne,{})}),i.jsx(Pe,{name:"listeningFromMe",label:e("typebot.form.listeningFromMe.label"),reverse:!0}),i.jsx(Pe,{name:"stopBotFromMe",label:e("typebot.form.stopBotFromMe.label"),reverse:!0}),i.jsx(Pe,{name:"keepOpen",label:e("typebot.form.keepOpen.label"),reverse:!0}),i.jsx(le,{name:"debounceTime",label:e("typebot.form.debounceTime.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(Da,{name:"ignoreJids",label:e("typebot.form.ignoreJids.label"),placeholder:e("typebot.form.ignoreJids.placeholder")})]})}),i.jsx(Yt,{children:i.jsx(se,{type:"submit",children:e("typebot.button.save")})})]})})]})]})}const dse=e=>["typebot","fetchSessions",JSON.stringify(e)],fse=async({instanceName:e,typebotId:t,token:n})=>(await Ee.get(`/typebot/fetchSessions/${t}/${e}`,{headers:{apiKey:n}})).data,pse=e=>{const{instanceName:t,token:n,typebotId:r,...s}=e;return mt({...s,queryKey:dse({instanceName:t}),queryFn:()=>fse({instanceName:t,token:n,typebotId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function UI({typebotId:e}){const{t}=Ve(),{instance:n}=ct(),[r,s]=y.useState([]),[o,l]=y.useState(!1),[u,d]=y.useState(""),{changeStatusTypebot:f}=Eg(),{data:h,refetch:m}=pse({instanceName:n?.name,token:n?.token,typebotId:e});function g(){m()}const x=async(w,C)=>{try{if(!n)return;await f({instanceName:n.name,token:n.token,remoteJid:w,status:C}),me.success(t("typebot.toast.success.status")),g()}catch(k){console.error("Error:",k),me.error(`Error : ${k?.response?.data?.response?.message}`)}},b=[{accessorKey:"remoteJid",header:()=>i.jsx("div",{className:"text-center",children:t("typebot.sessions.table.remoteJid")}),cell:({row:w})=>i.jsx("div",{children:w.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>i.jsx("div",{className:"text-center",children:t("typebot.sessions.table.pushName")}),cell:({row:w})=>i.jsx("div",{children:w.getValue("pushName")})},{accessorKey:"sessionId",header:()=>i.jsx("div",{className:"text-center",children:t("typebot.sessions.table.sessionId")}),cell:({row:w})=>i.jsx("div",{children:w.getValue("sessionId")})},{accessorKey:"status",header:()=>i.jsx("div",{className:"text-center",children:t("typebot.sessions.table.status")}),cell:({row:w})=>i.jsx("div",{children:w.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:w})=>{const C=w.original;return i.jsxs(Kr,{children:[i.jsx(Wr,{asChild:!0,children:i.jsxs(se,{variant:"ghost",className:"h-8 w-8 p-0",children:[i.jsx("span",{className:"sr-only",children:t("typebot.sessions.table.actions.title")}),i.jsx(Pa,{className:"h-4 w-4"})]})}),i.jsxs(hr,{align:"end",children:[i.jsx(Ao,{children:"Actions"}),i.jsx(Xs,{}),C.status!=="opened"&&i.jsxs(wt,{onClick:()=>x(C.remoteJid,"opened"),children:[i.jsx(Fi,{className:"mr-2 h-4 w-4"}),t("typebot.sessions.table.actions.open")]}),C.status!=="paused"&&C.status!=="closed"&&i.jsxs(wt,{onClick:()=>x(C.remoteJid,"paused"),children:[i.jsx(Di,{className:"mr-2 h-4 w-4"}),t("typebot.sessions.table.actions.pause")]}),C.status!=="closed"&&i.jsxs(wt,{onClick:()=>x(C.remoteJid,"closed"),children:[i.jsx(Oi,{className:"mr-2 h-4 w-4"}),t("typebot.sessions.table.actions.close")]}),i.jsxs(wt,{onClick:()=>x(C.remoteJid,"delete"),children:[i.jsx(Ii,{className:"mr-2 h-4 w-4"}),t("typebot.sessions.table.actions.delete")]})]})]})}}];return i.jsxs(Pt,{open:o,onOpenChange:l,children:[i.jsx(Bt,{asChild:!0,children:i.jsxs(se,{variant:"secondary",size:"sm",children:[i.jsx(Ai,{size:16,className:"mr-1"})," ",i.jsx("span",{className:"hidden sm:inline",children:t("typebot.sessions.label")})]})}),i.jsxs(Nt,{className:"overflow-y-auto sm:max-w-[950px]",onCloseAutoFocus:g,children:[i.jsx(Mt,{children:i.jsx(zt,{children:t("typebot.sessions.label")})}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between gap-6 p-5",children:[i.jsx(ne,{placeholder:t("typebot.sessions.search"),value:u,onChange:w=>d(w.target.value)}),i.jsx(se,{variant:"outline",onClick:g,size:"icon",children:i.jsx(Li,{size:16})})]}),i.jsx($a,{columns:b,data:h??[],onSortingChange:s,state:{sorting:r,globalFilter:u},onGlobalFilterChange:d,enableGlobalFilter:!0,noResultsMessage:t("typebot.sessions.table.none")})]})]})]})}const hse=P.object({enabled:P.boolean(),description:P.string(),url:P.string(),typebot:P.string().optional(),triggerType:P.string(),triggerOperator:P.string().optional(),triggerValue:P.string().optional(),expire:P.coerce.number().optional(),keywordFinish:P.string().optional(),delayMessage:P.coerce.number().optional(),unknownMessage:P.string().optional(),listeningFromMe:P.boolean().optional(),stopBotFromMe:P.boolean().optional(),keepOpen:P.boolean().optional(),debounceTime:P.coerce.number().optional()});function VI({initialData:e,onSubmit:t,handleDelete:n,typebotId:r,isModal:s=!1,isLoading:o=!1,openDeletionDialog:l=!1,setOpenDeletionDialog:u=()=>{}}){const{t:d}=Ve(),f=on({resolver:an(hse),defaultValues:e||{enabled:!0,description:"",url:"",typebot:"",triggerType:"keyword",triggerOperator:"contains",triggerValue:"",expire:0,keywordFinish:"",delayMessage:0,unknownMessage:"",listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0}}),h=f.watch("triggerType");return i.jsx(Gn,{...f,children:i.jsxs("form",{onSubmit:f.handleSubmit(t),className:"w-full space-y-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx(Pe,{name:"enabled",label:d("typebot.form.enabled.label"),reverse:!0}),i.jsx(le,{name:"description",label:d("typebot.form.description.label"),required:!0,children:i.jsx(ne,{})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:d("typebot.form.typebotSettings.label")}),i.jsx($t,{})]}),i.jsx(le,{name:"url",label:d("typebot.form.url.label"),required:!0,children:i.jsx(ne,{})}),i.jsx(le,{name:"typebot",label:d("typebot.form.typebot.label"),children:i.jsx(ne,{})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:d("typebot.form.triggerSettings.label")}),i.jsx($t,{})]}),i.jsx(Jt,{name:"triggerType",label:d("typebot.form.triggerType.label"),options:[{label:d("typebot.form.triggerType.keyword"),value:"keyword"},{label:d("typebot.form.triggerType.all"),value:"all"},{label:d("typebot.form.triggerType.advanced"),value:"advanced"},{label:d("typebot.form.triggerType.none"),value:"none"}]}),h==="keyword"&&i.jsxs(i.Fragment,{children:[i.jsx(Jt,{name:"triggerOperator",label:d("typebot.form.triggerOperator.label"),options:[{label:d("typebot.form.triggerOperator.contains"),value:"contains"},{label:d("typebot.form.triggerOperator.equals"),value:"equals"},{label:d("typebot.form.triggerOperator.startsWith"),value:"startsWith"},{label:d("typebot.form.triggerOperator.endsWith"),value:"endsWith"},{label:d("typebot.form.triggerOperator.regex"),value:"regex"}]}),i.jsx(le,{name:"triggerValue",label:d("typebot.form.triggerValue.label"),children:i.jsx(ne,{})})]}),h==="advanced"&&i.jsx(le,{name:"triggerValue",label:d("typebot.form.triggerConditions.label"),children:i.jsx(ne,{})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("h3",{className:"my-4 text-lg font-medium",children:d("typebot.form.generalSettings.label")}),i.jsx($t,{})]}),i.jsx(le,{name:"expire",label:d("typebot.form.expire.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(le,{name:"keywordFinish",label:d("typebot.form.keywordFinish.label"),children:i.jsx(ne,{})}),i.jsx(le,{name:"delayMessage",label:d("typebot.form.delayMessage.label"),children:i.jsx(ne,{type:"number"})}),i.jsx(le,{name:"unknownMessage",label:d("typebot.form.unknownMessage.label"),children:i.jsx(ne,{})}),i.jsx(Pe,{name:"listeningFromMe",label:d("typebot.form.listeningFromMe.label"),reverse:!0}),i.jsx(Pe,{name:"stopBotFromMe",label:d("typebot.form.stopBotFromMe.label"),reverse:!0}),i.jsx(Pe,{name:"keepOpen",label:d("typebot.form.keepOpen.label"),reverse:!0}),i.jsx(le,{name:"debounceTime",label:d("typebot.form.debounceTime.label"),children:i.jsx(ne,{type:"number"})})]}),s&&i.jsx(Yt,{children:i.jsx(se,{disabled:o,type:"submit",children:d(o?"typebot.button.saving":"typebot.button.save")})}),!s&&i.jsxs("div",{children:[i.jsx(UI,{typebotId:r}),i.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[i.jsxs(Pt,{open:l,onOpenChange:u,children:[i.jsx(Bt,{asChild:!0,children:i.jsx(se,{variant:"destructive",size:"sm",children:d("dify.button.delete")})}),i.jsx(Nt,{children:i.jsxs(Mt,{children:[i.jsx(zt,{children:d("modal.delete.title")}),i.jsx(eo,{children:d("modal.delete.messageSingle")}),i.jsxs(Yt,{children:[i.jsx(se,{size:"sm",variant:"outline",onClick:()=>u(!1),children:d("button.cancel")}),i.jsx(se,{variant:"destructive",onClick:n,children:d("button.delete")})]})]})})]}),i.jsx(se,{disabled:o,type:"submit",children:d(o?"typebot.button.saving":"typebot.button.update")})]})]})]})})}function gse({resetTable:e}){const{t}=Ve(),{instance:n}=ct(),{createTypebot:r}=Eg(),[s,o]=y.useState(!1),[l,u]=y.useState(!1),d=async f=>{try{if(!n||!n.name)throw new Error("instance not found");o(!0);const h={enabled:f.enabled,description:f.description,url:f.url,typebot:f.typebot||"",triggerType:f.triggerType,triggerOperator:f.triggerOperator||"",triggerValue:f.triggerValue||"",expire:f.expire||0,keywordFinish:f.keywordFinish||"",delayMessage:f.delayMessage||0,unknownMessage:f.unknownMessage||"",listeningFromMe:f.listeningFromMe||!1,stopBotFromMe:f.stopBotFromMe||!1,keepOpen:f.keepOpen||!1,debounceTime:f.debounceTime||0};await r({instanceName:n.name,token:n.token,data:h}),me.success(t("typebot.toast.success.create")),u(!1),e()}catch(h){console.error("Error:",h),me.error(`Error: ${h?.response?.data?.response?.message}`)}finally{o(!1)}};return i.jsxs(Pt,{open:l,onOpenChange:u,children:[i.jsx(Bt,{asChild:!0,children:i.jsxs(se,{size:"sm",children:[i.jsx(cs,{size:16,className:"mr-1"}),i.jsx("span",{className:"hidden sm:inline",children:t("typebot.button.create")})]})}),i.jsxs(Nt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[i.jsx(Mt,{children:i.jsx(zt,{children:t("typebot.form.title")})}),i.jsx(VI,{onSubmit:d,isModal:!0,isLoading:s})]})]})}const mse=e=>["typebot","getTypebot",JSON.stringify(e)],vse=async({instanceName:e,token:t,typebotId:n})=>{const r=await Ee.get(`/typebot/fetch/${n}/${e}`,{headers:{apiKey:t}});return Array.isArray(r.data)?r.data[0]:r.data},yse=e=>{const{instanceName:t,token:n,typebotId:r,...s}=e;return mt({...s,queryKey:mse({instanceName:t}),queryFn:()=>vse({instanceName:t,token:n,typebotId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function bse({typebotId:e,resetTable:t}){const{t:n}=Ve(),{instance:r}=ct(),s=dn(),[o,l]=y.useState(!1),{deleteTypebot:u,updateTypebot:d}=Eg(),{data:f,isLoading:h}=yse({instanceName:r?.name,typebotId:e}),m=y.useMemo(()=>({enabled:!!f?.enabled,description:f?.description??"",url:f?.url??"",typebot:f?.typebot??"",triggerType:f?.triggerType??"",triggerOperator:f?.triggerOperator??"",triggerValue:f?.triggerValue,expire:f?.expire??0,keywordFinish:f?.keywordFinish,delayMessage:f?.delayMessage??0,unknownMessage:f?.unknownMessage,listeningFromMe:!!f?.listeningFromMe,stopBotFromMe:!!f?.stopBotFromMe,keepOpen:!!f?.keepOpen,debounceTime:f?.debounceTime??0}),[f?.debounceTime,f?.delayMessage,f?.description,f?.enabled,f?.expire,f?.keepOpen,f?.keywordFinish,f?.listeningFromMe,f?.stopBotFromMe,f?.triggerOperator,f?.triggerType,f?.triggerValue,f?.typebot,f?.unknownMessage,f?.url]),g=async b=>{try{if(r&&r.name&&e){const w={enabled:b.enabled,description:b.description,url:b.url,typebot:b.typebot||"",triggerType:b.triggerType,triggerOperator:b.triggerOperator||"",triggerValue:b.triggerValue||"",expire:b.expire||0,keywordFinish:b.keywordFinish||"",delayMessage:b.delayMessage||1e3,unknownMessage:b.unknownMessage||"",listeningFromMe:b.listeningFromMe||!1,stopBotFromMe:b.stopBotFromMe||!1,keepOpen:b.keepOpen||!1,debounceTime:b.debounceTime||0};await d({instanceName:r.name,typebotId:e,data:w}),me.success(n("typebot.toast.success.update")),t(),s(`/manager/instance/${r.id}/typebot/${e}`)}else console.error("Token not found")}catch(w){console.error("Error:",w),me.error(`Error: ${w?.response?.data?.response?.message}`)}},x=async()=>{try{r&&r.name&&e?(await u({instanceName:r.name,typebotId:e}),me.success(n("typebot.toast.success.delete")),l(!1),t(),s(`/manager/instance/${r.id}/typebot`)):console.error("instance not found")}catch(b){console.error("Erro ao excluir dify:",b)}};return h?i.jsx(On,{}):i.jsx("div",{className:"m-4",children:i.jsx(VI,{initialData:m,onSubmit:g,typebotId:e,handleDelete:x,isModal:!1,isLoading:h,openDeletionDialog:o,setOpenDeletionDialog:l})})}function Nk(){const{t:e}=Ve(),t=zo("(min-width: 768px)"),{instance:n}=ct(),{typebotId:r}=ls(),{data:s,isLoading:o,refetch:l}=zI({instanceName:n?.name,token:n?.token}),u=dn(),d=h=>{n&&u(`/manager/instance/${n.id}/typebot/${h}`)},f=()=>{l()};return i.jsxs("main",{className:"pt-5",children:[i.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[i.jsx("h3",{className:"text-lg font-medium",children:e("typebot.title")}),i.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[i.jsx(UI,{}),i.jsx(use,{}),i.jsx(gse,{resetTable:f})]})]}),i.jsx($t,{className:"my-4"}),i.jsxs($o,{direction:t?"horizontal":"vertical",children:[i.jsx(Hn,{defaultSize:35,className:"pr-4",children:i.jsx("div",{className:"flex flex-col gap-3",children:o?i.jsx(On,{}):i.jsx(i.Fragment,{children:s&&s.length>0&&Array.isArray(s)?s.map(h=>i.jsx(se,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>d(`${h.id}`),variant:r===h.id?"secondary":"outline",children:h.description?i.jsxs(i.Fragment,{children:[i.jsx("h4",{className:"text-base",children:h.description}),i.jsxs("p",{className:"text-wrap text-sm font-normal text-muted-foreground",children:[h.url," - ",h.typebot]})]}):i.jsxs(i.Fragment,{children:[i.jsx("h4",{className:"text-base",children:h.url}),i.jsx("p",{className:"text-wrap text-sm font-normal text-muted-foreground",children:h.typebot})]})},h.id)):i.jsx(se,{variant:"link",children:e("typebot.table.none")})})})}),r&&i.jsxs(i.Fragment,{children:[i.jsx(Bo,{withHandle:!0,className:"border border-black"}),i.jsx(Hn,{children:i.jsx(bse,{typebotId:r,resetTable:f})})]})]})]})}const xse=e=>["webhook","fetchWebhook",JSON.stringify(e)],wse=async({instanceName:e,token:t})=>(await Ee.get(`/webhook/find/${e}`,{headers:{apiKey:t}})).data,Sse=e=>{const{instanceName:t,token:n,...r}=e;return mt({...r,queryKey:xse({instanceName:t,token:n}),queryFn:()=>wse({instanceName:t,token:n}),enabled:!!t})},Cse=async({instanceName:e,token:t,data:n})=>(await Ee.post(`/webhook/set/${e}`,{webhook:n},{headers:{apikey:t}})).data;function Ese(){return{createWebhook:nt(Cse,{invalidateKeys:[["webhook","fetchWebhook"]]})}}const kse=P.object({enabled:P.boolean(),url:P.string().url("Invalid URL format"),events:P.array(P.string()),base64:P.boolean(),byEvents:P.boolean()});function jse(){const{t:e}=Ve(),{instance:t}=ct(),[n,r]=y.useState(!1),{createWebhook:s}=Ese(),{data:o}=Sse({instanceName:t?.name,token:t?.token}),l=on({resolver:an(kse),defaultValues:{enabled:!1,url:"",events:[],base64:!1,byEvents:!1}});y.useEffect(()=>{o&&l.reset({enabled:o.enabled,url:o.url,events:o.events,base64:o.webhookBase64,byEvents:o.webhookByEvents})},[o]);const u=async m=>{if(t){r(!0);try{const g={enabled:m.enabled,url:m.url,events:m.events,base64:m.base64,byEvents:m.byEvents};await s({instanceName:t.name,token:t.token,data:g}),me.success(e("webhook.toast.success"))}catch(g){console.error(e("webhook.toast.error"),g),me.error(`Error: ${g?.response?.data?.response?.message}`)}finally{r(!1)}}},d=["APPLICATION_STARTUP","QRCODE_UPDATED","MESSAGES_SET","MESSAGES_UPSERT","MESSAGES_UPDATE","MESSAGES_DELETE","SEND_MESSAGE","CONTACTS_SET","CONTACTS_UPSERT","CONTACTS_UPDATE","PRESENCE_UPDATE","CHATS_SET","CHATS_UPSERT","CHATS_UPDATE","CHATS_DELETE","GROUPS_UPSERT","GROUP_UPDATE","GROUP_PARTICIPANTS_UPDATE","CONNECTION_UPDATE","REMOVE_INSTANCE","LOGOUT_INSTANCE","LABELS_EDIT","LABELS_ASSOCIATION","CALL","TYPEBOT_START","TYPEBOT_CHANGE_STATUS"],f=()=>{l.setValue("events",d)},h=()=>{l.setValue("events",[])};return i.jsx(i.Fragment,{children:i.jsx(Fo,{...l,children:i.jsx("form",{onSubmit:l.handleSubmit(u),className:"w-full space-y-6",children:i.jsxs("div",{children:[i.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("webhook.title")}),i.jsx(Oa,{className:"my-4"}),i.jsxs("div",{className:"mx-4 space-y-2 divide-y [&>*]:p-4",children:[i.jsx(Pe,{name:"enabled",label:e("webhook.form.enabled.label"),className:"w-full justify-between",helper:e("webhook.form.enabled.description")}),i.jsx(le,{name:"url",label:"URL",children:i.jsx(ne,{})}),i.jsx(Pe,{name:"byEvents",label:e("webhook.form.byEvents.label"),className:"w-full justify-between",helper:e("webhook.form.byEvents.description")}),i.jsx(Pe,{name:"base64",label:e("webhook.form.base64.label"),className:"w-full justify-between",helper:e("webhook.form.base64.description")}),i.jsxs("div",{className:"mb-4 flex justify-between",children:[i.jsx(se,{variant:"outline",type:"button",onClick:f,children:e("button.markAll")}),i.jsx(se,{variant:"outline",type:"button",onClick:h,children:e("button.unMarkAll")})]}),i.jsx(Lo,{control:l.control,name:"events",render:({field:m})=>i.jsxs(no,{className:"flex flex-col",children:[i.jsx(Nr,{className:"my-2 text-lg",children:e("webhook.form.events.label")}),i.jsx(_s,{children:i.jsx("div",{className:"flex flex-col gap-2 space-y-1 divide-y",children:d.sort((g,x)=>g.localeCompare(x)).map(g=>i.jsxs("div",{className:"flex items-center justify-between gap-3 pt-3",children:[i.jsx(Nr,{className:Ie("break-all",m.value.includes(g)?"text-foreground":"text-muted-foreground"),children:g}),i.jsx(gc,{checked:m.value.includes(g),onCheckedChange:x=>{x?m.onChange([...m.value,g]):m.onChange(m.value.filter(b=>b!==g))}})]},g))})})]})})]}),i.jsx("div",{className:"mx-4 flex justify-end pt-6",children:i.jsx(se,{type:"submit",disabled:n,children:e(n?"webhook.button.saving":"webhook.button.save")})})]})})})})}const Tse=e=>["websocket","fetchWebsocket",JSON.stringify(e)],Nse=async({instanceName:e,token:t})=>(await Ee.get(`/websocket/find/${e}`,{headers:{apiKey:t}})).data,Mse=e=>{const{instanceName:t,token:n,...r}=e;return mt({...r,queryKey:Tse({instanceName:t,token:n}),queryFn:()=>Nse({instanceName:t,token:n}),enabled:!!t})},_se=async({instanceName:e,token:t,data:n})=>(await Ee.post(`/websocket/set/${e}`,{websocket:n},{headers:{apikey:t}})).data;function Rse(){return{createWebsocket:nt(_se,{invalidateKeys:[["websocket","fetchWebsocket"]]})}}const Pse=P.object({enabled:P.boolean(),events:P.array(P.string())});function Ose(){const{t:e}=Ve(),{instance:t}=ct(),[n,r]=y.useState(!1),{createWebsocket:s}=Rse(),{data:o}=Mse({instanceName:t?.name,token:t?.token}),l=on({resolver:an(Pse),defaultValues:{enabled:!1,events:[]}});y.useEffect(()=>{o&&l.reset({enabled:o.enabled,events:o.events})},[o]);const u=async m=>{if(t){r(!0);try{const g={enabled:m.enabled,events:m.events};await s({instanceName:t.name,token:t.token,data:g}),me.success(e("websocket.toast.success"))}catch(g){console.error(e("websocket.toast.error"),g),me.error(`Error: ${g?.response?.data?.response?.message}`)}finally{r(!1)}}},d=["APPLICATION_STARTUP","QRCODE_UPDATED","MESSAGES_SET","MESSAGES_UPSERT","MESSAGES_UPDATE","MESSAGES_DELETE","SEND_MESSAGE","CONTACTS_SET","CONTACTS_UPSERT","CONTACTS_UPDATE","PRESENCE_UPDATE","CHATS_SET","CHATS_UPSERT","CHATS_UPDATE","CHATS_DELETE","GROUPS_UPSERT","GROUP_UPDATE","GROUP_PARTICIPANTS_UPDATE","CONNECTION_UPDATE","REMOVE_INSTANCE","LOGOUT_INSTANCE","LABELS_EDIT","LABELS_ASSOCIATION","CALL","TYPEBOT_START","TYPEBOT_CHANGE_STATUS"],f=()=>{l.setValue("events",d)},h=()=>{l.setValue("events",[])};return i.jsx(i.Fragment,{children:i.jsx(Fo,{...l,children:i.jsx("form",{onSubmit:l.handleSubmit(u),className:"w-full space-y-6",children:i.jsxs("div",{children:[i.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("websocket.title")}),i.jsx(Oa,{className:"my-4"}),i.jsxs("div",{className:"mx-4 space-y-2 divide-y [&>*]:p-4",children:[i.jsx(Pe,{name:"enabled",label:e("websocket.form.enabled.label"),className:"w-full justify-between",helper:e("websocket.form.enabled.description")}),i.jsxs("div",{className:"mb-4 flex justify-between",children:[i.jsx(se,{variant:"outline",type:"button",onClick:f,children:e("button.markAll")}),i.jsx(se,{variant:"outline",type:"button",onClick:h,children:e("button.unMarkAll")})]}),i.jsx(Lo,{control:l.control,name:"events",render:({field:m})=>i.jsxs(no,{className:"flex flex-col",children:[i.jsx(Nr,{className:"my-2 text-lg",children:e("websocket.form.events.label")}),i.jsx(_s,{children:i.jsx("div",{className:"flex flex-col gap-2 space-y-1 divide-y",children:d.sort((g,x)=>g.localeCompare(x)).map(g=>i.jsxs("div",{className:"flex items-center justify-between gap-3 pt-3",children:[i.jsx(Nr,{className:Ie("break-all",m.value.includes(g)?"text-foreground":"text-muted-foreground"),children:g}),i.jsx(gc,{checked:m.value.includes(g),onCheckedChange:x=>{x?m.onChange([...m.value,g]):m.onChange(m.value.filter(b=>b!==g))}})]},g))})})]})})]}),i.jsx("div",{className:"mx-4 flex justify-end pt-6",children:i.jsx(se,{type:"submit",disabled:n,children:e(n?"websocket.button.saving":"websocket.button.save")})})]})})})})}const Ise=async({url:e,token:t})=>{try{const{data:n}=await sn.post(`${e}/verify-creds`,{},{headers:{apikey:t}});return Rj({facebookAppId:n.facebookAppId,facebookConfigId:n.facebookConfigId,facebookUserToken:n.facebookUserToken}),n}catch{return null}},Ase=P.object({serverUrl:P.string({required_error:"serverUrl is required"}).url("URL inválida"),apiKey:P.string({required_error:"ApiKey is required"})});function Dse(){const{t:e}=Ve(),t=dn(),{theme:n}=tc(),r=on({resolver:an(Ase),defaultValues:{serverUrl:window.location.protocol+"//"+window.location.host,apiKey:""}}),s=async o=>{const l=await sT({url:o.serverUrl});if(!l||!l.version){Pj(),r.setError("serverUrl",{type:"manual",message:e("login.message.invalidServer")});return}if(!await Ise({token:o.apiKey,url:o.serverUrl})){r.setError("apiKey",{type:"manual",message:e("login.message.invalidCredentials")});return}Rj({version:l.version,clientName:l.clientName,url:o.serverUrl,token:o.apiKey}),t("/manager/")};return i.jsxs("div",{className:"flex min-h-screen flex-col",children:[i.jsx("div",{className:"flex items-center justify-center pt-2",children:i.jsx("img",{className:"h-10",src:n==="dark"?"https://evolution-api.com/files/evo/evolution-logo-white.svg":"https://evolution-api.com/files/evo/evolution-logo.svg",alt:"logo"})}),i.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:i.jsxs(So,{className:"b-none w-[350px] shadow-none",children:[i.jsxs(Co,{children:[i.jsx(gi,{className:"text-center",children:e("login.title")}),i.jsx(Kp,{className:"text-center",children:e("login.description")})]}),i.jsx(Fo,{...r,children:i.jsxs("form",{onSubmit:r.handleSubmit(s),children:[i.jsx(Eo,{children:i.jsxs("div",{className:"grid w-full items-center gap-4",children:[i.jsx(le,{required:!0,name:"serverUrl",label:e("login.form.serverUrl"),children:i.jsx(ne,{})}),i.jsx(le,{required:!0,name:"apiKey",label:e("login.form.apiKey"),children:i.jsx(ne,{type:"password"})})]})}),i.jsx(Vh,{className:"flex justify-center",children:i.jsx(se,{className:"w-full",type:"submit",children:e("login.button.login")})})]})})]})}),i.jsx(Vb,{})]})}function Fse(){const e=dn(),{theme:t}=tc(),n=()=>{e("/manager")};return i.jsxs("div",{className:"min-h-screen bg-background",children:[i.jsxs("header",{className:"flex items-center justify-between px-4 py-2",children:[i.jsx("div",{className:"flex items-center",children:i.jsx("img",{src:t==="dark"?"https://evolution-api.com/files/evo/evolution-logo-white.svg":"https://evolution-api.com/files/evo/evolution-logo.svg",alt:"Evolution API Logo",className:"h-8"})}),i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx(iM,{}),i.jsx(lM,{})]})]}),i.jsx("div",{className:"container mx-auto px-4 py-16",children:i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsxs("div",{className:"text-center mb-12",children:[i.jsx("div",{className:"flex items-center justify-center mb-6",children:i.jsx("img",{src:t==="dark"?"https://evolution-api.com/files/evo/evolution-logo-white.svg":"https://evolution-api.com/files/evo/evolution-logo.svg",alt:"Evolution Manager Logo",className:"h-10"})}),i.jsx("h1",{className:"text-4xl font-bold text-foreground mb-4",children:"Evolution Manager v2"}),i.jsx("p",{className:"text-xl text-muted-foreground mb-6",children:"Modern web interface for Evolution API management"}),i.jsx(vu,{variant:"secondary",className:"text-sm px-3 py-1",children:"Version 2.0.0"})]}),i.jsxs(So,{className:"mb-8",children:[i.jsxs(Co,{children:[i.jsxs(gi,{className:"flex items-center gap-2",children:[i.jsx(xB,{className:"w-5 h-5 text-primary"}),"Welcome to Evolution Manager"]}),i.jsx(Kp,{children:"A powerful, modern dashboard for managing your WhatsApp API instances with Evolution API"})]}),i.jsx(Eo,{className:"space-y-6",children:i.jsx("div",{className:"pt-6 border-t border-border",children:i.jsx("div",{className:"flex flex-col sm:flex-row gap-4 justify-center items-center",children:i.jsxs(se,{onClick:n,size:"lg",className:"px-8 py-3",children:["Access Manager Dashboard",i.jsx(Th,{className:"w-4 h-4 ml-2"})]})})})})]}),i.jsxs(So,{children:[i.jsxs(Co,{children:[i.jsx(gi,{children:"Resources & Support"}),i.jsx(Kp,{children:"Get help, contribute, or learn more about Evolution API"})]}),i.jsx(Eo,{children:i.jsxs("div",{className:"grid md:grid-cols-3 gap-4",children:[i.jsxs("a",{href:"https://github.com/EvolutionAPI/evolution-manager-v2",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 p-4 rounded-lg border border-border hover:bg-accent transition-colors",children:[i.jsx(aB,{className:"w-5 h-5 text-muted-foreground"}),i.jsxs("div",{children:[i.jsx("div",{className:"font-medium text-foreground",children:"GitHub"}),i.jsx("div",{className:"text-sm text-muted-foreground",children:"Source code"})]})]}),i.jsxs("a",{href:"https://evolution-api.com",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 p-4 rounded-lg border border-border hover:bg-accent transition-colors",children:[i.jsx(iB,{className:"w-5 h-5 text-muted-foreground"}),i.jsxs("div",{children:[i.jsx("div",{className:"font-medium text-foreground",children:"Website"}),i.jsx("div",{className:"text-sm text-muted-foreground",children:"Official site"})]})]}),i.jsxs("a",{href:"mailto:contato@evolution-api.com",className:"flex items-center gap-3 p-4 rounded-lg border border-border hover:bg-accent transition-colors",children:[i.jsx(vB,{className:"w-5 h-5 text-muted-foreground"}),i.jsxs("div",{children:[i.jsx("div",{className:"font-medium text-foreground",children:"Contact"}),i.jsx("div",{className:"text-sm text-muted-foreground",children:"Get support"})]})]})]})})]}),i.jsx("div",{className:"text-center mt-12 text-sm text-muted-foreground",children:i.jsx("p",{children:"© 2025 Evolution API. Licensed under Apache 2.0 with Evolution API custom conditions."})})]})})]})}const Lse=Z2([{path:"/",element:i.jsx(Fse,{})},{path:"/manager/login",element:i.jsx(jL,{children:i.jsx(Dse,{})})},{path:"/manager/",element:i.jsx(tn,{children:i.jsx(B5,{children:i.jsx(CZ,{})})})},{path:"/manager/instance/:instanceId/dashboard",element:i.jsx(tn,{children:i.jsx(un,{children:i.jsx(PX,{})})})},{path:"/manager/instance/:instanceId/chat",element:i.jsx(tn,{children:i.jsx(un,{children:i.jsx(tk,{})})})},{path:"/manager/instance/:instanceId/chat/:remoteJid",element:i.jsx(tn,{children:i.jsx(un,{children:i.jsx(tk,{})})})},{path:"/manager/instance/:instanceId/settings",element:i.jsx(tn,{children:i.jsx(un,{children:i.jsx(qre,{})})})},{path:"/manager/instance/:instanceId/openai",element:i.jsx(tn,{children:i.jsx(un,{children:i.jsx(Tk,{})})})},{path:"/manager/instance/:instanceId/openai/:botId",element:i.jsx(tn,{children:i.jsx(un,{children:i.jsx(Tk,{})})})},{path:"/manager/instance/:instanceId/webhook",element:i.jsx(tn,{children:i.jsx(un,{children:i.jsx(jse,{})})})},{path:"/manager/instance/:instanceId/websocket",element:i.jsx(tn,{children:i.jsx(un,{children:i.jsx(Ose,{})})})},{path:"/manager/instance/:instanceId/rabbitmq",element:i.jsx(tn,{children:i.jsx(un,{children:i.jsx(Bre,{})})})},{path:"/manager/instance/:instanceId/sqs",element:i.jsx(tn,{children:i.jsx(un,{children:i.jsx(Yre,{})})})},{path:"/manager/instance/:instanceId/chatwoot",element:i.jsx(tn,{children:i.jsx(un,{children:i.jsx(yX,{})})})},{path:"/manager/instance/:instanceId/typebot",element:i.jsx(tn,{children:i.jsx(un,{children:i.jsx(Nk,{})})})},{path:"/manager/instance/:instanceId/typebot/:typebotId",element:i.jsx(tn,{children:i.jsx(un,{children:i.jsx(Nk,{})})})},{path:"/manager/instance/:instanceId/dify",element:i.jsx(tn,{children:i.jsx(un,{children:i.jsx(xk,{})})})},{path:"/manager/instance/:instanceId/dify/:difyId",element:i.jsx(tn,{children:i.jsx(un,{children:i.jsx(xk,{})})})},{path:"/manager/instance/:instanceId/n8n",element:i.jsx(tn,{children:i.jsx(un,{children:i.jsx(jk,{})})})},{path:"/manager/instance/:instanceId/n8n/:n8nId",element:i.jsx(tn,{children:i.jsx(un,{children:i.jsx(jk,{})})})},{path:"/manager/instance/:instanceId/evoai",element:i.jsx(tn,{children:i.jsx(un,{children:i.jsx(Ck,{})})})},{path:"/manager/instance/:instanceId/evoai/:evoaiId",element:i.jsx(tn,{children:i.jsx(un,{children:i.jsx(Ck,{})})})},{path:"/manager/instance/:instanceId/evolutionBot",element:i.jsx(tn,{children:i.jsx(un,{children:i.jsx(Ek,{})})})},{path:"/manager/instance/:instanceId/evolutionBot/:evolutionBotId",element:i.jsx(tn,{children:i.jsx(un,{children:i.jsx(Ek,{})})})},{path:"/manager/instance/:instanceId/flowise",element:i.jsx(tn,{children:i.jsx(un,{children:i.jsx(kk,{})})})},{path:"/manager/instance/:instanceId/flowise/:flowiseId",element:i.jsx(tn,{children:i.jsx(un,{children:i.jsx(kk,{})})})},{path:"/manager/instance/:instanceId/proxy",element:i.jsx(tn,{children:i.jsx(un,{children:i.jsx(Ore,{})})})},{path:"/manager/embed-chat",element:i.jsx(Sk,{})},{path:"/manager/embed-chat/:remoteJid",element:i.jsx(Sk,{})}]),$se={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class uh{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||$se,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r{this.observers[r]||(this.observers[r]=new Map);const s=this.observers[r].get(n)||0;this.observers[r].set(n,s+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s{let[u,d]=l;for(let f=0;f{let[u,d]=l;for(let f=0;f{let e,t;const n=new Promise((r,s)=>{e=r,t=s});return n.resolve=e,n.reject=t,n},Mk=e=>e==null?"":""+e,Bse=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},zse=/###/g,_k=e=>e&&e.indexOf("###")>-1?e.replace(zse,"."):e,Rk=e=>!e||typeof e=="string",Pu=(e,t,n)=>{const r=typeof t!="string"?t:t.split(".");let s=0;for(;s{const{obj:r,k:s}=Pu(e,t,Object);if(r!==void 0||t.length===1){r[s]=n;return}let o=t[t.length-1],l=t.slice(0,t.length-1),u=Pu(e,l,Object);for(;u.obj===void 0&&l.length;)o=`${l[l.length-1]}.${o}`,l=l.slice(0,l.length-1),u=Pu(e,l,Object),u&&u.obj&&typeof u.obj[`${u.k}.${o}`]<"u"&&(u.obj=void 0);u.obj[`${u.k}.${o}`]=n},Use=(e,t,n,r)=>{const{obj:s,k:o}=Pu(e,t,Object);s[o]=s[o]||[],s[o].push(n)},dh=(e,t)=>{const{obj:n,k:r}=Pu(e,t);if(n)return n[r]},Vse=(e,t,n)=>{const r=dh(e,n);return r!==void 0?r:dh(t,n)},HI=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):HI(e[r],t[r],n):e[r]=t[r]);return e},Sl=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Hse={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const qse=e=>typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>Hse[t]):e;class Kse{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const Wse=[" ",",","?","!",";"],Gse=new Kse(20),Jse=(e,t,n)=>{t=t||"",n=n||"";const r=Wse.filter(l=>t.indexOf(l)<0&&n.indexOf(l)<0);if(r.length===0)return!0;const s=Gse.getRegExp(`(${r.map(l=>l==="?"?"\\?":l).join("|")})`);let o=!s.test(e);if(!o){const l=e.indexOf(n);l>0&&!s.test(e.substring(0,l))&&(o=!0)}return o},Mb=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let s=e;for(let o=0;o-1&&de&&e.indexOf("_")>0?e.replace("_","-"):e;class Ok extends kg{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,l=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let u;t.indexOf(".")>-1?u=t.split("."):(u=[t,n],r&&(Array.isArray(r)?u.push(...r):typeof r=="string"&&o?u.push(...r.split(o)):u.push(r)));const d=dh(this.data,u);return!d&&!n&&!r&&t.indexOf(".")>-1&&(t=u[0],n=u[1],r=u.slice(2).join(".")),d||!l||typeof r!="string"?d:Mb(this.data&&this.data[t]&&this.data[t][n],r,o)}addResource(t,n,r,s){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const l=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let u=[t,n];r&&(u=u.concat(l?r.split(l):r)),t.indexOf(".")>-1&&(u=t.split("."),s=n,n=u[1]),this.addNamespaces(n),Pk(this.data,u,s),o.silent||this.emit("added",t,n,r,s)}addResources(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const o in r)(typeof r[o]=="string"||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});s.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,s,o){let l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},u=[t,n];t.indexOf(".")>-1&&(u=t.split("."),s=r,r=n,n=u[1]),this.addNamespaces(n);let d=dh(this.data,u)||{};l.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?HI(d,r,o):d={...d,...r},Pk(this.data,u,d),l.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,n)}:this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(s=>n[s]&&Object.keys(n[s]).length>0)}toJSON(){return this.data}}var qI={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,s){return e.forEach(o=>{this.processors[o]&&(t=this.processors[o].process(t,n,r,s))}),t}};const Ik={};class ph extends kg{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Bse(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Ks.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const r=this.resolve(t,n);return r&&r.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const l=r&&t.indexOf(r)>-1,u=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!Jse(t,r,s);if(l&&!u){const d=t.match(this.interpolator.nestingRegexp);if(d&&d.length>0)return{key:t,namespaces:o};const f=t.split(r);(r!==s||r===s&&this.options.ns.indexOf(f[0])>-1)&&(o=f.shift()),t=f.join(s)}return typeof o=="string"&&(o=[o]),{key:t,namespaces:o}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const s=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:l,namespaces:u}=this.extractFromKey(t[t.length-1],n),d=u[u.length-1],f=n.lng||this.language,h=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(f&&f.toLowerCase()==="cimode"){if(h){const _=n.nsSeparator||this.options.nsSeparator;return s?{res:`${d}${_}${l}`,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:d,usedParams:this.getUsedParamsDetails(n)}:`${d}${_}${l}`}return s?{res:l,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:d,usedParams:this.getUsedParamsDetails(n)}:l}const m=this.resolve(t,n);let g=m&&m.res;const x=m&&m.usedKey||l,b=m&&m.exactUsedKey||l,w=Object.prototype.toString.apply(g),C=["[object Number]","[object Function]","[object RegExp]"],k=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,j=!this.i18nFormat||this.i18nFormat.handleAsObject;if(j&&g&&(typeof g!="string"&&typeof g!="boolean"&&typeof g!="number")&&C.indexOf(w)<0&&!(typeof k=="string"&&Array.isArray(g))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const _=this.options.returnedObjectHandler?this.options.returnedObjectHandler(x,g,{...n,ns:u}):`key '${l} (${this.language})' returned an object instead of string.`;return s?(m.res=_,m.usedParams=this.getUsedParamsDetails(n),m):_}if(o){const _=Array.isArray(g),R=_?[]:{},N=_?b:x;for(const O in g)if(Object.prototype.hasOwnProperty.call(g,O)){const D=`${N}${o}${O}`;R[O]=this.translate(D,{...n,joinArrays:!1,ns:u}),R[O]===D&&(R[O]=g[O])}g=R}}else if(j&&typeof k=="string"&&Array.isArray(g))g=g.join(k),g&&(g=this.extendTranslation(g,t,n,r));else{let _=!1,R=!1;const N=n.count!==void 0&&typeof n.count!="string",O=ph.hasDefaultValue(n),D=N?this.pluralResolver.getSuffix(f,n.count,n):"",z=n.ordinal&&N?this.pluralResolver.getSuffix(f,n.count,{ordinal:!1}):"",Q=N&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),pe=Q&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${D}`]||n[`defaultValue${z}`]||n.defaultValue;!this.isValidLookup(g)&&O&&(_=!0,g=pe),this.isValidLookup(g)||(R=!0,g=l);const G=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&R?void 0:g,W=O&&pe!==g&&this.options.updateMissing;if(R||_||W){if(this.logger.log(W?"updateKey":"missingKey",f,d,l,W?pe:g),o){const H=this.resolve(l,{...n,keySeparator:!1});H&&H.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let ie=[];const re=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&re&&re[0])for(let H=0;H{const A=O&&he!==g?he:G;this.options.missingKeyHandler?this.options.missingKeyHandler(H,d,q,A,W,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(H,d,q,A,W,n),this.emit("missingKey",H,d,q,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&N?ie.forEach(H=>{const q=this.pluralResolver.getSuffixes(H,n);Q&&n[`defaultValue${this.options.pluralSeparator}zero`]&&q.indexOf(`${this.options.pluralSeparator}zero`)<0&&q.push(`${this.options.pluralSeparator}zero`),q.forEach(he=>{Y([H],l+he,n[`defaultValue${he}`]||pe)})}):Y(ie,l,pe))}g=this.extendTranslation(g,t,n,m,r),R&&g===l&&this.options.appendNamespaceToMissingKey&&(g=`${d}:${l}`),(R||_)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${d}:${l}`:l,_?g:void 0):g=this.options.parseMissingKeyHandler(g))}return s?(m.res=g,m.usedParams=this.getUsedParamsDetails(n),m):g}extendTranslation(t,n,r,s,o){var l=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const f=typeof t=="string"&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(f){const g=t.match(this.interpolator.nestingRegexp);h=g&&g.length}let m=r.replace&&typeof r.replace!="string"?r.replace:r;if(this.options.interpolation.defaultVariables&&(m={...this.options.interpolation.defaultVariables,...m}),t=this.interpolator.interpolate(t,m,r.lng||this.language||s.usedLng,r),f){const g=t.match(this.interpolator.nestingRegexp),x=g&&g.length;h1&&arguments[1]!==void 0?arguments[1]:{},r,s,o,l,u;return typeof t=="string"&&(t=[t]),t.forEach(d=>{if(this.isValidLookup(r))return;const f=this.extractFromKey(d,n),h=f.key;s=h;let m=f.namespaces;this.options.fallbackNS&&(m=m.concat(this.options.fallbackNS));const g=n.count!==void 0&&typeof n.count!="string",x=g&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),b=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",w=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);m.forEach(C=>{this.isValidLookup(r)||(u=C,!Ik[`${w[0]}-${C}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(u)&&(Ik[`${w[0]}-${C}`]=!0,this.logger.warn(`key "${s}" for languages "${w.join(", ")}" won't get resolved as namespace "${u}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),w.forEach(k=>{if(this.isValidLookup(r))return;l=k;const j=[h];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(j,h,k,C,n);else{let _;g&&(_=this.pluralResolver.getSuffix(k,n.count,n));const R=`${this.options.pluralSeparator}zero`,N=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(g&&(j.push(h+_),n.ordinal&&_.indexOf(N)===0&&j.push(h+_.replace(N,this.options.pluralSeparator)),x&&j.push(h+R)),b){const O=`${h}${this.options.contextSeparator}${n.context}`;j.push(O),g&&(j.push(O+_),n.ordinal&&_.indexOf(N)===0&&j.push(O+_.replace(N,this.options.pluralSeparator)),x&&j.push(O+R))}}let M;for(;M=j.pop();)this.isValidLookup(r)||(o=M,r=this.getResource(k,C,M,n))}))})}),{res:r,usedKey:s,exactUsedKey:o,usedLng:l,usedNS:u}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,s):this.resourceStore.getResource(t,n,r,s)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&typeof t.replace!="string";let s=r?t.replace:t;if(r&&typeof t.count<"u"&&(s.count=t.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!r){s={...s};for(const o of n)delete s[o]}return s}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}const xy=e=>e.charAt(0).toUpperCase()+e.slice(1);class Ak{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ks.create("languageUtils")}getScriptPartFromCode(t){if(t=fh(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=fh(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=t.split("-");return this.options.lowerCaseLng?r=r.map(s=>s.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=xy(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=xy(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=xy(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const s=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(s))&&(n=s)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const s=this.getLanguagePartFromCode(r);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(o=>{if(o===s)return o;if(!(o.indexOf("-")<0&&s.indexOf("-")<0)&&(o.indexOf("-")>0&&s.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===s||o.indexOf(s)===0&&s.length>1))return o})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),typeof t=="string"&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),s=[],o=l=>{l&&(this.isSupportedCode(l)?s.push(l):this.logger.warn(`rejecting language code not found in supportedLngs: ${l}`))};return typeof t=="string"&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):typeof t=="string"&&o(this.formatLanguageCode(t)),r.forEach(l=>{s.indexOf(l)<0&&o(this.formatLanguageCode(l))}),s}}let Qse=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Zse={1:e=>+(e>1),2:e=>+(e!=1),3:e=>0,4:e=>e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,5:e=>e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5,6:e=>e==1?0:e>=2&&e<=4?1:2,7:e=>e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,8:e=>e==1?0:e==2?1:e!=8&&e!=11?2:3,9:e=>+(e>=2),10:e=>e==1?0:e==2?1:e<7?2:e<11?3:4,11:e=>e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3,12:e=>+(e%10!=1||e%100==11),13:e=>+(e!==0),14:e=>e==1?0:e==2?1:e==3?2:3,15:e=>e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2,16:e=>e%10==1&&e%100!=11?0:e!==0?1:2,17:e=>e==1||e%10==1&&e%100!=11?0:1,18:e=>e==0?0:e==1?1:2,19:e=>e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3,20:e=>e==1?0:e==0||e%100>0&&e%100<20?1:2,21:e=>e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0,22:e=>e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3};const Yse=["v1","v2","v3"],Xse=["v4"],Dk={zero:0,one:1,two:2,few:3,many:4,other:5},eoe=()=>{const e={};return Qse.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:Zse[t.fc]}})}),e};class toe{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=Ks.create("pluralResolver"),(!this.options.compatibilityJSON||Xse.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=eoe(),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{const r=fh(t==="dev"?"en":t),s=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:s});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];const l=new Intl.PluralRules(r,{type:s});return this.pluralRulesCache[o]=l,l}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(s=>`${n}${s}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((s,o)=>Dk[s]-Dk[o]).map(s=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s}`):r.numbers.map(s=>this.getSuffix(t,s,n)):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=this.getRule(t,r);return s?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${s.select(n)}`:this.getSuffixRetroCompatible(s,n):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,n){const r=t.noAbs?t.plurals(n):t.plurals(Math.abs(n));let s=t.numbers[r];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));const o=()=>this.options.prepend&&s.toString()?this.options.prepend+s.toString():s.toString();return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?`_plural_${s.toString()}`:o():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?o():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!Yse.includes(this.options.compatibilityJSON)}}const Fk=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=Vse(e,t,n);return!o&&s&&typeof n=="string"&&(o=Mb(e,n,r),o===void 0&&(o=Mb(t,n,r))),o},wy=e=>e.replace(/\$/g,"$$$$");class noe{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Ks.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:s,prefix:o,prefixEscaped:l,suffix:u,suffixEscaped:d,formatSeparator:f,unescapeSuffix:h,unescapePrefix:m,nestingPrefix:g,nestingPrefixEscaped:x,nestingSuffix:b,nestingSuffixEscaped:w,nestingOptionsSeparator:C,maxReplaces:k,alwaysFormat:j}=t.interpolation;this.escape=n!==void 0?n:qse,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=o?Sl(o):l||"{{",this.suffix=u?Sl(u):d||"}}",this.formatSeparator=f||",",this.unescapePrefix=h?"":m||"-",this.unescapeSuffix=this.unescapePrefix?"":h||"",this.nestingPrefix=g?Sl(g):x||Sl("$t("),this.nestingSuffix=b?Sl(b):w||Sl(")"),this.nestingOptionsSeparator=C||",",this.maxReplaces=k||1e3,this.alwaysFormat=j!==void 0?j:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n&&n.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,s){let o,l,u;const d=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},f=x=>{if(x.indexOf(this.formatSeparator)<0){const k=Fk(n,d,x,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(k,void 0,r,{...s,...n,interpolationkey:x}):k}const b=x.split(this.formatSeparator),w=b.shift().trim(),C=b.join(this.formatSeparator).trim();return this.format(Fk(n,d,w,this.options.keySeparator,this.options.ignoreJSONStructure),C,r,{...s,...n,interpolationkey:w})};this.resetRegExp();const h=s&&s.missingInterpolationHandler||this.options.missingInterpolationHandler,m=s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:x=>wy(x)},{regex:this.regexp,safeValue:x=>this.escapeValue?wy(this.escape(x)):wy(x)}].forEach(x=>{for(u=0;o=x.regex.exec(t);){const b=o[1].trim();if(l=f(b),l===void 0)if(typeof h=="function"){const C=h(t,o,s);l=typeof C=="string"?C:""}else if(s&&Object.prototype.hasOwnProperty.call(s,b))l="";else if(m){l=o[0];continue}else this.logger.warn(`missed to pass in variable ${b} for interpolating ${t}`),l="";else typeof l!="string"&&!this.useRawValueToEscape&&(l=Mk(l));const w=x.safeValue(l);if(t=t.replace(o[0],w),m?(x.regex.lastIndex+=l.length,x.regex.lastIndex-=o[0].length):x.regex.lastIndex=0,u++,u>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,o,l;const u=(d,f)=>{const h=this.nestingOptionsSeparator;if(d.indexOf(h)<0)return d;const m=d.split(new RegExp(`${h}[ ]*{`));let g=`{${m[1]}`;d=m[0],g=this.interpolate(g,l);const x=g.match(/'/g),b=g.match(/"/g);(x&&x.length%2===0&&!b||b.length%2!==0)&&(g=g.replace(/'/g,'"'));try{l=JSON.parse(g),f&&(l={...f,...l})}catch(w){return this.logger.warn(`failed parsing options string in nesting for key ${d}`,w),`${d}${h}${g}`}return l.defaultValue&&l.defaultValue.indexOf(this.prefix)>-1&&delete l.defaultValue,d};for(;s=this.nestingRegexp.exec(t);){let d=[];l={...r},l=l.replace&&typeof l.replace!="string"?l.replace:l,l.applyPostProcessor=!1,delete l.defaultValue;let f=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const h=s[1].split(this.formatSeparator).map(m=>m.trim());s[1]=h.shift(),d=h,f=!0}if(o=n(u.call(this,s[1].trim(),l),l),o&&s[0]===t&&typeof o!="string")return o;typeof o!="string"&&(o=Mk(o)),o||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${t}`),o=""),f&&(o=d.reduce((h,m)=>this.format(h,m,r.lng,{...r,interpolationkey:s[1].trim()}),o.trim())),t=t.replace(s[0],o),this.regexp.lastIndex=0}return t}}const roe=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const s=r[1].substring(0,r[1].length-1);t==="currency"&&s.indexOf(":")<0?n.currency||(n.currency=s.trim()):t==="relativetime"&&s.indexOf(":")<0?n.range||(n.range=s.trim()):s.split(";").forEach(l=>{if(l){const[u,...d]=l.split(":"),f=d.join(":").trim().replace(/^'+|'+$/g,""),h=u.trim();n[h]||(n[h]=f),f==="false"&&(n[h]=!1),f==="true"&&(n[h]=!0),isNaN(f)||(n[h]=parseInt(f,10))}})}return{formatName:t,formatOptions:n}},Cl=e=>{const t={};return(n,r,s)=>{let o=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(o={...o,[s.interpolationkey]:void 0});const l=r+JSON.stringify(o);let u=t[l];return u||(u=e(fh(r),s),t[l]=u),u(n)}};class soe{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Ks.create("formatter"),this.options=t,this.formats={number:Cl((n,r)=>{const s=new Intl.NumberFormat(n,{...r});return o=>s.format(o)}),currency:Cl((n,r)=>{const s=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>s.format(o)}),datetime:Cl((n,r)=>{const s=new Intl.DateTimeFormat(n,{...r});return o=>s.format(o)}),relativetime:Cl((n,r)=>{const s=new Intl.RelativeTimeFormat(n,{...r});return o=>s.format(o,r.range||"day")}),list:Cl((n,r)=>{const s=new Intl.ListFormat(n,{...r});return o=>s.format(o)})},this.init(t)}init(t){const r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=Cl(n)}format(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(u=>u.indexOf(")")>-1)){const u=o.findIndex(d=>d.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,u)].join(this.formatSeparator)}return o.reduce((u,d)=>{const{formatName:f,formatOptions:h}=roe(d);if(this.formats[f]){let m=u;try{const g=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},x=g.locale||g.lng||s.locale||s.lng||r;m=this.formats[f](u,x,{...h,...s,...g})}catch(g){this.logger.warn(g)}return m}else this.logger.warn(`there was no format function for ${f}`);return u},t)}}const ooe=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class aoe extends kg{constructor(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=s,this.logger=Ks.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,s.backend,s)}queueLoad(t,n,r,s){const o={},l={},u={},d={};return t.forEach(f=>{let h=!0;n.forEach(m=>{const g=`${f}|${m}`;!r.reload&&this.store.hasResourceBundle(f,m)?this.state[g]=2:this.state[g]<0||(this.state[g]===1?l[g]===void 0&&(l[g]=!0):(this.state[g]=1,h=!1,l[g]===void 0&&(l[g]=!0),o[g]===void 0&&(o[g]=!0),d[m]===void 0&&(d[m]=!0)))}),h||(u[f]=!0)}),(Object.keys(o).length||Object.keys(l).length)&&this.queue.push({pending:l,pendingCount:Object.keys(l).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(o),pending:Object.keys(l),toLoadLanguages:Object.keys(u),toLoadNamespaces:Object.keys(d)}}loaded(t,n,r){const s=t.split("|"),o=s[0],l=s[1];n&&this.emit("failedLoading",o,l,n),!n&&r&&this.store.addResourceBundle(o,l,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const u={};this.queue.forEach(d=>{Use(d.loaded,[o],l),ooe(d,t),n&&d.errors.push(n),d.pendingCount===0&&!d.done&&(Object.keys(d.loaded).forEach(f=>{u[f]||(u[f]={});const h=d.loaded[f];h.length&&h.forEach(m=>{u[f][m]===void 0&&(u[f][m]=!0)})}),d.done=!0,d.errors.length?d.callback(d.errors):d.callback())}),this.emit("loaded",u),this.queue=this.queue.filter(d=>!d.done)}read(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,l=arguments.length>5?arguments[5]:void 0;if(!t.length)return l(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:s,wait:o,callback:l});return}this.readingCalls++;const u=(f,h)=>{if(this.readingCalls--,this.waitingReads.length>0){const m=this.waitingReads.shift();this.read(m.lng,m.ns,m.fcName,m.tried,m.wait,m.callback)}if(f&&h&&s{this.read.call(this,t,n,r,s+1,o*2,l)},o);return}l(f,h)},d=this.backend[r].bind(this.backend);if(d.length===2){try{const f=d(t,n);f&&typeof f.then=="function"?f.then(h=>u(null,h)).catch(u):u(null,f)}catch(f){u(f)}return}return d(t,n,u)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof n=="string"&&(n=[n]);const o=this.queueLoad(t,n,r,s);if(!o.toLoad.length)return o.pending.length||s(),null;o.toLoad.forEach(l=>{this.loadOne(l)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),s=r[0],o=r[1];this.read(s,o,"read",void 0,void 0,(l,u)=>{l&&this.logger.warn(`${n}loading namespace ${o} for language ${s} failed`,l),!l&&u&&this.logger.log(`${n}loaded namespace ${o} for language ${s}`,u),this.loaded(t,l,u)})}saveMissing(t,n,r,s,o){let l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},u=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend&&this.backend.create){const d={...l,isUpdate:o},f=this.backend.create.bind(this.backend);if(f.length<6)try{let h;f.length===5?h=f(t,n,r,s,d):h=f(t,n,r,s),h&&typeof h.then=="function"?h.then(m=>u(null,m)).catch(u):u(null,h)}catch(h){u(h)}else f(t,n,r,s,u,d)}!t||!t[0]||this.store.addResource(t[0],n,r,s)}}}const Lk=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),typeof e[1]=="string"&&(t.defaultValue=e[1]),typeof e[2]=="string"&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),$k=e=>(typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),lp=()=>{},ioe=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class dd extends kg{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=$k(t),this.services={},this.logger=Ks,this.modules={external:[]},ioe(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const s=Lk();this.options={...s,...this.options,...$k(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...s.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const o=h=>h?typeof h=="function"?new h:h:null;if(!this.options.isClone){this.modules.logger?Ks.init(o(this.modules.logger),this.options):Ks.init(null,this.options);let h;this.modules.formatter?h=this.modules.formatter:typeof Intl<"u"&&(h=soe);const m=new Ak(this.options);this.store=new Ok(this.options.resources,this.options);const g=this.services;g.logger=Ks,g.resourceStore=this.store,g.languageUtils=m,g.pluralResolver=new toe(m,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),h&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(g.formatter=o(h),g.formatter.init(g,this.options),this.options.interpolation.format=g.formatter.format.bind(g.formatter)),g.interpolator=new noe(this.options),g.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},g.backendConnector=new aoe(o(this.modules.backend),g.resourceStore,g,this.options),g.backendConnector.on("*",function(x){for(var b=arguments.length,w=new Array(b>1?b-1:0),C=1;C1?b-1:0),C=1;C{x.init&&x.init(this)})}if(this.format=this.options.interpolation.format,r||(r=lp),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.length>0&&h[0]!=="dev"&&(this.options.lng=h[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(h=>{this[h]=function(){return t.store[h](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(h=>{this[h]=function(){return t.store[h](...arguments),t}});const d=hu(),f=()=>{const h=(m,g)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),d.resolve(g),r(m,g)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return h(null,this.t.bind(this));this.changeLanguage(this.options.lng,h)};return this.options.resources||!this.options.initImmediate?f():setTimeout(f,0),d}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:lp;const s=typeof t=="string"?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(s&&s.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const o=[],l=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(f=>{f!=="cimode"&&o.indexOf(f)<0&&o.push(f)})};s?l(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>l(d)),this.options.preload&&this.options.preload.forEach(u=>l(u)),this.services.backendConnector.load(o,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(u)})}else r(null)}reloadResources(t,n,r){const s=hu();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=lp),this.services.backendConnector.reload(t,n,o=>{s.resolve(),r(o)}),s}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&qI.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const s=hu();this.emit("languageChanging",t);const o=d=>{this.language=d,this.languages=this.services.languageUtils.toResolveHierarchy(d),this.resolvedLanguage=void 0,this.setResolvedLanguage(d)},l=(d,f)=>{f?(o(f),this.translator.changeLanguage(f),this.isLanguageChangingTo=void 0,this.emit("languageChanged",f),this.logger.log("languageChanged",f)):this.isLanguageChangingTo=void 0,s.resolve(function(){return r.t(...arguments)}),n&&n(d,function(){return r.t(...arguments)})},u=d=>{!t&&!d&&this.services.languageDetector&&(d=[]);const f=typeof d=="string"?d:this.services.languageUtils.getBestMatchFromCodes(d);f&&(this.language||o(f),this.translator.language||this.translator.changeLanguage(f),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(f)),this.loadResources(f,h=>{l(h,f)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?u(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(u):this.services.languageDetector.detect(u):u(t),s}getFixedT(t,n,r){var s=this;const o=function(l,u){let d;if(typeof u!="object"){for(var f=arguments.length,h=new Array(f>2?f-2:0),m=2;m`${d.keyPrefix}${g}${b}`):x=d.keyPrefix?`${d.keyPrefix}${g}${l}`:l,s.t(x,d)};return typeof t=="string"?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=r,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const l=(u,d)=>{const f=this.services.backendConnector.state[`${u}|${d}`];return f===-1||f===0||f===2};if(n.precheck){const u=n.precheck(this,l);if(u!==void 0)return u}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||l(r,t)&&(!s||l(o,t)))}loadNamespaces(t,n){const r=hu();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=hu();typeof t=="string"&&(t=[t]);const s=this.options.preload||[],o=t.filter(l=>s.indexOf(l)<0&&this.services.languageUtils.isSupportedCode(l));return o.length?(this.options.preload=s.concat(o),this.loadResources(l=>{r.resolve(),n&&n(l)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services&&this.services.languageUtils||new Ak(Lk());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new dd(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:lp;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const s={...this.options,...t,isClone:!0},o=new dd(s);return(t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(u=>{o[u]=this[u]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r&&(o.store=new Ok(this.store.data,s),o.services.resourceStore=o.store),o.translator=new ph(o.services,s),o.translator.on("*",function(u){for(var d=arguments.length,f=new Array(d>1?d-1:0),h=1;h:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.75rem * var(--tw-space-x-reverse));margin-left:calc(.75rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * 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-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.divide-x>:not([hidden])~:not([hidden]){--tw-divide-x-reverse: 0;border-right-width:calc(1px * var(--tw-divide-x-reverse));border-left-width:calc(1px * calc(1 - var(--tw-divide-x-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))}.self-end{align-self:flex-end}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.text-wrap{text-wrap:wrap}.break-all{word-break:break-all}.rounded-3xl{border-radius:1.5rem}.rounded-\[2px\]{border-radius:2px}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-\[1\.5px\]{border-width:1.5px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-\[--color-border\]{border-color:var(--color-border)}.border-amber-500\/20{border-color:#f59e0b33}.border-black{--tw-border-opacity: 1;border-color:rgb(0 0 0 / var(--tw-border-opacity))}.border-border{border-color:hsl(var(--border))}.border-border\/50{border-color:hsl(var(--border) / .5)}.border-emerald-500\/20{border-color:#10b98133}.border-gray-600\/50{border-color:#4b556380}.border-input{border-color:hsl(var(--input))}.border-muted{border-color:hsl(var(--muted))}.border-red-500\/20{border-color:#ef444433}.border-sky-500\/20{border-color:#0ea5e933}.border-transparent{border-color:transparent}.border-zinc-500\/20{border-color:#71717a33}.border-l-transparent{border-left-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-\[--color-bg\]{background-color:var(--color-bg)}.bg-amber-50\/50{background-color:#fffbeb80}.bg-amber-600{--tw-bg-opacity: 1;background-color:rgb(217 119 6 / var(--tw-bg-opacity))}.bg-background{background-color:hsl(var(--background))}.bg-background\/80{background-color:hsl(var(--background) / .8)}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-emerald-50\/50{background-color:#ecfdf580}.bg-muted{background-color:hsl(var(--muted))}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary\/20{background-color:hsl(var(--primary) / .2)}.bg-primary\/30{background-color:hsl(var(--primary) / .3)}.bg-red-50\/50{background-color:#fef2f280}.bg-secondary{background-color:hsl(var(--secondary))}.bg-sky-50\/50{background-color:#f0f9ff80}.bg-transparent{background-color:transparent}.bg-zinc-50\/50{background-color:#fafafa80}.fill-current{fill:currentColor}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.p-\[1px\]{padding:1px}.px-1{padding-left:.25rem;padding-right:.25rem}.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-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-3{padding-bottom:.75rem}.pl-12{padding-left:3rem}.pl-2{padding-left:.5rem}.pl-3{padding-left:.75rem}.pl-8{padding-left:2rem}.pr-16{padding-right:4rem}.pr-2{padding-right:.5rem}.pr-4{padding-right:1rem}.pt-0{padding-top:0}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-5{padding-top:1.25rem}.pt-6{padding-top:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.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-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-widest{letter-spacing:.1em}.text-amber-100{--tw-text-opacity: 1;color:rgb(254 243 199 / var(--tw-text-opacity))}.text-amber-900{--tw-text-opacity: 1;color:rgb(120 53 15 / var(--tw-text-opacity))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-emerald-900{--tw-text-opacity: 1;color:rgb(6 78 59 / var(--tw-text-opacity))}.text-foreground{color:hsl(var(--foreground))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-muted-foreground\/80{color:hsl(var(--muted-foreground) / .8)}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-red-900{--tw-text-opacity: 1;color:rgb(127 29 29 / var(--tw-text-opacity))}.text-rose-600{--tw-text-opacity: 1;color:rgb(225 29 72 / var(--tw-text-opacity))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-sky-900{--tw-text-opacity: 1;color:rgb(12 74 110 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-zinc-900{--tw-text-opacity: 1;color:rgb(24 24 27 / var(--tw-text-opacity))}.underline-offset-4{text-underline-offset:4px}.caret-transparent{caret-color:transparent}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-muted-foreground{--tw-ring-color: hsl(var(--muted-foreground))}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.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}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.duration-200{animation-duration:.2s}.paused{animation-play-state:paused}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:inset-y-0:after{content:var(--tw-content);top:0;bottom:0}.after\:left-1\/2:after{content:var(--tw-content);left:50%}.after\:w-1:after{content:var(--tw-content);width:.25rem}.after\:-translate-x-1\/2:after{content:var(--tw-content);--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.after\:bg-border:after{content:var(--tw-content);background-color:hsl(var(--border))}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-amber-600\/80:hover{background-color:#d97706cc}.hover\:bg-amber-600\/90:hover{background-color:#d97706e6}.hover\:bg-destructive\/80:hover{background-color:hsl(var(--destructive) / .8)}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-transparent:hover{background-color:transparent}.hover\:stroke-destructive:hover{stroke:hsl(var(--destructive))}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width: 1px}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-default:disabled{cursor:default}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.aria-selected\:bg-accent[aria-selected=true]{background-color:hsl(var(--accent))}.aria-selected\:text-accent-foreground[aria-selected=true]{color:hsl(var(--accent-foreground))}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[panel-group-direction\=vertical\]\:h-px[data-panel-group-direction=vertical]{height:1px}.data-\[panel-group-direction\=vertical\]\:w-full[data-panel-group-direction=vertical]{width:100%}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:translate-x-5[data-state=checked]{--tw-translate-x: 1.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[panel-group-direction\=vertical\]\:flex-col[data-panel-group-direction=vertical]{flex-direction:column}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=open\]\:bg-muted[data-state=open],.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:hsl(var(--muted))}.data-\[state\=unchecked\]\:bg-slate-400[data-state=unchecked]{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity))}.data-\[state\=active\]\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[state\=open\]\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y: -48%}.data-\[panel-group-direction\=vertical\]\:after\:left-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);left:0}.data-\[panel-group-direction\=vertical\]\:after\:h-1[data-panel-group-direction=vertical]:after{content:var(--tw-content);height:.25rem}.data-\[panel-group-direction\=vertical\]\:after\:w-full[data-panel-group-direction=vertical]:after{content:var(--tw-content);width:100%}.data-\[panel-group-direction\=vertical\]\:after\:-translate-y-1\/2[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[panel-group-direction\=vertical\]\:after\:translate-x-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.dark\:-rotate-90:is(.dark *){--tw-rotate: -90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.dark\:rotate-0:is(.dark *){--tw-rotate: 0deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.dark\:scale-0:is(.dark *){--tw-scale-x: 0;--tw-scale-y: 0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.dark\:scale-100:is(.dark *){--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.dark\:border-amber-500\/30:is(.dark *){border-color:#f59e0b4d}.dark\:border-emerald-500\/30:is(.dark *){border-color:#10b9814d}.dark\:border-red-500\/30:is(.dark *){border-color:#ef44444d}.dark\:border-sky-500\/30:is(.dark *){border-color:#0ea5e94d}.dark\:border-zinc-500\/30:is(.dark *){border-color:#71717a4d}.dark\:bg-amber-500\/10:is(.dark *){background-color:#f59e0b1a}.dark\:bg-emerald-500\/10:is(.dark *){background-color:#10b9811a}.dark\:bg-red-500\/10:is(.dark *){background-color:#ef44441a}.dark\:bg-sky-500\/10:is(.dark *){background-color:#0ea5e91a}.dark\:bg-zinc-500\/10:is(.dark *){background-color:#71717a1a}.dark\:text-amber-200:is(.dark *){--tw-text-opacity: 1;color:rgb(253 230 138 / var(--tw-text-opacity))}.dark\:text-emerald-200:is(.dark *){--tw-text-opacity: 1;color:rgb(167 243 208 / var(--tw-text-opacity))}.dark\:text-red-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 202 202 / var(--tw-text-opacity))}.dark\:text-sky-200:is(.dark *){--tw-text-opacity: 1;color:rgb(186 230 253 / var(--tw-text-opacity))}.dark\:text-zinc-300:is(.dark *){--tw-text-opacity: 1;color:rgb(212 212 216 / var(--tw-text-opacity))}@media (min-width: 640px){.sm\:m-4{margin:1rem}.sm\:inline{display:inline}.sm\:max-h-\[600px\]{max-height:600px}.sm\:max-w-\[650px\]{max-width:650px}.sm\:max-w-\[740px\]{max-width:740px}.sm\:max-w-\[950px\]{max-width:950px}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-\[10rem_1fr_10rem\]{grid-template-columns:10rem 1fr 10rem}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:text-left{text-align:left}}@media (min-width: 768px){.md\:inline{display:inline}.md\:flex{display:flex}.md\:w-64{width:16rem}.md\:w-full{width:100%}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:gap-8{gap:2rem}}@media (min-width: 1024px){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (min-width: 1280px){.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\&\>\*\]\:p-4>*{padding:1rem}.\[\&\>\*\]\:px-4>*{padding-left:1rem;padding-right:1rem}.\[\&\>\*\]\:py-2>*{padding-top:.5rem;padding-bottom:.5rem}.\[\&\>div\[style\]\]\:\!block>div[style]{display:block!important}.\[\&\>div\[style\]\]\:h-full>div[style]{height:100%}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y: -3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:left-4>svg{left:1rem}.\[\&\>svg\]\:top-4>svg{top:1rem}.\[\&\>svg\]\:h-2\.5>svg{height:.625rem}.\[\&\>svg\]\:h-3>svg{height:.75rem}.\[\&\>svg\]\:w-2\.5>svg{width:.625rem}.\[\&\>svg\]\:w-3>svg{width:.75rem}.\[\&\>svg\]\:fill-rose-600>svg{fill:#e11d48}.\[\&\>svg\]\:text-amber-500>svg{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity))}.\[\&\>svg\]\:text-emerald-600>svg{--tw-text-opacity: 1;color:rgb(5 150 105 / var(--tw-text-opacity))}.\[\&\>svg\]\:text-foreground>svg{color:hsl(var(--foreground))}.\[\&\>svg\]\:text-muted-foreground>svg{color:hsl(var(--muted-foreground))}.\[\&\>svg\]\:text-red-600>svg{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity))}.\[\&\>svg\]\:text-sky-500>svg{--tw-text-opacity: 1;color:rgb(14 165 233 / var(--tw-text-opacity))}.\[\&\>svg\]\:text-zinc-400>svg{--tw-text-opacity: 1;color:rgb(161 161 170 / var(--tw-text-opacity))}.hover\:\[\&\>svg\]\:fill-rose-700>svg:hover{fill:#be123c}.dark\:\[\&\>svg\]\:text-emerald-400\/80>svg:is(.dark *){color:#34d399cc}.dark\:\[\&\>svg\]\:text-red-400\/80>svg:is(.dark *){color:#f87171cc}.dark\:\[\&\>svg\]\:text-zinc-300>svg:is(.dark *){--tw-text-opacity: 1;color:rgb(212 212 216 / var(--tw-text-opacity))}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:1.75rem}.\[\&\>tr\]\:last\:border-b-0:last-child>tr{border-bottom-width:0px}.\[\&\[data-panel-group-direction\=vertical\]\>div\]\:rotate-90[data-panel-group-direction=vertical]>div{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&_\.recharts-cartesian-axis-tick_text\]\:fill-muted-foreground .recharts-cartesian-axis-tick text{fill:hsl(var(--muted-foreground))}.\[\&_\.recharts-cartesian-grid_line\[stroke\=\'\#ccc\'\]\]\:stroke-border\/50 .recharts-cartesian-grid line[stroke="#ccc"]{stroke:hsl(var(--border) / .5)}.\[\&_\.recharts-curve\.recharts-tooltip-cursor\]\:stroke-border .recharts-curve.recharts-tooltip-cursor{stroke:hsl(var(--border))}.\[\&_\.recharts-dot\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-dot[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-layer\]\:outline-none .recharts-layer{outline:2px solid transparent;outline-offset:2px}.\[\&_\.recharts-polar-grid_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-polar-grid [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-radial-bar-background-sector\]\:fill-muted .recharts-radial-bar-background-sector,.\[\&_\.recharts-rectangle\.recharts-tooltip-cursor\]\:fill-muted .recharts-rectangle.recharts-tooltip-cursor{fill:hsl(var(--muted))}.\[\&_\.recharts-reference-line_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-reference-line [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-sector\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-sector[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-sector\]\:outline-none .recharts-sector,.\[\&_\.recharts-surface\]\:outline-none .recharts-surface{outline:2px solid transparent;outline-offset:2px}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-top:.375rem;padding-bottom:.375rem}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{font-weight:500}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:hsl(var(--muted-foreground))}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:3rem}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-top:.75rem;padding-bottom:.75rem}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:1.25rem}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:1.25rem}.\[\&_p\]\:leading-relaxed p{line-height:1.625}.\[\&_strong\]\:text-foreground strong{color:hsl(var(--foreground))}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-width:0px}.\[\&_tr\]\:border-b tr{border-bottom-width:1px}:root{--toastify-color-light: #fff;--toastify-color-dark: #121212;--toastify-color-info: #3498db;--toastify-color-success: #07bc0c;--toastify-color-warning: #f1c40f;--toastify-color-error: #e74c3c;--toastify-color-transparent: rgba(255, 255, 255, .7);--toastify-icon-color-info: var(--toastify-color-info);--toastify-icon-color-success: var(--toastify-color-success);--toastify-icon-color-warning: var(--toastify-color-warning);--toastify-icon-color-error: var(--toastify-color-error);--toastify-toast-width: 320px;--toastify-toast-offset: 16px;--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));--toastify-toast-background: #fff;--toastify-toast-min-height: 64px;--toastify-toast-max-height: 800px;--toastify-toast-bd-radius: 6px;--toastify-font-family: sans-serif;--toastify-z-index: 9999;--toastify-text-color-light: #757575;--toastify-text-color-dark: #fff;--toastify-text-color-info: #fff;--toastify-text-color-success: #fff;--toastify-text-color-warning: #fff;--toastify-text-color-error: #fff;--toastify-spinner-color: #616161;--toastify-spinner-color-empty-area: #e0e0e0;--toastify-color-progress-light: linear-gradient( to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55 );--toastify-color-progress-dark: #bb86fc;--toastify-color-progress-info: var(--toastify-color-info);--toastify-color-progress-success: var(--toastify-color-success);--toastify-color-progress-warning: var(--toastify-color-warning);--toastify-color-progress-error: var(--toastify-color-error);--toastify-color-progress-bgo: .2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translate3d(0,0,var(--toastify-z-index));position:fixed;padding:4px;width:var(--toastify-toast-width);box-sizing:border-box;color:#fff}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translate(-50%)}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right)}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translate(-50%)}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right)}@media only screen and (max-width : 480px){.Toastify__toast-container{width:100vw;padding:0;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-left,.Toastify__toast-container--top-center,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translate(0)}.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translate(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:initial}}.Toastify__toast{--y: 0;position:relative;touch-action:none;min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:8px;border-radius:var(--toastify-toast-bd-radius);box-shadow:0 4px 12px #0000001a;display:flex;justify-content:space-between;max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);cursor:default;direction:ltr;z-index:0;overflow:hidden}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,.Toastify__toast--stacked[data-collapsed] .Toastify__close-button{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-body{margin:auto 0;flex:1 1 auto;padding:6px;display:flex;align-items:center}.Toastify__toast-body>div:last-child{word-break:break-word;flex:1}.Toastify__toast-icon{margin-inline-end:10px;width:20px;flex-shrink:0;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}@media only screen and (max-width : 480px){.Toastify__toast{margin-bottom:0;border-radius:0}}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--light,.Toastify__toast-theme--colored.Toastify__toast--default{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;align-self:flex-start;z-index:1}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:hover,.Toastify__close-button:focus{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:var(--toastify-z-index);opacity:.7;transform-origin:left;border-bottom-left-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:initial;transform-origin:right;border-bottom-left-radius:initial;border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp{position:absolute;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--top-left,.Toastify__bounce-enter--bottom-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--top-right,.Toastify__bounce-enter--bottom-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--top-left,.Toastify__bounce-exit--bottom-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--top-right,.Toastify__bounce-exit--bottom-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--top-left,.Toastify__slide-enter--bottom-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--top-right,.Toastify__slide-enter--bottom-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--top-left,.Toastify__slide-exit--bottom-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-right,.Toastify__slide-exit--bottom-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.tabs-chat{background-color:transparent;width:100%;border-radius:0}.chat-item{display:flex;padding:10px;cursor:pointer;background-color:hsl(var(--background))}.chat-item:hover,.chat-item.active{background-color:#2f2f2f}.bubble{border-radius:16px;padding:12px;word-wrap:break-word}.bubble-right .bubble{background-color:#0a0a0a;text-align:right;max-width:100%}.bubble-left .bubble{background-color:#1b1b1b;max-width:100%}.bubble-right{align-self:flex-end;display:flex;justify-content:flex-end;width:80%}.bubble-left{align-self:flex-start;display:flex;justify-content:flex-start;width:80%}.input-message textarea{background-color:#2f2f2f;padding-left:48px}.input-message textarea:focus{outline:none;border:none;box-shadow:none}.message-container{flex:1;overflow-y:auto;max-height:calc(100vh - 110px);padding-top:50px} diff --git a/manager/dist/assets/index-D-oOjDYe.js b/manager/dist/assets/index-D-oOjDYe.js deleted file mode 100644 index 25cc0b122..000000000 --- a/manager/dist/assets/index-D-oOjDYe.js +++ /dev/null @@ -1,381 +0,0 @@ -var Yw=e=>{throw TypeError(e)};var sD=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var lm=(e,t,n)=>t.has(e)||Yw("Cannot "+n);var N=(e,t,n)=>(lm(e,t,"read from private field"),n?n.call(e):t.get(e)),De=(e,t,n)=>t.has(e)?Yw("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),we=(e,t,n,r)=>(lm(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Ye=(e,t,n)=>(lm(e,t,"access private method"),n);var uf=(e,t,n,r)=>({set _(s){we(e,t,s,n)},get _(){return N(e,t,r)}});var Ooe=sD((fo,po)=>{function DE(e,t){for(var n=0;nr[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(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 a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).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)}})();function Rb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var AE={exports:{}},Ig={},FE={exports:{}},it={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var zd=Symbol.for("react.element"),oD=Symbol.for("react.portal"),aD=Symbol.for("react.fragment"),iD=Symbol.for("react.strict_mode"),lD=Symbol.for("react.profiler"),cD=Symbol.for("react.provider"),uD=Symbol.for("react.context"),dD=Symbol.for("react.forward_ref"),fD=Symbol.for("react.suspense"),pD=Symbol.for("react.memo"),gD=Symbol.for("react.lazy"),Xw=Symbol.iterator;function hD(e){return e===null||typeof e!="object"?null:(e=Xw&&e[Xw]||e["@@iterator"],typeof e=="function"?e:null)}var LE={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},$E=Object.assign,BE={};function bc(e,t,n){this.props=e,this.context=t,this.refs=BE,this.updater=n||LE}bc.prototype.isReactComponent={};bc.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};bc.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function zE(){}zE.prototype=bc.prototype;function Ob(e,t,n){this.props=e,this.context=t,this.refs=BE,this.updater=n||LE}var Ib=Ob.prototype=new zE;Ib.constructor=Ob;$E(Ib,bc.prototype);Ib.isPureReactComponent=!0;var eS=Array.isArray,UE=Object.prototype.hasOwnProperty,Db={current:null},VE={key:!0,ref:!0,__self:!0,__source:!0};function HE(e,t,n){var r,s={},o=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(o=""+t.key),t)UE.call(t,r)&&!VE.hasOwnProperty(r)&&(s[r]=t[r]);var c=arguments.length-2;if(c===1)s.children=n;else if(1{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},rc=typeof window>"u"||"Deno"in globalThis;function Dr(){}function jD(e,t){return typeof e=="function"?e(t):e}function Nv(e){return typeof e=="number"&&e>=0&&e!==1/0}function WE(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Pl(e,t){return typeof e=="function"?e(t):e}function Xr(e,t){return typeof e=="function"?e(t):e}function nS(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:o,queryKey:a,stale:c}=e;if(a){if(r){if(t.queryHash!==Fb(a,t.options))return!1}else if(!zu(t.queryKey,a))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||s&&s!==t.state.fetchStatus||o&&!o(t))}function rS(e,t){const{exact:n,status:r,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(ki(t.options.mutationKey)!==ki(o))return!1}else if(!zu(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function Fb(e,t){return((t==null?void 0:t.queryKeyHashFn)||ki)(e)}function ki(e){return JSON.stringify(e,(t,n)=>_v(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function zu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!zu(e[n],t[n])):!1}function GE(e,t){if(e===t)return e;const n=sS(e)&&sS(t);if(n||_v(e)&&_v(t)){const r=n?e:Object.keys(e),s=r.length,o=n?t:Object.keys(t),a=o.length,c=n?[]:{};let u=0;for(let i=0;i{setTimeout(t,e)})}function Pv(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?GE(e,t):t}function MD(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function ND(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var JE=Symbol();function QE(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===JE?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var ui,Qo,Hl,kE,_D=(kE=class extends xc{constructor(){super();De(this,ui);De(this,Qo);De(this,Hl);we(this,Hl,t=>{if(!rc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){N(this,Qo)||this.setEventListener(N(this,Hl))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,Qo))==null||t.call(this),we(this,Qo,void 0))}setEventListener(t){var n;we(this,Hl,t),(n=N(this,Qo))==null||n.call(this),we(this,Qo,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){N(this,ui)!==t&&(we(this,ui,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof N(this,ui)=="boolean"?N(this,ui):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ui=new WeakMap,Qo=new WeakMap,Hl=new WeakMap,kE),Lb=new _D,Kl,Zo,ql,jE,PD=(jE=class extends xc{constructor(){super();De(this,Kl,!0);De(this,Zo);De(this,ql);we(this,ql,t=>{if(!rc&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){N(this,Zo)||this.setEventListener(N(this,ql))}onUnsubscribe(){var t;this.hasListeners()||((t=N(this,Zo))==null||t.call(this),we(this,Zo,void 0))}setEventListener(t){var n;we(this,ql,t),(n=N(this,Zo))==null||n.call(this),we(this,Zo,t(this.setOnline.bind(this)))}setOnline(t){N(this,Kl)!==t&&(we(this,Kl,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return N(this,Kl)}},Kl=new WeakMap,Zo=new WeakMap,ql=new WeakMap,jE),Tp=new PD;function RD(e){return Math.min(1e3*2**e,3e4)}function ZE(e){return(e??"online")==="online"?Tp.isOnline():!0}var YE=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function um(e){return e instanceof YE}function XE(e){let t=!1,n=0,r=!1,s,o,a;const c=new Promise((b,y)=>{o=b,a=y}),u=b=>{var y;r||(h(new YE(b)),(y=e.abort)==null||y.call(e))},i=()=>{t=!0},d=()=>{t=!1},p=()=>Lb.isFocused()&&(e.networkMode==="always"||Tp.isOnline())&&e.canRun(),f=()=>ZE(e.networkMode)&&e.canRun(),g=b=>{var y;r||(r=!0,(y=e.onSuccess)==null||y.call(e,b),s==null||s(),o(b))},h=b=>{var y;r||(r=!0,(y=e.onError)==null||y.call(e,b),s==null||s(),a(b))},m=()=>new Promise(b=>{var y;s=w=>{(r||p())&&b(w)},(y=e.onPause)==null||y.call(e)}).then(()=>{var b;s=void 0,r||(b=e.onContinue)==null||b.call(e)}),x=()=>{if(r)return;let b;const y=n===0?e.initialPromise:void 0;try{b=y??e.fn()}catch(w){b=Promise.reject(w)}Promise.resolve(b).then(g).catch(w=>{var j;if(r)return;const S=e.retry??(rc?0:3),E=e.retryDelay??RD,C=typeof E=="function"?E(n,w):E,T=S===!0||typeof S=="number"&&np()?void 0:m()).then(()=>{t?h(w):x()})})};return{promise:c,cancel:u,continue:()=>(s==null||s(),c),cancelRetry:i,continueRetry:d,canStart:f,start:()=>(f()?x():m().then(x),c)}}function OD(){let e=[],t=0,n=f=>{f()},r=f=>{f()},s=f=>setTimeout(f,0);const o=f=>{s=f},a=f=>{let g;t++;try{g=f()}finally{t--,t||i()}return g},c=f=>{t?e.push(f):s(()=>{n(f)})},u=f=>(...g)=>{c(()=>{f(...g)})},i=()=>{const f=e;e=[],f.length&&s(()=>{r(()=>{f.forEach(g=>{n(g)})})})};return{batch:a,batchCalls:u,schedule:c,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{r=f},setScheduler:o}}var dn=OD(),di,TE,ek=(TE=class{constructor(){De(this,di)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Nv(this.gcTime)&&we(this,di,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(rc?1/0:5*60*1e3))}clearGcTimeout(){N(this,di)&&(clearTimeout(N(this,di)),we(this,di,void 0))}},di=new WeakMap,TE),Wl,Gl,Ir,Dn,Fd,fi,Qr,eo,ME,ID=(ME=class extends ek{constructor(t){super();De(this,Qr);De(this,Wl);De(this,Gl);De(this,Ir);De(this,Dn);De(this,Fd);De(this,fi);we(this,fi,!1),we(this,Fd,t.defaultOptions),this.setOptions(t.options),this.observers=[],we(this,Ir,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,we(this,Wl,DD(this.options)),this.state=t.state??N(this,Wl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=N(this,Dn))==null?void 0:t.promise}setOptions(t){this.options={...N(this,Fd),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&N(this,Ir).remove(this)}setData(t,n){const r=Pv(this.state.data,t,this.options);return Ye(this,Qr,eo).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Ye(this,Qr,eo).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=N(this,Dn))==null?void 0:r.promise;return(s=N(this,Dn))==null||s.cancel(t),n?n.then(Dr).catch(Dr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(N(this,Wl))}isActive(){return this.observers.some(t=>Xr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!WE(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=N(this,Dn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=N(this,Dn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),N(this,Ir).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(N(this,Dn)&&(N(this,fi)?N(this,Dn).cancel({revert:!0}):N(this,Dn).cancelRetry()),this.scheduleGc()),N(this,Ir).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ye(this,Qr,eo).call(this,{type:"invalidate"})}fetch(t,n){var u,i,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(N(this,Dn))return N(this,Dn).continueRetry(),N(this,Dn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const p=this.observers.find(f=>f.options.queryFn);p&&this.setOptions(p.options)}const r=new AbortController,s=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(we(this,fi,!0),r.signal)})},o=()=>{const p=QE(this.options,n),f={queryKey:this.queryKey,meta:this.meta};return s(f),we(this,fi,!1),this.options.persister?this.options.persister(p,f,this):p(f)},a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};s(a),(u=this.options.behavior)==null||u.onFetch(a,this),we(this,Gl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((i=a.fetchOptions)==null?void 0:i.meta))&&Ye(this,Qr,eo).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta});const c=p=>{var f,g,h,m;um(p)&&p.silent||Ye(this,Qr,eo).call(this,{type:"error",error:p}),um(p)||((g=(f=N(this,Ir).config).onError)==null||g.call(f,p,this),(m=(h=N(this,Ir).config).onSettled)==null||m.call(h,this.state.data,p,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return we(this,Dn,XE({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var f,g,h,m;if(p===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(p)}catch(x){c(x);return}(g=(f=N(this,Ir).config).onSuccess)==null||g.call(f,p,this),(m=(h=N(this,Ir).config).onSettled)==null||m.call(h,p,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:c,onFail:(p,f)=>{Ye(this,Qr,eo).call(this,{type:"failed",failureCount:p,error:f})},onPause:()=>{Ye(this,Qr,eo).call(this,{type:"pause"})},onContinue:()=>{Ye(this,Qr,eo).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),N(this,Dn).start()}},Wl=new WeakMap,Gl=new WeakMap,Ir=new WeakMap,Dn=new WeakMap,Fd=new WeakMap,fi=new WeakMap,Qr=new WeakSet,eo=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...tk(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return um(s)&&s.revert&&N(this,Gl)?{...N(this,Gl),fetchStatus:"idle"}:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),dn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),N(this,Ir).notify({query:this,type:"updated",action:t})})},ME);function tk(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ZE(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function DD(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var js,NE,AD=(NE=class extends xc{constructor(t={}){super();De(this,js);this.config=t,we(this,js,new Map)}build(t,n,r){const s=n.queryKey,o=n.queryHash??Fb(s,n);let a=this.get(o);return a||(a=new ID({cache:this,queryKey:s,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(a)),a}add(t){N(this,js).has(t.queryHash)||(N(this,js).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=N(this,js).get(t.queryHash);n&&(t.destroy(),n===t&&N(this,js).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){dn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return N(this,js).get(t)}getAll(){return[...N(this,js).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>nS(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>nS(t,r)):n}notify(t){dn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){dn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){dn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},js=new WeakMap,NE),Ts,Un,pi,Ms,zo,_E,FD=(_E=class extends ek{constructor(t){super();De(this,Ms);De(this,Ts);De(this,Un);De(this,pi);this.mutationId=t.mutationId,we(this,Un,t.mutationCache),we(this,Ts,[]),this.state=t.state||nk(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){N(this,Ts).includes(t)||(N(this,Ts).push(t),this.clearGcTimeout(),N(this,Un).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){we(this,Ts,N(this,Ts).filter(n=>n!==t)),this.scheduleGc(),N(this,Un).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){N(this,Ts).length||(this.state.status==="pending"?this.scheduleGc():N(this,Un).remove(this))}continue(){var t;return((t=N(this,pi))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,o,a,c,u,i,d,p,f,g,h,m,x,b,y,w,S,E,C,T;we(this,pi,XE({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(j,_)=>{Ye(this,Ms,zo).call(this,{type:"failed",failureCount:j,error:_})},onPause:()=>{Ye(this,Ms,zo).call(this,{type:"pause"})},onContinue:()=>{Ye(this,Ms,zo).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>N(this,Un).canRun(this)}));const n=this.state.status==="pending",r=!N(this,pi).canStart();try{if(!n){Ye(this,Ms,zo).call(this,{type:"pending",variables:t,isPaused:r}),await((o=(s=N(this,Un).config).onMutate)==null?void 0:o.call(s,t,this));const _=await((c=(a=this.options).onMutate)==null?void 0:c.call(a,t));_!==this.state.context&&Ye(this,Ms,zo).call(this,{type:"pending",context:_,variables:t,isPaused:r})}const j=await N(this,pi).start();return await((i=(u=N(this,Un).config).onSuccess)==null?void 0:i.call(u,j,t,this.state.context,this)),await((p=(d=this.options).onSuccess)==null?void 0:p.call(d,j,t,this.state.context)),await((g=(f=N(this,Un).config).onSettled)==null?void 0:g.call(f,j,null,this.state.variables,this.state.context,this)),await((m=(h=this.options).onSettled)==null?void 0:m.call(h,j,null,t,this.state.context)),Ye(this,Ms,zo).call(this,{type:"success",data:j}),j}catch(j){try{throw await((b=(x=N(this,Un).config).onError)==null?void 0:b.call(x,j,t,this.state.context,this)),await((w=(y=this.options).onError)==null?void 0:w.call(y,j,t,this.state.context)),await((E=(S=N(this,Un).config).onSettled)==null?void 0:E.call(S,void 0,j,this.state.variables,this.state.context,this)),await((T=(C=this.options).onSettled)==null?void 0:T.call(C,void 0,j,t,this.state.context)),j}finally{Ye(this,Ms,zo).call(this,{type:"error",error:j})}}finally{N(this,Un).runNext(this)}}},Ts=new WeakMap,Un=new WeakMap,pi=new WeakMap,Ms=new WeakSet,zo=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),dn.batch(()=>{N(this,Ts).forEach(r=>{r.onMutationUpdate(t)}),N(this,Un).notify({mutation:this,type:"updated",action:t})})},_E);function nk(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var fr,Ld,PE,LD=(PE=class extends xc{constructor(t={}){super();De(this,fr);De(this,Ld);this.config=t,we(this,fr,new Map),we(this,Ld,Date.now())}build(t,n,r){const s=new FD({mutationCache:this,mutationId:++uf(this,Ld)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){const n=ff(t),r=N(this,fr).get(n)??[];r.push(t),N(this,fr).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=ff(t);if(N(this,fr).has(n)){const s=(r=N(this,fr).get(n))==null?void 0:r.filter(o=>o!==t);s&&(s.length===0?N(this,fr).delete(n):N(this,fr).set(n,s))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=N(this,fr).get(ff(t)))==null?void 0:r.find(s=>s.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=N(this,fr).get(ff(t)))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){dn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...N(this,fr).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>rS(n,r))}findAll(t={}){return this.getAll().filter(n=>rS(t,n))}notify(t){dn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return dn.batch(()=>Promise.all(t.map(n=>n.continue().catch(Dr))))}},fr=new WeakMap,Ld=new WeakMap,PE);function ff(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function $D(e){return{onFetch:(t,n)=>{const r=async()=>{var h,m,x,b,y;const s=t.options,o=(x=(m=(h=t.fetchOptions)==null?void 0:h.meta)==null?void 0:m.fetchMore)==null?void 0:x.direction,a=((b=t.state.data)==null?void 0:b.pages)||[],c=((y=t.state.data)==null?void 0:y.pageParams)||[],u={pages:[],pageParams:[]};let i=!1;const d=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?i=!0:t.signal.addEventListener("abort",()=>{i=!0}),t.signal)})},p=QE(t.options,t.fetchOptions),f=async(w,S,E)=>{if(i)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const C={queryKey:t.queryKey,pageParam:S,direction:E?"backward":"forward",meta:t.options.meta};d(C);const T=await p(C),{maxPages:j}=t.options,_=E?ND:MD;return{pages:_(w.pages,T,j),pageParams:_(w.pageParams,S,j)}};let g;if(o&&a.length){const w=o==="backward",S=w?BD:aS,E={pages:a,pageParams:c},C=S(s,E);g=await f(E,C,w)}else{g=await f(u,c[0]??s.initialPageParam);const w=e??a.length;for(let S=1;S{var s,o;return(o=(s=t.options).persister)==null?void 0:o.call(s,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function aS(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function BD(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Qt,Yo,Xo,Jl,Ql,ea,Zl,Yl,RE,zD=(RE=class{constructor(e={}){De(this,Qt);De(this,Yo);De(this,Xo);De(this,Jl);De(this,Ql);De(this,ea);De(this,Zl);De(this,Yl);we(this,Qt,e.queryCache||new AD),we(this,Yo,e.mutationCache||new LD),we(this,Xo,e.defaultOptions||{}),we(this,Jl,new Map),we(this,Ql,new Map),we(this,ea,0)}mount(){uf(this,ea)._++,N(this,ea)===1&&(we(this,Zl,Lb.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,Qt).onFocus())})),we(this,Yl,Tp.subscribe(async e=>{e&&(await this.resumePausedMutations(),N(this,Qt).onOnline())})))}unmount(){var e,t;uf(this,ea)._--,N(this,ea)===0&&((e=N(this,Zl))==null||e.call(this),we(this,Zl,void 0),(t=N(this,Yl))==null||t.call(this),we(this,Yl,void 0))}isFetching(e){return N(this,Qt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return N(this,Yo).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=N(this,Qt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const n=this.defaultQueryOptions(e),r=N(this,Qt).build(this,n);return e.revalidateIfStale&&r.isStaleByTime(Pl(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return N(this,Qt).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=N(this,Qt).get(r.queryHash),o=s==null?void 0:s.state.data,a=jD(t,o);if(a!==void 0)return N(this,Qt).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return dn.batch(()=>N(this,Qt).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=N(this,Qt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=N(this,Qt);dn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=N(this,Qt),r={type:"active",...e};return dn.batch(()=>(n.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=dn.batch(()=>N(this,Qt).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Dr).catch(Dr)}invalidateQueries(e={},t={}){return dn.batch(()=>{if(N(this,Qt).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=dn.batch(()=>N(this,Qt).findAll(e).filter(s=>!s.isDisabled()).map(s=>{let o=s.fetch(void 0,n);return n.throwOnError||(o=o.catch(Dr)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Dr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=N(this,Qt).build(this,t);return n.isStaleByTime(Pl(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Dr).catch(Dr)}fetchInfiniteQuery(e){return e.behavior=$D(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Dr).catch(Dr)}resumePausedMutations(){return Tp.isOnline()?N(this,Yo).resumePausedMutations():Promise.resolve()}getQueryCache(){return N(this,Qt)}getMutationCache(){return N(this,Yo)}getDefaultOptions(){return N(this,Xo)}setDefaultOptions(e){we(this,Xo,e)}setQueryDefaults(e,t){N(this,Jl).set(ki(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...N(this,Jl).values()];let n={};return t.forEach(r=>{zu(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){N(this,Ql).set(ki(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...N(this,Ql).values()];let n={};return t.forEach(r=>{zu(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...N(this,Xo).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Fb(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.enabled!==!0&&t.queryFn===JE&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...N(this,Xo).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){N(this,Qt).clear(),N(this,Yo).clear()}},Qt=new WeakMap,Yo=new WeakMap,Xo=new WeakMap,Jl=new WeakMap,Ql=new WeakMap,ea=new WeakMap,Zl=new WeakMap,Yl=new WeakMap,RE),er,lt,$d,Vn,gi,Xl,Ns,Bd,ec,tc,hi,mi,ta,nc,wt,du,Rv,Ov,Iv,Dv,Av,Fv,Lv,rk,OE,UD=(OE=class extends xc{constructor(t,n){super();De(this,wt);De(this,er);De(this,lt);De(this,$d);De(this,Vn);De(this,gi);De(this,Xl);De(this,Ns);De(this,Bd);De(this,ec);De(this,tc);De(this,hi);De(this,mi);De(this,ta);De(this,nc,new Set);this.options=n,we(this,er,t),we(this,Ns,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(N(this,lt).addObserver(this),iS(N(this,lt),this.options)?Ye(this,wt,du).call(this):this.updateResult(),Ye(this,wt,Dv).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return $v(N(this,lt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return $v(N(this,lt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ye(this,wt,Av).call(this),Ye(this,wt,Fv).call(this),N(this,lt).removeObserver(this)}setOptions(t,n){const r=this.options,s=N(this,lt);if(this.options=N(this,er).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Xr(this.options.enabled,N(this,lt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ye(this,wt,Lv).call(this),N(this,lt).setOptions(this.options),r._defaulted&&!jp(this.options,r)&&N(this,er).getQueryCache().notify({type:"observerOptionsUpdated",query:N(this,lt),observer:this});const o=this.hasListeners();o&&lS(N(this,lt),s,this.options,r)&&Ye(this,wt,du).call(this),this.updateResult(n),o&&(N(this,lt)!==s||Xr(this.options.enabled,N(this,lt))!==Xr(r.enabled,N(this,lt))||Pl(this.options.staleTime,N(this,lt))!==Pl(r.staleTime,N(this,lt)))&&Ye(this,wt,Rv).call(this);const a=Ye(this,wt,Ov).call(this);o&&(N(this,lt)!==s||Xr(this.options.enabled,N(this,lt))!==Xr(r.enabled,N(this,lt))||a!==N(this,ta))&&Ye(this,wt,Iv).call(this,a)}getOptimisticResult(t){const n=N(this,er).getQueryCache().build(N(this,er),t),r=this.createResult(n,t);return HD(this,r)&&(we(this,Vn,r),we(this,Xl,this.options),we(this,gi,N(this,lt).state)),r}getCurrentResult(){return N(this,Vn)}trackResult(t,n){const r={};return Object.keys(t).forEach(s=>{Object.defineProperty(r,s,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(s),n==null||n(s),t[s])})}),r}trackProp(t){N(this,nc).add(t)}getCurrentQuery(){return N(this,lt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=N(this,er).defaultQueryOptions(t),r=N(this,er).getQueryCache().build(N(this,er),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Ye(this,wt,du).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),N(this,Vn)))}createResult(t,n){var T;const r=N(this,lt),s=this.options,o=N(this,Vn),a=N(this,gi),c=N(this,Xl),i=t!==r?t.state:N(this,$d),{state:d}=t;let p={...d},f=!1,g;if(n._optimisticResults){const j=this.hasListeners(),_=!j&&iS(t,n),O=j&&lS(t,r,n,s);(_||O)&&(p={...p,...tk(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:h,errorUpdatedAt:m,status:x}=p;if(n.select&&p.data!==void 0)if(o&&p.data===(a==null?void 0:a.data)&&n.select===N(this,Bd))g=N(this,ec);else try{we(this,Bd,n.select),g=n.select(p.data),g=Pv(o==null?void 0:o.data,g,n),we(this,ec,g),we(this,Ns,null)}catch(j){we(this,Ns,j)}else g=p.data;if(n.placeholderData!==void 0&&g===void 0&&x==="pending"){let j;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(c==null?void 0:c.placeholderData))j=o.data;else if(j=typeof n.placeholderData=="function"?n.placeholderData((T=N(this,tc))==null?void 0:T.state.data,N(this,tc)):n.placeholderData,n.select&&j!==void 0)try{j=n.select(j),we(this,Ns,null)}catch(_){we(this,Ns,_)}j!==void 0&&(x="success",g=Pv(o==null?void 0:o.data,j,n),f=!0)}N(this,Ns)&&(h=N(this,Ns),g=N(this,ec),m=Date.now(),x="error");const b=p.fetchStatus==="fetching",y=x==="pending",w=x==="error",S=y&&b,E=g!==void 0;return{status:x,fetchStatus:p.fetchStatus,isPending:y,isSuccess:x==="success",isError:w,isInitialLoading:S,isLoading:S,data:g,dataUpdatedAt:p.dataUpdatedAt,error:h,errorUpdatedAt:m,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>i.dataUpdateCount||p.errorUpdateCount>i.errorUpdateCount,isFetching:b,isRefetching:b&&!y,isLoadingError:w&&!E,isPaused:p.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:w&&E,isStale:$b(t,n),refetch:this.refetch}}updateResult(t){const n=N(this,Vn),r=this.createResult(N(this,lt),this.options);if(we(this,gi,N(this,lt).state),we(this,Xl,this.options),N(this,gi).data!==void 0&&we(this,tc,N(this,lt)),jp(r,n))return;we(this,Vn,r);const s={},o=()=>{if(!n)return!0;const{notifyOnChangeProps:a}=this.options,c=typeof a=="function"?a():a;if(c==="all"||!c&&!N(this,nc).size)return!0;const u=new Set(c??N(this,nc));return this.options.throwOnError&&u.add("error"),Object.keys(N(this,Vn)).some(i=>{const d=i;return N(this,Vn)[d]!==n[d]&&u.has(d)})};(t==null?void 0:t.listeners)!==!1&&o()&&(s.listeners=!0),Ye(this,wt,rk).call(this,{...s,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ye(this,wt,Dv).call(this)}},er=new WeakMap,lt=new WeakMap,$d=new WeakMap,Vn=new WeakMap,gi=new WeakMap,Xl=new WeakMap,Ns=new WeakMap,Bd=new WeakMap,ec=new WeakMap,tc=new WeakMap,hi=new WeakMap,mi=new WeakMap,ta=new WeakMap,nc=new WeakMap,wt=new WeakSet,du=function(t){Ye(this,wt,Lv).call(this);let n=N(this,lt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Dr)),n},Rv=function(){Ye(this,wt,Av).call(this);const t=Pl(this.options.staleTime,N(this,lt));if(rc||N(this,Vn).isStale||!Nv(t))return;const r=WE(N(this,Vn).dataUpdatedAt,t)+1;we(this,hi,setTimeout(()=>{N(this,Vn).isStale||this.updateResult()},r))},Ov=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(N(this,lt)):this.options.refetchInterval)??!1},Iv=function(t){Ye(this,wt,Fv).call(this),we(this,ta,t),!(rc||Xr(this.options.enabled,N(this,lt))===!1||!Nv(N(this,ta))||N(this,ta)===0)&&we(this,mi,setInterval(()=>{(this.options.refetchIntervalInBackground||Lb.isFocused())&&Ye(this,wt,du).call(this)},N(this,ta)))},Dv=function(){Ye(this,wt,Rv).call(this),Ye(this,wt,Iv).call(this,Ye(this,wt,Ov).call(this))},Av=function(){N(this,hi)&&(clearTimeout(N(this,hi)),we(this,hi,void 0))},Fv=function(){N(this,mi)&&(clearInterval(N(this,mi)),we(this,mi,void 0))},Lv=function(){const t=N(this,er).getQueryCache().build(N(this,er),this.options);if(t===N(this,lt))return;const n=N(this,lt);we(this,lt,t),we(this,$d,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},rk=function(t){dn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(N(this,Vn))}),N(this,er).getQueryCache().notify({query:N(this,lt),type:"observerResultsUpdated"})})},OE);function VD(e,t){return Xr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function iS(e,t){return VD(e,t)||e.state.data!==void 0&&$v(e,t,t.refetchOnMount)}function $v(e,t,n){if(Xr(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&$b(e,t)}return!1}function lS(e,t,n,r){return(e!==t||Xr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&$b(e,n)}function $b(e,t){return Xr(t.enabled,e)!==!1&&e.isStaleByTime(Pl(t.staleTime,e))}function HD(e,t){return!jp(e.getCurrentResult(),t)}var na,ra,tr,ao,mo,ep,Bv,IE,KD=(IE=class extends xc{constructor(n,r){super();De(this,mo);De(this,na);De(this,ra);De(this,tr);De(this,ao);we(this,na,n),this.setOptions(r),this.bindMethods(),Ye(this,mo,ep).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=N(this,na).defaultMutationOptions(n),jp(this.options,r)||N(this,na).getMutationCache().notify({type:"observerOptionsUpdated",mutation:N(this,tr),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&ki(r.mutationKey)!==ki(this.options.mutationKey)?this.reset():((s=N(this,tr))==null?void 0:s.state.status)==="pending"&&N(this,tr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=N(this,tr))==null||n.removeObserver(this)}onMutationUpdate(n){Ye(this,mo,ep).call(this),Ye(this,mo,Bv).call(this,n)}getCurrentResult(){return N(this,ra)}reset(){var n;(n=N(this,tr))==null||n.removeObserver(this),we(this,tr,void 0),Ye(this,mo,ep).call(this),Ye(this,mo,Bv).call(this)}mutate(n,r){var s;return we(this,ao,r),(s=N(this,tr))==null||s.removeObserver(this),we(this,tr,N(this,na).getMutationCache().build(N(this,na),this.options)),N(this,tr).addObserver(this),N(this,tr).execute(n)}},na=new WeakMap,ra=new WeakMap,tr=new WeakMap,ao=new WeakMap,mo=new WeakSet,ep=function(){var r;const n=((r=N(this,tr))==null?void 0:r.state)??nk();we(this,ra,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Bv=function(n){dn.batch(()=>{var r,s,o,a,c,u,i,d;if(N(this,ao)&&this.hasListeners()){const p=N(this,ra).variables,f=N(this,ra).context;(n==null?void 0:n.type)==="success"?((s=(r=N(this,ao)).onSuccess)==null||s.call(r,n.data,p,f),(a=(o=N(this,ao)).onSettled)==null||a.call(o,n.data,null,p,f)):(n==null?void 0:n.type)==="error"&&((u=(c=N(this,ao)).onError)==null||u.call(c,n.error,p,f),(d=(i=N(this,ao)).onSettled)==null||d.call(i,void 0,n.error,p,f))}this.listeners.forEach(p=>{p(N(this,ra))})})},IE),sk=v.createContext(void 0),Bb=e=>{const t=v.useContext(sk);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},qD=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(sk.Provider,{value:e,children:t})),ok=v.createContext(!1),WD=()=>v.useContext(ok);ok.Provider;function GD(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var JD=v.createContext(GD()),QD=()=>v.useContext(JD);function ak(e,t){return typeof e=="function"?e(...t):!!e}function ZD(){}var YD=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},XD=e=>{v.useEffect(()=>{e.clearReset()},[e])},eA=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&ak(n,[e.error,r]),tA=e=>{e.suspense&&(typeof e.staleTime!="number"&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},nA=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,rA=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function sA(e,t,n){var i,d,p,f;const r=Bb(),s=WD(),o=QD(),a=r.defaultQueryOptions(e);(d=(i=r.getDefaultOptions().queries)==null?void 0:i._experimental_beforeQuery)==null||d.call(i,a),a._optimisticResults=s?"isRestoring":"optimistic",tA(a),YD(a,o),XD(o);const[c]=v.useState(()=>new t(r,a)),u=c.getOptimisticResult(a);if(v.useSyncExternalStore(v.useCallback(g=>{const h=s?()=>{}:c.subscribe(dn.batchCalls(g));return c.updateResult(),h},[c,s]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),v.useEffect(()=>{c.setOptions(a,{listeners:!1})},[a,c]),nA(a,u))throw rA(a,c,o);if(eA({result:u,errorResetBoundary:o,throwOnError:a.throwOnError,query:r.getQueryCache().get(a.queryHash)}))throw u.error;return(f=(p=r.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||f.call(p,a,u),a.notifyOnChangeProps?u:c.trackResult(u)}function qe(e,t){return sA(e,UD)}function oA(e,t){const n=Bb(),[r]=v.useState(()=>new KD(n,e));v.useEffect(()=>{r.setOptions(e)},[r,e]);const s=v.useSyncExternalStore(v.useCallback(a=>r.subscribe(dn.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=v.useCallback((a,c)=>{r.mutate(a,c).catch(ZD)},[r]);if(s.error&&ak(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:o,mutateAsync:s.mutate}}var zv={},ik={exports:{}},jr={},lk={exports:{}},ck={};/** - * @license React - * scheduler.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */(function(e){function t(L,A){var X=L.length;L.push(A);e:for(;0>>1,H=L[fe];if(0>>1;fes(le,X))oes(Q,le)?(L[fe]=Q,L[oe]=X,fe=oe):(L[fe]=le,L[ne]=X,fe=ne);else if(oes(Q,X))L[fe]=Q,L[oe]=X,fe=oe;else break e}}return A}function s(L,A){var X=L.sortIndex-A.sortIndex;return X!==0?X:L.id-A.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,c=a.now();e.unstable_now=function(){return a.now()-c}}var u=[],i=[],d=1,p=null,f=3,g=!1,h=!1,m=!1,x=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(L){for(var A=n(i);A!==null;){if(A.callback===null)r(i);else if(A.startTime<=L)r(i),A.sortIndex=A.expirationTime,t(u,A);else break;A=n(i)}}function S(L){if(m=!1,w(L),!h)if(n(u)!==null)h=!0,ee(E);else{var A=n(i);A!==null&&J(S,A.startTime-L)}}function E(L,A){h=!1,m&&(m=!1,b(j),j=-1),g=!0;var X=f;try{for(w(A),p=n(u);p!==null&&(!(p.expirationTime>A)||L&&!K());){var fe=p.callback;if(typeof fe=="function"){p.callback=null,f=p.priorityLevel;var H=fe(p.expirationTime<=A);A=e.unstable_now(),typeof H=="function"?p.callback=H:p===n(u)&&r(u),w(A)}else r(u);p=n(u)}if(p!==null)var se=!0;else{var ne=n(i);ne!==null&&J(S,ne.startTime-A),se=!1}return se}finally{p=null,f=X,g=!1}}var C=!1,T=null,j=-1,_=5,O=-1;function K(){return!(e.unstable_now()-O<_)}function I(){if(T!==null){var L=e.unstable_now();O=L;var A=!0;try{A=T(!0,L)}finally{A?Y():(C=!1,T=null)}}else C=!1}var Y;if(typeof y=="function")Y=function(){y(I)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,Z=q.port2;q.port1.onmessage=I,Y=function(){Z.postMessage(null)}}else Y=function(){x(I,0)};function ee(L){T=L,C||(C=!0,Y())}function J(L,A){j=x(function(){L(e.unstable_now())},A)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(L){L.callback=null},e.unstable_continueExecution=function(){h||g||(h=!0,ee(E))},e.unstable_forceFrameRate=function(L){0>L||125fe?(L.sortIndex=X,t(i,L),n(u)===null&&L===n(i)&&(m?(b(j),j=-1):m=!0,J(S,X-fe))):(L.sortIndex=H,t(u,L),h||g||(h=!0,ee(E))),L},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(L){var A=f;return function(){var X=f;f=A;try{return L.apply(this,arguments)}finally{f=X}}}})(ck);lk.exports=ck;var aA=lk.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var iA=v,Cr=aA;function te(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Uv=Object.prototype.hasOwnProperty,lA=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,cS={},uS={};function cA(e){return Uv.call(uS,e)?!0:Uv.call(cS,e)?!1:lA.test(e)?uS[e]=!0:(cS[e]=!0,!1)}function uA(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function dA(e,t,n,r){if(t===null||typeof t>"u"||uA(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Zn(e,t,n,r,s,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var jn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){jn[e]=new Zn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];jn[t]=new Zn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){jn[e]=new Zn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){jn[e]=new Zn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){jn[e]=new Zn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){jn[e]=new Zn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){jn[e]=new Zn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){jn[e]=new Zn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){jn[e]=new Zn(e,5,!1,e.toLowerCase(),null,!1,!1)});var zb=/[\-:]([a-z])/g;function Ub(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(zb,Ub);jn[t]=new Zn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(zb,Ub);jn[t]=new Zn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(zb,Ub);jn[t]=new Zn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){jn[e]=new Zn(e,1,!1,e.toLowerCase(),null,!1,!1)});jn.xlinkHref=new Zn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){jn[e]=new Zn(e,1,!1,e.toLowerCase(),null,!0,!0)});function Vb(e,t,n,r){var s=jn.hasOwnProperty(t)?jn[t]:null;(s!==null?s.type!==0:r||!(2c||s[a]!==o[c]){var u=` -`+s[a].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=a&&0<=c);break}}}finally{fm=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?fu(e):""}function fA(e){switch(e.tag){case 5:return fu(e.type);case 16:return fu("Lazy");case 13:return fu("Suspense");case 19:return fu("SuspenseList");case 0:case 2:case 15:return e=pm(e.type,!1),e;case 11:return e=pm(e.type.render,!1),e;case 1:return e=pm(e.type,!0),e;default:return""}}function qv(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ml:return"Fragment";case hl:return"Portal";case Vv:return"Profiler";case Hb:return"StrictMode";case Hv:return"Suspense";case Kv:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case fk:return(e.displayName||"Context")+".Consumer";case dk:return(e._context.displayName||"Context")+".Provider";case Kb:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case qb:return t=e.displayName||null,t!==null?t:qv(e.type)||"Memo";case Ho:t=e._payload,e=e._init;try{return qv(e(t))}catch{}}return null}function pA(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return qv(t);case 8:return t===Hb?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ma(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function gk(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function gA(e){var t=gk(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function gf(e){e._valueTracker||(e._valueTracker=gA(e))}function hk(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=gk(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Mp(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Wv(e,t){var n=t.checked;return Gt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function fS(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ma(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function mk(e,t){t=t.checked,t!=null&&Vb(e,"checked",t,!1)}function Gv(e,t){mk(e,t);var n=ma(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Jv(e,t.type,n):t.hasOwnProperty("defaultValue")&&Jv(e,t.type,ma(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function pS(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Jv(e,t,n){(t!=="number"||Mp(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var pu=Array.isArray;function Rl(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=hf.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Vu(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Eu={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},hA=["Webkit","ms","Moz","O"];Object.keys(Eu).forEach(function(e){hA.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Eu[t]=Eu[e]})});function xk(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Eu.hasOwnProperty(e)&&Eu[e]?(""+t).trim():t+"px"}function wk(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=xk(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var mA=Gt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Yv(e,t){if(t){if(mA[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(te(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(te(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(te(61))}if(t.style!=null&&typeof t.style!="object")throw Error(te(62))}}function Xv(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ey=null;function Wb(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ty=null,Ol=null,Il=null;function mS(e){if(e=Hd(e)){if(typeof ty!="function")throw Error(te(280));var t=e.stateNode;t&&(t=Bg(t),ty(e.stateNode,e.type,t))}}function Sk(e){Ol?Il?Il.push(e):Il=[e]:Ol=e}function Ck(){if(Ol){var e=Ol,t=Il;if(Il=Ol=null,mS(e),t)for(e=0;e>>=0,e===0?32:31-(TA(e)/MA|0)|0}var mf=64,vf=4194304;function gu(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Rp(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,o=e.pingedLanes,a=n&268435455;if(a!==0){var c=a&~s;c!==0?r=gu(c):(o&=a,o!==0&&(r=gu(o)))}else a=n&~s,a!==0?r=gu(a):o!==0&&(r=gu(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,o=t&-t,s>=o||s===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Ud(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ss(t),e[t]=n}function RA(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=ju),kS=" ",jS=!1;function Vk(e,t){switch(e){case"keyup":return aF.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hk(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var vl=!1;function lF(e,t){switch(e){case"compositionend":return Hk(t);case"keypress":return t.which!==32?null:(jS=!0,kS);case"textInput":return e=t.data,e===kS&&jS?null:e;default:return null}}function cF(e,t){if(vl)return e==="compositionend"||!tx&&Vk(e,t)?(e=zk(),np=Yb=sa=null,vl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=_S(n)}}function Gk(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Gk(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Jk(){for(var e=window,t=Mp();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Mp(e.document)}return t}function nx(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function yF(e){var t=Jk(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Gk(n.ownerDocument.documentElement,n)){if(r!==null&&nx(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,o=Math.min(r.start,s);r=r.end===void 0?o:Math.min(r.end,s),!e.extend&&o>r&&(s=r,r=o,o=s),s=PS(n,o);var a=PS(n,r);s&&a&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,yl=null,iy=null,Mu=null,ly=!1;function RS(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ly||yl==null||yl!==Mp(r)||(r=yl,"selectionStart"in r&&nx(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Mu&&Ju(Mu,r)||(Mu=r,r=Dp(iy,"onSelect"),0wl||(e.current=gy[wl],gy[wl]=null,wl--)}function Nt(e,t){wl++,gy[wl]=e.current,e.current=t}var va={},Ln=Na(va),or=Na(!1),ji=va;function oc(e,t){var n=e.type.contextTypes;if(!n)return va;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},o;for(o in n)s[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function ar(e){return e=e.childContextTypes,e!=null}function Fp(){At(or),At(Ln)}function $S(e,t,n){if(Ln.current!==va)throw Error(te(168));Nt(Ln,t),Nt(or,n)}function sj(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(te(108,pA(e)||"Unknown",s));return Gt({},n,r)}function Lp(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||va,ji=Ln.current,Nt(Ln,e),Nt(or,or.current),!0}function BS(e,t,n){var r=e.stateNode;if(!r)throw Error(te(169));n?(e=sj(e,t,ji),r.__reactInternalMemoizedMergedChildContext=e,At(or),At(Ln),Nt(Ln,e)):At(or),Nt(or,n)}var oo=null,zg=!1,Tm=!1;function oj(e){oo===null?oo=[e]:oo.push(e)}function _F(e){zg=!0,oj(e)}function _a(){if(!Tm&&oo!==null){Tm=!0;var e=0,t=Ct;try{var n=oo;for(Ct=1;e>=a,s-=a,lo=1<<32-ss(t)+s|n<j?(_=T,T=null):_=T.sibling;var O=f(b,T,w[j],S);if(O===null){T===null&&(T=_);break}e&&T&&O.alternate===null&&t(b,T),y=o(O,y,j),C===null?E=O:C.sibling=O,C=O,T=_}if(j===w.length)return n(b,T),$t&&Ja(b,j),E;if(T===null){for(;jj?(_=T,T=null):_=T.sibling;var K=f(b,T,O.value,S);if(K===null){T===null&&(T=_);break}e&&T&&K.alternate===null&&t(b,T),y=o(K,y,j),C===null?E=K:C.sibling=K,C=K,T=_}if(O.done)return n(b,T),$t&&Ja(b,j),E;if(T===null){for(;!O.done;j++,O=w.next())O=p(b,O.value,S),O!==null&&(y=o(O,y,j),C===null?E=O:C.sibling=O,C=O);return $t&&Ja(b,j),E}for(T=r(b,T);!O.done;j++,O=w.next())O=g(T,b,j,O.value,S),O!==null&&(e&&O.alternate!==null&&T.delete(O.key===null?j:O.key),y=o(O,y,j),C===null?E=O:C.sibling=O,C=O);return e&&T.forEach(function(I){return t(b,I)}),$t&&Ja(b,j),E}function x(b,y,w,S){if(typeof w=="object"&&w!==null&&w.type===ml&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case pf:e:{for(var E=w.key,C=y;C!==null;){if(C.key===E){if(E=w.type,E===ml){if(C.tag===7){n(b,C.sibling),y=s(C,w.props.children),y.return=b,b=y;break e}}else if(C.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Ho&&VS(E)===C.type){n(b,C.sibling),y=s(C,w.props),y.ref=Gc(b,C,w),y.return=b,b=y;break e}n(b,C);break}else t(b,C);C=C.sibling}w.type===ml?(y=yi(w.props.children,b.mode,S,w.key),y.return=b,b=y):(S=up(w.type,w.key,w.props,null,b.mode,S),S.ref=Gc(b,y,w),S.return=b,b=S)}return a(b);case hl:e:{for(C=w.key;y!==null;){if(y.key===C)if(y.tag===4&&y.stateNode.containerInfo===w.containerInfo&&y.stateNode.implementation===w.implementation){n(b,y.sibling),y=s(y,w.children||[]),y.return=b,b=y;break e}else{n(b,y);break}else t(b,y);y=y.sibling}y=Dm(w,b.mode,S),y.return=b,b=y}return a(b);case Ho:return C=w._init,x(b,y,C(w._payload),S)}if(pu(w))return h(b,y,w,S);if(Vc(w))return m(b,y,w,S);Ef(b,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,y!==null&&y.tag===6?(n(b,y.sibling),y=s(y,w),y.return=b,b=y):(n(b,y),y=Im(w,b.mode,S),y.return=b,b=y),a(b)):n(b,y)}return x}var ic=cj(!0),uj=cj(!1),zp=Na(null),Up=null,El=null,ax=null;function ix(){ax=El=Up=null}function lx(e){var t=zp.current;At(zp),e._currentValue=t}function vy(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Al(e,t){Up=e,ax=El=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(sr=!0),e.firstContext=null)}function Hr(e){var t=e._currentValue;if(ax!==e)if(e={context:e,memoizedValue:t,next:null},El===null){if(Up===null)throw Error(te(308));El=e,Up.dependencies={lanes:0,firstContext:e}}else El=El.next=e;return t}var ei=null;function cx(e){ei===null?ei=[e]:ei.push(e)}function dj(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,cx(t)):(n.next=s.next,s.next=n),t.interleaved=n,bo(e,r)}function bo(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ko=!1;function ux(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function fj(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function go(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function fa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,gt&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,bo(e,n)}return s=r.interleaved,s===null?(t.next=t,cx(r)):(t.next=s.next,s.next=t),r.interleaved=t,bo(e,n)}function sp(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Jb(e,n)}}function HS(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?s=o=a:o=o.next=a,n=n.next}while(n!==null);o===null?s=o=t:o=o.next=t}else s=o=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Vp(e,t,n,r){var s=e.updateQueue;Ko=!1;var o=s.firstBaseUpdate,a=s.lastBaseUpdate,c=s.shared.pending;if(c!==null){s.shared.pending=null;var u=c,i=u.next;u.next=null,a===null?o=i:a.next=i,a=u;var d=e.alternate;d!==null&&(d=d.updateQueue,c=d.lastBaseUpdate,c!==a&&(c===null?d.firstBaseUpdate=i:c.next=i,d.lastBaseUpdate=u))}if(o!==null){var p=s.baseState;a=0,d=i=u=null,c=o;do{var f=c.lane,g=c.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:g,lane:0,tag:c.tag,payload:c.payload,callback:c.callback,next:null});e:{var h=e,m=c;switch(f=t,g=n,m.tag){case 1:if(h=m.payload,typeof h=="function"){p=h.call(g,p,f);break e}p=h;break e;case 3:h.flags=h.flags&-65537|128;case 0:if(h=m.payload,f=typeof h=="function"?h.call(g,p,f):h,f==null)break e;p=Gt({},p,f);break e;case 2:Ko=!0}}c.callback!==null&&c.lane!==0&&(e.flags|=64,f=s.effects,f===null?s.effects=[c]:f.push(c))}else g={eventTime:g,lane:f,tag:c.tag,payload:c.payload,callback:c.callback,next:null},d===null?(i=d=g,u=p):d=d.next=g,a|=f;if(c=c.next,c===null){if(c=s.shared.pending,c===null)break;f=c,c=f.next,f.next=null,s.lastBaseUpdate=f,s.shared.pending=null}}while(!0);if(d===null&&(u=p),s.baseState=u,s.firstBaseUpdate=i,s.lastBaseUpdate=d,t=s.shared.interleaved,t!==null){s=t;do a|=s.lane,s=s.next;while(s!==t)}else o===null&&(s.shared.lanes=0);Ni|=a,e.lanes=a,e.memoizedState=p}}function KS(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Nm.transition;Nm.transition={};try{e(!1),t()}finally{Ct=n,Nm.transition=r}}function Nj(){return Kr().memoizedState}function IF(e,t,n){var r=ga(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},_j(e))Pj(t,n);else if(n=dj(e,t,n,r),n!==null){var s=Gn();os(n,e,r,s),Rj(n,t,r)}}function DF(e,t,n){var r=ga(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(_j(e))Pj(t,s);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,c=o(a,n);if(s.hasEagerState=!0,s.eagerState=c,ds(c,a)){var u=t.interleaved;u===null?(s.next=s,cx(t)):(s.next=u.next,u.next=s),t.interleaved=s;return}}catch{}finally{}n=dj(e,t,s,r),n!==null&&(s=Gn(),os(n,e,r,s),Rj(n,t,r))}}function _j(e){var t=e.alternate;return e===Wt||t!==null&&t===Wt}function Pj(e,t){Nu=Kp=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Rj(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Jb(e,n)}}var qp={readContext:Hr,useCallback:Pn,useContext:Pn,useEffect:Pn,useImperativeHandle:Pn,useInsertionEffect:Pn,useLayoutEffect:Pn,useMemo:Pn,useReducer:Pn,useRef:Pn,useState:Pn,useDebugValue:Pn,useDeferredValue:Pn,useTransition:Pn,useMutableSource:Pn,useSyncExternalStore:Pn,useId:Pn,unstable_isNewReconciler:!1},AF={readContext:Hr,useCallback:function(e,t){return ks().memoizedState=[e,t===void 0?null:t],e},useContext:Hr,useEffect:WS,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ap(4194308,4,Ej.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ap(4194308,4,e,t)},useInsertionEffect:function(e,t){return ap(4,2,e,t)},useMemo:function(e,t){var n=ks();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ks();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=IF.bind(null,Wt,e),[r.memoizedState,e]},useRef:function(e){var t=ks();return e={current:e},t.memoizedState=e},useState:qS,useDebugValue:yx,useDeferredValue:function(e){return ks().memoizedState=e},useTransition:function(){var e=qS(!1),t=e[0];return e=OF.bind(null,e[1]),ks().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Wt,s=ks();if($t){if(n===void 0)throw Error(te(407));n=n()}else{if(n=t(),yn===null)throw Error(te(349));Mi&30||mj(r,t,n)}s.memoizedState=n;var o={value:n,getSnapshot:t};return s.queue=o,WS(yj.bind(null,r,o,e),[e]),r.flags|=2048,rd(9,vj.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=ks(),t=yn.identifierPrefix;if($t){var n=co,r=lo;n=(r&~(1<<32-ss(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=td++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[_s]=t,e[Yu]=r,Uj(e,t,!1,!1),t.stateNode=e;e:{switch(a=Xv(n,r),n){case"dialog":It("cancel",e),It("close",e),s=r;break;case"iframe":case"object":case"embed":It("load",e),s=r;break;case"video":case"audio":for(s=0;suc&&(t.flags|=128,r=!0,Jc(o,!1),t.lanes=4194304)}else{if(!r)if(e=Hp(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Jc(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!$t)return Rn(t),null}else 2*en()-o.renderingStartTime>uc&&n!==1073741824&&(t.flags|=128,r=!0,Jc(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,n!==null?n.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=en(),t.sibling=null,n=qt.current,Nt(qt,r?n&1|2:n&1),t):(Rn(t),null);case 22:case 23:return Ex(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?gr&1073741824&&(Rn(t),t.subtreeFlags&6&&(t.flags|=8192)):Rn(t),null;case 24:return null;case 25:return null}throw Error(te(156,t.tag))}function HF(e,t){switch(sx(t),t.tag){case 1:return ar(t.type)&&Fp(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return lc(),At(or),At(Ln),px(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return fx(t),null;case 13:if(At(qt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(te(340));ac()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return At(qt),null;case 4:return lc(),null;case 10:return lx(t.type._context),null;case 22:case 23:return Ex(),null;case 24:return null;default:return null}}var jf=!1,An=!1,KF=typeof WeakSet=="function"?WeakSet:Set,Se=null;function kl(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Zt(e,t,r)}else n.current=null}function jy(e,t,n){try{n()}catch(r){Zt(e,t,r)}}var s0=!1;function qF(e,t){if(cy=Op,e=Jk(),nx(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,c=-1,u=-1,i=0,d=0,p=e,f=null;t:for(;;){for(var g;p!==n||s!==0&&p.nodeType!==3||(c=a+s),p!==o||r!==0&&p.nodeType!==3||(u=a+r),p.nodeType===3&&(a+=p.nodeValue.length),(g=p.firstChild)!==null;)f=p,p=g;for(;;){if(p===e)break t;if(f===n&&++i===s&&(c=a),f===o&&++d===r&&(u=a),(g=p.nextSibling)!==null)break;p=f,f=p.parentNode}p=g}n=c===-1||u===-1?null:{start:c,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(uy={focusedElem:e,selectionRange:n},Op=!1,Se=t;Se!==null;)if(t=Se,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Se=e;else for(;Se!==null;){t=Se;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var m=h.memoizedProps,x=h.memoizedState,b=t.stateNode,y=b.getSnapshotBeforeUpdate(t.elementType===t.type?m:Jr(t.type,m),x);b.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(te(163))}}catch(S){Zt(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,Se=e;break}Se=t.return}return h=s0,s0=!1,h}function _u(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var o=s.destroy;s.destroy=void 0,o!==void 0&&jy(t,n,o)}s=s.next}while(s!==r)}}function Hg(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Ty(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Kj(e){var t=e.alternate;t!==null&&(e.alternate=null,Kj(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[_s],delete t[Yu],delete t[py],delete t[MF],delete t[NF])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function qj(e){return e.tag===5||e.tag===3||e.tag===4}function o0(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||qj(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function My(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ap));else if(r!==4&&(e=e.child,e!==null))for(My(e,t,n),e=e.sibling;e!==null;)My(e,t,n),e=e.sibling}function Ny(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Ny(e,t,n),e=e.sibling;e!==null;)Ny(e,t,n),e=e.sibling}var Cn=null,Zr=!1;function Ao(e,t,n){for(n=n.child;n!==null;)Wj(e,t,n),n=n.sibling}function Wj(e,t,n){if($s&&typeof $s.onCommitFiberUnmount=="function")try{$s.onCommitFiberUnmount(Ag,n)}catch{}switch(n.tag){case 5:An||kl(n,t);case 6:var r=Cn,s=Zr;Cn=null,Ao(e,t,n),Cn=r,Zr=s,Cn!==null&&(Zr?(e=Cn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Cn.removeChild(n.stateNode));break;case 18:Cn!==null&&(Zr?(e=Cn,n=n.stateNode,e.nodeType===8?jm(e.parentNode,n):e.nodeType===1&&jm(e,n),Wu(e)):jm(Cn,n.stateNode));break;case 4:r=Cn,s=Zr,Cn=n.stateNode.containerInfo,Zr=!0,Ao(e,t,n),Cn=r,Zr=s;break;case 0:case 11:case 14:case 15:if(!An&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var o=s,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&jy(n,t,a),s=s.next}while(s!==r)}Ao(e,t,n);break;case 1:if(!An&&(kl(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(c){Zt(n,t,c)}Ao(e,t,n);break;case 21:Ao(e,t,n);break;case 22:n.mode&1?(An=(r=An)||n.memoizedState!==null,Ao(e,t,n),An=r):Ao(e,t,n);break;default:Ao(e,t,n)}}function a0(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new KF),t.forEach(function(r){var s=t2.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Gr(e,t){var n=t.deletions;if(n!==null)for(var r=0;rs&&(s=a),r&=~o}if(r=s,r=en()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*GF(r/1960))-r,10e?16:e,oa===null)var r=!1;else{if(e=oa,oa=null,Jp=0,gt&6)throw Error(te(331));var s=gt;for(gt|=4,Se=e.current;Se!==null;){var o=Se,a=o.child;if(Se.flags&16){var c=o.deletions;if(c!==null){for(var u=0;uen()-Sx?vi(e,0):wx|=n),ir(e,t)}function tT(e,t){t===0&&(e.mode&1?(t=vf,vf<<=1,!(vf&130023424)&&(vf=4194304)):t=1);var n=Gn();e=bo(e,t),e!==null&&(Ud(e,t,n),ir(e,n))}function e2(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),tT(e,n)}function t2(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(te(314))}r!==null&&r.delete(t),tT(e,n)}var nT;nT=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||or.current)sr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return sr=!1,UF(e,t,n);sr=!!(e.flags&131072)}else sr=!1,$t&&t.flags&1048576&&aj(t,Bp,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ip(e,t),e=t.pendingProps;var s=oc(t,Ln.current);Al(t,n),s=hx(null,t,r,e,s,n);var o=mx();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ar(r)?(o=!0,Lp(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,ux(t),s.updater=Vg,t.stateNode=s,s._reactInternals=t,by(t,r,e,n),t=Sy(null,t,r,!0,o,n)):(t.tag=0,$t&&o&&rx(t),Kn(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ip(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=r2(r),e=Jr(r,e),s){case 0:t=wy(null,t,r,e,n);break e;case 1:t=t0(null,t,r,e,n);break e;case 11:t=XS(null,t,r,e,n);break e;case 14:t=e0(null,t,r,Jr(r.type,e),n);break e}throw Error(te(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Jr(r,s),wy(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Jr(r,s),t0(e,t,r,s,n);case 3:e:{if($j(t),e===null)throw Error(te(387));r=t.pendingProps,o=t.memoizedState,s=o.element,fj(e,t),Vp(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){s=cc(Error(te(423)),t),t=n0(e,t,r,n,s);break e}else if(r!==s){s=cc(Error(te(424)),t),t=n0(e,t,r,n,s);break e}else for(yr=da(t.stateNode.containerInfo.firstChild),xr=t,$t=!0,es=null,n=uj(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ac(),r===s){t=xo(e,t,n);break e}Kn(e,t,r,n)}t=t.child}return t;case 5:return pj(t),e===null&&my(t),r=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,a=s.children,dy(r,s)?a=null:o!==null&&dy(r,o)&&(t.flags|=32),Lj(e,t),Kn(e,t,a,n),t.child;case 6:return e===null&&my(t),null;case 13:return Bj(e,t,n);case 4:return dx(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ic(t,null,r,n):Kn(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Jr(r,s),XS(e,t,r,s,n);case 7:return Kn(e,t,t.pendingProps,n),t.child;case 8:return Kn(e,t,t.pendingProps.children,n),t.child;case 12:return Kn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,o=t.memoizedProps,a=s.value,Nt(zp,r._currentValue),r._currentValue=a,o!==null)if(ds(o.value,a)){if(o.children===s.children&&!or.current){t=xo(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){a=o.child;for(var u=c.firstContext;u!==null;){if(u.context===r){if(o.tag===1){u=go(-1,n&-n),u.tag=2;var i=o.updateQueue;if(i!==null){i=i.shared;var d=i.pending;d===null?u.next=u:(u.next=d.next,d.next=u),i.pending=u}}o.lanes|=n,u=o.alternate,u!==null&&(u.lanes|=n),vy(o.return,n,t),c.lanes|=n;break}u=u.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(te(341));a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),vy(a,n,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}Kn(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Al(t,n),s=Hr(s),r=r(s),t.flags|=1,Kn(e,t,r,n),t.child;case 14:return r=t.type,s=Jr(r,t.pendingProps),s=Jr(r.type,s),e0(e,t,r,s,n);case 15:return Aj(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Jr(r,s),ip(e,t),t.tag=1,ar(r)?(e=!0,Lp(t)):e=!1,Al(t,n),Oj(t,r,s),by(t,r,s,n),Sy(null,t,r,!0,e,n);case 19:return zj(e,t,n);case 22:return Fj(e,t,n)}throw Error(te(156,t.tag))};function rT(e,t){return _k(e,t)}function n2(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $r(e,t,n,r){return new n2(e,t,n,r)}function jx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function r2(e){if(typeof e=="function")return jx(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Kb)return 11;if(e===qb)return 14}return 2}function ha(e,t){var n=e.alternate;return n===null?(n=$r(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function up(e,t,n,r,s,o){var a=2;if(r=e,typeof e=="function")jx(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case ml:return yi(n.children,s,o,t);case Hb:a=8,s|=8;break;case Vv:return e=$r(12,n,t,s|2),e.elementType=Vv,e.lanes=o,e;case Hv:return e=$r(13,n,t,s),e.elementType=Hv,e.lanes=o,e;case Kv:return e=$r(19,n,t,s),e.elementType=Kv,e.lanes=o,e;case pk:return qg(n,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case dk:a=10;break e;case fk:a=9;break e;case Kb:a=11;break e;case qb:a=14;break e;case Ho:a=16,r=null;break e}throw Error(te(130,e==null?e:typeof e,""))}return t=$r(a,n,t,s),t.elementType=e,t.type=r,t.lanes=o,t}function yi(e,t,n,r){return e=$r(7,e,r,t),e.lanes=n,e}function qg(e,t,n,r){return e=$r(22,e,r,t),e.elementType=pk,e.lanes=n,e.stateNode={isHidden:!1},e}function Im(e,t,n){return e=$r(6,e,null,t),e.lanes=n,e}function Dm(e,t,n){return t=$r(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function s2(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=hm(0),this.expirationTimes=hm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hm(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Tx(e,t,n,r,s,o,a,c,u){return e=new s2(e,t,n,c,u),t===1?(t=1,o===!0&&(t|=8)):t=0,o=$r(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ux(o),e}function o2(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(iT)}catch(e){console.error(e)}}iT(),ik.exports=jr;var Pa=ik.exports;const lT=Rb(Pa),u2=DE({__proto__:null,default:lT},[Pa]);var g0=Pa;zv.createRoot=g0.createRoot,zv.hydrateRoot=g0.hydrateRoot;const d2=(...e)=>{console!=null&&console.warn&&(bi(e[0])&&(e[0]=`react-i18next:: ${e[0]}`),console.warn(...e))},h0={},Iy=(...e)=>{bi(e[0])&&h0[e[0]]||(bi(e[0])&&(h0[e[0]]=new Date),d2(...e))},cT=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},m0=(e,t,n)=>{e.loadNamespaces(t,cT(e,n))},v0=(e,t,n,r)=>{bi(n)&&(n=[n]),n.forEach(s=>{e.options.ns.indexOf(s)<0&&e.options.ns.push(s)}),e.loadLanguages(t,cT(e,r))},f2=(e,t,n={})=>!t.languages||!t.languages.length?(Iy("i18n.languages were undefined or empty",t.languages),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,s)=>{var o;if(((o=n.bindI18n)==null?void 0:o.indexOf("languageChanging"))>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!s(r.isLanguageChangingTo,e))return!1}}),bi=e=>typeof e=="string",p2=e=>typeof e=="object"&&e!==null,g2=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,h2={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},m2=e=>h2[e],v2=e=>e.replace(g2,m2);let Dy={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:v2};const y2=(e={})=>{Dy={...Dy,...e}},b2=()=>Dy;let uT;const x2=e=>{uT=e},w2=()=>uT,S2={type:"3rdParty",init(e){y2(e.options.react),x2(e)}},dT=v.createContext();class C2{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{var r;(r=this.usedNamespaces)[n]??(r[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const E2=(e,t)=>{const n=v.useRef();return v.useEffect(()=>{n.current=e},[e,t]),n.current},fT=(e,t,n,r)=>e.getFixedT(t,n,r),k2=(e,t,n,r)=>v.useCallback(fT(e,t,n,r),[e,t,n,r]),Te=(e,t={})=>{var S,E,C,T;const{i18n:n}=t,{i18n:r,defaultNS:s}=v.useContext(dT)||{},o=n||r||w2();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new C2),!o){Iy("You will need to pass in an i18next instance by using initReactI18next");const j=(O,K)=>bi(K)?K:p2(K)&&bi(K.defaultValue)?K.defaultValue:Array.isArray(O)?O[O.length-1]:O,_=[j,{},!1];return _.t=j,_.i18n={},_.ready=!1,_}(S=o.options.react)!=null&&S.wait&&Iy("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...b2(),...o.options.react,...t},{useSuspense:c,keyPrefix:u}=a;let i=s||((E=o.options)==null?void 0:E.defaultNS);i=bi(i)?[i]:i||["translation"],(T=(C=o.reportNamespaces).addUsedNamespaces)==null||T.call(C,i);const d=(o.isInitialized||o.initializedStoreOnce)&&i.every(j=>f2(j,o,a)),p=k2(o,t.lng||null,a.nsMode==="fallback"?i:i[0],u),f=()=>p,g=()=>fT(o,t.lng||null,a.nsMode==="fallback"?i:i[0],u),[h,m]=v.useState(f);let x=i.join();t.lng&&(x=`${t.lng}${x}`);const b=E2(x),y=v.useRef(!0);v.useEffect(()=>{const{bindI18n:j,bindI18nStore:_}=a;y.current=!0,!d&&!c&&(t.lng?v0(o,t.lng,i,()=>{y.current&&m(g)}):m0(o,i,()=>{y.current&&m(g)})),d&&b&&b!==x&&y.current&&m(g);const O=()=>{y.current&&m(g)};return j&&(o==null||o.on(j,O)),_&&(o==null||o.store.on(_,O)),()=>{y.current=!1,o&&(j==null||j.split(" ").forEach(K=>o.off(K,O))),_&&o&&_.split(" ").forEach(K=>o.store.off(K,O))}},[o,x]),v.useEffect(()=>{y.current&&d&&m(f)},[o,u,d]);const w=[h,o,d];if(w.t=h,w.i18n=o,w.ready=d,d||!d&&!c)return w;throw new Promise(j=>{t.lng?v0(o,t.lng,i,()=>j()):m0(o,i,()=>j())})};function j2({i18n:e,defaultNS:t,children:n}){const r=v.useMemo(()=>({i18n:e,defaultNS:t}),[e,t]);return v.createElement(dT.Provider,{value:r},n)}/** - * @remix-run/router v1.18.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Kt(){return Kt=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function dc(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function M2(){return Math.random().toString(36).substr(2,8)}function b0(e,t){return{usr:e.state,key:e.key,idx:t}}function od(e,t,n,r){return n===void 0&&(n=null),Kt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ra(t):t,{state:n,key:t&&t.key||r||M2()})}function Pi(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Ra(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function N2(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:o=!1}=r,a=s.history,c=rn.Pop,u=null,i=d();i==null&&(i=0,a.replaceState(Kt({},a.state,{idx:i}),""));function d(){return(a.state||{idx:null}).idx}function p(){c=rn.Pop;let x=d(),b=x==null?null:x-i;i=x,u&&u({action:c,location:m.location,delta:b})}function f(x,b){c=rn.Push;let y=od(m.location,x,b);i=d()+1;let w=b0(y,i),S=m.createHref(y);try{a.pushState(w,"",S)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;s.location.assign(S)}o&&u&&u({action:c,location:m.location,delta:1})}function g(x,b){c=rn.Replace;let y=od(m.location,x,b);i=d();let w=b0(y,i),S=m.createHref(y);a.replaceState(w,"",S),o&&u&&u({action:c,location:m.location,delta:0})}function h(x){let b=s.location.origin!=="null"?s.location.origin:s.location.href,y=typeof x=="string"?x:Pi(x);return y=y.replace(/ $/,"%20"),et(b,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,b)}let m={get action(){return c},get location(){return e(s,a)},listen(x){if(u)throw new Error("A history only accepts one active listener");return s.addEventListener(y0,p),u=x,()=>{s.removeEventListener(y0,p),u=null}},createHref(x){return t(s,x)},createURL:h,encodeLocation(x){let b=h(x);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:f,replace:g,go(x){return a.go(x)}};return m}var Mt;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Mt||(Mt={}));const _2=new Set(["lazy","caseSensitive","path","id","index","children"]);function P2(e){return e.index===!0}function ad(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((s,o)=>{let a=[...n,String(o)],c=typeof s.id=="string"?s.id:a.join("-");if(et(s.index!==!0||!s.children,"Cannot specify children on an index route"),et(!r[c],'Found a route id collision on id "'+c+`". Route id's must be globally unique within Data Router usages`),P2(s)){let u=Kt({},s,t(s),{id:c});return r[c]=u,u}else{let u=Kt({},s,t(s),{id:c,children:void 0});return r[c]=u,s.children&&(u.children=ad(s.children,t,a,r)),u}})}function Ya(e,t,n){return n===void 0&&(n="/"),dp(e,t,n,!1)}function dp(e,t,n,r){let s=typeof t=="string"?Ra(t):t,o=Cc(s.pathname||"/",n);if(o==null)return null;let a=pT(e);O2(a);let c=null;for(let u=0;c==null&&u{let u={relativePath:c===void 0?o.path||"":c,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};u.relativePath.startsWith("/")&&(et(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let i=ho([r,u.relativePath]),d=n.concat(u);o.children&&o.children.length>0&&(et(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+i+'".')),pT(o.children,t,d,i)),!(o.path==null&&!o.index)&&t.push({path:i,score:B2(i,o.index),routesMeta:d})};return e.forEach((o,a)=>{var c;if(o.path===""||!((c=o.path)!=null&&c.includes("?")))s(o,a);else for(let u of gT(o.path))s(o,a,u)}),t}function gT(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return s?[o,""]:[o];let a=gT(r.join("/")),c=[];return c.push(...a.map(u=>u===""?o:[o,u].join("/"))),s&&c.push(...a),c.map(u=>e.startsWith("/")&&u===""?"/":u)}function O2(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:z2(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const I2=/^:[\w-]+$/,D2=3,A2=2,F2=1,L2=10,$2=-2,x0=e=>e==="*";function B2(e,t){let n=e.split("/"),r=n.length;return n.some(x0)&&(r+=$2),t&&(r+=A2),n.filter(s=>!x0(s)).reduce((s,o)=>s+(I2.test(o)?D2:o===""?F2:L2),r)}function z2(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function U2(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,s={},o="/",a=[];for(let c=0;c{let{paramName:f,isOptional:g}=d;if(f==="*"){let m=c[p]||"";a=o.slice(0,o.length-m.length).replace(/(.)\/+$/,"$1")}const h=c[p];return g&&!h?i[f]=void 0:i[f]=(h||"").replace(/%2F/g,"/"),i},{}),pathname:o,pathnameBase:a,pattern:e}}function V2(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),dc(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,c,u)=>(r.push({paramName:c,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function H2(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return dc(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Cc(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function K2(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?Ra(e):e;return{pathname:n?n.startsWith("/")?n:q2(n,t):t,search:G2(r),hash:J2(s)}}function q2(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function Am(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function hT(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Zg(e,t){let n=hT(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Yg(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=Ra(e):(s=Kt({},e),et(!s.pathname||!s.pathname.includes("?"),Am("?","pathname","search",s)),et(!s.pathname||!s.pathname.includes("#"),Am("#","pathname","hash",s)),et(!s.search||!s.search.includes("#"),Am("#","search","hash",s)));let o=e===""||s.pathname==="",a=o?"/":s.pathname,c;if(a==null)c=n;else{let p=t.length-1;if(!r&&a.startsWith("..")){let f=a.split("/");for(;f[0]==="..";)f.shift(),p-=1;s.pathname=f.join("/")}c=p>=0?t[p]:"/"}let u=K2(s,c),i=a&&a!=="/"&&a.endsWith("/"),d=(o||a===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(i||d)&&(u.pathname+="/"),u}const ho=e=>e.join("/").replace(/\/\/+/g,"/"),W2=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),G2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,J2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Px{constructor(t,n,r,s){s===void 0&&(s=!1),this.status=t,this.statusText=n||"",this.internal=s,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function Xg(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const mT=["post","put","patch","delete"],Q2=new Set(mT),Z2=["get",...mT],Y2=new Set(Z2),X2=new Set([301,302,303,307,308]),eL=new Set([307,308]),Fm={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},tL={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Zc={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Rx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,nL=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),vT="remix-router-transitions";function rL(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;et(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let s;if(e.mapRouteProperties)s=e.mapRouteProperties;else if(e.detectErrorBoundary){let P=e.detectErrorBoundary;s=R=>({hasErrorBoundary:P(R)})}else s=nL;let o={},a=ad(e.routes,s,void 0,o),c,u=e.basename||"/",i=e.unstable_dataStrategy||lL,d=e.unstable_patchRoutesOnMiss,p=Kt({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),f=null,g=new Set,h=null,m=null,x=null,b=e.hydrationData!=null,y=Ya(a,e.history.location,u),w=null;if(y==null&&!d){let P=Hn(404,{pathname:e.history.location.pathname}),{matches:R,route:B}=P0(a);y=R,w={[B.id]:P}}y&&d&&!e.hydrationData&&im(y,a,e.history.location.pathname).active&&(y=null);let S;if(!y)S=!1,y=[];else if(y.some(P=>P.route.lazy))S=!1;else if(!y.some(P=>P.route.loader))S=!0;else if(p.v7_partialHydration){let P=e.hydrationData?e.hydrationData.loaderData:null,R=e.hydrationData?e.hydrationData.errors:null,B=W=>W.route.loader?typeof W.route.loader=="function"&&W.route.loader.hydrate===!0?!1:P&&P[W.route.id]!==void 0||R&&R[W.route.id]!==void 0:!0;if(R){let W=y.findIndex(be=>R[be.route.id]!==void 0);S=y.slice(0,W+1).every(B)}else S=y.every(B)}else S=e.hydrationData!=null;let E,C={historyAction:e.history.action,location:e.history.location,matches:y,initialized:S,navigation:Fm,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||w,fetchers:new Map,blockers:new Map},T=rn.Pop,j=!1,_,O=!1,K=new Map,I=null,Y=!1,q=!1,Z=[],ee=[],J=new Map,L=0,A=-1,X=new Map,fe=new Set,H=new Map,se=new Map,ne=new Set,le=new Map,oe=new Map,Q=new Map,Ee=!1;function Pe(){if(f=e.history.listen(P=>{let{action:R,location:B,delta:W}=P;if(Ee){Ee=!1;return}dc(oe.size===0||W!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let be=Io({currentLocation:C.location,nextLocation:B,historyAction:R});if(be&&W!=null){Ee=!0,e.history.go(W*-1),xs(be,{state:"blocked",location:B,proceed(){xs(be,{state:"proceeding",proceed:void 0,reset:void 0,location:B}),e.history.go(W)},reset(){let Me=new Map(C.blockers);Me.set(be,Zc),ve({blockers:Me})}});return}return Xt(R,B)}),n){wL(t,K);let P=()=>SL(t,K);t.addEventListener("pagehide",P),I=()=>t.removeEventListener("pagehide",P)}return C.initialized||Xt(rn.Pop,C.location,{initialHydration:!0}),E}function Be(){f&&f(),I&&I(),g.clear(),_&&_.abort(),C.fetchers.forEach((P,R)=>bs(R)),C.blockers.forEach((P,R)=>_n(R))}function Re(P){return g.add(P),()=>g.delete(P)}function ve(P,R){R===void 0&&(R={}),C=Kt({},C,P);let B=[],W=[];p.v7_fetcherPersist&&C.fetchers.forEach((be,Me)=>{be.state==="idle"&&(ne.has(Me)?W.push(Me):B.push(Me))}),[...g].forEach(be=>be(C,{deletedFetchers:W,unstable_viewTransitionOpts:R.viewTransitionOpts,unstable_flushSync:R.flushSync===!0})),p.v7_fetcherPersist&&(B.forEach(be=>C.fetchers.delete(be)),W.forEach(be=>bs(be)))}function ot(P,R,B){var W,be;let{flushSync:Me}=B===void 0?{}:B,ze=C.actionData!=null&&C.navigation.formMethod!=null&&Yr(C.navigation.formMethod)&&C.navigation.state==="loading"&&((W=P.state)==null?void 0:W._isRedirect)!==!0,pe;R.actionData?Object.keys(R.actionData).length>0?pe=R.actionData:pe=null:ze?pe=C.actionData:pe=null;let Je=R.loaderData?N0(C.loaderData,R.loaderData,R.matches||[],R.errors):C.loaderData,_e=C.blockers;_e.size>0&&(_e=new Map(_e),_e.forEach((St,kt)=>_e.set(kt,Zc)));let Oe=j===!0||C.navigation.formMethod!=null&&Yr(C.navigation.formMethod)&&((be=P.state)==null?void 0:be._isRedirect)!==!0;c&&(a=c,c=void 0),Y||T===rn.Pop||(T===rn.Push?e.history.push(P,P.state):T===rn.Replace&&e.history.replace(P,P.state));let Et;if(T===rn.Pop){let St=K.get(C.location.pathname);St&&St.has(P.pathname)?Et={currentLocation:C.location,nextLocation:P}:K.has(P.pathname)&&(Et={currentLocation:P,nextLocation:C.location})}else if(O){let St=K.get(C.location.pathname);St?St.add(P.pathname):(St=new Set([P.pathname]),K.set(C.location.pathname,St)),Et={currentLocation:C.location,nextLocation:P}}ve(Kt({},R,{actionData:pe,loaderData:Je,historyAction:T,location:P,initialized:!0,navigation:Fm,revalidation:"idle",restoreScrollPosition:Qw(P,R.matches||C.matches),preventScrollReset:Oe,blockers:_e}),{viewTransitionOpts:Et,flushSync:Me===!0}),T=rn.Pop,j=!1,O=!1,Y=!1,q=!1,Z=[],ee=[]}async function Vt(P,R){if(typeof P=="number"){e.history.go(P);return}let B=Ay(C.location,C.matches,u,p.v7_prependBasename,P,p.v7_relativeSplatPath,R==null?void 0:R.fromRouteId,R==null?void 0:R.relative),{path:W,submission:be,error:Me}=S0(p.v7_normalizeFormMethod,!1,B,R),ze=C.location,pe=od(C.location,W,R&&R.state);pe=Kt({},pe,e.history.encodeLocation(pe));let Je=R&&R.replace!=null?R.replace:void 0,_e=rn.Push;Je===!0?_e=rn.Replace:Je===!1||be!=null&&Yr(be.formMethod)&&be.formAction===C.location.pathname+C.location.search&&(_e=rn.Replace);let Oe=R&&"preventScrollReset"in R?R.preventScrollReset===!0:void 0,Et=(R&&R.unstable_flushSync)===!0,St=Io({currentLocation:ze,nextLocation:pe,historyAction:_e});if(St){xs(St,{state:"blocked",location:pe,proceed(){xs(St,{state:"proceeding",proceed:void 0,reset:void 0,location:pe}),Vt(P,R)},reset(){let kt=new Map(C.blockers);kt.set(St,Zc),ve({blockers:kt})}});return}return await Xt(_e,pe,{submission:be,pendingError:Me,preventScrollReset:Oe,replace:R&&R.replace,enableViewTransition:R&&R.unstable_viewTransition,flushSync:Et})}function tn(){if(hn(),ve({revalidation:"loading"}),C.navigation.state!=="submitting"){if(C.navigation.state==="idle"){Xt(C.historyAction,C.location,{startUninterruptedRevalidation:!0});return}Xt(T||C.historyAction,C.navigation.location,{overrideNavigation:C.navigation})}}async function Xt(P,R,B){_&&_.abort(),_=null,T=P,Y=(B&&B.startUninterruptedRevalidation)===!0,eD(C.location,C.matches),j=(B&&B.preventScrollReset)===!0,O=(B&&B.enableViewTransition)===!0;let W=c||a,be=B&&B.overrideNavigation,Me=Ya(W,R,u),ze=(B&&B.flushSync)===!0,pe=im(Me,W,R.pathname);if(pe.active&&pe.matches&&(Me=pe.matches),!Me){let{error:bt,notFoundMatches:xn,route:nn}=Bc(R.pathname);ot(R,{matches:xn,loaderData:{},errors:{[nn.id]:bt}},{flushSync:ze});return}if(C.initialized&&!q&&gL(C.location,R)&&!(B&&B.submission&&Yr(B.submission.formMethod))){ot(R,{matches:Me},{flushSync:ze});return}_=new AbortController;let Je=nl(e.history,R,_.signal,B&&B.submission),_e;if(B&&B.pendingError)_e=[Tl(Me).route.id,{type:Mt.error,error:B.pendingError}];else if(B&&B.submission&&Yr(B.submission.formMethod)){let bt=await ln(Je,R,B.submission,Me,pe.active,{replace:B.replace,flushSync:ze});if(bt.shortCircuited)return;if(bt.pendingActionResult){let[xn,nn]=bt.pendingActionResult;if(mr(nn)&&Xg(nn.error)&&nn.error.status===404){_=null,ot(R,{matches:bt.matches,loaderData:{},errors:{[xn]:nn.error}});return}}Me=bt.matches||Me,_e=bt.pendingActionResult,be=Lm(R,B.submission),ze=!1,pe.active=!1,Je=nl(e.history,Je.url,Je.signal)}let{shortCircuited:Oe,matches:Et,loaderData:St,errors:kt}=await M(Je,R,Me,pe.active,be,B&&B.submission,B&&B.fetcherSubmission,B&&B.replace,B&&B.initialHydration===!0,ze,_e);Oe||(_=null,ot(R,Kt({matches:Et||Me},_0(_e),{loaderData:St,errors:kt})))}async function ln(P,R,B,W,be,Me){Me===void 0&&(Me={}),hn();let ze=bL(R,B);if(ve({navigation:ze},{flushSync:Me.flushSync===!0}),be){let _e=await of(W,R.pathname,P.signal);if(_e.type==="aborted")return{shortCircuited:!0};if(_e.type==="error"){let{boundaryId:Oe,error:Et}=Zi(R.pathname,_e);return{matches:_e.partialMatches,pendingActionResult:[Oe,{type:Mt.error,error:Et}]}}else if(_e.matches)W=_e.matches;else{let{notFoundMatches:Oe,error:Et,route:St}=Bc(R.pathname);return{matches:Oe,pendingActionResult:[St.id,{type:Mt.error,error:Et}]}}}let pe,Je=mu(W,R);if(!Je.route.action&&!Je.route.lazy)pe={type:Mt.error,error:Hn(405,{method:P.method,pathname:R.pathname,routeId:Je.route.id})};else if(pe=(await rt("action",P,[Je],W))[0],P.signal.aborted)return{shortCircuited:!0};if(ri(pe)){let _e;return Me&&Me.replace!=null?_e=Me.replace:_e=j0(pe.response.headers.get("Location"),new URL(P.url),u)===C.location.pathname+C.location.search,await ke(P,pe,{submission:B,replace:_e}),{shortCircuited:!0}}if(ni(pe))throw Hn(400,{type:"defer-action"});if(mr(pe)){let _e=Tl(W,Je.route.id);return(Me&&Me.replace)!==!0&&(T=rn.Push),{matches:W,pendingActionResult:[_e.route.id,pe]}}return{matches:W,pendingActionResult:[Je.route.id,pe]}}async function M(P,R,B,W,be,Me,ze,pe,Je,_e,Oe){let Et=be||Lm(R,Me),St=Me||ze||I0(Et),kt=!Y&&(!p.v7_partialHydration||!Je);if(W){if(kt){let Jt=D(Oe);ve(Kt({navigation:Et},Jt!==void 0?{actionData:Jt}:{}),{flushSync:_e})}let Ze=await of(B,R.pathname,P.signal);if(Ze.type==="aborted")return{shortCircuited:!0};if(Ze.type==="error"){let{boundaryId:Jt,error:ur}=Zi(R.pathname,Ze);return{matches:Ze.partialMatches,loaderData:{},errors:{[Jt]:ur}}}else if(Ze.matches)B=Ze.matches;else{let{error:Jt,notFoundMatches:ur,route:Ft}=Bc(R.pathname);return{matches:ur,loaderData:{},errors:{[Ft.id]:Jt}}}}let bt=c||a,[xn,nn]=C0(e.history,C,B,St,R,p.v7_partialHydration&&Je===!0,p.v7_skipActionErrorRevalidation,q,Z,ee,ne,H,fe,bt,u,Oe);if(ws(Ze=>!(B&&B.some(Jt=>Jt.route.id===Ze))||xn&&xn.some(Jt=>Jt.route.id===Ze)),A=++L,xn.length===0&&nn.length===0){let Ze=He();return ot(R,Kt({matches:B,loaderData:{},errors:Oe&&mr(Oe[1])?{[Oe[0]]:Oe[1].error}:null},_0(Oe),Ze?{fetchers:new Map(C.fetchers)}:{}),{flushSync:_e}),{shortCircuited:!0}}if(kt){let Ze={};if(!W){Ze.navigation=Et;let Jt=D(Oe);Jt!==void 0&&(Ze.actionData=Jt)}nn.length>0&&(Ze.fetchers=V(nn)),ve(Ze,{flushSync:_e})}nn.forEach(Ze=>{J.has(Ze.key)&&zn(Ze.key),Ze.controller&&J.set(Ze.key,Ze.controller)});let Uc=()=>nn.forEach(Ze=>zn(Ze.key));_&&_.signal.addEventListener("abort",Uc);let{loaderResults:Do,fetcherResults:Yi}=await Pt(C.matches,B,xn,nn,P);if(P.signal.aborted)return{shortCircuited:!0};_&&_.signal.removeEventListener("abort",Uc),nn.forEach(Ze=>J.delete(Ze.key));let Xi=R0([...Do,...Yi]);if(Xi){if(Xi.idx>=xn.length){let Ze=nn[Xi.idx-xn.length].key;fe.add(Ze)}return await ke(P,Xi.result,{replace:pe}),{shortCircuited:!0}}let{loaderData:el,errors:Ss}=M0(C,B,xn,Do,Oe,nn,Yi,le);le.forEach((Ze,Jt)=>{Ze.subscribe(ur=>{(ur||Ze.done)&&le.delete(Jt)})}),p.v7_partialHydration&&Je&&C.errors&&Object.entries(C.errors).filter(Ze=>{let[Jt]=Ze;return!xn.some(ur=>ur.route.id===Jt)}).forEach(Ze=>{let[Jt,ur]=Ze;Ss=Object.assign(Ss||{},{[Jt]:ur})});let af=He(),lf=Tt(A),cf=af||lf||nn.length>0;return Kt({matches:B,loaderData:el,errors:Ss},cf?{fetchers:new Map(C.fetchers)}:{})}function D(P){if(P&&!mr(P[1]))return{[P[0]]:P[1].data};if(C.actionData)return Object.keys(C.actionData).length===0?null:C.actionData}function V(P){return P.forEach(R=>{let B=C.fetchers.get(R.key),W=Yc(void 0,B?B.data:void 0);C.fetchers.set(R.key,W)}),new Map(C.fetchers)}function he(P,R,B,W){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");J.has(P)&&zn(P);let be=(W&&W.unstable_flushSync)===!0,Me=c||a,ze=Ay(C.location,C.matches,u,p.v7_prependBasename,B,p.v7_relativeSplatPath,R,W==null?void 0:W.relative),pe=Ya(Me,ze,u),Je=im(pe,Me,ze);if(Je.active&&Je.matches&&(pe=Je.matches),!pe){mn(P,R,Hn(404,{pathname:ze}),{flushSync:be});return}let{path:_e,submission:Oe,error:Et}=S0(p.v7_normalizeFormMethod,!0,ze,W);if(Et){mn(P,R,Et,{flushSync:be});return}let St=mu(pe,_e);if(j=(W&&W.preventScrollReset)===!0,Oe&&Yr(Oe.formMethod)){ce(P,R,_e,St,pe,Je.active,be,Oe);return}H.set(P,{routeId:R,path:_e}),ae(P,R,_e,St,pe,Je.active,be,Oe)}async function ce(P,R,B,W,be,Me,ze,pe){hn(),H.delete(P);function Je(Ft){if(!Ft.route.action&&!Ft.route.lazy){let Qs=Hn(405,{method:pe.formMethod,pathname:B,routeId:R});return mn(P,R,Qs,{flushSync:ze}),!0}return!1}if(!Me&&Je(W))return;let _e=C.fetchers.get(P);bn(P,xL(pe,_e),{flushSync:ze});let Oe=new AbortController,Et=nl(e.history,B,Oe.signal,pe);if(Me){let Ft=await of(be,B,Et.signal);if(Ft.type==="aborted")return;if(Ft.type==="error"){let{error:Qs}=Zi(B,Ft);mn(P,R,Qs,{flushSync:ze});return}else if(Ft.matches){if(be=Ft.matches,W=mu(be,B),Je(W))return}else{mn(P,R,Hn(404,{pathname:B}),{flushSync:ze});return}}J.set(P,Oe);let St=L,bt=(await rt("action",Et,[W],be))[0];if(Et.signal.aborted){J.get(P)===Oe&&J.delete(P);return}if(p.v7_fetcherPersist&&ne.has(P)){if(ri(bt)||mr(bt)){bn(P,Uo(void 0));return}}else{if(ri(bt))if(J.delete(P),A>St){bn(P,Uo(void 0));return}else return fe.add(P),bn(P,Yc(pe)),ke(Et,bt,{fetcherSubmission:pe});if(mr(bt)){mn(P,R,bt.error);return}}if(ni(bt))throw Hn(400,{type:"defer-action"});let xn=C.navigation.location||C.location,nn=nl(e.history,xn,Oe.signal),Uc=c||a,Do=C.navigation.state!=="idle"?Ya(Uc,C.navigation.location,u):C.matches;et(Do,"Didn't find any matches after fetcher action");let Yi=++L;X.set(P,Yi);let Xi=Yc(pe,bt.data);C.fetchers.set(P,Xi);let[el,Ss]=C0(e.history,C,Do,pe,xn,!1,p.v7_skipActionErrorRevalidation,q,Z,ee,ne,H,fe,Uc,u,[W.route.id,bt]);Ss.filter(Ft=>Ft.key!==P).forEach(Ft=>{let Qs=Ft.key,Zw=C.fetchers.get(Qs),rD=Yc(void 0,Zw?Zw.data:void 0);C.fetchers.set(Qs,rD),J.has(Qs)&&zn(Qs),Ft.controller&&J.set(Qs,Ft.controller)}),ve({fetchers:new Map(C.fetchers)});let af=()=>Ss.forEach(Ft=>zn(Ft.key));Oe.signal.addEventListener("abort",af);let{loaderResults:lf,fetcherResults:cf}=await Pt(C.matches,Do,el,Ss,nn);if(Oe.signal.aborted)return;Oe.signal.removeEventListener("abort",af),X.delete(P),J.delete(P),Ss.forEach(Ft=>J.delete(Ft.key));let Ze=R0([...lf,...cf]);if(Ze){if(Ze.idx>=el.length){let Ft=Ss[Ze.idx-el.length].key;fe.add(Ft)}return ke(nn,Ze.result)}let{loaderData:Jt,errors:ur}=M0(C,C.matches,el,lf,void 0,Ss,cf,le);if(C.fetchers.has(P)){let Ft=Uo(bt.data);C.fetchers.set(P,Ft)}Tt(Yi),C.navigation.state==="loading"&&Yi>A?(et(T,"Expected pending action"),_&&_.abort(),ot(C.navigation.location,{matches:Do,loaderData:Jt,errors:ur,fetchers:new Map(C.fetchers)})):(ve({errors:ur,loaderData:N0(C.loaderData,Jt,Do,ur),fetchers:new Map(C.fetchers)}),q=!1)}async function ae(P,R,B,W,be,Me,ze,pe){let Je=C.fetchers.get(P);bn(P,Yc(pe,Je?Je.data:void 0),{flushSync:ze});let _e=new AbortController,Oe=nl(e.history,B,_e.signal);if(Me){let bt=await of(be,B,Oe.signal);if(bt.type==="aborted")return;if(bt.type==="error"){let{error:xn}=Zi(B,bt);mn(P,R,xn,{flushSync:ze});return}else if(bt.matches)be=bt.matches,W=mu(be,B);else{mn(P,R,Hn(404,{pathname:B}),{flushSync:ze});return}}J.set(P,_e);let Et=L,kt=(await rt("loader",Oe,[W],be))[0];if(ni(kt)&&(kt=await ST(kt,Oe.signal,!0)||kt),J.get(P)===_e&&J.delete(P),!Oe.signal.aborted){if(ne.has(P)){bn(P,Uo(void 0));return}if(ri(kt))if(A>Et){bn(P,Uo(void 0));return}else{fe.add(P),await ke(Oe,kt);return}if(mr(kt)){mn(P,R,kt.error);return}et(!ni(kt),"Unhandled fetcher deferred data"),bn(P,Uo(kt.data))}}async function ke(P,R,B){let{submission:W,fetcherSubmission:be,replace:Me}=B===void 0?{}:B;R.response.headers.has("X-Remix-Revalidate")&&(q=!0);let ze=R.response.headers.get("Location");et(ze,"Expected a Location header on the redirect Response"),ze=j0(ze,new URL(P.url),u);let pe=od(C.location,ze,{_isRedirect:!0});if(n){let kt=!1;if(R.response.headers.has("X-Remix-Reload-Document"))kt=!0;else if(Rx.test(ze)){const bt=e.history.createURL(ze);kt=bt.origin!==t.location.origin||Cc(bt.pathname,u)==null}if(kt){Me?t.location.replace(ze):t.location.assign(ze);return}}_=null;let Je=Me===!0?rn.Replace:rn.Push,{formMethod:_e,formAction:Oe,formEncType:Et}=C.navigation;!W&&!be&&_e&&Oe&&Et&&(W=I0(C.navigation));let St=W||be;if(eL.has(R.response.status)&&St&&Yr(St.formMethod))await Xt(Je,pe,{submission:Kt({},St,{formAction:ze}),preventScrollReset:j});else{let kt=Lm(pe,W);await Xt(Je,pe,{overrideNavigation:kt,fetcherSubmission:be,preventScrollReset:j})}}async function rt(P,R,B,W){try{let be=await cL(i,P,R,B,W,o,s);return await Promise.all(be.map((Me,ze)=>{if(mL(Me)){let pe=Me.result;return{type:Mt.redirect,response:fL(pe,R,B[ze].route.id,W,u,p.v7_relativeSplatPath)}}return dL(Me)}))}catch(be){return B.map(()=>({type:Mt.error,error:be}))}}async function Pt(P,R,B,W,be){let[Me,...ze]=await Promise.all([B.length?rt("loader",be,B,R):[],...W.map(pe=>{if(pe.matches&&pe.match&&pe.controller){let Je=nl(e.history,pe.path,pe.controller.signal);return rt("loader",Je,[pe.match],pe.matches).then(_e=>_e[0])}else return Promise.resolve({type:Mt.error,error:Hn(404,{pathname:pe.path})})})]);return await Promise.all([O0(P,B,Me,Me.map(()=>be.signal),!1,C.loaderData),O0(P,W.map(pe=>pe.match),ze,W.map(pe=>pe.controller?pe.controller.signal:null),!0)]),{loaderResults:Me,fetcherResults:ze}}function hn(){q=!0,Z.push(...ws()),H.forEach((P,R)=>{J.has(R)&&(ee.push(R),zn(R))})}function bn(P,R,B){B===void 0&&(B={}),C.fetchers.set(P,R),ve({fetchers:new Map(C.fetchers)},{flushSync:(B&&B.flushSync)===!0})}function mn(P,R,B,W){W===void 0&&(W={});let be=Tl(C.matches,R);bs(P),ve({errors:{[be.route.id]:B},fetchers:new Map(C.fetchers)},{flushSync:(W&&W.flushSync)===!0})}function Oo(P){return p.v7_fetcherPersist&&(se.set(P,(se.get(P)||0)+1),ne.has(P)&&ne.delete(P)),C.fetchers.get(P)||tL}function bs(P){let R=C.fetchers.get(P);J.has(P)&&!(R&&R.state==="loading"&&X.has(P))&&zn(P),H.delete(P),X.delete(P),fe.delete(P),ne.delete(P),C.fetchers.delete(P)}function qa(P){if(p.v7_fetcherPersist){let R=(se.get(P)||0)-1;R<=0?(se.delete(P),ne.add(P)):se.set(P,R)}else bs(P);ve({fetchers:new Map(C.fetchers)})}function zn(P){let R=J.get(P);et(R,"Expected fetch controller: "+P),R.abort(),J.delete(P)}function ue(P){for(let R of P){let B=Oo(R),W=Uo(B.data);C.fetchers.set(R,W)}}function He(){let P=[],R=!1;for(let B of fe){let W=C.fetchers.get(B);et(W,"Expected fetcher: "+B),W.state==="loading"&&(fe.delete(B),P.push(B),R=!0)}return ue(P),R}function Tt(P){let R=[];for(let[B,W]of X)if(W0}function vt(P,R){let B=C.blockers.get(P)||Zc;return oe.get(P)!==R&&oe.set(P,R),B}function _n(P){C.blockers.delete(P),oe.delete(P)}function xs(P,R){let B=C.blockers.get(P)||Zc;et(B.state==="unblocked"&&R.state==="blocked"||B.state==="blocked"&&R.state==="blocked"||B.state==="blocked"&&R.state==="proceeding"||B.state==="blocked"&&R.state==="unblocked"||B.state==="proceeding"&&R.state==="unblocked","Invalid blocker state transition: "+B.state+" -> "+R.state);let W=new Map(C.blockers);W.set(P,R),ve({blockers:W})}function Io(P){let{currentLocation:R,nextLocation:B,historyAction:W}=P;if(oe.size===0)return;oe.size>1&&dc(!1,"A router only supports one blocker at a time");let be=Array.from(oe.entries()),[Me,ze]=be[be.length-1],pe=C.blockers.get(Me);if(!(pe&&pe.state==="proceeding")&&ze({currentLocation:R,nextLocation:B,historyAction:W}))return Me}function Bc(P){let R=Hn(404,{pathname:P}),B=c||a,{matches:W,route:be}=P0(B);return ws(),{notFoundMatches:W,route:be,error:R}}function Zi(P,R){return{boundaryId:Tl(R.partialMatches).route.id,error:Hn(400,{type:"route-discovery",pathname:P,message:R.error!=null&&"message"in R.error?R.error:String(R.error)})}}function ws(P){let R=[];return le.forEach((B,W)=>{(!P||P(W))&&(B.cancel(),R.push(W),le.delete(W))}),R}function zc(P,R,B){if(h=P,x=R,m=B||null,!b&&C.navigation===Fm){b=!0;let W=Qw(C.location,C.matches);W!=null&&ve({restoreScrollPosition:W})}return()=>{h=null,x=null,m=null}}function Jw(P,R){return m&&m(P,R.map(W=>R2(W,C.loaderData)))||P.key}function eD(P,R){if(h&&x){let B=Jw(P,R);h[B]=x()}}function Qw(P,R){if(h){let B=Jw(P,R),W=h[B];if(typeof W=="number")return W}return null}function im(P,R,B){if(d)if(P){let W=P[P.length-1].route;if(W.path&&(W.path==="*"||W.path.endsWith("/*")))return{active:!0,matches:dp(R,B,u,!0)}}else return{active:!0,matches:dp(R,B,u,!0)||[]};return{active:!1,matches:null}}async function of(P,R,B){let W=P,be=W.length>0?W[W.length-1].route:null;for(;;){let Me=c==null,ze=c||a;try{await iL(d,R,W,ze,o,s,Q,B)}catch(Oe){return{type:"error",error:Oe,partialMatches:W}}finally{Me&&(a=[...a])}if(B.aborted)return{type:"aborted"};let pe=Ya(ze,R,u),Je=!1;if(pe){let Oe=pe[pe.length-1].route;if(Oe.index)return{type:"success",matches:pe};if(Oe.path&&Oe.path.length>0)if(Oe.path==="*")Je=!0;else return{type:"success",matches:pe}}let _e=dp(ze,R,u,!0);if(!_e||W.map(Oe=>Oe.route.id).join("-")===_e.map(Oe=>Oe.route.id).join("-"))return{type:"success",matches:Je?pe:null};if(W=_e,be=W[W.length-1].route,be.path==="*")return{type:"success",matches:W}}}function tD(P){o={},c=ad(P,s,void 0,o)}function nD(P,R){let B=c==null;bT(P,R,c||a,o,s),B&&(a=[...a],ve({}))}return E={get basename(){return u},get future(){return p},get state(){return C},get routes(){return a},get window(){return t},initialize:Pe,subscribe:Re,enableScrollRestoration:zc,navigate:Vt,fetch:he,revalidate:tn,createHref:P=>e.history.createHref(P),encodeLocation:P=>e.history.encodeLocation(P),getFetcher:Oo,deleteFetcher:qa,dispose:Be,getBlocker:vt,deleteBlocker:_n,patchRoutes:nD,_internalFetchControllers:J,_internalActiveDeferreds:le,_internalSetRoutes:tD},E}function sL(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Ay(e,t,n,r,s,o,a,c){let u,i;if(a){u=[];for(let p of t)if(u.push(p),p.route.id===a){i=p;break}}else u=t,i=t[t.length-1];let d=Yg(s||".",Zg(u,o),Cc(e.pathname,n)||e.pathname,c==="path");return s==null&&(d.search=e.search,d.hash=e.hash),(s==null||s===""||s===".")&&i&&i.route.index&&!Ox(d.search)&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(d.pathname=d.pathname==="/"?n:ho([n,d.pathname])),Pi(d)}function S0(e,t,n,r){if(!r||!sL(r))return{path:n};if(r.formMethod&&!yL(r.formMethod))return{path:n,error:Hn(405,{method:r.formMethod})};let s=()=>({path:n,error:Hn(400,{type:"invalid-body"})}),o=r.formMethod||"get",a=e?o.toUpperCase():o.toLowerCase(),c=xT(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Yr(a))return s();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((g,h)=>{let[m,x]=h;return""+g+m+"="+x+` -`},""):String(r.body);return{path:n,submission:{formMethod:a,formAction:c,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!Yr(a))return s();try{let f=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:a,formAction:c,formEncType:r.formEncType,formData:void 0,json:f,text:void 0}}}catch{return s()}}}et(typeof FormData=="function","FormData is not available in this environment");let u,i;if(r.formData)u=Fy(r.formData),i=r.formData;else if(r.body instanceof FormData)u=Fy(r.body),i=r.body;else if(r.body instanceof URLSearchParams)u=r.body,i=T0(u);else if(r.body==null)u=new URLSearchParams,i=new FormData;else try{u=new URLSearchParams(r.body),i=T0(u)}catch{return s()}let d={formMethod:a,formAction:c,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(Yr(d.formMethod))return{path:n,submission:d};let p=Ra(n);return t&&p.search&&Ox(p.search)&&u.append("index",""),p.search="?"+u,{path:Pi(p),submission:d}}function oL(e,t){let n=e;if(t){let r=e.findIndex(s=>s.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function C0(e,t,n,r,s,o,a,c,u,i,d,p,f,g,h,m){let x=m?mr(m[1])?m[1].error:m[1].data:void 0,b=e.createURL(t.location),y=e.createURL(s),w=m&&mr(m[1])?m[0]:void 0,S=w?oL(n,w):n,E=m?m[1].statusCode:void 0,C=a&&E&&E>=400,T=S.filter((_,O)=>{let{route:K}=_;if(K.lazy)return!0;if(K.loader==null)return!1;if(o)return typeof K.loader!="function"||K.loader.hydrate?!0:t.loaderData[K.id]===void 0&&(!t.errors||t.errors[K.id]===void 0);if(aL(t.loaderData,t.matches[O],_)||u.some(q=>q===_.route.id))return!0;let I=t.matches[O],Y=_;return E0(_,Kt({currentUrl:b,currentParams:I.params,nextUrl:y,nextParams:Y.params},r,{actionResult:x,actionStatus:E,defaultShouldRevalidate:C?!1:c||b.pathname+b.search===y.pathname+y.search||b.search!==y.search||yT(I,Y)}))}),j=[];return p.forEach((_,O)=>{if(o||!n.some(Z=>Z.route.id===_.routeId)||d.has(O))return;let K=Ya(g,_.path,h);if(!K){j.push({key:O,routeId:_.routeId,path:_.path,matches:null,match:null,controller:null});return}let I=t.fetchers.get(O),Y=mu(K,_.path),q=!1;f.has(O)?q=!1:i.includes(O)?q=!0:I&&I.state!=="idle"&&I.data===void 0?q=c:q=E0(Y,Kt({currentUrl:b,currentParams:t.matches[t.matches.length-1].params,nextUrl:y,nextParams:n[n.length-1].params},r,{actionResult:x,actionStatus:E,defaultShouldRevalidate:C?!1:c})),q&&j.push({key:O,routeId:_.routeId,path:_.path,matches:K,match:Y,controller:new AbortController})}),[T,j]}function aL(e,t,n){let r=!t||n.route.id!==t.route.id,s=e[n.route.id]===void 0;return r||s}function yT(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function E0(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function iL(e,t,n,r,s,o,a,c){let u=[t,...n.map(i=>i.route.id)].join("-");try{let i=a.get(u);i||(i=e({path:t,matches:n,patch:(d,p)=>{c.aborted||bT(d,p,r,s,o)}}),a.set(u,i)),i&&hL(i)&&await i}finally{a.delete(u)}}function bT(e,t,n,r,s){if(e){var o;let a=r[e];et(a,"No route found to patch children into: routeId = "+e);let c=ad(t,s,[e,"patch",String(((o=a.children)==null?void 0:o.length)||"0")],r);a.children?a.children.push(...c):a.children=c}else{let a=ad(t,s,["patch",String(n.length||"0")],r);n.push(...a)}}async function k0(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let s=n[e.id];et(s,"No route found in manifest");let o={};for(let a in r){let u=s[a]!==void 0&&a!=="hasErrorBoundary";dc(!u,'Route "'+s.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+a+'" will be ignored.')),!u&&!_2.has(a)&&(o[a]=r[a])}Object.assign(s,o),Object.assign(s,Kt({},t(s),{lazy:void 0}))}function lL(e){return Promise.all(e.matches.map(t=>t.resolve()))}async function cL(e,t,n,r,s,o,a,c){let u=r.reduce((p,f)=>p.add(f.route.id),new Set),i=new Set,d=await e({matches:s.map(p=>{let f=u.has(p.route.id);return Kt({},p,{shouldLoad:f,resolve:h=>(i.add(p.route.id),f?uL(t,n,p,o,a,h,c):Promise.resolve({type:Mt.data,result:void 0}))})}),request:n,params:s[0].params,context:c});return s.forEach(p=>et(i.has(p.route.id),'`match.resolve()` was not called for route id "'+p.route.id+'". You must call `match.resolve()` on every match passed to `dataStrategy` to ensure all routes are properly loaded.')),d.filter((p,f)=>u.has(s[f].route.id))}async function uL(e,t,n,r,s,o,a){let c,u,i=d=>{let p,f=new Promise((m,x)=>p=x);u=()=>p(),t.signal.addEventListener("abort",u);let g=m=>typeof d!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):d({request:t,params:n.params,context:a},...m!==void 0?[m]:[]),h;return o?h=o(m=>g(m)):h=(async()=>{try{return{type:"data",result:await g()}}catch(m){return{type:"error",result:m}}})(),Promise.race([h,f])};try{let d=n.route[e];if(n.route.lazy)if(d){let p,[f]=await Promise.all([i(d).catch(g=>{p=g}),k0(n.route,s,r)]);if(p!==void 0)throw p;c=f}else if(await k0(n.route,s,r),d=n.route[e],d)c=await i(d);else if(e==="action"){let p=new URL(t.url),f=p.pathname+p.search;throw Hn(405,{method:t.method,pathname:f,routeId:n.route.id})}else return{type:Mt.data,result:void 0};else if(d)c=await i(d);else{let p=new URL(t.url),f=p.pathname+p.search;throw Hn(404,{pathname:f})}et(c.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(d){return{type:Mt.error,result:d}}finally{u&&t.signal.removeEventListener("abort",u)}return c}async function dL(e){let{result:t,type:n,status:r}=e;if(wT(t)){let a;try{let c=t.headers.get("Content-Type");c&&/\bapplication\/json\b/.test(c)?t.body==null?a=null:a=await t.json():a=await t.text()}catch(c){return{type:Mt.error,error:c}}return n===Mt.error?{type:Mt.error,error:new Px(t.status,t.statusText,a),statusCode:t.status,headers:t.headers}:{type:Mt.data,data:a,statusCode:t.status,headers:t.headers}}if(n===Mt.error)return{type:Mt.error,error:t,statusCode:Xg(t)?t.status:r};if(vL(t)){var s,o;return{type:Mt.deferred,deferredData:t,statusCode:(s=t.init)==null?void 0:s.status,headers:((o=t.init)==null?void 0:o.headers)&&new Headers(t.init.headers)}}return{type:Mt.data,data:t,statusCode:r}}function fL(e,t,n,r,s,o){let a=e.headers.get("Location");if(et(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!Rx.test(a)){let c=r.slice(0,r.findIndex(u=>u.route.id===n)+1);a=Ay(new URL(t.url),c,s,!0,a,o),e.headers.set("Location",a)}return e}function j0(e,t,n){if(Rx.test(e)){let r=e,s=r.startsWith("//")?new URL(t.protocol+r):new URL(r),o=Cc(s.pathname,n)!=null;if(s.origin===t.origin&&o)return s.pathname+s.search+s.hash}return e}function nl(e,t,n,r){let s=e.createURL(xT(t)).toString(),o={signal:n};if(r&&Yr(r.formMethod)){let{formMethod:a,formEncType:c}=r;o.method=a.toUpperCase(),c==="application/json"?(o.headers=new Headers({"Content-Type":c}),o.body=JSON.stringify(r.json)):c==="text/plain"?o.body=r.text:c==="application/x-www-form-urlencoded"&&r.formData?o.body=Fy(r.formData):o.body=r.formData}return new Request(s,o)}function Fy(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function T0(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function pL(e,t,n,r,s,o){let a={},c=null,u,i=!1,d={},p=r&&mr(r[1])?r[1].error:void 0;return n.forEach((f,g)=>{let h=t[g].route.id;if(et(!ri(f),"Cannot handle redirect results in processLoaderData"),mr(f)){let m=f.error;p!==void 0&&(m=p,p=void 0),c=c||{};{let x=Tl(e,h);c[x.route.id]==null&&(c[x.route.id]=m)}a[h]=void 0,i||(i=!0,u=Xg(f.error)?f.error.status:500),f.headers&&(d[h]=f.headers)}else ni(f)?(s.set(h,f.deferredData),a[h]=f.deferredData.data,f.statusCode!=null&&f.statusCode!==200&&!i&&(u=f.statusCode),f.headers&&(d[h]=f.headers)):(a[h]=f.data,f.statusCode&&f.statusCode!==200&&!i&&(u=f.statusCode),f.headers&&(d[h]=f.headers))}),p!==void 0&&r&&(c={[r[0]]:p},a[r[0]]=void 0),{loaderData:a,errors:c,statusCode:u||200,loaderHeaders:d}}function M0(e,t,n,r,s,o,a,c){let{loaderData:u,errors:i}=pL(t,n,r,s,c);for(let d=0;dr.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function P0(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Hn(e,t){let{pathname:n,routeId:r,method:s,type:o,message:a}=t===void 0?{}:t,c="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(c="Bad Request",o==="route-discovery"?u='Unable to match URL "'+n+'" - the `unstable_patchRoutesOnMiss()` '+(`function threw the following error: -`+a):s&&n&&r?u="You made a "+s+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":o==="defer-action"?u="defer() is not supported in actions":o==="invalid-body"&&(u="Unable to encode submission body")):e===403?(c="Forbidden",u='Route "'+r+'" does not match URL "'+n+'"'):e===404?(c="Not Found",u='No route matches URL "'+n+'"'):e===405&&(c="Method Not Allowed",s&&n&&r?u="You made a "+s.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":s&&(u='Invalid request method "'+s.toUpperCase()+'"')),new Px(e||500,c,new Error(u),!0)}function R0(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(ri(n))return{result:n,idx:t}}}function xT(e){let t=typeof e=="string"?Ra(e):e;return Pi(Kt({},t,{hash:""}))}function gL(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function hL(e){return typeof e=="object"&&e!=null&&"then"in e}function mL(e){return wT(e.result)&&X2.has(e.result.status)}function ni(e){return e.type===Mt.deferred}function mr(e){return e.type===Mt.error}function ri(e){return(e&&e.type)===Mt.redirect}function vL(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function wT(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function yL(e){return Y2.has(e.toLowerCase())}function Yr(e){return Q2.has(e.toLowerCase())}async function O0(e,t,n,r,s,o){for(let a=0;ap.route.id===u.route.id),d=i!=null&&!yT(i,u)&&(o&&o[u.route.id])!==void 0;if(ni(c)&&(s||d)){let p=r[a];et(p,"Expected an AbortSignal for revalidating fetcher deferred result"),await ST(c,p,s).then(f=>{f&&(n[a]=f||n[a])})}}}async function ST(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:Mt.data,data:e.deferredData.unwrappedData}}catch(s){return{type:Mt.error,error:s}}return{type:Mt.data,data:e.deferredData.data}}}function Ox(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function mu(e,t){let n=typeof t=="string"?Ra(t).search:t.search;if(e[e.length-1].route.index&&Ox(n||""))return e[e.length-1];let r=hT(e);return r[r.length-1]}function I0(e){let{formMethod:t,formAction:n,formEncType:r,text:s,formData:o,json:a}=e;if(!(!t||!n||!r)){if(s!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:s};if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(a!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:a,text:void 0}}}function Lm(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function bL(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Yc(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function xL(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Uo(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function wL(e,t){try{let n=e.sessionStorage.getItem(vT);if(n){let r=JSON.parse(n);for(let[s,o]of Object.entries(r||{}))o&&Array.isArray(o)&&t.set(s,new Set(o||[]))}}catch{}}function SL(e,t){if(t.size>0){let n={};for(let[r,s]of t)n[r]=[...s];try{e.sessionStorage.setItem(vT,JSON.stringify(n))}catch(r){dc(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/** - * React Router v6.25.1 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Yp(){return Yp=Object.assign?Object.assign.bind():function(e){for(var t=1;t{c.current=!0}),v.useCallback(function(i,d){if(d===void 0&&(d={}),!c.current)return;if(typeof i=="number"){r.go(i);return}let p=Yg(i,JSON.parse(a),o,d.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:ho([t,p.pathname])),(d.replace?r.replace:r.push)(p,d.state,d)},[t,r,a,o,e])}function gs(){let{matches:e}=v.useContext(jo),t=e[e.length-1];return t?t.params:{}}function jT(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=v.useContext(Oa),{matches:s}=v.useContext(jo),{pathname:o}=kc(),a=JSON.stringify(Zg(s,r.v7_relativeSplatPath));return v.useMemo(()=>Yg(e,JSON.parse(a),o,n==="path"),[e,a,o,n])}function kL(e,t,n,r){Ec()||et(!1);let{navigator:s}=v.useContext(Oa),{matches:o}=v.useContext(jo),a=o[o.length-1],c=a?a.params:{};a&&a.pathname;let u=a?a.pathnameBase:"/";a&&a.route;let i=kc(),d;d=i;let p=d.pathname||"/",f=p;if(u!=="/"){let m=u.replace(/^\//,"").split("/");f="/"+p.replace(/^\//,"").split("/").slice(m.length).join("/")}let g=Ya(e,{pathname:f});return _L(g&&g.map(m=>Object.assign({},m,{params:Object.assign({},c,m.params),pathname:ho([u,s.encodeLocation?s.encodeLocation(m.pathname).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?u:ho([u,s.encodeLocation?s.encodeLocation(m.pathnameBase).pathname:m.pathnameBase])})),o,n,r)}function jL(){let e=IL(),t=Xg(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:s},n):null,null)}const TL=v.createElement(jL,null);class ML extends v.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?v.createElement(jo.Provider,{value:this.props.routeContext},v.createElement(ET.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function NL(e){let{routeContext:t,match:n,children:r}=e,s=v.useContext(eh);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement(jo.Provider,{value:t},r)}function _L(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if((o=n)!=null&&o.errors)e=n.matches;else return null}let a=e,c=(s=n)==null?void 0:s.errors;if(c!=null){let d=a.findIndex(p=>p.route.id&&(c==null?void 0:c[p.route.id])!==void 0);d>=0||et(!1),a=a.slice(0,Math.min(a.length,d+1))}let u=!1,i=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d=0?a=a.slice(0,i+1):a=[a[0]];break}}}return a.reduceRight((d,p,f)=>{let g,h=!1,m=null,x=null;n&&(g=c&&p.route.id?c[p.route.id]:void 0,m=p.route.errorElement||TL,u&&(i<0&&f===0?(AL("route-fallback"),h=!0,x=null):i===f&&(h=!0,x=p.route.hydrateFallbackElement||null)));let b=t.concat(a.slice(0,f+1)),y=()=>{let w;return g?w=m:h?w=x:p.route.Component?w=v.createElement(p.route.Component,null):p.route.element?w=p.route.element:w=d,v.createElement(NL,{match:p,routeContext:{outlet:d,matches:b,isDataRoute:n!=null},children:w})};return n&&(p.route.ErrorBoundary||p.route.errorElement||f===0)?v.createElement(ML,{location:n.location,revalidation:n.revalidation,component:m,error:g,children:y(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):y()},null)}var TT=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(TT||{}),Xp=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Xp||{});function PL(e){let t=v.useContext(eh);return t||et(!1),t}function RL(e){let t=v.useContext(CT);return t||et(!1),t}function OL(e){let t=v.useContext(jo);return t||et(!1),t}function MT(e){let t=OL(),n=t.matches[t.matches.length-1];return n.route.id||et(!1),n.route.id}function IL(){var e;let t=v.useContext(ET),n=RL(Xp.UseRouteError),r=MT(Xp.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function DL(){let{router:e}=PL(TT.UseNavigateStable),t=MT(Xp.UseNavigateStable),n=v.useRef(!1);return kT(()=>{n.current=!0}),v.useCallback(function(s,o){o===void 0&&(o={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,Yp({fromRouteId:t},o)))},[e,t])}const D0={};function AL(e,t,n){D0[e]||(D0[e]=!0)}function NT(e){let{to:t,replace:n,state:r,relative:s}=e;Ec()||et(!1);let{future:o,static:a}=v.useContext(Oa),{matches:c}=v.useContext(jo),{pathname:u}=kc(),i=an(),d=Yg(t,Zg(c,o.v7_relativeSplatPath),u,s==="path"),p=JSON.stringify(d);return v.useEffect(()=>i(JSON.parse(p),{replace:n,state:r,relative:s}),[i,p,s,n,r]),null}function FL(e){let{basename:t="/",children:n=null,location:r,navigationType:s=rn.Pop,navigator:o,static:a=!1,future:c}=e;Ec()&&et(!1);let u=t.replace(/^\/*/,"/"),i=v.useMemo(()=>({basename:u,navigator:o,static:a,future:Yp({v7_relativeSplatPath:!1},c)}),[u,c,o,a]);typeof r=="string"&&(r=Ra(r));let{pathname:d="/",search:p="",hash:f="",state:g=null,key:h="default"}=r,m=v.useMemo(()=>{let x=Cc(d,u);return x==null?null:{location:{pathname:x,search:p,hash:f,state:g,key:h},navigationType:s}},[u,d,p,f,g,h,s]);return m==null?null:v.createElement(Oa.Provider,{value:i},v.createElement(Ix.Provider,{children:n,value:m}))}new Promise(()=>{});function LL(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:v.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:v.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:v.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** - * React Router DOM v6.25.1 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function id(){return id=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function BL(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function zL(e,t){return e.button===0&&(!t||t==="_self")&&!BL(e)}const UL=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],VL="6";try{window.__reactRouterVersion=VL}catch{}function HL(e,t){return rL({basename:void 0,future:id({},void 0,{v7_prependBasename:!0}),history:T2({window:void 0}),hydrationData:KL(),routes:e,mapRouteProperties:LL,unstable_dataStrategy:void 0,unstable_patchRoutesOnMiss:void 0,window:void 0}).initialize()}function KL(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=id({},t,{errors:qL(t.errors)})),t}function qL(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,s]of t)if(s&&s.__type==="RouteErrorResponse")n[r]=new Px(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let o=window[s.__subType];if(typeof o=="function")try{let a=new o(s.message);a.stack="",n[r]=a}catch{}}if(n[r]==null){let o=new Error(s.message);o.stack="",n[r]=o}}else n[r]=s;return n}const WL=v.createContext({isTransitioning:!1}),GL=v.createContext(new Map),JL="startTransition",A0=Dg[JL],QL="flushSync",F0=u2[QL];function ZL(e){A0?A0(e):e()}function Xc(e){F0?F0(e):e()}class YL{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function XL(e){let{fallbackElement:t,router:n,future:r}=e,[s,o]=v.useState(n.state),[a,c]=v.useState(),[u,i]=v.useState({isTransitioning:!1}),[d,p]=v.useState(),[f,g]=v.useState(),[h,m]=v.useState(),x=v.useRef(new Map),{v7_startTransition:b}=r||{},y=v.useCallback(j=>{b?ZL(j):j()},[b]),w=v.useCallback((j,_)=>{let{deletedFetchers:O,unstable_flushSync:K,unstable_viewTransitionOpts:I}=_;O.forEach(q=>x.current.delete(q)),j.fetchers.forEach((q,Z)=>{q.data!==void 0&&x.current.set(Z,q.data)});let Y=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!I||Y){K?Xc(()=>o(j)):y(()=>o(j));return}if(K){Xc(()=>{f&&(d&&d.resolve(),f.skipTransition()),i({isTransitioning:!0,flushSync:!0,currentLocation:I.currentLocation,nextLocation:I.nextLocation})});let q=n.window.document.startViewTransition(()=>{Xc(()=>o(j))});q.finished.finally(()=>{Xc(()=>{p(void 0),g(void 0),c(void 0),i({isTransitioning:!1})})}),Xc(()=>g(q));return}f?(d&&d.resolve(),f.skipTransition(),m({state:j,currentLocation:I.currentLocation,nextLocation:I.nextLocation})):(c(j),i({isTransitioning:!0,flushSync:!1,currentLocation:I.currentLocation,nextLocation:I.nextLocation}))},[n.window,f,d,x,y]);v.useLayoutEffect(()=>n.subscribe(w),[n,w]),v.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new YL)},[u]),v.useEffect(()=>{if(d&&a&&n.window){let j=a,_=d.promise,O=n.window.document.startViewTransition(async()=>{y(()=>o(j)),await _});O.finished.finally(()=>{p(void 0),g(void 0),c(void 0),i({isTransitioning:!1})}),g(O)}},[y,a,d,n.window]),v.useEffect(()=>{d&&a&&s.location.key===a.location.key&&d.resolve()},[d,f,s.location,a]),v.useEffect(()=>{!u.isTransitioning&&h&&(c(h.state),i({isTransitioning:!0,flushSync:!1,currentLocation:h.currentLocation,nextLocation:h.nextLocation}),m(void 0))},[u.isTransitioning,h]),v.useEffect(()=>{},[]);let S=v.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:j=>n.navigate(j),push:(j,_,O)=>n.navigate(j,{state:_,preventScrollReset:O==null?void 0:O.preventScrollReset}),replace:(j,_,O)=>n.navigate(j,{replace:!0,state:_,preventScrollReset:O==null?void 0:O.preventScrollReset})}),[n]),E=n.basename||"/",C=v.useMemo(()=>({router:n,navigator:S,static:!1,basename:E}),[n,S,E]),T=v.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return v.createElement(v.Fragment,null,v.createElement(eh.Provider,{value:C},v.createElement(CT.Provider,{value:s},v.createElement(GL.Provider,{value:x.current},v.createElement(WL.Provider,{value:u},v.createElement(FL,{basename:E,location:s.location,navigationType:s.historyAction,navigator:S,future:T},s.initialized||n.future.v7_partialHydration?v.createElement(e$,{routes:n.routes,future:n.future,state:s}):t))))),null)}const e$=v.memo(t$);function t$(e){let{routes:t,future:n,state:r}=e;return kL(t,void 0,r,n)}const n$=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",r$=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ld=v.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:o,replace:a,state:c,target:u,to:i,preventScrollReset:d,unstable_viewTransition:p}=t,f=$L(t,UL),{basename:g}=v.useContext(Oa),h,m=!1;if(typeof i=="string"&&r$.test(i)&&(h=i,n$))try{let w=new URL(window.location.href),S=i.startsWith("//")?new URL(w.protocol+i):new URL(i),E=Cc(S.pathname,g);S.origin===w.origin&&E!=null?i=E+S.search+S.hash:m=!0}catch{}let x=CL(i,{relative:s}),b=s$(i,{replace:a,state:c,target:u,preventScrollReset:d,relative:s,unstable_viewTransition:p});function y(w){r&&r(w),w.defaultPrevented||b(w)}return v.createElement("a",id({},f,{href:h||x,onClick:m||o?r:y,ref:n,target:u}))});var L0;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(L0||(L0={}));var $0;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})($0||($0={}));function s$(e,t){let{target:n,replace:r,state:s,preventScrollReset:o,relative:a,unstable_viewTransition:c}=t===void 0?{}:t,u=an(),i=kc(),d=jT(e,{relative:a});return v.useCallback(p=>{if(zL(p,n)){p.preventDefault();let f=r!==void 0?r:Pi(i)===Pi(d);u(e,{replace:f,state:s,preventScrollReset:o,relative:a,unstable_viewTransition:c})}},[i,u,d,r,s,n,e,o,a,c])}function _T(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;ttypeof e=="number"&&!isNaN(e),xi=e=>typeof e=="string",br=e=>typeof e=="function",fp=e=>xi(e)||br(e)?e:null,Ly=e=>v.isValidElement(e)||xi(e)||br(e)||cd(e);function o$(e,t,n){n===void 0&&(n=300);const{scrollHeight:r,style:s}=e;requestAnimationFrame(()=>{s.minHeight="initial",s.height=r+"px",s.transition=`all ${n}ms`,requestAnimationFrame(()=>{s.height="0",s.padding="0",s.margin="0",setTimeout(t,n)})})}function th(e){let{enter:t,exit:n,appendPosition:r=!1,collapse:s=!0,collapseDuration:o=300}=e;return function(a){let{children:c,position:u,preventExitTransition:i,done:d,nodeRef:p,isIn:f,playToast:g}=a;const h=r?`${t}--${u}`:t,m=r?`${n}--${u}`:n,x=v.useRef(0);return v.useLayoutEffect(()=>{const b=p.current,y=h.split(" "),w=S=>{S.target===p.current&&(g(),b.removeEventListener("animationend",w),b.removeEventListener("animationcancel",w),x.current===0&&S.type!=="animationcancel"&&b.classList.remove(...y))};b.classList.add(...y),b.addEventListener("animationend",w),b.addEventListener("animationcancel",w)},[]),v.useEffect(()=>{const b=p.current,y=()=>{b.removeEventListener("animationend",y),s?o$(b,d,o):d()};f||(i?y():(x.current=1,b.className+=` ${m}`,b.addEventListener("animationend",y)))},[f]),je.createElement(je.Fragment,null,c)}}function B0(e,t){return e!=null?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const Wn=new Map;let ud=[];const $y=new Set,a$=e=>$y.forEach(t=>t(e)),PT=()=>Wn.size>0;function RT(e,t){var n;if(t)return!((n=Wn.get(t))==null||!n.isToastActive(e));let r=!1;return Wn.forEach(s=>{s.isToastActive(e)&&(r=!0)}),r}function OT(e,t){Ly(e)&&(PT()||ud.push({content:e,options:t}),Wn.forEach(n=>{n.buildToast(e,t)}))}function z0(e,t){Wn.forEach(n=>{t!=null&&t!=null&&t.containerId?(t==null?void 0:t.containerId)===n.id&&n.toggle(e,t==null?void 0:t.id):n.toggle(e,t==null?void 0:t.id)})}function i$(e){const{subscribe:t,getSnapshot:n,setProps:r}=v.useRef(function(o){const a=o.containerId||1;return{subscribe(c){const u=function(d,p,f){let g=1,h=0,m=[],x=[],b=[],y=p;const w=new Map,S=new Set,E=()=>{b=Array.from(w.values()),S.forEach(j=>j())},C=j=>{x=j==null?[]:x.filter(_=>_!==j),E()},T=j=>{const{toastId:_,onOpen:O,updateId:K,children:I}=j.props,Y=K==null;j.staleId&&w.delete(j.staleId),w.set(_,j),x=[...x,j.props.toastId].filter(q=>q!==j.staleId),E(),f(B0(j,Y?"added":"updated")),Y&&br(O)&&O(v.isValidElement(I)&&I.props)};return{id:d,props:y,observe:j=>(S.add(j),()=>S.delete(j)),toggle:(j,_)=>{w.forEach(O=>{_!=null&&_!==O.props.toastId||br(O.toggle)&&O.toggle(j)})},removeToast:C,toasts:w,clearQueue:()=>{h-=m.length,m=[]},buildToast:(j,_)=>{if((H=>{let{containerId:se,toastId:ne,updateId:le}=H;const oe=se?se!==d:d!==1,Q=w.has(ne)&&le==null;return oe||Q})(_))return;const{toastId:O,updateId:K,data:I,staleId:Y,delay:q}=_,Z=()=>{C(O)},ee=K==null;ee&&h++;const J={...y,style:y.toastStyle,key:g++,...Object.fromEntries(Object.entries(_).filter(H=>{let[se,ne]=H;return ne!=null})),toastId:O,updateId:K,data:I,closeToast:Z,isIn:!1,className:fp(_.className||y.toastClassName),bodyClassName:fp(_.bodyClassName||y.bodyClassName),progressClassName:fp(_.progressClassName||y.progressClassName),autoClose:!_.isLoading&&(L=_.autoClose,A=y.autoClose,L===!1||cd(L)&&L>0?L:A),deleteToast(){const H=w.get(O),{onClose:se,children:ne}=H.props;br(se)&&se(v.isValidElement(ne)&&ne.props),f(B0(H,"removed")),w.delete(O),h--,h<0&&(h=0),m.length>0?T(m.shift()):E()}};var L,A;J.closeButton=y.closeButton,_.closeButton===!1||Ly(_.closeButton)?J.closeButton=_.closeButton:_.closeButton===!0&&(J.closeButton=!Ly(y.closeButton)||y.closeButton);let X=j;v.isValidElement(j)&&!xi(j.type)?X=v.cloneElement(j,{closeToast:Z,toastProps:J,data:I}):br(j)&&(X=j({closeToast:Z,toastProps:J,data:I}));const fe={content:X,props:J,staleId:Y};y.limit&&y.limit>0&&h>y.limit&&ee?m.push(fe):cd(q)?setTimeout(()=>{T(fe)},q):T(fe)},setProps(j){y=j},setToggle:(j,_)=>{w.get(j).toggle=_},isToastActive:j=>x.some(_=>_===j),getSnapshot:()=>y.newestOnTop?b.reverse():b}}(a,o,a$);Wn.set(a,u);const i=u.observe(c);return ud.forEach(d=>OT(d.content,d.options)),ud=[],()=>{i(),Wn.delete(a)}},setProps(c){var u;(u=Wn.get(a))==null||u.setProps(c)},getSnapshot(){var c;return(c=Wn.get(a))==null?void 0:c.getSnapshot()}}}(e)).current;r(e);const s=v.useSyncExternalStore(t,n,n);return{getToastToRender:function(o){if(!s)return[];const a=new Map;return s.forEach(c=>{const{position:u}=c.props;a.has(u)||a.set(u,[]),a.get(u).push(c)}),Array.from(a,c=>o(c[0],c[1]))},isToastActive:RT,count:s==null?void 0:s.length}}function l$(e){const[t,n]=v.useState(!1),[r,s]=v.useState(!1),o=v.useRef(null),a=v.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:c,pauseOnHover:u,closeToast:i,onClick:d,closeOnClick:p}=e;var f,g;function h(){n(!0)}function m(){n(!1)}function x(w){const S=o.current;a.canDrag&&S&&(a.didMove=!0,t&&m(),a.delta=e.draggableDirection==="x"?w.clientX-a.start:w.clientY-a.start,a.start!==w.clientX&&(a.canCloseOnClick=!1),S.style.transform=`translate3d(${e.draggableDirection==="x"?`${a.delta}px, var(--y)`:`0, calc(${a.delta}px + var(--y))`},0)`,S.style.opacity=""+(1-Math.abs(a.delta/a.removalDistance)))}function b(){document.removeEventListener("pointermove",x),document.removeEventListener("pointerup",b);const w=o.current;if(a.canDrag&&a.didMove&&w){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance)return s(!0),e.closeToast(),void e.collapseAll();w.style.transition="transform 0.2s, opacity 0.2s",w.style.removeProperty("transform"),w.style.removeProperty("opacity")}}(g=Wn.get((f={id:e.toastId,containerId:e.containerId,fn:n}).containerId||1))==null||g.setToggle(f.id,f.fn),v.useEffect(()=>{if(e.pauseOnFocusLoss)return document.hasFocus()||m(),window.addEventListener("focus",h),window.addEventListener("blur",m),()=>{window.removeEventListener("focus",h),window.removeEventListener("blur",m)}},[e.pauseOnFocusLoss]);const y={onPointerDown:function(w){if(e.draggable===!0||e.draggable===w.pointerType){a.didMove=!1,document.addEventListener("pointermove",x),document.addEventListener("pointerup",b);const S=o.current;a.canCloseOnClick=!0,a.canDrag=!0,S.style.transition="none",e.draggableDirection==="x"?(a.start=w.clientX,a.removalDistance=S.offsetWidth*(e.draggablePercent/100)):(a.start=w.clientY,a.removalDistance=S.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent)/100)}},onPointerUp:function(w){const{top:S,bottom:E,left:C,right:T}=o.current.getBoundingClientRect();w.nativeEvent.type!=="touchend"&&e.pauseOnHover&&w.clientX>=C&&w.clientX<=T&&w.clientY>=S&&w.clientY<=E?m():h()}};return c&&u&&(y.onMouseEnter=m,e.stacked||(y.onMouseLeave=h)),p&&(y.onClick=w=>{d&&d(w),a.canCloseOnClick&&i()}),{playToast:h,pauseToast:m,isRunning:t,preventExitTransition:r,toastRef:o,eventHandlers:y}}function c$(e){let{delay:t,isRunning:n,closeToast:r,type:s="default",hide:o,className:a,style:c,controlledProgress:u,progress:i,rtl:d,isIn:p,theme:f}=e;const g=o||u&&i===0,h={...c,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused"};u&&(h.transform=`scaleX(${i})`);const m=uo("Toastify__progress-bar",u?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${f}`,`Toastify__progress-bar--${s}`,{"Toastify__progress-bar--rtl":d}),x=br(a)?a({rtl:d,type:s,defaultClassName:m}):uo(m,a),b={[u&&i>=1?"onTransitionEnd":"onAnimationEnd"]:u&&i<1?null:()=>{p&&r()}};return je.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":g},je.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${f} Toastify__progress-bar--${s}`}),je.createElement("div",{role:"progressbar","aria-hidden":g?"true":"false","aria-label":"notification timer",className:x,style:h,...b}))}let u$=1;const IT=()=>""+u$++;function d$(e){return e&&(xi(e.toastId)||cd(e.toastId))?e.toastId:IT()}function Ou(e,t){return OT(e,t),t.toastId}function eg(e,t){return{...t,type:t&&t.type||e,toastId:d$(t)}}function Nf(e){return(t,n)=>Ou(t,eg(e,n))}function G(e,t){return Ou(e,eg("default",t))}G.loading=(e,t)=>Ou(e,eg("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),G.promise=function(e,t,n){let r,{pending:s,error:o,success:a}=t;s&&(r=xi(s)?G.loading(s,n):G.loading(s.render,{...n,...s}));const c={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},u=(d,p,f)=>{if(p==null)return void G.dismiss(r);const g={type:d,...c,...n,data:f},h=xi(p)?{render:p}:p;return r?G.update(r,{...g,...h}):G(h.render,{...g,...h}),f},i=br(e)?e():e;return i.then(d=>u("success",a,d)).catch(d=>u("error",o,d)),i},G.success=Nf("success"),G.info=Nf("info"),G.error=Nf("error"),G.warning=Nf("warning"),G.warn=G.warning,G.dark=(e,t)=>Ou(e,eg("default",{theme:"dark",...t})),G.dismiss=function(e){(function(t){var n;if(PT()){if(t==null||xi(n=t)||cd(n))Wn.forEach(r=>{r.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){const r=Wn.get(t.containerId);r?r.removeToast(t.id):Wn.forEach(s=>{s.removeToast(t.id)})}}else ud=ud.filter(r=>t!=null&&r.options.toastId!==t)})(e)},G.clearWaitingQueue=function(e){e===void 0&&(e={}),Wn.forEach(t=>{!t.props.limit||e.containerId&&t.id!==e.containerId||t.clearQueue()})},G.isActive=RT,G.update=function(e,t){t===void 0&&(t={});const n=((r,s)=>{var o;let{containerId:a}=s;return(o=Wn.get(a||1))==null?void 0:o.toasts.get(r)})(e,t);if(n){const{props:r,content:s}=n,o={delay:100,...r,...t,toastId:t.toastId||e,updateId:IT()};o.toastId!==e&&(o.staleId=e);const a=o.render||s;delete o.render,Ou(a,o)}},G.done=e=>{G.update(e,{progress:1})},G.onChange=function(e){return $y.add(e),()=>{$y.delete(e)}},G.play=e=>z0(!0,e),G.pause=e=>z0(!1,e);const f$=typeof window<"u"?v.useLayoutEffect:v.useEffect,_f=e=>{let{theme:t,type:n,isLoading:r,...s}=e;return je.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...s})},$m={info:function(e){return je.createElement(_f,{...e},je.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return je.createElement(_f,{...e},je.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return je.createElement(_f,{...e},je.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return je.createElement(_f,{...e},je.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return je.createElement("div",{className:"Toastify__spinner"})}},p$=e=>{const{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:s,playToast:o}=l$(e),{closeButton:a,children:c,autoClose:u,onClick:i,type:d,hideProgressBar:p,closeToast:f,transition:g,position:h,className:m,style:x,bodyClassName:b,bodyStyle:y,progressClassName:w,progressStyle:S,updateId:E,role:C,progress:T,rtl:j,toastId:_,deleteToast:O,isIn:K,isLoading:I,closeOnClick:Y,theme:q}=e,Z=uo("Toastify__toast",`Toastify__toast-theme--${q}`,`Toastify__toast--${d}`,{"Toastify__toast--rtl":j},{"Toastify__toast--close-on-click":Y}),ee=br(m)?m({rtl:j,position:h,type:d,defaultClassName:Z}):uo(Z,m),J=function(fe){let{theme:H,type:se,isLoading:ne,icon:le}=fe,oe=null;const Q={theme:H,type:se};return le===!1||(br(le)?oe=le({...Q,isLoading:ne}):v.isValidElement(le)?oe=v.cloneElement(le,Q):ne?oe=$m.spinner():(Ee=>Ee in $m)(se)&&(oe=$m[se](Q))),oe}(e),L=!!T||!u,A={closeToast:f,type:d,theme:q};let X=null;return a===!1||(X=br(a)?a(A):v.isValidElement(a)?v.cloneElement(a,A):function(fe){let{closeToast:H,theme:se,ariaLabel:ne="close"}=fe;return je.createElement("button",{className:`Toastify__close-button Toastify__close-button--${se}`,type:"button",onClick:le=>{le.stopPropagation(),H(le)},"aria-label":ne},je.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},je.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(A)),je.createElement(g,{isIn:K,done:O,position:h,preventExitTransition:n,nodeRef:r,playToast:o},je.createElement("div",{id:_,onClick:i,"data-in":K,className:ee,...s,style:x,ref:r},je.createElement("div",{...K&&{role:C},className:br(b)?b({type:d}):uo("Toastify__toast-body",b),style:y},J!=null&&je.createElement("div",{className:uo("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!I})},J),je.createElement("div",null,c)),X,je.createElement(c$,{...E&&!L?{key:`pb-${E}`}:{},rtl:j,theme:q,delay:u,isRunning:t,isIn:K,closeToast:f,hide:p,type:d,style:S,className:w,controlledProgress:L,progress:T||0})))},nh=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},g$=th(nh("bounce",!0));th(nh("slide",!0));th(nh("zoom"));th(nh("flip"));const h$={position:"top-right",transition:g$,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function m$(e){let t={...h$,...e};const n=e.stacked,[r,s]=v.useState(!0),o=v.useRef(null),{getToastToRender:a,isToastActive:c,count:u}=i$(t),{className:i,style:d,rtl:p,containerId:f}=t;function g(m){const x=uo("Toastify__toast-container",`Toastify__toast-container--${m}`,{"Toastify__toast-container--rtl":p});return br(i)?i({position:m,rtl:p,defaultClassName:x}):uo(x,fp(i))}function h(){n&&(s(!0),G.play())}return f$(()=>{if(n){var m;const x=o.current.querySelectorAll('[data-in="true"]'),b=12,y=(m=t.position)==null?void 0:m.includes("top");let w=0,S=0;Array.from(x).reverse().forEach((E,C)=>{const T=E;T.classList.add("Toastify__toast--stacked"),C>0&&(T.dataset.collapsed=`${r}`),T.dataset.pos||(T.dataset.pos=y?"top":"bot");const j=w*(r?.2:1)+(r?0:b*C);T.style.setProperty("--y",`${y?j:-1*j}px`),T.style.setProperty("--g",`${b}`),T.style.setProperty("--s",""+(1-(r?S:0))),w+=T.offsetHeight,S+=.025})}},[r,u,n]),je.createElement("div",{ref:o,className:"Toastify",id:f,onMouseEnter:()=>{n&&(s(!1),G.pause())},onMouseLeave:h},a((m,x)=>{const b=x.length?{...d}:{...d,pointerEvents:"none"};return je.createElement("div",{className:g(m),style:b,key:`container-${m}`},x.map(y=>{let{content:w,props:S}=y;return je.createElement(p$,{...S,stacked:n,collapseAll:h,isIn:c(S.toastId,S.containerId),style:S.style,key:`toast-${S.key}`},w)}))}))}const v$={theme:"system",setTheme:()=>null},DT=v.createContext(v$);function y$({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[s,o]=v.useState(()=>localStorage.getItem(n)||t);v.useEffect(()=>{const c=window.document.documentElement;if(c.classList.remove("light","dark"),s==="system"){const u=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";c.classList.add(u);return}c.classList.add(s)},[s]);const a={theme:s,setTheme:c=>{localStorage.setItem(n,c),o(c)}};return l.jsx(DT.Provider,{...r,value:a,children:e})}const Dx=()=>{const e=v.useContext(DT);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};let Bm=!1;const b$=new zD({defaultOptions:{queries:{staleTime:1e3*60*5,retry(e){return e>=3?(Bm===!1&&(Bm=!0,G.error("The application is taking longer than expected to load, please try again in a few minutes.",{onClose:()=>{Bm=!1}})),!1):!0}}}});var Fn=(e=>(e.API_URL="apiUrl",e.TOKEN="token",e.INSTANCE_ID="instanceId",e.INSTANCE_NAME="instanceName",e.INSTANCE_TOKEN="instanceToken",e.VERSION="version",e.FACEBOOK_APP_ID="facebookAppId",e.FACEBOOK_CONFIG_ID="facebookConfigId",e.FACEBOOK_USER_TOKEN="facebookUserToken",e.CLIENT_NAME="clientName",e))(Fn||{});const AT=async e=>{if(e.url){const t=e.url.endsWith("/")?e.url.slice(0,-1):e.url;localStorage.setItem("apiUrl",t)}e.token&&localStorage.setItem("token",e.token),e.version&&localStorage.setItem("version",e.version),e.facebookAppId&&localStorage.setItem("facebookAppId",e.facebookAppId),e.facebookConfigId&&localStorage.setItem("facebookConfigId",e.facebookConfigId),e.facebookUserToken&&localStorage.setItem("facebookUserToken",e.facebookUserToken),e.clientName&&localStorage.setItem("clientName",e.clientName)},FT=()=>{localStorage.removeItem("apiUrl"),localStorage.removeItem("token"),localStorage.removeItem("version"),localStorage.removeItem("facebookAppId"),localStorage.removeItem("facebookConfigId"),localStorage.removeItem("facebookUserToken"),localStorage.removeItem("clientName")},zr=e=>localStorage.getItem(e),Rt=({children:e})=>{const t=zr(Fn.API_URL),n=zr(Fn.TOKEN),r=zr(Fn.VERSION);return!t||!n||!r?l.jsx(NT,{to:"/manager/login"}):e},x$=({children:e})=>{const t=zr(Fn.API_URL),n=zr(Fn.TOKEN),r=zr(Fn.VERSION);return t&&n&&r?l.jsx(NT,{to:"/"}):e};function LT(e,t){return function(){return e.apply(t,arguments)}}const{toString:w$}=Object.prototype,{getPrototypeOf:Ax}=Object,rh=(e=>t=>{const n=w$.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),hs=e=>(e=e.toLowerCase(),t=>rh(t)===e),sh=e=>t=>typeof t===e,{isArray:jc}=Array,dd=sh("undefined");function S$(e){return e!==null&&!dd(e)&&e.constructor!==null&&!dd(e.constructor)&&Ur(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const $T=hs("ArrayBuffer");function C$(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&$T(e.buffer),t}const E$=sh("string"),Ur=sh("function"),BT=sh("number"),oh=e=>e!==null&&typeof e=="object",k$=e=>e===!0||e===!1,pp=e=>{if(rh(e)!=="object")return!1;const t=Ax(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},j$=hs("Date"),T$=hs("File"),M$=hs("Blob"),N$=hs("FileList"),_$=e=>oh(e)&&Ur(e.pipe),P$=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Ur(e.append)&&((t=rh(e))==="formdata"||t==="object"&&Ur(e.toString)&&e.toString()==="[object FormData]"))},R$=hs("URLSearchParams"),[O$,I$,D$,A$]=["ReadableStream","Request","Response","Headers"].map(hs),F$=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function qd(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),jc(e))for(r=0,s=e.length;r0;)if(s=n[r],t===s.toLowerCase())return s;return null}const UT=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,VT=e=>!dd(e)&&e!==UT;function By(){const{caseless:e}=VT(this)&&this||{},t={},n=(r,s)=>{const o=e&&zT(t,s)||s;pp(t[o])&&pp(r)?t[o]=By(t[o],r):pp(r)?t[o]=By({},r):jc(r)?t[o]=r.slice():t[o]=r};for(let r=0,s=arguments.length;r(qd(t,(s,o)=>{n&&Ur(s)?e[o]=LT(s,n):e[o]=s},{allOwnKeys:r}),e),$$=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),B$=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},z$=(e,t,n,r)=>{let s,o,a;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)a=s[o],(!r||r(a,e,t))&&!c[a]&&(t[a]=e[a],c[a]=!0);e=n!==!1&&Ax(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},U$=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},V$=e=>{if(!e)return null;if(jc(e))return e;let t=e.length;if(!BT(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},H$=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ax(Uint8Array)),K$=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},q$=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},W$=hs("HTMLFormElement"),G$=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),U0=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),J$=hs("RegExp"),HT=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};qd(n,(s,o)=>{let a;(a=t(s,o,e))!==!1&&(r[o]=a||s)}),Object.defineProperties(e,r)},Q$=e=>{HT(e,(t,n)=>{if(Ur(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Ur(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Z$=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return jc(e)?r(e):r(String(e).split(t)),n},Y$=()=>{},X$=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,zm="abcdefghijklmnopqrstuvwxyz",V0="0123456789",KT={DIGIT:V0,ALPHA:zm,ALPHA_DIGIT:zm+zm.toUpperCase()+V0},e4=(e=16,t=KT.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function t4(e){return!!(e&&Ur(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const n4=e=>{const t=new Array(10),n=(r,s)=>{if(oh(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const o=jc(r)?[]:{};return qd(r,(a,c)=>{const u=n(a,s+1);!dd(u)&&(o[c]=u)}),t[s]=void 0,o}}return r};return n(e,0)},r4=hs("AsyncFunction"),s4=e=>e&&(oh(e)||Ur(e))&&Ur(e.then)&&Ur(e.catch),U={isArray:jc,isArrayBuffer:$T,isBuffer:S$,isFormData:P$,isArrayBufferView:C$,isString:E$,isNumber:BT,isBoolean:k$,isObject:oh,isPlainObject:pp,isReadableStream:O$,isRequest:I$,isResponse:D$,isHeaders:A$,isUndefined:dd,isDate:j$,isFile:T$,isBlob:M$,isRegExp:J$,isFunction:Ur,isStream:_$,isURLSearchParams:R$,isTypedArray:H$,isFileList:N$,forEach:qd,merge:By,extend:L$,trim:F$,stripBOM:$$,inherits:B$,toFlatObject:z$,kindOf:rh,kindOfTest:hs,endsWith:U$,toArray:V$,forEachEntry:K$,matchAll:q$,isHTMLForm:W$,hasOwnProperty:U0,hasOwnProp:U0,reduceDescriptors:HT,freezeMethods:Q$,toObjectSet:Z$,toCamelCase:G$,noop:Y$,toFiniteNumber:X$,findKey:zT,global:UT,isContextDefined:VT,ALPHABET:KT,generateString:e4,isSpecCompliantForm:t4,toJSONObject:n4,isAsyncFn:r4,isThenable:s4};function We(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s)}U.inherits(We,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:U.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const qT=We.prototype,WT={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{WT[e]={value:e}});Object.defineProperties(We,WT);Object.defineProperty(qT,"isAxiosError",{value:!0});We.from=(e,t,n,r,s,o)=>{const a=Object.create(qT);return U.toFlatObject(e,a,function(u){return u!==Error.prototype},c=>c!=="isAxiosError"),We.call(a,e.message,t,n,r,s),a.cause=e,a.name=e.name,o&&Object.assign(a,o),a};const o4=null;function zy(e){return U.isPlainObject(e)||U.isArray(e)}function GT(e){return U.endsWith(e,"[]")?e.slice(0,-2):e}function H0(e,t,n){return e?e.concat(t).map(function(s,o){return s=GT(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function a4(e){return U.isArray(e)&&!e.some(zy)}const i4=U.toFlatObject(U,{},null,function(t){return/^is[A-Z]/.test(t)});function ah(e,t,n){if(!U.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=U.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,x){return!U.isUndefined(x[m])});const r=n.metaTokens,s=n.visitor||d,o=n.dots,a=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&U.isSpecCompliantForm(t);if(!U.isFunction(s))throw new TypeError("visitor must be a function");function i(h){if(h===null)return"";if(U.isDate(h))return h.toISOString();if(!u&&U.isBlob(h))throw new We("Blob is not supported. Use a Buffer instead.");return U.isArrayBuffer(h)||U.isTypedArray(h)?u&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function d(h,m,x){let b=h;if(h&&!x&&typeof h=="object"){if(U.endsWith(m,"{}"))m=r?m:m.slice(0,-2),h=JSON.stringify(h);else if(U.isArray(h)&&a4(h)||(U.isFileList(h)||U.endsWith(m,"[]"))&&(b=U.toArray(h)))return m=GT(m),b.forEach(function(w,S){!(U.isUndefined(w)||w===null)&&t.append(a===!0?H0([m],S,o):a===null?m:m+"[]",i(w))}),!1}return zy(h)?!0:(t.append(H0(x,m,o),i(h)),!1)}const p=[],f=Object.assign(i4,{defaultVisitor:d,convertValue:i,isVisitable:zy});function g(h,m){if(!U.isUndefined(h)){if(p.indexOf(h)!==-1)throw Error("Circular reference detected in "+m.join("."));p.push(h),U.forEach(h,function(b,y){(!(U.isUndefined(b)||b===null)&&s.call(t,b,U.isString(y)?y.trim():y,m,f))===!0&&g(b,m?m.concat(y):[y])}),p.pop()}}if(!U.isObject(e))throw new TypeError("data must be an object");return g(e),t}function K0(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Fx(e,t){this._pairs=[],e&&ah(e,this,t)}const JT=Fx.prototype;JT.append=function(t,n){this._pairs.push([t,n])};JT.toString=function(t){const n=t?function(r){return t.call(this,r,K0)}:K0;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function l4(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function QT(e,t,n){if(!t)return e;const r=n&&n.encode||l4,s=n&&n.serialize;let o;if(s?o=s(t,n):o=U.isURLSearchParams(t)?t.toString():new Fx(t,n).toString(r),o){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class q0{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){U.forEach(this.handlers,function(r){r!==null&&t(r)})}}const ZT={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},c4=typeof URLSearchParams<"u"?URLSearchParams:Fx,u4=typeof FormData<"u"?FormData:null,d4=typeof Blob<"u"?Blob:null,f4={isBrowser:!0,classes:{URLSearchParams:c4,FormData:u4,Blob:d4},protocols:["http","https","file","blob","url","data"]},Lx=typeof window<"u"&&typeof document<"u",p4=(e=>Lx&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),g4=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",h4=Lx&&window.location.href||"http://localhost",m4=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Lx,hasStandardBrowserEnv:p4,hasStandardBrowserWebWorkerEnv:g4,origin:h4},Symbol.toStringTag,{value:"Module"})),as={...m4,...f4};function v4(e,t){return ah(e,new as.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,o){return as.isNode&&U.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function y4(e){return U.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function b4(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r=n.length;return a=!a&&U.isArray(s)?s.length:a,u?(U.hasOwnProp(s,a)?s[a]=[s[a],r]:s[a]=r,!c):((!s[a]||!U.isObject(s[a]))&&(s[a]=[]),t(n,r,s[a],o)&&U.isArray(s[a])&&(s[a]=b4(s[a])),!c)}if(U.isFormData(e)&&U.isFunction(e.entries)){const n={};return U.forEachEntry(e,(r,s)=>{t(y4(r),s,n,0)}),n}return null}function x4(e,t,n){if(U.isString(e))try{return(t||JSON.parse)(e),U.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Wd={transitional:ZT,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=U.isObject(t);if(o&&U.isHTMLForm(t)&&(t=new FormData(t)),U.isFormData(t))return s?JSON.stringify(YT(t)):t;if(U.isArrayBuffer(t)||U.isBuffer(t)||U.isStream(t)||U.isFile(t)||U.isBlob(t)||U.isReadableStream(t))return t;if(U.isArrayBufferView(t))return t.buffer;if(U.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return v4(t,this.formSerializer).toString();if((c=U.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return ah(c?{"files[]":t}:t,u&&new u,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),x4(t)):t}],transformResponse:[function(t){const n=this.transitional||Wd.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(U.isResponse(t)||U.isReadableStream(t))return t;if(t&&U.isString(t)&&(r&&!this.responseType||s)){const a=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(c){if(a)throw c.name==="SyntaxError"?We.from(c,We.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:as.classes.FormData,Blob:as.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};U.forEach(["delete","get","head","post","put","patch"],e=>{Wd.headers[e]={}});const w4=U.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),S4=e=>{const t={};let n,r,s;return e&&e.split(` -`).forEach(function(a){s=a.indexOf(":"),n=a.substring(0,s).trim().toLowerCase(),r=a.substring(s+1).trim(),!(!n||t[n]&&w4[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},W0=Symbol("internals");function eu(e){return e&&String(e).trim().toLowerCase()}function gp(e){return e===!1||e==null?e:U.isArray(e)?e.map(gp):String(e)}function C4(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const E4=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Um(e,t,n,r,s){if(U.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!U.isString(t)){if(U.isString(r))return t.indexOf(r)!==-1;if(U.isRegExp(r))return r.test(t)}}function k4(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function j4(e,t){const n=U.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,a){return this[r].call(this,t,s,o,a)},configurable:!0})})}let lr=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(c,u,i){const d=eu(u);if(!d)throw new Error("header name must be a non-empty string");const p=U.findKey(s,d);(!p||s[p]===void 0||i===!0||i===void 0&&s[p]!==!1)&&(s[p||u]=gp(c))}const a=(c,u)=>U.forEach(c,(i,d)=>o(i,d,u));if(U.isPlainObject(t)||t instanceof this.constructor)a(t,n);else if(U.isString(t)&&(t=t.trim())&&!E4(t))a(S4(t),n);else if(U.isHeaders(t))for(const[c,u]of t.entries())o(u,c,r);else t!=null&&o(n,t,r);return this}get(t,n){if(t=eu(t),t){const r=U.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return C4(s);if(U.isFunction(n))return n.call(this,s,r);if(U.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=eu(t),t){const r=U.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Um(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(a){if(a=eu(a),a){const c=U.findKey(r,a);c&&(!n||Um(r,r[c],c,n))&&(delete r[c],s=!0)}}return U.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||Um(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return U.forEach(this,(s,o)=>{const a=U.findKey(r,o);if(a){n[a]=gp(s),delete n[o];return}const c=t?k4(o):String(o).trim();c!==o&&delete n[o],n[c]=gp(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return U.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&U.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` -`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[W0]=this[W0]={accessors:{}}).accessors,s=this.prototype;function o(a){const c=eu(a);r[c]||(j4(s,a),r[c]=!0)}return U.isArray(t)?t.forEach(o):o(t),this}};lr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);U.reduceDescriptors(lr.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});U.freezeMethods(lr);function Vm(e,t){const n=this||Wd,r=t||n,s=lr.from(r.headers);let o=r.data;return U.forEach(e,function(c){o=c.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function XT(e){return!!(e&&e.__CANCEL__)}function Tc(e,t,n){We.call(this,e??"canceled",We.ERR_CANCELED,t,n),this.name="CanceledError"}U.inherits(Tc,We,{__CANCEL__:!0});function eM(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new We("Request failed with status code "+n.status,[We.ERR_BAD_REQUEST,We.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function T4(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function M4(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,a;return t=t!==void 0?t:1e3,function(u){const i=Date.now(),d=r[o];a||(a=i),n[s]=u,r[s]=i;let p=o,f=0;for(;p!==s;)f+=n[p++],p=p%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),i-ar)return s&&(clearTimeout(s),s=null),n=c,e.apply(null,arguments);s||(s=setTimeout(()=>(s=null,n=Date.now(),e.apply(null,arguments)),r-(c-n)))}}const tg=(e,t,n=3)=>{let r=0;const s=M4(50,250);return N4(o=>{const a=o.loaded,c=o.lengthComputable?o.total:void 0,u=a-r,i=s(u),d=a<=c;r=a;const p={loaded:a,total:c,progress:c?a/c:void 0,bytes:u,rate:i||void 0,estimated:i&&c&&d?(c-a)/i:void 0,event:o,lengthComputable:c!=null};p[t?"download":"upload"]=!0,e(p)},n)},_4=as.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function s(o){let a=o;return t&&(n.setAttribute("href",a),a=n.href),n.setAttribute("href",a),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=s(window.location.href),function(a){const c=U.isString(a)?s(a):a;return c.protocol===r.protocol&&c.host===r.host}}():function(){return function(){return!0}}(),P4=as.hasStandardBrowserEnv?{write(e,t,n,r,s,o){const a=[e+"="+encodeURIComponent(t)];U.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),U.isString(r)&&a.push("path="+r),U.isString(s)&&a.push("domain="+s),o===!0&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function R4(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function O4(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function tM(e,t){return e&&!R4(t)?O4(e,t):t}const G0=e=>e instanceof lr?{...e}:e;function Ri(e,t){t=t||{};const n={};function r(i,d,p){return U.isPlainObject(i)&&U.isPlainObject(d)?U.merge.call({caseless:p},i,d):U.isPlainObject(d)?U.merge({},d):U.isArray(d)?d.slice():d}function s(i,d,p){if(U.isUndefined(d)){if(!U.isUndefined(i))return r(void 0,i,p)}else return r(i,d,p)}function o(i,d){if(!U.isUndefined(d))return r(void 0,d)}function a(i,d){if(U.isUndefined(d)){if(!U.isUndefined(i))return r(void 0,i)}else return r(void 0,d)}function c(i,d,p){if(p in t)return r(i,d);if(p in e)return r(void 0,i)}const u={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c,headers:(i,d)=>s(G0(i),G0(d),!0)};return U.forEach(Object.keys(Object.assign({},e,t)),function(d){const p=u[d]||s,f=p(e[d],t[d],d);U.isUndefined(f)&&p!==c||(n[d]=f)}),n}const nM=e=>{const t=Ri({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:a,auth:c}=t;t.headers=a=lr.from(a),t.url=QT(tM(t.baseURL,t.url),e.params,e.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let u;if(U.isFormData(n)){if(as.hasStandardBrowserEnv||as.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((u=a.getContentType())!==!1){const[i,...d]=u?u.split(";").map(p=>p.trim()).filter(Boolean):[];a.setContentType([i||"multipart/form-data",...d].join("; "))}}if(as.hasStandardBrowserEnv&&(r&&U.isFunction(r)&&(r=r(t)),r||r!==!1&&_4(t.url))){const i=s&&o&&P4.read(o);i&&a.set(s,i)}return t},I4=typeof XMLHttpRequest<"u",D4=I4&&function(e){return new Promise(function(n,r){const s=nM(e);let o=s.data;const a=lr.from(s.headers).normalize();let{responseType:c}=s,u;function i(){s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let d=new XMLHttpRequest;d.open(s.method.toUpperCase(),s.url,!0),d.timeout=s.timeout;function p(){if(!d)return;const g=lr.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),m={data:!c||c==="text"||c==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:g,config:e,request:d};eM(function(b){n(b),i()},function(b){r(b),i()},m),d=null}"onloadend"in d?d.onloadend=p:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(p)},d.onabort=function(){d&&(r(new We("Request aborted",We.ECONNABORTED,s,d)),d=null)},d.onerror=function(){r(new We("Network Error",We.ERR_NETWORK,s,d)),d=null},d.ontimeout=function(){let h=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const m=s.transitional||ZT;s.timeoutErrorMessage&&(h=s.timeoutErrorMessage),r(new We(h,m.clarifyTimeoutError?We.ETIMEDOUT:We.ECONNABORTED,s,d)),d=null},o===void 0&&a.setContentType(null),"setRequestHeader"in d&&U.forEach(a.toJSON(),function(h,m){d.setRequestHeader(m,h)}),U.isUndefined(s.withCredentials)||(d.withCredentials=!!s.withCredentials),c&&c!=="json"&&(d.responseType=s.responseType),typeof s.onDownloadProgress=="function"&&d.addEventListener("progress",tg(s.onDownloadProgress,!0)),typeof s.onUploadProgress=="function"&&d.upload&&d.upload.addEventListener("progress",tg(s.onUploadProgress)),(s.cancelToken||s.signal)&&(u=g=>{d&&(r(!g||g.type?new Tc(null,e,d):g),d.abort(),d=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const f=T4(s.url);if(f&&as.protocols.indexOf(f)===-1){r(new We("Unsupported protocol "+f+":",We.ERR_BAD_REQUEST,e));return}d.send(o||null)})},A4=(e,t)=>{let n=new AbortController,r;const s=function(u){if(!r){r=!0,a();const i=u instanceof Error?u:this.reason;n.abort(i instanceof We?i:new Tc(i instanceof Error?i.message:i))}};let o=t&&setTimeout(()=>{s(new We(`timeout ${t} of ms exceeded`,We.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(u=>{u&&(u.removeEventListener?u.removeEventListener("abort",s):u.unsubscribe(s))}),e=null)};e.forEach(u=>u&&u.addEventListener&&u.addEventListener("abort",s));const{signal:c}=n;return c.unsubscribe=a,[c,()=>{o&&clearTimeout(o),o=null}]},F4=function*(e,t){let n=e.byteLength;if(!t||n{const o=L4(e,t,s);let a=0;return new ReadableStream({type:"bytes",async pull(c){const{done:u,value:i}=await o.next();if(u){c.close(),r();return}let d=i.byteLength;n&&n(a+=d),c.enqueue(new Uint8Array(i))},cancel(c){return r(c),o.return()}},{highWaterMark:2})},Q0=(e,t)=>{const n=e!=null;return r=>setTimeout(()=>t({lengthComputable:n,total:e,loaded:r}))},ih=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",rM=ih&&typeof ReadableStream=="function",Uy=ih&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),$4=rM&&(()=>{let e=!1;const t=new Request(as.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})(),Z0=64*1024,Vy=rM&&!!(()=>{try{return U.isReadableStream(new Response("").body)}catch{}})(),ng={stream:Vy&&(e=>e.body)};ih&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!ng[t]&&(ng[t]=U.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new We(`Response type '${t}' is not supported`,We.ERR_NOT_SUPPORT,r)})})})(new Response);const B4=async e=>{if(e==null)return 0;if(U.isBlob(e))return e.size;if(U.isSpecCompliantForm(e))return(await new Request(e).arrayBuffer()).byteLength;if(U.isArrayBufferView(e))return e.byteLength;if(U.isURLSearchParams(e)&&(e=e+""),U.isString(e))return(await Uy(e)).byteLength},z4=async(e,t)=>{const n=U.toFiniteNumber(e.getContentLength());return n??B4(t)},U4=ih&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:o,timeout:a,onDownloadProgress:c,onUploadProgress:u,responseType:i,headers:d,withCredentials:p="same-origin",fetchOptions:f}=nM(e);i=i?(i+"").toLowerCase():"text";let[g,h]=s||o||a?A4([s,o],a):[],m,x;const b=()=>{!m&&setTimeout(()=>{g&&g.unsubscribe()}),m=!0};let y;try{if(u&&$4&&n!=="get"&&n!=="head"&&(y=await z4(d,r))!==0){let C=new Request(t,{method:"POST",body:r,duplex:"half"}),T;U.isFormData(r)&&(T=C.headers.get("content-type"))&&d.setContentType(T),C.body&&(r=J0(C.body,Z0,Q0(y,tg(u)),null,Uy))}U.isString(p)||(p=p?"cors":"omit"),x=new Request(t,{...f,signal:g,method:n.toUpperCase(),headers:d.normalize().toJSON(),body:r,duplex:"half",withCredentials:p});let w=await fetch(x);const S=Vy&&(i==="stream"||i==="response");if(Vy&&(c||S)){const C={};["status","statusText","headers"].forEach(j=>{C[j]=w[j]});const T=U.toFiniteNumber(w.headers.get("content-length"));w=new Response(J0(w.body,Z0,c&&Q0(T,tg(c,!0)),S&&b,Uy),C)}i=i||"text";let E=await ng[U.findKey(ng,i)||"text"](w,e);return!S&&b(),h&&h(),await new Promise((C,T)=>{eM(C,T,{data:E,headers:lr.from(w.headers),status:w.status,statusText:w.statusText,config:e,request:x})})}catch(w){throw b(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new We("Network Error",We.ERR_NETWORK,e,x),{cause:w.cause||w}):We.from(w,w&&w.code,e,x)}}),Hy={http:o4,xhr:D4,fetch:U4};U.forEach(Hy,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Y0=e=>`- ${e}`,V4=e=>U.isFunction(e)||e===null||e===!1,sM={getAdapter:e=>{e=U.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let o=0;o`adapter ${c} `+(u===!1?"is not supported by the environment":"is not available in the build"));let a=t?o.length>1?`since : -`+o.map(Y0).join(` -`):" "+Y0(o[0]):"as no adapter specified";throw new We("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:Hy};function Hm(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Tc(null,e)}function X0(e){return Hm(e),e.headers=lr.from(e.headers),e.data=Vm.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),sM.getAdapter(e.adapter||Wd.adapter)(e).then(function(r){return Hm(e),r.data=Vm.call(e,e.transformResponse,r),r.headers=lr.from(r.headers),r},function(r){return XT(r)||(Hm(e),r&&r.response&&(r.response.data=Vm.call(e,e.transformResponse,r.response),r.response.headers=lr.from(r.response.headers))),Promise.reject(r)})}const oM="1.7.2",$x={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{$x[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const eC={};$x.transitional=function(t,n,r){function s(o,a){return"[Axios v"+oM+"] Transitional option '"+o+"'"+a+(r?". "+r:"")}return(o,a,c)=>{if(t===!1)throw new We(s(a," has been removed"+(n?" in "+n:"")),We.ERR_DEPRECATED);return n&&!eC[a]&&(eC[a]=!0,console.warn(s(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,a,c):!0}};function H4(e,t,n){if(typeof e!="object")throw new We("options must be an object",We.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],a=t[o];if(a){const c=e[o],u=c===void 0||a(c,o,e);if(u!==!0)throw new We("option "+o+" must be "+u,We.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new We("Unknown option "+o,We.ERR_BAD_OPTION)}}const Ky={assertOptions:H4,validators:$x},Fo=Ky.validators;let wi=class{constructor(t){this.defaults=t,this.interceptors={request:new q0,response:new q0}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s;Error.captureStackTrace?Error.captureStackTrace(s={}):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=` -`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Ri(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&Ky.assertOptions(r,{silentJSONParsing:Fo.transitional(Fo.boolean),forcedJSONParsing:Fo.transitional(Fo.boolean),clarifyTimeoutError:Fo.transitional(Fo.boolean)},!1),s!=null&&(U.isFunction(s)?n.paramsSerializer={serialize:s}:Ky.assertOptions(s,{encode:Fo.function,serialize:Fo.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&U.merge(o.common,o[n.method]);o&&U.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),n.headers=lr.concat(a,o);const c=[];let u=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(u=u&&m.synchronous,c.unshift(m.fulfilled,m.rejected))});const i=[];this.interceptors.response.forEach(function(m){i.push(m.fulfilled,m.rejected)});let d,p=0,f;if(!u){const h=[X0.bind(this),void 0];for(h.unshift.apply(h,c),h.push.apply(h,i),f=h.length,d=Promise.resolve(n);p{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const a=new Promise(c=>{r.subscribe(c),o=c}).then(s);return a.cancel=function(){r.unsubscribe(o)},a},t(function(o,a,c){r.reason||(r.reason=new Tc(o,a,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new aM(function(s){t=s}),cancel:t}}};function q4(e){return function(n){return e.apply(null,n)}}function W4(e){return U.isObject(e)&&e.isAxiosError===!0}const qy={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(qy).forEach(([e,t])=>{qy[t]=e});function iM(e){const t=new wi(e),n=LT(wi.prototype.request,t);return U.extend(n,wi.prototype,t,{allOwnKeys:!0}),U.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return iM(Ri(e,s))},n}const Bt=iM(Wd);Bt.Axios=wi;Bt.CanceledError=Tc;Bt.CancelToken=K4;Bt.isCancel=XT;Bt.VERSION=oM;Bt.toFormData=ah;Bt.AxiosError=We;Bt.Cancel=Bt.CanceledError;Bt.all=function(t){return Promise.all(t)};Bt.spread=q4;Bt.isAxiosError=W4;Bt.mergeConfig=Ri;Bt.AxiosHeaders=lr;Bt.formToJSON=e=>YT(U.isHTMLForm(e)?new FormData(e):e);Bt.getAdapter=sM.getAdapter;Bt.HttpStatusCode=qy;Bt.default=Bt;const{Axios:Loe,AxiosError:$oe,CanceledError:Boe,isCancel:zoe,CancelToken:Uoe,VERSION:Voe,all:Hoe,Cancel:Koe,isAxiosError:G4,spread:qoe,toFormData:Woe,AxiosHeaders:Goe,HttpStatusCode:Joe,formToJSON:Qoe,getAdapter:Zoe,mergeConfig:Yoe}=Bt,J4=e=>["auth","verifyServer",JSON.stringify(e)],lM=async({url:e})=>(await Bt.get(`${e}/`)).data,Q4=e=>{const{url:t,...n}=e;return qe({...n,queryKey:J4({url:t}),queryFn:()=>lM({url:t}),enabled:!!t})};function Z4(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function lh(...e){return t=>e.forEach(n=>Z4(n,t))}function ct(...e){return v.useCallback(lh(...e),e)}var wo=v.forwardRef((e,t)=>{const{children:n,...r}=e,s=v.Children.toArray(n),o=s.find(X4);if(o){const a=o.props.children,c=s.map(u=>u===o?v.Children.count(a)>1?v.Children.only(null):v.isValidElement(a)?a.props.children:null:u);return l.jsx(Wy,{...r,ref:t,children:v.isValidElement(a)?v.cloneElement(a,void 0,c):null})}return l.jsx(Wy,{...r,ref:t,children:n})});wo.displayName="Slot";var Wy=v.forwardRef((e,t)=>{const{children:n,...r}=e;if(v.isValidElement(n)){const s=tB(n);return v.cloneElement(n,{...eB(r,n.props),ref:t?lh(t,s):s})}return v.Children.count(n)>1?v.Children.only(null):null});Wy.displayName="SlotClone";var Y4=({children:e})=>l.jsx(l.Fragment,{children:e});function X4(e){return v.isValidElement(e)&&e.type===Y4}function eB(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...c)=>{o(...c),s(...c)}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function tB(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function cM(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;ttypeof e=="boolean"?"".concat(e):e===0?"0":e,nC=nB,ch=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return nC(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:o}=t,a=Object.keys(s).map(i=>{const d=n==null?void 0:n[i],p=o==null?void 0:o[i];if(d===null)return null;const f=tC(d)||tC(p);return s[i][f]}),c=n&&Object.entries(n).reduce((i,d)=>{let[p,f]=d;return f===void 0||(i[p]=f),i},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((i,d)=>{let{class:p,className:f,...g}=d;return Object.entries(g).every(h=>{let[m,x]=h;return Array.isArray(x)?x.includes({...o,...c}[m]):{...o,...c}[m]===x})?[...i,p,f]:i},[]);return nC(e,a,u,n==null?void 0:n.class,n==null?void 0:n.className)},Bx="-";function rB(e){const t=oB(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function s(a){const c=a.split(Bx);return c[0]===""&&c.length!==1&&c.shift(),uM(c,t)||sB(a)}function o(a,c){const u=n[a]||[];return c&&r[a]?[...u,...r[a]]:u}return{getClassGroupId:s,getConflictingClassGroupIds:o}}function uM(e,t){var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?uM(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(Bx);return(a=t.validators.find(({validator:c})=>c(o)))==null?void 0:a.classGroupId}const rC=/^\[(.+)\]$/;function sB(e){if(rC.test(e)){const t=rC.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function oB(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return iB(Object.entries(e.classGroups),n).forEach(([o,a])=>{Gy(a,r,o,t)}),r}function Gy(e,t,n,r){e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:sC(t,s);o.classGroupId=n;return}if(typeof s=="function"){if(aB(s)){Gy(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,a])=>{Gy(a,sC(t,o),n,r)})})}function sC(e,t){let n=e;return t.split(Bx).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function aB(e){return e.isThemeGetter}function iB(e,t){return t?e.map(([n,r])=>{const s=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,c])=>[t+a,c])):o);return[n,s]}):e}function lB(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function s(o,a){n.set(o,a),t++,t>e&&(t=0,r=n,n=new Map)}return{get(o){let a=n.get(o);if(a!==void 0)return a;if((a=r.get(o))!==void 0)return s(o,a),a},set(o,a){n.has(o)?n.set(o,a):s(o,a)}}}const dM="!";function cB(e){const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],o=t.length;function a(c){const u=[];let i=0,d=0,p;for(let x=0;xd?p-d:void 0;return{modifiers:u,hasImportantModifier:g,baseClassName:h,maybePostfixModifierPosition:m}}return n?function(u){return n({className:u,parseClassName:a})}:a}function uB(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function dB(e){return{cache:lB(e.cacheSize),parseClassName:cB(e),...rB(e)}}const fB=/\s+/;function pB(e,t){const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,o=new Set;return e.trim().split(fB).map(a=>{const{modifiers:c,hasImportantModifier:u,baseClassName:i,maybePostfixModifierPosition:d}=n(a);let p=!!d,f=r(p?i.substring(0,d):i);if(!f){if(!p)return{isTailwindClass:!1,originalClassName:a};if(f=r(i),!f)return{isTailwindClass:!1,originalClassName:a};p=!1}const g=uB(c).join(":");return{isTailwindClass:!0,modifierId:u?g+dM:g,classGroupId:f,originalClassName:a,hasPostfixModifier:p}}).reverse().filter(a=>{if(!a.isTailwindClass)return!0;const{modifierId:c,classGroupId:u,hasPostfixModifier:i}=a,d=c+u;return o.has(d)?!1:(o.add(d),s(u,i).forEach(p=>o.add(c+p)),!0)}).reverse().map(a=>a.originalClassName).join(" ")}function gB(){let e=0,t,n,r="";for(;ep(d),e());return n=dB(i),r=n.cache.get,s=n.cache.set,o=c,c(u)}function c(u){const i=r(u);if(i)return i;const d=pB(u,n);return s(u,d),d}return function(){return o(gB.apply(null,arguments))}}function Ot(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const pM=/^\[(?:([a-z-]+):)?(.+)\]$/i,mB=/^\d+\/\d+$/,vB=new Set(["px","full","screen"]),yB=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,bB=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,xB=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,wB=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,SB=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Zs(e){return si(e)||vB.has(e)||mB.test(e)}function Lo(e){return Mc(e,"length",_B)}function si(e){return!!e&&!Number.isNaN(Number(e))}function Pf(e){return Mc(e,"number",si)}function tu(e){return!!e&&Number.isInteger(Number(e))}function CB(e){return e.endsWith("%")&&si(e.slice(0,-1))}function Qe(e){return pM.test(e)}function $o(e){return yB.test(e)}const EB=new Set(["length","size","percentage"]);function kB(e){return Mc(e,EB,gM)}function jB(e){return Mc(e,"position",gM)}const TB=new Set(["image","url"]);function MB(e){return Mc(e,TB,RB)}function NB(e){return Mc(e,"",PB)}function nu(){return!0}function Mc(e,t,n){const r=pM.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function _B(e){return bB.test(e)&&!xB.test(e)}function gM(){return!1}function PB(e){return wB.test(e)}function RB(e){return SB.test(e)}function OB(){const e=Ot("colors"),t=Ot("spacing"),n=Ot("blur"),r=Ot("brightness"),s=Ot("borderColor"),o=Ot("borderRadius"),a=Ot("borderSpacing"),c=Ot("borderWidth"),u=Ot("contrast"),i=Ot("grayscale"),d=Ot("hueRotate"),p=Ot("invert"),f=Ot("gap"),g=Ot("gradientColorStops"),h=Ot("gradientColorStopPositions"),m=Ot("inset"),x=Ot("margin"),b=Ot("opacity"),y=Ot("padding"),w=Ot("saturate"),S=Ot("scale"),E=Ot("sepia"),C=Ot("skew"),T=Ot("space"),j=Ot("translate"),_=()=>["auto","contain","none"],O=()=>["auto","hidden","clip","visible","scroll"],K=()=>["auto",Qe,t],I=()=>[Qe,t],Y=()=>["",Zs,Lo],q=()=>["auto",si,Qe],Z=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ee=()=>["solid","dashed","dotted","double","none"],J=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],L=()=>["start","end","center","between","around","evenly","stretch"],A=()=>["","0",Qe],X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],fe=()=>[si,Pf],H=()=>[si,Qe];return{cacheSize:500,separator:":",theme:{colors:[nu],spacing:[Zs,Lo],blur:["none","",$o,Qe],brightness:fe(),borderColor:[e],borderRadius:["none","","full",$o,Qe],borderSpacing:I(),borderWidth:Y(),contrast:fe(),grayscale:A(),hueRotate:H(),invert:A(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[CB,Lo],inset:K(),margin:K(),opacity:fe(),padding:I(),saturate:fe(),scale:fe(),sepia:A(),skew:H(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",Qe]}],container:["container"],columns:[{columns:[$o]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Z(),Qe]}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",tu,Qe]}],basis:[{basis:K()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Qe]}],grow:[{grow:A()}],shrink:[{shrink:A()}],order:[{order:["first","last","none",tu,Qe]}],"grid-cols":[{"grid-cols":[nu]}],"col-start-end":[{col:["auto",{span:["full",tu,Qe]},Qe]}],"col-start":[{"col-start":q()}],"col-end":[{"col-end":q()}],"grid-rows":[{"grid-rows":[nu]}],"row-start-end":[{row:["auto",{span:[tu,Qe]},Qe]}],"row-start":[{"row-start":q()}],"row-end":[{"row-end":q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Qe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Qe]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...L()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...L(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...L(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Qe,t]}],"min-w":[{"min-w":[Qe,t,"min","max","fit"]}],"max-w":[{"max-w":[Qe,t,"none","full","min","max","fit","prose",{screen:[$o]},$o]}],h:[{h:[Qe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Qe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Qe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Qe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",$o,Lo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Pf]}],"font-family":[{font:[nu]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Qe]}],"line-clamp":[{"line-clamp":["none",si,Pf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Zs,Qe]}],"list-image":[{"list-image":["none",Qe]}],"list-style-type":[{list:["none","disc","decimal",Qe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ee(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Zs,Lo]}],"underline-offset":[{"underline-offset":["auto",Zs,Qe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Qe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Qe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Z(),jB]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",kB]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},MB]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...ee(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:ee()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...ee()]}],"outline-offset":[{"outline-offset":[Zs,Qe]}],"outline-w":[{outline:[Zs,Lo]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[Zs,Lo]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",$o,NB]}],"shadow-color":[{shadow:[nu]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...J(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":J()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",$o,Qe]}],grayscale:[{grayscale:[i]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[p]}],saturate:[{saturate:[w]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[i]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Qe]}],duration:[{duration:H()}],ease:[{ease:["linear","in","out","in-out",Qe]}],delay:[{delay:H()}],animate:[{animate:["none","spin","ping","pulse","bounce",Qe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[tu,Qe]}],"translate-x":[{"translate-x":[j]}],"translate-y":[{"translate-y":[j]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Qe]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Qe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Qe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Zs,Lo,Pf]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const IB=hB(OB);function me(...e){return IB(uo(e))}const DB=ch("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",warning:"bg-amber-600 shadow-sm hover:bg-amber-600/90 data-active:bg-amber-600/90 text-foreground",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),z=v.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},o)=>{const a=r?wo:"button";return l.jsx(a,{className:me(DB({variant:t,size:n,className:e})),ref:o,...s})});z.displayName="Button";function zx(){const{t:e}=Te(),t=zr(Fn.API_URL),{data:n}=Q4({url:t}),r=v.useMemo(()=>n==null?void 0:n.clientName,[n]),s=v.useMemo(()=>n==null?void 0:n.version,[n]),o=[{name:"Discord",url:"https://evolution-api.com/discord"},{name:"Postman",url:"https://evolution-api.com/postman"},{name:"GitHub",url:"https://github.com/EvolutionAPI/evolution-api"},{name:"Docs",url:"https://doc.evolution-api.com"}];return l.jsxs("footer",{className:"flex w-full flex-col items-center justify-between p-6 text-xs text-secondary-foreground sm:flex-row",children:[l.jsxs("div",{className:"flex items-center space-x-3 divide-x",children:[r&&r!==""&&l.jsxs("span",{children:[e("footer.clientName"),": ",l.jsx("strong",{children:r})]}),s&&s!==""&&l.jsxs("span",{className:"pl-3",children:[e("footer.version"),": ",l.jsx("strong",{children:s})]})]}),l.jsx("div",{className:"flex gap-2",children:o.map(a=>l.jsx(z,{variant:"link",asChild:!0,size:"sm",className:"text-xs",children:l.jsx("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",children:a.name})},a.url))})]})}/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const AB=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),hM=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var FB={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const LB=v.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:a,...c},u)=>v.createElement("svg",{ref:u,...FB,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:hM("lucide",s),...c},[...a.map(([i,d])=>v.createElement(i,d)),...Array.isArray(o)?o:[o]]));/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const nt=(e,t)=>{const n=v.forwardRef(({className:r,...s},o)=>v.createElement(LB,{ref:o,iconNode:t,className:hM(`lucide-${AB(e)}`,r),...s}));return n.displayName=`${e}`,n};/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const $B=nt("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const BB=nt("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const mM=nt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const uh=nt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const zB=nt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const UB=nt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const VB=nt("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const HB=nt("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ui=nt("CircleStop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{width:"6",height:"6",x:"9",y:"9",key:"1wrtvo"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const vM=nt("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const KB=nt("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const To=nt("Cog",[["path",{d:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",key:"sobvz5"}],["path",{d:"M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",key:"11i496"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const qB=nt("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Vi=nt("Delete",[["path",{d:"M10 5a2 2 0 0 0-1.344.519l-6.328 5.74a1 1 0 0 0 0 1.481l6.328 5.741A2 2 0 0 0 10 19h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2z",key:"1yo7s0"}],["path",{d:"m12 9 6 6",key:"anjzzh"}],["path",{d:"m18 9-6 6",key:"1fp51s"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const WB=nt("DoorOpen",[["path",{d:"M13 4h3a2 2 0 0 1 2 2v14",key:"hrm0s9"}],["path",{d:"M2 20h3",key:"1gaodv"}],["path",{d:"M13 20h9",key:"s90cdi"}],["path",{d:"M10 12v.01",key:"vx6srw"}],["path",{d:"M13 4.562v16.157a1 1 0 0 1-1.242.97L5 20V5.562a2 2 0 0 1 1.515-1.94l4-1A2 2 0 0 1 13 4.561Z",key:"199qr4"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ia=nt("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const GB=nt("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const JB=nt("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const QB=nt("FileQuestion",[["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ZB=nt("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const YB=nt("IterationCcw",[["path",{d:"M20 10c0-4.4-3.6-8-8-8s-8 3.6-8 8 3.6 8 8 8h8",key:"4znkd0"}],["polyline",{points:"16 14 20 18 16 22",key:"11njsm"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const XB=nt("Languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const e3=nt("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const t3=nt("LifeBuoy",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.93 4.93 4.24 4.24",key:"1ymg45"}],["path",{d:"m14.83 9.17 4.24-4.24",key:"1cb5xl"}],["path",{d:"m14.83 14.83 4.24 4.24",key:"q42g0n"}],["path",{d:"m9.17 14.83-4.24 4.24",key:"bqpfvv"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Hi=nt("ListCollapse",[["path",{d:"m3 10 2.5-2.5L3 5",key:"i6eama"}],["path",{d:"m3 19 2.5-2.5L3 14",key:"w2gmor"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const n3=nt("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const dh=nt("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const r3=nt("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const s3=nt("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ki=nt("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const qi=nt("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ws=nt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const rg=nt("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Wi=nt("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const o3=nt("Sparkle",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const a3=nt("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const i3=nt("UsersRound",[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const l3=nt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** - * @license lucide-react v0.408.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const yM=nt("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),ie=Bt.create({timeout:3e4});ie.interceptors.request.use(async e=>{const t=zr(Fn.API_URL);if(t&&(e.baseURL=t.toString()),!e.headers.apiKey||e.headers.apiKey===""){const n=zr(Fn.INSTANCE_TOKEN);n&&(e.headers.apikey=`${n}`)}return e},e=>Promise.reject(e));const Gd=Bt.create({timeout:3e4});Gd.interceptors.request.use(async e=>{const t=zr(Fn.API_URL);if(t&&(e.baseURL=t.toString()),!e.headers.apiKey||e.headers.apiKey===""){const n=zr(Fn.TOKEN);n&&(e.headers.apikey=`${n}`)}return e},e=>Promise.reject(e));const c3=e=>["instance","fetchInstance",JSON.stringify(e)],u3=async({instanceId:e})=>{const t=await Gd.get("/instance/fetchInstances",{params:{instanceId:e}});return Array.isArray(t.data)?t.data[0]:t.data},bM=e=>{const{instanceId:t,...n}=e;return qe({...n,queryKey:c3({instanceId:t}),queryFn:()=>u3({instanceId:t}),enabled:!!t})};function Ce(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function d3(e,t){const n=v.createContext(t);function r(o){const{children:a,...c}=o,u=v.useMemo(()=>c,Object.values(c));return l.jsx(n.Provider,{value:u,children:a})}function s(o){const a=v.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return r.displayName=e+"Provider",[r,s]}function qr(e,t=[]){let n=[];function r(o,a){const c=v.createContext(a),u=n.length;n=[...n,a];function i(p){const{scope:f,children:g,...h}=p,m=(f==null?void 0:f[e][u])||c,x=v.useMemo(()=>h,Object.values(h));return l.jsx(m.Provider,{value:x,children:g})}function d(p,f){const g=(f==null?void 0:f[e][u])||c,h=v.useContext(g);if(h)return h;if(a!==void 0)return a;throw new Error(`\`${p}\` must be used within \`${o}\``)}return i.displayName=o+"Provider",[i,d]}const s=()=>{const o=n.map(a=>v.createContext(a));return function(c){const u=(c==null?void 0:c[e])||o;return v.useMemo(()=>({[`__scope${e}`]:{...c,[e]:u}}),[c,u])}};return s.scopeName=e,[r,f3(s,...t)]}function f3(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const a=r.reduce((c,{useScope:u,scopeName:i})=>{const p=u(o)[`__scope${i}`];return{...c,...p}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function on(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function ya({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,s]=p3({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:r,c=on(n),u=v.useCallback(i=>{if(o){const p=typeof i=="function"?i(e):i;p!==e&&c(p)}else s(i)},[o,e,s,c]);return[a,u]}function p3({defaultProp:e,onChange:t}){const n=v.useState(e),[r]=n,s=v.useRef(r),o=on(t);return v.useEffect(()=>{s.current!==r&&(o(r),s.current=r)},[r,s,o]),n}var g3=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ie=g3.reduce((e,t)=>{const n=v.forwardRef((r,s)=>{const{asChild:o,...a}=r,c=o?wo:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function xM(e,t){e&&Pa.flushSync(()=>e.dispatchEvent(t))}function Ux(e){const t=e+"CollectionProvider",[n,r]=qr(t),[s,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=g=>{const{scope:h,children:m}=g,x=je.useRef(null),b=je.useRef(new Map).current;return l.jsx(s,{scope:h,itemMap:b,collectionRef:x,children:m})};a.displayName=t;const c=e+"CollectionSlot",u=je.forwardRef((g,h)=>{const{scope:m,children:x}=g,b=o(c,m),y=ct(h,b.collectionRef);return l.jsx(wo,{ref:y,children:x})});u.displayName=c;const i=e+"CollectionItemSlot",d="data-radix-collection-item",p=je.forwardRef((g,h)=>{const{scope:m,children:x,...b}=g,y=je.useRef(null),w=ct(h,y),S=o(i,m);return je.useEffect(()=>(S.itemMap.set(y,{ref:y,...b}),()=>void S.itemMap.delete(y))),l.jsx(wo,{[d]:"",ref:w,children:x})});p.displayName=i;function f(g){const h=o(e+"CollectionConsumer",g);return je.useCallback(()=>{const x=h.collectionRef.current;if(!x)return[];const b=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(h.itemMap.values()).sort((S,E)=>b.indexOf(S.ref.current)-b.indexOf(E.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:a,Slot:u,ItemSlot:p},f,r]}var h3=v.createContext(void 0);function Jd(e){const t=v.useContext(h3);return e||t||"ltr"}function m3(e,t=globalThis==null?void 0:globalThis.document){const n=on(e);v.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var v3="DismissableLayer",Jy="dismissableLayer.update",y3="dismissableLayer.pointerDownOutside",b3="dismissableLayer.focusOutside",oC,wM=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),fh=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:c,...u}=e,i=v.useContext(wM),[d,p]=v.useState(null),f=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=v.useState({}),h=ct(t,T=>p(T)),m=Array.from(i.layers),[x]=[...i.layersWithOutsidePointerEventsDisabled].slice(-1),b=m.indexOf(x),y=d?m.indexOf(d):-1,w=i.layersWithOutsidePointerEventsDisabled.size>0,S=y>=b,E=S3(T=>{const j=T.target,_=[...i.branches].some(O=>O.contains(j));!S||_||(s==null||s(T),a==null||a(T),T.defaultPrevented||c==null||c())},f),C=C3(T=>{const j=T.target;[...i.branches].some(O=>O.contains(j))||(o==null||o(T),a==null||a(T),T.defaultPrevented||c==null||c())},f);return m3(T=>{y===i.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&c&&(T.preventDefault(),c()))},f),v.useEffect(()=>{if(d)return n&&(i.layersWithOutsidePointerEventsDisabled.size===0&&(oC=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),i.layersWithOutsidePointerEventsDisabled.add(d)),i.layers.add(d),aC(),()=>{n&&i.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=oC)}},[d,f,n,i]),v.useEffect(()=>()=>{d&&(i.layers.delete(d),i.layersWithOutsidePointerEventsDisabled.delete(d),aC())},[d,i]),v.useEffect(()=>{const T=()=>g({});return document.addEventListener(Jy,T),()=>document.removeEventListener(Jy,T)},[]),l.jsx(Ie.div,{...u,ref:h,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:Ce(e.onFocusCapture,C.onFocusCapture),onBlurCapture:Ce(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Ce(e.onPointerDownCapture,E.onPointerDownCapture)})});fh.displayName=v3;var x3="DismissableLayerBranch",w3=v.forwardRef((e,t)=>{const n=v.useContext(wM),r=v.useRef(null),s=ct(t,r);return v.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),l.jsx(Ie.div,{...e,ref:s})});w3.displayName=x3;function S3(e,t=globalThis==null?void 0:globalThis.document){const n=on(e),r=v.useRef(!1),s=v.useRef(()=>{});return v.useEffect(()=>{const o=c=>{if(c.target&&!r.current){let u=function(){SM(y3,n,i,{discrete:!0})};const i={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=u,t.addEventListener("click",s.current,{once:!0})):u()}else t.removeEventListener("click",s.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function C3(e,t=globalThis==null?void 0:globalThis.document){const n=on(e),r=v.useRef(!1);return v.useEffect(()=>{const s=o=>{o.target&&!r.current&&SM(b3,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function aC(){const e=new CustomEvent(Jy);document.dispatchEvent(e)}function SM(e,t,n,{discrete:r}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?xM(s,o):s.dispatchEvent(o)}var Km=0;function Vx(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??iC()),document.body.insertAdjacentElement("beforeend",e[1]??iC()),Km++,()=>{Km===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Km--}},[])}function iC(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var qm="focusScope.autoFocusOnMount",Wm="focusScope.autoFocusOnUnmount",lC={bubbles:!1,cancelable:!0},E3="FocusScope",ph=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...a}=e,[c,u]=v.useState(null),i=on(s),d=on(o),p=v.useRef(null),f=ct(t,m=>u(m)),g=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let m=function(w){if(g.paused||!c)return;const S=w.target;c.contains(S)?p.current=S:Vo(p.current,{select:!0})},x=function(w){if(g.paused||!c)return;const S=w.relatedTarget;S!==null&&(c.contains(S)||Vo(p.current,{select:!0}))},b=function(w){if(document.activeElement===document.body)for(const E of w)E.removedNodes.length>0&&Vo(c)};document.addEventListener("focusin",m),document.addEventListener("focusout",x);const y=new MutationObserver(b);return c&&y.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",x),y.disconnect()}}},[r,c,g.paused]),v.useEffect(()=>{if(c){uC.add(g);const m=document.activeElement;if(!c.contains(m)){const b=new CustomEvent(qm,lC);c.addEventListener(qm,i),c.dispatchEvent(b),b.defaultPrevented||(k3(_3(CM(c)),{select:!0}),document.activeElement===m&&Vo(c))}return()=>{c.removeEventListener(qm,i),setTimeout(()=>{const b=new CustomEvent(Wm,lC);c.addEventListener(Wm,d),c.dispatchEvent(b),b.defaultPrevented||Vo(m??document.body,{select:!0}),c.removeEventListener(Wm,d),uC.remove(g)},0)}}},[c,i,d,g]);const h=v.useCallback(m=>{if(!n&&!r||g.paused)return;const x=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,b=document.activeElement;if(x&&b){const y=m.currentTarget,[w,S]=j3(y);w&&S?!m.shiftKey&&b===S?(m.preventDefault(),n&&Vo(w,{select:!0})):m.shiftKey&&b===w&&(m.preventDefault(),n&&Vo(S,{select:!0})):b===y&&m.preventDefault()}},[n,r,g.paused]);return l.jsx(Ie.div,{tabIndex:-1,...a,ref:f,onKeyDown:h})});ph.displayName=E3;function k3(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Vo(r,{select:t}),document.activeElement!==n)return}function j3(e){const t=CM(e),n=cC(t,e),r=cC(t.reverse(),e);return[n,r]}function CM(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function cC(e,t){for(const n of e)if(!T3(n,{upTo:t}))return n}function T3(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function M3(e){return e instanceof HTMLInputElement&&"select"in e}function Vo(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&M3(e)&&t&&e.select()}}var uC=N3();function N3(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=dC(e,t),e.unshift(t)},remove(t){var n;e=dC(e,t),(n=e[0])==null||n.resume()}}}function dC(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function _3(e){return e.filter(t=>t.tagName!=="A")}var pn=globalThis!=null&&globalThis.document?v.useLayoutEffect:()=>{},P3=Dg.useId||(()=>{}),R3=0;function is(e){const[t,n]=v.useState(P3());return pn(()=>{n(r=>r??String(R3++))},[e]),t?`radix-${t}`:""}const O3=["top","right","bottom","left"],Ds=Math.min,vr=Math.max,sg=Math.round,Rf=Math.floor,ba=e=>({x:e,y:e}),I3={left:"right",right:"left",bottom:"top",top:"bottom"},D3={start:"end",end:"start"};function Qy(e,t,n){return vr(e,Ds(t,n))}function So(e,t){return typeof e=="function"?e(t):e}function Co(e){return e.split("-")[0]}function Nc(e){return e.split("-")[1]}function Hx(e){return e==="x"?"y":"x"}function Kx(e){return e==="y"?"height":"width"}function xa(e){return["top","bottom"].includes(Co(e))?"y":"x"}function qx(e){return Hx(xa(e))}function A3(e,t,n){n===void 0&&(n=!1);const r=Nc(e),s=qx(e),o=Kx(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=og(a)),[a,og(a)]}function F3(e){const t=og(e);return[Zy(e),t,Zy(t)]}function Zy(e){return e.replace(/start|end/g,t=>D3[t])}function L3(e,t,n){const r=["left","right"],s=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?s:r:t?r:s;case"left":case"right":return t?o:a;default:return[]}}function $3(e,t,n,r){const s=Nc(e);let o=L3(Co(e),n==="start",r);return s&&(o=o.map(a=>a+"-"+s),t&&(o=o.concat(o.map(Zy)))),o}function og(e){return e.replace(/left|right|bottom|top/g,t=>I3[t])}function B3(e){return{top:0,right:0,bottom:0,left:0,...e}}function EM(e){return typeof e!="number"?B3(e):{top:e,right:e,bottom:e,left:e}}function ag(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function fC(e,t,n){let{reference:r,floating:s}=e;const o=xa(t),a=qx(t),c=Kx(a),u=Co(t),i=o==="y",d=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,f=r[c]/2-s[c]/2;let g;switch(u){case"top":g={x:d,y:r.y-s.height};break;case"bottom":g={x:d,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:p};break;case"left":g={x:r.x-s.width,y:p};break;default:g={x:r.x,y:r.y}}switch(Nc(t)){case"start":g[a]-=f*(n&&i?-1:1);break;case"end":g[a]+=f*(n&&i?-1:1);break}return g}const z3=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:a}=n,c=o.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(t));let i=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:d,y:p}=fC(i,r,u),f=r,g={},h=0;for(let m=0;m({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:o,platform:a,elements:c,middlewareData:u}=t,{element:i,padding:d=0}=So(e,t)||{};if(i==null)return{};const p=EM(d),f={x:n,y:r},g=qx(s),h=Kx(g),m=await a.getDimensions(i),x=g==="y",b=x?"top":"left",y=x?"bottom":"right",w=x?"clientHeight":"clientWidth",S=o.reference[h]+o.reference[g]-f[g]-o.floating[h],E=f[g]-o.reference[g],C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(i));let T=C?C[w]:0;(!T||!await(a.isElement==null?void 0:a.isElement(C)))&&(T=c.floating[w]||o.floating[h]);const j=S/2-E/2,_=T/2-m[h]/2-1,O=Ds(p[b],_),K=Ds(p[y],_),I=O,Y=T-m[h]-K,q=T/2-m[h]/2+j,Z=Qy(I,q,Y),ee=!u.arrow&&Nc(s)!=null&&q!==Z&&o.reference[h]/2-(qq<=0)){var K,I;const q=(((K=o.flip)==null?void 0:K.index)||0)+1,Z=T[q];if(Z)return{data:{index:q,overflows:O},reset:{placement:Z}};let ee=(I=O.filter(J=>J.overflows[0]<=0).sort((J,L)=>J.overflows[1]-L.overflows[1])[0])==null?void 0:I.placement;if(!ee)switch(g){case"bestFit":{var Y;const J=(Y=O.filter(L=>{if(C){const A=xa(L.placement);return A===y||A==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(A=>A>0).reduce((A,X)=>A+X,0)]).sort((L,A)=>L[1]-A[1])[0])==null?void 0:Y[0];J&&(ee=J);break}case"initialPlacement":ee=c;break}if(s!==ee)return{reset:{placement:ee}}}return{}}}};function pC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function gC(e){return O3.some(t=>e[t]>=0)}const H3=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=So(e,t);switch(r){case"referenceHidden":{const o=await fd(t,{...s,elementContext:"reference"}),a=pC(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:gC(a)}}}case"escaped":{const o=await fd(t,{...s,altBoundary:!0}),a=pC(o,n.floating);return{data:{escapedOffsets:a,escaped:gC(a)}}}default:return{}}}}};async function K3(e,t){const{placement:n,platform:r,elements:s}=e,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=Co(n),c=Nc(n),u=xa(n)==="y",i=["left","top"].includes(a)?-1:1,d=o&&u?-1:1,p=So(t,e);let{mainAxis:f,crossAxis:g,alignmentAxis:h}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...p};return c&&typeof h=="number"&&(g=c==="end"?h*-1:h),u?{x:g*d,y:f*i}:{x:f*i,y:g*d}}const q3=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:o,placement:a,middlewareData:c}=t,u=await K3(t,e);return a===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:s+u.x,y:o+u.y,data:{...u,placement:a}}}}},W3=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:c={fn:x=>{let{x:b,y}=x;return{x:b,y}}},...u}=So(e,t),i={x:n,y:r},d=await fd(t,u),p=xa(Co(s)),f=Hx(p);let g=i[f],h=i[p];if(o){const x=f==="y"?"top":"left",b=f==="y"?"bottom":"right",y=g+d[x],w=g-d[b];g=Qy(y,g,w)}if(a){const x=p==="y"?"top":"left",b=p==="y"?"bottom":"right",y=h+d[x],w=h-d[b];h=Qy(y,h,w)}const m=c.fn({...t,[f]:g,[p]:h});return{...m,data:{x:m.x-n,y:m.y-r}}}}},G3=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:o,middlewareData:a}=t,{offset:c=0,mainAxis:u=!0,crossAxis:i=!0}=So(e,t),d={x:n,y:r},p=xa(s),f=Hx(p);let g=d[f],h=d[p];const m=So(c,t),x=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(u){const w=f==="y"?"height":"width",S=o.reference[f]-o.floating[w]+x.mainAxis,E=o.reference[f]+o.reference[w]-x.mainAxis;gE&&(g=E)}if(i){var b,y;const w=f==="y"?"width":"height",S=["top","left"].includes(Co(s)),E=o.reference[p]-o.floating[w]+(S&&((b=a.offset)==null?void 0:b[p])||0)+(S?0:x.crossAxis),C=o.reference[p]+o.reference[w]+(S?0:((y=a.offset)==null?void 0:y[p])||0)-(S?x.crossAxis:0);hC&&(h=C)}return{[f]:g,[p]:h}}}},J3=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:s,elements:o}=t,{apply:a=()=>{},...c}=So(e,t),u=await fd(t,c),i=Co(n),d=Nc(n),p=xa(n)==="y",{width:f,height:g}=r.floating;let h,m;i==="top"||i==="bottom"?(h=i,m=d===(await(s.isRTL==null?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(m=i,h=d==="end"?"top":"bottom");const x=g-u.top-u.bottom,b=f-u.left-u.right,y=Ds(g-u[h],x),w=Ds(f-u[m],b),S=!t.middlewareData.shift;let E=y,C=w;if(p?C=d||S?Ds(w,b):b:E=d||S?Ds(y,x):x,S&&!d){const j=vr(u.left,0),_=vr(u.right,0),O=vr(u.top,0),K=vr(u.bottom,0);p?C=f-2*(j!==0||_!==0?j+_:vr(u.left,u.right)):E=g-2*(O!==0||K!==0?O+K:vr(u.top,u.bottom))}await a({...t,availableWidth:C,availableHeight:E});const T=await s.getDimensions(o.floating);return f!==T.width||g!==T.height?{reset:{rects:!0}}:{}}}};function _c(e){return kM(e)?(e.nodeName||"").toLowerCase():"#document"}function wr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Mo(e){var t;return(t=(kM(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function kM(e){return e instanceof Node||e instanceof wr(e).Node}function Us(e){return e instanceof Element||e instanceof wr(e).Element}function Vs(e){return e instanceof HTMLElement||e instanceof wr(e).HTMLElement}function hC(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof wr(e).ShadowRoot}function Qd(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=fs(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(s)}function Q3(e){return["table","td","th"].includes(_c(e))}function gh(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Wx(e){const t=Gx(),n=fs(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Z3(e){let t=wa(e);for(;Vs(t)&&!fc(t);){if(gh(t))return null;if(Wx(t))return t;t=wa(t)}return null}function Gx(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function fc(e){return["html","body","#document"].includes(_c(e))}function fs(e){return wr(e).getComputedStyle(e)}function hh(e){return Us(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function wa(e){if(_c(e)==="html")return e;const t=e.assignedSlot||e.parentNode||hC(e)&&e.host||Mo(e);return hC(t)?t.host:t}function jM(e){const t=wa(e);return fc(t)?e.ownerDocument?e.ownerDocument.body:e.body:Vs(t)&&Qd(t)?t:jM(t)}function pd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=jM(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),a=wr(s);return o?t.concat(a,a.visualViewport||[],Qd(s)?s:[],a.frameElement&&n?pd(a.frameElement):[]):t.concat(s,pd(s,[],n))}function TM(e){const t=fs(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Vs(e),o=s?e.offsetWidth:n,a=s?e.offsetHeight:r,c=sg(n)!==o||sg(r)!==a;return c&&(n=o,r=a),{width:n,height:r,$:c}}function Jx(e){return Us(e)?e:e.contextElement}function Ll(e){const t=Jx(e);if(!Vs(t))return ba(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=TM(t);let a=(o?sg(n.width):n.width)/r,c=(o?sg(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const Y3=ba(0);function MM(e){const t=wr(e);return!Gx()||!t.visualViewport?Y3:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function X3(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==wr(e)?!1:t}function Oi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=Jx(e);let a=ba(1);t&&(r?Us(r)&&(a=Ll(r)):a=Ll(e));const c=X3(o,n,r)?MM(o):ba(0);let u=(s.left+c.x)/a.x,i=(s.top+c.y)/a.y,d=s.width/a.x,p=s.height/a.y;if(o){const f=wr(o),g=r&&Us(r)?wr(r):r;let h=f,m=h.frameElement;for(;m&&r&&g!==h;){const x=Ll(m),b=m.getBoundingClientRect(),y=fs(m),w=b.left+(m.clientLeft+parseFloat(y.paddingLeft))*x.x,S=b.top+(m.clientTop+parseFloat(y.paddingTop))*x.y;u*=x.x,i*=x.y,d*=x.x,p*=x.y,u+=w,i+=S,h=wr(m),m=h.frameElement}}return ag({width:d,height:p,x:u,y:i})}function ez(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",a=Mo(r),c=t?gh(t.floating):!1;if(r===a||c&&o)return n;let u={scrollLeft:0,scrollTop:0},i=ba(1);const d=ba(0),p=Vs(r);if((p||!p&&!o)&&((_c(r)!=="body"||Qd(a))&&(u=hh(r)),Vs(r))){const f=Oi(r);i=Ll(r),d.x=f.x+r.clientLeft,d.y=f.y+r.clientTop}return{width:n.width*i.x,height:n.height*i.y,x:n.x*i.x-u.scrollLeft*i.x+d.x,y:n.y*i.y-u.scrollTop*i.y+d.y}}function tz(e){return Array.from(e.getClientRects())}function NM(e){return Oi(Mo(e)).left+hh(e).scrollLeft}function nz(e){const t=Mo(e),n=hh(e),r=e.ownerDocument.body,s=vr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=vr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+NM(e);const c=-n.scrollTop;return fs(r).direction==="rtl"&&(a+=vr(t.clientWidth,r.clientWidth)-s),{width:s,height:o,x:a,y:c}}function rz(e,t){const n=wr(e),r=Mo(e),s=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,c=0,u=0;if(s){o=s.width,a=s.height;const i=Gx();(!i||i&&t==="fixed")&&(c=s.offsetLeft,u=s.offsetTop)}return{width:o,height:a,x:c,y:u}}function sz(e,t){const n=Oi(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,o=Vs(e)?Ll(e):ba(1),a=e.clientWidth*o.x,c=e.clientHeight*o.y,u=s*o.x,i=r*o.y;return{width:a,height:c,x:u,y:i}}function mC(e,t,n){let r;if(t==="viewport")r=rz(e,n);else if(t==="document")r=nz(Mo(e));else if(Us(t))r=sz(t,n);else{const s=MM(e);r={...t,x:t.x-s.x,y:t.y-s.y}}return ag(r)}function _M(e,t){const n=wa(e);return n===t||!Us(n)||fc(n)?!1:fs(n).position==="fixed"||_M(n,t)}function oz(e,t){const n=t.get(e);if(n)return n;let r=pd(e,[],!1).filter(c=>Us(c)&&_c(c)!=="body"),s=null;const o=fs(e).position==="fixed";let a=o?wa(e):e;for(;Us(a)&&!fc(a);){const c=fs(a),u=Wx(a);!u&&c.position==="fixed"&&(s=null),(o?!u&&!s:!u&&c.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||Qd(a)&&!u&&_M(e,a))?r=r.filter(d=>d!==a):s=c,a=wa(a)}return t.set(e,r),r}function az(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const a=[...n==="clippingAncestors"?gh(t)?[]:oz(t,this._c):[].concat(n),r],c=a[0],u=a.reduce((i,d)=>{const p=mC(t,d,s);return i.top=vr(p.top,i.top),i.right=Ds(p.right,i.right),i.bottom=Ds(p.bottom,i.bottom),i.left=vr(p.left,i.left),i},mC(t,c,s));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function iz(e){const{width:t,height:n}=TM(e);return{width:t,height:n}}function lz(e,t,n){const r=Vs(t),s=Mo(t),o=n==="fixed",a=Oi(e,!0,o,t);let c={scrollLeft:0,scrollTop:0};const u=ba(0);if(r||!r&&!o)if((_c(t)!=="body"||Qd(s))&&(c=hh(t)),r){const p=Oi(t,!0,o,t);u.x=p.x+t.clientLeft,u.y=p.y+t.clientTop}else s&&(u.x=NM(s));const i=a.left+c.scrollLeft-u.x,d=a.top+c.scrollTop-u.y;return{x:i,y:d,width:a.width,height:a.height}}function Gm(e){return fs(e).position==="static"}function vC(e,t){return!Vs(e)||fs(e).position==="fixed"?null:t?t(e):e.offsetParent}function PM(e,t){const n=wr(e);if(gh(e))return n;if(!Vs(e)){let s=wa(e);for(;s&&!fc(s);){if(Us(s)&&!Gm(s))return s;s=wa(s)}return n}let r=vC(e,t);for(;r&&Q3(r)&&Gm(r);)r=vC(r,t);return r&&fc(r)&&Gm(r)&&!Wx(r)?n:r||Z3(e)||n}const cz=async function(e){const t=this.getOffsetParent||PM,n=this.getDimensions,r=await n(e.floating);return{reference:lz(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function uz(e){return fs(e).direction==="rtl"}const dz={convertOffsetParentRelativeRectToViewportRelativeRect:ez,getDocumentElement:Mo,getClippingRect:az,getOffsetParent:PM,getElementRects:cz,getClientRects:tz,getDimensions:iz,getScale:Ll,isElement:Us,isRTL:uz};function fz(e,t){let n=null,r;const s=Mo(e);function o(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function a(c,u){c===void 0&&(c=!1),u===void 0&&(u=1),o();const{left:i,top:d,width:p,height:f}=e.getBoundingClientRect();if(c||t(),!p||!f)return;const g=Rf(d),h=Rf(s.clientWidth-(i+p)),m=Rf(s.clientHeight-(d+f)),x=Rf(i),y={rootMargin:-g+"px "+-h+"px "+-m+"px "+-x+"px",threshold:vr(0,Ds(1,u))||1};let w=!0;function S(E){const C=E[0].intersectionRatio;if(C!==u){if(!w)return a();C?a(!1,C):r=setTimeout(()=>{a(!1,1e-7)},1e3)}w=!1}try{n=new IntersectionObserver(S,{...y,root:s.ownerDocument})}catch{n=new IntersectionObserver(S,y)}n.observe(e)}return a(!0),o}function pz(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,i=Jx(e),d=s||o?[...i?pd(i):[],...pd(t)]:[];d.forEach(b=>{s&&b.addEventListener("scroll",n,{passive:!0}),o&&b.addEventListener("resize",n)});const p=i&&c?fz(i,n):null;let f=-1,g=null;a&&(g=new ResizeObserver(b=>{let[y]=b;y&&y.target===i&&g&&(g.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var w;(w=g)==null||w.observe(t)})),n()}),i&&!u&&g.observe(i),g.observe(t));let h,m=u?Oi(e):null;u&&x();function x(){const b=Oi(e);m&&(b.x!==m.x||b.y!==m.y||b.width!==m.width||b.height!==m.height)&&n(),m=b,h=requestAnimationFrame(x)}return n(),()=>{var b;d.forEach(y=>{s&&y.removeEventListener("scroll",n),o&&y.removeEventListener("resize",n)}),p==null||p(),(b=g)==null||b.disconnect(),g=null,u&&cancelAnimationFrame(h)}}const gz=q3,hz=W3,mz=V3,vz=J3,yz=H3,yC=U3,bz=G3,xz=(e,t,n)=>{const r=new Map,s={platform:dz,...n},o={...s.platform,_c:r};return z3(e,t,{...s,platform:o})};var hp=typeof document<"u"?v.useLayoutEffect:v.useEffect;function ig(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ig(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const o=s[r];if(!(o==="_owner"&&e.$$typeof)&&!ig(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function RM(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function bC(e,t){const n=RM(e);return Math.round(t*n)/n}function xC(e){const t=v.useRef(e);return hp(()=>{t.current=e}),t}function wz(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:o,floating:a}={},transform:c=!0,whileElementsMounted:u,open:i}=e,[d,p]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,g]=v.useState(r);ig(f,r)||g(r);const[h,m]=v.useState(null),[x,b]=v.useState(null),y=v.useCallback(J=>{J!==C.current&&(C.current=J,m(J))},[]),w=v.useCallback(J=>{J!==T.current&&(T.current=J,b(J))},[]),S=o||h,E=a||x,C=v.useRef(null),T=v.useRef(null),j=v.useRef(d),_=u!=null,O=xC(u),K=xC(s),I=v.useCallback(()=>{if(!C.current||!T.current)return;const J={placement:t,strategy:n,middleware:f};K.current&&(J.platform=K.current),xz(C.current,T.current,J).then(L=>{const A={...L,isPositioned:!0};Y.current&&!ig(j.current,A)&&(j.current=A,Pa.flushSync(()=>{p(A)}))})},[f,t,n,K]);hp(()=>{i===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,p(J=>({...J,isPositioned:!1})))},[i]);const Y=v.useRef(!1);hp(()=>(Y.current=!0,()=>{Y.current=!1}),[]),hp(()=>{if(S&&(C.current=S),E&&(T.current=E),S&&E){if(O.current)return O.current(S,E,I);I()}},[S,E,I,O,_]);const q=v.useMemo(()=>({reference:C,floating:T,setReference:y,setFloating:w}),[y,w]),Z=v.useMemo(()=>({reference:S,floating:E}),[S,E]),ee=v.useMemo(()=>{const J={position:n,left:0,top:0};if(!Z.floating)return J;const L=bC(Z.floating,d.x),A=bC(Z.floating,d.y);return c?{...J,transform:"translate("+L+"px, "+A+"px)",...RM(Z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:A}},[n,c,Z.floating,d.x,d.y]);return v.useMemo(()=>({...d,update:I,refs:q,elements:Z,floatingStyles:ee}),[d,I,q,Z,ee])}const Sz=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?yC({element:r.current,padding:s}).fn(n):{}:r?yC({element:r,padding:s}).fn(n):{}}}},Cz=(e,t)=>({...gz(e),options:[e,t]}),Ez=(e,t)=>({...hz(e),options:[e,t]}),kz=(e,t)=>({...bz(e),options:[e,t]}),jz=(e,t)=>({...mz(e),options:[e,t]}),Tz=(e,t)=>({...vz(e),options:[e,t]}),Mz=(e,t)=>({...yz(e),options:[e,t]}),Nz=(e,t)=>({...Sz(e),options:[e,t]});var _z="Arrow",OM=v.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...o}=e;return l.jsx(Ie.svg,{...o,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});OM.displayName=_z;var Pz=OM;function IM(e){const[t,n]=v.useState(void 0);return pn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let a,c;if("borderBoxSize"in o){const u=o.borderBoxSize,i=Array.isArray(u)?u[0]:u;a=i.inlineSize,c=i.blockSize}else a=e.offsetWidth,c=e.offsetHeight;n({width:a,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Qx="Popper",[DM,mh]=qr(Qx),[Rz,AM]=DM(Qx),FM=e=>{const{__scopePopper:t,children:n}=e,[r,s]=v.useState(null);return l.jsx(Rz,{scope:t,anchor:r,onAnchorChange:s,children:n})};FM.displayName=Qx;var LM="PopperAnchor",$M=v.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,o=AM(LM,n),a=v.useRef(null),c=ct(t,a);return v.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:l.jsx(Ie.div,{...s,ref:c})});$M.displayName=LM;var Zx="PopperContent",[Oz,Iz]=DM(Zx),BM=v.forwardRef((e,t)=>{var Q,Ee,Pe,Be,Re,ve;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:i=[],collisionPadding:d=0,sticky:p="partial",hideWhenDetached:f=!1,updatePositionStrategy:g="optimized",onPlaced:h,...m}=e,x=AM(Zx,n),[b,y]=v.useState(null),w=ct(t,ot=>y(ot)),[S,E]=v.useState(null),C=IM(S),T=(C==null?void 0:C.width)??0,j=(C==null?void 0:C.height)??0,_=r+(o!=="center"?"-"+o:""),O=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},K=Array.isArray(i)?i:[i],I=K.length>0,Y={padding:O,boundary:K.filter(Az),altBoundary:I},{refs:q,floatingStyles:Z,placement:ee,isPositioned:J,middlewareData:L}=wz({strategy:"fixed",placement:_,whileElementsMounted:(...ot)=>pz(...ot,{animationFrame:g==="always"}),elements:{reference:x.anchor},middleware:[Cz({mainAxis:s+j,alignmentAxis:a}),u&&Ez({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?kz():void 0,...Y}),u&&jz({...Y}),Tz({...Y,apply:({elements:ot,rects:Vt,availableWidth:tn,availableHeight:Xt})=>{const{width:ln,height:M}=Vt.reference,D=ot.floating.style;D.setProperty("--radix-popper-available-width",`${tn}px`),D.setProperty("--radix-popper-available-height",`${Xt}px`),D.setProperty("--radix-popper-anchor-width",`${ln}px`),D.setProperty("--radix-popper-anchor-height",`${M}px`)}}),S&&Nz({element:S,padding:c}),Fz({arrowWidth:T,arrowHeight:j}),f&&Mz({strategy:"referenceHidden",...Y})]}),[A,X]=VM(ee),fe=on(h);pn(()=>{J&&(fe==null||fe())},[J,fe]);const H=(Q=L.arrow)==null?void 0:Q.x,se=(Ee=L.arrow)==null?void 0:Ee.y,ne=((Pe=L.arrow)==null?void 0:Pe.centerOffset)!==0,[le,oe]=v.useState();return pn(()=>{b&&oe(window.getComputedStyle(b).zIndex)},[b]),l.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:J?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:le,"--radix-popper-transform-origin":[(Be=L.transformOrigin)==null?void 0:Be.x,(Re=L.transformOrigin)==null?void 0:Re.y].join(" "),...((ve=L.hide)==null?void 0:ve.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(Oz,{scope:n,placedSide:A,onArrowChange:E,arrowX:H,arrowY:se,shouldHideArrow:ne,children:l.jsx(Ie.div,{"data-side":A,"data-align":X,...m,ref:w,style:{...m.style,animation:J?void 0:"none"}})})})});BM.displayName=Zx;var zM="PopperArrow",Dz={top:"bottom",right:"left",bottom:"top",left:"right"},UM=v.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,o=Iz(zM,r),a=Dz[o.placedSide];return l.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:l.jsx(Pz,{...s,ref:n,style:{...s.style,display:"block"}})})});UM.displayName=zM;function Az(e){return e!==null}var Fz=e=>({name:"transformOrigin",options:e,fn(t){var x,b,y;const{placement:n,rects:r,middlewareData:s}=t,a=((x=s.arrow)==null?void 0:x.centerOffset)!==0,c=a?0:e.arrowWidth,u=a?0:e.arrowHeight,[i,d]=VM(n),p={start:"0%",center:"50%",end:"100%"}[d],f=(((b=s.arrow)==null?void 0:b.x)??0)+c/2,g=(((y=s.arrow)==null?void 0:y.y)??0)+u/2;let h="",m="";return i==="bottom"?(h=a?p:`${f}px`,m=`${-u}px`):i==="top"?(h=a?p:`${f}px`,m=`${r.floating.height+u}px`):i==="right"?(h=`${-u}px`,m=a?p:`${g}px`):i==="left"&&(h=`${r.floating.width+u}px`,m=a?p:`${g}px`),{data:{x:h,y:m}}}});function VM(e){const[t,n="center"]=e.split("-");return[t,n]}var HM=FM,KM=$M,qM=BM,WM=UM,Lz="Portal",vh=v.forwardRef((e,t)=>{var c;const{container:n,...r}=e,[s,o]=v.useState(!1);pn(()=>o(!0),[]);const a=n||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return a?lT.createPortal(l.jsx(Ie.div,{...r,ref:t}),a):null});vh.displayName=Lz;function $z(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var cr=e=>{const{present:t,children:n}=e,r=Bz(t),s=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=ct(r.ref,zz(s));return typeof n=="function"||r.isPresent?v.cloneElement(s,{ref:o}):null};cr.displayName="Presence";function Bz(e){const[t,n]=v.useState(),r=v.useRef({}),s=v.useRef(e),o=v.useRef("none"),a=e?"mounted":"unmounted",[c,u]=$z(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const i=Of(r.current);o.current=c==="mounted"?i:"none"},[c]),pn(()=>{const i=r.current,d=s.current;if(d!==e){const f=o.current,g=Of(i);e?u("MOUNT"):g==="none"||(i==null?void 0:i.display)==="none"?u("UNMOUNT"):u(d&&f!==g?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,u]),pn(()=>{if(t){const i=p=>{const g=Of(r.current).includes(p.animationName);p.target===t&&g&&Pa.flushSync(()=>u("ANIMATION_END"))},d=p=>{p.target===t&&(o.current=Of(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",i),t.addEventListener("animationend",i),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",i),t.removeEventListener("animationend",i)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:v.useCallback(i=>{i&&(r.current=getComputedStyle(i)),n(i)},[])}}function Of(e){return(e==null?void 0:e.animationName)||"none"}function zz(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Jm="rovingFocusGroup.onEntryFocus",Uz={bubbles:!1,cancelable:!0},yh="RovingFocusGroup",[Yy,GM,Vz]=Ux(yh),[Hz,bh]=qr(yh,[Vz]),[Kz,qz]=Hz(yh),JM=v.forwardRef((e,t)=>l.jsx(Yy.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Yy.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Wz,{...e,ref:t})})}));JM.displayName=yh;var Wz=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:i,preventScrollOnEntryFocus:d=!1,...p}=e,f=v.useRef(null),g=ct(t,f),h=Jd(o),[m=null,x]=ya({prop:a,defaultProp:c,onChange:u}),[b,y]=v.useState(!1),w=on(i),S=GM(n),E=v.useRef(!1),[C,T]=v.useState(0);return v.useEffect(()=>{const j=f.current;if(j)return j.addEventListener(Jm,w),()=>j.removeEventListener(Jm,w)},[w]),l.jsx(Kz,{scope:n,orientation:r,dir:h,loop:s,currentTabStopId:m,onItemFocus:v.useCallback(j=>x(j),[x]),onItemShiftTab:v.useCallback(()=>y(!0),[]),onFocusableItemAdd:v.useCallback(()=>T(j=>j+1),[]),onFocusableItemRemove:v.useCallback(()=>T(j=>j-1),[]),children:l.jsx(Ie.div,{tabIndex:b||C===0?-1:0,"data-orientation":r,...p,ref:g,style:{outline:"none",...e.style},onMouseDown:Ce(e.onMouseDown,()=>{E.current=!0}),onFocus:Ce(e.onFocus,j=>{const _=!E.current;if(j.target===j.currentTarget&&_&&!b){const O=new CustomEvent(Jm,Uz);if(j.currentTarget.dispatchEvent(O),!O.defaultPrevented){const K=S().filter(ee=>ee.focusable),I=K.find(ee=>ee.active),Y=K.find(ee=>ee.id===m),Z=[I,Y,...K].filter(Boolean).map(ee=>ee.ref.current);YM(Z,d)}}E.current=!1}),onBlur:Ce(e.onBlur,()=>y(!1))})})}),QM="RovingFocusGroupItem",ZM=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:o,...a}=e,c=is(),u=o||c,i=qz(QM,n),d=i.currentTabStopId===u,p=GM(n),{onFocusableItemAdd:f,onFocusableItemRemove:g}=i;return v.useEffect(()=>{if(r)return f(),()=>g()},[r,f,g]),l.jsx(Yy.ItemSlot,{scope:n,id:u,focusable:r,active:s,children:l.jsx(Ie.span,{tabIndex:d?0:-1,"data-orientation":i.orientation,...a,ref:t,onMouseDown:Ce(e.onMouseDown,h=>{r?i.onItemFocus(u):h.preventDefault()}),onFocus:Ce(e.onFocus,()=>i.onItemFocus(u)),onKeyDown:Ce(e.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){i.onItemShiftTab();return}if(h.target!==h.currentTarget)return;const m=Qz(h,i.orientation,i.dir);if(m!==void 0){if(h.metaKey||h.ctrlKey||h.altKey||h.shiftKey)return;h.preventDefault();let b=p().filter(y=>y.focusable).map(y=>y.ref.current);if(m==="last")b.reverse();else if(m==="prev"||m==="next"){m==="prev"&&b.reverse();const y=b.indexOf(h.currentTarget);b=i.loop?Zz(b,y+1):b.slice(y+1)}setTimeout(()=>YM(b))}})})})});ZM.displayName=QM;var Gz={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Jz(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Qz(e,t,n){const r=Jz(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Gz[r]}function YM(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Zz(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var XM=JM,eN=ZM,Yz=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},rl=new WeakMap,If=new WeakMap,Df={},Qm=0,tN=function(e){return e&&(e.host||tN(e.parentNode))},Xz=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=tN(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},eU=function(e,t,n,r){var s=Xz(t,Array.isArray(e)?e:[e]);Df[n]||(Df[n]=new WeakMap);var o=Df[n],a=[],c=new Set,u=new Set(s),i=function(p){!p||c.has(p)||(c.add(p),i(p.parentNode))};s.forEach(i);var d=function(p){!p||u.has(p)||Array.prototype.forEach.call(p.children,function(f){if(c.has(f))d(f);else try{var g=f.getAttribute(r),h=g!==null&&g!=="false",m=(rl.get(f)||0)+1,x=(o.get(f)||0)+1;rl.set(f,m),o.set(f,x),a.push(f),m===1&&h&&If.set(f,!0),x===1&&f.setAttribute(n,"true"),h||f.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",f,b)}})};return d(t),c.clear(),Qm++,function(){a.forEach(function(p){var f=rl.get(p)-1,g=o.get(p)-1;rl.set(p,f),o.set(p,g),f||(If.has(p)||p.removeAttribute(r),If.delete(p)),g||p.removeAttribute(n)}),Qm--,Qm||(rl=new WeakMap,rl=new WeakMap,If=new WeakMap,Df={})}},Yx=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=Yz(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),eU(r,s,n,"aria-hidden")):function(){return null}},Ps=function(){return Ps=Object.assign||function(t){for(var n,r=1,s=arguments.length;r"u")return vU;var t=yU(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},xU=oN(),$l="data-scroll-locked",wU=function(e,t,n,r){var s=e.left,o=e.top,a=e.right,c=e.gap;return n===void 0&&(n="margin"),` - .`.concat(nU,` { - overflow: hidden `).concat(r,`; - padding-right: `).concat(c,"px ").concat(r,`; - } - body[`).concat($l,`] { - overflow: hidden `).concat(r,`; - overscroll-behavior: contain; - `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` - padding-left: `.concat(s,`px; - padding-top: `).concat(o,`px; - padding-right: `).concat(a,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(c,"px ").concat(r,`; - `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),` - } - - .`).concat(mp,` { - right: `).concat(c,"px ").concat(r,`; - } - - .`).concat(vp,` { - margin-right: `).concat(c,"px ").concat(r,`; - } - - .`).concat(mp," .").concat(mp,` { - right: 0 `).concat(r,`; - } - - .`).concat(vp," .").concat(vp,` { - margin-right: 0 `).concat(r,`; - } - - body[`).concat($l,`] { - `).concat(rU,": ").concat(c,`px; - } -`)},SC=function(){var e=parseInt(document.body.getAttribute($l)||"0",10);return isFinite(e)?e:0},SU=function(){v.useEffect(function(){return document.body.setAttribute($l,(SC()+1).toString()),function(){var e=SC()-1;e<=0?document.body.removeAttribute($l):document.body.setAttribute($l,e.toString())}},[])},CU=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;SU();var o=v.useMemo(function(){return bU(s)},[s]);return v.createElement(xU,{styles:wU(o,!t,s,n?"":"!important")})},Xy=!1;if(typeof window<"u")try{var Af=Object.defineProperty({},"passive",{get:function(){return Xy=!0,!0}});window.addEventListener("test",Af,Af),window.removeEventListener("test",Af,Af)}catch{Xy=!1}var sl=Xy?{passive:!1}:!1,EU=function(e){return e.tagName==="TEXTAREA"},aN=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!EU(e)&&n[t]==="visible")},kU=function(e){return aN(e,"overflowY")},jU=function(e){return aN(e,"overflowX")},CC=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=iN(e,r);if(s){var o=lN(e,r),a=o[1],c=o[2];if(a>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},TU=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},MU=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},iN=function(e,t){return e==="v"?kU(t):jU(t)},lN=function(e,t){return e==="v"?TU(t):MU(t)},NU=function(e,t){return e==="h"&&t==="rtl"?-1:1},_U=function(e,t,n,r,s){var o=NU(e,window.getComputedStyle(t).direction),a=o*r,c=n.target,u=t.contains(c),i=!1,d=a>0,p=0,f=0;do{var g=lN(e,c),h=g[0],m=g[1],x=g[2],b=m-x-o*h;(h||b)&&iN(e,c)&&(p+=b,f+=h),c instanceof ShadowRoot?c=c.host:c=c.parentNode}while(!u&&c!==document.body||u&&(t.contains(c)||t===c));return(d&&(Math.abs(p)<1||!s)||!d&&(Math.abs(f)<1||!s))&&(i=!0),i},Ff=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},EC=function(e){return[e.deltaX,e.deltaY]},kC=function(e){return e&&"current"in e?e.current:e},PU=function(e,t){return e[0]===t[0]&&e[1]===t[1]},RU=function(e){return` - .block-interactivity-`.concat(e,` {pointer-events: none;} - .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},OU=0,ol=[];function IU(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),s=v.useState(OU++)[0],o=v.useState(oN)[0],a=v.useRef(e);v.useEffect(function(){a.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var m=tU([e.lockRef.current],(e.shards||[]).map(kC),!0).filter(Boolean);return m.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),m.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var c=v.useCallback(function(m,x){if("touches"in m&&m.touches.length===2)return!a.current.allowPinchZoom;var b=Ff(m),y=n.current,w="deltaX"in m?m.deltaX:y[0]-b[0],S="deltaY"in m?m.deltaY:y[1]-b[1],E,C=m.target,T=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in m&&T==="h"&&C.type==="range")return!1;var j=CC(T,C);if(!j)return!0;if(j?E=T:(E=T==="v"?"h":"v",j=CC(T,C)),!j)return!1;if(!r.current&&"changedTouches"in m&&(w||S)&&(r.current=E),!E)return!0;var _=r.current||E;return _U(_,x,m,_==="h"?w:S,!0)},[]),u=v.useCallback(function(m){var x=m;if(!(!ol.length||ol[ol.length-1]!==o)){var b="deltaY"in x?EC(x):Ff(x),y=t.current.filter(function(E){return E.name===x.type&&(E.target===x.target||x.target===E.shadowParent)&&PU(E.delta,b)})[0];if(y&&y.should){x.cancelable&&x.preventDefault();return}if(!y){var w=(a.current.shards||[]).map(kC).filter(Boolean).filter(function(E){return E.contains(x.target)}),S=w.length>0?c(x,w[0]):!a.current.noIsolation;S&&x.cancelable&&x.preventDefault()}}},[]),i=v.useCallback(function(m,x,b,y){var w={name:m,delta:x,target:b,should:y,shadowParent:DU(b)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),d=v.useCallback(function(m){n.current=Ff(m),r.current=void 0},[]),p=v.useCallback(function(m){i(m.type,EC(m),m.target,c(m,e.lockRef.current))},[]),f=v.useCallback(function(m){i(m.type,Ff(m),m.target,c(m,e.lockRef.current))},[]);v.useEffect(function(){return ol.push(o),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:f}),document.addEventListener("wheel",u,sl),document.addEventListener("touchmove",u,sl),document.addEventListener("touchstart",d,sl),function(){ol=ol.filter(function(m){return m!==o}),document.removeEventListener("wheel",u,sl),document.removeEventListener("touchmove",u,sl),document.removeEventListener("touchstart",d,sl)}},[]);var g=e.removeScrollBar,h=e.inert;return v.createElement(v.Fragment,null,h?v.createElement(o,{styles:RU(s)}):null,g?v.createElement(CU,{gapMode:e.gapMode}):null)}function DU(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const AU=uU(sN,IU);var wh=v.forwardRef(function(e,t){return v.createElement(xh,Ps({},e,{ref:t,sideCar:AU}))});wh.classNames=xh.classNames;var eb=["Enter"," "],FU=["ArrowDown","PageUp","Home"],cN=["ArrowUp","PageDown","End"],LU=[...FU,...cN],$U={ltr:[...eb,"ArrowRight"],rtl:[...eb,"ArrowLeft"]},BU={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Zd="Menu",[gd,zU,UU]=Ux(Zd),[Gi,uN]=qr(Zd,[UU,mh,bh]),Sh=mh(),dN=bh(),[VU,Ji]=Gi(Zd),[HU,Yd]=Gi(Zd),fN=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:o,modal:a=!0}=e,c=Sh(t),[u,i]=v.useState(null),d=v.useRef(!1),p=on(o),f=Jd(s);return v.useEffect(()=>{const g=()=>{d.current=!0,document.addEventListener("pointerdown",h,{capture:!0,once:!0}),document.addEventListener("pointermove",h,{capture:!0,once:!0})},h=()=>d.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",h,{capture:!0}),document.removeEventListener("pointermove",h,{capture:!0})}},[]),l.jsx(HM,{...c,children:l.jsx(VU,{scope:t,open:n,onOpenChange:p,content:u,onContentChange:i,children:l.jsx(HU,{scope:t,onClose:v.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:d,dir:f,modal:a,children:r})})})};fN.displayName=Zd;var KU="MenuAnchor",Xx=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Sh(n);return l.jsx(KM,{...s,...r,ref:t})});Xx.displayName=KU;var ew="MenuPortal",[qU,pN]=Gi(ew,{forceMount:void 0}),gN=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,o=Ji(ew,t);return l.jsx(qU,{scope:t,forceMount:n,children:l.jsx(cr,{present:n||o.open,children:l.jsx(vh,{asChild:!0,container:s,children:r})})})};gN.displayName=ew;var Vr="MenuContent",[WU,tw]=Gi(Vr),hN=v.forwardRef((e,t)=>{const n=pN(Vr,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=Ji(Vr,e.__scopeMenu),a=Yd(Vr,e.__scopeMenu);return l.jsx(gd.Provider,{scope:e.__scopeMenu,children:l.jsx(cr,{present:r||o.open,children:l.jsx(gd.Slot,{scope:e.__scopeMenu,children:a.modal?l.jsx(GU,{...s,ref:t}):l.jsx(JU,{...s,ref:t})})})})}),GU=v.forwardRef((e,t)=>{const n=Ji(Vr,e.__scopeMenu),r=v.useRef(null),s=ct(t,r);return v.useEffect(()=>{const o=r.current;if(o)return Yx(o)},[]),l.jsx(nw,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ce(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),JU=v.forwardRef((e,t)=>{const n=Ji(Vr,e.__scopeMenu);return l.jsx(nw,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),nw=v.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:i,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:f,onDismiss:g,disableOutsideScroll:h,...m}=e,x=Ji(Vr,n),b=Yd(Vr,n),y=Sh(n),w=dN(n),S=zU(n),[E,C]=v.useState(null),T=v.useRef(null),j=ct(t,T,x.onContentChange),_=v.useRef(0),O=v.useRef(""),K=v.useRef(0),I=v.useRef(null),Y=v.useRef("right"),q=v.useRef(0),Z=h?wh:v.Fragment,ee=h?{as:wo,allowPinchZoom:!0}:void 0,J=A=>{var Q,Ee;const X=O.current+A,fe=S().filter(Pe=>!Pe.disabled),H=document.activeElement,se=(Q=fe.find(Pe=>Pe.ref.current===H))==null?void 0:Q.textValue,ne=fe.map(Pe=>Pe.textValue),le=i5(ne,X,se),oe=(Ee=fe.find(Pe=>Pe.textValue===le))==null?void 0:Ee.ref.current;(function Pe(Be){O.current=Be,window.clearTimeout(_.current),Be!==""&&(_.current=window.setTimeout(()=>Pe(""),1e3))})(X),oe&&setTimeout(()=>oe.focus())};v.useEffect(()=>()=>window.clearTimeout(_.current),[]),Vx();const L=v.useCallback(A=>{var fe,H;return Y.current===((fe=I.current)==null?void 0:fe.side)&&c5(A,(H=I.current)==null?void 0:H.area)},[]);return l.jsx(WU,{scope:n,searchRef:O,onItemEnter:v.useCallback(A=>{L(A)&&A.preventDefault()},[L]),onItemLeave:v.useCallback(A=>{var X;L(A)||((X=T.current)==null||X.focus(),C(null))},[L]),onTriggerLeave:v.useCallback(A=>{L(A)&&A.preventDefault()},[L]),pointerGraceTimerRef:K,onPointerGraceIntentChange:v.useCallback(A=>{I.current=A},[]),children:l.jsx(Z,{...ee,children:l.jsx(ph,{asChild:!0,trapped:s,onMountAutoFocus:Ce(o,A=>{var X;A.preventDefault(),(X=T.current)==null||X.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:l.jsx(fh,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:i,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:f,onDismiss:g,children:l.jsx(XM,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:C,onEntryFocus:Ce(u,A=>{b.isUsingKeyboardRef.current||A.preventDefault()}),preventScrollOnEntryFocus:!0,children:l.jsx(qM,{role:"menu","aria-orientation":"vertical","data-state":PN(x.open),"data-radix-menu-content":"",dir:b.dir,...y,...m,ref:j,style:{outline:"none",...m.style},onKeyDown:Ce(m.onKeyDown,A=>{const fe=A.target.closest("[data-radix-menu-content]")===A.currentTarget,H=A.ctrlKey||A.altKey||A.metaKey,se=A.key.length===1;fe&&(A.key==="Tab"&&A.preventDefault(),!H&&se&&J(A.key));const ne=T.current;if(A.target!==ne||!LU.includes(A.key))return;A.preventDefault();const oe=S().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);cN.includes(A.key)&&oe.reverse(),o5(oe)}),onBlur:Ce(e.onBlur,A=>{A.currentTarget.contains(A.target)||(window.clearTimeout(_.current),O.current="")}),onPointerMove:Ce(e.onPointerMove,hd(A=>{const X=A.target,fe=q.current!==A.clientX;if(A.currentTarget.contains(X)&&fe){const H=A.clientX>q.current?"right":"left";Y.current=H,q.current=A.clientX}}))})})})})})})});hN.displayName=Vr;var QU="MenuGroup",rw=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(Ie.div,{role:"group",...r,ref:t})});rw.displayName=QU;var ZU="MenuLabel",mN=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(Ie.div,{...r,ref:t})});mN.displayName=ZU;var lg="MenuItem",jC="menu.itemSelect",Ch=v.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,o=v.useRef(null),a=Yd(lg,e.__scopeMenu),c=tw(lg,e.__scopeMenu),u=ct(t,o),i=v.useRef(!1),d=()=>{const p=o.current;if(!n&&p){const f=new CustomEvent(jC,{bubbles:!0,cancelable:!0});p.addEventListener(jC,g=>r==null?void 0:r(g),{once:!0}),xM(p,f),f.defaultPrevented?i.current=!1:a.onClose()}};return l.jsx(vN,{...s,ref:u,disabled:n,onClick:Ce(e.onClick,d),onPointerDown:p=>{var f;(f=e.onPointerDown)==null||f.call(e,p),i.current=!0},onPointerUp:Ce(e.onPointerUp,p=>{var f;i.current||(f=p.currentTarget)==null||f.click()}),onKeyDown:Ce(e.onKeyDown,p=>{const f=c.searchRef.current!=="";n||f&&p.key===" "||eb.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});Ch.displayName=lg;var vN=v.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...o}=e,a=tw(lg,n),c=dN(n),u=v.useRef(null),i=ct(t,u),[d,p]=v.useState(!1),[f,g]=v.useState("");return v.useEffect(()=>{const h=u.current;h&&g((h.textContent??"").trim())},[o.children]),l.jsx(gd.ItemSlot,{scope:n,disabled:r,textValue:s??f,children:l.jsx(eN,{asChild:!0,...c,focusable:!r,children:l.jsx(Ie.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:i,onPointerMove:Ce(e.onPointerMove,hd(h=>{r?a.onItemLeave(h):(a.onItemEnter(h),h.defaultPrevented||h.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ce(e.onPointerLeave,hd(h=>a.onItemLeave(h))),onFocus:Ce(e.onFocus,()=>p(!0)),onBlur:Ce(e.onBlur,()=>p(!1))})})})}),YU="MenuCheckboxItem",yN=v.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return l.jsx(CN,{scope:e.__scopeMenu,checked:n,children:l.jsx(Ch,{role:"menuitemcheckbox","aria-checked":cg(n)?"mixed":n,...s,ref:t,"data-state":ow(n),onSelect:Ce(s.onSelect,()=>r==null?void 0:r(cg(n)?!0:!n),{checkForDefaultPrevented:!1})})})});yN.displayName=YU;var bN="MenuRadioGroup",[XU,e5]=Gi(bN,{value:void 0,onValueChange:()=>{}}),xN=v.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,o=on(r);return l.jsx(XU,{scope:e.__scopeMenu,value:n,onValueChange:o,children:l.jsx(rw,{...s,ref:t})})});xN.displayName=bN;var wN="MenuRadioItem",SN=v.forwardRef((e,t)=>{const{value:n,...r}=e,s=e5(wN,e.__scopeMenu),o=n===s.value;return l.jsx(CN,{scope:e.__scopeMenu,checked:o,children:l.jsx(Ch,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":ow(o),onSelect:Ce(r.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,n)},{checkForDefaultPrevented:!1})})})});SN.displayName=wN;var sw="MenuItemIndicator",[CN,t5]=Gi(sw,{checked:!1}),EN=v.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,o=t5(sw,n);return l.jsx(cr,{present:r||cg(o.checked)||o.checked===!0,children:l.jsx(Ie.span,{...s,ref:t,"data-state":ow(o.checked)})})});EN.displayName=sw;var n5="MenuSeparator",kN=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(Ie.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});kN.displayName=n5;var r5="MenuArrow",jN=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Sh(n);return l.jsx(WM,{...s,...r,ref:t})});jN.displayName=r5;var s5="MenuSub",[Xoe,TN]=Gi(s5),vu="MenuSubTrigger",MN=v.forwardRef((e,t)=>{const n=Ji(vu,e.__scopeMenu),r=Yd(vu,e.__scopeMenu),s=TN(vu,e.__scopeMenu),o=tw(vu,e.__scopeMenu),a=v.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=o,i={__scopeMenu:e.__scopeMenu},d=v.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return v.useEffect(()=>d,[d]),v.useEffect(()=>{const p=c.current;return()=>{window.clearTimeout(p),u(null)}},[c,u]),l.jsx(Xx,{asChild:!0,...i,children:l.jsx(vN,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":PN(n.open),...e,ref:lh(t,s.onTriggerChange),onClick:p=>{var f;(f=e.onClick)==null||f.call(e,p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ce(e.onPointerMove,hd(p=>{o.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:Ce(e.onPointerLeave,hd(p=>{var g,h;d();const f=(g=n.content)==null?void 0:g.getBoundingClientRect();if(f){const m=(h=n.content)==null?void 0:h.dataset.side,x=m==="right",b=x?-5:5,y=f[x?"left":"right"],w=f[x?"right":"left"];o.onPointerGraceIntentChange({area:[{x:p.clientX+b,y:p.clientY},{x:y,y:f.top},{x:w,y:f.top},{x:w,y:f.bottom},{x:y,y:f.bottom}],side:m}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(p),p.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Ce(e.onKeyDown,p=>{var g;const f=o.searchRef.current!=="";e.disabled||f&&p.key===" "||$U[r.dir].includes(p.key)&&(n.onOpenChange(!0),(g=n.content)==null||g.focus(),p.preventDefault())})})})});MN.displayName=vu;var NN="MenuSubContent",_N=v.forwardRef((e,t)=>{const n=pN(Vr,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=Ji(Vr,e.__scopeMenu),a=Yd(Vr,e.__scopeMenu),c=TN(NN,e.__scopeMenu),u=v.useRef(null),i=ct(t,u);return l.jsx(gd.Provider,{scope:e.__scopeMenu,children:l.jsx(cr,{present:r||o.open,children:l.jsx(gd.Slot,{scope:e.__scopeMenu,children:l.jsx(nw,{id:c.contentId,"aria-labelledby":c.triggerId,...s,ref:i,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var p;a.isUsingKeyboardRef.current&&((p=u.current)==null||p.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:Ce(e.onFocusOutside,d=>{d.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Ce(e.onEscapeKeyDown,d=>{a.onClose(),d.preventDefault()}),onKeyDown:Ce(e.onKeyDown,d=>{var g;const p=d.currentTarget.contains(d.target),f=BU[a.dir].includes(d.key);p&&f&&(o.onOpenChange(!1),(g=c.trigger)==null||g.focus(),d.preventDefault())})})})})})});_N.displayName=NN;function PN(e){return e?"open":"closed"}function cg(e){return e==="indeterminate"}function ow(e){return cg(e)?"indeterminate":e?"checked":"unchecked"}function o5(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function a5(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function i5(e,t,n){const s=t.length>1&&Array.from(t).every(i=>i===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=a5(e,Math.max(o,0));s.length===1&&(a=a.filter(i=>i!==n));const u=a.find(i=>i.toLowerCase().startsWith(s.toLowerCase()));return u!==n?u:void 0}function l5(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,a=t.length-1;or!=d>r&&n<(i-c)*(r-u)/(d-u)+c&&(s=!s)}return s}function c5(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return l5(n,t)}function hd(e){return t=>t.pointerType==="mouse"?e(t):void 0}var u5=fN,d5=Xx,f5=gN,p5=hN,g5=rw,h5=mN,m5=Ch,v5=yN,y5=xN,b5=SN,x5=EN,w5=kN,S5=jN,C5=MN,E5=_N,aw="DropdownMenu",[k5,eae]=qr(aw,[uN]),Yn=uN(),[j5,RN]=k5(aw),iw=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:o,onOpenChange:a,modal:c=!0}=e,u=Yn(t),i=v.useRef(null),[d=!1,p]=ya({prop:s,defaultProp:o,onChange:a});return l.jsx(j5,{scope:t,triggerId:is(),triggerRef:i,contentId:is(),open:d,onOpenChange:p,onOpenToggle:v.useCallback(()=>p(f=>!f),[p]),modal:c,children:l.jsx(u5,{...u,open:d,onOpenChange:p,dir:r,modal:c,children:n})})};iw.displayName=aw;var ON="DropdownMenuTrigger",lw=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,o=RN(ON,n),a=Yn(n);return l.jsx(d5,{asChild:!0,...a,children:l.jsx(Ie.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:lh(t,o.triggerRef),onPointerDown:Ce(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(o.onOpenToggle(),o.open||c.preventDefault())}),onKeyDown:Ce(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&o.onOpenToggle(),c.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});lw.displayName=ON;var T5="DropdownMenuPortal",IN=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Yn(t);return l.jsx(f5,{...r,...n})};IN.displayName=T5;var DN="DropdownMenuContent",AN=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=RN(DN,n),o=Yn(n),a=v.useRef(!1);return l.jsx(p5,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...r,ref:t,onCloseAutoFocus:Ce(e.onCloseAutoFocus,c=>{var u;a.current||(u=s.triggerRef.current)==null||u.focus(),a.current=!1,c.preventDefault()}),onInteractOutside:Ce(e.onInteractOutside,c=>{const u=c.detail.originalEvent,i=u.button===0&&u.ctrlKey===!0,d=u.button===2||i;(!s.modal||d)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});AN.displayName=DN;var M5="DropdownMenuGroup",N5=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Yn(n);return l.jsx(g5,{...s,...r,ref:t})});N5.displayName=M5;var _5="DropdownMenuLabel",FN=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Yn(n);return l.jsx(h5,{...s,...r,ref:t})});FN.displayName=_5;var P5="DropdownMenuItem",LN=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Yn(n);return l.jsx(m5,{...s,...r,ref:t})});LN.displayName=P5;var R5="DropdownMenuCheckboxItem",$N=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Yn(n);return l.jsx(v5,{...s,...r,ref:t})});$N.displayName=R5;var O5="DropdownMenuRadioGroup",I5=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Yn(n);return l.jsx(y5,{...s,...r,ref:t})});I5.displayName=O5;var D5="DropdownMenuRadioItem",BN=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Yn(n);return l.jsx(b5,{...s,...r,ref:t})});BN.displayName=D5;var A5="DropdownMenuItemIndicator",zN=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Yn(n);return l.jsx(x5,{...s,...r,ref:t})});zN.displayName=A5;var F5="DropdownMenuSeparator",UN=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Yn(n);return l.jsx(w5,{...s,...r,ref:t})});UN.displayName=F5;var L5="DropdownMenuArrow",$5=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Yn(n);return l.jsx(S5,{...s,...r,ref:t})});$5.displayName=L5;var B5="DropdownMenuSubTrigger",VN=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Yn(n);return l.jsx(C5,{...s,...r,ref:t})});VN.displayName=B5;var z5="DropdownMenuSubContent",HN=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Yn(n);return l.jsx(E5,{...s,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});HN.displayName=z5;var U5=iw,V5=lw,H5=IN,KN=AN,qN=FN,WN=LN,GN=$N,JN=BN,QN=zN,Da=UN,ZN=VN,YN=HN;const ms=U5,vs=V5,K5=v.forwardRef(({className:e,inset:t,children:n,...r},s)=>l.jsxs(ZN,{ref:s,className:me("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,l.jsx(zB,{className:"ml-auto h-4 w-4"})]}));K5.displayName=ZN.displayName;const q5=v.forwardRef(({className:e,...t},n)=>l.jsx(YN,{ref:n,className:me("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));q5.displayName=YN.displayName;const Mr=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>l.jsx(H5,{children:l.jsx(KN,{ref:r,sideOffset:t,className:me("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Mr.displayName=KN.displayName;const tt=v.forwardRef(({className:e,inset:t,...n},r)=>l.jsx(WN,{ref:r,className:me("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));tt.displayName=WN.displayName;const XN=v.forwardRef(({className:e,children:t,checked:n,...r},s)=>l.jsxs(GN,{ref:s,className:me("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(QN,{children:l.jsx(mM,{className:"h-4 w-4"})})}),t]}));XN.displayName=GN.displayName;const W5=v.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(JN,{ref:r,className:me("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(QN,{children:l.jsx(KB,{className:"h-2 w-2 fill-current"})})}),t]}));W5.displayName=JN.displayName;const No=v.forwardRef(({className:e,inset:t,...n},r)=>l.jsx(qN,{ref:r,className:me("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));No.displayName=qN.displayName;const Gs=v.forwardRef(({className:e,...t},n)=>l.jsx(Da,{ref:n,className:me("-mx-1 my-1 h-px bg-muted",e),...t}));Gs.displayName=Da.displayName;function G5(){const{t:e,i18n:t}=Te(),n=r=>{t.changeLanguage(r),localStorage.setItem("i18nextLng",r),window.location.reload()};return l.jsxs(ms,{children:[l.jsx(vs,{asChild:!0,children:l.jsxs(z,{variant:"outline",size:"icon",children:[l.jsx(XB,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all"}),l.jsx("span",{className:"sr-only",children:e("header.theme.label")})]})}),l.jsxs(Mr,{align:"end",children:[l.jsx(tt,{className:t.language==="pt-BR"?"font-bold":"",onClick:()=>n("pt-BR"),children:e("header.language.portuguese")}),l.jsx(tt,{className:t.language==="en-US"?"font-bold":"",onClick:()=>n("en-US"),children:e("header.language.english")}),l.jsx(tt,{className:t.language==="es-ES"?"font-bold":"",onClick:()=>n("es-ES"),children:e("header.language.spanish")}),l.jsx(tt,{className:t.language==="fr-FR"?"font-bold":"",onClick:()=>n("fr-FR"),children:e("header.language.french")})]})]})}function J5(){const{t:e}=Te(),{setTheme:t}=Dx();return l.jsxs(ms,{children:[l.jsx(vs,{asChild:!0,children:l.jsxs(z,{variant:"outline",size:"icon",children:[l.jsx(a3,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),l.jsx(r3,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),l.jsx("span",{className:"sr-only",children:e("header.theme.label")})]})}),l.jsxs(Mr,{align:"end",children:[l.jsx(tt,{onClick:()=>t("light"),children:e("header.theme.light")}),l.jsx(tt,{onClick:()=>t("dark"),children:e("header.theme.dark")}),l.jsx(tt,{onClick:()=>t("system"),children:e("header.theme.system")})]})]})}var cw="Avatar",[Q5,tae]=qr(cw),[Z5,e_]=Q5(cw),t_=v.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[s,o]=v.useState("idle");return l.jsx(Z5,{scope:n,imageLoadingStatus:s,onImageLoadingStatusChange:o,children:l.jsx(Ie.span,{...r,ref:t})})});t_.displayName=cw;var n_="AvatarImage",r_=v.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:s=()=>{},...o}=e,a=e_(n_,n),c=Y5(r),u=on(i=>{s(i),a.onImageLoadingStatusChange(i)});return pn(()=>{c!=="idle"&&u(c)},[c,u]),c==="loaded"?l.jsx(Ie.img,{...o,ref:t,src:r}):null});r_.displayName=n_;var s_="AvatarFallback",o_=v.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...s}=e,o=e_(s_,n),[a,c]=v.useState(r===void 0);return v.useEffect(()=>{if(r!==void 0){const u=window.setTimeout(()=>c(!0),r);return()=>window.clearTimeout(u)}},[r]),a&&o.imageLoadingStatus!=="loaded"?l.jsx(Ie.span,{...s,ref:t}):null});o_.displayName=s_;function Y5(e){const[t,n]=v.useState("idle");return pn(()=>{if(!e){n("error");return}let r=!0;const s=new window.Image,o=a=>()=>{r&&n(a)};return n("loading"),s.onload=o("loaded"),s.onerror=o("error"),s.src=e,()=>{r=!1}},[e]),t}var a_=t_,i_=r_,l_=o_;const Eh=v.forwardRef(({className:e,...t},n)=>l.jsx(a_,{ref:n,className:me("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Eh.displayName=a_.displayName;const kh=v.forwardRef(({className:e,...t},n)=>l.jsx(i_,{ref:n,className:me("aspect-square h-full w-full",e),...t}));kh.displayName=i_.displayName;const X5=v.forwardRef(({className:e,...t},n)=>l.jsx(l_,{ref:n,className:me("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));X5.displayName=l_.displayName;var uw="Dialog",[c_,nae]=qr(uw),[eV,ys]=c_(uw),u_=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:a=!0}=e,c=v.useRef(null),u=v.useRef(null),[i=!1,d]=ya({prop:r,defaultProp:s,onChange:o});return l.jsx(eV,{scope:t,triggerRef:c,contentRef:u,contentId:is(),titleId:is(),descriptionId:is(),open:i,onOpenChange:d,onOpenToggle:v.useCallback(()=>d(p=>!p),[d]),modal:a,children:n})};u_.displayName=uw;var d_="DialogTrigger",f_=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ys(d_,n),o=ct(t,s.triggerRef);return l.jsx(Ie.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":pw(s.open),...r,ref:o,onClick:Ce(e.onClick,s.onOpenToggle)})});f_.displayName=d_;var dw="DialogPortal",[tV,p_]=c_(dw,{forceMount:void 0}),g_=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=ys(dw,t);return l.jsx(tV,{scope:t,forceMount:n,children:v.Children.map(r,a=>l.jsx(cr,{present:n||o.open,children:l.jsx(vh,{asChild:!0,container:s,children:a})}))})};g_.displayName=dw;var ug="DialogOverlay",h_=v.forwardRef((e,t)=>{const n=p_(ug,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=ys(ug,e.__scopeDialog);return o.modal?l.jsx(cr,{present:r||o.open,children:l.jsx(nV,{...s,ref:t})}):null});h_.displayName=ug;var nV=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ys(ug,n);return l.jsx(wh,{as:wo,allowPinchZoom:!0,shards:[s.contentRef],children:l.jsx(Ie.div,{"data-state":pw(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ii="DialogContent",m_=v.forwardRef((e,t)=>{const n=p_(Ii,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=ys(Ii,e.__scopeDialog);return l.jsx(cr,{present:r||o.open,children:o.modal?l.jsx(rV,{...s,ref:t}):l.jsx(sV,{...s,ref:t})})});m_.displayName=Ii;var rV=v.forwardRef((e,t)=>{const n=ys(Ii,e.__scopeDialog),r=v.useRef(null),s=ct(t,n.contentRef,r);return v.useEffect(()=>{const o=r.current;if(o)return Yx(o)},[]),l.jsx(v_,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ce(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Ce(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&o.preventDefault()}),onFocusOutside:Ce(e.onFocusOutside,o=>o.preventDefault())})}),sV=v.forwardRef((e,t)=>{const n=ys(Ii,e.__scopeDialog),r=v.useRef(!1),s=v.useRef(!1);return l.jsx(v_,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,c;(a=e.onCloseAutoFocus)==null||a.call(e,o),o.defaultPrevented||(r.current||(c=n.triggerRef.current)==null||c.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{var u,i;(u=e.onInteractOutside)==null||u.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=o.target;((i=n.triggerRef.current)==null?void 0:i.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),v_=v.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...a}=e,c=ys(Ii,n),u=v.useRef(null),i=ct(t,u);return Vx(),l.jsxs(l.Fragment,{children:[l.jsx(ph,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:l.jsx(fh,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":pw(c.open),...a,ref:i,onDismiss:()=>c.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(oV,{titleId:c.titleId}),l.jsx(iV,{contentRef:u,descriptionId:c.descriptionId})]})]})}),fw="DialogTitle",y_=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ys(fw,n);return l.jsx(Ie.h2,{id:s.titleId,...r,ref:t})});y_.displayName=fw;var b_="DialogDescription",x_=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ys(b_,n);return l.jsx(Ie.p,{id:s.descriptionId,...r,ref:t})});x_.displayName=b_;var w_="DialogClose",S_=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ys(w_,n);return l.jsx(Ie.button,{type:"button",...r,ref:t,onClick:Ce(e.onClick,()=>s.onOpenChange(!1))})});S_.displayName=w_;function pw(e){return e?"open":"closed"}var C_="DialogTitleWarning",[rae,E_]=d3(C_,{contentName:Ii,titleName:fw,docsSlug:"dialog"}),oV=({titleId:e})=>{const t=E_(C_),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. - -If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. - -For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return v.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},aV="DialogDescriptionWarning",iV=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${E_(aV).contentName}}.`;return v.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},lV=u_,cV=f_,uV=g_,k_=h_,j_=m_,T_=y_,M_=x_,N_=S_;const pt=lV,mt=cV,dV=uV,__=N_,P_=v.forwardRef(({className:e,...t},n)=>l.jsx(k_,{ref:n,className:me("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));P_.displayName=k_.displayName;const ut=v.forwardRef(({className:e,children:t,closeBtn:n=!0,...r},s)=>l.jsx(dV,{children:l.jsx(P_,{className:"fixed inset-0 grid place-items-center overflow-y-auto",children:l.jsxs(j_,{ref:s,className:me("relative z-50 grid w-full max-w-lg gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:m-4 sm:rounded-lg md:w-full",e),...r,children:[t,n&&l.jsxs(N_,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[l.jsx(l3,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})})}));ut.displayName=j_.displayName;const dt=({className:e,...t})=>l.jsx("div",{className:me("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});dt.displayName="DialogHeader";const _t=({className:e,...t})=>l.jsx("div",{className:me("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});_t.displayName="DialogFooter";const yt=v.forwardRef(({className:e,...t},n)=>l.jsx(T_,{ref:n,className:me("text-lg font-semibold leading-none tracking-tight",e),...t}));yt.displayName=T_.displayName;const _o=v.forwardRef(({className:e,...t},n)=>l.jsx(M_,{ref:n,className:me("text-sm text-muted-foreground",e),...t}));_o.displayName=M_.displayName;function R_({instanceId:e}){const[t,n]=v.useState(!1),r=an(),{theme:s}=Dx(),o=()=>{FT(),r("/manager/login")},a=()=>{r("/manager/")},{data:c}=bM({instanceId:e});return l.jsxs("header",{className:"flex items-center justify-between px-4 py-2",children:[l.jsx(ld,{to:"/manager",onClick:a,className:"flex h-8 items-center gap-4",children:l.jsx("img",{src:s==="dark"?"https://evolution-api.com/files/evo/evolution-logo-white.svg":"https://evolution-api.com/files/evo/evolution-logo.svg",alt:"Logo",className:"h-full"})}),l.jsxs("div",{className:"flex items-center gap-4",children:[e&&l.jsx(Eh,{className:"h-8 w-8",children:l.jsx(kh,{src:(c==null?void 0:c.profilePicUrl)||"/assets/images/evolution-logo.png",alt:c==null?void 0:c.name})}),l.jsx(G5,{}),l.jsx(J5,{}),l.jsx(z,{onClick:()=>n(!0),variant:"destructive",size:"icon",children:l.jsx(WB,{size:"18"})})]}),t&&l.jsx(pt,{onOpenChange:n,open:t,children:l.jsxs(ut,{children:[l.jsx(__,{}),l.jsx(dt,{children:"Deseja realmente sair?"}),l.jsx(_t,{children:l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx(z,{onClick:()=>n(!1),size:"sm",variant:"outline",children:"Cancelar"}),l.jsx(z,{onClick:o,variant:"destructive",children:"Sair"})]})})]})})]})}const O_=v.createContext(null),Ve=()=>{const e=v.useContext(O_);if(!e)throw new Error("useInstance must be used within an InstanceProvider");return e},fV=({children:e})=>{const t=gs(),[n,r]=v.useState(null),{data:s,refetch:o}=bM({instanceId:n});return v.useEffect(()=>{t.instanceId?r(t.instanceId):r(null)},[t]),l.jsx(O_.Provider,{value:{instance:s??null,reloadInstance:async()=>{await o()}},children:e})};var gw="Collapsible",[pV,sae]=qr(gw),[gV,hw]=pV(gw),I_=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:o,onOpenChange:a,...c}=e,[u=!1,i]=ya({prop:r,defaultProp:s,onChange:a});return l.jsx(gV,{scope:n,disabled:o,contentId:is(),open:u,onOpenToggle:v.useCallback(()=>i(d=>!d),[i]),children:l.jsx(Ie.div,{"data-state":vw(u),"data-disabled":o?"":void 0,...c,ref:t})})});I_.displayName=gw;var D_="CollapsibleTrigger",A_=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=hw(D_,n);return l.jsx(Ie.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":vw(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:Ce(e.onClick,s.onOpenToggle)})});A_.displayName=D_;var mw="CollapsibleContent",F_=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=hw(mw,e.__scopeCollapsible);return l.jsx(cr,{present:n||s.open,children:({present:o})=>l.jsx(hV,{...r,ref:t,present:o})})});F_.displayName=mw;var hV=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...o}=e,a=hw(mw,n),[c,u]=v.useState(r),i=v.useRef(null),d=ct(t,i),p=v.useRef(0),f=p.current,g=v.useRef(0),h=g.current,m=a.open||c,x=v.useRef(m),b=v.useRef();return v.useEffect(()=>{const y=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(y)},[]),pn(()=>{const y=i.current;if(y){b.current=b.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const w=y.getBoundingClientRect();p.current=w.height,g.current=w.width,x.current||(y.style.transitionDuration=b.current.transitionDuration,y.style.animationName=b.current.animationName),u(r)}},[a.open,r]),l.jsx(Ie.div,{"data-state":vw(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!m,...o,ref:d,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":h?`${h}px`:void 0,...e.style},children:m&&s})});function vw(e){return e?"open":"closed"}var mV=I_;const vV=mV,yV=A_,bV=F_;function xV(){const{t:e}=Te(),t=v.useMemo(()=>[{id:"dashboard",title:e("sidebar.dashboard"),icon:e3,path:"dashboard"},{navLabel:!0,title:e("sidebar.configurations"),icon:To,children:[{id:"settings",title:e("sidebar.settings"),path:"settings"},{id:"proxy",title:e("sidebar.proxy"),path:"proxy"}]},{title:e("sidebar.events"),icon:YB,children:[{id:"webhook",title:e("sidebar.webhook"),path:"webhook"},{id:"websocket",title:e("sidebar.websocket"),path:"websocket"},{id:"rabbitmq",title:e("sidebar.rabbitmq"),path:"rabbitmq"},{id:"sqs",title:e("sidebar.sqs"),path:"sqs"}]},{title:e("sidebar.integrations"),icon:yM,children:[{id:"evoai",title:e("sidebar.evoai"),path:"evoai"},{id:"n8n",title:e("sidebar.n8n"),path:"n8n"},{id:"evolutionBot",title:e("sidebar.evolutionBot"),path:"evolutionBot"},{id:"chatwoot",title:e("sidebar.chatwoot"),path:"chatwoot"},{id:"typebot",title:e("sidebar.typebot"),path:"typebot"},{id:"openai",title:e("sidebar.openai"),path:"openai"},{id:"dify",title:e("sidebar.dify"),path:"dify"},{id:"flowise",title:e("sidebar.flowise"),path:"flowise"}]},{id:"documentation",title:e("sidebar.documentation"),icon:QB,link:"https://doc.evolution-api.com",divider:!0},{id:"postman",title:e("sidebar.postman"),icon:HB,link:"https://evolution-api.com/postman"},{id:"discord",title:e("sidebar.discord"),icon:dh,link:"https://evolution-api.com/discord"},{id:"support-premium",title:e("sidebar.supportPremium"),icon:t3,link:"https://evolution-api.com/suporte-pro"}],[e]),n=an(),{pathname:r}=kc(),{instance:s}=Ve(),o=c=>{!c||!s||(c.path&&n(`/manager/instance/${s.id}/${c.path}`),c.link&&window.open(c.link,"_blank"))},a=v.useMemo(()=>t.map(c=>{var u;return{...c,children:"children"in c?(u=c.children)==null?void 0:u.map(i=>({...i,isActive:"path"in i?r.includes(i.path):!1})):void 0,isActive:"path"in c&&c.path?r.includes(c.path):!1}}).map(c=>{var u;return{...c,isActive:c.isActive||"children"in c&&((u=c.children)==null?void 0:u.some(i=>i.isActive))}}),[t,r]);return l.jsx("ul",{className:"flex h-full w-full flex-col gap-2 border-r border-border px-2",children:a.map(c=>l.jsx("li",{className:"divider"in c?"mt-auto":void 0,children:c.children?l.jsxs(vV,{defaultOpen:c.isActive,children:[l.jsx(yV,{asChild:!0,children:l.jsxs(z,{className:me("flex w-full items-center justify-start gap-2"),variant:c.isActive?"secondary":"link",children:[c.icon&&l.jsx(c.icon,{size:"15"}),l.jsx("span",{children:c.title}),l.jsx(uh,{size:"15",className:"ml-auto"})]})}),l.jsx(bV,{children:l.jsx("ul",{className:"my-4 ml-6 flex flex-col gap-2 text-sm",children:c.children.map(u=>l.jsx("li",{children:l.jsx("button",{onClick:()=>o(u),className:me(u.isActive?"text-foreground":"text-muted-foreground"),children:l.jsx("span",{className:"nav-label",children:u.title})})},u.id))})})]}):l.jsxs(z,{className:me("relative flex w-full items-center justify-start gap-2",c.isActive&&"pointer-events-none"),variant:c.isActive?"secondary":"link",children:["link"in c&&l.jsx("a",{href:c.link,target:"_blank",rel:"noreferrer",className:"absolute inset-0 h-full w-full"}),"path"in c&&l.jsx(ld,{to:`/manager/instance/${s==null?void 0:s.id}/${c.path}`,className:"absolute inset-0 h-full w-full"}),c.icon&&l.jsx(c.icon,{size:"15"}),l.jsx("span",{children:c.title})]})},c.title))})}function tb(e,[t,n]){return Math.min(n,Math.max(t,e))}function wV(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var yw="ScrollArea",[L_,oae]=qr(yw),[SV,Wr]=L_(yw),$_=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:o=600,...a}=e,[c,u]=v.useState(null),[i,d]=v.useState(null),[p,f]=v.useState(null),[g,h]=v.useState(null),[m,x]=v.useState(null),[b,y]=v.useState(0),[w,S]=v.useState(0),[E,C]=v.useState(!1),[T,j]=v.useState(!1),_=ct(t,K=>u(K)),O=Jd(s);return l.jsx(SV,{scope:n,type:r,dir:O,scrollHideDelay:o,scrollArea:c,viewport:i,onViewportChange:d,content:p,onContentChange:f,scrollbarX:g,onScrollbarXChange:h,scrollbarXEnabled:E,onScrollbarXEnabledChange:C,scrollbarY:m,onScrollbarYChange:x,scrollbarYEnabled:T,onScrollbarYEnabledChange:j,onCornerWidthChange:y,onCornerHeightChange:S,children:l.jsx(Ie.div,{dir:O,...a,ref:_,style:{position:"relative","--radix-scroll-area-corner-width":b+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});$_.displayName=yw;var B_="ScrollAreaViewport",z_=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:s,...o}=e,a=Wr(B_,n),c=v.useRef(null),u=ct(t,c,a.onViewportChange);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),l.jsx(Ie.div,{"data-radix-scroll-area-viewport":"",...o,ref:u,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:l.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});z_.displayName=B_;var Js="ScrollAreaScrollbar",bw=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Wr(Js,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:a}=s,c=e.orientation==="horizontal";return v.useEffect(()=>(c?o(!0):a(!0),()=>{c?o(!1):a(!1)}),[c,o,a]),s.type==="hover"?l.jsx(CV,{...r,ref:t,forceMount:n}):s.type==="scroll"?l.jsx(EV,{...r,ref:t,forceMount:n}):s.type==="auto"?l.jsx(U_,{...r,ref:t,forceMount:n}):s.type==="always"?l.jsx(xw,{...r,ref:t}):null});bw.displayName=Js;var CV=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Wr(Js,e.__scopeScrollArea),[o,a]=v.useState(!1);return v.useEffect(()=>{const c=s.scrollArea;let u=0;if(c){const i=()=>{window.clearTimeout(u),a(!0)},d=()=>{u=window.setTimeout(()=>a(!1),s.scrollHideDelay)};return c.addEventListener("pointerenter",i),c.addEventListener("pointerleave",d),()=>{window.clearTimeout(u),c.removeEventListener("pointerenter",i),c.removeEventListener("pointerleave",d)}}},[s.scrollArea,s.scrollHideDelay]),l.jsx(cr,{present:n||o,children:l.jsx(U_,{"data-state":o?"visible":"hidden",...r,ref:t})})}),EV=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Wr(Js,e.__scopeScrollArea),o=e.orientation==="horizontal",a=Th(()=>u("SCROLL_END"),100),[c,u]=wV("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return v.useEffect(()=>{if(c==="idle"){const i=window.setTimeout(()=>u("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(i)}},[c,s.scrollHideDelay,u]),v.useEffect(()=>{const i=s.viewport,d=o?"scrollLeft":"scrollTop";if(i){let p=i[d];const f=()=>{const g=i[d];p!==g&&(u("SCROLL"),a()),p=g};return i.addEventListener("scroll",f),()=>i.removeEventListener("scroll",f)}},[s.viewport,o,u,a]),l.jsx(cr,{present:n||c!=="hidden",children:l.jsx(xw,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ce(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Ce(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),U_=v.forwardRef((e,t)=>{const n=Wr(Js,e.__scopeScrollArea),{forceMount:r,...s}=e,[o,a]=v.useState(!1),c=e.orientation==="horizontal",u=Th(()=>{if(n.viewport){const i=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,s=Wr(Js,e.__scopeScrollArea),o=v.useRef(null),a=v.useRef(0),[c,u]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),i=W_(c.viewport,c.content),d={...r,sizes:c,onSizesChange:u,hasThumb:i>0&&i<1,onThumbChange:f=>o.current=f,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:f=>a.current=f};function p(f,g){return _V(f,a.current,c,g)}return n==="horizontal"?l.jsx(kV,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const f=s.viewport.scrollLeft,g=TC(f,c,s.dir);o.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:f=>{s.viewport&&(s.viewport.scrollLeft=f)},onDragScroll:f=>{s.viewport&&(s.viewport.scrollLeft=p(f,s.dir))}}):n==="vertical"?l.jsx(jV,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const f=s.viewport.scrollTop,g=TC(f,c);o.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:f=>{s.viewport&&(s.viewport.scrollTop=f)},onDragScroll:f=>{s.viewport&&(s.viewport.scrollTop=p(f))}}):null}),kV=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,o=Wr(Js,e.__scopeScrollArea),[a,c]=v.useState(),u=v.useRef(null),i=ct(t,u,o.onScrollbarXChange);return v.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),l.jsx(H_,{"data-orientation":"horizontal",...s,ref:i,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":jh(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,p)=>{if(o.viewport){const f=o.viewport.scrollLeft+d.deltaX;e.onWheelScroll(f),J_(f,p)&&d.preventDefault()}},onResize:()=>{u.current&&o.viewport&&a&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:fg(a.paddingLeft),paddingEnd:fg(a.paddingRight)}})}})}),jV=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,o=Wr(Js,e.__scopeScrollArea),[a,c]=v.useState(),u=v.useRef(null),i=ct(t,u,o.onScrollbarYChange);return v.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),l.jsx(H_,{"data-orientation":"vertical",...s,ref:i,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":jh(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,p)=>{if(o.viewport){const f=o.viewport.scrollTop+d.deltaY;e.onWheelScroll(f),J_(f,p)&&d.preventDefault()}},onResize:()=>{u.current&&o.viewport&&a&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:fg(a.paddingTop),paddingEnd:fg(a.paddingBottom)}})}})}),[TV,V_]=L_(Js),H_=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:o,onThumbPointerUp:a,onThumbPointerDown:c,onThumbPositionChange:u,onDragScroll:i,onWheelScroll:d,onResize:p,...f}=e,g=Wr(Js,n),[h,m]=v.useState(null),x=ct(t,_=>m(_)),b=v.useRef(null),y=v.useRef(""),w=g.viewport,S=r.content-r.viewport,E=on(d),C=on(u),T=Th(p,10);function j(_){if(b.current){const O=_.clientX-b.current.left,K=_.clientY-b.current.top;i({x:O,y:K})}}return v.useEffect(()=>{const _=O=>{const K=O.target;(h==null?void 0:h.contains(K))&&E(O,S)};return document.addEventListener("wheel",_,{passive:!1}),()=>document.removeEventListener("wheel",_,{passive:!1})},[w,h,S,E]),v.useEffect(C,[r,C]),pc(h,T),pc(g.content,T),l.jsx(TV,{scope:n,scrollbar:h,hasThumb:s,onThumbChange:on(o),onThumbPointerUp:on(a),onThumbPositionChange:C,onThumbPointerDown:on(c),children:l.jsx(Ie.div,{...f,ref:x,style:{position:"absolute",...f.style},onPointerDown:Ce(e.onPointerDown,_=>{_.button===0&&(_.target.setPointerCapture(_.pointerId),b.current=h.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),j(_))}),onPointerMove:Ce(e.onPointerMove,j),onPointerUp:Ce(e.onPointerUp,_=>{const O=_.target;O.hasPointerCapture(_.pointerId)&&O.releasePointerCapture(_.pointerId),document.body.style.webkitUserSelect=y.current,g.viewport&&(g.viewport.style.scrollBehavior=""),b.current=null})})})}),dg="ScrollAreaThumb",K_=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=V_(dg,e.__scopeScrollArea);return l.jsx(cr,{present:n||s.hasThumb,children:l.jsx(MV,{ref:t,...r})})}),MV=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...s}=e,o=Wr(dg,n),a=V_(dg,n),{onThumbPositionChange:c}=a,u=ct(t,p=>a.onThumbChange(p)),i=v.useRef(),d=Th(()=>{i.current&&(i.current(),i.current=void 0)},100);return v.useEffect(()=>{const p=o.viewport;if(p){const f=()=>{if(d(),!i.current){const g=PV(p,c);i.current=g,c()}};return c(),p.addEventListener("scroll",f),()=>p.removeEventListener("scroll",f)}},[o.viewport,d,c]),l.jsx(Ie.div,{"data-state":a.hasThumb?"visible":"hidden",...s,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Ce(e.onPointerDownCapture,p=>{const g=p.target.getBoundingClientRect(),h=p.clientX-g.left,m=p.clientY-g.top;a.onThumbPointerDown({x:h,y:m})}),onPointerUp:Ce(e.onPointerUp,a.onThumbPointerUp)})});K_.displayName=dg;var ww="ScrollAreaCorner",q_=v.forwardRef((e,t)=>{const n=Wr(ww,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?l.jsx(NV,{...e,ref:t}):null});q_.displayName=ww;var NV=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,s=Wr(ww,n),[o,a]=v.useState(0),[c,u]=v.useState(0),i=!!(o&&c);return pc(s.scrollbarX,()=>{var p;const d=((p=s.scrollbarX)==null?void 0:p.offsetHeight)||0;s.onCornerHeightChange(d),u(d)}),pc(s.scrollbarY,()=>{var p;const d=((p=s.scrollbarY)==null?void 0:p.offsetWidth)||0;s.onCornerWidthChange(d),a(d)}),i?l.jsx(Ie.div,{...r,ref:t,style:{width:o,height:c,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function fg(e){return e?parseInt(e,10):0}function W_(e,t){const n=e/t;return isNaN(n)?0:n}function jh(e){const t=W_(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function _V(e,t,n,r="ltr"){const s=jh(n),o=s/2,a=t||o,c=s-a,u=n.scrollbar.paddingStart+a,i=n.scrollbar.size-n.scrollbar.paddingEnd-c,d=n.content-n.viewport,p=r==="ltr"?[0,d]:[d*-1,0];return G_([u,i],p)(e)}function TC(e,t,n="ltr"){const r=jh(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-s,a=t.content-t.viewport,c=o-r,u=n==="ltr"?[0,a]:[a*-1,0],i=tb(e,u);return G_([0,a],[0,c])(i)}function G_(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function J_(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function s(){const o={left:e.scrollLeft,top:e.scrollTop},a=n.left!==o.left,c=n.top!==o.top;(a||c)&&t(),n=o,r=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(r)};function Th(e,t){const n=on(e),r=v.useRef(0);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),v.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function pc(e,t){const n=on(t);pn(()=>{let r=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(e),()=>{window.cancelAnimationFrame(r),s.unobserve(e)}}},[e,n])}var Q_=$_,RV=z_,OV=q_;const nb=v.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(Q_,{ref:r,className:me("relative overflow-hidden",e),...n,children:[l.jsx(RV,{className:"h-full w-full rounded-[inherit] [&>div[style]]:!block [&>div[style]]:h-full",children:t}),l.jsx(Z_,{}),l.jsx(OV,{})]}));nb.displayName=Q_.displayName;const Z_=v.forwardRef(({className:e,orientation:t="vertical",...n},r)=>l.jsx(bw,{ref:r,orientation:t,className:me("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 border-t border-t-transparent p-[1px]",e),...n,children:l.jsx(K_,{className:me("relative rounded-full bg-border",t==="vertical"&&"flex-1")})}));Z_.displayName=bw.displayName;function Lt({children:e}){const{instanceId:t}=gs();return l.jsx(fV,{children:l.jsxs("div",{className:"flex h-screen flex-col",children:[l.jsx(R_,{instanceId:t}),l.jsxs("div",{className:"flex min-h-[calc(100vh_-_56px)] flex-1 flex-col md:flex-row",children:[l.jsx(nb,{className:"mr-2 py-6 md:w-64",children:l.jsx("div",{className:"flex h-full",children:l.jsx(xV,{})})}),l.jsx(nb,{className:"w-full",children:l.jsxs("div",{className:"flex h-full flex-col",children:[l.jsx("div",{className:"my-6 flex flex-1 flex-col gap-2 pl-2 pr-4",children:e}),l.jsx(zx,{})]})})]})]})})}function IV({children:e}){return l.jsxs("div",{className:"flex h-full min-h-screen flex-col",children:[l.jsx(R_,{}),l.jsx("main",{className:"flex-1",children:e}),l.jsx(zx,{})]})}const DV=ch("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground",warning:"border-transparent bg-amber-600 text-amber-100 hover:bg-amber-600/80"}},defaultVariants:{variant:"default"}});function Lf({className:e,variant:t,...n}){return l.jsx("div",{className:me(DV({variant:t}),e),...n})}function Y_({status:e}){const{t}=Te();return e?e==="open"?l.jsx(Lf,{children:t("status.open")}):e==="connecting"?l.jsx(Lf,{variant:"warning",children:t("status.connecting")}):e==="close"||e==="closed"?l.jsx(Lf,{variant:"destructive",children:t("status.closed")}):l.jsx(Lf,{variant:"secondary",children:e}):null}const AV=e=>{navigator.clipboard.writeText(e),G.success("Copiado para a área de transferência")};function X_({token:e,className:t}){const[n,r]=v.useState(!1);return l.jsxs("div",{className:me("flex items-center gap-3 truncate rounded-sm bg-primary/20 px-2 py-1",t),children:[l.jsx("pre",{className:"block truncate text-xs",children:n?e:e==null?void 0:e.replace(/\w/g,"*")}),l.jsx(z,{variant:"ghost",size:"icon",onClick:()=>{AV(e)},children:l.jsx(qB,{size:"15"})}),l.jsx(z,{variant:"ghost",size:"icon",onClick:()=>{r(s=>!s)},children:n?l.jsx(GB,{size:"15"}):l.jsx(JB,{size:"15"})})]})}const oi=v.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:me("flex flex-col rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));oi.displayName="Card";const ai=v.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:me("flex flex-col space-y-1.5 p-6",e),...t}));ai.displayName="CardHeader";const Iu=v.forwardRef(({className:e,...t},n)=>l.jsx("h3",{ref:n,className:me("text-2xl font-semibold leading-none tracking-tight",e),...t}));Iu.displayName="CardTitle";const eP=v.forwardRef(({className:e,...t},n)=>l.jsx("p",{ref:n,className:me("text-sm text-muted-foreground",e),...t}));eP.displayName="CardDescription";const ii=v.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:me("p-6 pt-0",e),...t}));ii.displayName="CardContent";const Mh=v.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:me("flex items-center p-6 pt-0",e),...t}));Mh.displayName="CardFooter";const tP="flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",F=v.forwardRef(({className:e,type:t,...n},r)=>l.jsx("input",{type:t,className:me(tP,e),ref:r,...n}));F.displayName="Input";const FV=["instance","fetchInstances"],LV=async()=>(await Gd.get("/instance/fetchInstances")).data,$V=e=>qe({...e,queryKey:FV,queryFn:()=>LV()});function Le(e,t){const n=Bb(),r=oA({mutationFn:e});return(s,o)=>r.mutateAsync(s,{onSuccess:async(a,c,u)=>{var i;t!=null&&t.invalidateKeys&&await Promise.all(t.invalidateKeys.map(d=>n.invalidateQueries({queryKey:d}))),(i=o==null?void 0:o.onSuccess)==null||i.call(o,a,c,u)},onError(a,c,u){var i;(i=o==null?void 0:o.onError)==null||i.call(o,a,c,u)},onSettled(a,c,u,i){var d;(d=o==null?void 0:o.onSettled)==null||d.call(o,a,c,u,i)}})}const BV=async e=>(await Gd.post("/instance/create",e)).data,zV=async e=>(await ie.post(`/instance/restart/${e}`)).data,UV=async e=>(await ie.delete(`/instance/logout/${e}`)).data,VV=async e=>(await Gd.delete(`/instance/delete/${e}`)).data,HV=async({instanceName:e,token:t,number:n})=>(await ie.get(`/instance/connect/${e}`,{headers:{apikey:t},params:{number:n}})).data,KV=async({instanceName:e,token:t,data:n})=>(await ie.post(`/settings/set/${e}`,n,{headers:{apikey:t}})).data;function Nh(){const e=Le(HV,{invalidateKeys:[["instance","fetchInstance"],["instance","fetchInstances"]]}),t=Le(KV,{invalidateKeys:[["instance","fetchSettings"]]}),n=Le(VV,{invalidateKeys:[["instance","fetchInstance"],["instance","fetchInstances"]]}),r=Le(UV,{invalidateKeys:[["instance","fetchInstance"],["instance","fetchInstances"]]}),s=Le(zV,{invalidateKeys:[["instance","fetchInstance"],["instance","fetchInstances"]]}),o=Le(BV,{invalidateKeys:[["instance","fetchInstances"]]});return{connect:e,updateSettings:t,deleteInstance:n,logout:r,restart:s,createInstance:o}}var Xd=e=>e.type==="checkbox",Ml=e=>e instanceof Date,qn=e=>e==null;const nP=e=>typeof e=="object";var gn=e=>!qn(e)&&!Array.isArray(e)&&nP(e)&&!Ml(e),rP=e=>gn(e)&&e.target?Xd(e.target)?e.target.checked:e.target.value:e,qV=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,sP=(e,t)=>e.has(qV(t)),WV=e=>{const t=e.constructor&&e.constructor.prototype;return gn(t)&&t.hasOwnProperty("isPrototypeOf")},Sw=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Xn(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(Sw&&(e instanceof Blob||e instanceof FileList))&&(n||gn(e)))if(t=n?[]:{},!n&&!WV(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=Xn(e[r]));else return e;return t}var _h=e=>Array.isArray(e)?e.filter(Boolean):[],Yt=e=>e===void 0,de=(e,t,n)=>{if(!t||!gn(e))return n;const r=_h(t.split(/[,[\].]+?/)).reduce((s,o)=>qn(s)?s:s[o],e);return Yt(r)||r===e?Yt(e[t])?n:e[t]:r},Rs=e=>typeof e=="boolean",Cw=e=>/^\w*$/.test(e),oP=e=>_h(e.replace(/["|']|\]/g,"").split(/\.|\[/)),xt=(e,t,n)=>{let r=-1;const s=Cw(t)?[t]:oP(t),o=s.length,a=o-1;for(;++rje.useContext(aP),Mn=e=>{const{children:t,...n}=e;return je.createElement(aP.Provider,{value:n},t)};var iP=(e,t,n,r=!0)=>{const s={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(s,o,{get:()=>{const a=o;return t._proxyFormState[a]!==ts.all&&(t._proxyFormState[a]=!r||ts.all),n&&(n[a]=!0),e[a]}});return s},pr=e=>gn(e)&&!Object.keys(e).length,lP=(e,t,n,r)=>{n(e);const{name:s,...o}=e;return pr(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(a=>t[a]===(!r||ts.all))},Du=e=>Array.isArray(e)?e:[e],cP=(e,t,n)=>!e||!t||e===t||Du(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function Ew(e){const t=je.useRef(e);t.current=e,je.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function GV(e){const t=Ph(),{control:n=t.control,disabled:r,name:s,exact:o}=e||{},[a,c]=je.useState(n._formState),u=je.useRef(!0),i=je.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=je.useRef(s);return d.current=s,Ew({disabled:r,next:p=>u.current&&cP(d.current,p.name,o)&&lP(p,i.current,n._updateFormState)&&c({...n._formState,...p}),subject:n._subjects.state}),je.useEffect(()=>(u.current=!0,i.current.isValid&&n._updateValid(!0),()=>{u.current=!1}),[n]),iP(a,n,i.current,!1)}var As=e=>typeof e=="string",uP=(e,t,n,r,s)=>As(e)?(r&&t.watch.add(e),de(n,e,s)):Array.isArray(e)?e.map(o=>(r&&t.watch.add(o),de(n,o))):(r&&(t.watchAll=!0),n);function JV(e){const t=Ph(),{control:n=t.control,name:r,defaultValue:s,disabled:o,exact:a}=e||{},c=je.useRef(r);c.current=r,Ew({disabled:o,subject:n._subjects.values,next:d=>{cP(c.current,d.name,a)&&i(Xn(uP(c.current,n._names,d.values||n._formValues,!1,s)))}});const[u,i]=je.useState(n._getWatch(r,s));return je.useEffect(()=>n._removeUnmounted()),u}function QV(e){const t=Ph(),{name:n,disabled:r,control:s=t.control,shouldUnregister:o}=e,a=sP(s._names.array,n),c=JV({control:s,name:n,defaultValue:de(s._formValues,n,de(s._defaultValues,n,e.defaultValue)),exact:!0}),u=GV({control:s,name:n}),i=je.useRef(s.register(n,{...e.rules,value:c,...Rs(e.disabled)?{disabled:e.disabled}:{}}));return je.useEffect(()=>{const d=s._options.shouldUnregister||o,p=(f,g)=>{const h=de(s._fields,f);h&&h._f&&(h._f.mount=g)};if(p(n,!0),d){const f=Xn(de(s._options.defaultValues,n));xt(s._defaultValues,n,f),Yt(de(s._formValues,n))&&xt(s._formValues,n,f)}return()=>{(a?d&&!s._state.action:d)?s.unregister(n):p(n,!1)}},[n,s,a,o]),je.useEffect(()=>{de(s._fields,n)&&s._updateDisabledField({disabled:r,fields:s._fields,name:n,value:de(s._fields,n)._f.value})},[r,n,s]),{field:{name:n,value:c,...Rs(r)||u.disabled?{disabled:u.disabled||r}:{},onChange:je.useCallback(d=>i.current.onChange({target:{value:rP(d),name:n},type:pg.CHANGE}),[n]),onBlur:je.useCallback(()=>i.current.onBlur({target:{value:de(s._formValues,n),name:n},type:pg.BLUR}),[n,s]),ref:d=>{const p=de(s._fields,n);p&&d&&(p._f.ref={focus:()=>d.focus(),select:()=>d.select(),setCustomValidity:f=>d.setCustomValidity(f),reportValidity:()=>d.reportValidity()})}},formState:u,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!de(u.errors,n)},isDirty:{enumerable:!0,get:()=>!!de(u.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!de(u.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!de(u.validatingFields,n)},error:{enumerable:!0,get:()=>de(u.errors,n)}})}}const ZV=e=>e.render(QV(e));var dP=(e,t,n,r,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:s||!0}}:{},MC=e=>({isOnSubmit:!e||e===ts.onSubmit,isOnBlur:e===ts.onBlur,isOnChange:e===ts.onChange,isOnAll:e===ts.all,isOnTouch:e===ts.onTouched}),NC=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Au=(e,t,n,r)=>{for(const s of n||Object.keys(e)){const o=de(e,s);if(o){const{_f:a,...c}=o;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],s)&&!r)break;if(a.ref&&t(a.ref,a.name)&&!r)break;Au(c,t)}else gn(c)&&Au(c,t)}}};var YV=(e,t,n)=>{const r=Du(de(e,n));return xt(r,"root",t[n]),xt(e,n,r),e},kw=e=>e.type==="file",aa=e=>typeof e=="function",gg=e=>{if(!Sw)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},yp=e=>As(e),jw=e=>e.type==="radio",hg=e=>e instanceof RegExp;const _C={value:!1,isValid:!1},PC={value:!0,isValid:!0};var fP=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Yt(e[0].attributes.value)?Yt(e[0].value)||e[0].value===""?PC:{value:e[0].value,isValid:!0}:PC:_C}return _C};const RC={isValid:!1,value:null};var pP=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,RC):RC;function OC(e,t,n="validate"){if(yp(e)||Array.isArray(e)&&e.every(yp)||Rs(e)&&!e)return{type:n,message:yp(e)?e:"",ref:t}}var al=e=>gn(e)&&!hg(e)?e:{value:e,message:""},IC=async(e,t,n,r,s)=>{const{ref:o,refs:a,required:c,maxLength:u,minLength:i,min:d,max:p,pattern:f,validate:g,name:h,valueAsNumber:m,mount:x,disabled:b}=e._f,y=de(t,h);if(!x||b)return{};const w=a?a[0]:o,S=I=>{r&&w.reportValidity&&(w.setCustomValidity(Rs(I)?"":I||""),w.reportValidity())},E={},C=jw(o),T=Xd(o),j=C||T,_=(m||kw(o))&&Yt(o.value)&&Yt(y)||gg(o)&&o.value===""||y===""||Array.isArray(y)&&!y.length,O=dP.bind(null,h,n,E),K=(I,Y,q,Z=Ys.maxLength,ee=Ys.minLength)=>{const J=I?Y:q;E[h]={type:I?Z:ee,message:J,ref:o,...O(I?Z:ee,J)}};if(s?!Array.isArray(y)||!y.length:c&&(!j&&(_||qn(y))||Rs(y)&&!y||T&&!fP(a).isValid||C&&!pP(a).isValid)){const{value:I,message:Y}=yp(c)?{value:!!c,message:c}:al(c);if(I&&(E[h]={type:Ys.required,message:Y,ref:w,...O(Ys.required,Y)},!n))return S(Y),E}if(!_&&(!qn(d)||!qn(p))){let I,Y;const q=al(p),Z=al(d);if(!qn(y)&&!isNaN(y)){const ee=o.valueAsNumber||y&&+y;qn(q.value)||(I=ee>q.value),qn(Z.value)||(Y=eenew Date(new Date().toDateString()+" "+X),L=o.type=="time",A=o.type=="week";As(q.value)&&y&&(I=L?J(y)>J(q.value):A?y>q.value:ee>new Date(q.value)),As(Z.value)&&y&&(Y=L?J(y)+I.value,Z=!qn(Y.value)&&y.length<+Y.value;if((q||Z)&&(K(q,I.message,Y.message),!n))return S(E[h].message),E}if(f&&!_&&As(y)){const{value:I,message:Y}=al(f);if(hg(I)&&!y.match(I)&&(E[h]={type:Ys.pattern,message:Y,ref:o,...O(Ys.pattern,Y)},!n))return S(Y),E}if(g){if(aa(g)){const I=await g(y,t),Y=OC(I,w);if(Y&&(E[h]={...Y,...O(Ys.validate,Y.message)},!n))return S(Y.message),E}else if(gn(g)){let I={};for(const Y in g){if(!pr(I)&&!n)break;const q=OC(await g[Y](y,t),w,Y);q&&(I={...q,...O(Y,q.message)},S(q.message),n&&(E[h]=I))}if(!pr(I)&&(E[h]={ref:w,...I},!n))return E}}return S(!0),E};function XV(e,t){const n=t.slice(0,-1).length;let r=0;for(;r{let e=[];return{get observers(){return e},next:s=>{for(const o of e)o.next&&o.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(o=>o!==s)}}),unsubscribe:()=>{e=[]}}},mg=e=>qn(e)||!nP(e);function li(e,t){if(mg(e)||mg(t))return e===t;if(Ml(e)&&Ml(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const s of n){const o=e[s];if(!r.includes(s))return!1;if(s!=="ref"){const a=t[s];if(Ml(o)&&Ml(a)||gn(o)&&gn(a)||Array.isArray(o)&&Array.isArray(a)?!li(o,a):o!==a)return!1}}return!0}var gP=e=>e.type==="select-multiple",t8=e=>jw(e)||Xd(e),tv=e=>gg(e)&&e.isConnected,hP=e=>{for(const t in e)if(aa(e[t]))return!0;return!1};function vg(e,t={}){const n=Array.isArray(e);if(gn(e)||n)for(const r in e)Array.isArray(e[r])||gn(e[r])&&!hP(e[r])?(t[r]=Array.isArray(e[r])?[]:{},vg(e[r],t[r])):qn(e[r])||(t[r]=!0);return t}function mP(e,t,n){const r=Array.isArray(e);if(gn(e)||r)for(const s in e)Array.isArray(e[s])||gn(e[s])&&!hP(e[s])?Yt(t)||mg(n[s])?n[s]=Array.isArray(e[s])?vg(e[s],[]):{...vg(e[s])}:mP(e[s],qn(t)?{}:t[s],n[s]):n[s]=!li(e[s],t[s]);return n}var $f=(e,t)=>mP(e,t,vg(t)),vP=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Yt(e)?e:t?e===""?NaN:e&&+e:n&&As(e)?new Date(e):r?r(e):e;function nv(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return kw(t)?t.files:jw(t)?pP(e.refs).value:gP(t)?[...t.selectedOptions].map(({value:n})=>n):Xd(t)?fP(e.refs).value:vP(Yt(t.value)?e.ref.value:t.value,e)}var n8=(e,t,n,r)=>{const s={};for(const o of e){const a=de(t,o);a&&xt(s,o,a._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:r}},ru=e=>Yt(e)?e:hg(e)?e.source:gn(e)?hg(e.value)?e.value.source:e.value:e,r8=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function DC(e,t,n){const r=de(e,n);if(r||Cw(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const o=s.join("."),a=de(t,o),c=de(e,o);if(a&&!Array.isArray(a)&&n!==o)return{name:n};if(c&&c.type)return{name:o,error:c};s.pop()}return{name:n}}var s8=(e,t,n,r,s)=>s.isOnAll?!1:!n&&s.isOnTouch?!(t||e):(n?r.isOnBlur:s.isOnBlur)?!e:(n?r.isOnChange:s.isOnChange)?e:!0,o8=(e,t)=>!_h(de(e,t)).length&&cn(e,t);const a8={mode:ts.onSubmit,reValidateMode:ts.onChange,shouldFocusError:!0};function i8(e={}){let t={...a8,...e},n={submitCount:0,isDirty:!1,isLoading:aa(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},s=gn(t.defaultValues)||gn(t.values)?Xn(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:Xn(s),a={action:!1,mount:!1,watch:!1},c={mount:new Set,unMount:new Set,array:new Set,watch:new Set},u,i=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},p={values:ev(),array:ev(),state:ev()},f=MC(t.mode),g=MC(t.reValidateMode),h=t.criteriaMode===ts.all,m=M=>D=>{clearTimeout(i),i=setTimeout(M,D)},x=async M=>{if(d.isValid||M){const D=t.resolver?pr((await j()).errors):await O(r,!0);D!==n.isValid&&p.state.next({isValid:D})}},b=(M,D)=>{(d.isValidating||d.validatingFields)&&((M||Array.from(c.mount)).forEach(V=>{V&&(D?xt(n.validatingFields,V,D):cn(n.validatingFields,V))}),p.state.next({validatingFields:n.validatingFields,isValidating:!pr(n.validatingFields)}))},y=(M,D=[],V,he,ce=!0,ae=!0)=>{if(he&&V){if(a.action=!0,ae&&Array.isArray(de(r,M))){const ke=V(de(r,M),he.argA,he.argB);ce&&xt(r,M,ke)}if(ae&&Array.isArray(de(n.errors,M))){const ke=V(de(n.errors,M),he.argA,he.argB);ce&&xt(n.errors,M,ke),o8(n.errors,M)}if(d.touchedFields&&ae&&Array.isArray(de(n.touchedFields,M))){const ke=V(de(n.touchedFields,M),he.argA,he.argB);ce&&xt(n.touchedFields,M,ke)}d.dirtyFields&&(n.dirtyFields=$f(s,o)),p.state.next({name:M,isDirty:I(M,D),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else xt(o,M,D)},w=(M,D)=>{xt(n.errors,M,D),p.state.next({errors:n.errors})},S=M=>{n.errors=M,p.state.next({errors:n.errors,isValid:!1})},E=(M,D,V,he)=>{const ce=de(r,M);if(ce){const ae=de(o,M,Yt(V)?de(s,M):V);Yt(ae)||he&&he.defaultChecked||D?xt(o,M,D?ae:nv(ce._f)):Z(M,ae),a.mount&&x()}},C=(M,D,V,he,ce)=>{let ae=!1,ke=!1;const rt={name:M},Pt=!!(de(r,M)&&de(r,M)._f&&de(r,M)._f.disabled);if(!V||he){d.isDirty&&(ke=n.isDirty,n.isDirty=rt.isDirty=I(),ae=ke!==rt.isDirty);const hn=Pt||li(de(s,M),D);ke=!!(!Pt&&de(n.dirtyFields,M)),hn||Pt?cn(n.dirtyFields,M):xt(n.dirtyFields,M,!0),rt.dirtyFields=n.dirtyFields,ae=ae||d.dirtyFields&&ke!==!hn}if(V){const hn=de(n.touchedFields,M);hn||(xt(n.touchedFields,M,V),rt.touchedFields=n.touchedFields,ae=ae||d.touchedFields&&hn!==V)}return ae&&ce&&p.state.next(rt),ae?rt:{}},T=(M,D,V,he)=>{const ce=de(n.errors,M),ae=d.isValid&&Rs(D)&&n.isValid!==D;if(e.delayError&&V?(u=m(()=>w(M,V)),u(e.delayError)):(clearTimeout(i),u=null,V?xt(n.errors,M,V):cn(n.errors,M)),(V?!li(ce,V):ce)||!pr(he)||ae){const ke={...he,...ae&&Rs(D)?{isValid:D}:{},errors:n.errors,name:M};n={...n,...ke},p.state.next(ke)}},j=async M=>{b(M,!0);const D=await t.resolver(o,t.context,n8(M||c.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return b(M),D},_=async M=>{const{errors:D}=await j(M);if(M)for(const V of M){const he=de(D,V);he?xt(n.errors,V,he):cn(n.errors,V)}else n.errors=D;return D},O=async(M,D,V={valid:!0})=>{for(const he in M){const ce=M[he];if(ce){const{_f:ae,...ke}=ce;if(ae){const rt=c.array.has(ae.name);b([he],!0);const Pt=await IC(ce,o,h,t.shouldUseNativeValidation&&!D,rt);if(b([he]),Pt[ae.name]&&(V.valid=!1,D))break;!D&&(de(Pt,ae.name)?rt?YV(n.errors,Pt,ae.name):xt(n.errors,ae.name,Pt[ae.name]):cn(n.errors,ae.name))}ke&&await O(ke,D,V)}}return V.valid},K=()=>{for(const M of c.unMount){const D=de(r,M);D&&(D._f.refs?D._f.refs.every(V=>!tv(V)):!tv(D._f.ref))&&oe(M)}c.unMount=new Set},I=(M,D)=>(M&&D&&xt(o,M,D),!li(fe(),s)),Y=(M,D,V)=>uP(M,c,{...a.mount?o:Yt(D)?s:As(M)?{[M]:D}:D},V,D),q=M=>_h(de(a.mount?o:s,M,e.shouldUnregister?de(s,M,[]):[])),Z=(M,D,V={})=>{const he=de(r,M);let ce=D;if(he){const ae=he._f;ae&&(!ae.disabled&&xt(o,M,vP(D,ae)),ce=gg(ae.ref)&&qn(D)?"":D,gP(ae.ref)?[...ae.ref.options].forEach(ke=>ke.selected=ce.includes(ke.value)):ae.refs?Xd(ae.ref)?ae.refs.length>1?ae.refs.forEach(ke=>(!ke.defaultChecked||!ke.disabled)&&(ke.checked=Array.isArray(ce)?!!ce.find(rt=>rt===ke.value):ce===ke.value)):ae.refs[0]&&(ae.refs[0].checked=!!ce):ae.refs.forEach(ke=>ke.checked=ke.value===ce):kw(ae.ref)?ae.ref.value="":(ae.ref.value=ce,ae.ref.type||p.values.next({name:M,values:{...o}})))}(V.shouldDirty||V.shouldTouch)&&C(M,ce,V.shouldTouch,V.shouldDirty,!0),V.shouldValidate&&X(M)},ee=(M,D,V)=>{for(const he in D){const ce=D[he],ae=`${M}.${he}`,ke=de(r,ae);(c.array.has(M)||!mg(ce)||ke&&!ke._f)&&!Ml(ce)?ee(ae,ce,V):Z(ae,ce,V)}},J=(M,D,V={})=>{const he=de(r,M),ce=c.array.has(M),ae=Xn(D);xt(o,M,ae),ce?(p.array.next({name:M,values:{...o}}),(d.isDirty||d.dirtyFields)&&V.shouldDirty&&p.state.next({name:M,dirtyFields:$f(s,o),isDirty:I(M,ae)})):he&&!he._f&&!qn(ae)?ee(M,ae,V):Z(M,ae,V),NC(M,c)&&p.state.next({...n}),p.values.next({name:a.mount?M:void 0,values:{...o}})},L=async M=>{a.mount=!0;const D=M.target;let V=D.name,he=!0;const ce=de(r,V),ae=()=>D.type?nv(ce._f):rP(M),ke=rt=>{he=Number.isNaN(rt)||rt===de(o,V,rt)};if(ce){let rt,Pt;const hn=ae(),bn=M.type===pg.BLUR||M.type===pg.FOCUS_OUT,mn=!r8(ce._f)&&!t.resolver&&!de(n.errors,V)&&!ce._f.deps||s8(bn,de(n.touchedFields,V),n.isSubmitted,g,f),Oo=NC(V,c,bn);xt(o,V,hn),bn?(ce._f.onBlur&&ce._f.onBlur(M),u&&u(0)):ce._f.onChange&&ce._f.onChange(M);const bs=C(V,hn,bn,!1),qa=!pr(bs)||Oo;if(!bn&&p.values.next({name:V,type:M.type,values:{...o}}),mn)return d.isValid&&x(),qa&&p.state.next({name:V,...Oo?{}:bs});if(!bn&&Oo&&p.state.next({...n}),t.resolver){const{errors:zn}=await j([V]);if(ke(hn),he){const ue=DC(n.errors,r,V),He=DC(zn,r,ue.name||V);rt=He.error,V=He.name,Pt=pr(zn)}}else b([V],!0),rt=(await IC(ce,o,h,t.shouldUseNativeValidation))[V],b([V]),ke(hn),he&&(rt?Pt=!1:d.isValid&&(Pt=await O(r,!0)));he&&(ce._f.deps&&X(ce._f.deps),T(V,Pt,rt,bs))}},A=(M,D)=>{if(de(n.errors,D)&&M.focus)return M.focus(),1},X=async(M,D={})=>{let V,he;const ce=Du(M);if(t.resolver){const ae=await _(Yt(M)?M:ce);V=pr(ae),he=M?!ce.some(ke=>de(ae,ke)):V}else M?(he=(await Promise.all(ce.map(async ae=>{const ke=de(r,ae);return await O(ke&&ke._f?{[ae]:ke}:ke)}))).every(Boolean),!(!he&&!n.isValid)&&x()):he=V=await O(r);return p.state.next({...!As(M)||d.isValid&&V!==n.isValid?{}:{name:M},...t.resolver||!M?{isValid:V}:{},errors:n.errors}),D.shouldFocus&&!he&&Au(r,A,M?ce:c.mount),he},fe=M=>{const D={...a.mount?o:s};return Yt(M)?D:As(M)?de(D,M):M.map(V=>de(D,V))},H=(M,D)=>({invalid:!!de((D||n).errors,M),isDirty:!!de((D||n).dirtyFields,M),error:de((D||n).errors,M),isValidating:!!de(n.validatingFields,M),isTouched:!!de((D||n).touchedFields,M)}),se=M=>{M&&Du(M).forEach(D=>cn(n.errors,D)),p.state.next({errors:M?n.errors:{}})},ne=(M,D,V)=>{const he=(de(r,M,{_f:{}})._f||{}).ref,ce=de(n.errors,M)||{},{ref:ae,message:ke,type:rt,...Pt}=ce;xt(n.errors,M,{...Pt,...D,ref:he}),p.state.next({name:M,errors:n.errors,isValid:!1}),V&&V.shouldFocus&&he&&he.focus&&he.focus()},le=(M,D)=>aa(M)?p.values.subscribe({next:V=>M(Y(void 0,D),V)}):Y(M,D,!0),oe=(M,D={})=>{for(const V of M?Du(M):c.mount)c.mount.delete(V),c.array.delete(V),D.keepValue||(cn(r,V),cn(o,V)),!D.keepError&&cn(n.errors,V),!D.keepDirty&&cn(n.dirtyFields,V),!D.keepTouched&&cn(n.touchedFields,V),!D.keepIsValidating&&cn(n.validatingFields,V),!t.shouldUnregister&&!D.keepDefaultValue&&cn(s,V);p.values.next({values:{...o}}),p.state.next({...n,...D.keepDirty?{isDirty:I()}:{}}),!D.keepIsValid&&x()},Q=({disabled:M,name:D,field:V,fields:he,value:ce})=>{if(Rs(M)&&a.mount||M){const ae=M?void 0:Yt(ce)?nv(V?V._f:de(he,D)._f):ce;xt(o,D,ae),C(D,ae,!1,!1,!0)}},Ee=(M,D={})=>{let V=de(r,M);const he=Rs(D.disabled);return xt(r,M,{...V||{},_f:{...V&&V._f?V._f:{ref:{name:M}},name:M,mount:!0,...D}}),c.mount.add(M),V?Q({field:V,disabled:D.disabled,name:M,value:D.value}):E(M,!0,D.value),{...he?{disabled:D.disabled}:{},...t.progressive?{required:!!D.required,min:ru(D.min),max:ru(D.max),minLength:ru(D.minLength),maxLength:ru(D.maxLength),pattern:ru(D.pattern)}:{},name:M,onChange:L,onBlur:L,ref:ce=>{if(ce){Ee(M,D),V=de(r,M);const ae=Yt(ce.value)&&ce.querySelectorAll&&ce.querySelectorAll("input,select,textarea")[0]||ce,ke=t8(ae),rt=V._f.refs||[];if(ke?rt.find(Pt=>Pt===ae):ae===V._f.ref)return;xt(r,M,{_f:{...V._f,...ke?{refs:[...rt.filter(tv),ae,...Array.isArray(de(s,M))?[{}]:[]],ref:{type:ae.type,name:M}}:{ref:ae}}}),E(M,!1,void 0,ae)}else V=de(r,M,{}),V._f&&(V._f.mount=!1),(t.shouldUnregister||D.shouldUnregister)&&!(sP(c.array,M)&&a.action)&&c.unMount.add(M)}}},Pe=()=>t.shouldFocusError&&Au(r,A,c.mount),Be=M=>{Rs(M)&&(p.state.next({disabled:M}),Au(r,(D,V)=>{const he=de(r,V);he&&(D.disabled=he._f.disabled||M,Array.isArray(he._f.refs)&&he._f.refs.forEach(ce=>{ce.disabled=he._f.disabled||M}))},0,!1))},Re=(M,D)=>async V=>{let he;V&&(V.preventDefault&&V.preventDefault(),V.persist&&V.persist());let ce=Xn(o);if(p.state.next({isSubmitting:!0}),t.resolver){const{errors:ae,values:ke}=await j();n.errors=ae,ce=ke}else await O(r);if(cn(n.errors,"root"),pr(n.errors)){p.state.next({errors:{}});try{await M(ce,V)}catch(ae){he=ae}}else D&&await D({...n.errors},V),Pe(),setTimeout(Pe);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:pr(n.errors)&&!he,submitCount:n.submitCount+1,errors:n.errors}),he)throw he},ve=(M,D={})=>{de(r,M)&&(Yt(D.defaultValue)?J(M,Xn(de(s,M))):(J(M,D.defaultValue),xt(s,M,Xn(D.defaultValue))),D.keepTouched||cn(n.touchedFields,M),D.keepDirty||(cn(n.dirtyFields,M),n.isDirty=D.defaultValue?I(M,Xn(de(s,M))):I()),D.keepError||(cn(n.errors,M),d.isValid&&x()),p.state.next({...n}))},ot=(M,D={})=>{const V=M?Xn(M):s,he=Xn(V),ce=pr(M),ae=ce?s:he;if(D.keepDefaultValues||(s=V),!D.keepValues){if(D.keepDirtyValues)for(const ke of c.mount)de(n.dirtyFields,ke)?xt(ae,ke,de(o,ke)):J(ke,de(ae,ke));else{if(Sw&&Yt(M))for(const ke of c.mount){const rt=de(r,ke);if(rt&&rt._f){const Pt=Array.isArray(rt._f.refs)?rt._f.refs[0]:rt._f.ref;if(gg(Pt)){const hn=Pt.closest("form");if(hn){hn.reset();break}}}}r={}}o=e.shouldUnregister?D.keepDefaultValues?Xn(s):{}:Xn(ae),p.array.next({values:{...ae}}),p.values.next({values:{...ae}})}c={mount:D.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!d.isValid||!!D.keepIsValid||!!D.keepDirtyValues,a.watch=!!e.shouldUnregister,p.state.next({submitCount:D.keepSubmitCount?n.submitCount:0,isDirty:ce?!1:D.keepDirty?n.isDirty:!!(D.keepDefaultValues&&!li(M,s)),isSubmitted:D.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:ce?{}:D.keepDirtyValues?D.keepDefaultValues&&o?$f(s,o):n.dirtyFields:D.keepDefaultValues&&M?$f(s,M):D.keepDirty?n.dirtyFields:{},touchedFields:D.keepTouched?n.touchedFields:{},errors:D.keepErrors?n.errors:{},isSubmitSuccessful:D.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Vt=(M,D)=>ot(aa(M)?M(o):M,D);return{control:{register:Ee,unregister:oe,getFieldState:H,handleSubmit:Re,setError:ne,_executeSchema:j,_getWatch:Y,_getDirty:I,_updateValid:x,_removeUnmounted:K,_updateFieldArray:y,_updateDisabledField:Q,_getFieldArray:q,_reset:ot,_resetDefaultValues:()=>aa(t.defaultValues)&&t.defaultValues().then(M=>{Vt(M,t.resetOptions),p.state.next({isLoading:!1})}),_updateFormState:M=>{n={...n,...M}},_disableForm:Be,_subjects:p,_proxyFormState:d,_setErrors:S,get _fields(){return r},get _formValues(){return o},get _state(){return a},set _state(M){a=M},get _defaultValues(){return s},get _names(){return c},set _names(M){c=M},get _formState(){return n},set _formState(M){n=M},get _options(){return t},set _options(M){t={...t,...M}}},trigger:X,register:Ee,handleSubmit:Re,watch:le,setValue:J,getValues:fe,reset:Vt,resetField:ve,clearErrors:se,unregister:oe,setError:ne,setFocus:(M,D={})=>{const V=de(r,M),he=V&&V._f;if(he){const ce=he.refs?he.refs[0]:he.ref;ce.focus&&(ce.focus(),D.shouldSelect&&ce.select())}},getFieldState:H}}function zt(e={}){const t=je.useRef(),n=je.useRef(),[r,s]=je.useState({isDirty:!1,isValidating:!1,isLoading:aa(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:aa(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...i8(e),formState:r});const o=t.current.control;return o._options=e,Ew({subject:o._subjects.state,next:a=>{lP(a,o._proxyFormState,o._updateFormState,!0)&&s({...o._formState})}}),je.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),je.useEffect(()=>{if(o._proxyFormState.isDirty){const a=o._getDirty();a!==r.isDirty&&o._subjects.state.next({isDirty:a})}},[o,r.isDirty]),je.useEffect(()=>{e.values&&!li(e.values,n.current)?(o._reset(e.values,o._options.resetOptions),n.current=e.values,s(a=>({...a}))):o._resetDefaultValues()},[e.values,o]),je.useEffect(()=>{e.errors&&o._setErrors(e.errors)},[e.errors,o]),je.useEffect(()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),je.useEffect(()=>{e.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})},[e.shouldUnregister,o]),t.current.formState=iP(r,o),t.current}const AC=(e,t,n)=>{if(e&&"reportValidity"in e){const r=de(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},yP=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?AC(r.ref,n,e):r.refs&&r.refs.forEach(s=>AC(s,n,e))}},l8=(e,t)=>{t.shouldUseNativeValidation&&yP(e,t);const n={};for(const r in e){const s=de(t.fields,r),o=Object.assign(e[r]||{},{ref:s&&s.ref});if(c8(t.names||Object.keys(e),r)){const a=Object.assign({},de(n,r));xt(a,"root",o),xt(n,r,a)}else xt(n,r,o)}return n},c8=(e,t)=>e.some(n=>n.startsWith(t+"."));var u8=function(e,t){for(var n={};e.length;){var r=e[0],s=r.code,o=r.message,a=r.path.join(".");if(!n[a])if("unionErrors"in r){var c=r.unionErrors[0].errors[0];n[a]={message:c.message,type:c.code}}else n[a]={message:o,type:s};if("unionErrors"in r&&r.unionErrors.forEach(function(d){return d.errors.forEach(function(p){return e.push(p)})}),t){var u=n[a].types,i=u&&u[r.code];n[a]=dP(a,t,n,s,i?[].concat(i,r.message):r.message)}e.shift()}return n},Ut=function(e,t,n){return n===void 0&&(n={}),function(r,s,o){try{return Promise.resolve(function(a,c){try{var u=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(i){return o.shouldUseNativeValidation&&yP({},o),{errors:{},values:n.raw?r:i}})}catch(i){return c(i)}return u&&u.then?u.then(void 0,c):u}(0,function(a){if(function(c){return Array.isArray(c==null?void 0:c.errors)}(a))return{values:{},errors:l8(u8(a.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw a}))}catch(a){return Promise.reject(a)}}},wn=[];for(var rv=0;rv<256;++rv)wn.push((rv+256).toString(16).slice(1));function d8(e,t=0){return(wn[e[t+0]]+wn[e[t+1]]+wn[e[t+2]]+wn[e[t+3]]+"-"+wn[e[t+4]]+wn[e[t+5]]+"-"+wn[e[t+6]]+wn[e[t+7]]+"-"+wn[e[t+8]]+wn[e[t+9]]+"-"+wn[e[t+10]]+wn[e[t+11]]+wn[e[t+12]]+wn[e[t+13]]+wn[e[t+14]]+wn[e[t+15]]).toLowerCase()}var Bf,f8=new Uint8Array(16);function p8(){if(!Bf&&(Bf=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Bf))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Bf(f8)}var g8=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const FC={randomUUID:g8};function LC(e,t,n){if(FC.randomUUID&&!t&&!e)return FC.randomUUID();e=e||{};var r=e.random||(e.rng||p8)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,d8(r)}var ft;(function(e){e.assertEqual=s=>s;function t(s){}e.assertIs=t;function n(s){throw new Error}e.assertNever=n,e.arrayToEnum=s=>{const o={};for(const a of s)o[a]=a;return o},e.getValidEnumValues=s=>{const o=e.objectKeys(s).filter(c=>typeof s[s[c]]!="number"),a={};for(const c of o)a[c]=s[c];return e.objectValues(a)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const a in s)Object.prototype.hasOwnProperty.call(s,a)&&o.push(a);return o},e.find=(s,o)=>{for(const a of s)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function r(s,o=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(ft||(ft={}));var rb;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(rb||(rb={}));const xe=ft.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Go=e=>{switch(typeof e){case"undefined":return xe.undefined;case"string":return xe.string;case"number":return isNaN(e)?xe.nan:xe.number;case"boolean":return xe.boolean;case"function":return xe.function;case"bigint":return xe.bigint;case"symbol":return xe.symbol;case"object":return Array.isArray(e)?xe.array:e===null?xe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?xe.promise:typeof Map<"u"&&e instanceof Map?xe.map:typeof Set<"u"&&e instanceof Set?xe.set:typeof Date<"u"&&e instanceof Date?xe.date:xe.object;default:return xe.unknown}},re=ft.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),h8=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Sr extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(o){return o.message},r={_errors:[]},s=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let c=r,u=0;for(;un.message){const n={},r=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Sr.create=e=>new Sr(e);const gc=(e,t)=>{let n;switch(e.code){case re.invalid_type:e.received===xe.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case re.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,ft.jsonStringifyReplacer)}`;break;case re.unrecognized_keys:n=`Unrecognized key(s) in object: ${ft.joinValues(e.keys,", ")}`;break;case re.invalid_union:n="Invalid input";break;case re.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ft.joinValues(e.options)}`;break;case re.invalid_enum_value:n=`Invalid enum value. Expected ${ft.joinValues(e.options)}, received '${e.received}'`;break;case re.invalid_arguments:n="Invalid function arguments";break;case re.invalid_return_type:n="Invalid function return type";break;case re.invalid_date:n="Invalid date";break;case re.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:ft.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case re.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case re.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case re.custom:n="Invalid input";break;case re.invalid_intersection_types:n="Intersection results could not be merged";break;case re.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case re.not_finite:n="Number must be finite";break;default:n=t.defaultError,ft.assertNever(e)}return{message:n}};let bP=gc;function m8(e){bP=e}function yg(){return bP}const bg=e=>{const{data:t,path:n,errorMaps:r,issueData:s}=e,o=[...n,...s.path||[]],a={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let c="";const u=r.filter(i=>!!i).slice().reverse();for(const i of u)c=i(a,{data:t,defaultError:c}).message;return{...s,path:o,message:c}},v8=[];function ye(e,t){const n=yg(),r=bg({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===gc?void 0:gc].filter(s=>!!s)});e.common.issues.push(r)}class $n{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const s of n){if(s.status==="aborted")return Ue;s.status==="dirty"&&t.dirty(),r.push(s.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const s of n){const o=await s.key,a=await s.value;r.push({key:o,value:a})}return $n.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const s of n){const{key:o,value:a}=s;if(o.status==="aborted"||a.status==="aborted")return Ue;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||s.alwaysSet)&&(r[o.value]=a.value)}return{status:t.value,value:r}}}const Ue=Object.freeze({status:"aborted"}),Nl=e=>({status:"dirty",value:e}),Jn=e=>({status:"valid",value:e}),sb=e=>e.status==="aborted",ob=e=>e.status==="dirty",md=e=>e.status==="valid",vd=e=>typeof Promise<"u"&&e instanceof Promise;function xg(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function xP(e,t,n,r,s){if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var Ne;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Ne||(Ne={}));var yu,bu;class Hs{constructor(t,n,r,s){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const $C=(e,t)=>{if(md(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Sr(e.common.issues);return this._error=n,this._error}}};function Ge(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:s}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(a,c)=>{var u,i;const{message:d}=e;return a.code==="invalid_enum_value"?{message:d??c.defaultError}:typeof c.data>"u"?{message:(u=d??r)!==null&&u!==void 0?u:c.defaultError}:a.code!=="invalid_type"?{message:c.defaultError}:{message:(i=d??n)!==null&&i!==void 0?i:c.defaultError}},description:s}}class Xe{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Go(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Go(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new $n,ctx:{common:t.parent.common,data:t.data,parsedType:Go(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(vd(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const s={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Go(t)},o=this._parseSync({data:t,path:s.path,parent:s});return $C(s,o)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Go(t)},s=this._parse({data:t,path:r.path,parent:r}),o=await(vd(s)?s:Promise.resolve(s));return $C(r,o)}refine(t,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,o)=>{const a=t(s),c=()=>o.addIssue({code:re.custom,...r(s)});return typeof Promise<"u"&&a instanceof Promise?a.then(u=>u?!0:(c(),!1)):a?!0:(c(),!1)})}refinement(t,n){return this._refinement((r,s)=>t(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(t){return new ps({schema:this,typeName:$e.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return zs.create(this,this._def)}nullable(){return ka.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ls.create(this,this._def)}promise(){return mc.create(this,this._def)}or(t){return wd.create([this,t],this._def)}and(t){return Sd.create(this,t,this._def)}transform(t){return new ps({...Ge(this._def),schema:this,typeName:$e.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Td({...Ge(this._def),innerType:this,defaultValue:n,typeName:$e.ZodDefault})}brand(){return new Tw({typeName:$e.ZodBranded,type:this,...Ge(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Md({...Ge(this._def),innerType:this,catchValue:n,typeName:$e.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return ef.create(this,t)}readonly(){return Nd.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const y8=/^c[^\s-]{8,}$/i,b8=/^[0-9a-z]+$/,x8=/^[0-9A-HJKMNP-TV-Z]{26}$/,w8=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,S8=/^[a-z0-9_-]{21}$/i,C8=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,E8=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,k8="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let sv;const j8=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,T8=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,M8=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,wP="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",N8=new RegExp(`^${wP}$`);function SP(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function _8(e){return new RegExp(`^${SP(e)}$`)}function CP(e){let t=`${wP}T${SP(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function P8(e,t){return!!((t==="v4"||!t)&&j8.test(e)||(t==="v6"||!t)&&T8.test(e))}class rs extends Xe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==xe.string){const o=this._getOrReturnCtx(t);return ye(o,{code:re.invalid_type,expected:xe.string,received:o.parsedType}),Ue}const r=new $n;let s;for(const o of this._def.checks)if(o.kind==="min")t.data.lengtho.value&&(s=this._getOrReturnCtx(t,s),ye(s,{code:re.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const a=t.data.length>o.value,c=t.data.lengtht.test(s),{validation:n,code:re.invalid_string,...Ne.errToObj(r)})}_addCheck(t){return new rs({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ne.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ne.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ne.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ne.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ne.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ne.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ne.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ne.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ne.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ne.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(r=t==null?void 0:t.local)!==null&&r!==void 0?r:!1,...Ne.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Ne.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Ne.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ne.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Ne.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ne.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ne.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ne.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ne.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ne.errToObj(n)})}nonempty(t){return this.min(1,Ne.errToObj(t))}trim(){return new rs({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new rs({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new rs({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new rs({checks:[],typeName:$e.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Ge(e)})};function R8(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r,o=parseInt(e.toFixed(s).replace(".","")),a=parseInt(t.toFixed(s).replace(".",""));return o%a/Math.pow(10,s)}class Sa extends Xe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==xe.number){const o=this._getOrReturnCtx(t);return ye(o,{code:re.invalid_type,expected:xe.number,received:o.parsedType}),Ue}let r;const s=new $n;for(const o of this._def.checks)o.kind==="int"?ft.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),ye(r,{code:re.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),ye(r,{code:re.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?R8(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),ye(r,{code:re.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),ye(r,{code:re.not_finite,message:o.message}),s.dirty()):ft.assertNever(o);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ne.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ne.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ne.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ne.toString(n))}setLimit(t,n,r,s){return new Sa({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ne.toString(s)}]})}_addCheck(t){return new Sa({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ne.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ne.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ne.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ne.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ne.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ne.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ne.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ne.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ne.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuet.kind==="int"||t.kind==="multipleOf"&&ft.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.valuenew Sa({checks:[],typeName:$e.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Ge(e)});class Ca extends Xe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==xe.bigint){const o=this._getOrReturnCtx(t);return ye(o,{code:re.invalid_type,expected:xe.bigint,received:o.parsedType}),Ue}let r;const s=new $n;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),ye(r,{code:re.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),ye(r,{code:re.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):ft.assertNever(o);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ne.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ne.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ne.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ne.toString(n))}setLimit(t,n,r,s){return new Ca({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ne.toString(s)}]})}_addCheck(t){return new Ca({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ne.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ne.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ne.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ne.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ne.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new Ca({checks:[],typeName:$e.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Ge(e)})};class yd extends Xe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==xe.boolean){const r=this._getOrReturnCtx(t);return ye(r,{code:re.invalid_type,expected:xe.boolean,received:r.parsedType}),Ue}return Jn(t.data)}}yd.create=e=>new yd({typeName:$e.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Ge(e)});class Di extends Xe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==xe.date){const o=this._getOrReturnCtx(t);return ye(o,{code:re.invalid_type,expected:xe.date,received:o.parsedType}),Ue}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return ye(o,{code:re.invalid_date}),Ue}const r=new $n;let s;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()o.value&&(s=this._getOrReturnCtx(t,s),ye(s,{code:re.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):ft.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Di({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ne.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ne.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuenew Di({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:$e.ZodDate,...Ge(e)});class wg extends Xe{_parse(t){if(this._getType(t)!==xe.symbol){const r=this._getOrReturnCtx(t);return ye(r,{code:re.invalid_type,expected:xe.symbol,received:r.parsedType}),Ue}return Jn(t.data)}}wg.create=e=>new wg({typeName:$e.ZodSymbol,...Ge(e)});class bd extends Xe{_parse(t){if(this._getType(t)!==xe.undefined){const r=this._getOrReturnCtx(t);return ye(r,{code:re.invalid_type,expected:xe.undefined,received:r.parsedType}),Ue}return Jn(t.data)}}bd.create=e=>new bd({typeName:$e.ZodUndefined,...Ge(e)});class xd extends Xe{_parse(t){if(this._getType(t)!==xe.null){const r=this._getOrReturnCtx(t);return ye(r,{code:re.invalid_type,expected:xe.null,received:r.parsedType}),Ue}return Jn(t.data)}}xd.create=e=>new xd({typeName:$e.ZodNull,...Ge(e)});class hc extends Xe{constructor(){super(...arguments),this._any=!0}_parse(t){return Jn(t.data)}}hc.create=e=>new hc({typeName:$e.ZodAny,...Ge(e)});class Si extends Xe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Jn(t.data)}}Si.create=e=>new Si({typeName:$e.ZodUnknown,...Ge(e)});class Eo extends Xe{_parse(t){const n=this._getOrReturnCtx(t);return ye(n,{code:re.invalid_type,expected:xe.never,received:n.parsedType}),Ue}}Eo.create=e=>new Eo({typeName:$e.ZodNever,...Ge(e)});class Sg extends Xe{_parse(t){if(this._getType(t)!==xe.undefined){const r=this._getOrReturnCtx(t);return ye(r,{code:re.invalid_type,expected:xe.void,received:r.parsedType}),Ue}return Jn(t.data)}}Sg.create=e=>new Sg({typeName:$e.ZodVoid,...Ge(e)});class ls extends Xe{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==xe.array)return ye(n,{code:re.invalid_type,expected:xe.array,received:n.parsedType}),Ue;if(s.exactLength!==null){const a=n.data.length>s.exactLength.value,c=n.data.lengths.maxLength.value&&(ye(n,{code:re.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,c)=>s.type._parseAsync(new Hs(n,a,n.path,c)))).then(a=>$n.mergeArray(r,a));const o=[...n.data].map((a,c)=>s.type._parseSync(new Hs(n,a,n.path,c)));return $n.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new ls({...this._def,minLength:{value:t,message:Ne.toString(n)}})}max(t,n){return new ls({...this._def,maxLength:{value:t,message:Ne.toString(n)}})}length(t,n){return new ls({...this._def,exactLength:{value:t,message:Ne.toString(n)}})}nonempty(t){return this.min(1,t)}}ls.create=(e,t)=>new ls({type:e,minLength:null,maxLength:null,exactLength:null,typeName:$e.ZodArray,...Ge(t)});function pl(e){if(e instanceof Ht){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=zs.create(pl(r))}return new Ht({...e._def,shape:()=>t})}else return e instanceof ls?new ls({...e._def,type:pl(e.element)}):e instanceof zs?zs.create(pl(e.unwrap())):e instanceof ka?ka.create(pl(e.unwrap())):e instanceof Ks?Ks.create(e.items.map(t=>pl(t))):e}class Ht extends Xe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=ft.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==xe.object){const i=this._getOrReturnCtx(t);return ye(i,{code:re.invalid_type,expected:xe.object,received:i.parsedType}),Ue}const{status:r,ctx:s}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),c=[];if(!(this._def.catchall instanceof Eo&&this._def.unknownKeys==="strip"))for(const i in s.data)a.includes(i)||c.push(i);const u=[];for(const i of a){const d=o[i],p=s.data[i];u.push({key:{status:"valid",value:i},value:d._parse(new Hs(s,p,s.path,i)),alwaysSet:i in s.data})}if(this._def.catchall instanceof Eo){const i=this._def.unknownKeys;if(i==="passthrough")for(const d of c)u.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(i==="strict")c.length>0&&(ye(s,{code:re.unrecognized_keys,keys:c}),r.dirty());else if(i!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const i=this._def.catchall;for(const d of c){const p=s.data[d];u.push({key:{status:"valid",value:d},value:i._parse(new Hs(s,p,s.path,d)),alwaysSet:d in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const i=[];for(const d of u){const p=await d.key,f=await d.value;i.push({key:p,value:f,alwaysSet:d.alwaysSet})}return i}).then(i=>$n.mergeObjectSync(r,i)):$n.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(t){return Ne.errToObj,new Ht({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var s,o,a,c;const u=(a=(o=(s=this._def).errorMap)===null||o===void 0?void 0:o.call(s,n,r).message)!==null&&a!==void 0?a:r.defaultError;return n.code==="unrecognized_keys"?{message:(c=Ne.errToObj(t).message)!==null&&c!==void 0?c:u}:{message:u}}}:{}})}strip(){return new Ht({...this._def,unknownKeys:"strip"})}passthrough(){return new Ht({...this._def,unknownKeys:"passthrough"})}extend(t){return new Ht({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Ht({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:$e.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Ht({...this._def,catchall:t})}pick(t){const n={};return ft.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Ht({...this._def,shape:()=>n})}omit(t){const n={};return ft.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Ht({...this._def,shape:()=>n})}deepPartial(){return pl(this)}partial(t){const n={};return ft.objectKeys(this.shape).forEach(r=>{const s=this.shape[r];t&&!t[r]?n[r]=s:n[r]=s.optional()}),new Ht({...this._def,shape:()=>n})}required(t){const n={};return ft.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof zs;)o=o._def.innerType;n[r]=o}}),new Ht({...this._def,shape:()=>n})}keyof(){return EP(ft.objectKeys(this.shape))}}Ht.create=(e,t)=>new Ht({shape:()=>e,unknownKeys:"strip",catchall:Eo.create(),typeName:$e.ZodObject,...Ge(t)});Ht.strictCreate=(e,t)=>new Ht({shape:()=>e,unknownKeys:"strict",catchall:Eo.create(),typeName:$e.ZodObject,...Ge(t)});Ht.lazycreate=(e,t)=>new Ht({shape:e,unknownKeys:"strip",catchall:Eo.create(),typeName:$e.ZodObject,...Ge(t)});class wd extends Xe{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function s(o){for(const c of o)if(c.result.status==="valid")return c.result;for(const c of o)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;const a=o.map(c=>new Sr(c.ctx.common.issues));return ye(n,{code:re.invalid_union,unionErrors:a}),Ue}if(n.common.async)return Promise.all(r.map(async o=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(s);{let o;const a=[];for(const u of r){const i={...n,common:{...n.common,issues:[]},parent:null},d=u._parseSync({data:n.data,path:n.path,parent:i});if(d.status==="valid")return d;d.status==="dirty"&&!o&&(o={result:d,ctx:i}),i.common.issues.length&&a.push(i.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const c=a.map(u=>new Sr(u));return ye(n,{code:re.invalid_union,unionErrors:c}),Ue}}get options(){return this._def.options}}wd.create=(e,t)=>new wd({options:e,typeName:$e.ZodUnion,...Ge(t)});const to=e=>e instanceof Ed?to(e.schema):e instanceof ps?to(e.innerType()):e instanceof kd?[e.value]:e instanceof Ea?e.options:e instanceof jd?ft.objectValues(e.enum):e instanceof Td?to(e._def.innerType):e instanceof bd?[void 0]:e instanceof xd?[null]:e instanceof zs?[void 0,...to(e.unwrap())]:e instanceof ka?[null,...to(e.unwrap())]:e instanceof Tw||e instanceof Nd?to(e.unwrap()):e instanceof Md?to(e._def.innerType):[];class Rh extends Xe{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==xe.object)return ye(n,{code:re.invalid_type,expected:xe.object,received:n.parsedType}),Ue;const r=this.discriminator,s=n.data[r],o=this.optionsMap.get(s);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(ye(n,{code:re.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Ue)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const s=new Map;for(const o of n){const a=to(o.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const c of a){if(s.has(c))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(c)}`);s.set(c,o)}}return new Rh({typeName:$e.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:s,...Ge(r)})}}function ab(e,t){const n=Go(e),r=Go(t);if(e===t)return{valid:!0,data:e};if(n===xe.object&&r===xe.object){const s=ft.objectKeys(t),o=ft.objectKeys(e).filter(c=>s.indexOf(c)!==-1),a={...e,...t};for(const c of o){const u=ab(e[c],t[c]);if(!u.valid)return{valid:!1};a[c]=u.data}return{valid:!0,data:a}}else if(n===xe.array&&r===xe.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let o=0;o{if(sb(o)||sb(a))return Ue;const c=ab(o.value,a.value);return c.valid?((ob(o)||ob(a))&&n.dirty(),{status:n.value,value:c.data}):(ye(r,{code:re.invalid_intersection_types}),Ue)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,a])=>s(o,a)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Sd.create=(e,t,n)=>new Sd({left:e,right:t,typeName:$e.ZodIntersection,...Ge(n)});class Ks extends Xe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==xe.array)return ye(r,{code:re.invalid_type,expected:xe.array,received:r.parsedType}),Ue;if(r.data.lengththis._def.items.length&&(ye(r,{code:re.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((a,c)=>{const u=this._def.items[c]||this._def.rest;return u?u._parse(new Hs(r,a,r.path,c)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>$n.mergeArray(n,a)):$n.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new Ks({...this._def,rest:t})}}Ks.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ks({items:e,typeName:$e.ZodTuple,rest:null,...Ge(t)})};class Cd extends Xe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==xe.object)return ye(r,{code:re.invalid_type,expected:xe.object,received:r.parsedType}),Ue;const s=[],o=this._def.keyType,a=this._def.valueType;for(const c in r.data)s.push({key:o._parse(new Hs(r,c,r.path,c)),value:a._parse(new Hs(r,r.data[c],r.path,c)),alwaysSet:c in r.data});return r.common.async?$n.mergeObjectAsync(n,s):$n.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Xe?new Cd({keyType:t,valueType:n,typeName:$e.ZodRecord,...Ge(r)}):new Cd({keyType:rs.create(),valueType:t,typeName:$e.ZodRecord,...Ge(n)})}}class Cg extends Xe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==xe.map)return ye(r,{code:re.invalid_type,expected:xe.map,received:r.parsedType}),Ue;const s=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([c,u],i)=>({key:s._parse(new Hs(r,c,r.path,[i,"key"])),value:o._parse(new Hs(r,u,r.path,[i,"value"]))}));if(r.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const u of a){const i=await u.key,d=await u.value;if(i.status==="aborted"||d.status==="aborted")return Ue;(i.status==="dirty"||d.status==="dirty")&&n.dirty(),c.set(i.value,d.value)}return{status:n.value,value:c}})}else{const c=new Map;for(const u of a){const i=u.key,d=u.value;if(i.status==="aborted"||d.status==="aborted")return Ue;(i.status==="dirty"||d.status==="dirty")&&n.dirty(),c.set(i.value,d.value)}return{status:n.value,value:c}}}}Cg.create=(e,t,n)=>new Cg({valueType:t,keyType:e,typeName:$e.ZodMap,...Ge(n)});class Ai extends Xe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==xe.set)return ye(r,{code:re.invalid_type,expected:xe.set,received:r.parsedType}),Ue;const s=this._def;s.minSize!==null&&r.data.sizes.maxSize.value&&(ye(r,{code:re.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const o=this._def.valueType;function a(u){const i=new Set;for(const d of u){if(d.status==="aborted")return Ue;d.status==="dirty"&&n.dirty(),i.add(d.value)}return{status:n.value,value:i}}const c=[...r.data.values()].map((u,i)=>o._parse(new Hs(r,u,r.path,i)));return r.common.async?Promise.all(c).then(u=>a(u)):a(c)}min(t,n){return new Ai({...this._def,minSize:{value:t,message:Ne.toString(n)}})}max(t,n){return new Ai({...this._def,maxSize:{value:t,message:Ne.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Ai.create=(e,t)=>new Ai({valueType:e,minSize:null,maxSize:null,typeName:$e.ZodSet,...Ge(t)});class Bl extends Xe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==xe.function)return ye(n,{code:re.invalid_type,expected:xe.function,received:n.parsedType}),Ue;function r(c,u){return bg({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,yg(),gc].filter(i=>!!i),issueData:{code:re.invalid_arguments,argumentsError:u}})}function s(c,u){return bg({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,yg(),gc].filter(i=>!!i),issueData:{code:re.invalid_return_type,returnTypeError:u}})}const o={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof mc){const c=this;return Jn(async function(...u){const i=new Sr([]),d=await c._def.args.parseAsync(u,o).catch(g=>{throw i.addIssue(r(u,g)),i}),p=await Reflect.apply(a,this,d);return await c._def.returns._def.type.parseAsync(p,o).catch(g=>{throw i.addIssue(s(p,g)),i})})}else{const c=this;return Jn(function(...u){const i=c._def.args.safeParse(u,o);if(!i.success)throw new Sr([r(u,i.error)]);const d=Reflect.apply(a,this,i.data),p=c._def.returns.safeParse(d,o);if(!p.success)throw new Sr([s(d,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Bl({...this._def,args:Ks.create(t).rest(Si.create())})}returns(t){return new Bl({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Bl({args:t||Ks.create([]).rest(Si.create()),returns:n||Si.create(),typeName:$e.ZodFunction,...Ge(r)})}}class Ed extends Xe{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Ed.create=(e,t)=>new Ed({getter:e,typeName:$e.ZodLazy,...Ge(t)});class kd extends Xe{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return ye(n,{received:n.data,code:re.invalid_literal,expected:this._def.value}),Ue}return{status:"valid",value:t.data}}get value(){return this._def.value}}kd.create=(e,t)=>new kd({value:e,typeName:$e.ZodLiteral,...Ge(t)});function EP(e,t){return new Ea({values:e,typeName:$e.ZodEnum,...Ge(t)})}class Ea extends Xe{constructor(){super(...arguments),yu.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return ye(n,{expected:ft.joinValues(r),received:n.parsedType,code:re.invalid_type}),Ue}if(xg(this,yu)||xP(this,yu,new Set(this._def.values)),!xg(this,yu).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return ye(n,{received:n.data,code:re.invalid_enum_value,options:r}),Ue}return Jn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return Ea.create(t,{...this._def,...n})}exclude(t,n=this._def){return Ea.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}yu=new WeakMap;Ea.create=EP;class jd extends Xe{constructor(){super(...arguments),bu.set(this,void 0)}_parse(t){const n=ft.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==xe.string&&r.parsedType!==xe.number){const s=ft.objectValues(n);return ye(r,{expected:ft.joinValues(s),received:r.parsedType,code:re.invalid_type}),Ue}if(xg(this,bu)||xP(this,bu,new Set(ft.getValidEnumValues(this._def.values))),!xg(this,bu).has(t.data)){const s=ft.objectValues(n);return ye(r,{received:r.data,code:re.invalid_enum_value,options:s}),Ue}return Jn(t.data)}get enum(){return this._def.values}}bu=new WeakMap;jd.create=(e,t)=>new jd({values:e,typeName:$e.ZodNativeEnum,...Ge(t)});class mc extends Xe{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==xe.promise&&n.common.async===!1)return ye(n,{code:re.invalid_type,expected:xe.promise,received:n.parsedType}),Ue;const r=n.parsedType===xe.promise?n.data:Promise.resolve(n.data);return Jn(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}mc.create=(e,t)=>new mc({type:e,typeName:$e.ZodPromise,...Ge(t)});class ps extends Xe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===$e.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=this._def.effect||null,o={addIssue:a=>{ye(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){const a=s.transform(r.data,o);if(r.common.async)return Promise.resolve(a).then(async c=>{if(n.value==="aborted")return Ue;const u=await this._def.schema._parseAsync({data:c,path:r.path,parent:r});return u.status==="aborted"?Ue:u.status==="dirty"||n.value==="dirty"?Nl(u.value):u});{if(n.value==="aborted")return Ue;const c=this._def.schema._parseSync({data:a,path:r.path,parent:r});return c.status==="aborted"?Ue:c.status==="dirty"||n.value==="dirty"?Nl(c.value):c}}if(s.type==="refinement"){const a=c=>{const u=s.refinement(c,o);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(r.common.async===!1){const c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return c.status==="aborted"?Ue:(c.status==="dirty"&&n.dirty(),a(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>c.status==="aborted"?Ue:(c.status==="dirty"&&n.dirty(),a(c.value).then(()=>({status:n.value,value:c.value}))))}if(s.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!md(a))return a;const c=s.transform(a.value,o);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>md(a)?Promise.resolve(s.transform(a.value,o)).then(c=>({status:n.value,value:c})):a);ft.assertNever(s)}}ps.create=(e,t,n)=>new ps({schema:e,typeName:$e.ZodEffects,effect:t,...Ge(n)});ps.createWithPreprocess=(e,t,n)=>new ps({schema:t,effect:{type:"preprocess",transform:e},typeName:$e.ZodEffects,...Ge(n)});class zs extends Xe{_parse(t){return this._getType(t)===xe.undefined?Jn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}zs.create=(e,t)=>new zs({innerType:e,typeName:$e.ZodOptional,...Ge(t)});class ka extends Xe{_parse(t){return this._getType(t)===xe.null?Jn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ka.create=(e,t)=>new ka({innerType:e,typeName:$e.ZodNullable,...Ge(t)});class Td extends Xe{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===xe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Td.create=(e,t)=>new Td({innerType:e,typeName:$e.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ge(t)});class Md extends Xe{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return vd(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Sr(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Sr(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Md.create=(e,t)=>new Md({innerType:e,typeName:$e.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ge(t)});class Eg extends Xe{_parse(t){if(this._getType(t)!==xe.nan){const r=this._getOrReturnCtx(t);return ye(r,{code:re.invalid_type,expected:xe.nan,received:r.parsedType}),Ue}return{status:"valid",value:t.data}}}Eg.create=e=>new Eg({typeName:$e.ZodNaN,...Ge(e)});const O8=Symbol("zod_brand");class Tw extends Xe{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class ef extends Xe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Ue:o.status==="dirty"?(n.dirty(),Nl(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Ue:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(t,n){return new ef({in:t,out:n,typeName:$e.ZodPipeline})}}class Nd extends Xe{_parse(t){const n=this._def.innerType._parse(t),r=s=>(md(s)&&(s.value=Object.freeze(s.value)),s);return vd(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}Nd.create=(e,t)=>new Nd({innerType:e,typeName:$e.ZodReadonly,...Ge(t)});function kP(e,t={},n){return e?hc.create().superRefine((r,s)=>{var o,a;if(!e(r)){const c=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,u=(a=(o=c.fatal)!==null&&o!==void 0?o:n)!==null&&a!==void 0?a:!0,i=typeof c=="string"?{message:c}:c;s.addIssue({code:"custom",...i,fatal:u})}}):hc.create()}const I8={object:Ht.lazycreate};var $e;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})($e||($e={}));const D8=(e,t={message:`Input not instance of ${e.name}`})=>kP(n=>n instanceof e,t),jP=rs.create,TP=Sa.create,A8=Eg.create,F8=Ca.create,MP=yd.create,L8=Di.create,$8=wg.create,B8=bd.create,z8=xd.create,U8=hc.create,V8=Si.create,H8=Eo.create,K8=Sg.create,q8=ls.create,W8=Ht.create,G8=Ht.strictCreate,J8=wd.create,Q8=Rh.create,Z8=Sd.create,Y8=Ks.create,X8=Cd.create,e6=Cg.create,t6=Ai.create,n6=Bl.create,r6=Ed.create,s6=kd.create,o6=Ea.create,a6=jd.create,i6=mc.create,BC=ps.create,l6=zs.create,c6=ka.create,u6=ps.createWithPreprocess,d6=ef.create,f6=()=>jP().optional(),p6=()=>TP().optional(),g6=()=>MP().optional(),h6={string:e=>rs.create({...e,coerce:!0}),number:e=>Sa.create({...e,coerce:!0}),boolean:e=>yd.create({...e,coerce:!0}),bigint:e=>Ca.create({...e,coerce:!0}),date:e=>Di.create({...e,coerce:!0})},m6=Ue;var k=Object.freeze({__proto__:null,defaultErrorMap:gc,setErrorMap:m8,getErrorMap:yg,makeIssue:bg,EMPTY_PATH:v8,addIssueToContext:ye,ParseStatus:$n,INVALID:Ue,DIRTY:Nl,OK:Jn,isAborted:sb,isDirty:ob,isValid:md,isAsync:vd,get util(){return ft},get objectUtil(){return rb},ZodParsedType:xe,getParsedType:Go,ZodType:Xe,datetimeRegex:CP,ZodString:rs,ZodNumber:Sa,ZodBigInt:Ca,ZodBoolean:yd,ZodDate:Di,ZodSymbol:wg,ZodUndefined:bd,ZodNull:xd,ZodAny:hc,ZodUnknown:Si,ZodNever:Eo,ZodVoid:Sg,ZodArray:ls,ZodObject:Ht,ZodUnion:wd,ZodDiscriminatedUnion:Rh,ZodIntersection:Sd,ZodTuple:Ks,ZodRecord:Cd,ZodMap:Cg,ZodSet:Ai,ZodFunction:Bl,ZodLazy:Ed,ZodLiteral:kd,ZodEnum:Ea,ZodNativeEnum:jd,ZodPromise:mc,ZodEffects:ps,ZodTransformer:ps,ZodOptional:zs,ZodNullable:ka,ZodDefault:Td,ZodCatch:Md,ZodNaN:Eg,BRAND:O8,ZodBranded:Tw,ZodPipeline:ef,ZodReadonly:Nd,custom:kP,Schema:Xe,ZodSchema:Xe,late:I8,get ZodFirstPartyTypeKind(){return $e},coerce:h6,any:U8,array:q8,bigint:F8,boolean:MP,date:L8,discriminatedUnion:Q8,effect:BC,enum:o6,function:n6,instanceof:D8,intersection:Z8,lazy:r6,literal:s6,map:e6,nan:A8,nativeEnum:a6,never:H8,null:z8,nullable:c6,number:TP,object:W8,oboolean:g6,onumber:p6,optional:l6,ostring:f6,pipeline:d6,preprocess:u6,promise:i6,record:X8,set:t6,strictObject:G8,string:jP,symbol:$8,transformer:BC,tuple:Y8,undefined:B8,union:J8,unknown:V8,void:K8,NEVER:m6,ZodIssueCode:re,quotelessJson:h8,ZodError:Sr}),NP=v.createContext({dragDropManager:void 0}),Lr;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Lr||(Lr={}));function Ke(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),s=2;s-1})}var w6={type:Mw,payload:{clientOffset:null,sourceClientOffset:null}};function S6(e){return function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{publishSource:!0},s=r.publishSource,o=s===void 0?!0:s,a=r.clientOffset,c=r.getSourceClientOffset,u=e.getMonitor(),i=e.getRegistry();e.dispatch(zC(a)),C6(n,u,i);var d=j6(n,u);if(d===null){e.dispatch(w6);return}var p=null;if(a){if(!c)throw new Error("getSourceClientOffset must be defined");E6(c),p=c(d)}e.dispatch(zC(a,p));var f=i.getSource(d),g=f.beginDrag(u,d);if(g!=null){k6(g),i.pinSource(d);var h=i.getSourceType(d);return{type:Oh,payload:{itemType:h,item:g,sourceId:d,clientOffset:a||null,sourceClientOffset:p||null,isSourcePublic:!!o}}}}}function C6(e,t,n){Ke(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(r){Ke(n.getSource(r),"Expected sourceIds to be registered.")})}function E6(e){Ke(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function k6(e){Ke(_P(e),"Item must be an object.")}function j6(e,t){for(var n=null,r=e.length-1;r>=0;r--)if(t.canDragSource(e[r])){n=e[r];break}return n}function T6(e){return function(){var n=e.getMonitor();if(n.isDragging())return{type:Nw}}}function ib(e,t){return t===null?e===null:Array.isArray(e)?e.some(function(n){return n===t}):e===t}function M6(e){return function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=r.clientOffset;N6(n);var o=n.slice(0),a=e.getMonitor(),c=e.getRegistry();_6(o,a,c);var u=a.getItemType();return P6(o,c,u),R6(o,a,c),{type:Ih,payload:{targetIds:o,clientOffset:s||null}}}}function N6(e){Ke(Array.isArray(e),"Expected targetIds to be an array.")}function _6(e,t,n){Ke(t.isDragging(),"Cannot call hover while not dragging."),Ke(!t.didDrop(),"Cannot call hover after drop.");for(var r=0;r=0;r--){var s=e[r],o=t.getTargetType(s);ib(o,n)||e.splice(r,1)}}function R6(e,t,n){e.forEach(function(r){var s=n.getTarget(r);s.hover(t,r)})}function UC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function VC(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{},r=e.getMonitor(),s=e.getRegistry();D6(r);var o=L6(r);o.forEach(function(a,c){var u=A6(a,c,s,r),i={type:Dh,payload:{dropResult:VC(VC({},n),u)}};e.dispatch(i)})}}function D6(e){Ke(e.isDragging(),"Cannot call drop while not dragging."),Ke(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function A6(e,t,n,r){var s=n.getTarget(e),o=s?s.drop(r,e):void 0;return F6(o),typeof o>"u"&&(o=t===0?{}:r.getDropResult()),o}function F6(e){Ke(typeof e>"u"||_P(e),"Drop result must either be an object or undefined.")}function L6(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function $6(e){return function(){var n=e.getMonitor(),r=e.getRegistry();B6(n);var s=n.getSourceId();if(s!=null){var o=r.getSource(s,!0);o.endDrag(n,s),r.unpinSource()}return{type:Ah}}}function B6(e){Ke(e.isDragging(),"Cannot call endDrag while not dragging.")}function z6(e){return{beginDrag:S6(e),publishDragSource:T6(e),hover:M6(e),drop:I6(e),endDrag:$6(e)}}function U6(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function V6(e,t){for(var n=0;n0;r.backend&&(s&&!r.isSetUp?(r.backend.setup(),r.isSetUp=!0):!s&&r.isSetUp&&(r.backend.teardown(),r.isSetUp=!1))}),this.store=t,this.monitor=n,t.subscribe(this.handleRefCountChange)}return H6(e,[{key:"receiveBackend",value:function(n){this.backend=n}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var n=this,r=this.store.dispatch;function s(a){return function(){for(var c=arguments.length,u=new Array(c),i=0;i"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(_r(1));return n(PP)(e,t)}if(typeof e!="function")throw new Error(_r(2));var s=e,o=t,a=[],c=a,u=!1;function i(){c===a&&(c=a.slice())}function d(){if(u)throw new Error(_r(3));return o}function p(m){if(typeof m!="function")throw new Error(_r(4));if(u)throw new Error(_r(5));var x=!0;return i(),c.push(m),function(){if(x){if(u)throw new Error(_r(6));x=!1,i();var y=c.indexOf(m);c.splice(y,1),a=null}}}function f(m){if(!q6(m))throw new Error(_r(7));if(typeof m.type>"u")throw new Error(_r(8));if(u)throw new Error(_r(9));try{u=!0,o=s(o,m)}finally{u=!1}for(var x=a=c,b=0;b2&&arguments[2]!==void 0?arguments[2]:W6;if(e.length!==t.length)return!1;for(var r=0;r0&&arguments[0]!==void 0?arguments[0]:GC,t=arguments.length>1?arguments[1]:void 0,n=t.payload;switch(t.type){case Mw:case Oh:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case Ih:return G6(e.clientOffset,n.clientOffset)?e:WC(WC({},e),{},{clientOffset:n.clientOffset});case Ah:case Dh:return GC;default:return e}}var _w="dnd-core/ADD_SOURCE",Pw="dnd-core/ADD_TARGET",Rw="dnd-core/REMOVE_SOURCE",Fh="dnd-core/REMOVE_TARGET";function Y6(e){return{type:_w,payload:{sourceId:e}}}function X6(e){return{type:Pw,payload:{targetId:e}}}function eH(e){return{type:Rw,payload:{sourceId:e}}}function tH(e){return{type:Fh,payload:{targetId:e}}}function JC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Pr(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:rH,t=arguments.length>1?arguments[1]:void 0,n=t.payload;switch(t.type){case Oh:return Pr(Pr({},e),{},{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case Nw:return Pr(Pr({},e),{},{isSourcePublic:!0});case Ih:return Pr(Pr({},e),{},{targetIds:n.targetIds});case Fh:return e.targetIds.indexOf(n.targetId)===-1?e:Pr(Pr({},e),{},{targetIds:y6(e.targetIds,n.targetId)});case Dh:return Pr(Pr({},e),{},{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case Ah:return Pr(Pr({},e),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function oH(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case _w:case Pw:return e+1;case Rw:case Fh:return e-1;default:return e}}var kg=[],Ow=[];kg.__IS_NONE__=!0;Ow.__IS_ALL__=!0;function aH(e,t){if(e===kg)return!1;if(e===Ow||typeof t>"u")return!0;var n=x6(t,e);return n.length>0}function iH(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case Ih:break;case _w:case Pw:case Fh:case Rw:return kg;case Oh:case Nw:case Ah:case Dh:default:return Ow}var t=e.payload,n=t.targetIds,r=n===void 0?[]:n,s=t.prevTargetIds,o=s===void 0?[]:s,a=b6(r,o),c=a.length>0||!J6(r,o);if(!c)return kg;var u=o[o.length-1],i=r[r.length-1];return u!==i&&(u&&a.push(u),i&&a.push(i)),a}function lH(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e+1}function QC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function ZC(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:iH(e.dirtyHandlerIds,{type:t.type,payload:ZC(ZC({},t.payload),{},{prevTargetIds:v6(e,"dragOperation.targetIds",[])})}),dragOffset:Z6(e.dragOffset,t),refCount:oH(e.refCount,t),dragOperation:sH(e.dragOperation,t),stateId:lH(e.stateId)}}function dH(e,t){return{x:e.x+t.x,y:e.y+t.y}}function RP(e,t){return{x:e.x-t.x,y:e.y-t.y}}function fH(e){var t=e.clientOffset,n=e.initialClientOffset,r=e.initialSourceClientOffset;return!t||!n||!r?null:RP(dH(t,r),n)}function pH(e){var t=e.clientOffset,n=e.initialClientOffset;return!t||!n?null:RP(t,n)}function gH(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hH(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0},o=s.handlerIds;Ke(typeof n=="function","listener must be a function."),Ke(typeof o>"u"||Array.isArray(o),"handlerIds, when specified, must be an array of strings.");var a=this.store.getState().stateId,c=function(){var i=r.store.getState(),d=i.stateId;try{var p=d===a||d===a+1&&!aH(i.dirtyHandlerIds,o);p||n()}finally{a=d}};return this.store.subscribe(c)}},{key:"subscribeToOffsetChange",value:function(n){var r=this;Ke(typeof n=="function","listener must be a function.");var s=this.store.getState().dragOffset,o=function(){var c=r.store.getState().dragOffset;c!==s&&(s=c,n())};return this.store.subscribe(o)}},{key:"canDragSource",value:function(n){if(!n)return!1;var r=this.registry.getSource(n);return Ke(r,"Expected to find a valid source. sourceId=".concat(n)),this.isDragging()?!1:r.canDrag(this,n)}},{key:"canDropOnTarget",value:function(n){if(!n)return!1;var r=this.registry.getTarget(n);if(Ke(r,"Expected to find a valid target. targetId=".concat(n)),!this.isDragging()||this.didDrop())return!1;var s=this.registry.getTargetType(n),o=this.getItemType();return ib(s,o)&&r.canDrop(this,n)}},{key:"isDragging",value:function(){return!!this.getItemType()}},{key:"isDraggingSource",value:function(n){if(!n)return!1;var r=this.registry.getSource(n,!0);if(Ke(r,"Expected to find a valid source. sourceId=".concat(n)),!this.isDragging()||!this.isSourcePublic())return!1;var s=this.registry.getSourceType(n),o=this.getItemType();return s!==o?!1:r.isDragging(this,n)}},{key:"isOverTarget",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shallow:!1};if(!n)return!1;var s=r.shallow;if(!this.isDragging())return!1;var o=this.registry.getTargetType(n),a=this.getItemType();if(a&&!ib(o,a))return!1;var c=this.getTargetIds();if(!c.length)return!1;var u=c.indexOf(n);return s?u===c.length-1:u>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return!!this.store.getState().dragOperation.isSourcePublic}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return fH(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return pH(this.store.getState().dragOffset)}}]),e}(),yH=0;function bH(){return yH++}function xp(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?xp=function(n){return typeof n}:xp=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},xp(e)}function xH(e){Ke(typeof e.canDrag=="function","Expected canDrag to be a function."),Ke(typeof e.beginDrag=="function","Expected beginDrag to be a function."),Ke(typeof e.endDrag=="function","Expected endDrag to be a function.")}function wH(e){Ke(typeof e.canDrop=="function","Expected canDrop to be a function."),Ke(typeof e.hover=="function","Expected hover to be a function."),Ke(typeof e.drop=="function","Expected beginDrag to be a function.")}function lb(e,t){if(t&&Array.isArray(e)){e.forEach(function(n){return lb(n,!1)});return}Ke(typeof e=="string"||xp(e)==="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}const XC=typeof global<"u"?global:self,OP=XC.MutationObserver||XC.WebKitMutationObserver;function IP(e){return function(){const n=setTimeout(s,0),r=setInterval(s,50);function s(){clearTimeout(n),clearInterval(r),e()}}}function SH(e){let t=1;const n=new OP(e),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}const CH=typeof OP=="function"?SH:IP;class EH{enqueueTask(t){const{queue:n,requestFlush:r}=this;n.length||(r(),this.flushing=!0),n[n.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.indexthis.capacity){for(let r=0,s=t.length-this.index;r{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=CH(this.flush),this.requestErrorThrow=IP(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class kH{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,n){this.onError=t,this.release=n,this.task=null}}class jH{create(t){const n=this.freeTasks,r=n.length?n.pop():new kH(this.onError,s=>n[n.length]=s);return r.task=t,r}constructor(t){this.onError=t,this.freeTasks=[]}}const DP=new EH,TH=new jH(DP.registerPendingError);function MH(e){DP.enqueueTask(TH.create(e))}function NH(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _H(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:!1;Ke(this.isSourceId(n),"Expected a valid source ID.");var s=r&&n===this.pinnedSourceId,o=s?this.pinnedSource:this.dragSources.get(n);return o}},{key:"getTarget",value:function(n){return Ke(this.isTargetId(n),"Expected a valid target ID."),this.dropTargets.get(n)}},{key:"getSourceType",value:function(n){return Ke(this.isSourceId(n),"Expected a valid source ID."),this.types.get(n)}},{key:"getTargetType",value:function(n){return Ke(this.isTargetId(n),"Expected a valid target ID."),this.types.get(n)}},{key:"isSourceId",value:function(n){var r=t1(n);return r===Lr.SOURCE}},{key:"isTargetId",value:function(n){var r=t1(n);return r===Lr.TARGET}},{key:"removeSource",value:function(n){var r=this;Ke(this.getSource(n),"Expected an existing source."),this.store.dispatch(eH(n)),MH(function(){r.dragSources.delete(n),r.types.delete(n)})}},{key:"removeTarget",value:function(n){Ke(this.getTarget(n),"Expected an existing target."),this.store.dispatch(tH(n)),this.dropTargets.delete(n),this.types.delete(n)}},{key:"pinSource",value:function(n){var r=this.getSource(n);Ke(r,"Expected an existing source."),this.pinnedSourceId=n,this.pinnedSource=r}},{key:"unpinSource",value:function(){Ke(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(n,r,s){var o=FH(n);return this.types.set(o,r),n===Lr.SOURCE?this.dragSources.set(o,s):n===Lr.TARGET&&this.dropTargets.set(o,s),o}}]),e}();function $H(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,s=BH(r),o=new vH(s,new LH(s)),a=new K6(s,o),c=e(a,t,n);return a.receiveBackend(c),a}function BH(e){var t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return PP(uH,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}var zH=["children"];function UH(e,t){return qH(e)||KH(e,t)||HH(e,t)||VH()}function VH(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HH(e,t){if(e){if(typeof e=="string")return r1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r1(e,t)}}function r1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function GH(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,o;for(o=0;o=0)&&(n[s]=e[s]);return n}var s1=0,wp=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),JH=v.memo(function(t){var n=t.children,r=WH(t,zH),s=QH(r),o=UH(s,2),a=o[0],c=o[1];return v.useEffect(function(){if(c){var u=AP();return++s1,function(){--s1===0&&(u[wp]=null)}}},[]),l.jsx(NP.Provider,Object.assign({value:a},{children:n}),void 0)});function QH(e){if("manager"in e){var t={dragDropManager:e.manager};return[t,!1]}var n=ZH(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[n,r]}function ZH(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:AP(),n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,s=t;return s[wp]||(s[wp]={dragDropManager:$H(e,t,n,r)}),s[wp]}function AP(){return typeof global<"u"?global:window}function YH(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function XH(e,t){for(var n=0;n, or turn it into a ")+"drag source or a drop target itself.")}}function iK(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!v.isValidElement(t)){var r=t;return e(r,n),r}var s=t;aK(s);var o=n?function(a){return e(a,n)}:e;return lK(s,o)}}function FP(e){var t={};return Object.keys(e).forEach(function(n){var r=e[n];if(n.endsWith("Ref"))t[n]=e[n];else{var s=iK(r);t[n]=function(){return s}}}),t}function i1(e,t){typeof e=="function"?e(t):e.current=t}function lK(e,t){var n=e.ref;return Ke(typeof n!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a or
. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?v.cloneElement(e,{ref:function(s){i1(n,s),i1(t,s)}}):v.cloneElement(e,{ref:t})}function Sp(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Sp=function(n){return typeof n}:Sp=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Sp(e)}function cb(e){return e!==null&&Sp(e)==="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function ub(e,t,n,r){var s=void 0;if(s!==void 0)return!!s;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;var o=Object.keys(e),a=Object.keys(t);if(o.length!==a.length)return!1;for(var c=Object.prototype.hasOwnProperty.bind(t),u=0;ue.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0}},{key:"leave",value:function(n){var r=this.entered.length;return this.entered=v7(this.entered.filter(this.isNodeInDocument),n),r>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),e}(),C7=BP(function(){return/firefox/i.test(navigator.userAgent)}),zP=BP(function(){return!!window.safari});function E7(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function k7(e,t){for(var n=0;nn)d=p-1;else return s[p]}u=Math.max(0,d);var g=n-r[u],h=g*g;return s[u]+o[u]*g+a[u]*h+c[u]*g*h}}]),e}(),T7=1;function UP(e){var t=e.nodeType===T7?e:e.parentElement;if(!t)return null;var n=t.getBoundingClientRect(),r=n.top,s=n.left;return{x:s,y:r}}function zf(e){return{x:e.clientX,y:e.clientY}}function M7(e){var t;return e.nodeName==="IMG"&&(C7()||!((t=document.documentElement)!==null&&t!==void 0&&t.contains(e)))}function N7(e,t,n,r){var s=e?t.width:n,o=e?t.height:r;return zP()&&e&&(o/=window.devicePixelRatio,s/=window.devicePixelRatio),{dragPreviewWidth:s,dragPreviewHeight:o}}function _7(e,t,n,r,s){var o=M7(t),a=o?e:t,c=UP(a),u={x:n.x-c.x,y:n.y-c.y},i=e.offsetWidth,d=e.offsetHeight,p=r.anchorX,f=r.anchorY,g=N7(o,t,i,d),h=g.dragPreviewWidth,m=g.dragPreviewHeight,x=function(){var T=new g1([0,.5,1],[u.y,u.y/d*m,u.y+m-d]),j=T.interpolate(f);return zP()&&o&&(j+=(window.devicePixelRatio-1)*m),j},b=function(){var T=new g1([0,.5,1],[u.x,u.x/i*h,u.x+h-i]);return T.interpolate(p)},y=s.offsetX,w=s.offsetY,S=y===0||y,E=w===0||w;return{x:S?y:b(),y:E?w:x()}}var VP="__NATIVE_FILE__",HP="__NATIVE_URL__",KP="__NATIVE_TEXT__",qP="__NATIVE_HTML__";const h1=Object.freeze(Object.defineProperty({__proto__:null,FILE:VP,HTML:qP,TEXT:KP,URL:HP},Symbol.toStringTag,{value:"Module"}));function uv(e,t,n){var r=t.reduce(function(s,o){return s||e.getData(o)},"");return r??n}var ll;function Uf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var fb=(ll={},Uf(ll,VP,{exposeProperties:{files:function(t){return Array.prototype.slice.call(t.files)},items:function(t){return t.items},dataTransfer:function(t){return t}},matchesTypes:["Files"]}),Uf(ll,qP,{exposeProperties:{html:function(t,n){return uv(t,n,"")},dataTransfer:function(t){return t}},matchesTypes:["Html","text/html"]}),Uf(ll,HP,{exposeProperties:{urls:function(t,n){return uv(t,n,"").split(` -`)},dataTransfer:function(t){return t}},matchesTypes:["Url","text/uri-list"]}),Uf(ll,KP,{exposeProperties:{text:function(t,n){return uv(t,n,"")},dataTransfer:function(t){return t}},matchesTypes:["Text","text/plain"]}),ll);function P7(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function R7(e,t){for(var n=0;n-1})})[0]||null}function A7(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F7(e,t){for(var n=0;n0&&s.actions.hover(a,{clientOffset:zf(o)});var c=a.some(function(u){return s.monitor.canDropOnTarget(u)});c&&(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=s.getCurrentDropEffect()))}}),at(this,"handleTopDragOverCapture",function(){s.dragOverTargetIds=[]}),at(this,"handleTopDragOver",function(o){var a=s.dragOverTargetIds;if(s.dragOverTargetIds=[],!s.monitor.isDragging()){o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none");return}s.altKeyPressed=o.altKey,s.lastClientOffset=zf(o),s.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(s.hoverRafId=requestAnimationFrame(function(){s.monitor.isDragging()&&s.actions.hover(a||[],{clientOffset:s.lastClientOffset}),s.hoverRafId=null}));var c=(a||[]).some(function(u){return s.monitor.canDropOnTarget(u)});c?(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=s.getCurrentDropEffect())):s.isDraggingNativeItem()?o.preventDefault():(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none"))}),at(this,"handleTopDragLeaveCapture",function(o){s.isDraggingNativeItem()&&o.preventDefault();var a=s.enterLeaveCounter.leave(o.target);a&&s.isDraggingNativeItem()&&setTimeout(function(){return s.endDragNativeItem()},0)}),at(this,"handleTopDropCapture",function(o){if(s.dropTargetIds=[],s.isDraggingNativeItem()){var a;o.preventDefault(),(a=s.currentNativeSource)===null||a===void 0||a.loadDataTransfer(o.dataTransfer)}else dv(o.dataTransfer)&&o.preventDefault();s.enterLeaveCounter.reset()}),at(this,"handleTopDrop",function(o){var a=s.dropTargetIds;s.dropTargetIds=[],s.actions.hover(a,{clientOffset:zf(o)}),s.actions.drop({dropEffect:s.getCurrentDropEffect()}),s.isDraggingNativeItem()?s.endDragNativeItem():s.monitor.isDragging()&&s.actions.endDrag()}),at(this,"handleSelectStart",function(o){var a=o.target;typeof a.dragDrop=="function"&&(a.tagName==="INPUT"||a.tagName==="SELECT"||a.tagName==="TEXTAREA"||a.isContentEditable||(o.preventDefault(),a.dragDrop()))}),this.options=new $7(n,r),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new S7(this.isNodeInDocument)}return U7(e,[{key:"profile",value:function(){var n,r;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((n=this.dragStartSourceIds)===null||n===void 0?void 0:n.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((r=this.dragOverTargetIds)===null||r===void 0?void 0:r.length)||0}}},{key:"window",get:function(){return this.options.window}},{key:"document",get:function(){return this.options.document}},{key:"rootElement",get:function(){return this.options.rootElement}},{key:"setup",value:function(){var n=this.rootElement;if(n!==void 0){if(n.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");n.__isReactDndBackendSetUp=!0,this.addEventListeners(n)}}},{key:"teardown",value:function(){var n=this.rootElement;if(n!==void 0&&(n.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var r;(r=this.window)===null||r===void 0||r.cancelAnimationFrame(this.asyncEndDragFrameId)}}},{key:"connectDragPreview",value:function(n,r,s){var o=this;return this.sourcePreviewNodeOptions.set(n,s),this.sourcePreviewNodes.set(n,r),function(){o.sourcePreviewNodes.delete(n),o.sourcePreviewNodeOptions.delete(n)}}},{key:"connectDragSource",value:function(n,r,s){var o=this;this.sourceNodes.set(n,r),this.sourceNodeOptions.set(n,s);var a=function(i){return o.handleDragStart(i,n)},c=function(i){return o.handleSelectStart(i)};return r.setAttribute("draggable","true"),r.addEventListener("dragstart",a),r.addEventListener("selectstart",c),function(){o.sourceNodes.delete(n),o.sourceNodeOptions.delete(n),r.removeEventListener("dragstart",a),r.removeEventListener("selectstart",c),r.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(n,r){var s=this,o=function(i){return s.handleDragEnter(i,n)},a=function(i){return s.handleDragOver(i,n)},c=function(i){return s.handleDrop(i,n)};return r.addEventListener("dragenter",o),r.addEventListener("dragover",a),r.addEventListener("drop",c),function(){r.removeEventListener("dragenter",o),r.removeEventListener("dragover",a),r.removeEventListener("drop",c)}}},{key:"addEventListeners",value:function(n){n.addEventListener&&(n.addEventListener("dragstart",this.handleTopDragStart),n.addEventListener("dragstart",this.handleTopDragStartCapture,!0),n.addEventListener("dragend",this.handleTopDragEndCapture,!0),n.addEventListener("dragenter",this.handleTopDragEnter),n.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),n.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),n.addEventListener("dragover",this.handleTopDragOver),n.addEventListener("dragover",this.handleTopDragOverCapture,!0),n.addEventListener("drop",this.handleTopDrop),n.addEventListener("drop",this.handleTopDropCapture,!0))}},{key:"removeEventListeners",value:function(n){n.removeEventListener&&(n.removeEventListener("dragstart",this.handleTopDragStart),n.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),n.removeEventListener("dragend",this.handleTopDragEndCapture,!0),n.removeEventListener("dragenter",this.handleTopDragEnter),n.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),n.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),n.removeEventListener("dragover",this.handleTopDragOver),n.removeEventListener("dragover",this.handleTopDragOverCapture,!0),n.removeEventListener("drop",this.handleTopDrop),n.removeEventListener("drop",this.handleTopDropCapture,!0))}},{key:"getCurrentSourceNodeOptions",value:function(){var n=this.monitor.getSourceId(),r=this.sourceNodeOptions.get(n);return y1({dropEffect:this.altKeyPressed?"copy":"move"},r||{})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var n=this.monitor.getSourceId(),r=this.sourcePreviewNodeOptions.get(n);return y1({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}},{key:"isDraggingNativeItem",value:function(){var n=this.monitor.getItemType();return Object.keys(h1).some(function(r){return h1[r]===n})}},{key:"beginDragNativeItem",value:function(n,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=D7(n,r),this.currentNativeHandle=this.registry.addSource(n,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(n){var r=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=n;var s=1e3;this.mouseMoveTimeoutTimer=setTimeout(function(){var o;return(o=r.rootElement)===null||o===void 0?void 0:o.addEventListener("mousemove",r.endDragIfSourceWasRemovedFromDOM,!0)},s)}},{key:"clearCurrentDragSourceNode",value:function(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var n;(n=this.window)===null||n===void 0||n.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}},{key:"handleDragStart",value:function(n,r){n.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(r))}},{key:"handleDragEnter",value:function(n,r){this.dragEnterTargetIds.unshift(r)}},{key:"handleDragOver",value:function(n,r){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(r)}},{key:"handleDrop",value:function(n,r){this.dropTargetIds.unshift(r)}}]),e}(),H7=function(t,n,r){return new V7(t,n,r)},K7=Object.create,WP=Object.defineProperty,q7=Object.getOwnPropertyDescriptor,GP=Object.getOwnPropertyNames,W7=Object.getPrototypeOf,G7=Object.prototype.hasOwnProperty,J7=(e,t)=>function(){return t||(0,e[GP(e)[0]])((t={exports:{}}).exports,t),t.exports},Q7=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of GP(t))!G7.call(e,s)&&s!==n&&WP(e,s,{get:()=>t[s],enumerable:!(r=q7(t,s))||r.enumerable});return e},JP=(e,t,n)=>(n=e!=null?K7(W7(e)):{},Q7(WP(n,"default",{value:e,enumerable:!0}),e)),QP=J7({"node_modules/classnames/index.js"(e,t){(function(){var n={}.hasOwnProperty;function r(){for(var s=[],o=0;o-1}var oW=sW,aW=9007199254740991,iW=/^(?:0|[1-9]\d*)$/;function lW(e,t){var n=typeof e;return t=t??aW,!!t&&(n=="number"||n!="symbol"&&iW.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=dW}var rR=fW;function pW(e){return e!=null&&rR(e.length)&&!tR(e)}var gW=pW,hW=Object.prototype;function mW(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||hW;return e===n}var vW=mW;function yW(e,t){for(var n=-1,r=Array(e);++n-1}var JG=GG;function QG(e,t){var n=this.__data__,r=Lh(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var ZG=QG;function Dc(e){var t=-1,n=e==null?0:e.length;for(this.clear();++tc))return!1;var i=o.get(e),d=o.get(t);if(i&&d)return i==t&&d==e;var p=-1,f=!0,g=n&sJ?new uR:void 0;for(o.set(e,t),o.set(t,e);++p":">",'"':""","'":"'"},FJ=m9(AJ),LJ=FJ,gR=/[&<>"']/g,$J=RegExp(gR.source);function BJ(e){return e=cR(e),e&&$J.test(e)?e.replace(gR,LJ):e}var zJ=BJ,hR=/[\\^$.*+?()[\]{}|]/g,UJ=RegExp(hR.source);function VJ(e){return e=cR(e),e&&UJ.test(e)?e.replace(hR,"\\$&"):e}var HJ=VJ;function KJ(e,t){return OJ(e,t)}var qJ=KJ,WJ=1/0,GJ=Ul&&1/Iw(new Ul([,-0]))[1]==WJ?function(e){return new Ul(e)}:Jq,JJ=GJ,QJ=200;function ZJ(e,t,n){var r=-1,s=oW,o=e.length,a=!0,c=[],u=c;if(n)a=!1,s=DJ;else if(o>=QJ){var i=t?null:JJ(e);if(i)return Iw(i);a=!1,s=dR,u=new uR}else u=t?[]:c;e:for(;++rl.jsx("button",{className:e.classNames.clearAll,onClick:e.onClick,children:"Clear all"}),nQ=tQ,rQ=(e,t)=>{const n=t.offsetHeight,r=e.offsetHeight,s=e.offsetTop-t.scrollTop;s+r>=n?t.scrollTop+=s-n+r:s<0&&(t.scrollTop+=s)},vb=(e,t,n,r)=>typeof r=="function"?r(e):e.length>=t&&n,sQ=e=>{const t=v.createRef(),{labelField:n,minQueryLength:r,isFocused:s,classNames:o,selectedIndex:a,query:c}=e;v.useEffect(()=>{if(!t.current)return;const p=t.current.querySelector(`.${o.activeSuggestion}`);p&&rQ(p,t.current)},[a]);const u=(p,f)=>{const g=f.trim().replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&"),{[n]:h}=p;return{__html:h.replace(RegExp(g,"gi"),m=>`${zJ(m)}`)}},i=(p,f)=>typeof e.renderSuggestion=="function"?e.renderSuggestion(p,f):l.jsx("span",{dangerouslySetInnerHTML:u(p,f)}),d=e.suggestions.map((p,f)=>l.jsx("li",{onMouseDown:e.handleClick.bind(null,f),onTouchStart:e.handleClick.bind(null,f),onMouseOver:e.handleHover.bind(null,f),className:f===e.selectedIndex?e.classNames.activeSuggestion:"",children:i(p,e.query)},f));return d.length===0||!vb(c,r||2,s,e.shouldRenderSuggestions)?null:l.jsx("div",{ref:t,className:o.suggestions,"data-testid":"suggestions",children:l.jsxs("ul",{children:[" ",d," "]})})},oQ=(e,t)=>{const{query:n,minQueryLength:r=2,isFocused:s,suggestions:o}=t;return!!(e.isFocused===s&&qJ(e.suggestions,o)&&vb(n,r,s,t.shouldRenderSuggestions)===vb(e.query,e.minQueryLength??2,e.isFocused,e.shouldRenderSuggestions)&&e.selectedIndex===t.selectedIndex)},aQ=v.memo(sQ,oQ),iQ=aQ,lQ=JP(QP()),cQ=JP(QP());function uQ(e){const t=e.map(r=>{const s=r-48*Math.floor(r/48);return String.fromCharCode(96<=r?s:r)}).join(""),n=HJ(t);return new RegExp(`[${n}]+`)}function dQ(e){switch(e){case Os.ENTER:return[10,13];case Os.TAB:return 9;case Os.COMMA:return 188;case Os.SPACE:return 32;case Os.SEMICOLON:return 186;default:return 0}}function H1(e){const{moveTag:t,readOnly:n,allowDragDrop:r}=e;return t!==void 0&&!n&&r}function fQ(e){const{readOnly:t,allowDragDrop:n}=e;return!t&&n}var pQ=e=>{const{readOnly:t,removeComponent:n,onRemove:r,className:s,tag:o,index:a}=e,c=i=>{if(zl.ENTER.includes(i.keyCode)||i.keyCode===zl.SPACE){i.preventDefault(),i.stopPropagation();return}i.keyCode===zl.BACKSPACE&&r(i)};if(t)return l.jsx("span",{});const u=`Tag at index ${a} with value ${o.id} focussed. Press backspace to remove`;if(n){const i=n;return l.jsx(i,{"data-testid":"remove",onRemove:r,onKeyDown:c,className:s,"aria-label":u,tag:o,index:a})}return l.jsx("button",{"data-testid":"remove",onClick:r,onKeyDown:c,className:s,type:"button","aria-label":u,children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",height:"12",width:"12",fill:"#fff",children:l.jsx("path",{d:"M376.6 84.5c11.3-13.6 9.5-33.8-4.1-45.1s-33.8-9.5-45.1 4.1L192 206 56.6 43.5C45.3 29.9 25.1 28.1 11.5 39.4S-3.9 70.9 7.4 84.5L150.3 256 7.4 427.5c-11.3 13.6-9.5 33.8 4.1 45.1s33.8 9.5 45.1-4.1L192 306 327.4 468.5c11.3 13.6 31.5 15.4 45.1 4.1s15.4-31.5 4.1-45.1L233.7 256 376.6 84.5z"})})})},gQ=pQ,K1={TAG:"tag"},hQ=e=>{const t=v.useRef(null),{readOnly:n=!1,tag:r,classNames:s,index:o,moveTag:a,allowDragDrop:c=!0,labelField:u="text",tags:i}=e,[{isDragging:d},p]=e7(()=>({type:K1.TAG,collect:x=>({isDragging:!!x.isDragging()}),item:e,canDrag:()=>H1({moveTag:a,readOnly:n,allowDragDrop:c})}),[i]),[,f]=m7(()=>({accept:K1.TAG,drop:x=>{var w;const b=x.index,y=o;b!==y&&((w=e==null?void 0:e.moveTag)==null||w.call(e,b,y))},canDrop:x=>fQ(x)}),[i]);p(f(t));const g=e.tag[u],{className:h=""}=r,m=d?0:1;return l.jsxs("span",{ref:t,className:(0,cQ.default)("tag-wrapper",s.tag,h),style:{opacity:m,cursor:H1({moveTag:a,readOnly:n,allowDragDrop:c})?"move":"auto"},"data-testid":"tag",onClick:e.onTagClicked,onTouchStart:e.onTagClicked,children:[g,l.jsx(gQ,{tag:e.tag,className:s.remove,removeComponent:e.removeComponent,onRemove:e.onDelete,readOnly:n,index:o})]})},mQ=e=>{const{autofocus:t,autoFocus:n,readOnly:r,labelField:s,allowDeleteFromEmptyInput:o,allowAdditionFromPaste:a,allowDragDrop:c,minQueryLength:u,shouldRenderSuggestions:i,removeComponent:d,autocomplete:p,inline:f,maxTags:g,allowUnique:h,editable:m,placeholder:x,delimiters:b,separators:y,tags:w,inputFieldPosition:S,inputProps:E,classNames:C,maxLength:T,inputValue:j,clearAll:_}=e,[O,K]=v.useState(e.suggestions),[I,Y]=v.useState(""),[q,Z]=v.useState(!1),[ee,J]=v.useState(-1),[L,A]=v.useState(!1),[X,fe]=v.useState(""),[H,se]=v.useState(-1),[ne,le]=v.useState(""),oe=v.createRef(),Q=v.useRef(null),Ee=v.useRef(null);v.useEffect(()=>{b.length&&console.warn("[Deprecation] The delimiters prop is deprecated and will be removed in v7.x.x, please use separators instead. If you have any concerns regarding this, please share your thoughts in https://github.com/react-tags/react-tags/issues/960")},[]),v.useEffect(()=>{typeof f<"u"&&console.warn("[Deprecation] The inline attribute is deprecated and will be removed in v7.x.x, please use inputFieldPosition instead.")},[f]),v.useEffect(()=>{typeof t<"u"&&console.warn("[Deprecated] autofocus prop will be removed in 7.x so please migrate to autoFocus prop."),(t||n&&t!==!1)&&!r&&Re()},[n,n,r]),v.useEffect(()=>{Xt()},[I,e.suggestions]);const Pe=ue=>{let He=e.suggestions.slice();if(h){const _n=w.map(xs=>xs.id.trim().toLowerCase());He=He.filter(xs=>!_n.includes(xs.id.toLowerCase()))}if(e.handleFilterSuggestions)return e.handleFilterSuggestions(ue,He);const Tt=He.filter(_n=>Be(ue,_n)===0),vt=He.filter(_n=>Be(ue,_n)>0);return Tt.concat(vt)},Be=(ue,He)=>He[s].toLowerCase().indexOf(ue.toLowerCase()),Re=()=>{Y(""),Q.current&&(Q.current.value="",Q.current.focus())},ve=(ue,He)=>{var vt;He.preventDefault(),He.stopPropagation();const Tt=w.slice();Tt.length!==0&&(le(""),(vt=e==null?void 0:e.handleDelete)==null||vt.call(e,ue,He),ot(ue,Tt))},ot=(ue,He)=>{var _n;if(!(oe!=null&&oe.current))return;const Tt=oe.current.querySelectorAll(".ReactTags__remove");let vt="";ue===0&&He.length>1?(vt=`Tag at index ${ue} with value ${He[ue].id} deleted. Tag at index 0 with value ${He[1].id} focussed. Press backspace to remove`,Tt[0].focus()):ue>0?(vt=`Tag at index ${ue} with value ${He[ue].id} deleted. Tag at index ${ue-1} with value ${He[ue-1].id} focussed. Press backspace to remove`,Tt[ue-1].focus()):(vt=`Tag at index ${ue} with value ${He[ue].id} deleted. Input focussed. Press enter to add a new tag`,(_n=Q.current)==null||_n.focus()),fe(vt)},Vt=(ue,He,Tt)=>{var vt,_n;r||(m&&(se(ue),Y(He[s]),(vt=Ee.current)==null||vt.focus()),(_n=e.handleTagClick)==null||_n.call(e,ue,Tt))},tn=ue=>{e.handleInputChange&&e.handleInputChange(ue.target.value,ue);const He=ue.target.value.trim();Y(He)},Xt=()=>{const ue=Pe(I);K(ue),J(ee>=ue.length?ue.length-1:ee)},ln=ue=>{const He=ue.target.value;e.handleInputFocus&&e.handleInputFocus(He,ue),Z(!0)},M=ue=>{const He=ue.target.value;e.handleInputBlur&&(e.handleInputBlur(He,ue),Q.current&&(Q.current.value="")),Z(!1),se(-1)},D=ue=>{if(ue.key==="Escape"&&(ue.preventDefault(),ue.stopPropagation(),J(-1),A(!1),K([]),se(-1)),(y.indexOf(ue.key)!==-1||b.indexOf(ue.keyCode)!==-1)&&!ue.shiftKey){(ue.keyCode!==zl.TAB||I!=="")&&ue.preventDefault();const He=L&&ee!==-1?O[ee]:{id:I.trim(),[s]:I.trim(),className:""};Object.keys(He)&&ce(He)}ue.key==="Backspace"&&I===""&&(o||S===au.INLINE)&&ve(w.length-1,ue),ue.keyCode===zl.UP_ARROW&&(ue.preventDefault(),J(ee<=0?O.length-1:ee-1),A(!0)),ue.keyCode===zl.DOWN_ARROW&&(ue.preventDefault(),A(!0),O.length===0?J(-1):J((ee+1)%O.length))},V=()=>g&&w.length>=g,he=ue=>{if(!a)return;if(V()){le(x1.TAG_LIMIT),Re();return}le(""),ue.preventDefault();const He=ue.clipboardData||window.clipboardData,Tt=He.getData("text"),{maxLength:vt=Tt.length}=e,_n=Math.min(vt,Tt.length),xs=He.getData("text").substr(0,_n);let Io=b;y.length&&(Io=[],y.forEach(ws=>{const zc=dQ(ws);Array.isArray(zc)?Io=[...Io,...zc]:Io.push(zc)}));const Bc=uQ(Io),Zi=xs.split(Bc).map(ws=>ws.trim());eQ(Zi).forEach(ws=>ce({id:ws.trim(),[s]:ws.trim(),className:""}))},ce=ue=>{var Tt;if(!ue.id||!ue[s])return;if(H===-1){if(V()){le(x1.TAG_LIMIT),Re();return}le("")}const He=w.map(vt=>vt.id.toLowerCase());if(!(h&&He.indexOf(ue.id.trim().toLowerCase())>=0)){if(p){const vt=Pe(ue[s]);console.warn("[Deprecation] The autocomplete prop will be removed in 7.x to simplify the integration and make it more intutive. If you have any concerns regarding this, please share your thoughts in https://github.com/react-tags/react-tags/issues/949"),(p===1&&vt.length===1||p===!0&&vt.length)&&(ue=vt[0])}H!==-1&&e.onTagUpdate?e.onTagUpdate(H,ue):(Tt=e==null?void 0:e.handleAddition)==null||Tt.call(e,ue),Y(""),A(!1),J(-1),se(-1),Re()}},ae=ue=>{ce(O[ue])},ke=()=>{e.onClearAll&&e.onClearAll(),le(""),Re()},rt=ue=>{J(ue),A(!0)},Pt=(ue,He)=>{var vt;const Tt=w[ue];(vt=e==null?void 0:e.handleDrag)==null||vt.call(e,Tt,ue,He)},bn=(()=>{const ue={...b1,...e.classNames};return w.map((He,Tt)=>l.jsx(v.Fragment,{children:H===Tt?l.jsx("div",{className:ue.editTagInput,children:l.jsx("input",{ref:vt=>{Ee.current=vt},onFocus:ln,value:I,onChange:tn,onKeyDown:D,onBlur:M,className:ue.editTagInputField,onPaste:he,"data-testid":"tag-edit"})}):l.jsx(hQ,{index:Tt,tag:He,tags:w,labelField:s,onDelete:vt=>ve(Tt,vt),moveTag:c?Pt:void 0,removeComponent:d,onTagClicked:vt=>Vt(Tt,He,vt),readOnly:r,classNames:ue,allowDragDrop:c})},Tt))})(),mn={...b1,...C},{name:Oo,id:bs}=e,qa=f===!1?au.BOTTOM:S,zn=r?null:l.jsxs("div",{className:mn.tagInput,children:[l.jsx("input",{...E,ref:ue=>{Q.current=ue},className:mn.tagInputField,type:"text",placeholder:x,"aria-label":x,onFocus:ln,onBlur:M,onChange:tn,onKeyDown:D,onPaste:he,name:Oo,id:bs,maxLength:T,value:j,"data-automation":"input","data-testid":"input"}),l.jsx(iQ,{query:I.trim(),suggestions:O,labelField:s,selectedIndex:ee,handleClick:ae,handleHover:rt,minQueryLength:u,shouldRenderSuggestions:i,isFocused:q,classNames:mn,renderSuggestion:e.renderSuggestion}),_&&w.length>0&&l.jsx(nQ,{classNames:mn,onClick:ke}),ne&&l.jsxs("div",{"data-testid":"error",className:"ReactTags__error",children:[l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",height:"24",width:"24",fill:"#e03131",children:l.jsx("path",{d:"M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"})}),ne]})]});return l.jsxs("div",{className:(0,lQ.default)(mn.tags,"react-tags-wrapper"),ref:oe,children:[l.jsx("p",{role:"alert",className:"sr-only",style:{position:"absolute",overflow:"hidden",clip:"rect(0 0 0 0)",margin:"-1px",padding:0,width:"1px",height:"1px",border:0},children:X}),qa===au.TOP&&zn,l.jsxs("div",{className:mn.selected,children:[bn,qa===au.INLINE&&zn]}),qa===au.BOTTOM&&zn]})},vQ=mQ,yQ=e=>{var ne;const{placeholder:t=Z7,labelField:n=Y7,suggestions:r=[],delimiters:s=[],separators:o=(ne=e.delimiters)!=null&&ne.length?[]:[Os.ENTER,Os.TAB],autofocus:a,autoFocus:c=!0,inline:u,inputFieldPosition:i="inline",allowDeleteFromEmptyInput:d=!1,allowAdditionFromPaste:p=!0,autocomplete:f=!1,readOnly:g=!1,allowUnique:h=!0,allowDragDrop:m=!0,tags:x=[],inputProps:b={},editable:y=!1,clearAll:w=!1,handleDelete:S,handleAddition:E,onTagUpdate:C,handleDrag:T,handleFilterSuggestions:j,handleTagClick:_,handleInputChange:O,handleInputFocus:K,handleInputBlur:I,minQueryLength:Y,shouldRenderSuggestions:q,removeComponent:Z,onClearAll:ee,classNames:J,name:L,id:A,maxLength:X,inputValue:fe,maxTags:H,renderSuggestion:se}=e;return l.jsx(vQ,{placeholder:t,labelField:n,suggestions:r,delimiters:s,separators:o,autofocus:a,autoFocus:c,inline:u,inputFieldPosition:i,allowDeleteFromEmptyInput:d,allowAdditionFromPaste:p,autocomplete:f,readOnly:g,allowUnique:h,allowDragDrop:m,tags:x,inputProps:b,editable:y,clearAll:w,handleDelete:S,handleAddition:E,onTagUpdate:C,handleDrag:T,handleFilterSuggestions:j,handleTagClick:_,handleInputChange:O,handleInputFocus:K,handleInputBlur:I,minQueryLength:Y,shouldRenderSuggestions:q,removeComponent:Z,onClearAll:ee,classNames:J,name:L,id:A,maxLength:X,inputValue:fe,maxTags:H,renderSuggestion:se})},bQ=({...e})=>l.jsx(JH,{backend:H7,children:l.jsx(yQ,{...e})});/*! Bundled license information: - -classnames/index.js: - (*! - Copyright (c) 2018 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames - *) - -lodash-es/lodash.js: - (** - * @license - * Lodash (Custom Build) - * Build: `lodash modularize exports="es" -o ./` - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - *) -*/var xQ="Label",mR=v.forwardRef((e,t)=>l.jsx(Ie.label,{...e,ref:t,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));mR.displayName=xQ;var vR=mR;const wQ=ch("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),yR=v.forwardRef(({className:e,...t},n)=>l.jsx(vR,{ref:n,className:me(wQ(),e),...t}));yR.displayName=vR.displayName;function bR(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var SQ="VisuallyHidden",xR=v.forwardRef((e,t)=>l.jsx(Ie.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));xR.displayName=SQ;var CQ=[" ","Enter","ArrowUp","ArrowDown"],EQ=[" ","Enter"],tf="Select",[zh,Uh,kQ]=Ux(tf),[Lc,aae]=qr(tf,[kQ,mh]),Vh=mh(),[jQ,Aa]=Lc(tf),[TQ,MQ]=Lc(tf),wR=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:o,value:a,defaultValue:c,onValueChange:u,dir:i,name:d,autoComplete:p,disabled:f,required:g}=e,h=Vh(t),[m,x]=v.useState(null),[b,y]=v.useState(null),[w,S]=v.useState(!1),E=Jd(i),[C=!1,T]=ya({prop:r,defaultProp:s,onChange:o}),[j,_]=ya({prop:a,defaultProp:c,onChange:u}),O=v.useRef(null),K=m?!!m.closest("form"):!0,[I,Y]=v.useState(new Set),q=Array.from(I).map(Z=>Z.props.value).join(";");return l.jsx(HM,{...h,children:l.jsxs(jQ,{required:g,scope:t,trigger:m,onTriggerChange:x,valueNode:b,onValueNodeChange:y,valueNodeHasChildren:w,onValueNodeHasChildrenChange:S,contentId:is(),value:j,onValueChange:_,open:C,onOpenChange:T,dir:E,triggerPointerDownPosRef:O,disabled:f,children:[l.jsx(zh.Provider,{scope:t,children:l.jsx(TQ,{scope:e.__scopeSelect,onNativeOptionAdd:v.useCallback(Z=>{Y(ee=>new Set(ee).add(Z))},[]),onNativeOptionRemove:v.useCallback(Z=>{Y(ee=>{const J=new Set(ee);return J.delete(Z),J})},[]),children:n})}),K?l.jsxs(qR,{"aria-hidden":!0,required:g,tabIndex:-1,name:d,autoComplete:p,value:j,onChange:Z=>_(Z.target.value),disabled:f,children:[j===void 0?l.jsx("option",{value:""}):null,Array.from(I)]},q):null]})})};wR.displayName=tf;var SR="SelectTrigger",CR=v.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,o=Vh(n),a=Aa(SR,n),c=a.disabled||r,u=ct(t,a.onTriggerChange),i=Uh(n),[d,p,f]=WR(h=>{const m=i().filter(y=>!y.disabled),x=m.find(y=>y.value===a.value),b=GR(m,h,x);b!==void 0&&a.onValueChange(b.value)}),g=()=>{c||(a.onOpenChange(!0),f())};return l.jsx(KM,{asChild:!0,...o,children:l.jsx(Ie.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":KR(a.value)?"":void 0,...s,ref:u,onClick:Ce(s.onClick,h=>{h.currentTarget.focus()}),onPointerDown:Ce(s.onPointerDown,h=>{const m=h.target;m.hasPointerCapture(h.pointerId)&&m.releasePointerCapture(h.pointerId),h.button===0&&h.ctrlKey===!1&&(g(),a.triggerPointerDownPosRef.current={x:Math.round(h.pageX),y:Math.round(h.pageY)},h.preventDefault())}),onKeyDown:Ce(s.onKeyDown,h=>{const m=d.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&p(h.key),!(m&&h.key===" ")&&CQ.includes(h.key)&&(g(),h.preventDefault())})})})});CR.displayName=SR;var ER="SelectValue",kR=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:o,placeholder:a="",...c}=e,u=Aa(ER,n),{onValueNodeHasChildrenChange:i}=u,d=o!==void 0,p=ct(t,u.onValueNodeChange);return pn(()=>{i(d)},[i,d]),l.jsx(Ie.span,{...c,ref:p,style:{pointerEvents:"none"},children:KR(u.value)?l.jsx(l.Fragment,{children:a}):o})});kR.displayName=ER;var NQ="SelectIcon",jR=v.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return l.jsx(Ie.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});jR.displayName=NQ;var _Q="SelectPortal",TR=e=>l.jsx(vh,{asChild:!0,...e});TR.displayName=_Q;var Li="SelectContent",MR=v.forwardRef((e,t)=>{const n=Aa(Li,e.__scopeSelect),[r,s]=v.useState();if(pn(()=>{s(new DocumentFragment)},[]),!n.open){const o=r;return o?Pa.createPortal(l.jsx(NR,{scope:e.__scopeSelect,children:l.jsx(zh.Slot,{scope:e.__scopeSelect,children:l.jsx("div",{children:e.children})})}),o):null}return l.jsx(_R,{...e,ref:t})});MR.displayName=Li;var ro=10,[NR,Fa]=Lc(Li),PQ="SelectContentImpl",_R=v.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:a,side:c,sideOffset:u,align:i,alignOffset:d,arrowPadding:p,collisionBoundary:f,collisionPadding:g,sticky:h,hideWhenDetached:m,avoidCollisions:x,...b}=e,y=Aa(Li,n),[w,S]=v.useState(null),[E,C]=v.useState(null),T=ct(t,Q=>S(Q)),[j,_]=v.useState(null),[O,K]=v.useState(null),I=Uh(n),[Y,q]=v.useState(!1),Z=v.useRef(!1);v.useEffect(()=>{if(w)return Yx(w)},[w]),Vx();const ee=v.useCallback(Q=>{const[Ee,...Pe]=I().map(ve=>ve.ref.current),[Be]=Pe.slice(-1),Re=document.activeElement;for(const ve of Q)if(ve===Re||(ve==null||ve.scrollIntoView({block:"nearest"}),ve===Ee&&E&&(E.scrollTop=0),ve===Be&&E&&(E.scrollTop=E.scrollHeight),ve==null||ve.focus(),document.activeElement!==Re))return},[I,E]),J=v.useCallback(()=>ee([j,w]),[ee,j,w]);v.useEffect(()=>{Y&&J()},[Y,J]);const{onOpenChange:L,triggerPointerDownPosRef:A}=y;v.useEffect(()=>{if(w){let Q={x:0,y:0};const Ee=Be=>{var Re,ve;Q={x:Math.abs(Math.round(Be.pageX)-(((Re=A.current)==null?void 0:Re.x)??0)),y:Math.abs(Math.round(Be.pageY)-(((ve=A.current)==null?void 0:ve.y)??0))}},Pe=Be=>{Q.x<=10&&Q.y<=10?Be.preventDefault():w.contains(Be.target)||L(!1),document.removeEventListener("pointermove",Ee),A.current=null};return A.current!==null&&(document.addEventListener("pointermove",Ee),document.addEventListener("pointerup",Pe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Ee),document.removeEventListener("pointerup",Pe,{capture:!0})}}},[w,L,A]),v.useEffect(()=>{const Q=()=>L(!1);return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[L]);const[X,fe]=WR(Q=>{const Ee=I().filter(Re=>!Re.disabled),Pe=Ee.find(Re=>Re.ref.current===document.activeElement),Be=GR(Ee,Q,Pe);Be&&setTimeout(()=>Be.ref.current.focus())}),H=v.useCallback((Q,Ee,Pe)=>{const Be=!Z.current&&!Pe;(y.value!==void 0&&y.value===Ee||Be)&&(_(Q),Be&&(Z.current=!0))},[y.value]),se=v.useCallback(()=>w==null?void 0:w.focus(),[w]),ne=v.useCallback((Q,Ee,Pe)=>{const Be=!Z.current&&!Pe;(y.value!==void 0&&y.value===Ee||Be)&&K(Q)},[y.value]),le=r==="popper"?yb:PR,oe=le===yb?{side:c,sideOffset:u,align:i,alignOffset:d,arrowPadding:p,collisionBoundary:f,collisionPadding:g,sticky:h,hideWhenDetached:m,avoidCollisions:x}:{};return l.jsx(NR,{scope:n,content:w,viewport:E,onViewportChange:C,itemRefCallback:H,selectedItem:j,onItemLeave:se,itemTextRefCallback:ne,focusSelectedItem:J,selectedItemText:O,position:r,isPositioned:Y,searchRef:X,children:l.jsx(wh,{as:wo,allowPinchZoom:!0,children:l.jsx(ph,{asChild:!0,trapped:y.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:Ce(s,Q=>{var Ee;(Ee=y.trigger)==null||Ee.focus({preventScroll:!0}),Q.preventDefault()}),children:l.jsx(fh,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:l.jsx(le,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:Q=>Q.preventDefault(),...b,...oe,onPlaced:()=>q(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Ce(b.onKeyDown,Q=>{const Ee=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!Ee&&Q.key.length===1&&fe(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let Be=I().filter(Re=>!Re.disabled).map(Re=>Re.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(Be=Be.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const Re=Q.target,ve=Be.indexOf(Re);Be=Be.slice(ve+1)}setTimeout(()=>ee(Be)),Q.preventDefault()}})})})})})})});_R.displayName=PQ;var RQ="SelectItemAlignedPosition",PR=v.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,o=Aa(Li,n),a=Fa(Li,n),[c,u]=v.useState(null),[i,d]=v.useState(null),p=ct(t,T=>d(T)),f=Uh(n),g=v.useRef(!1),h=v.useRef(!0),{viewport:m,selectedItem:x,selectedItemText:b,focusSelectedItem:y}=a,w=v.useCallback(()=>{if(o.trigger&&o.valueNode&&c&&i&&m&&x&&b){const T=o.trigger.getBoundingClientRect(),j=i.getBoundingClientRect(),_=o.valueNode.getBoundingClientRect(),O=b.getBoundingClientRect();if(o.dir!=="rtl"){const Re=O.left-j.left,ve=_.left-Re,ot=T.left-ve,Vt=T.width+ot,tn=Math.max(Vt,j.width),Xt=window.innerWidth-ro,ln=tb(ve,[ro,Xt-tn]);c.style.minWidth=Vt+"px",c.style.left=ln+"px"}else{const Re=j.right-O.right,ve=window.innerWidth-_.right-Re,ot=window.innerWidth-T.right-ve,Vt=T.width+ot,tn=Math.max(Vt,j.width),Xt=window.innerWidth-ro,ln=tb(ve,[ro,Xt-tn]);c.style.minWidth=Vt+"px",c.style.right=ln+"px"}const K=f(),I=window.innerHeight-ro*2,Y=m.scrollHeight,q=window.getComputedStyle(i),Z=parseInt(q.borderTopWidth,10),ee=parseInt(q.paddingTop,10),J=parseInt(q.borderBottomWidth,10),L=parseInt(q.paddingBottom,10),A=Z+ee+Y+L+J,X=Math.min(x.offsetHeight*5,A),fe=window.getComputedStyle(m),H=parseInt(fe.paddingTop,10),se=parseInt(fe.paddingBottom,10),ne=T.top+T.height/2-ro,le=I-ne,oe=x.offsetHeight/2,Q=x.offsetTop+oe,Ee=Z+ee+Q,Pe=A-Ee;if(Ee<=ne){const Re=x===K[K.length-1].ref.current;c.style.bottom="0px";const ve=i.clientHeight-m.offsetTop-m.offsetHeight,ot=Math.max(le,oe+(Re?se:0)+ve+J),Vt=Ee+ot;c.style.height=Vt+"px"}else{const Re=x===K[0].ref.current;c.style.top="0px";const ot=Math.max(ne,Z+m.offsetTop+(Re?H:0)+oe)+Pe;c.style.height=ot+"px",m.scrollTop=Ee-ne+m.offsetTop}c.style.margin=`${ro}px 0`,c.style.minHeight=X+"px",c.style.maxHeight=I+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[f,o.trigger,o.valueNode,c,i,m,x,b,o.dir,r]);pn(()=>w(),[w]);const[S,E]=v.useState();pn(()=>{i&&E(window.getComputedStyle(i).zIndex)},[i]);const C=v.useCallback(T=>{T&&h.current===!0&&(w(),y==null||y(),h.current=!1)},[w,y]);return l.jsx(IQ,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:g,onScrollButtonChange:C,children:l.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:l.jsx(Ie.div,{...s,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});PR.displayName=RQ;var OQ="SelectPopperPosition",yb=v.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=ro,...o}=e,a=Vh(n);return l.jsx(qM,{...a,...o,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});yb.displayName=OQ;var[IQ,Dw]=Lc(Li,{}),bb="SelectViewport",RR=v.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,o=Fa(bb,n),a=Dw(bb,n),c=ct(t,o.onViewportChange),u=v.useRef(0);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),l.jsx(zh.Slot,{scope:n,children:l.jsx(Ie.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:c,style:{position:"relative",flex:1,overflow:"auto",...s.style},onScroll:Ce(s.onScroll,i=>{const d=i.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:f}=a;if(f!=null&&f.current&&p){const g=Math.abs(u.current-d.scrollTop);if(g>0){const h=window.innerHeight-ro*2,m=parseFloat(p.style.minHeight),x=parseFloat(p.style.height),b=Math.max(m,x);if(b0?S:0,p.style.justifyContent="flex-end")}}}u.current=d.scrollTop})})})]})});RR.displayName=bb;var OR="SelectGroup",[DQ,AQ]=Lc(OR),FQ=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=is();return l.jsx(DQ,{scope:n,id:s,children:l.jsx(Ie.div,{role:"group","aria-labelledby":s,...r,ref:t})})});FQ.displayName=OR;var IR="SelectLabel",DR=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=AQ(IR,n);return l.jsx(Ie.div,{id:s.id,...r,ref:t})});DR.displayName=IR;var Tg="SelectItem",[LQ,AR]=Lc(Tg),FR=v.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:o,...a}=e,c=Aa(Tg,n),u=Fa(Tg,n),i=c.value===r,[d,p]=v.useState(o??""),[f,g]=v.useState(!1),h=ct(t,b=>{var y;return(y=u.itemRefCallback)==null?void 0:y.call(u,b,r,s)}),m=is(),x=()=>{s||(c.onValueChange(r),c.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return l.jsx(LQ,{scope:n,value:r,disabled:s,textId:m,isSelected:i,onItemTextChange:v.useCallback(b=>{p(y=>y||((b==null?void 0:b.textContent)??"").trim())},[]),children:l.jsx(zh.ItemSlot,{scope:n,value:r,disabled:s,textValue:d,children:l.jsx(Ie.div,{role:"option","aria-labelledby":m,"data-highlighted":f?"":void 0,"aria-selected":i&&f,"data-state":i?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...a,ref:h,onFocus:Ce(a.onFocus,()=>g(!0)),onBlur:Ce(a.onBlur,()=>g(!1)),onPointerUp:Ce(a.onPointerUp,x),onPointerMove:Ce(a.onPointerMove,b=>{var y;s?(y=u.onItemLeave)==null||y.call(u):b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ce(a.onPointerLeave,b=>{var y;b.currentTarget===document.activeElement&&((y=u.onItemLeave)==null||y.call(u))}),onKeyDown:Ce(a.onKeyDown,b=>{var w;((w=u.searchRef)==null?void 0:w.current)!==""&&b.key===" "||(EQ.includes(b.key)&&x(),b.key===" "&&b.preventDefault())})})})})});FR.displayName=Tg;var xu="SelectItemText",LR=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...o}=e,a=Aa(xu,n),c=Fa(xu,n),u=AR(xu,n),i=MQ(xu,n),[d,p]=v.useState(null),f=ct(t,b=>p(b),u.onItemTextChange,b=>{var y;return(y=c.itemTextRefCallback)==null?void 0:y.call(c,b,u.value,u.disabled)}),g=d==null?void 0:d.textContent,h=v.useMemo(()=>l.jsx("option",{value:u.value,disabled:u.disabled,children:g},u.value),[u.disabled,u.value,g]),{onNativeOptionAdd:m,onNativeOptionRemove:x}=i;return pn(()=>(m(h),()=>x(h)),[m,x,h]),l.jsxs(l.Fragment,{children:[l.jsx(Ie.span,{id:u.textId,...o,ref:f}),u.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Pa.createPortal(o.children,a.valueNode):null]})});LR.displayName=xu;var $R="SelectItemIndicator",BR=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return AR($R,n).isSelected?l.jsx(Ie.span,{"aria-hidden":!0,...r,ref:t}):null});BR.displayName=$R;var xb="SelectScrollUpButton",zR=v.forwardRef((e,t)=>{const n=Fa(xb,e.__scopeSelect),r=Dw(xb,e.__scopeSelect),[s,o]=v.useState(!1),a=ct(t,r.onScrollButtonChange);return pn(()=>{if(n.viewport&&n.isPositioned){let c=function(){const i=u.scrollTop>0;o(i)};const u=n.viewport;return c(),u.addEventListener("scroll",c),()=>u.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),s?l.jsx(VR,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:u}=n;c&&u&&(c.scrollTop=c.scrollTop-u.offsetHeight)}}):null});zR.displayName=xb;var wb="SelectScrollDownButton",UR=v.forwardRef((e,t)=>{const n=Fa(wb,e.__scopeSelect),r=Dw(wb,e.__scopeSelect),[s,o]=v.useState(!1),a=ct(t,r.onScrollButtonChange);return pn(()=>{if(n.viewport&&n.isPositioned){let c=function(){const i=u.scrollHeight-u.clientHeight,d=Math.ceil(u.scrollTop)u.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),s?l.jsx(VR,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:u}=n;c&&u&&(c.scrollTop=c.scrollTop+u.offsetHeight)}}):null});UR.displayName=wb;var VR=v.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,o=Fa("SelectScrollButton",n),a=v.useRef(null),c=Uh(n),u=v.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return v.useEffect(()=>()=>u(),[u]),pn(()=>{var d;const i=c().find(p=>p.ref.current===document.activeElement);(d=i==null?void 0:i.ref.current)==null||d.scrollIntoView({block:"nearest"})},[c]),l.jsx(Ie.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Ce(s.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:Ce(s.onPointerMove,()=>{var i;(i=o.onItemLeave)==null||i.call(o),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:Ce(s.onPointerLeave,()=>{u()})})}),$Q="SelectSeparator",HR=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return l.jsx(Ie.div,{"aria-hidden":!0,...r,ref:t})});HR.displayName=$Q;var Sb="SelectArrow",BQ=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Vh(n),o=Aa(Sb,n),a=Fa(Sb,n);return o.open&&a.position==="popper"?l.jsx(WM,{...s,...r,ref:t}):null});BQ.displayName=Sb;function KR(e){return e===""||e===void 0}var qR=v.forwardRef((e,t)=>{const{value:n,...r}=e,s=v.useRef(null),o=ct(t,s),a=bR(n);return v.useEffect(()=>{const c=s.current,u=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(u,"value").set;if(a!==n&&d){const p=new Event("change",{bubbles:!0});d.call(c,n),c.dispatchEvent(p)}},[a,n]),l.jsx(xR,{asChild:!0,children:l.jsx("select",{...r,ref:o,defaultValue:n})})});qR.displayName="BubbleSelect";function WR(e){const t=on(e),n=v.useRef(""),r=v.useRef(0),s=v.useCallback(a=>{const c=n.current+a;t(c),function u(i){n.current=i,window.clearTimeout(r.current),i!==""&&(r.current=window.setTimeout(()=>u(""),1e3))}(c)},[t]),o=v.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,o]}function GR(e,t,n){const s=t.length>1&&Array.from(t).every(i=>i===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=zQ(e,Math.max(o,0));s.length===1&&(a=a.filter(i=>i!==n));const u=a.find(i=>i.textValue.toLowerCase().startsWith(s.toLowerCase()));return u!==n?u:void 0}function zQ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var UQ=wR,JR=CR,VQ=kR,HQ=jR,KQ=TR,QR=MR,qQ=RR,ZR=DR,YR=FR,WQ=LR,GQ=BR,XR=zR,eO=UR,tO=HR;const JQ=UQ,QQ=VQ,nO=v.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(JR,{ref:r,className:me("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-default disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,l.jsx(HQ,{asChild:!0,children:l.jsx(uh,{className:"h-4 w-4 opacity-50"})})]}));nO.displayName=JR.displayName;const rO=v.forwardRef(({className:e,...t},n)=>l.jsx(XR,{ref:n,className:me("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(UB,{className:"h-4 w-4"})}));rO.displayName=XR.displayName;const sO=v.forwardRef(({className:e,...t},n)=>l.jsx(eO,{ref:n,className:me("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(uh,{className:"h-4 w-4"})}));sO.displayName=eO.displayName;const oO=v.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>l.jsx(KQ,{children:l.jsxs(QR,{ref:s,className:me("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[l.jsx(rO,{}),l.jsx(qQ,{className:me("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),l.jsx(sO,{})]})}));oO.displayName=QR.displayName;const ZQ=v.forwardRef(({className:e,...t},n)=>l.jsx(ZR,{ref:n,className:me("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));ZQ.displayName=ZR.displayName;const aO=v.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(YR,{ref:r,className:me("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(GQ,{children:l.jsx(mM,{className:"h-4 w-4"})})}),l.jsx(WQ,{children:t})]}));aO.displayName=YR.displayName;const YQ=v.forwardRef(({className:e,...t},n)=>l.jsx(tO,{ref:n,className:me("-mx-1 my-1 h-px bg-muted",e),...t}));YQ.displayName=tO.displayName;var Aw="Switch",[XQ,iae]=qr(Aw),[eZ,tZ]=XQ(Aw),iO=v.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:o,required:a,disabled:c,value:u="on",onCheckedChange:i,...d}=e,[p,f]=v.useState(null),g=ct(t,y=>f(y)),h=v.useRef(!1),m=p?!!p.closest("form"):!0,[x=!1,b]=ya({prop:s,defaultProp:o,onChange:i});return l.jsxs(eZ,{scope:n,checked:x,disabled:c,children:[l.jsx(Ie.button,{type:"button",role:"switch","aria-checked":x,"aria-required":a,"data-state":uO(x),"data-disabled":c?"":void 0,disabled:c,value:u,...d,ref:g,onClick:Ce(e.onClick,y=>{b(w=>!w),m&&(h.current=y.isPropagationStopped(),h.current||y.stopPropagation())})}),m&&l.jsx(nZ,{control:p,bubbles:!h.current,name:r,value:u,checked:x,required:a,disabled:c,style:{transform:"translateX(-100%)"}})]})});iO.displayName=Aw;var lO="SwitchThumb",cO=v.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=tZ(lO,n);return l.jsx(Ie.span,{"data-state":uO(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});cO.displayName=lO;var nZ=e=>{const{control:t,checked:n,bubbles:r=!0,...s}=e,o=v.useRef(null),a=bR(n),c=IM(t);return v.useEffect(()=>{const u=o.current,i=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(i,"checked").set;if(a!==n&&p){const f=new Event("click",{bubbles:r});p.call(u,n),u.dispatchEvent(f)}},[a,n,r]),l.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:o,style:{...e.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function uO(e){return e?"checked":"unchecked"}var dO=iO,rZ=cO;const $c=v.forwardRef(({className:e,...t},n)=>l.jsx(dO,{className:me("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-slate-400",e),...t,ref:n,children:l.jsx(rZ,{className:me("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));$c.displayName=dO.displayName;const La=Mn,fO=v.createContext({}),$a=({...e})=>l.jsx(fO.Provider,{value:{name:e.name},children:l.jsx(ZV,{...e})}),Hh=()=>{const e=v.useContext(fO),t=v.useContext(pO),{getFieldState:n,formState:r}=Ph(),s=n(e.name,r);if(!e)throw new Error("useFormField should be used within ");const{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...s}},pO=v.createContext({}),Ro=v.forwardRef(({className:e,...t},n)=>{const r=v.useId();return l.jsx(pO.Provider,{value:{id:r},children:l.jsx("div",{ref:n,className:me("space-y-2",e),...t})})});Ro.displayName="FormItem";const Er=v.forwardRef(({className:e,...t},n)=>{const{error:r,formItemId:s}=Hh();return l.jsx(yR,{ref:n,className:me(r&&"text-rose-600",e),htmlFor:s,...t})});Er.displayName="FormLabel";const qs=v.forwardRef(({...e},t)=>{const{error:n,formItemId:r,formDescriptionId:s,formMessageId:o}=Hh();return l.jsx(wo,{ref:t,id:r,"aria-describedby":n?`${s} ${o}`:`${s}`,"aria-invalid":!!n,...e})});qs.displayName="FormControl";const Kh=v.forwardRef(({className:e,...t},n)=>{const{formDescriptionId:r}=Hh();return l.jsx("p",{ref:n,id:r,className:me("text-sm text-muted-foreground",e),...t})});Kh.displayName="FormDescription";const nf=v.forwardRef(({className:e,children:t,...n},r)=>{const{error:s,formMessageId:o}=Hh(),a=s?String(s==null?void 0:s.message):t;return a?l.jsx("p",{ref:r,id:o,className:me("text-sm font-medium text-rose-600",e),...n,children:a}):null});nf.displayName="FormMessage";const $=({name:e,label:t,children:n,required:r,readOnly:s,className:o,...a})=>l.jsx($a,{...a,name:e,render:({field:c})=>l.jsxs(Ro,{className:o,children:[t&&l.jsxs(Er,{children:[t,r&&l.jsx("span",{className:"ml-2 text-rose-600",children:"*"})]}),l.jsx(qs,{children:v.isValidElement(n)&&v.cloneElement(n,{...c,value:c.value??"",required:r,readOnly:s,checked:c.value,onCheckedChange:c.onChange})}),l.jsx(nf,{})]})}),ge=({name:e,label:t,required:n,className:r,helper:s,reverse:o,...a})=>l.jsx($a,{...a,name:e,render:({field:c})=>l.jsxs(Ro,{className:me("flex items-center gap-3",o&&"flex-row-reverse justify-end",r),children:[l.jsx("div",{className:"flex flex-col gap-2",children:t&&l.jsxs(Er,{children:[l.jsxs("p",{className:"break-all",children:[t,n&&l.jsx("span",{className:"ml-2 text-rose-600",children:"*"})]}),s&&l.jsx(Kh,{className:"mt-2",children:s})]})}),l.jsx(qs,{children:l.jsx($c,{checked:c.value,onCheckedChange:c.onChange,required:n})}),l.jsx(nf,{})]})}),jt=({name:e,label:t,helper:n,required:r,options:s,placeholder:o,disabled:a,...c})=>l.jsx($a,{...c,name:e,render:({field:u})=>l.jsxs(Ro,{children:[t&&l.jsxs(Er,{children:[t,r&&l.jsx("span",{className:"ml-2 text-rose-600",children:"*"})]}),l.jsx(qs,{children:l.jsxs(JQ,{onValueChange:u.onChange,defaultValue:u.value,disabled:a,children:[l.jsx(qs,{children:l.jsx(nO,{children:l.jsx(QQ,{placeholder:o})})}),l.jsx(oO,{children:s.map(i=>l.jsx(aO,{value:i.value,children:i.label},i.value))})]})}),n&&l.jsx(Kh,{children:n}),l.jsx(nf,{})]})}),Ba=({name:e,label:t,helper:n,required:r,placeholder:s,...o})=>l.jsx($a,{...o,name:e,render:({field:a})=>{let c=[];return Array.isArray(a.value)&&(c=a.value),l.jsxs(Ro,{children:[t&&l.jsxs(Er,{children:[t,r&&l.jsx("span",{className:"ml-2 text-rose-600",children:"*"})]}),l.jsx(qs,{children:l.jsx(bQ,{tags:c.map(u=>({id:u,text:u,className:""})),handleDelete:u=>a.onChange(c.filter((i,d)=>d!==u)),handleAddition:u=>a.onChange([...c,u.id]),inputFieldPosition:"bottom",placeholder:s,autoFocus:!1,allowDragDrop:!1,separators:[Os.ENTER,Os.TAB,Os.COMMA],classNames:{tags:"tagsClass",tagInput:"tagInputClass",tagInputField:tP,selected:"my-2 flex flex-wrap gap-2",tag:"flex items-center gap-2 px-2 py-1 bg-primary/30 rounded-md text-xs",remove:"[&>svg]:fill-rose-600 hover:[&>svg]:fill-rose-700",suggestions:"suggestionsClass",activeSuggestion:"activeSuggestionClass",editTagInput:"editTagInputClass",editTagInputField:"editTagInputFieldClass",clearAll:"clearAllClass"}})}),n&&l.jsx(Kh,{children:n}),l.jsx(nf,{})]})}}),vv=k.string().optional().transform(e=>e===""?void 0:e),sZ=k.object({name:k.string(),token:vv,number:vv,businessId:vv,integration:k.enum(["WHATSAPP-BUSINESS","WHATSAPP-BAILEYS","EVOLUTION"])});function oZ({resetTable:e}){const{t}=Te(),{createInstance:n}=Nh(),[r,s]=v.useState(!1),o=[{value:"WHATSAPP-BAILEYS",label:t("instance.form.integration.baileys")},{value:"WHATSAPP-BUSINESS",label:t("instance.form.integration.whatsapp")},{value:"EVOLUTION",label:t("instance.form.integration.evolution")}],a=zt({resolver:Ut(sZ),defaultValues:{name:"",integration:"WHATSAPP-BAILEYS",token:LC().replace("-","").toUpperCase(),number:"",businessId:""}}),c=a.watch("integration"),u=async d=>{var p,f,g;try{const h={instanceName:d.name,integration:d.integration,token:d.token===""?null:d.token,number:d.number===""?null:d.number,businessId:d.businessId===""?null:d.businessId};await n(h),G.success(t("toast.instance.created")),s(!1),i(),e()}catch(h){console.error("Error:",h),G.error(`Error : ${(g=(f=(p=h==null?void 0:h.response)==null?void 0:p.data)==null?void 0:f.response)==null?void 0:g.message}`)}},i=()=>{a.reset({name:"",integration:"WHATSAPP-BAILEYS",token:LC().replace("-","").toLocaleUpperCase(),number:"",businessId:""})};return l.jsxs(pt,{open:r,onOpenChange:s,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{variant:"default",size:"sm",children:[t("instance.button.create")," ",l.jsx(Ws,{size:"18"})]})}),l.jsxs(ut,{className:"sm:max-w-[650px]",onCloseAutoFocus:i,children:[l.jsx(dt,{children:l.jsx(yt,{children:t("instance.modal.title")})}),l.jsx(Mn,{...a,children:l.jsxs("form",{onSubmit:a.handleSubmit(u),className:"grid gap-4 py-4",children:[l.jsx($,{required:!0,name:"name",label:t("instance.form.name"),children:l.jsx(F,{})}),l.jsx(jt,{name:"integration",label:t("instance.form.integration.label"),options:o}),l.jsx($,{required:!0,name:"token",label:t("instance.form.token"),children:l.jsx(F,{})}),l.jsx($,{name:"number",label:t("instance.form.number"),children:l.jsx(F,{type:"tel"})}),c==="WHATSAPP-BUSINESS"&&l.jsx($,{required:!0,name:"businessId",label:t("instance.form.businessId"),children:l.jsx(F,{})}),l.jsx(_t,{children:l.jsx(z,{type:"submit",children:t("instance.button.save")})})]})})]})]})}function aZ(){const{t:e}=Te(),[t,n]=v.useState(null),{deleteInstance:r,logout:s}=Nh(),{data:o,refetch:a}=$V(),[c,u]=v.useState([]),[i,d]=v.useState("all"),[p,f]=v.useState(""),g=async()=>{await a()},h=async b=>{var y,w,S;n(null),u([...c,b]);try{try{await s(b)}catch(E){console.error("Error logout:",E)}await r(b),await new Promise(E=>setTimeout(E,1e3)),g()}catch(E){console.error("Error instance delete:",E),G.error(`Error : ${(S=(w=(y=E==null?void 0:E.response)==null?void 0:y.data)==null?void 0:w.response)==null?void 0:S.message}`)}finally{u(c.filter(E=>E!==b))}},m=v.useMemo(()=>{let b=o?[...o]:[];return i!=="all"&&(b=b.filter(y=>y.connectionStatus===i)),p!==""&&(b=b.filter(y=>y.name.toLowerCase().includes(p.toLowerCase()))),b},[o,p,i]),x=[{value:"all",label:e("status.all")},{value:"close",label:e("status.closed")},{value:"connecting",label:e("status.connecting")},{value:"open",label:e("status.open")}];return l.jsxs("div",{className:"my-4 px-4",children:[l.jsxs("div",{className:"flex w-full items-center justify-between",children:[l.jsx("h2",{className:"text-lg",children:e("dashboard.title")}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(z,{variant:"outline",size:"icon",children:l.jsx(rg,{onClick:g,size:"20"})}),l.jsx(oZ,{resetTable:g})]})]}),l.jsxs("div",{className:"my-4 flex items-center justify-between gap-3 px-4",children:[l.jsx("div",{className:"flex-1",children:l.jsx(F,{placeholder:e("dashboard.search"),value:p,onChange:b=>f(b.target.value)})}),l.jsxs(ms,{children:[l.jsx(vs,{asChild:!0,children:l.jsxs(z,{variant:"secondary",children:[e("dashboard.status")," ",l.jsx(VB,{size:"15"})]})}),l.jsx(Mr,{children:x.map(b=>l.jsx(XN,{checked:i===b.value,onCheckedChange:y=>{y&&d(b.value)},children:b.label},b.value))})]})]}),l.jsx("main",{className:"grid gap-6 sm:grid-cols-2 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:m.length>0&&Array.isArray(o)&&o.map(b=>{var y,w;return l.jsxs(oi,{children:[l.jsx(ai,{children:l.jsxs(ld,{to:`/manager/instance/${b.id}/dashboard`,className:"flex w-full flex-row items-center justify-between gap-4",children:[l.jsx("h3",{className:"text-wrap font-semibold",children:b.name}),l.jsx(z,{variant:"ghost",size:"icon",children:l.jsx(To,{className:"card-icon",size:"20"})})]})}),l.jsxs(ii,{className:"flex-1 space-y-6",children:[l.jsx(X_,{token:b.token}),l.jsxs("div",{className:"flex w-full flex-wrap",children:[l.jsx("div",{className:"flex flex-1 gap-2",children:b.profileName&&l.jsxs(l.Fragment,{children:[l.jsx(Eh,{children:l.jsx(kh,{src:b.profilePicUrl,alt:""})}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("strong",{children:b.profileName}),l.jsx("p",{className:"text-sm text-muted-foreground",children:b.ownerJid&&b.ownerJid.split("@")[0]})]})]})}),l.jsxs("div",{className:"flex items-center justify-end gap-4 text-sm",children:[l.jsxs("div",{className:"flex flex-col items-center justify-center gap-1",children:[l.jsx(vM,{className:"text-muted-foreground",size:"20"}),l.jsx("span",{children:new Intl.NumberFormat("pt-BR").format(((y=b==null?void 0:b._count)==null?void 0:y.Contact)||0)})]}),l.jsxs("div",{className:"flex flex-col items-center justify-center gap-1",children:[l.jsx(dh,{className:"text-muted-foreground",size:"20"}),l.jsx("span",{children:new Intl.NumberFormat("pt-BR").format(((w=b==null?void 0:b._count)==null?void 0:w.Message)||0)})]})]})]})]}),l.jsxs(Mh,{className:"justify-between",children:[l.jsx(Y_,{status:b.connectionStatus}),l.jsx(z,{variant:"destructive",size:"sm",onClick:()=>n(b.name),disabled:c.includes(b.name),children:c.includes(b.name)?l.jsx("span",{children:e("button.deleting")}):l.jsx("span",{children:e("button.delete")})})]})]},b.id)})}),!!t&&l.jsx(pt,{onOpenChange:()=>n(null),open:!0,children:l.jsxs(ut,{children:[l.jsx(__,{}),l.jsx(dt,{children:e("modal.delete.title")}),l.jsx("p",{children:e("modal.delete.message",{instanceName:t})}),l.jsx(_t,{children:l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx(z,{onClick:()=>n(null),size:"sm",variant:"outline",children:e("button.cancel")}),l.jsx(z,{onClick:()=>h(t),variant:"destructive",children:e("button.delete")})]})})]})})]})}const{createElement:yc,createContext:iZ,createRef:lae,forwardRef:gO,useCallback:dr,useContext:hO,useEffect:Ci,useImperativeHandle:mO,useLayoutEffect:lZ,useMemo:cZ,useRef:nr,useState:Lu}=Dg,q1=Dg.useId,uZ=lZ,qh=iZ(null);qh.displayName="PanelGroupContext";const Ei=uZ,dZ=typeof q1=="function"?q1:()=>null;let fZ=0;function Fw(e=null){const t=dZ(),n=nr(e||t||null);return n.current===null&&(n.current=""+fZ++),e??n.current}function vO({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:s,forwardedRef:o,id:a,maxSize:c,minSize:u,onCollapse:i,onExpand:d,onResize:p,order:f,style:g,tagName:h="div",...m}){const x=hO(qh);if(x===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:b,expandPanel:y,getPanelSize:w,getPanelStyle:S,groupId:E,isPanelCollapsed:C,reevaluatePanelConstraints:T,registerPanel:j,resizePanel:_,unregisterPanel:O}=x,K=Fw(a),I=nr({callbacks:{onCollapse:i,onExpand:d,onResize:p},constraints:{collapsedSize:n,collapsible:r,defaultSize:s,maxSize:c,minSize:u},id:K,idIsFromProps:a!==void 0,order:f});nr({didLogMissingDefaultSizeWarning:!1}),Ei(()=>{const{callbacks:q,constraints:Z}=I.current,ee={...Z};I.current.id=K,I.current.idIsFromProps=a!==void 0,I.current.order=f,q.onCollapse=i,q.onExpand=d,q.onResize=p,Z.collapsedSize=n,Z.collapsible=r,Z.defaultSize=s,Z.maxSize=c,Z.minSize=u,(ee.collapsedSize!==Z.collapsedSize||ee.collapsible!==Z.collapsible||ee.maxSize!==Z.maxSize||ee.minSize!==Z.minSize)&&T(I.current,ee)}),Ei(()=>{const q=I.current;return j(q),()=>{O(q)}},[f,K,j,O]),mO(o,()=>({collapse:()=>{b(I.current)},expand:q=>{y(I.current,q)},getId(){return K},getSize(){return w(I.current)},isCollapsed(){return C(I.current)},isExpanded(){return!C(I.current)},resize:q=>{_(I.current,q)}}),[b,y,w,C,K,_]);const Y=S(I.current,s);return yc(h,{...m,children:e,className:t,id:a,style:{...Y,...g},"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-group-id":E,"data-panel-id":K,"data-panel-size":parseFloat(""+Y.flexGrow).toFixed(1)})}const yO=gO((e,t)=>yc(vO,{...e,forwardedRef:t}));vO.displayName="Panel";yO.displayName="forwardRef(Panel)";let Cb=null,ci=null;function pZ(e,t){if(t){const n=(t&CO)!==0,r=(t&EO)!==0,s=(t&kO)!==0,o=(t&jO)!==0;if(n)return s?"se-resize":o?"ne-resize":"e-resize";if(r)return s?"sw-resize":o?"nw-resize":"w-resize";if(s)return"s-resize";if(o)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function gZ(){ci!==null&&(document.head.removeChild(ci),Cb=null,ci=null)}function yv(e,t){const n=pZ(e,t);Cb!==n&&(Cb=n,ci===null&&(ci=document.createElement("style"),document.head.appendChild(ci)),ci.innerHTML=`*{cursor: ${n}!important;}`)}function bO(e){return e.type==="keydown"}function xO(e){return e.type.startsWith("pointer")}function wO(e){return e.type.startsWith("mouse")}function Wh(e){if(xO(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(wO(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function hZ(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function mZ(e,t,n){return e.xt.x&&e.yt.y}function vZ(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:J1(e),b:J1(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;st(r,"Stacking order can only be calculated for elements with a common ancestor");const s={a:G1(W1(n.a)),b:G1(W1(n.b))};if(s.a===s.b){const o=r.childNodes,a={a:n.a.at(-1),b:n.b.at(-1)};let c=o.length;for(;c--;){const u=o[c];if(u===a.a)return 1;if(u===a.b)return-1}}return Math.sign(s.a-s.b)}const yZ=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function bZ(e){var t;const n=getComputedStyle((t=SO(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function xZ(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||bZ(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||yZ.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function W1(e){let t=e.length;for(;t--;){const n=e[t];if(st(n,"Missing node"),xZ(n))return n}return null}function G1(e){return e&&Number(getComputedStyle(e).zIndex)||0}function J1(e){const t=[];for(;e;)t.push(e),e=SO(e);return t}function SO(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const CO=1,EO=2,kO=4,jO=8,wZ=hZ()==="coarse";let cs=[],Od=!1,Jo=new Map,Gh=new Map;const Id=new Set;function SZ(e,t,n,r,s){var o;const{ownerDocument:a}=t,c={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:s},u=(o=Jo.get(a))!==null&&o!==void 0?o:0;return Jo.set(a,u+1),Id.add(c),Mg(),function(){var d;Gh.delete(e),Id.delete(c);const p=(d=Jo.get(a))!==null&&d!==void 0?d:1;if(Jo.set(a,p-1),Mg(),p===1&&Jo.delete(a),cs.includes(c)){const f=cs.indexOf(c);f>=0&&cs.splice(f,1),$w()}}}function Q1(e){const{target:t}=e,{x:n,y:r}=Wh(e);Od=!0,Lw({target:t,x:n,y:r}),Mg(),cs.length>0&&(Ng("down",e),e.preventDefault(),e.stopPropagation())}function lu(e){const{x:t,y:n}=Wh(e);if(e.buttons===0&&(Od=!1,Ng("up",e)),!Od){const{target:r}=e;Lw({target:r,x:t,y:n})}Ng("move",e),$w(),cs.length>0&&e.preventDefault()}function cl(e){const{target:t}=e,{x:n,y:r}=Wh(e);Gh.clear(),Od=!1,cs.length>0&&e.preventDefault(),Ng("up",e),Lw({target:t,x:n,y:r}),$w(),Mg()}function Lw({target:e,x:t,y:n}){cs.splice(0);let r=null;e instanceof HTMLElement&&(r=e),Id.forEach(s=>{const{element:o,hitAreaMargins:a}=s,c=o.getBoundingClientRect(),{bottom:u,left:i,right:d,top:p}=c,f=wZ?a.coarse:a.fine;if(t>=i-f&&t<=d+f&&n>=p-f&&n<=u+f){if(r!==null&&o!==r&&!o.contains(r)&&!r.contains(o)&&vZ(r,o)>0){let h=r,m=!1;for(;h&&!h.contains(o);){if(mZ(h.getBoundingClientRect(),c)){m=!0;break}h=h.parentElement}if(m)return}cs.push(s)}})}function bv(e,t){Gh.set(e,t)}function $w(){let e=!1,t=!1;cs.forEach(r=>{const{direction:s}=r;s==="horizontal"?e=!0:t=!0});let n=0;Gh.forEach(r=>{n|=r}),e&&t?yv("intersection",n):e?yv("horizontal",n):t?yv("vertical",n):gZ()}function Mg(){Jo.forEach((e,t)=>{const{body:n}=t;n.removeEventListener("contextmenu",cl),n.removeEventListener("pointerdown",Q1),n.removeEventListener("pointerleave",lu),n.removeEventListener("pointermove",lu)}),window.removeEventListener("pointerup",cl),window.removeEventListener("pointercancel",cl),Id.size>0&&(Od?(cs.length>0&&Jo.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("contextmenu",cl),n.addEventListener("pointerleave",lu),n.addEventListener("pointermove",lu))}),window.addEventListener("pointerup",cl),window.addEventListener("pointercancel",cl)):Jo.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("pointerdown",Q1,{capture:!0}),n.addEventListener("pointermove",lu))}))}function Ng(e,t){Id.forEach(n=>{const{setResizeHandlerState:r}=n,s=cs.includes(n);r(e,s,t)})}function st(e,t){if(!e)throw console.error(t),Error(t)}const Bw=10;function $i(e,t,n=Bw){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function io(e,t,n=Bw){return $i(e,t,n)===0}function hr(e,t,n){return $i(e,t,n)===0}function CZ(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r0&&(e=e<0?0-b:b)}}}{const p=e<0?c:u,f=n[p];st(f,`No panel constraints found for index ${p}`);const{collapsedSize:g=0,collapsible:h,minSize:m=0}=f;if(h){const x=t[p];if(st(x!=null,`Previous layout not found for panel index ${p}`),hr(x,m)){const b=x-g;$i(b,Math.abs(e))>0&&(e=e<0?0-b:b)}}}}{const p=e<0?1:-1;let f=e<0?u:c,g=0;for(;;){const m=t[f];st(m!=null,`Previous layout not found for panel index ${f}`);const b=_l({panelConstraints:n,panelIndex:f,size:100})-m;if(g+=b,f+=p,f<0||f>=n.length)break}const h=Math.min(Math.abs(e),Math.abs(g));e=e<0?0-h:h}{let f=e<0?c:u;for(;f>=0&&f=0))break;e<0?f--:f++}}if(CZ(s,a))return s;{const p=e<0?u:c,f=t[p];st(f!=null,`Previous layout not found for panel index ${p}`);const g=f+i,h=_l({panelConstraints:n,panelIndex:p,size:g});if(a[p]=h,!hr(h,g)){let m=g-h,b=e<0?u:c;for(;b>=0&&b0?b--:b++}}}const d=a.reduce((p,f)=>f+p,0);return hr(d,100)?a:s}function EZ({layout:e,panelsArray:t,pivotIndices:n}){let r=0,s=100,o=0,a=0;const c=n[0];st(c!=null,"No pivot index found"),t.forEach((p,f)=>{const{constraints:g}=p,{maxSize:h=100,minSize:m=0}=g;f===c?(r=m,s=h):(o+=m,a+=h)});const u=Math.min(s,100-o),i=Math.max(r,100-a),d=e[c];return{valueMax:u,valueMin:i,valueNow:d}}function Dd(e,t=document){return Array.from(t.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function TO(e,t,n=document){const s=Dd(e,n).findIndex(o=>o.getAttribute("data-panel-resize-handle-id")===t);return s??null}function MO(e,t,n){const r=TO(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function NO(e,t=document){var n;if(t instanceof HTMLElement&&(t==null||(n=t.dataset)===null||n===void 0?void 0:n.panelGroupId)==e)return t;const r=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function Jh(e,t=document){const n=t.querySelector(`[data-panel-resize-handle-id="${e}"]`);return n||null}function kZ(e,t,n,r=document){var s,o,a,c;const u=Jh(t,r),i=Dd(e,r),d=u?i.indexOf(u):-1,p=(s=(o=n[d])===null||o===void 0?void 0:o.id)!==null&&s!==void 0?s:null,f=(a=(c=n[d+1])===null||c===void 0?void 0:c.id)!==null&&a!==void 0?a:null;return[p,f]}function jZ({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:s,panelGroupElement:o,setLayout:a}){nr({didWarnAboutMissingResizeHandle:!1}),Ei(()=>{if(!o)return;const c=Dd(n,o);for(let u=0;u{c.forEach((u,i)=>{u.removeAttribute("aria-controls"),u.removeAttribute("aria-valuemax"),u.removeAttribute("aria-valuemin"),u.removeAttribute("aria-valuenow")})}},[n,r,s,o]),Ci(()=>{if(!o)return;const c=t.current;st(c,"Eager values not found");const{panelDataArray:u}=c,i=NO(n,o);st(i!=null,`No group found for id "${n}"`);const d=Dd(n,o);st(d,`No resize handles found for group id "${n}"`);const p=d.map(f=>{const g=f.getAttribute("data-panel-resize-handle-id");st(g,"Resize handle element has no handle id attribute");const[h,m]=kZ(n,g,u,o);if(h==null||m==null)return()=>{};const x=b=>{if(!b.defaultPrevented)switch(b.key){case"Enter":{b.preventDefault();const y=u.findIndex(w=>w.id===h);if(y>=0){const w=u[y];st(w,`No panel data found for index ${y}`);const S=r[y],{collapsedSize:E=0,collapsible:C,minSize:T=0}=w.constraints;if(S!=null&&C){const j=wu({delta:hr(S,E)?T-E:E-S,initialLayout:r,panelConstraints:u.map(_=>_.constraints),pivotIndices:MO(n,g,o),prevLayout:r,trigger:"keyboard"});r!==j&&a(j)}}break}}};return f.addEventListener("keydown",x),()=>{f.removeEventListener("keydown",x)}});return()=>{p.forEach(f=>f())}},[o,e,t,n,r,s,a])}function Z1(e,t){if(e.length!==t.length)return!1;for(let n=0;no.constraints);let r=0,s=100;for(let o=0;o{const o=e[s];st(o,`Panel data not found for index ${s}`);const{callbacks:a,constraints:c,id:u}=o,{collapsedSize:i=0,collapsible:d}=c,p=n[u];if(p==null||r!==p){n[u]=r;const{onCollapse:f,onExpand:g,onResize:h}=a;h&&h(r,p),d&&(f||g)&&(g&&(p==null||io(p,i))&&!io(r,i)&&g(),f&&(p==null||!io(p,i))&&io(r,i)&&f())}})}function Hf(e,t){if(e.length!==t.length)return!1;for(let n=0;n{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...s)},t)}}function Y1(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function PO(e){return`react-resizable-panels:${e}`}function RO(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:s,order:o}=t;return s?r:o?`${o}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function OO(e,t){try{const n=PO(e),r=t.getItem(n);if(r){const s=JSON.parse(r);if(typeof s=="object"&&s!=null)return s}}catch{}return null}function RZ(e,t,n){var r,s;const o=(r=OO(e,n))!==null&&r!==void 0?r:{},a=RO(t);return(s=o[a])!==null&&s!==void 0?s:null}function OZ(e,t,n,r,s){var o;const a=PO(e),c=RO(t),u=(o=OO(e,s))!==null&&o!==void 0?o:{};u[c]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{s.setItem(a,JSON.stringify(u))}catch(i){console.error(i)}}function X1({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((o,a)=>o+a,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(o=>`${o}%`).join(", ")}`);if(!hr(r,100))for(let o=0;o(Y1(Su),Su.getItem(e)),setItem:(e,t)=>{Y1(Su),Su.setItem(e,t)}},eE={};function IO({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:s,id:o=null,onLayout:a=null,keyboardResizeBy:c=null,storage:u=Su,style:i,tagName:d="div",...p}){const f=Fw(o),g=nr(null),[h,m]=Lu(null),[x,b]=Lu([]),y=nr({}),w=nr(new Map),S=nr(0),E=nr({autoSaveId:e,direction:r,dragState:h,id:f,keyboardResizeBy:c,onLayout:a,storage:u}),C=nr({layout:x,panelDataArray:[],panelDataArrayChanged:!1});nr({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),mO(s,()=>({getId:()=>E.current.id,getLayout:()=>{const{layout:H}=C.current;return H},setLayout:H=>{const{onLayout:se}=E.current,{layout:ne,panelDataArray:le}=C.current,oe=X1({layout:H,panelConstraints:le.map(Q=>Q.constraints)});Z1(ne,oe)||(b(oe),C.current.layout=oe,se&&se(oe),ul(le,oe,y.current))}}),[]),Ei(()=>{E.current.autoSaveId=e,E.current.direction=r,E.current.dragState=h,E.current.id=f,E.current.onLayout=a,E.current.storage=u}),jZ({committedValuesRef:E,eagerValuesRef:C,groupId:f,layout:x,panelDataArray:C.current.panelDataArray,setLayout:b,panelGroupElement:g.current}),Ci(()=>{const{panelDataArray:H}=C.current;if(e){if(x.length===0||x.length!==H.length)return;let se=eE[e];se==null&&(se=PZ(OZ,IZ),eE[e]=se);const ne=[...H],le=new Map(w.current);se(e,ne,le,x,u)}},[e,x,u]),Ci(()=>{});const T=dr(H=>{const{onLayout:se}=E.current,{layout:ne,panelDataArray:le}=C.current;if(H.constraints.collapsible){const oe=le.map(Be=>Be.constraints),{collapsedSize:Q=0,panelSize:Ee,pivotIndices:Pe}=Wa(le,H,ne);if(st(Ee!=null,`Panel size not found for panel "${H.id}"`),!io(Ee,Q)){w.current.set(H.id,Ee);const Re=gl(le,H)===le.length-1?Ee-Q:Q-Ee,ve=wu({delta:Re,initialLayout:ne,panelConstraints:oe,pivotIndices:Pe,prevLayout:ne,trigger:"imperative-api"});Hf(ne,ve)||(b(ve),C.current.layout=ve,se&&se(ve),ul(le,ve,y.current))}}},[]),j=dr((H,se)=>{const{onLayout:ne}=E.current,{layout:le,panelDataArray:oe}=C.current;if(H.constraints.collapsible){const Q=oe.map(ot=>ot.constraints),{collapsedSize:Ee=0,panelSize:Pe=0,minSize:Be=0,pivotIndices:Re}=Wa(oe,H,le),ve=se??Be;if(io(Pe,Ee)){const ot=w.current.get(H.id),Vt=ot!=null&&ot>=ve?ot:ve,Xt=gl(oe,H)===oe.length-1?Pe-Vt:Vt-Pe,ln=wu({delta:Xt,initialLayout:le,panelConstraints:Q,pivotIndices:Re,prevLayout:le,trigger:"imperative-api"});Hf(le,ln)||(b(ln),C.current.layout=ln,ne&&ne(ln),ul(oe,ln,y.current))}}},[]),_=dr(H=>{const{layout:se,panelDataArray:ne}=C.current,{panelSize:le}=Wa(ne,H,se);return st(le!=null,`Panel size not found for panel "${H.id}"`),le},[]),O=dr((H,se)=>{const{panelDataArray:ne}=C.current,le=gl(ne,H);return _Z({defaultSize:se,dragState:h,layout:x,panelData:ne,panelIndex:le})},[h,x]),K=dr(H=>{const{layout:se,panelDataArray:ne}=C.current,{collapsedSize:le=0,collapsible:oe,panelSize:Q}=Wa(ne,H,se);return st(Q!=null,`Panel size not found for panel "${H.id}"`),oe===!0&&io(Q,le)},[]),I=dr(H=>{const{layout:se,panelDataArray:ne}=C.current,{collapsedSize:le=0,collapsible:oe,panelSize:Q}=Wa(ne,H,se);return st(Q!=null,`Panel size not found for panel "${H.id}"`),!oe||$i(Q,le)>0},[]),Y=dr(H=>{const{panelDataArray:se}=C.current;se.push(H),se.sort((ne,le)=>{const oe=ne.order,Q=le.order;return oe==null&&Q==null?0:oe==null?-1:Q==null?1:oe-Q}),C.current.panelDataArrayChanged=!0},[]);Ei(()=>{if(C.current.panelDataArrayChanged){C.current.panelDataArrayChanged=!1;const{autoSaveId:H,onLayout:se,storage:ne}=E.current,{layout:le,panelDataArray:oe}=C.current;let Q=null;if(H){const Pe=RZ(H,oe,ne);Pe&&(w.current=new Map(Object.entries(Pe.expandToSizes)),Q=Pe.layout)}Q==null&&(Q=NZ({panelDataArray:oe}));const Ee=X1({layout:Q,panelConstraints:oe.map(Pe=>Pe.constraints)});Z1(le,Ee)||(b(Ee),C.current.layout=Ee,se&&se(Ee),ul(oe,Ee,y.current))}}),Ei(()=>{const H=C.current;return()=>{H.layout=[]}},[]);const q=dr(H=>function(ne){ne.preventDefault();const le=g.current;if(!le)return()=>null;const{direction:oe,dragState:Q,id:Ee,keyboardResizeBy:Pe,onLayout:Be}=E.current,{layout:Re,panelDataArray:ve}=C.current,{initialLayout:ot}=Q??{},Vt=MO(Ee,H,le);let tn=MZ(ne,H,oe,Q,Pe,le);const Xt=oe==="horizontal";document.dir==="rtl"&&Xt&&(tn=-tn);const ln=ve.map(V=>V.constraints),M=wu({delta:tn,initialLayout:ot??Re,panelConstraints:ln,pivotIndices:Vt,prevLayout:Re,trigger:bO(ne)?"keyboard":"mouse-or-touch"}),D=!Hf(Re,M);(xO(ne)||wO(ne))&&S.current!=tn&&(S.current=tn,D?bv(H,0):Xt?bv(H,tn<0?CO:EO):bv(H,tn<0?kO:jO)),D&&(b(M),C.current.layout=M,Be&&Be(M),ul(ve,M,y.current))},[]),Z=dr((H,se)=>{const{onLayout:ne}=E.current,{layout:le,panelDataArray:oe}=C.current,Q=oe.map(ot=>ot.constraints),{panelSize:Ee,pivotIndices:Pe}=Wa(oe,H,le);st(Ee!=null,`Panel size not found for panel "${H.id}"`);const Re=gl(oe,H)===oe.length-1?Ee-se:se-Ee,ve=wu({delta:Re,initialLayout:le,panelConstraints:Q,pivotIndices:Pe,prevLayout:le,trigger:"imperative-api"});Hf(le,ve)||(b(ve),C.current.layout=ve,ne&&ne(ve),ul(oe,ve,y.current))},[]),ee=dr((H,se)=>{const{layout:ne,panelDataArray:le}=C.current,{collapsedSize:oe=0,collapsible:Q}=se,{collapsedSize:Ee=0,collapsible:Pe,maxSize:Be=100,minSize:Re=0}=H.constraints,{panelSize:ve}=Wa(le,H,ne);ve!=null&&(Q&&Pe&&io(ve,oe)?io(oe,Ee)||Z(H,Ee):veBe&&Z(H,Be))},[Z]),J=dr((H,se)=>{const{direction:ne}=E.current,{layout:le}=C.current;if(!g.current)return;const oe=Jh(H,g.current);st(oe,`Drag handle element not found for id "${H}"`);const Q=_O(ne,se);m({dragHandleId:H,dragHandleRect:oe.getBoundingClientRect(),initialCursorPosition:Q,initialLayout:le})},[]),L=dr(()=>{m(null)},[]),A=dr(H=>{const{panelDataArray:se}=C.current,ne=gl(se,H);ne>=0&&(se.splice(ne,1),delete y.current[H.id],C.current.panelDataArrayChanged=!0)},[]),X=cZ(()=>({collapsePanel:T,direction:r,dragState:h,expandPanel:j,getPanelSize:_,getPanelStyle:O,groupId:f,isPanelCollapsed:K,isPanelExpanded:I,reevaluatePanelConstraints:ee,registerPanel:Y,registerResizeHandle:q,resizePanel:Z,startDragging:J,stopDragging:L,unregisterPanel:A,panelGroupElement:g.current}),[T,h,r,j,_,O,f,K,I,ee,Y,q,Z,J,L,A]),fe={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return yc(qh.Provider,{value:X},yc(d,{...p,children:t,className:n,id:o,ref:g,style:{...fe,...i},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":f}))}const DO=gO((e,t)=>yc(IO,{...e,forwardedRef:t}));IO.displayName="PanelGroup";DO.displayName="forwardRef(PanelGroup)";function gl(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function Wa(e,t,n){const r=gl(e,t),o=r===e.length-1?[r-1,r]:[r,r+1],a=n[r];return{...t.constraints,panelSize:a,pivotIndices:o}}function DZ({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){Ci(()=>{if(e||n==null||r==null)return;const s=Jh(t,r);if(s==null)return;const o=a=>{if(!a.defaultPrevented)switch(a.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{a.preventDefault(),n(a);break}case"F6":{a.preventDefault();const c=s.getAttribute("data-panel-group-id");st(c,`No group element found for id "${c}"`);const u=Dd(c,r),i=TO(c,t,r);st(i!==null,`No resize element found for id "${t}"`);const d=a.shiftKey?i>0?i-1:u.length-1:i+1{s.removeEventListener("keydown",o)}},[r,e,t,n])}function AO({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:s,onBlur:o,onDragging:a,onFocus:c,style:u={},tabIndex:i=0,tagName:d="div",...p}){var f,g;const h=nr(null),m=nr({onDragging:a});Ci(()=>{m.current.onDragging=a});const x=hO(qh);if(x===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:b,groupId:y,registerResizeHandle:w,startDragging:S,stopDragging:E,panelGroupElement:C}=x,T=Fw(s),[j,_]=Lu("inactive"),[O,K]=Lu(!1),[I,Y]=Lu(null),q=nr({state:j});Ei(()=>{q.current.state=j}),Ci(()=>{if(n)Y(null);else{const L=w(T);Y(()=>L)}},[n,T,w]);const Z=(f=r==null?void 0:r.coarse)!==null&&f!==void 0?f:15,ee=(g=r==null?void 0:r.fine)!==null&&g!==void 0?g:5;return Ci(()=>{if(n||I==null)return;const L=h.current;return st(L,"Element ref not attached"),SZ(T,L,b,{coarse:Z,fine:ee},(X,fe,H)=>{if(fe)switch(X){case"down":{_("drag"),S(T,H);const{onDragging:se}=m.current;se&&se(!0);break}case"move":{const{state:se}=q.current;se!=="drag"&&_("hover"),I(H);break}case"up":{_("hover"),E();const{onDragging:se}=m.current;se&&se(!1);break}}else _("inactive")})},[Z,b,n,ee,w,T,I,S,E]),DZ({disabled:n,handleId:T,resizeHandler:I,panelGroupElement:C}),yc(d,{...p,children:e,className:t,id:s,onBlur:()=>{K(!1),o==null||o()},onFocus:()=>{K(!0),c==null||c()},ref:h,role:"separator",style:{...{touchAction:"none",userSelect:"none"},...u},tabIndex:i,"data-panel-group-direction":b,"data-panel-group-id":y,"data-resize-handle":"","data-resize-handle-active":j==="drag"?"pointer":O?"keyboard":void 0,"data-resize-handle-state":j,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":T})}AO.displayName="PanelResizeHandle";const za=({className:e,...t})=>l.jsx(DO,{className:me("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),Bn=yO,Ua=({withHandle:e,className:t,...n})=>l.jsx(AO,{className:me("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 after:bg-border focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),...n,children:e&&l.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:l.jsx(ZB,{className:"h-2.5 w-2.5"})})});var zw="Tabs",[AZ,cae]=qr(zw,[bh]),FO=bh(),[FZ,Uw]=AZ(zw),LO=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:o,orientation:a="horizontal",dir:c,activationMode:u="automatic",...i}=e,d=Jd(c),[p,f]=ya({prop:r,onChange:s,defaultProp:o});return l.jsx(FZ,{scope:n,baseId:is(),value:p,onValueChange:f,orientation:a,dir:d,activationMode:u,children:l.jsx(Ie.div,{dir:d,"data-orientation":a,...i,ref:t})})});LO.displayName=zw;var $O="TabsList",BO=v.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,o=Uw($O,n),a=FO(n);return l.jsx(XM,{asChild:!0,...a,orientation:o.orientation,dir:o.dir,loop:r,children:l.jsx(Ie.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});BO.displayName=$O;var zO="TabsTrigger",UO=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...o}=e,a=Uw(zO,n),c=FO(n),u=KO(a.baseId,r),i=qO(a.baseId,r),d=r===a.value;return l.jsx(eN,{asChild:!0,...c,focusable:!s,active:d,children:l.jsx(Ie.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":i,"data-state":d?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:u,...o,ref:t,onMouseDown:Ce(e.onMouseDown,p=>{!s&&p.button===0&&p.ctrlKey===!1?a.onValueChange(r):p.preventDefault()}),onKeyDown:Ce(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&a.onValueChange(r)}),onFocus:Ce(e.onFocus,()=>{const p=a.activationMode!=="manual";!d&&!s&&p&&a.onValueChange(r)})})})});UO.displayName=zO;var VO="TabsContent",HO=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:o,...a}=e,c=Uw(VO,n),u=KO(c.baseId,r),i=qO(c.baseId,r),d=r===c.value,p=v.useRef(d);return v.useEffect(()=>{const f=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(f)},[]),l.jsx(cr,{present:s||d,children:({present:f})=>l.jsx(Ie.div,{"data-state":d?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":u,hidden:!f,id:i,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:f&&o})})});HO.displayName=VO;function KO(e,t){return`${e}-trigger-${t}`}function qO(e,t){return`${e}-content-${t}`}var LZ=LO,WO=BO,GO=UO,JO=HO;const $Z=LZ,QO=v.forwardRef(({className:e,...t},n)=>l.jsx(WO,{ref:n,className:me("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));QO.displayName=WO.displayName;const Eb=v.forwardRef(({className:e,...t},n)=>l.jsx(GO,{ref:n,className:me("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Eb.displayName=GO.displayName;const kb=v.forwardRef(({className:e,...t},n)=>l.jsx(JO,{ref:n,className:me("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));kb.displayName=JO.displayName;const BZ=e=>["chats","findChats",JSON.stringify(e)],zZ=async({instanceName:e})=>(await ie.post(`/chat/findChats/${e}`,{where:{}})).data,UZ=e=>{const{instanceName:t,...n}=e;return qe({...n,queryKey:BZ({instanceName:t}),queryFn:()=>zZ({instanceName:t}),enabled:!!t})};function Va(e){const t=o=>typeof window<"u"?window.matchMedia(o).matches:!1,[n,r]=v.useState(t(e));function s(){r(t(e))}return v.useEffect(()=>{const o=window.matchMedia(e);return s(),o.addListener?o.addListener(s):o.addEventListener("change",s),()=>{o.removeListener?o.removeListener(s):o.removeEventListener("change",s)}},[e]),n}const Vl=v.forwardRef(({className:e,...t},n)=>l.jsx("textarea",{className:me("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));Vl.displayName="Textarea";const VZ=e=>["chats","findChats",JSON.stringify(e)],HZ=async({instanceName:e,remoteJid:t})=>{const n=await ie.post(`/chat/findChats/${e}`,{where:{remoteJid:t}});return Array.isArray(n.data)?n.data[0]:n.data},KZ=e=>{const{instanceName:t,remoteJid:n,...r}=e;return qe({...r,queryKey:VZ({instanceName:t,remoteJid:n}),queryFn:()=>HZ({instanceName:t,remoteJid:n}),enabled:!!t&&!!n})},qZ=e=>["chats","findMessages",JSON.stringify(e)],WZ=async({instanceName:e,remoteJid:t})=>{var r,s;const n=await ie.post(`/chat/findMessages/${e}`,{where:{key:{remoteJid:t}}});return(s=(r=n.data)==null?void 0:r.messages)!=null&&s.records?n.data.messages.records:n.data},GZ=e=>{const{instanceName:t,remoteJid:n,...r}=e;return qe({...r,queryKey:qZ({instanceName:t,remoteJid:n}),queryFn:()=>WZ({instanceName:t,remoteJid:n}),enabled:!!t&&!!n})};function JZ({textareaRef:e,handleTextareaChange:t,textareaHeight:n,lastMessageRef:r,scrollToBottom:s}){const{instance:o}=Ve(),{remoteJid:a}=gs(),{data:c}=KZ({remoteJid:a,instanceName:o==null?void 0:o.name}),{data:u,isSuccess:i}=GZ({remoteJid:a,instanceName:o==null?void 0:o.name});v.useEffect(()=>{i&&u&&s()},[i,u,s]);const d=f=>l.jsx("div",{className:"bubble-right",children:l.jsx("div",{className:"flex items-start gap-4 self-end",children:l.jsx("div",{className:"grid gap-1",children:l.jsx("div",{className:"prose text-muted-foreground",children:l.jsx("div",{className:"bubble",children:JSON.stringify(f.message)})})})})}),p=f=>l.jsx("div",{className:"bubble-left",children:l.jsx("div",{className:"flex items-start gap-4",children:l.jsx("div",{className:"grid gap-1",children:l.jsx("div",{className:"prose text-muted-foreground",children:l.jsx("div",{className:"bubble",children:JSON.stringify(f.message)})})})})});return l.jsxs("div",{className:"flex min-h-screen flex-col",children:[l.jsx("div",{className:"sticky top-0 p-2",children:l.jsxs(iw,{children:[l.jsx(lw,{asChild:!0,children:l.jsxs(z,{variant:"ghost",className:"h-10 gap-1 rounded-xl px-3 text-lg data-[state=open]:bg-muted",children:[(c==null?void 0:c.pushName)||(c==null?void 0:c.remoteJid.split("@")[0]),l.jsx(uh,{className:"h-4 w-4 text-muted-foreground"})]})}),l.jsxs(Mr,{align:"start",className:"max-w-[300px]",children:[l.jsxs(tt,{className:"items-start gap-2",children:[l.jsx(o3,{className:"mr-2 h-4 w-4 shrink-0 translate-y-1"}),l.jsxs("div",{children:[l.jsx("div",{className:"font-medium",children:"GPT-4"}),l.jsx("div",{className:"text-muted-foreground/80",children:"With DALL-E, browsing and analysis. Limit 40 messages / 3 hours"})]})]}),l.jsx(Gs,{}),l.jsxs(tt,{className:"items-start gap-2",children:[l.jsx(yM,{className:"mr-2 h-4 w-4 shrink-0 translate-y-1"}),l.jsxs("div",{children:[l.jsx("div",{className:"font-medium",children:"GPT-3"}),l.jsx("div",{className:"text-muted-foreground/80",children:"Great for everyday tasks"})]})]})]})]})}),l.jsxs("div",{className:"message-container mx-auto flex max-w-4xl flex-1 flex-col gap-8 overflow-y-auto px-4",children:[u==null?void 0:u.map(f=>f.key.fromMe?d(f):p(f)),l.jsx("div",{ref:r})]}),l.jsx("div",{className:"sticky bottom-0 mx-auto flex w-full max-w-2xl flex-col gap-1.5 bg-background px-4 py-2",children:l.jsxs("div",{className:"input-message relative",children:[l.jsxs(z,{type:"button",size:"icon",className:"absolute bottom-3 left-3 h-8 w-8 rounded-full bg-transparent text-white hover:bg-transparent",children:[l.jsx(s3,{className:"h-4 w-4 text-white"}),l.jsx("span",{className:"sr-only",children:"Anexar"})]}),l.jsx(Vl,{placeholder:"Enviar mensagem...",name:"message",id:"message",rows:1,ref:e,onChange:t,style:{height:n},className:"max-h-[240px] min-h-[48px] resize-none rounded-3xl border border-none p-4 pl-12 pr-16 shadow-sm"}),l.jsxs(z,{type:"submit",size:"icon",className:"absolute bottom-3 right-3 h-8 w-8 rounded-full",children:[l.jsx(BB,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Enviar"})]})]})})]})}function tE(){const e=Va("(min-width: 768px)"),t=v.useRef(null),[n]=v.useState("auto"),r=v.useRef(null),{instance:s}=Ve(),{data:o,isSuccess:a}=UZ({instanceName:s==null?void 0:s.name}),{instanceId:c,remoteJid:u}=gs(),i=an(),d=v.useCallback(()=>{t.current&&t.current.scrollIntoView({})},[]),p=()=>{if(r.current){r.current.style.height="auto";const g=r.current.scrollHeight,m=parseInt(getComputedStyle(r.current).lineHeight)*10;r.current.style.height=`${Math.min(g,m)}px`}};v.useEffect(()=>{a&&d()},[a,d]);const f=g=>{i(`/manager/instance/${c}/chat/${g}`)};return l.jsxs(za,{direction:e?"horizontal":"vertical",children:[l.jsx(Bn,{defaultSize:20,children:l.jsxs("div",{className:"hidden flex-col gap-2 bg-background text-foreground md:flex",children:[l.jsx("div",{className:"sticky top-0 p-2",children:l.jsxs(z,{variant:"ghost",className:"w-full justify-start gap-2 px-2 text-left",children:[l.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-full",children:l.jsx(dh,{className:"h-4 w-4"})}),l.jsx("div",{className:"grow overflow-hidden text-ellipsis whitespace-nowrap text-sm",children:"Chat"}),l.jsx(Ws,{className:"h-4 w-4"})]})}),l.jsxs($Z,{defaultValue:"contacts",children:[l.jsxs(QO,{className:"tabs-chat",children:[l.jsx(Eb,{value:"contacts",children:"Contatos"}),l.jsx(Eb,{value:"groups",children:"Grupos"})]}),l.jsx(kb,{value:"contacts",children:l.jsx("div",{className:"flex-1 overflow-auto",children:l.jsxs("div",{className:"grid gap-1 p-2 text-foreground",children:[l.jsx("div",{className:"px-2 text-xs font-medium text-muted-foreground",children:"Contatos"}),o==null?void 0:o.map(g=>g.remoteJid.includes("@s.whatsapp.net")&&l.jsxs(ld,{to:"#",onClick:()=>f(g.remoteJid),className:`chat-item flex items-center overflow-hidden truncate whitespace-nowrap rounded-md border-b border-gray-600/50 p-2 text-sm transition-colors hover:bg-muted/50 ${u===g.remoteJid?"active":""}`,children:[l.jsx("span",{className:"chat-avatar mr-2",children:l.jsx("img",{src:g.profilePicUrl||"https://via.placeholder.com/150",alt:"Avatar",className:"h-8 w-8 rounded-full"})}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("span",{className:"chat-title block font-medium",children:g.pushName}),l.jsx("span",{className:"chat-description block text-xs text-gray-500",children:g.remoteJid.split("@")[0]})]})]},g.id))]})})}),l.jsx(kb,{value:"groups",children:l.jsx("div",{className:"flex-1 overflow-auto",children:l.jsx("div",{className:"grid gap-1 p-2 text-foreground",children:o==null?void 0:o.map(g=>g.remoteJid.includes("@g.us")&&l.jsxs(ld,{to:"#",onClick:()=>f(g.remoteJid),className:`chat-item flex items-center overflow-hidden truncate whitespace-nowrap rounded-md border-b border-gray-600/50 p-2 text-sm transition-colors hover:bg-muted/50 ${u===g.remoteJid?"active":""}`,children:[l.jsx("span",{className:"chat-avatar mr-2",children:l.jsx("img",{src:g.profilePicUrl||"https://via.placeholder.com/150",alt:"Avatar",className:"h-8 w-8 rounded-full"})}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("span",{className:"chat-title block font-medium",children:g.pushName}),l.jsx("span",{className:"chat-description block text-xs text-gray-500",children:g.remoteJid})]})]},g.id))})})})]})]})}),l.jsx(Ua,{withHandle:!0,className:"border border-black"}),l.jsx(Bn,{children:u&&l.jsx(JZ,{textareaRef:r,handleTextareaChange:p,textareaHeight:n,lastMessageRef:t,scrollToBottom:d})})]})}const QZ=e=>["chatwoot","fetchChatwoot",JSON.stringify(e)],ZZ=async({instanceName:e,token:t})=>(await ie.get(`/chatwoot/find/${e}`,{headers:{apiKey:t}})).data,YZ=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:QZ({instanceName:t,token:n}),queryFn:()=>ZZ({instanceName:t,token:n}),enabled:!!t})},XZ=async({instanceName:e,token:t,data:n})=>(await ie.post(`/chatwoot/set/${e}`,n,{headers:{apikey:t}})).data;function eY(){return{createChatwoot:Le(XZ,{invalidateKeys:[["chatwoot","fetchChatwoot"]]})}}const Kf=k.string().optional().transform(e=>e===""?void 0:e),tY=k.object({enabled:k.boolean(),accountId:k.string(),token:k.string(),url:k.string(),signMsg:k.boolean().optional(),signDelimiter:Kf,nameInbox:Kf,organization:Kf,logo:Kf,reopenConversation:k.boolean().optional(),conversationPending:k.boolean().optional(),mergeBrazilContacts:k.boolean().optional(),importContacts:k.boolean().optional(),importMessages:k.boolean().optional(),daysLimitImportMessages:k.coerce.number().optional(),autoCreate:k.boolean(),ignoreJids:k.array(k.string()).default([])});function nY(){const{t:e}=Te(),{instance:t}=Ve(),[,n]=v.useState(!1),{createChatwoot:r}=eY(),{data:s}=YZ({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token}),o=zt({resolver:Ut(tY),defaultValues:{enabled:!0,accountId:"",token:"",url:"",signMsg:!0,signDelimiter:"\\n",nameInbox:"",organization:"",logo:"",reopenConversation:!0,conversationPending:!1,mergeBrazilContacts:!0,importContacts:!1,importMessages:!1,daysLimitImportMessages:7,autoCreate:!0,ignoreJids:[]}});v.useEffect(()=>{if(s){o.setValue("ignoreJids",s.ignoreJids||[]);const c={enabled:s.enabled,accountId:s.accountId,token:s.token,url:s.url,signMsg:s.signMsg||!1,signDelimiter:s.signDelimiter||"\\n",nameInbox:s.nameInbox||"",organization:s.organization||"",logo:s.logo||"",reopenConversation:s.reopenConversation||!1,conversationPending:s.conversationPending||!1,mergeBrazilContacts:s.mergeBrazilContacts||!1,importContacts:s.importContacts||!1,importMessages:s.importMessages||!1,daysLimitImportMessages:s.daysLimitImportMessages||7,autoCreate:s.autoCreate||!1,ignoreJids:s.ignoreJids};o.reset(c)}},[s,o]);const a=async c=>{if(!t)return;n(!0);const u={enabled:c.enabled,accountId:c.accountId,token:c.token,url:c.url,signMsg:c.signMsg||!1,signDelimiter:c.signDelimiter||"\\n",nameInbox:c.nameInbox||"",organization:c.organization||"",logo:c.logo||"",reopenConversation:c.reopenConversation||!1,conversationPending:c.conversationPending||!1,mergeBrazilContacts:c.mergeBrazilContacts||!1,importContacts:c.importContacts||!1,importMessages:c.importMessages||!1,daysLimitImportMessages:c.daysLimitImportMessages||7,autoCreate:c.autoCreate,ignoreJids:c.ignoreJids};await r({instanceName:t.name,token:t.token,data:u},{onSuccess:()=>{G.success(e("chatwoot.toast.success"))},onError:i=>{var d,p,f;console.error(e("chatwoot.toast.error"),i),G4(i)?G.error(`Error: ${(f=(p=(d=i==null?void 0:i.response)==null?void 0:d.data)==null?void 0:p.response)==null?void 0:f.message}`):G.error(e("chatwoot.toast.error"))},onSettled:()=>{n(!1)}})};return l.jsx(l.Fragment,{children:l.jsx(La,{...o,children:l.jsxs("form",{onSubmit:o.handleSubmit(a),className:"w-full space-y-6",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("chatwoot.title")}),l.jsx(Da,{className:"my-4"}),l.jsxs("div",{className:"mx-4 space-y-2 divide-y [&>*]:px-4 [&>*]:py-2",children:[l.jsx(ge,{name:"enabled",label:e("chatwoot.form.enabled.label"),className:"w-full justify-between",helper:e("chatwoot.form.enabled.description")}),l.jsx($,{name:"url",label:e("chatwoot.form.url.label"),children:l.jsx(F,{})}),l.jsx($,{name:"accountId",label:e("chatwoot.form.accountId.label"),children:l.jsx(F,{})}),l.jsx($,{name:"token",label:e("chatwoot.form.token.label"),children:l.jsx(F,{type:"password"})}),l.jsx(ge,{name:"signMsg",label:e("chatwoot.form.signMsg.label"),className:"w-full justify-between",helper:e("chatwoot.form.signMsg.description")}),l.jsx($,{name:"signDelimiter",label:e("chatwoot.form.signDelimiter.label"),children:l.jsx(F,{})}),l.jsx($,{name:"nameInbox",label:e("chatwoot.form.nameInbox.label"),children:l.jsx(F,{})}),l.jsx($,{name:"organization",label:e("chatwoot.form.organization.label"),children:l.jsx(F,{})}),l.jsx($,{name:"logo",label:e("chatwoot.form.logo.label"),children:l.jsx(F,{})}),l.jsx(ge,{name:"conversationPending",label:e("chatwoot.form.conversationPending.label"),className:"w-full justify-between",helper:e("chatwoot.form.conversationPending.description")}),l.jsx(ge,{name:"reopenConversation",label:e("chatwoot.form.reopenConversation.label"),className:"w-full justify-between",helper:e("chatwoot.form.reopenConversation.description")}),l.jsx(ge,{name:"importContacts",label:e("chatwoot.form.importContacts.label"),className:"w-full justify-between",helper:e("chatwoot.form.importContacts.description")}),l.jsx(ge,{name:"importMessages",label:e("chatwoot.form.importMessages.label"),className:"w-full justify-between",helper:e("chatwoot.form.importMessages.description")}),l.jsx($,{name:"daysLimitImportMessages",label:e("chatwoot.form.daysLimitImportMessages.label"),children:l.jsx(F,{type:"number"})}),l.jsx(Ba,{name:"ignoreJids",label:e("chatwoot.form.ignoreJids.label"),placeholder:e("chatwoot.form.ignoreJids.placeholder")}),l.jsx(ge,{name:"autoCreate",label:e("chatwoot.form.autoCreate.label"),className:"w-full justify-between",helper:e("chatwoot.form.autoCreate.description")})]})]}),l.jsx("div",{className:"mx-4 flex justify-end",children:l.jsx(z,{type:"submit",children:e("chatwoot.button.save")})})]})})})}var Qh={},ZO={exports:{}},rY="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",sY=rY,oY=sY;function YO(){}function XO(){}XO.resetWarningCache=YO;var aY=function(){function e(r,s,o,a,c,u){if(u!==oY){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:XO,resetWarningCache:YO};return n.PropTypes=n,n};ZO.exports=aY();var eI=ZO.exports,tI={L:1,M:0,Q:3,H:2},nI={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},iY=nI;function rI(e){this.mode=iY.MODE_8BIT_BYTE,this.data=e}rI.prototype={getLength:function(e){return this.data.length},write:function(e){for(var t=0;t>>7-e%8&1)==1},put:function(e,t){for(var n=0;n>>t-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var uY=sI,ns={glog:function(e){if(e<1)throw new Error("glog("+e+")");return ns.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return ns.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var En=0;En<8;En++)ns.EXP_TABLE[En]=1<=0;)t^=Sn.G15<=0;)t^=Sn.G18<>>=1;return t},getPatternPosition:function(e){return Sn.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,n){switch(e){case Bo.PATTERN000:return(t+n)%2==0;case Bo.PATTERN001:return t%2==0;case Bo.PATTERN010:return n%3==0;case Bo.PATTERN011:return(t+n)%3==0;case Bo.PATTERN100:return(Math.floor(t/2)+Math.floor(n/3))%2==0;case Bo.PATTERN101:return t*n%2+t*n%3==0;case Bo.PATTERN110:return(t*n%2+t*n%3)%2==0;case Bo.PATTERN111:return(t*n%3+(t+n)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new nE([1],0),n=0;n5&&(n+=3+o-5)}for(var r=0;r=7&&this.setupTypeNumber(e),this.dataCache==null&&(this.dataCache=Fs.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)};Nr.setupPositionProbePattern=function(e,t){for(var n=-1;n<=7;n++)if(!(e+n<=-1||this.moduleCount<=e+n))for(var r=-1;r<=7;r++)t+r<=-1||this.moduleCount<=t+r||(0<=n&&n<=6&&(r==0||r==6)||0<=r&&r<=6&&(n==0||n==6)||2<=n&&n<=4&&2<=r&&r<=4?this.modules[e+n][t+r]=!0:this.modules[e+n][t+r]=!1)};Nr.getBestMaskPattern=function(){for(var e=0,t=0,n=0;n<8;n++){this.makeImpl(!0,n);var r=Ha.getLostPoint(this);(n==0||e>r)&&(e=r,t=n)}return t};Nr.createMovieClip=function(e,t,n){var r=e.createEmptyMovieClip(t,n),s=1;this.make();for(var o=0;o>n&1)==1;this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=r}for(var n=0;n<18;n++){var r=!e&&(t>>n&1)==1;this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=r}};Nr.setupTypeInfo=function(e,t){for(var n=this.errorCorrectLevel<<3|t,r=Ha.getBCHTypeInfo(n),s=0;s<15;s++){var o=!e&&(r>>s&1)==1;s<6?this.modules[s][8]=o:s<8?this.modules[s+1][8]=o:this.modules[this.moduleCount-15+s][8]=o}for(var s=0;s<15;s++){var o=!e&&(r>>s&1)==1;s<8?this.modules[8][this.moduleCount-s-1]=o:s<9?this.modules[8][15-s-1+1]=o:this.modules[8][15-s-1]=o}this.modules[this.moduleCount-8][8]=!e};Nr.mapData=function(e,t){for(var n=-1,r=this.moduleCount-1,s=7,o=0,a=this.moduleCount-1;a>0;a-=2)for(a==6&&a--;;){for(var c=0;c<2;c++)if(this.modules[r][a-c]==null){var u=!1;o>>s&1)==1);var i=Ha.getMask(t,r,a-c);i&&(u=!u),this.modules[r][a-c]=u,s--,s==-1&&(o++,s=7)}if(r+=n,r<0||this.moduleCount<=r){r-=n,n=-n;break}}};Fs.PAD0=236;Fs.PAD1=17;Fs.createData=function(e,t,n){for(var r=iI.getRSBlocks(e,t),s=new lI,o=0;oc*8)throw new Error("code length overflow. ("+s.getLengthInBits()+">"+c*8+")");for(s.getLengthInBits()+4<=c*8&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;!(s.getLengthInBits()>=c*8||(s.put(Fs.PAD0,8),s.getLengthInBits()>=c*8));)s.put(Fs.PAD1,8);return Fs.createBytes(s,r)};Fs.createBytes=function(e,t){for(var n=0,r=0,s=0,o=new Array(t.length),a=new Array(t.length),c=0;c=0?g.get(h):0}}for(var m=0,d=0;d=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var bY={bgColor:Or.default.oneOfType([Or.default.object,Or.default.string]).isRequired,bgD:Or.default.string.isRequired,fgColor:Or.default.oneOfType([Or.default.object,Or.default.string]).isRequired,fgD:Or.default.string.isRequired,size:Or.default.number.isRequired,title:Or.default.string,viewBoxSize:Or.default.number.isRequired,xmlns:Or.default.string},Hw=(0,cI.forwardRef)(function(e,t){var n=e.bgColor,r=e.bgD,s=e.fgD,o=e.fgColor,a=e.size,c=e.title,u=e.viewBoxSize,i=e.xmlns,d=i===void 0?"http://www.w3.org/2000/svg":i,p=yY(e,["bgColor","bgD","fgD","fgColor","size","title","viewBoxSize","xmlns"]);return Wf.default.createElement("svg",mY({},p,{height:a,ref:t,viewBox:"0 0 "+u+" "+u,width:a,xmlns:d}),c?Wf.default.createElement("title",null,c):null,Wf.default.createElement("path",{d:r,fill:n}),Wf.default.createElement("path",{d:s,fill:o}))});Hw.displayName="QRCodeSvg";Hw.propTypes=bY;Vw.default=Hw;Object.defineProperty(Qh,"__esModule",{value:!0});Qh.QRCode=void 0;var xY=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var _Y={bgColor:Xs.default.oneOfType([Xs.default.object,Xs.default.string]),fgColor:Xs.default.oneOfType([Xs.default.object,Xs.default.string]),level:Xs.default.string,size:Xs.default.number,value:Xs.default.string.isRequired},Zh=(0,dI.forwardRef)(function(e,t){var n=e.bgColor,r=n===void 0?"#FFFFFF":n,s=e.fgColor,o=s===void 0?"#000000":s,a=e.level,c=a===void 0?"L":a,u=e.size,i=u===void 0?256:u,d=e.value,p=NY(e,["bgColor","fgColor","level","size","value"]),f=new kY.default(-1,CY.default[c]);f.addData(d),f.make();var g=f.modules;return jY.default.createElement(MY.default,xY({},p,{bgColor:r,bgD:g.map(function(h,m){return h.map(function(x,b){return x?"":"M "+b+" "+m+" l 1 0 0 1 -1 0 Z"}).join(" ")}).join(" "),fgColor:o,fgD:g.map(function(h,m){return h.map(function(x,b){return x?"M "+b+" "+m+" l 1 0 0 1 -1 0 Z":""}).join(" ")}).join(" "),ref:t,size:i,viewBoxSize:g.length}))});Qh.QRCode=Zh;Zh.displayName="QRCode";Zh.propTypes=_Y;var PY=Qh.default=Zh;const RY=ch("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7 space-y-1 [&_strong]:text-foreground",{variants:{variant:{default:"border-zinc-500/20 bg-zinc-50/50 dark:border-zinc-500/30 dark:bg-zinc-500/10 text-zinc-900 dark:text-zinc-300 [&>svg]:text-zinc-400 dark:[&>svg]:text-zinc-300",destructive:"border-red-500/20 bg-red-50/50 dark:border-red-500/30 dark:bg-red-500/10 text-red-900 dark:text-red-200 [&>svg]:text-red-600 dark:[&>svg]:text-red-400/80",warning:"border-amber-500/20 bg-amber-50/50 dark:border-amber-500/30 dark:bg-amber-500/10 text-amber-900 dark:text-amber-200 [&>svg]:text-amber-500",info:"border-sky-500/20 bg-sky-50/50 dark:border-sky-500/30 dark:bg-sky-500/10 text-sky-900 dark:text-sky-200 [&>svg]:text-sky-500",success:"border-emerald-500/20 bg-emerald-50/50 dark:border-emerald-500/30 dark:bg-emerald-500/10 text-emerald-900 dark:text-emerald-200 [&>svg]:text-emerald-600 dark:[&>svg]:text-emerald-400/80"}},defaultVariants:{variant:"default"}}),fI=v.forwardRef(({className:e,variant:t,...n},r)=>l.jsx("div",{ref:r,role:"alert",className:me(RY({variant:t}),e),...n}));fI.displayName="Alert";const pI=v.forwardRef(({className:e,...t},n)=>l.jsx("h5",{ref:n,className:me("font-medium leading-none tracking-tight",e),...t}));pI.displayName="AlertTitle";const OY=v.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:me("text-sm [&_p]:leading-relaxed",e),...t}));OY.displayName="AlertDescription";const Tn=({size:e=45,className:t,...n})=>l.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"},children:l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,...n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:me("animate-spin",t),children:l.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})});function IY(){const{t:e,i18n:t}=Te(),n=new Intl.NumberFormat(t.language),[r,s]=v.useState(null),[o,a]=v.useState(""),c=zr(Fn.TOKEN),{theme:u}=Dx(),{connect:i,logout:d,restart:p}=Nh(),{instance:f,reloadInstance:g}=Ve();v.useEffect(()=>{f&&(localStorage.setItem(Fn.INSTANCE_ID,f.id),localStorage.setItem(Fn.INSTANCE_NAME,f.name),localStorage.setItem(Fn.INSTANCE_TOKEN,f.token))},[f]);const h=async()=>{await g()},m=async E=>{try{await p(E),await g()}catch(C){console.error("Error:",C)}},x=async E=>{try{await d(E),await g()}catch(C){console.error("Error:",C)}},b=async(E,C)=>{try{if(s(null),!c){console.error("Token not found.");return}if(C){const T=await i({instanceName:E,token:c,number:f==null?void 0:f.number});a(T.pairingCode)}else{const T=await i({instanceName:E,token:c});s(T.code)}}catch(T){console.error("Error:",T)}},y=async()=>{s(null),a(""),await g()},w=v.useMemo(()=>{var E,C,T;return f?{contacts:((E=f._count)==null?void 0:E.Contact)||0,chats:((C=f._count)==null?void 0:C.Chat)||0,messages:((T=f._count)==null?void 0:T.Message)||0}:{contacts:0,chats:0,messages:0}},[f]),S=v.useMemo(()=>u==="dark"?"#fff":u==="light"?"#000":"#189d68",[u]);return f?l.jsxs("main",{className:"flex flex-col gap-8",children:[l.jsx("section",{children:l.jsxs(oi,{children:[l.jsx(ai,{children:l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[l.jsx("h2",{className:"break-all text-lg font-semibold",children:f.name}),l.jsx(Y_,{status:f.connectionStatus})]})}),l.jsxs(ii,{className:"flex flex-col items-start space-y-6",children:[l.jsx("div",{className:"flex w-full flex-1",children:l.jsx(X_,{token:f.token})}),f.profileName&&l.jsxs("div",{className:"flex flex-1 gap-2",children:[l.jsx(Eh,{children:l.jsx(kh,{src:f.profilePicUrl,alt:""})}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("strong",{children:f.profileName}),l.jsx("p",{className:"break-all text-sm text-muted-foreground",children:f.ownerJid})]})]}),f.connectionStatus!=="open"&&l.jsxs(fI,{variant:"warning",className:"flex flex-wrap items-center justify-between gap-3",children:[l.jsx(pI,{className:"text-lg font-bold tracking-wide",children:e("instance.dashboard.alert")}),l.jsxs(pt,{children:[l.jsx(mt,{onClick:()=>b(f.name,!1),asChild:!0,children:l.jsx(z,{variant:"warning",children:e("instance.dashboard.button.qrcode.label")})}),l.jsxs(ut,{onCloseAutoFocus:y,children:[l.jsx(dt,{children:e("instance.dashboard.button.qrcode.title")}),l.jsx("div",{className:"flex items-center justify-center",children:r&&l.jsx(PY,{value:r,size:256,bgColor:"transparent",fgColor:S,className:"rounded-sm"})})]})]}),f.number&&l.jsxs(pt,{children:[l.jsx(mt,{className:"connect-code-button",onClick:()=>b(f.name,!0),children:e("instance.dashboard.button.pairingCode.label")}),l.jsx(ut,{onCloseAutoFocus:y,children:l.jsx(dt,{children:l.jsx(_o,{children:o?l.jsxs("div",{className:"py-3",children:[l.jsx("p",{className:"text-center",children:l.jsx("strong",{children:e("instance.dashboard.button.pairingCode.title")})}),l.jsxs("p",{className:"pairing-code text-center",children:[o.substring(0,4),"-",o.substring(4,8)]})]}):l.jsx(Tn,{})})})})]})]})]}),l.jsxs(Mh,{className:"flex flex-wrap items-center justify-end gap-3",children:[l.jsx(z,{variant:"outline",className:"refresh-button",size:"icon",onClick:h,children:l.jsx(rg,{size:"20"})}),l.jsx(z,{className:"action-button",variant:"secondary",onClick:()=>m(f.name),children:e("instance.dashboard.button.restart").toUpperCase()}),l.jsx(z,{variant:"destructive",onClick:()=>x(f.name),disabled:f.connectionStatus==="close",children:e("instance.dashboard.button.disconnect").toUpperCase()})]})]})}),l.jsxs("section",{className:"grid grid-cols-[repeat(auto-fit,_minmax(15rem,_1fr))] gap-6",children:[l.jsxs(oi,{className:"instance-card",children:[l.jsx(ai,{children:l.jsxs(Iu,{className:"flex items-center gap-2",children:[l.jsx(vM,{size:"20"}),e("instance.dashboard.contacts")]})}),l.jsx(ii,{children:n.format(w.contacts)})]}),l.jsxs(oi,{className:"instance-card",children:[l.jsx(ai,{children:l.jsxs(Iu,{className:"flex items-center gap-2",children:[l.jsx(i3,{size:"20"}),e("instance.dashboard.chats")]})}),l.jsx(ii,{children:n.format(w.chats)})]}),l.jsxs(oi,{className:"instance-card",children:[l.jsx(ai,{children:l.jsxs(Iu,{className:"flex items-center gap-2",children:[l.jsx(dh,{size:"20"}),e("instance.dashboard.messages")]})}),l.jsx(ii,{children:n.format(w.messages)})]})]})]}):l.jsx(Tn,{})}var DY="Separator",rE="horizontal",AY=["horizontal","vertical"],gI=v.forwardRef((e,t)=>{const{decorative:n,orientation:r=rE,...s}=e,o=FY(r)?r:rE,c=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return l.jsx(Ie.div,{"data-orientation":o,...c,...s,ref:t})});gI.displayName=DY;function FY(e){return AY.includes(e)}var hI=gI;const ht=v.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},s)=>l.jsx(hI,{ref:s,decorative:n,orientation:t,className:me("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));ht.displayName=hI.displayName;const LY=e=>["dify","fetchDify",JSON.stringify(e)],$Y=async({instanceName:e,token:t})=>(await ie.get(`/dify/find/${e}`,{headers:{apikey:t}})).data,mI=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:LY({instanceName:t,token:n}),queryFn:()=>$Y({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},BY=async({instanceName:e,token:t,data:n})=>(await ie.post(`/dify/create/${e}`,n,{headers:{apikey:t}})).data,zY=async({instanceName:e,difyId:t,data:n})=>(await ie.put(`/dify/update/${t}/${e}`,n)).data,UY=async({instanceName:e,difyId:t})=>(await ie.delete(`/dify/delete/${t}/${e}`)).data,VY=async({instanceName:e,token:t,data:n})=>(await ie.post(`/dify/settings/${e}`,n,{headers:{apikey:t}})).data,HY=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await ie.post(`/dify/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function Yh(){const e=Le(VY,{invalidateKeys:[["dify","fetchDefaultSettings"]]}),t=Le(HY,{invalidateKeys:[["dify","getDify"],["dify","fetchSessions"]]}),n=Le(UY,{invalidateKeys:[["dify","getDify"],["dify","fetchDify"],["dify","fetchSessions"]]}),r=Le(zY,{invalidateKeys:[["dify","getDify"],["dify","fetchDify"],["dify","fetchSessions"]]}),s=Le(BY,{invalidateKeys:[["dify","fetchDify"]]});return{setDefaultSettingsDify:e,changeStatusDify:t,deleteDify:n,updateDify:r,createDify:s}}const KY=e=>["dify","fetchDefaultSettings",JSON.stringify(e)],qY=async({instanceName:e,token:t})=>(await ie.get(`/dify/fetchSettings/${e}`,{headers:{apikey:t}})).data,WY=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:KY({instanceName:t,token:n}),queryFn:()=>qY({instanceName:t,token:n}),enabled:!!t})},GY=k.object({expire:k.string(),keywordFinish:k.string(),delayMessage:k.string(),unknownMessage:k.string(),listeningFromMe:k.boolean(),stopBotFromMe:k.boolean(),keepOpen:k.boolean(),debounceTime:k.string(),ignoreJids:k.array(k.string()).default([]),difyIdFallback:k.union([k.null(),k.string()]).optional(),splitMessages:k.boolean(),timePerChar:k.string()});function JY(){const{t:e}=Te(),{instance:t}=Ve(),{setDefaultSettingsDify:n}=Yh(),[r,s]=v.useState(!1),{data:o,refetch:a}=mI({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token,enabled:r}),{data:c,refetch:u}=WY({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token}),i=zt({resolver:Ut(GY),defaultValues:{expire:"0",keywordFinish:e("dify.form.examples.keywordFinish"),delayMessage:"1000",unknownMessage:e("dify.form.examples.unknownMessage"),listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:"0",ignoreJids:[],difyIdFallback:void 0,splitMessages:!1,timePerChar:"0"}});v.useEffect(()=>{c&&i.reset({expire:c!=null&&c.expire?c.expire.toString():"0",keywordFinish:c.keywordFinish,delayMessage:c.delayMessage?c.delayMessage.toString():"0",unknownMessage:c.unknownMessage,listeningFromMe:c.listeningFromMe,stopBotFromMe:c.stopBotFromMe,keepOpen:c.keepOpen,debounceTime:c.debounceTime?c.debounceTime.toString():"0",ignoreJids:c.ignoreJids,difyIdFallback:c.difyIdFallback,splitMessages:c.splitMessages,timePerChar:c.timePerChar?c.timePerChar.toString():"0"})},[c]);const d=async f=>{var g,h,m;try{if(!t||!t.name)throw new Error("instance not found.");const x={expire:parseInt(f.expire),keywordFinish:f.keywordFinish,delayMessage:parseInt(f.delayMessage),unknownMessage:f.unknownMessage,listeningFromMe:f.listeningFromMe,stopBotFromMe:f.stopBotFromMe,keepOpen:f.keepOpen,debounceTime:parseInt(f.debounceTime),difyIdFallback:f.difyIdFallback||void 0,ignoreJids:f.ignoreJids,splitMessages:f.splitMessages,timePerChar:parseInt(f.timePerChar)};await n({instanceName:t.name,token:t.token,data:x}),G.success(e("dify.toast.defaultSettings.success"))}catch(x){console.error("Error:",x),G.error(`Error: ${(m=(h=(g=x==null?void 0:x.response)==null?void 0:g.data)==null?void 0:h.response)==null?void 0:m.message}`)}};function p(){u(),a()}return l.jsxs(pt,{open:r,onOpenChange:s,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{variant:"secondary",size:"sm",children:[l.jsx(To,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:e("dify.defaultSettings")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:p,children:[l.jsx(dt,{children:l.jsx(yt,{children:e("dify.defaultSettings")})}),l.jsx(Mn,{...i,children:l.jsxs("form",{className:"w-full space-y-6",onSubmit:i.handleSubmit(d),children:[l.jsx("div",{children:l.jsxs("div",{className:"space-y-4",children:[l.jsx(jt,{name:"difyIdFallback",label:e("dify.form.difyIdFallback.label"),options:(o==null?void 0:o.filter(f=>!!f.id).map(f=>({label:f.description,value:f.id})))??[]}),l.jsx($,{name:"expire",label:e("dify.form.expire.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"keywordFinish",label:e("dify.form.keywordFinish.label"),children:l.jsx(F,{})}),l.jsx($,{name:"delayMessage",label:e("dify.form.delayMessage.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"unknownMessage",label:e("dify.form.unknownMessage.label"),children:l.jsx(F,{})}),l.jsx(ge,{name:"listeningFromMe",label:e("dify.form.listeningFromMe.label"),reverse:!0}),l.jsx(ge,{name:"stopBotFromMe",label:e("dify.form.stopBotFromMe.label"),reverse:!0}),l.jsx(ge,{name:"keepOpen",label:e("dify.form.keepOpen.label"),reverse:!0}),l.jsx($,{name:"debounceTime",label:e("dify.form.debounceTime.label"),children:l.jsx(F,{type:"number"})}),l.jsx(ge,{name:"splitMessages",label:e("dify.form.splitMessages.label"),reverse:!0}),l.jsx($,{name:"timePerChar",label:e("dify.form.timePerChar.label"),children:l.jsx(F,{type:"number"})}),l.jsx(Ba,{name:"ignoreJids",label:e("dify.form.ignoreJids.label"),placeholder:e("dify.form.ignoreJids.placeholder")})]})}),l.jsx(_t,{children:l.jsx(z,{type:"submit",children:e("dify.button.save")})})]})})]})]})}/** - * table-core - * - * Copyright (c) TanStack - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function ia(e,t){return typeof e=="function"?e(t):e}function kr(e,t){return n=>{t.setState(r=>({...r,[e]:ia(n,r[e])}))}}function Xh(e){return e instanceof Function}function QY(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function vI(e,t){const n=[],r=s=>{s.forEach(o=>{n.push(o);const a=t(o);a!=null&&a.length&&r(a)})};return r(e),n}function Ae(e,t,n){let r=[],s;return o=>{let a;n.key&&n.debug&&(a=Date.now());const c=e(o);if(!(c.length!==r.length||c.some((d,p)=>r[p]!==d)))return s;r=c;let i;if(n.key&&n.debug&&(i=Date.now()),s=t(...c),n==null||n.onChange==null||n.onChange(s),n.key&&n.debug&&n!=null&&n.debug()){const d=Math.round((Date.now()-a)*100)/100,p=Math.round((Date.now()-i)*100)/100,f=p/16,g=(h,m)=>{for(h=String(h);h.length{var s;return(s=e==null?void 0:e.debugAll)!=null?s:e[t]},key:!1,onChange:r}}function ZY(e,t,n,r){const s=()=>{var a;return(a=o.getValue())!=null?a:e.options.renderFallbackValue},o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:s,getContext:Ae(()=>[e,n,t,o],(a,c,u,i)=>({table:a,column:c,row:u,cell:i,getValue:i.getValue,renderValue:i.renderValue}),Fe(e.options,"debugCells"))};return e._features.forEach(a=>{a.createCell==null||a.createCell(o,n,t,e)},{}),o}function YY(e,t,n,r){var s,o;const c={...e._getDefaultColumnDef(),...t},u=c.accessorKey;let i=(s=(o=c.id)!=null?o:u?typeof String.prototype.replaceAll=="function"?u.replaceAll(".","_"):u.replace(/\./g,"_"):void 0)!=null?s:typeof c.header=="string"?c.header:void 0,d;if(c.accessorFn?d=c.accessorFn:u&&(u.includes(".")?d=f=>{let g=f;for(const m of u.split(".")){var h;g=(h=g)==null?void 0:h[m]}return g}:d=f=>f[c.accessorKey]),!i)throw new Error;let p={id:`${String(i)}`,accessorFn:d,parent:r,depth:n,columnDef:c,columns:[],getFlatColumns:Ae(()=>[!0],()=>{var f;return[p,...(f=p.columns)==null?void 0:f.flatMap(g=>g.getFlatColumns())]},Fe(e.options,"debugColumns")),getLeafColumns:Ae(()=>[e._getOrderColumnsFn()],f=>{var g;if((g=p.columns)!=null&&g.length){let h=p.columns.flatMap(m=>m.getLeafColumns());return f(h)}return[p]},Fe(e.options,"debugColumns"))};for(const f of e._features)f.createColumn==null||f.createColumn(p,e);return p}const In="debugHeaders";function sE(e,t,n){var r;let o={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const a=[],c=u=>{u.subHeaders&&u.subHeaders.length&&u.subHeaders.map(c),a.push(u)};return c(o),a},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(a=>{a.createHeader==null||a.createHeader(o,e)}),o}const XY={createTable:e=>{e.getHeaderGroups=Ae(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,s)=>{var o,a;const c=(o=r==null?void 0:r.map(p=>n.find(f=>f.id===p)).filter(Boolean))!=null?o:[],u=(a=s==null?void 0:s.map(p=>n.find(f=>f.id===p)).filter(Boolean))!=null?a:[],i=n.filter(p=>!(r!=null&&r.includes(p.id))&&!(s!=null&&s.includes(p.id)));return Gf(t,[...c,...i,...u],e)},Fe(e.options,In)),e.getCenterHeaderGroups=Ae(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,s)=>(n=n.filter(o=>!(r!=null&&r.includes(o.id))&&!(s!=null&&s.includes(o.id))),Gf(t,n,e,"center")),Fe(e.options,In)),e.getLeftHeaderGroups=Ae(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var s;const o=(s=r==null?void 0:r.map(a=>n.find(c=>c.id===a)).filter(Boolean))!=null?s:[];return Gf(t,o,e,"left")},Fe(e.options,In)),e.getRightHeaderGroups=Ae(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var s;const o=(s=r==null?void 0:r.map(a=>n.find(c=>c.id===a)).filter(Boolean))!=null?s:[];return Gf(t,o,e,"right")},Fe(e.options,In)),e.getFooterGroups=Ae(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Fe(e.options,In)),e.getLeftFooterGroups=Ae(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Fe(e.options,In)),e.getCenterFooterGroups=Ae(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Fe(e.options,In)),e.getRightFooterGroups=Ae(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Fe(e.options,In)),e.getFlatHeaders=Ae(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Fe(e.options,In)),e.getLeftFlatHeaders=Ae(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Fe(e.options,In)),e.getCenterFlatHeaders=Ae(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Fe(e.options,In)),e.getRightFlatHeaders=Ae(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Fe(e.options,In)),e.getCenterLeafHeaders=Ae(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Fe(e.options,In)),e.getLeftLeafHeaders=Ae(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Fe(e.options,In)),e.getRightLeafHeaders=Ae(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Fe(e.options,In)),e.getLeafHeaders=Ae(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var s,o,a,c,u,i;return[...(s=(o=t[0])==null?void 0:o.headers)!=null?s:[],...(a=(c=n[0])==null?void 0:c.headers)!=null?a:[],...(u=(i=r[0])==null?void 0:i.headers)!=null?u:[]].map(d=>d.getLeafHeaders()).flat()},Fe(e.options,In))}};function Gf(e,t,n,r){var s,o;let a=0;const c=function(f,g){g===void 0&&(g=1),a=Math.max(a,g),f.filter(h=>h.getIsVisible()).forEach(h=>{var m;(m=h.columns)!=null&&m.length&&c(h.columns,g+1)},0)};c(e);let u=[];const i=(f,g)=>{const h={depth:g,id:[r,`${g}`].filter(Boolean).join("_"),headers:[]},m=[];f.forEach(x=>{const b=[...m].reverse()[0],y=x.column.depth===h.depth;let w,S=!1;if(y&&x.column.parent?w=x.column.parent:(w=x.column,S=!0),b&&(b==null?void 0:b.column)===w)b.subHeaders.push(x);else{const E=sE(n,w,{id:[r,g,w.id,x==null?void 0:x.id].filter(Boolean).join("_"),isPlaceholder:S,placeholderId:S?`${m.filter(C=>C.column===w).length}`:void 0,depth:g,index:m.length});E.subHeaders.push(x),m.push(E)}h.headers.push(x),x.headerGroup=h}),u.push(h),g>0&&i(m,g-1)},d=t.map((f,g)=>sE(n,f,{depth:a,index:g}));i(d,a-1),u.reverse();const p=f=>f.filter(h=>h.column.getIsVisible()).map(h=>{let m=0,x=0,b=[0];h.subHeaders&&h.subHeaders.length?(b=[],p(h.subHeaders).forEach(w=>{let{colSpan:S,rowSpan:E}=w;m+=S,b.push(E)})):m=1;const y=Math.min(...b);return x=x+y,h.colSpan=m,h.rowSpan=x,{colSpan:m,rowSpan:x}});return p((s=(o=u[0])==null?void 0:o.headers)!=null?s:[]),u}const em=(e,t,n,r,s,o,a)=>{let c={id:t,index:r,original:n,depth:s,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:u=>{if(c._valuesCache.hasOwnProperty(u))return c._valuesCache[u];const i=e.getColumn(u);if(i!=null&&i.accessorFn)return c._valuesCache[u]=i.accessorFn(c.original,r),c._valuesCache[u]},getUniqueValues:u=>{if(c._uniqueValuesCache.hasOwnProperty(u))return c._uniqueValuesCache[u];const i=e.getColumn(u);if(i!=null&&i.accessorFn)return i.columnDef.getUniqueValues?(c._uniqueValuesCache[u]=i.columnDef.getUniqueValues(c.original,r),c._uniqueValuesCache[u]):(c._uniqueValuesCache[u]=[c.getValue(u)],c._uniqueValuesCache[u])},renderValue:u=>{var i;return(i=c.getValue(u))!=null?i:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>vI(c.subRows,u=>u.subRows),getParentRow:()=>c.parentId?e.getRow(c.parentId,!0):void 0,getParentRows:()=>{let u=[],i=c;for(;;){const d=i.getParentRow();if(!d)break;u.push(d),i=d}return u.reverse()},getAllCells:Ae(()=>[e.getAllLeafColumns()],u=>u.map(i=>ZY(e,c,i,i.id)),Fe(e.options,"debugRows")),_getAllCellsByColumnId:Ae(()=>[c.getAllCells()],u=>u.reduce((i,d)=>(i[d.column.id]=d,i),{}),Fe(e.options,"debugRows"))};for(let u=0;u{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},yI=(e,t,n)=>{var r;const s=n.toLowerCase();return!!(!((r=e.getValue(t))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(s))};yI.autoRemove=e=>us(e);const bI=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};bI.autoRemove=e=>us(e);const xI=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};xI.autoRemove=e=>us(e);const wI=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};wI.autoRemove=e=>us(e)||!(e!=null&&e.length);const SI=(e,t,n)=>!n.some(r=>{var s;return!((s=e.getValue(t))!=null&&s.includes(r))});SI.autoRemove=e=>us(e)||!(e!=null&&e.length);const CI=(e,t,n)=>n.some(r=>{var s;return(s=e.getValue(t))==null?void 0:s.includes(r)});CI.autoRemove=e=>us(e)||!(e!=null&&e.length);const EI=(e,t,n)=>e.getValue(t)===n;EI.autoRemove=e=>us(e);const kI=(e,t,n)=>e.getValue(t)==n;kI.autoRemove=e=>us(e);const Kw=(e,t,n)=>{let[r,s]=n;const o=e.getValue(t);return o>=r&&o<=s};Kw.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,s=typeof n!="number"?parseFloat(n):n,o=t===null||Number.isNaN(r)?-1/0:r,a=n===null||Number.isNaN(s)?1/0:s;if(o>a){const c=o;o=a,a=c}return[o,a]};Kw.autoRemove=e=>us(e)||us(e[0])&&us(e[1]);const so={includesString:yI,includesStringSensitive:bI,equalsString:xI,arrIncludes:wI,arrIncludesAll:SI,arrIncludesSome:CI,equals:EI,weakEquals:kI,inNumberRange:Kw};function us(e){return e==null||e===""}const tX={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:kr("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?so.includesString:typeof r=="number"?so.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?so.equals:Array.isArray(r)?so.arrIncludes:so.weakEquals},e.getFilterFn=()=>{var n,r;return Xh(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:so[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,s;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(s=>s.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const s=e.getFilterFn(),o=r==null?void 0:r.find(d=>d.id===e.id),a=ia(n,o?o.value:void 0);if(oE(s,a,e)){var c;return(c=r==null?void 0:r.filter(d=>d.id!==e.id))!=null?c:[]}const u={id:e.id,value:a};if(o){var i;return(i=r==null?void 0:r.map(d=>d.id===e.id?u:d))!=null?i:[]}return r!=null&&r.length?[...r,u]:[u]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=s=>{var o;return(o=ia(t,s))==null?void 0:o.filter(a=>{const c=n.find(u=>u.id===a.id);if(c){const u=c.getFilterFn();if(oE(u,a.value,c))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function oE(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const nX=(e,t,n)=>n.reduce((r,s)=>{const o=s.getValue(e);return r+(typeof o=="number"?o:0)},0),rX=(e,t,n)=>{let r;return n.forEach(s=>{const o=s.getValue(e);o!=null&&(r>o||r===void 0&&o>=o)&&(r=o)}),r},sX=(e,t,n)=>{let r;return n.forEach(s=>{const o=s.getValue(e);o!=null&&(r=o)&&(r=o)}),r},oX=(e,t,n)=>{let r,s;return n.forEach(o=>{const a=o.getValue(e);a!=null&&(r===void 0?a>=a&&(r=s=a):(r>a&&(r=a),s{let n=0,r=0;if(t.forEach(s=>{let o=s.getValue(e);o!=null&&(o=+o)>=o&&(++n,r+=o)}),n)return r/n},iX=(e,t)=>{if(!t.length)return;const n=t.map(o=>o.getValue(e));if(!QY(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),s=n.sort((o,a)=>o-a);return n.length%2!==0?s[r]:(s[r-1]+s[r])/2},lX=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),cX=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,uX=(e,t)=>t.length,xv={sum:nX,min:rX,max:sX,extent:oX,mean:aX,median:iX,unique:lX,uniqueCount:cX,count:uX},dX={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:kr("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return xv.sum;if(Object.prototype.toString.call(r)==="[object Date]")return xv.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Xh(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:xv[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var s;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((s=n.subRows)!=null&&s.length)}}};function fX(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(o=>!t.includes(o.id));return n==="remove"?r:[...t.map(o=>e.find(a=>a.id===o)).filter(Boolean),...r]}const pX={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:kr("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Ae(n=>[$u(t,n)],n=>n.findIndex(r=>r.id===e.id),Fe(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=$u(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const s=$u(t,n);return((r=s[s.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=Ae(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>s=>{let o=[];if(!(t!=null&&t.length))o=s;else{const a=[...t],c=[...s];for(;c.length&&a.length;){const u=a.shift(),i=c.findIndex(d=>d.id===u);i>-1&&o.push(c.splice(i,1)[0])}o=[...o,...c]}return fX(o,n,r)},Fe(e.options,"debugTable"))}},wv=()=>({left:[],right:[]}),gX={getInitialState:e=>({columnPinning:wv(),...e}),getDefaultOptions:e=>({onColumnPinningChange:kr("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(s=>s.id).filter(Boolean);t.setColumnPinning(s=>{var o,a;if(n==="right"){var c,u;return{left:((c=s==null?void 0:s.left)!=null?c:[]).filter(p=>!(r!=null&&r.includes(p))),right:[...((u=s==null?void 0:s.right)!=null?u:[]).filter(p=>!(r!=null&&r.includes(p))),...r]}}if(n==="left"){var i,d;return{left:[...((i=s==null?void 0:s.left)!=null?i:[]).filter(p=>!(r!=null&&r.includes(p))),...r],right:((d=s==null?void 0:s.right)!=null?d:[]).filter(p=>!(r!=null&&r.includes(p)))}}return{left:((o=s==null?void 0:s.left)!=null?o:[]).filter(p=>!(r!=null&&r.includes(p))),right:((a=s==null?void 0:s.right)!=null?a:[]).filter(p=>!(r!=null&&r.includes(p)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var s,o,a;return((s=r.columnDef.enablePinning)!=null?s:!0)&&((o=(a=t.options.enableColumnPinning)!=null?a:t.options.enablePinning)!=null?o:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(c=>c.id),{left:r,right:s}=t.getState().columnPinning,o=n.some(c=>r==null?void 0:r.includes(c)),a=n.some(c=>s==null?void 0:s.includes(c));return o?"left":a?"right":!1},e.getPinnedIndex=()=>{var n,r;const s=e.getIsPinned();return s?(n=(r=t.getState().columnPinning)==null||(r=r[s])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=Ae(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,s)=>{const o=[...r??[],...s??[]];return n.filter(a=>!o.includes(a.column.id))},Fe(t.options,"debugRows")),e.getLeftVisibleCells=Ae(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(o=>n.find(a=>a.column.id===o)).filter(Boolean).map(o=>({...o,position:"left"})),Fe(t.options,"debugRows")),e.getRightVisibleCells=Ae(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(o=>n.find(a=>a.column.id===o)).filter(Boolean).map(o=>({...o,position:"right"})),Fe(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?wv():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:wv())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var s,o;return!!((s=r.left)!=null&&s.length||(o=r.right)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=Ae(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),Fe(e.options,"debugColumns")),e.getRightLeafColumns=Ae(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),Fe(e.options,"debugColumns")),e.getCenterLeafColumns=Ae(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const s=[...n??[],...r??[]];return t.filter(o=>!s.includes(o.id))},Fe(e.options,"debugColumns"))}},Jf={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Sv=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),hX={getDefaultColumnDef:()=>Jf,getInitialState:e=>({columnSizing:{},columnSizingInfo:Sv(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:kr("columnSizing",e),onColumnSizingInfoChange:kr("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,s;const o=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Jf.minSize,(r=o??e.columnDef.size)!=null?r:Jf.size),(s=e.columnDef.maxSize)!=null?s:Jf.maxSize)},e.getStart=Ae(n=>[n,$u(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((s,o)=>s+o.getSize(),0),Fe(t.options,"debugColumns")),e.getAfter=Ae(n=>[n,$u(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((s,o)=>s+o.getSize(),0),Fe(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...s}=n;return s})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=s=>{if(s.subHeaders.length)s.subHeaders.forEach(r);else{var o;n+=(o=s.column.getSize())!=null?o:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),s=r==null?void 0:r.getCanResize();return o=>{if(!r||!s||(o.persist==null||o.persist(),Cv(o)&&o.touches&&o.touches.length>1))return;const a=e.getSize(),c=e?e.getLeafHeaders().map(b=>[b.column.id,b.column.getSize()]):[[r.id,r.getSize()]],u=Cv(o)?Math.round(o.touches[0].clientX):o.clientX,i={},d=(b,y)=>{typeof y=="number"&&(t.setColumnSizingInfo(w=>{var S,E;const C=t.options.columnResizeDirection==="rtl"?-1:1,T=(y-((S=w==null?void 0:w.startOffset)!=null?S:0))*C,j=Math.max(T/((E=w==null?void 0:w.startSize)!=null?E:0),-.999999);return w.columnSizingStart.forEach(_=>{let[O,K]=_;i[O]=Math.round(Math.max(K+K*j,0)*100)/100}),{...w,deltaOffset:T,deltaPercentage:j}}),(t.options.columnResizeMode==="onChange"||b==="end")&&t.setColumnSizing(w=>({...w,...i})))},p=b=>d("move",b),f=b=>{d("end",b),t.setColumnSizingInfo(y=>({...y,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},g=n||typeof document<"u"?document:null,h={moveHandler:b=>p(b.clientX),upHandler:b=>{g==null||g.removeEventListener("mousemove",h.moveHandler),g==null||g.removeEventListener("mouseup",h.upHandler),f(b.clientX)}},m={moveHandler:b=>(b.cancelable&&(b.preventDefault(),b.stopPropagation()),p(b.touches[0].clientX),!1),upHandler:b=>{var y;g==null||g.removeEventListener("touchmove",m.moveHandler),g==null||g.removeEventListener("touchend",m.upHandler),b.cancelable&&(b.preventDefault(),b.stopPropagation()),f((y=b.touches[0])==null?void 0:y.clientX)}},x=mX()?{passive:!1}:!1;Cv(o)?(g==null||g.addEventListener("touchmove",m.moveHandler,x),g==null||g.addEventListener("touchend",m.upHandler,x)):(g==null||g.addEventListener("mousemove",h.moveHandler,x),g==null||g.addEventListener("mouseup",h.upHandler,x)),t.setColumnSizingInfo(b=>({...b,startOffset:u,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:c,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?Sv():(n=e.initialState.columnSizingInfo)!=null?n:Sv())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0}}};let Qf=null;function mX(){if(typeof Qf=="boolean")return Qf;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Qf=e,Qf}function Cv(e){return e.type==="touchstart"}const vX={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:kr("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const s=e.columns;return(n=s.length?s.some(o=>o.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=Ae(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Fe(t.options,"debugRows")),e.getVisibleCells=Ae(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,s)=>[...n,...r,...s],Fe(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>Ae(()=>[r(),r().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(o=>o.getIsVisible==null?void 0:o.getIsVisible()),Fe(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((s,o)=>({...s,[o.id]:n||!(o.getCanHide!=null&&o.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function $u(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const yX={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},bX={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:kr("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,s,o;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&((o=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?o:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>so.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Xh(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:so[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},xX={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:kr("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,s;if(!t){e._queue(()=>{t=!0});return}if((r=(s=e.options.autoResetAll)!=null?s:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var s,o;e.setExpanded(r?{}:(s=(o=e.initialState)==null?void 0:o.expanded)!=null?s:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(s=>!s.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(o=>{const a=o.split(".");r=Math.max(r,a.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var s;const o=r===!0?!0:!!(r!=null&&r[e.id]);let a={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(c=>{a[c]=!0}):a=r,n=(s=n)!=null?s:!o,!o&&n)return{...a,[e.id]:!0};if(o&&!n){const{[e.id]:c,...u}=a;return u}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,s;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((s=e.subRows)!=null&&s.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},jb=0,Tb=10,Ev=()=>({pageIndex:jb,pageSize:Tb}),wX={getInitialState:e=>({...e,pagination:{...Ev(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:kr("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,s;if(!t){e._queue(()=>{t=!0});return}if((r=(s=e.options.autoResetAll)!=null?s:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const s=o=>ia(r,o);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(s)},e.resetPagination=r=>{var s;e.setPagination(r?Ev():(s=e.initialState.pagination)!=null?s:Ev())},e.setPageIndex=r=>{e.setPagination(s=>{let o=ia(r,s.pageIndex);const a=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,a)),{...s,pageIndex:o}})},e.resetPageIndex=r=>{var s,o;e.setPageIndex(r?jb:(s=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageIndex)!=null?s:jb)},e.resetPageSize=r=>{var s,o;e.setPageSize(r?Tb:(s=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageSize)!=null?s:Tb)},e.setPageSize=r=>{e.setPagination(s=>{const o=Math.max(1,ia(r,s.pageSize)),a=s.pageSize*s.pageIndex,c=Math.floor(a/o);return{...s,pageIndex:c,pageSize:o}})},e.setPageCount=r=>e.setPagination(s=>{var o;let a=ia(r,(o=e.options.pageCount)!=null?o:-1);return typeof a=="number"&&(a=Math.max(-1,a)),{...s,pageCount:a}}),e.getPageOptions=Ae(()=>[e.getPageCount()],r=>{let s=[];return r&&r>0&&(s=[...new Array(r)].fill(null).map((o,a)=>a)),s},Fe(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,s=e.getPageCount();return s===-1?!0:s===0?!1:re.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},kv=()=>({top:[],bottom:[]}),SX={getInitialState:e=>({rowPinning:kv(),...e}),getDefaultOptions:e=>({onRowPinningChange:kr("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,s)=>{const o=r?e.getLeafRows().map(u=>{let{id:i}=u;return i}):[],a=s?e.getParentRows().map(u=>{let{id:i}=u;return i}):[],c=new Set([...a,e.id,...o]);t.setRowPinning(u=>{var i,d;if(n==="bottom"){var p,f;return{top:((p=u==null?void 0:u.top)!=null?p:[]).filter(m=>!(c!=null&&c.has(m))),bottom:[...((f=u==null?void 0:u.bottom)!=null?f:[]).filter(m=>!(c!=null&&c.has(m))),...Array.from(c)]}}if(n==="top"){var g,h;return{top:[...((g=u==null?void 0:u.top)!=null?g:[]).filter(m=>!(c!=null&&c.has(m))),...Array.from(c)],bottom:((h=u==null?void 0:u.bottom)!=null?h:[]).filter(m=>!(c!=null&&c.has(m)))}}return{top:((i=u==null?void 0:u.top)!=null?i:[]).filter(m=>!(c!=null&&c.has(m))),bottom:((d=u==null?void 0:u.bottom)!=null?d:[]).filter(m=>!(c!=null&&c.has(m)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:s}=t.options;return typeof r=="function"?r(e):(n=r??s)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:s}=t.getState().rowPinning,o=n.some(c=>r==null?void 0:r.includes(c)),a=n.some(c=>s==null?void 0:s.includes(c));return o?"top":a?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const s=e.getIsPinned();if(!s)return-1;const o=(n=s==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(a=>{let{id:c}=a;return c});return(r=o==null?void 0:o.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?kv():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:kv())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var s,o;return!!((s=r.top)!=null&&s.length||(o=r.bottom)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var s;return((s=e.options.keepPinnedRows)==null||s?(n??[]).map(a=>{const c=e.getRow(a,!0);return c.getIsAllParentsExpanded()?c:null}):(n??[]).map(a=>t.find(c=>c.id===a))).filter(Boolean).map(a=>({...a,position:r}))},e.getTopRows=Ae(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),Fe(e.options,"debugRows")),e.getBottomRows=Ae(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Fe(e.options,"debugRows")),e.getCenterRows=Ae(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const s=new Set([...n??[],...r??[]]);return t.filter(o=>!s.has(o.id))},Fe(e.options,"debugRows"))}},CX={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:kr("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},s=e.getPreGroupedRowModel().flatRows;return t?s.forEach(o=>{o.getCanSelect()&&(r[o.id]=!0)}):s.forEach(o=>{delete r[o.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),s={...n};return e.getRowModel().rows.forEach(o=>{Mb(s,o.id,r,!0,e)}),s}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Ae(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?jv(e,n):{rows:[],flatRows:[],rowsById:{}},Fe(e.options,"debugTable")),e.getFilteredSelectedRowModel=Ae(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?jv(e,n):{rows:[],flatRows:[],rowsById:{}},Fe(e.options,"debugTable")),e.getGroupedSelectedRowModel=Ae(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?jv(e,n):{rows:[],flatRows:[],rowsById:{}},Fe(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(s=>s.getCanSelect()&&!n[s.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(s=>s.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(s=>!n[s.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const s=e.getIsSelected();t.setRowSelection(o=>{var a;if(n=typeof n<"u"?n:!s,e.getCanSelect()&&s===n)return o;const c={...o};return Mb(c,e.id,n,(a=r==null?void 0:r.selectChildren)!=null?a:!0,t),c})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return qw(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Nb(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Nb(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var s;n&&e.toggleSelected((s=r.target)==null?void 0:s.checked)}}}},Mb=(e,t,n,r,s)=>{var o;const a=s.getRow(t,!0);n?(a.getCanMultiSelect()||Object.keys(e).forEach(c=>delete e[c]),a.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(o=a.subRows)!=null&&o.length&&a.getCanSelectSubRows()&&a.subRows.forEach(c=>Mb(e,c.id,n,r,s))};function jv(e,t){const n=e.getState().rowSelection,r=[],s={},o=function(a,c){return a.map(u=>{var i;const d=qw(u,n);if(d&&(r.push(u),s[u.id]=u),(i=u.subRows)!=null&&i.length&&(u={...u,subRows:o(u.subRows)}),d)return u}).filter(Boolean)};return{rows:o(t.rows),flatRows:r,rowsById:s}}function qw(e,t){var n;return(n=t[e.id])!=null?n:!1}function Nb(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let s=!0,o=!1;return e.subRows.forEach(a=>{if(!(o&&!s)&&(a.getCanSelect()&&(qw(a,t)?o=!0:s=!1),a.subRows&&a.subRows.length)){const c=Nb(a,t);c==="all"?o=!0:(c==="some"&&(o=!0),s=!1)}}),s?"all":o?"some":!1}const _b=/([0-9]+)/gm,EX=(e,t,n)=>jI(Ta(e.getValue(n)).toLowerCase(),Ta(t.getValue(n)).toLowerCase()),kX=(e,t,n)=>jI(Ta(e.getValue(n)),Ta(t.getValue(n))),jX=(e,t,n)=>Ww(Ta(e.getValue(n)).toLowerCase(),Ta(t.getValue(n)).toLowerCase()),TX=(e,t,n)=>Ww(Ta(e.getValue(n)),Ta(t.getValue(n))),MX=(e,t,n)=>{const r=e.getValue(n),s=t.getValue(n);return r>s?1:rWw(e.getValue(n),t.getValue(n));function Ww(e,t){return e===t?0:e>t?1:-1}function Ta(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function jI(e,t){const n=e.split(_b).filter(Boolean),r=t.split(_b).filter(Boolean);for(;n.length&&r.length;){const s=n.shift(),o=r.shift(),a=parseInt(s,10),c=parseInt(o,10),u=[a,c].sort();if(isNaN(u[0])){if(s>o)return 1;if(o>s)return-1;continue}if(isNaN(u[1]))return isNaN(a)?-1:1;if(a>c)return 1;if(c>a)return-1}return n.length-r.length}const cu={alphanumeric:EX,alphanumericCaseSensitive:kX,text:jX,textCaseSensitive:TX,datetime:MX,basic:NX},_X={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:kr("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const s of n){const o=s==null?void 0:s.getValue(e.id);if(Object.prototype.toString.call(o)==="[object Date]")return cu.datetime;if(typeof o=="string"&&(r=!0,o.split(_b).length>1))return cu.alphanumeric}return r?cu.text:cu.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return Xh(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:cu[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const s=e.getNextSortingOrder(),o=typeof n<"u"&&n!==null;t.setSorting(a=>{const c=a==null?void 0:a.find(g=>g.id===e.id),u=a==null?void 0:a.findIndex(g=>g.id===e.id);let i=[],d,p=o?n:s==="desc";if(a!=null&&a.length&&e.getCanMultiSort()&&r?c?d="toggle":d="add":a!=null&&a.length&&u!==a.length-1?d="replace":c?d="toggle":d="replace",d==="toggle"&&(o||s||(d="remove")),d==="add"){var f;i=[...a,{id:e.id,desc:p}],i.splice(0,i.length-((f=t.options.maxMultiSortColCount)!=null?f:Number.MAX_SAFE_INTEGER))}else d==="toggle"?i=a.map(g=>g.id===e.id?{...g,desc:p}:g):d==="remove"?i=a.filter(g=>g.id!==e.id):i=[{id:e.id,desc:p}];return i})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,s;const o=e.getFirstSortDir(),a=e.getIsSorted();return a?a!==o&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(s=t.options.enableMultiRemove)!=null)||s)?!1:a==="desc"?"asc":"desc":o},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(s=>s.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(s=>s.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},PX=[XY,vX,pX,gX,eX,tX,yX,bX,_X,dX,xX,wX,SX,CX,hX];function RX(e){var t,n;const r=[...PX,...(t=e._features)!=null?t:[]];let s={_features:r};const o=s._features.reduce((f,g)=>Object.assign(f,g.getDefaultOptions==null?void 0:g.getDefaultOptions(s)),{}),a=f=>s.options.mergeOptions?s.options.mergeOptions(o,f):{...o,...f};let u={...{},...(n=e.initialState)!=null?n:{}};s._features.forEach(f=>{var g;u=(g=f.getInitialState==null?void 0:f.getInitialState(u))!=null?g:u});const i=[];let d=!1;const p={_features:r,options:{...o,...e},initialState:u,_queue:f=>{i.push(f),d||(d=!0,Promise.resolve().then(()=>{for(;i.length;)i.shift()();d=!1}).catch(g=>setTimeout(()=>{throw g})))},reset:()=>{s.setState(s.initialState)},setOptions:f=>{const g=ia(f,s.options);s.options=a(g)},getState:()=>s.options.state,setState:f=>{s.options.onStateChange==null||s.options.onStateChange(f)},_getRowId:(f,g,h)=>{var m;return(m=s.options.getRowId==null?void 0:s.options.getRowId(f,g,h))!=null?m:`${h?[h.id,g].join("."):g}`},getCoreRowModel:()=>(s._getCoreRowModel||(s._getCoreRowModel=s.options.getCoreRowModel(s)),s._getCoreRowModel()),getRowModel:()=>s.getPaginationRowModel(),getRow:(f,g)=>{let h=(g?s.getPrePaginationRowModel():s.getRowModel()).rowsById[f];if(!h&&(h=s.getCoreRowModel().rowsById[f],!h))throw new Error;return h},_getDefaultColumnDef:Ae(()=>[s.options.defaultColumn],f=>{var g;return f=(g=f)!=null?g:{},{header:h=>{const m=h.header.column.columnDef;return m.accessorKey?m.accessorKey:m.accessorFn?m.id:null},cell:h=>{var m,x;return(m=(x=h.renderValue())==null||x.toString==null?void 0:x.toString())!=null?m:null},...s._features.reduce((h,m)=>Object.assign(h,m.getDefaultColumnDef==null?void 0:m.getDefaultColumnDef()),{}),...f}},Fe(e,"debugColumns")),_getColumnDefs:()=>s.options.columns,getAllColumns:Ae(()=>[s._getColumnDefs()],f=>{const g=function(h,m,x){return x===void 0&&(x=0),h.map(b=>{const y=YY(s,b,x,m),w=b;return y.columns=w.columns?g(w.columns,y,x+1):[],y})};return g(f)},Fe(e,"debugColumns")),getAllFlatColumns:Ae(()=>[s.getAllColumns()],f=>f.flatMap(g=>g.getFlatColumns()),Fe(e,"debugColumns")),_getAllFlatColumnsById:Ae(()=>[s.getAllFlatColumns()],f=>f.reduce((g,h)=>(g[h.id]=h,g),{}),Fe(e,"debugColumns")),getAllLeafColumns:Ae(()=>[s.getAllColumns(),s._getOrderColumnsFn()],(f,g)=>{let h=f.flatMap(m=>m.getLeafColumns());return g(h)},Fe(e,"debugColumns")),getColumn:f=>s._getAllFlatColumnsById()[f]};Object.assign(s,p);for(let f=0;fAe(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(s,o,a){o===void 0&&(o=0);const c=[];for(let i=0;ie._autoResetPageIndex()))}function IX(e,t,n){return n.options.filterFromLeafRows?DX(e,t,n):AX(e,t,n)}function DX(e,t,n){var r;const s=[],o={},a=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,c=function(u,i){i===void 0&&(i=0);const d=[];for(let f=0;fAe(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let f=0;f{var g;const h=e.getColumn(f.id);if(!h)return;const m=h.getFilterFn();m&&s.push({id:f.id,filterFn:m,resolvedValue:(g=m.resolveFilterValue==null?void 0:m.resolveFilterValue(f.value))!=null?g:f.value})});const a=(n??[]).map(f=>f.id),c=e.getGlobalFilterFn(),u=e.getAllLeafColumns().filter(f=>f.getCanGlobalFilter());r&&c&&u.length&&(a.push("__global__"),u.forEach(f=>{var g;o.push({id:f.id,filterFn:c,resolvedValue:(g=c.resolveFilterValue==null?void 0:c.resolveFilterValue(r))!=null?g:r})}));let i,d;for(let f=0;f{g.columnFiltersMeta[m]=x})}if(o.length){for(let h=0;h{g.columnFiltersMeta[m]=x})){g.columnFilters.__global__=!0;break}}g.columnFilters.__global__!==!0&&(g.columnFilters.__global__=!1)}}const p=f=>{for(let g=0;ge._autoResetPageIndex()))}function LX(){return e=>Ae(()=>[e.getState().grouping,e.getPreGroupedRowModel()],(t,n)=>{if(!n.rows.length||!t.length)return n.rows.forEach(u=>{u.depth=0,u.parentId=void 0}),n;const r=t.filter(u=>e.getColumn(u)),s=[],o={},a=function(u,i,d){if(i===void 0&&(i=0),i>=r.length)return u.map(h=>(h.depth=i,s.push(h),o[h.id]=h,h.subRows&&(h.subRows=a(h.subRows,i+1,h.id)),h));const p=r[i],f=$X(u,p);return Array.from(f.entries()).map((h,m)=>{let[x,b]=h,y=`${p}:${x}`;y=d?`${d}>${y}`:y;const w=a(b,i+1,y);w.forEach(C=>{C.parentId=y});const S=i?vI(b,C=>C.subRows):b,E=em(e,y,S[0].original,m,i,void 0,d);return Object.assign(E,{groupingColumnId:p,groupingValue:x,subRows:w,leafRows:S,getValue:C=>{if(r.includes(C)){if(E._valuesCache.hasOwnProperty(C))return E._valuesCache[C];if(b[0]){var T;E._valuesCache[C]=(T=b[0].getValue(C))!=null?T:void 0}return E._valuesCache[C]}if(E._groupingValuesCache.hasOwnProperty(C))return E._groupingValuesCache[C];const j=e.getColumn(C),_=j==null?void 0:j.getAggregationFn();if(_)return E._groupingValuesCache[C]=_(C,S,b),E._groupingValuesCache[C]}}),w.forEach(C=>{s.push(C),o[C.id]=C}),E})},c=a(n.rows,0);return c.forEach(u=>{s.push(u),o[u.id]=u}),{rows:c,flatRows:s,rowsById:o}},Fe(e.options,"debugTable","getGroupedRowModel",()=>{e._queue(()=>{e._autoResetExpanded(),e._autoResetPageIndex()})}))}function $X(e,t){const n=new Map;return e.reduce((r,s)=>{const o=`${s.getGroupingValue(t)}`,a=r.get(o);return a?a.push(s):r.set(o,[s]),r},n)}function BX(){return e=>Ae(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,s=[],o=r.filter(u=>{var i;return(i=e.getColumn(u.id))==null?void 0:i.getCanSort()}),a={};o.forEach(u=>{const i=e.getColumn(u.id);i&&(a[u.id]={sortUndefined:i.columnDef.sortUndefined,invertSorting:i.columnDef.invertSorting,sortingFn:i.getSortingFn()})});const c=u=>{const i=u.map(d=>({...d}));return i.sort((d,p)=>{for(let g=0;g{var p;s.push(d),(p=d.subRows)!=null&&p.length&&(d.subRows=c(d.subRows))}),i};return{rows:c(n.rows),flatRows:s,rowsById:n.rowsById}},Fe(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/** - * react-table - * - * Copyright (c) TanStack - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function aE(e,t){return e?zX(e)?v.createElement(e,t):e:null}function zX(e){return UX(e)||typeof e=="function"||VX(e)}function UX(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function VX(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function HX(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=v.useState(()=>({current:RX(t)})),[r,s]=v.useState(()=>n.current.initialState);return n.current.setOptions(o=>({...o,...e,state:{...r,...e.state},onStateChange:a=>{s(a),e.onStateChange==null||e.onStateChange(a)}})),n.current}const TI=v.forwardRef(({className:e,...t},n)=>l.jsx("div",{className:"relative w-full overflow-auto",children:l.jsx("table",{ref:n,className:me("w-full caption-bottom text-sm",e),...t})}));TI.displayName="Table";const MI=v.forwardRef(({className:e,...t},n)=>l.jsx("thead",{ref:n,className:me("[&_tr]:border-b",e),...t}));MI.displayName="TableHeader";const NI=v.forwardRef(({className:e,...t},n)=>l.jsx("tbody",{ref:n,className:me("[&_tr:last-child]:border-0",e),...t}));NI.displayName="TableBody";const KX=v.forwardRef(({className:e,...t},n)=>l.jsx("tfoot",{ref:n,className:me("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));KX.displayName="TableFooter";const Cu=v.forwardRef(({className:e,...t},n)=>l.jsx("tr",{ref:n,className:me("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Cu.displayName="TableRow";const _I=v.forwardRef(({className:e,...t},n)=>l.jsx("th",{ref:n,className:me("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));_I.displayName="TableHead";const kp=v.forwardRef(({className:e,...t},n)=>l.jsx("td",{ref:n,className:me("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));kp.displayName="TableCell";const qX=v.forwardRef(({className:e,...t},n)=>l.jsx("caption",{ref:n,className:me("mt-4 text-sm text-muted-foreground",e),...t}));qX.displayName="TableCaption";function Ka({columns:e,data:t,isLoading:n,loadingMessage:r,noResultsMessage:s,enableHeaders:o=!0,className:a,highlightedRows:c,...u}){var d;const i=HX({...u,data:t,columns:e,getCoreRowModel:OX(),getFilteredRowModel:FX(),getGroupedRowModel:LX(),getSortedRowModel:BX()});return l.jsx("div",{className:me("rounded-md border",a),children:l.jsxs(TI,{children:[o&&l.jsx(MI,{children:i.getHeaderGroups().map(p=>l.jsx(Cu,{children:p.headers.map(f=>l.jsx(_I,{children:f.isPlaceholder?null:aE(f.column.columnDef.header,f.getContext())},f.id))},p.id))}),l.jsx(NI,{children:n?l.jsx(Cu,{children:l.jsx(kp,{colSpan:e.length,className:"h-24 text-center text-muted-foreground",children:r??"Carregando..."})}):l.jsx(l.Fragment,{children:(d=i.getRowModel().rows)!=null&&d.length?i.getRowModel().rows.map(p=>l.jsx(Cu,{"data-state":p.getIsSelected()?"selected":c!=null&&c.includes(p.id)?"highlighted":"",children:p.getVisibleCells().map(f=>l.jsx(kp,{children:aE(f.column.columnDef.cell,f.getContext())},f.id))},p.id)):l.jsx(Cu,{children:l.jsx(kp,{colSpan:e.length,className:"h-24 text-center",children:s??"Nenhum resultado encontrado!"})})})})]})})}const WX=e=>["dify","fetchSessions",JSON.stringify(e)],GX=async({difyId:e,instanceName:t})=>(await ie.get(`/dify/fetchSessions/${e}/${t}`)).data,JX=e=>{const{difyId:t,instanceName:n,...r}=e;return qe({...r,queryKey:WX({difyId:t,instanceName:n}),queryFn:()=>GX({difyId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0),staleTime:1e3*10})};function PI({difyId:e}){const{t}=Te(),{instance:n}=Ve(),{changeStatusDify:r}=Yh(),[s,o]=v.useState([]),{data:a,refetch:c}=JX({difyId:e,instanceName:n==null?void 0:n.name}),[u,i]=v.useState(!1),[d,p]=v.useState("");function f(){c()}const g=async(m,x)=>{var b,y,w;try{if(!n)return;await r({instanceName:n.name,token:n.token,remoteJid:m,status:x}),G.success(t("dify.toast.success.status")),f()}catch(S){console.error("Error:",S),G.error(`Error : ${(w=(y=(b=S==null?void 0:S.response)==null?void 0:b.data)==null?void 0:y.response)==null?void 0:w.message}`)}},h=[{accessorKey:"remoteJid",header:()=>l.jsx("div",{className:"text-center",children:t("dify.sessions.table.remoteJid")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>l.jsx("div",{className:"text-center",children:t("dify.sessions.table.pushName")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("pushName")})},{accessorKey:"sessionId",header:()=>l.jsx("div",{className:"text-center",children:t("dify.sessions.table.sessionId")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("sessionId")})},{accessorKey:"status",header:()=>l.jsx("div",{className:"text-center",children:t("dify.sessions.table.status")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:m})=>{const x=m.original;return l.jsxs(ms,{children:[l.jsx(vs,{asChild:!0,children:l.jsxs(z,{variant:"ghost",className:"h-8 w-8 p-0",children:[l.jsx("span",{className:"sr-only",children:t("dify.sessions.table.actions.title")}),l.jsx(Ia,{className:"h-4 w-4"})]})}),l.jsxs(Mr,{align:"end",children:[l.jsx(No,{children:t("dify.sessions.table.actions.title")}),l.jsx(Gs,{}),x.status!=="opened"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"opened"),children:[l.jsx(qi,{className:"mr-2 h-4 w-4"}),t("dify.sessions.table.actions.open")]}),x.status!=="paused"&&x.status!=="closed"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"paused"),children:[l.jsx(Ki,{className:"mr-2 h-4 w-4"}),t("dify.sessions.table.actions.pause")]}),x.status!=="closed"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"closed"),children:[l.jsx(Ui,{className:"mr-2 h-4 w-4"}),t("dify.sessions.table.actions.close")]}),l.jsxs(tt,{onClick:()=>g(x.remoteJid,"delete"),children:[l.jsx(Vi,{className:"mr-2 h-4 w-4"}),t("dify.sessions.table.actions.delete")]})]})]})}}];return l.jsxs(pt,{open:u,onOpenChange:i,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{variant:"secondary",size:"sm",children:[l.jsx(Hi,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:t("dify.sessions.label")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-w-[950px]",onCloseAutoFocus:f,children:[l.jsx(dt,{children:l.jsx(yt,{children:t("dify.sessions.label")})}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between gap-6 p-5",children:[l.jsx(F,{placeholder:t("dify.sessions.search"),value:d,onChange:m=>p(m.target.value)}),l.jsx(z,{variant:"outline",onClick:f,size:"icon",children:l.jsx(Wi,{})})]}),l.jsx(Ka,{columns:h,data:a??[],onSortingChange:o,state:{sorting:s,globalFilter:d},onGlobalFilterChange:p,enableGlobalFilter:!0,noResultsMessage:t("dify.sessions.table.none")})]})]})]})}const QX=k.object({enabled:k.boolean(),description:k.string(),botType:k.string(),apiUrl:k.string(),apiKey:k.string(),triggerType:k.string(),triggerOperator:k.string().optional(),triggerValue:k.string().optional(),expire:k.coerce.number().optional(),keywordFinish:k.string().optional(),delayMessage:k.coerce.number().optional(),unknownMessage:k.string().optional(),listeningFromMe:k.boolean().optional(),stopBotFromMe:k.boolean().optional(),keepOpen:k.boolean().optional(),debounceTime:k.coerce.number().optional(),splitMessages:k.boolean().optional(),timePerChar:k.coerce.number().optional()});function RI({initialData:e,onSubmit:t,handleDelete:n,difyId:r,isModal:s=!1,isLoading:o=!1,openDeletionDialog:a=!1,setOpenDeletionDialog:c=()=>{}}){const{t:u}=Te(),i=zt({resolver:Ut(QX),defaultValues:e||{enabled:!0,description:"",botType:"chatBot",apiUrl:"",apiKey:"",triggerType:"keyword",triggerOperator:"contains",triggerValue:"",expire:0,keywordFinish:"",delayMessage:0,unknownMessage:"",listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0,splitMessages:!1,timePerChar:0}}),d=i.watch("triggerType");return l.jsx(Mn,{...i,children:l.jsxs("form",{onSubmit:i.handleSubmit(t),className:"w-full space-y-6",children:[l.jsxs("div",{className:"space-y-4",children:[l.jsx(ge,{name:"enabled",label:u("dify.form.enabled.label"),reverse:!0}),l.jsx($,{name:"description",label:u("dify.form.description.label"),required:!0,children:l.jsx(F,{})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("dify.form.difySettings.label")}),l.jsx(ht,{})]}),l.jsx(jt,{name:"botType",label:u("dify.form.botType.label"),options:[{label:u("dify.form.botType.chatBot"),value:"chatBot"},{label:u("dify.form.botType.textGenerator"),value:"textGenerator"},{label:u("dify.form.botType.agent"),value:"agent"},{label:u("dify.form.botType.workflow"),value:"workflow"}]}),l.jsx($,{name:"apiUrl",label:u("dify.form.apiUrl.label"),required:!0,children:l.jsx(F,{})}),l.jsx($,{name:"apiKey",label:u("dify.form.apiKey.label"),required:!0,children:l.jsx(F,{type:"password"})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("dify.form.triggerSettings.label")}),l.jsx(ht,{})]}),l.jsx(jt,{name:"triggerType",label:u("dify.form.triggerType.label"),options:[{label:u("dify.form.triggerType.keyword"),value:"keyword"},{label:u("dify.form.triggerType.all"),value:"all"},{label:u("dify.form.triggerType.advanced"),value:"advanced"},{label:u("dify.form.triggerType.none"),value:"none"}]}),d==="keyword"&&l.jsxs(l.Fragment,{children:[l.jsx(jt,{name:"triggerOperator",label:u("dify.form.triggerOperator.label"),options:[{label:u("dify.form.triggerOperator.contains"),value:"contains"},{label:u("dify.form.triggerOperator.equals"),value:"equals"},{label:u("dify.form.triggerOperator.startsWith"),value:"startsWith"},{label:u("dify.form.triggerOperator.endsWith"),value:"endsWith"},{label:u("dify.form.triggerOperator.regex"),value:"regex"}]}),l.jsx($,{name:"triggerValue",label:u("dify.form.triggerValue.label"),children:l.jsx(F,{})})]}),d==="advanced"&&l.jsx($,{name:"triggerValue",label:u("dify.form.triggerConditions.label"),children:l.jsx(F,{})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("dify.form.generalSettings.label")}),l.jsx(ht,{})]}),l.jsx($,{name:"expire",label:u("dify.form.expire.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"keywordFinish",label:u("dify.form.keywordFinish.label"),children:l.jsx(F,{})}),l.jsx($,{name:"delayMessage",label:u("dify.form.delayMessage.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"unknownMessage",label:u("dify.form.unknownMessage.label"),children:l.jsx(F,{})}),l.jsx(ge,{name:"listeningFromMe",label:u("dify.form.listeningFromMe.label"),reverse:!0}),l.jsx(ge,{name:"stopBotFromMe",label:u("dify.form.stopBotFromMe.label"),reverse:!0}),l.jsx(ge,{name:"keepOpen",label:u("dify.form.keepOpen.label"),reverse:!0}),l.jsx($,{name:"debounceTime",label:u("dify.form.debounceTime.label"),children:l.jsx(F,{type:"number"})}),l.jsx(ge,{name:"splitMessages",label:u("dify.form.splitMessages.label"),reverse:!0}),i.watch("splitMessages")&&l.jsx($,{name:"timePerChar",label:u("dify.form.timePerChar.label"),children:l.jsx(F,{type:"number"})})]}),s&&l.jsx(_t,{children:l.jsx(z,{disabled:o,type:"submit",children:u(o?"dify.button.saving":"dify.button.save")})}),!s&&l.jsxs("div",{children:[l.jsx(PI,{difyId:r}),l.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[l.jsxs(pt,{open:a,onOpenChange:c,children:[l.jsx(mt,{asChild:!0,children:l.jsx(z,{variant:"destructive",size:"sm",children:u("dify.button.delete")})}),l.jsx(ut,{children:l.jsxs(dt,{children:[l.jsx(yt,{children:u("modal.delete.title")}),l.jsx(_o,{children:u("modal.delete.messageSingle")}),l.jsxs(_t,{children:[l.jsx(z,{size:"sm",variant:"outline",onClick:()=>c(!1),children:u("button.cancel")}),l.jsx(z,{variant:"destructive",onClick:n,children:u("button.delete")})]})]})})]}),l.jsx(z,{disabled:o,type:"submit",children:u(o?"dify.button.saving":"dify.button.update")})]})]})]})})}function ZX({resetTable:e}){const{t}=Te(),{instance:n}=Ve(),[r,s]=v.useState(!1),[o,a]=v.useState(!1),{createDify:c}=Yh(),u=async i=>{var d,p,f;try{if(!n||!n.name)throw new Error("instance not found");s(!0);const g={enabled:i.enabled,description:i.description,botType:i.botType,apiUrl:i.apiUrl,apiKey:i.apiKey,triggerType:i.triggerType,triggerOperator:i.triggerOperator||"",triggerValue:i.triggerValue||"",expire:i.expire||0,keywordFinish:i.keywordFinish||"",delayMessage:i.delayMessage||0,unknownMessage:i.unknownMessage||"",listeningFromMe:i.listeningFromMe||!1,stopBotFromMe:i.stopBotFromMe||!1,keepOpen:i.keepOpen||!1,debounceTime:i.debounceTime||0,splitMessages:i.splitMessages||!1,timePerChar:i.timePerChar||0};await c({instanceName:n.name,token:n.token,data:g}),G.success(t("dify.toast.success.create")),a(!1),e()}catch(g){console.error("Error:",g),G.error(`Error: ${(f=(p=(d=g==null?void 0:g.response)==null?void 0:d.data)==null?void 0:p.response)==null?void 0:f.message}`)}finally{s(!1)}};return l.jsxs(pt,{open:o,onOpenChange:a,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{size:"sm",children:[l.jsx(Ws,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:t("dify.button.create")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[l.jsx(dt,{children:l.jsx(yt,{children:t("dify.form.title")})}),l.jsx(RI,{onSubmit:u,isModal:!0,isLoading:r})]})]})}const YX=e=>["dify","getDify",JSON.stringify(e)],XX=async({difyId:e,instanceName:t})=>(await ie.get(`/dify/fetch/${e}/${t}`)).data,eee=e=>{const{difyId:t,instanceName:n,...r}=e;return qe({...r,queryKey:YX({difyId:t,instanceName:n}),queryFn:()=>XX({difyId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0)})};function tee({difyId:e,resetTable:t}){const{t:n}=Te(),{instance:r}=Ve(),s=an(),[o,a]=v.useState(!1),{deleteDify:c,updateDify:u}=Yh(),{data:i,isLoading:d}=eee({difyId:e,instanceName:r==null?void 0:r.name}),p=v.useMemo(()=>({enabled:!!(i!=null&&i.enabled),description:(i==null?void 0:i.description)??"",botType:(i==null?void 0:i.botType)??"",apiUrl:(i==null?void 0:i.apiUrl)??"",apiKey:(i==null?void 0:i.apiKey)??"",triggerType:(i==null?void 0:i.triggerType)??"",triggerOperator:(i==null?void 0:i.triggerOperator)??"",triggerValue:(i==null?void 0:i.triggerValue)??"",expire:(i==null?void 0:i.expire)??0,keywordFinish:(i==null?void 0:i.keywordFinish)??"",delayMessage:(i==null?void 0:i.delayMessage)??0,unknownMessage:(i==null?void 0:i.unknownMessage)??"",listeningFromMe:!!(i!=null&&i.listeningFromMe),stopBotFromMe:!!(i!=null&&i.stopBotFromMe),keepOpen:!!(i!=null&&i.keepOpen),debounceTime:(i==null?void 0:i.debounceTime)??0,splitMessages:(i==null?void 0:i.splitMessages)??!1,timePerChar:(i==null?void 0:i.timePerChar)??0}),[i==null?void 0:i.apiKey,i==null?void 0:i.apiUrl,i==null?void 0:i.botType,i==null?void 0:i.debounceTime,i==null?void 0:i.delayMessage,i==null?void 0:i.description,i==null?void 0:i.enabled,i==null?void 0:i.expire,i==null?void 0:i.keepOpen,i==null?void 0:i.keywordFinish,i==null?void 0:i.listeningFromMe,i==null?void 0:i.stopBotFromMe,i==null?void 0:i.triggerOperator,i==null?void 0:i.triggerType,i==null?void 0:i.triggerValue,i==null?void 0:i.unknownMessage,i==null?void 0:i.splitMessages,i==null?void 0:i.timePerChar]),f=async h=>{var m,x,b;try{if(r&&r.name&&e){const y={enabled:h.enabled,description:h.description,botType:h.botType,apiUrl:h.apiUrl,apiKey:h.apiKey,triggerType:h.triggerType,triggerOperator:h.triggerOperator||"",triggerValue:h.triggerValue||"",expire:h.expire||0,keywordFinish:h.keywordFinish||"",delayMessage:h.delayMessage||1e3,unknownMessage:h.unknownMessage||"",listeningFromMe:h.listeningFromMe||!1,stopBotFromMe:h.stopBotFromMe||!1,keepOpen:h.keepOpen||!1,debounceTime:h.debounceTime||0,splitMessages:h.splitMessages||!1,timePerChar:h.timePerChar||0};await u({instanceName:r.name,difyId:e,data:y}),G.success(n("dify.toast.success.update")),t(),s(`/manager/instance/${r.id}/dify/${e}`)}else console.error("Token not found")}catch(y){console.error("Error:",y),G.error(`Error: ${(b=(x=(m=y==null?void 0:y.response)==null?void 0:m.data)==null?void 0:x.response)==null?void 0:b.message}`)}},g=async()=>{try{r&&r.name&&e?(await c({instanceName:r.name,difyId:e}),G.success(n("dify.toast.success.delete")),a(!1),t(),s(`/manager/instance/${r.id}/dify`)):console.error("instance not found")}catch(h){console.error("Erro ao excluir dify:",h)}};return d?l.jsx(Tn,{}):l.jsx("div",{className:"m-4",children:l.jsx(RI,{initialData:p,onSubmit:f,difyId:e,handleDelete:g,isModal:!1,isLoading:d,openDeletionDialog:o,setOpenDeletionDialog:a})})}function iE(){const{t:e}=Te(),t=Va("(min-width: 768px)"),{instance:n}=Ve(),{difyId:r}=gs(),{data:s,refetch:o,isLoading:a}=mI({instanceName:n==null?void 0:n.name}),c=an(),u=d=>{n&&c(`/manager/instance/${n.id}/dify/${d}`)},i=()=>{o()};return l.jsxs("main",{className:"pt-5",children:[l.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[l.jsx("h3",{className:"text-lg font-medium",children:e("dify.title")}),l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[l.jsx(PI,{}),l.jsx(JY,{}),l.jsx(ZX,{resetTable:i})]})]}),l.jsx(ht,{className:"my-4"}),l.jsxs(za,{direction:t?"horizontal":"vertical",children:[l.jsx(Bn,{defaultSize:35,className:"pr-4",children:l.jsx("div",{className:"flex flex-col gap-3",children:a?l.jsx(Tn,{}):l.jsx(l.Fragment,{children:s&&s.length>0&&Array.isArray(s)?s.map(d=>l.jsxs(z,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>u(`${d.id}`),variant:r===d.id?"secondary":"outline",children:[l.jsx("h4",{className:"text-base",children:d.description||d.id}),l.jsx("p",{className:"text-sm font-normal text-muted-foreground",children:d.botType})]},d.id)):l.jsx(z,{variant:"link",children:e("dify.table.none")})})})}),r&&l.jsxs(l.Fragment,{children:[l.jsx(Ua,{withHandle:!0,className:"border border-border"}),l.jsx(Bn,{children:l.jsx(tee,{difyId:r,resetTable:i})})]})]})]})}const nee=e=>["evoai","fetchEvoai",JSON.stringify(e)],ree=async({instanceName:e,token:t})=>(await ie.get(`/evoai/find/${e}`,{headers:{apikey:t}})).data,OI=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:nee({instanceName:t,token:n}),queryFn:()=>ree({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},see=async({instanceName:e,token:t,data:n})=>(await ie.post(`/evoai/create/${e}`,n,{headers:{apikey:t}})).data,oee=async({instanceName:e,evoaiId:t,data:n})=>(await ie.put(`/evoai/update/${t}/${e}`,n)).data,aee=async({instanceName:e,evoaiId:t})=>(await ie.delete(`/evoai/delete/${t}/${e}`)).data,iee=async({instanceName:e,token:t,data:n})=>(await ie.post(`/evoai/settings/${e}`,n,{headers:{apikey:t}})).data,lee=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await ie.post(`/evoai/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function tm(){const e=Le(iee,{invalidateKeys:[["evoai","fetchDefaultSettings"]]}),t=Le(lee,{invalidateKeys:[["evoai","getEvoai"],["evoai","fetchSessions"]]}),n=Le(aee,{invalidateKeys:[["evoai","getEvoai"],["evoai","fetchEvoai"],["evoai","fetchSessions"]]}),r=Le(oee,{invalidateKeys:[["evoai","getEvoai"],["evoai","fetchEvoai"],["evoai","fetchSessions"]]}),s=Le(see,{invalidateKeys:[["evoai","fetchEvoai"]]});return{setDefaultSettingsEvoai:e,changeStatusEvoai:t,deleteEvoai:n,updateEvoai:r,createEvoai:s}}const cee=e=>["evoai","fetchDefaultSettings",JSON.stringify(e)],uee=async({instanceName:e,token:t})=>(await ie.get(`/evoai/fetchSettings/${e}`,{headers:{apikey:t}})).data,dee=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:cee({instanceName:t,token:n}),queryFn:()=>uee({instanceName:t,token:n}),enabled:!!t})},fee=k.object({expire:k.string(),keywordFinish:k.string(),delayMessage:k.string(),unknownMessage:k.string(),listeningFromMe:k.boolean(),stopBotFromMe:k.boolean(),keepOpen:k.boolean(),debounceTime:k.string(),ignoreJids:k.array(k.string()).default([]),evoaiIdFallback:k.union([k.null(),k.string()]).optional(),splitMessages:k.boolean(),timePerChar:k.string()});function pee(){const{t:e}=Te(),{instance:t}=Ve(),{setDefaultSettingsEvoai:n}=tm(),[r,s]=v.useState(!1),{data:o,refetch:a}=OI({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token,enabled:r}),{data:c,refetch:u}=dee({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token}),i=zt({resolver:Ut(fee),defaultValues:{expire:"0",keywordFinish:e("evoai.form.examples.keywordFinish"),delayMessage:"1000",unknownMessage:e("evoai.form.examples.unknownMessage"),listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:"0",ignoreJids:[],evoaiIdFallback:void 0,splitMessages:!1,timePerChar:"0"}});v.useEffect(()=>{c&&i.reset({expire:c!=null&&c.expire?c.expire.toString():"0",keywordFinish:c.keywordFinish,delayMessage:c.delayMessage?c.delayMessage.toString():"0",unknownMessage:c.unknownMessage,listeningFromMe:c.listeningFromMe,stopBotFromMe:c.stopBotFromMe,keepOpen:c.keepOpen,debounceTime:c.debounceTime?c.debounceTime.toString():"0",ignoreJids:c.ignoreJids,evoaiIdFallback:c.evoaiIdFallback,splitMessages:c.splitMessages,timePerChar:c.timePerChar?c.timePerChar.toString():"0"})},[c]);const d=async f=>{var g,h,m;try{if(!t||!t.name)throw new Error("instance not found.");const x={expire:parseInt(f.expire),keywordFinish:f.keywordFinish,delayMessage:parseInt(f.delayMessage),unknownMessage:f.unknownMessage,listeningFromMe:f.listeningFromMe,stopBotFromMe:f.stopBotFromMe,keepOpen:f.keepOpen,debounceTime:parseInt(f.debounceTime),evoaiIdFallback:f.evoaiIdFallback||void 0,ignoreJids:f.ignoreJids,splitMessages:f.splitMessages,timePerChar:parseInt(f.timePerChar)};await n({instanceName:t.name,token:t.token,data:x}),G.success(e("evoai.toast.defaultSettings.success"))}catch(x){console.error("Error:",x),G.error(`Error: ${(m=(h=(g=x==null?void 0:x.response)==null?void 0:g.data)==null?void 0:h.response)==null?void 0:m.message}`)}};function p(){u(),a()}return l.jsxs(pt,{open:r,onOpenChange:s,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{variant:"secondary",size:"sm",children:[l.jsx(To,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:e("evoai.defaultSettings")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:p,children:[l.jsx(dt,{children:l.jsx(yt,{children:e("evoai.defaultSettings")})}),l.jsx(Mn,{...i,children:l.jsxs("form",{className:"w-full space-y-6",onSubmit:i.handleSubmit(d),children:[l.jsx("div",{children:l.jsxs("div",{className:"space-y-4",children:[l.jsx(jt,{name:"evoaiIdFallback",label:e("evoai.form.evoaiIdFallback.label"),options:(o==null?void 0:o.filter(f=>!!f.id).map(f=>({label:f.description,value:f.id})))??[]}),l.jsx($,{name:"expire",label:e("evoai.form.expire.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"keywordFinish",label:e("evoai.form.keywordFinish.label"),children:l.jsx(F,{})}),l.jsx($,{name:"delayMessage",label:e("evoai.form.delayMessage.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"unknownMessage",label:e("evoai.form.unknownMessage.label"),children:l.jsx(F,{})}),l.jsx(ge,{name:"listeningFromMe",label:e("evoai.form.listeningFromMe.label"),reverse:!0}),l.jsx(ge,{name:"stopBotFromMe",label:e("evoai.form.stopBotFromMe.label"),reverse:!0}),l.jsx(ge,{name:"keepOpen",label:e("evoai.form.keepOpen.label"),reverse:!0}),l.jsx($,{name:"debounceTime",label:e("evoai.form.debounceTime.label"),children:l.jsx(F,{type:"number"})}),l.jsx(ge,{name:"splitMessages",label:e("evoai.form.splitMessages.label"),reverse:!0}),l.jsx($,{name:"timePerChar",label:e("evoai.form.timePerChar.label"),children:l.jsx(F,{type:"number"})}),l.jsx(Ba,{name:"ignoreJids",label:e("evoai.form.ignoreJids.label"),placeholder:e("evoai.form.ignoreJids.placeholder")})]})}),l.jsx(_t,{children:l.jsx(z,{type:"submit",children:e("evoai.button.save")})})]})})]})]})}const gee=e=>["evoai","fetchSessions",JSON.stringify(e)],hee=async({evoaiId:e,instanceName:t})=>(await ie.get(`/evoai/fetchSessions/${e}/${t}`)).data,mee=e=>{const{evoaiId:t,instanceName:n,...r}=e;return qe({...r,queryKey:gee({evoaiId:t,instanceName:n}),queryFn:()=>hee({evoaiId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0),staleTime:1e3*10})};function II({evoaiId:e}){const{t}=Te(),{instance:n}=Ve(),{changeStatusEvoai:r}=tm(),[s,o]=v.useState([]),{data:a,refetch:c}=mee({evoaiId:e,instanceName:n==null?void 0:n.name}),[u,i]=v.useState(!1),[d,p]=v.useState("");function f(){c()}const g=async(m,x)=>{var b,y,w;try{if(!n)return;await r({instanceName:n.name,token:n.token,remoteJid:m,status:x}),G.success(t("evoai.toast.success.status")),f()}catch(S){console.error("Error:",S),G.error(`Error : ${(w=(y=(b=S==null?void 0:S.response)==null?void 0:b.data)==null?void 0:y.response)==null?void 0:w.message}`)}},h=[{accessorKey:"remoteJid",header:()=>l.jsx("div",{className:"text-center",children:t("evoai.sessions.table.remoteJid")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>l.jsx("div",{className:"text-center",children:t("evoai.sessions.table.pushName")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("pushName")})},{accessorKey:"sessionId",header:()=>l.jsx("div",{className:"text-center",children:t("evoai.sessions.table.sessionId")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("sessionId")})},{accessorKey:"status",header:()=>l.jsx("div",{className:"text-center",children:t("evoai.sessions.table.status")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:m})=>{const x=m.original;return l.jsxs(ms,{children:[l.jsx(vs,{asChild:!0,children:l.jsxs(z,{variant:"ghost",className:"h-8 w-8 p-0",children:[l.jsx("span",{className:"sr-only",children:t("evoai.sessions.table.actions.title")}),l.jsx(Ia,{className:"h-4 w-4"})]})}),l.jsxs(Mr,{align:"end",children:[l.jsx(No,{children:t("evoai.sessions.table.actions.title")}),l.jsx(Gs,{}),x.status!=="opened"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"opened"),children:[l.jsx(qi,{className:"mr-2 h-4 w-4"}),t("evoai.sessions.table.actions.open")]}),x.status!=="paused"&&x.status!=="closed"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"paused"),children:[l.jsx(Ki,{className:"mr-2 h-4 w-4"}),t("evoai.sessions.table.actions.pause")]}),x.status!=="closed"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"closed"),children:[l.jsx(Ui,{className:"mr-2 h-4 w-4"}),t("evoai.sessions.table.actions.close")]}),l.jsxs(tt,{onClick:()=>g(x.remoteJid,"delete"),children:[l.jsx(Vi,{className:"mr-2 h-4 w-4"}),t("evoai.sessions.table.actions.delete")]})]})]})}}];return l.jsxs(pt,{open:u,onOpenChange:i,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{variant:"secondary",size:"sm",children:[l.jsx(Hi,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:t("evoai.sessions.label")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-w-[950px]",onCloseAutoFocus:f,children:[l.jsx(dt,{children:l.jsx(yt,{children:t("evoai.sessions.label")})}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between gap-6 p-5",children:[l.jsx(F,{placeholder:t("evoai.sessions.search"),value:d,onChange:m=>p(m.target.value)}),l.jsx(z,{variant:"outline",onClick:f,size:"icon",children:l.jsx(Wi,{})})]}),l.jsx(Ka,{columns:h,data:a??[],onSortingChange:o,state:{sorting:s,globalFilter:d},onGlobalFilterChange:p,enableGlobalFilter:!0,noResultsMessage:t("evoai.sessions.table.none")})]})]})]})}const vee=k.object({enabled:k.boolean(),description:k.string(),agentUrl:k.string(),apiKey:k.string(),triggerType:k.string(),triggerOperator:k.string().optional(),triggerValue:k.string().optional(),expire:k.coerce.number().optional(),keywordFinish:k.string().optional(),delayMessage:k.coerce.number().optional(),unknownMessage:k.string().optional(),listeningFromMe:k.boolean().optional(),stopBotFromMe:k.boolean().optional(),keepOpen:k.boolean().optional(),debounceTime:k.coerce.number().optional(),splitMessages:k.boolean().optional(),timePerChar:k.coerce.number().optional()});function DI({initialData:e,onSubmit:t,handleDelete:n,evoaiId:r,isModal:s=!1,isLoading:o=!1,openDeletionDialog:a=!1,setOpenDeletionDialog:c=()=>{}}){const{t:u}=Te(),i=zt({resolver:Ut(vee),defaultValues:e||{enabled:!0,description:"",agentUrl:"",apiKey:"",triggerType:"keyword",triggerOperator:"contains",triggerValue:"",expire:0,keywordFinish:"",delayMessage:0,unknownMessage:"",listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0,splitMessages:!1,timePerChar:0}}),d=i.watch("triggerType");return l.jsx(Mn,{...i,children:l.jsxs("form",{onSubmit:i.handleSubmit(t),className:"w-full space-y-6",children:[l.jsxs("div",{className:"space-y-4",children:[l.jsx(ge,{name:"enabled",label:u("evoai.form.enabled.label"),reverse:!0}),l.jsx($,{name:"description",label:u("evoai.form.description.label"),children:l.jsx(F,{})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("evoai.form.evoaiSettings.label")}),l.jsx(ht,{})]}),l.jsx($,{name:"agentUrl",label:u("evoai.form.agentUrl.label"),required:!0,children:l.jsx(F,{})}),l.jsx($,{name:"apiKey",label:u("evoai.form.apiKey.label"),className:"flex-1",children:l.jsx(F,{type:"password"})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("evoai.form.triggerSettings.label")}),l.jsx(ht,{})]}),l.jsx(jt,{name:"triggerType",label:u("evoai.form.triggerType.label"),options:[{label:u("evoai.form.triggerType.keyword"),value:"keyword"},{label:u("evoai.form.triggerType.all"),value:"all"},{label:u("evoai.form.triggerType.advanced"),value:"advanced"},{label:u("evoai.form.triggerType.none"),value:"none"}]}),d==="keyword"&&l.jsxs(l.Fragment,{children:[l.jsx(jt,{name:"triggerOperator",label:u("evoai.form.triggerOperator.label"),options:[{label:u("evoai.form.triggerOperator.contains"),value:"contains"},{label:u("evoai.form.triggerOperator.equals"),value:"equals"},{label:u("evoai.form.triggerOperator.startsWith"),value:"startsWith"},{label:u("evoai.form.triggerOperator.endsWith"),value:"endsWith"},{label:u("evoai.form.triggerOperator.regex"),value:"regex"}]}),l.jsx($,{name:"triggerValue",label:u("evoai.form.triggerValue.label"),children:l.jsx(F,{})})]}),d==="advanced"&&l.jsx($,{name:"triggerValue",label:u("evoai.form.triggerConditions.label"),children:l.jsx(F,{})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("evoai.form.generalSettings.label")}),l.jsx(ht,{})]}),l.jsx($,{name:"expire",label:u("evoai.form.expire.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"keywordFinish",label:u("evoai.form.keywordFinish.label"),children:l.jsx(F,{})}),l.jsx($,{name:"delayMessage",label:u("evoai.form.delayMessage.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"unknownMessage",label:u("evoai.form.unknownMessage.label"),children:l.jsx(F,{})}),l.jsx(ge,{name:"listeningFromMe",label:u("evoai.form.listeningFromMe.label"),reverse:!0}),l.jsx(ge,{name:"stopBotFromMe",label:u("evoai.form.stopBotFromMe.label"),reverse:!0}),l.jsx(ge,{name:"keepOpen",label:u("evoai.form.keepOpen.label"),reverse:!0}),l.jsx($,{name:"debounceTime",label:u("evoai.form.debounceTime.label"),children:l.jsx(F,{type:"number"})}),l.jsx(ge,{name:"splitMessages",label:u("evoai.form.splitMessages.label"),reverse:!0}),i.watch("splitMessages")&&l.jsx($,{name:"timePerChar",label:u("evoai.form.timePerChar.label"),children:l.jsx(F,{type:"number"})})]}),s&&l.jsx(_t,{children:l.jsx(z,{disabled:o,type:"submit",children:u(o?"evoai.button.saving":"evoai.button.save")})}),!s&&l.jsxs("div",{children:[l.jsx(II,{evoaiId:r}),l.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[l.jsxs(pt,{open:a,onOpenChange:c,children:[l.jsx(mt,{asChild:!0,children:l.jsx(z,{variant:"destructive",size:"sm",children:u("evoai.button.delete")})}),l.jsx(ut,{children:l.jsxs(dt,{children:[l.jsx(yt,{children:u("modal.delete.title")}),l.jsx(_o,{children:u("modal.delete.messageSingle")}),l.jsxs(_t,{children:[l.jsx(z,{size:"sm",variant:"outline",onClick:()=>c(!1),children:u("button.cancel")}),l.jsx(z,{variant:"destructive",onClick:n,children:u("button.delete")})]})]})})]}),l.jsx(z,{disabled:o,type:"submit",children:u(o?"evoai.button.saving":"evoai.button.update")})]})]})]})})}function yee({resetTable:e}){const{t}=Te(),{instance:n}=Ve(),[r,s]=v.useState(!1),[o,a]=v.useState(!1),{createEvoai:c}=tm(),u=async i=>{var d,p,f;try{if(!n||!n.name)throw new Error("instance not found");s(!0);const g={enabled:i.enabled,description:i.description,agentUrl:i.agentUrl,apiKey:i.apiKey,triggerType:i.triggerType,triggerOperator:i.triggerOperator||"",triggerValue:i.triggerValue||"",expire:i.expire||0,keywordFinish:i.keywordFinish||"",delayMessage:i.delayMessage||0,unknownMessage:i.unknownMessage||"",listeningFromMe:i.listeningFromMe||!1,stopBotFromMe:i.stopBotFromMe||!1,keepOpen:i.keepOpen||!1,debounceTime:i.debounceTime||0,splitMessages:i.splitMessages||!1,timePerChar:i.timePerChar||0};await c({instanceName:n.name,token:n.token,data:g}),G.success(t("evoai.toast.success.create")),a(!1),e()}catch(g){console.error("Error:",g),G.error(`Error: ${(f=(p=(d=g==null?void 0:g.response)==null?void 0:d.data)==null?void 0:p.response)==null?void 0:f.message}`)}finally{s(!1)}};return l.jsxs(pt,{open:o,onOpenChange:a,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{size:"sm",children:[l.jsx(Ws,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:t("evoai.button.create")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[l.jsx(dt,{children:l.jsx(yt,{children:t("evoai.form.title")})}),l.jsx(DI,{onSubmit:u,isModal:!0,isLoading:r})]})]})}const bee=e=>["evoai","getEvoai",JSON.stringify(e)],xee=async({evoaiId:e,instanceName:t})=>(await ie.get(`/evoai/fetch/${e}/${t}`)).data,wee=e=>{const{evoaiId:t,instanceName:n,...r}=e;return qe({...r,queryKey:bee({evoaiId:t,instanceName:n}),queryFn:()=>xee({evoaiId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0)})};function See({evoaiId:e,resetTable:t}){const{t:n}=Te(),{instance:r}=Ve(),s=an(),[o,a]=v.useState(!1),{deleteEvoai:c,updateEvoai:u}=tm(),{data:i,isLoading:d}=wee({evoaiId:e,instanceName:r==null?void 0:r.name}),p=v.useMemo(()=>({enabled:!!(i!=null&&i.enabled),description:(i==null?void 0:i.description)??"",agentUrl:(i==null?void 0:i.agentUrl)??"",apiKey:(i==null?void 0:i.apiKey)??"",triggerType:(i==null?void 0:i.triggerType)??"",triggerOperator:(i==null?void 0:i.triggerOperator)??"",triggerValue:(i==null?void 0:i.triggerValue)??"",expire:(i==null?void 0:i.expire)??0,keywordFinish:(i==null?void 0:i.keywordFinish)??"",delayMessage:(i==null?void 0:i.delayMessage)??0,unknownMessage:(i==null?void 0:i.unknownMessage)??"",listeningFromMe:!!(i!=null&&i.listeningFromMe),stopBotFromMe:!!(i!=null&&i.stopBotFromMe),keepOpen:!!(i!=null&&i.keepOpen),debounceTime:(i==null?void 0:i.debounceTime)??0,splitMessages:(i==null?void 0:i.splitMessages)??!1,timePerChar:(i==null?void 0:i.timePerChar)??0}),[i==null?void 0:i.agentUrl,i==null?void 0:i.apiKey,i==null?void 0:i.debounceTime,i==null?void 0:i.delayMessage,i==null?void 0:i.description,i==null?void 0:i.enabled,i==null?void 0:i.expire,i==null?void 0:i.keepOpen,i==null?void 0:i.keywordFinish,i==null?void 0:i.listeningFromMe,i==null?void 0:i.stopBotFromMe,i==null?void 0:i.triggerOperator,i==null?void 0:i.triggerType,i==null?void 0:i.triggerValue,i==null?void 0:i.unknownMessage,i==null?void 0:i.splitMessages,i==null?void 0:i.timePerChar]),f=async h=>{var m,x,b;try{if(r&&r.name&&e){const y={enabled:h.enabled,description:h.description,agentUrl:h.agentUrl,apiKey:h.apiKey,triggerType:h.triggerType,triggerOperator:h.triggerOperator||"",triggerValue:h.triggerValue||"",expire:h.expire||0,keywordFinish:h.keywordFinish||"",delayMessage:h.delayMessage||1e3,unknownMessage:h.unknownMessage||"",listeningFromMe:h.listeningFromMe||!1,stopBotFromMe:h.stopBotFromMe||!1,keepOpen:h.keepOpen||!1,debounceTime:h.debounceTime||0,splitMessages:h.splitMessages||!1,timePerChar:h.timePerChar||0};await u({instanceName:r.name,evoaiId:e,data:y}),G.success(n("evoai.toast.success.update")),t(),s(`/manager/instance/${r.id}/evoai/${e}`)}else console.error("Token not found")}catch(y){console.error("Error:",y),G.error(`Error: ${(b=(x=(m=y==null?void 0:y.response)==null?void 0:m.data)==null?void 0:x.response)==null?void 0:b.message}`)}},g=async()=>{try{r&&r.name&&e?(await c({instanceName:r.name,evoaiId:e}),G.success(n("evoai.toast.success.delete")),a(!1),t(),s(`/manager/instance/${r.id}/evoai`)):console.error("instance not found")}catch(h){console.error("Erro ao excluir evoai:",h)}};return d?l.jsx(Tn,{}):l.jsx("div",{className:"m-4",children:l.jsx(DI,{initialData:p,onSubmit:f,evoaiId:e,handleDelete:g,isModal:!1,isLoading:d,openDeletionDialog:o,setOpenDeletionDialog:a})})}function lE(){const{t:e}=Te(),t=Va("(min-width: 768px)"),{instance:n}=Ve(),{evoaiId:r}=gs(),{data:s,refetch:o,isLoading:a}=OI({instanceName:n==null?void 0:n.name}),c=an(),u=d=>{n&&c(`/manager/instance/${n.id}/evoai/${d}`)},i=()=>{o()};return l.jsxs("main",{className:"pt-5",children:[l.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[l.jsx("h3",{className:"text-lg font-medium",children:e("evoai.title")}),l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[l.jsx(II,{}),l.jsx(pee,{}),l.jsx(yee,{resetTable:i})]})]}),l.jsx(ht,{className:"my-4"}),l.jsxs(za,{direction:t?"horizontal":"vertical",children:[l.jsx(Bn,{defaultSize:35,className:"pr-4",children:l.jsx("div",{className:"flex flex-col gap-3",children:a?l.jsx(Tn,{}):l.jsx(l.Fragment,{children:s&&s.length>0&&Array.isArray(s)?s.map(d=>l.jsx(z,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>u(`${d.id}`),variant:r===d.id?"secondary":"outline",children:l.jsx("h4",{className:"text-base",children:d.description||d.id})},d.id)):l.jsx(z,{variant:"link",children:e("evoai.table.none")})})})}),r&&l.jsxs(l.Fragment,{children:[l.jsx(Ua,{withHandle:!0,className:"border border-border"}),l.jsx(Bn,{children:l.jsx(See,{evoaiId:r,resetTable:i})})]})]})]})}const Cee=e=>["evolutionBot","findEvolutionBot",JSON.stringify(e)],Eee=async({instanceName:e,token:t})=>(await ie.get(`/evolutionBot/find/${e}`,{headers:{apiKey:t}})).data,AI=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:Cee({instanceName:t}),queryFn:()=>Eee({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},kee=e=>["evolutionBot","fetchDefaultSettings",JSON.stringify(e)],jee=async({instanceName:e,token:t})=>{const n=await ie.get(`/evolutionBot/fetchSettings/${e}`,{headers:{apiKey:t}});return Array.isArray(n.data)?n.data[0]:n.data},Tee=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:kee({instanceName:t}),queryFn:()=>jee({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},Mee=async({instanceName:e,token:t,data:n})=>(await ie.post(`/evolutionBot/create/${e}`,n,{headers:{apikey:t}})).data,Nee=async({instanceName:e,token:t,evolutionBotId:n,data:r})=>(await ie.put(`/evolutionBot/update/${n}/${e}`,r,{headers:{apikey:t}})).data,_ee=async({instanceName:e,evolutionBotId:t})=>(await ie.delete(`/evolutionBot/delete/${t}/${e}`)).data,Pee=async({instanceName:e,token:t,data:n})=>(await ie.post(`/evolutionBot/settings/${e}`,n,{headers:{apikey:t}})).data,Ree=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await ie.post(`/evolutionBot/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function nm(){const e=Le(Pee,{invalidateKeys:[["evolutionBot","fetchDefaultSettings"]]}),t=Le(Ree,{invalidateKeys:[["evolutionBot","getEvolutionBot"],["evolutionBot","fetchSessions"]]}),n=Le(_ee,{invalidateKeys:[["evolutionBot","getEvolutionBot"],["evolutionBot","findEvolutionBot"],["evolutionBot","fetchSessions"]]}),r=Le(Nee,{invalidateKeys:[["evolutionBot","getEvolutionBot"],["evolutionBot","findEvolutionBot"],["evolutionBot","fetchSessions"]]}),s=Le(Mee,{invalidateKeys:[["evolutionBot","findEvolutionBot"]]});return{setDefaultSettingsEvolutionBot:e,changeStatusEvolutionBot:t,deleteEvolutionBot:n,updateEvolutionBot:r,createEvolutionBot:s}}const Oee=k.object({expire:k.string(),keywordFinish:k.string(),delayMessage:k.string(),unknownMessage:k.string(),listeningFromMe:k.boolean(),stopBotFromMe:k.boolean(),keepOpen:k.boolean(),debounceTime:k.string(),ignoreJids:k.array(k.string()).default([]),botIdFallback:k.union([k.null(),k.string()]).optional(),splitMessages:k.boolean(),timePerChar:k.string()});function Iee(){const{t:e}=Te(),{instance:t}=Ve(),[n,r]=v.useState(!1),{data:s,refetch:o}=Tee({instanceName:t==null?void 0:t.name,enabled:n}),{data:a,refetch:c}=AI({instanceName:t==null?void 0:t.name,enabled:n}),{setDefaultSettingsEvolutionBot:u}=nm(),i=zt({resolver:Ut(Oee),defaultValues:{expire:"0",keywordFinish:e("evolutionBot.form.examples.keywordFinish"),delayMessage:"1000",unknownMessage:e("evolutionBot.form.examples.unknownMessage"),listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:"0",ignoreJids:[],botIdFallback:void 0,splitMessages:!1,timePerChar:"0"}});v.useEffect(()=>{s&&i.reset({expire:s!=null&&s.expire?s.expire.toString():"0",keywordFinish:s.keywordFinish,delayMessage:s.delayMessage?s.delayMessage.toString():"0",unknownMessage:s.unknownMessage,listeningFromMe:s.listeningFromMe,stopBotFromMe:s.stopBotFromMe,keepOpen:s.keepOpen,debounceTime:s.debounceTime?s.debounceTime.toString():"0",ignoreJids:s.ignoreJids,botIdFallback:s.botIdFallback,splitMessages:s.splitMessages,timePerChar:s.timePerChar?s.timePerChar.toString():"0"})},[s]);const d=async f=>{var g,h,m;try{if(!t||!t.name)throw new Error("instance not found.");const x={expire:parseInt(f.expire),keywordFinish:f.keywordFinish,delayMessage:parseInt(f.delayMessage),unknownMessage:f.unknownMessage,listeningFromMe:f.listeningFromMe,stopBotFromMe:f.stopBotFromMe,keepOpen:f.keepOpen,debounceTime:parseInt(f.debounceTime),botIdFallback:f.botIdFallback||void 0,ignoreJids:f.ignoreJids,splitMessages:f.splitMessages,timePerChar:parseInt(f.timePerChar)};await u({instanceName:t.name,token:t.token,data:x}),G.success(e("evolutionBot.toast.defaultSettings.success"))}catch(x){console.error("Error:",x),G.error(`Error: ${(m=(h=(g=x==null?void 0:x.response)==null?void 0:g.data)==null?void 0:h.response)==null?void 0:m.message}`)}};function p(){o(),c()}return l.jsxs(pt,{open:n,onOpenChange:r,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{variant:"secondary",size:"sm",children:[l.jsx(To,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:e("evolutionBot.defaultSettings")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:p,children:[l.jsx(dt,{children:l.jsx(yt,{children:e("evolutionBot.defaultSettings")})}),l.jsx(Mn,{...i,children:l.jsxs("form",{className:"w-full space-y-6",onSubmit:i.handleSubmit(d),children:[l.jsx("div",{children:l.jsxs("div",{className:"space-y-4",children:[l.jsx(jt,{name:"botIdFallback",label:e("evolutionBot.form.botIdFallback.label"),options:(a==null?void 0:a.filter(f=>!!f.id).map(f=>({label:f.description,value:f.id})))??[]}),l.jsx($,{name:"expire",label:e("evolutionBot.form.expire.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"keywordFinish",label:e("evolutionBot.form.keywordFinish.label"),children:l.jsx(F,{})}),l.jsx($,{name:"delayMessage",label:e("evolutionBot.form.delayMessage.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"unknownMessage",label:e("evolutionBot.form.unknownMessage.label"),children:l.jsx(F,{})}),l.jsx(ge,{name:"listeningFromMe",label:e("evolutionBot.form.listeningFromMe.label"),reverse:!0}),l.jsx(ge,{name:"stopBotFromMe",label:e("evolutionBot.form.stopBotFromMe.label"),reverse:!0}),l.jsx(ge,{name:"keepOpen",label:e("evolutionBot.form.keepOpen.label"),reverse:!0}),l.jsx($,{name:"debounceTime",label:e("evolutionBot.form.debounceTime.label"),children:l.jsx(F,{type:"number"})}),l.jsx(ge,{name:"splitMessages",label:e("evolutionBot.form.splitMessages.label"),reverse:!0}),i.watch("splitMessages")&&l.jsx($,{name:"timePerChar",label:e("evolutionBot.form.timePerChar.label"),children:l.jsx(F,{type:"number"})}),l.jsx(Ba,{name:"ignoreJids",label:e("evolutionBot.form.ignoreJids.label"),placeholder:e("evolutionBot.form.ignoreJids.placeholder")})]})}),l.jsx(_t,{children:l.jsx(z,{type:"submit",children:e("evolutionBot.button.save")})})]})})]})]})}const Dee=e=>["evolutionBot","fetchSessions",JSON.stringify(e)],Aee=async({instanceName:e,evolutionBotId:t,token:n})=>(await ie.get(`/evolutionBot/fetchSessions/${t}/${e}`,{headers:{apiKey:n}})).data,Fee=e=>{const{instanceName:t,token:n,evolutionBotId:r,...s}=e;return qe({...s,queryKey:Dee({instanceName:t}),queryFn:()=>Aee({instanceName:t,token:n,evolutionBotId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function FI({evolutionBotId:e}){const{t}=Te(),{instance:n}=Ve(),[r,s]=v.useState([]),[o,a]=v.useState(!1),[c,u]=v.useState(""),{data:i,refetch:d}=Fee({instanceName:n==null?void 0:n.name,evolutionBotId:e,enabled:o}),{changeStatusEvolutionBot:p}=nm();function f(){d()}const g=async(m,x)=>{var b,y,w;try{if(!n)return;await p({instanceName:n.name,token:n.token,remoteJid:m,status:x}),G.success(t("evolutionBot.toast.success.status")),f()}catch(S){console.error("Error:",S),G.error(`Error : ${(w=(y=(b=S==null?void 0:S.response)==null?void 0:b.data)==null?void 0:y.response)==null?void 0:w.message}`)}},h=[{accessorKey:"remoteJid",header:()=>l.jsx("div",{className:"text-center",children:t("evolutionBot.sessions.table.remoteJid")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>l.jsx("div",{className:"text-center",children:t("evolutionBot.sessions.table.pushName")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("pushName")})},{accessorKey:"sessionId",header:()=>l.jsx("div",{className:"text-center",children:t("evolutionBot.sessions.table.sessionId")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("sessionId")})},{accessorKey:"status",header:()=>l.jsx("div",{className:"text-center",children:t("evolutionBot.sessions.table.status")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:m})=>{const x=m.original;return l.jsxs(ms,{children:[l.jsx(vs,{asChild:!0,children:l.jsxs(z,{variant:"ghost",className:"h-8 w-8 p-0",children:[l.jsx("span",{className:"sr-only",children:t("evolutionBot.sessions.table.actions.title")}),l.jsx(Ia,{className:"h-4 w-4"})]})}),l.jsxs(Mr,{align:"end",children:[l.jsx(No,{children:t("evolutionBot.sessions.table.actions.title")}),l.jsx(Gs,{}),x.status!=="opened"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"opened"),children:[l.jsx(qi,{className:"mr-2 h-4 w-4"}),t("evolutionBot.sessions.table.actions.open")]}),x.status!=="paused"&&x.status!=="closed"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"paused"),children:[l.jsx(Ki,{className:"mr-2 h-4 w-4"}),t("evolutionBot.sessions.table.actions.pause")]}),x.status!=="closed"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"closed"),children:[l.jsx(Ui,{className:"mr-2 h-4 w-4"}),t("evolutionBot.sessions.table.actions.close")]}),l.jsxs(tt,{onClick:()=>g(x.remoteJid,"delete"),children:[l.jsx(Vi,{className:"mr-2 h-4 w-4"}),t("evolutionBot.sessions.table.actions.delete")]})]})]})}}];return l.jsxs(pt,{open:o,onOpenChange:a,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{variant:"secondary",size:"sm",children:[l.jsx(Hi,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:t("evolutionBot.sessions.label")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-w-[950px]",onCloseAutoFocus:f,children:[l.jsx(dt,{children:l.jsx(yt,{children:t("evolutionBot.sessions.label")})}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between gap-6 p-5",children:[l.jsx(F,{placeholder:t("evolutionBot.sessions.search"),value:c,onChange:m=>u(m.target.value)}),l.jsx(z,{variant:"outline",onClick:f,size:"icon",children:l.jsx(Wi,{})})]}),l.jsx(Ka,{columns:h,data:i??[],onSortingChange:s,state:{sorting:r,globalFilter:c},onGlobalFilterChange:u,enableGlobalFilter:!0,noResultsMessage:t("evolutionBot.sessions.table.none")})]})]})]})}const Lee=k.object({enabled:k.boolean(),description:k.string(),apiUrl:k.string(),apiKey:k.string().optional(),triggerType:k.string(),triggerOperator:k.string().optional(),triggerValue:k.string().optional(),expire:k.coerce.number().optional(),keywordFinish:k.string().optional(),delayMessage:k.coerce.number().optional(),unknownMessage:k.string().optional(),listeningFromMe:k.boolean().optional(),stopBotFromMe:k.boolean().optional(),keepOpen:k.boolean().optional(),debounceTime:k.coerce.number().optional(),splitMessages:k.boolean().optional(),timePerChar:k.coerce.number().optional()});function LI({initialData:e,onSubmit:t,handleDelete:n,evolutionBotId:r,isModal:s=!1,isLoading:o=!1,openDeletionDialog:a=!1,setOpenDeletionDialog:c=()=>{}}){const{t:u}=Te(),i=zt({resolver:Ut(Lee),defaultValues:e||{enabled:!0,description:"",apiUrl:"",apiKey:"",triggerType:"keyword",triggerOperator:"contains",triggerValue:"",expire:0,keywordFinish:"",delayMessage:0,unknownMessage:"",listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0,splitMessages:!1,timePerChar:0}}),d=i.watch("triggerType");return l.jsx(Mn,{...i,children:l.jsxs("form",{onSubmit:i.handleSubmit(t),className:"w-full space-y-6",children:[l.jsxs("div",{className:"space-y-4",children:[l.jsx(ge,{name:"enabled",label:u("evolutionBot.form.enabled.label"),reverse:!0}),l.jsx($,{name:"description",label:u("evolutionBot.form.description.label"),required:!0,children:l.jsx(F,{})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("evolutionBot.form.evolutionBotSettings.label")}),l.jsx(ht,{})]}),l.jsx($,{name:"apiUrl",label:u("evolutionBot.form.apiUrl.label"),required:!0,children:l.jsx(F,{})}),l.jsx($,{name:"apiKey",label:u("evolutionBot.form.apiKey.label"),children:l.jsx(F,{type:"password"})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("evolutionBot.form.triggerSettings.label")}),l.jsx(ht,{})]}),l.jsx(jt,{name:"triggerType",label:u("evolutionBot.form.triggerType.label"),options:[{label:u("evolutionBot.form.triggerType.keyword"),value:"keyword"},{label:u("evolutionBot.form.triggerType.all"),value:"all"},{label:u("evolutionBot.form.triggerType.advanced"),value:"advanced"},{label:u("evolutionBot.form.triggerType.none"),value:"none"}]}),d==="keyword"&&l.jsxs(l.Fragment,{children:[l.jsx(jt,{name:"triggerOperator",label:u("evolutionBot.form.triggerOperator.label"),options:[{label:u("evolutionBot.form.triggerOperator.contains"),value:"contains"},{label:u("evolutionBot.form.triggerOperator.equals"),value:"equals"},{label:u("evolutionBot.form.triggerOperator.startsWith"),value:"startsWith"},{label:u("evolutionBot.form.triggerOperator.endsWith"),value:"endsWith"},{label:u("evolutionBot.form.triggerOperator.regex"),value:"regex"}]}),l.jsx($,{name:"triggerValue",label:u("evolutionBot.form.triggerValue.label"),children:l.jsx(F,{})})]}),d==="advanced"&&l.jsx($,{name:"triggerValue",label:u("evolutionBot.form.triggerConditions.label"),children:l.jsx(F,{})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("evolutionBot.form.generalSettings.label")}),l.jsx(ht,{})]}),l.jsx($,{name:"expire",label:u("evolutionBot.form.expire.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"keywordFinish",label:u("evolutionBot.form.keywordFinish.label"),children:l.jsx(F,{})}),l.jsx($,{name:"delayMessage",label:u("evolutionBot.form.delayMessage.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"unknownMessage",label:u("evolutionBot.form.unknownMessage.label"),children:l.jsx(F,{})}),l.jsx(ge,{name:"listeningFromMe",label:u("evolutionBot.form.listeningFromMe.label"),reverse:!0}),l.jsx(ge,{name:"stopBotFromMe",label:u("evolutionBot.form.stopBotFromMe.label"),reverse:!0}),l.jsx(ge,{name:"keepOpen",label:u("evolutionBot.form.keepOpen.label"),reverse:!0}),l.jsx($,{name:"debounceTime",label:u("evolutionBot.form.debounceTime.label"),children:l.jsx(F,{type:"number"})}),l.jsx(ge,{name:"splitMessages",label:u("evolutionBot.form.splitMessages.label"),reverse:!0}),i.watch("splitMessages")&&l.jsx($,{name:"timePerChar",label:u("evolutionBot.form.timePerChar.label"),children:l.jsx(F,{type:"number"})})]}),s&&l.jsx(_t,{children:l.jsx(z,{disabled:o,type:"submit",children:u(o?"evolutionBot.button.saving":"evolutionBot.button.save")})}),!s&&l.jsxs("div",{children:[l.jsx(FI,{evolutionBotId:r}),l.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[l.jsxs(pt,{open:a,onOpenChange:c,children:[l.jsx(mt,{asChild:!0,children:l.jsx(z,{variant:"destructive",size:"sm",children:u("dify.button.delete")})}),l.jsx(ut,{children:l.jsxs(dt,{children:[l.jsx(yt,{children:u("modal.delete.title")}),l.jsx(_o,{children:u("modal.delete.messageSingle")}),l.jsxs(_t,{children:[l.jsx(z,{size:"sm",variant:"outline",onClick:()=>c(!1),children:u("button.cancel")}),l.jsx(z,{variant:"destructive",onClick:n,children:u("button.delete")})]})]})})]}),l.jsx(z,{disabled:o,type:"submit",children:u(o?"evolutionBot.button.saving":"evolutionBot.button.update")})]})]})]})})}function $ee({resetTable:e}){const{t}=Te(),{instance:n}=Ve(),[r,s]=v.useState(!1),[o,a]=v.useState(!1),{createEvolutionBot:c}=nm(),u=async i=>{var d,p,f;try{if(!n||!n.name)throw new Error("instance not found");s(!0);const g={enabled:i.enabled,description:i.description,apiUrl:i.apiUrl,apiKey:i.apiKey,triggerType:i.triggerType,triggerOperator:i.triggerOperator||"",triggerValue:i.triggerValue||"",expire:i.expire||0,keywordFinish:i.keywordFinish||"",delayMessage:i.delayMessage||0,unknownMessage:i.unknownMessage||"",listeningFromMe:i.listeningFromMe||!1,stopBotFromMe:i.stopBotFromMe||!1,keepOpen:i.keepOpen||!1,debounceTime:i.debounceTime||0,splitMessages:i.splitMessages||!1,timePerChar:i.timePerChar?i.timePerChar:0};await c({instanceName:n.name,token:n.token,data:g}),G.success(t("evolutionBot.toast.success.create")),a(!1),e()}catch(g){console.error("Error:",g),G.error(`Error: ${(f=(p=(d=g==null?void 0:g.response)==null?void 0:d.data)==null?void 0:p.response)==null?void 0:f.message}`)}finally{s(!1)}};return l.jsxs(pt,{open:o,onOpenChange:a,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{size:"sm",children:[l.jsx(Ws,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:t("evolutionBot.button.create")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[l.jsx(dt,{children:l.jsx(yt,{children:t("evolutionBot.form.title")})}),l.jsx(LI,{onSubmit:u,isModal:!0,isLoading:r})]})]})}const Bee=e=>["evolutionBot","getEvolutionBot",JSON.stringify(e)],zee=async({instanceName:e,token:t,evolutionBotId:n})=>{const r=await ie.get(`/evolutionBot/fetch/${n}/${e}`,{headers:{apiKey:t}});return Array.isArray(r.data)?r.data[0]:r.data},Uee=e=>{const{instanceName:t,token:n,evolutionBotId:r,...s}=e;return qe({...s,queryKey:Bee({instanceName:t}),queryFn:()=>zee({instanceName:t,token:n,evolutionBotId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function Vee({evolutionBotId:e,resetTable:t}){const{t:n}=Te(),{instance:r}=Ve(),s=an(),[o,a]=v.useState(!1),{deleteEvolutionBot:c,updateEvolutionBot:u}=nm(),{data:i,isLoading:d}=Uee({instanceName:r==null?void 0:r.name,evolutionBotId:e}),p=v.useMemo(()=>({enabled:(i==null?void 0:i.enabled)??!0,description:(i==null?void 0:i.description)??"",apiUrl:(i==null?void 0:i.apiUrl)??"",apiKey:(i==null?void 0:i.apiKey)??"",triggerType:(i==null?void 0:i.triggerType)??"",triggerOperator:(i==null?void 0:i.triggerOperator)??"",triggerValue:i==null?void 0:i.triggerValue,expire:(i==null?void 0:i.expire)??0,keywordFinish:i==null?void 0:i.keywordFinish,delayMessage:(i==null?void 0:i.delayMessage)??0,unknownMessage:i==null?void 0:i.unknownMessage,listeningFromMe:i==null?void 0:i.listeningFromMe,stopBotFromMe:!!(i!=null&&i.stopBotFromMe),keepOpen:!!(i!=null&&i.keepOpen),debounceTime:(i==null?void 0:i.debounceTime)??0,splitMessages:(i==null?void 0:i.splitMessages)??!1,timePerChar:i!=null&&i.timePerChar?i==null?void 0:i.timePerChar:0}),[i==null?void 0:i.apiKey,i==null?void 0:i.apiUrl,i==null?void 0:i.debounceTime,i==null?void 0:i.delayMessage,i==null?void 0:i.description,i==null?void 0:i.enabled,i==null?void 0:i.expire,i==null?void 0:i.keepOpen,i==null?void 0:i.keywordFinish,i==null?void 0:i.listeningFromMe,i==null?void 0:i.stopBotFromMe,i==null?void 0:i.triggerOperator,i==null?void 0:i.triggerType,i==null?void 0:i.triggerValue,i==null?void 0:i.unknownMessage,i==null?void 0:i.splitMessages,i==null?void 0:i.timePerChar]),f=async h=>{var m,x,b;try{if(r&&r.name&&e){const y={enabled:h.enabled,description:h.description,apiUrl:h.apiUrl,apiKey:h.apiKey,triggerType:h.triggerType,triggerOperator:h.triggerOperator||"",triggerValue:h.triggerValue||"",expire:h.expire||0,keywordFinish:h.keywordFinish||"",delayMessage:h.delayMessage||1e3,unknownMessage:h.unknownMessage||"",listeningFromMe:h.listeningFromMe||!1,stopBotFromMe:h.stopBotFromMe||!1,keepOpen:h.keepOpen||!1,debounceTime:h.debounceTime||0,splitMessages:h.splitMessages||!1,timePerChar:h.timePerChar?h.timePerChar:0};await u({instanceName:r.name,evolutionBotId:e,data:y}),G.success(n("evolutionBot.toast.success.update")),t(),s(`/manager/instance/${r.id}/evolutionBot/${e}`)}else console.error("Token not found")}catch(y){console.error("Error:",y),G.error(`Error: ${(b=(x=(m=y==null?void 0:y.response)==null?void 0:m.data)==null?void 0:x.response)==null?void 0:b.message}`)}},g=async()=>{try{r&&r.name&&e?(await c({instanceName:r.name,evolutionBotId:e}),G.success(n("evolutionBot.toast.success.delete")),a(!1),t(),s(`/manager/instance/${r.id}/evolutionBot`)):console.error("instance not found")}catch(h){console.error("Erro ao excluir evolutionBot:",h)}};return d?l.jsx(Tn,{}):l.jsx("div",{className:"m-4",children:l.jsx(LI,{initialData:p,onSubmit:f,evolutionBotId:e,handleDelete:g,isModal:!1,openDeletionDialog:o,setOpenDeletionDialog:a})})}function cE(){const{t:e}=Te(),t=Va("(min-width: 768px)"),{instance:n}=Ve(),{evolutionBotId:r}=gs(),{data:s,isLoading:o,refetch:a}=AI({instanceName:n==null?void 0:n.name}),c=an(),u=d=>{n&&c(`/manager/instance/${n.id}/evolutionBot/${d}`)},i=()=>{a()};return l.jsxs("main",{className:"pt-5",children:[l.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[l.jsx("h3",{className:"text-lg font-medium",children:e("evolutionBot.title")}),l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[l.jsx(FI,{}),l.jsx(Iee,{}),l.jsx($ee,{resetTable:i})]})]}),l.jsx(ht,{className:"my-4"}),l.jsxs(za,{direction:t?"horizontal":"vertical",children:[l.jsx(Bn,{defaultSize:35,className:"pr-4",children:l.jsx("div",{className:"flex flex-col gap-3",children:o?l.jsx(Tn,{}):l.jsx(l.Fragment,{children:s&&s.length>0&&Array.isArray(s)?s.map(d=>l.jsx(z,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>u(`${d.id}`),variant:r===d.id?"secondary":"outline",children:l.jsx("h4",{className:"text-base",children:d.description||d.id})},d.id)):l.jsx(z,{variant:"link",children:e("evolutionBot.table.none")})})})}),r&&l.jsxs(l.Fragment,{children:[l.jsx(Ua,{withHandle:!0,className:"border border-border"}),l.jsx(Bn,{children:l.jsx(Vee,{evolutionBotId:r,resetTable:i})})]})]})]})}const Hee=e=>["flowise","findFlowise",JSON.stringify(e)],Kee=async({instanceName:e,token:t})=>(await ie.get(`/flowise/find/${e}`,{headers:{apiKey:t}})).data,$I=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:Hee({instanceName:t}),queryFn:()=>Kee({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},qee=e=>["flowise","fetchDefaultSettings",JSON.stringify(e)],Wee=async({instanceName:e,token:t})=>{const n=await ie.get(`/flowise/fetchSettings/${e}`,{headers:{apiKey:t}});return Array.isArray(n.data)?n.data[0]:n.data},Gee=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:qee({instanceName:t}),queryFn:()=>Wee({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},Jee=async({instanceName:e,token:t,data:n})=>(await ie.post(`/flowise/create/${e}`,n,{headers:{apikey:t}})).data,Qee=async({instanceName:e,flowiseId:t,data:n})=>(await ie.put(`/flowise/update/${t}/${e}`,n)).data,Zee=async({instanceName:e,flowiseId:t})=>(await ie.delete(`/flowise/delete/${t}/${e}`)).data,Yee=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await ie.post(`/flowise/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data,Xee=async({instanceName:e,token:t,data:n})=>(await ie.post(`/flowise/settings/${e}`,n,{headers:{apikey:t}})).data;function rm(){const e=Le(Xee,{invalidateKeys:[["flowise","fetchDefaultSettings"]]}),t=Le(Yee,{invalidateKeys:[["flowise","getFlowise"],["flowise","fetchSessions"]]}),n=Le(Zee,{invalidateKeys:[["flowise","getFlowise"],["flowise","findFlowise"],["flowise","fetchSessions"]]}),r=Le(Qee,{invalidateKeys:[["flowise","getFlowise"],["flowise","findFlowise"],["flowise","fetchSessions"]]}),s=Le(Jee,{invalidateKeys:[["flowise","findFlowise"]]});return{setDefaultSettingsFlowise:e,changeStatusFlowise:t,deleteFlowise:n,updateFlowise:r,createFlowise:s}}const ete=k.object({expire:k.string(),keywordFinish:k.string(),delayMessage:k.string(),unknownMessage:k.string(),listeningFromMe:k.boolean(),stopBotFromMe:k.boolean(),keepOpen:k.boolean(),debounceTime:k.string(),ignoreJids:k.array(k.string()).default([]),flowiseIdFallback:k.union([k.null(),k.string()]).optional(),splitMessages:k.boolean(),timePerChar:k.string()});function tte(){const{t:e}=Te(),{instance:t}=Ve(),{setDefaultSettingsFlowise:n}=rm(),[r,s]=v.useState(!1),{data:o,refetch:a}=Gee({instanceName:t==null?void 0:t.name,enabled:r}),{data:c,refetch:u}=$I({instanceName:t==null?void 0:t.name,enabled:r}),i=zt({resolver:Ut(ete),defaultValues:{expire:"0",keywordFinish:e("flowise.form.examples.keywordFinish"),delayMessage:"1000",unknownMessage:e("flowise.form.examples.unknownMessage"),listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:"0",ignoreJids:[],flowiseIdFallback:void 0,splitMessages:!1,timePerChar:"0"}});v.useEffect(()=>{o&&i.reset({expire:o!=null&&o.expire?o.expire.toString():"0",keywordFinish:o.keywordFinish,delayMessage:o.delayMessage?o.delayMessage.toString():"0",unknownMessage:o.unknownMessage,listeningFromMe:o.listeningFromMe,stopBotFromMe:o.stopBotFromMe,keepOpen:o.keepOpen,debounceTime:o.debounceTime?o.debounceTime.toString():"0",ignoreJids:o.ignoreJids,flowiseIdFallback:o.flowiseIdFallback,splitMessages:o.splitMessages,timePerChar:o.timePerChar?o.timePerChar.toString():"0"})},[o]);const d=async f=>{var g,h,m;try{if(!t||!t.name)throw new Error("instance not found.");const x={expire:parseInt(f.expire),keywordFinish:f.keywordFinish,delayMessage:parseInt(f.delayMessage),unknownMessage:f.unknownMessage,listeningFromMe:f.listeningFromMe,stopBotFromMe:f.stopBotFromMe,keepOpen:f.keepOpen,debounceTime:parseInt(f.debounceTime),flowiseIdFallback:f.flowiseIdFallback||void 0,ignoreJids:f.ignoreJids,splitMessages:f.splitMessages,timePerChar:parseInt(f.timePerChar)};await n({instanceName:t.name,token:t.token,data:x}),G.success(e("flowise.toast.defaultSettings.success"))}catch(x){console.error("Error:",x),G.error(`Error: ${(m=(h=(g=x==null?void 0:x.response)==null?void 0:g.data)==null?void 0:h.response)==null?void 0:m.message}`)}};function p(){a(),u()}return l.jsxs(pt,{open:r,onOpenChange:s,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{variant:"secondary",size:"sm",children:[l.jsx(To,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:e("flowise.defaultSettings")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:p,children:[l.jsx(dt,{children:l.jsx(yt,{children:e("flowise.defaultSettings")})}),l.jsx(Mn,{...i,children:l.jsxs("form",{className:"w-full space-y-6",onSubmit:i.handleSubmit(d),children:[l.jsx("div",{children:l.jsxs("div",{className:"space-y-4",children:[l.jsx(jt,{name:"flowiseIdFallback",label:e("flowise.form.flowiseIdFallback.label"),options:(c==null?void 0:c.filter(f=>!!f.id).map(f=>({label:f.description,value:f.id})))??[]}),l.jsx($,{name:"expire",label:e("flowise.form.expire.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"keywordFinish",label:e("flowise.form.keywordFinish.label"),children:l.jsx(F,{})}),l.jsx($,{name:"delayMessage",label:e("flowise.form.delayMessage.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"unknownMessage",label:e("flowise.form.unknownMessage.label"),children:l.jsx(F,{})}),l.jsx(ge,{name:"listeningFromMe",label:e("flowise.form.listeningFromMe.label"),reverse:!0}),l.jsx(ge,{name:"stopBotFromMe",label:e("flowise.form.stopBotFromMe.label"),reverse:!0}),l.jsx(ge,{name:"keepOpen",label:e("flowise.form.keepOpen.label"),reverse:!0}),l.jsx($,{name:"debounceTime",label:e("flowise.form.debounceTime.label"),children:l.jsx(F,{type:"number"})}),l.jsx(ge,{name:"splitMessages",label:e("flowise.form.splitMessages.label"),reverse:!0}),i.watch("splitMessages")&&l.jsx($,{name:"timePerChar",label:e("flowise.form.timePerChar.label"),children:l.jsx(F,{type:"number"})}),l.jsx(Ba,{name:"ignoreJids",label:e("flowise.form.ignoreJids.label"),placeholder:e("flowise.form.ignoreJids.placeholder")})]})}),l.jsx(_t,{children:l.jsx(z,{type:"submit",children:e("flowise.button.save")})})]})})]})]})}const nte=e=>["flowise","fetchSessions",JSON.stringify(e)],rte=async({instanceName:e,flowiseId:t,token:n})=>(await ie.get(`/flowise/fetchSessions/${t}/${e}`,{headers:{apiKey:n}})).data,ste=e=>{const{instanceName:t,token:n,flowiseId:r,...s}=e;return qe({...s,queryKey:nte({instanceName:t}),queryFn:()=>rte({instanceName:t,token:n,flowiseId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function BI({flowiseId:e}){const{t}=Te(),{instance:n}=Ve(),{changeStatusFlowise:r}=rm(),[s,o]=v.useState([]),[a,c]=v.useState(!1),[u,i]=v.useState(""),{data:d,refetch:p}=ste({instanceName:n==null?void 0:n.name,flowiseId:e,enabled:a});function f(){p()}const g=async(m,x)=>{var b,y,w;try{if(!n)return;await r({instanceName:n.name,token:n.token,remoteJid:m,status:x}),G.success(t("flowise.toast.success.status")),f()}catch(S){console.error("Error:",S),G.error(`Error : ${(w=(y=(b=S==null?void 0:S.response)==null?void 0:b.data)==null?void 0:y.response)==null?void 0:w.message}`)}},h=[{accessorKey:"remoteJid",header:()=>l.jsx("div",{className:"text-center",children:t("flowise.sessions.table.remoteJid")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>l.jsx("div",{className:"text-center",children:t("flowise.sessions.table.pushName")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("pushName")})},{accessorKey:"sessionId",header:()=>l.jsx("div",{className:"text-center",children:t("flowise.sessions.table.sessionId")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("sessionId")})},{accessorKey:"status",header:()=>l.jsx("div",{className:"text-center",children:t("flowise.sessions.table.status")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:m})=>{const x=m.original;return l.jsxs(ms,{children:[l.jsx(vs,{asChild:!0,children:l.jsxs(z,{variant:"ghost",className:"h-8 w-8 p-0",children:[l.jsx("span",{className:"sr-only",children:t("flowise.sessions.table.actions.title")}),l.jsx(Ia,{className:"h-4 w-4"})]})}),l.jsxs(Mr,{align:"end",children:[l.jsx(No,{children:t("flowise.sessions.table.actions.title")}),l.jsx(Gs,{}),x.status!=="opened"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"opened"),children:[l.jsx(qi,{className:"mr-2 h-4 w-4"}),t("flowise.sessions.table.actions.open")]}),x.status!=="paused"&&x.status!=="closed"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"paused"),children:[l.jsx(Ki,{className:"mr-2 h-4 w-4"}),t("flowise.sessions.table.actions.pause")]}),x.status!=="closed"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"closed"),children:[l.jsx(Ui,{className:"mr-2 h-4 w-4"}),t("flowise.sessions.table.actions.close")]}),l.jsxs(tt,{onClick:()=>g(x.remoteJid,"delete"),children:[l.jsx(Vi,{className:"mr-2 h-4 w-4"}),t("flowise.sessions.table.actions.delete")]})]})]})}}];return l.jsxs(pt,{open:a,onOpenChange:c,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{variant:"secondary",size:"sm",children:[l.jsx(Hi,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:t("flowise.sessions.label")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-w-[950px]",onCloseAutoFocus:f,children:[l.jsx(dt,{children:l.jsx(yt,{children:t("flowise.sessions.label")})}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between gap-6 p-5",children:[l.jsx(F,{placeholder:t("flowise.sessions.search"),value:u,onChange:m=>i(m.target.value)}),l.jsx(z,{variant:"outline",onClick:f,size:"icon",children:l.jsx(Wi,{})})]}),l.jsx(Ka,{columns:h,data:d??[],onSortingChange:o,state:{sorting:s,globalFilter:u},onGlobalFilterChange:i,enableGlobalFilter:!0,noResultsMessage:t("flowise.sessions.table.none")})]})]})]})}const ote=k.object({enabled:k.boolean(),description:k.string(),apiUrl:k.string(),apiKey:k.string().optional(),triggerType:k.string(),triggerOperator:k.string().optional(),triggerValue:k.string().optional(),expire:k.coerce.number().optional(),keywordFinish:k.string().optional(),delayMessage:k.coerce.number().optional(),unknownMessage:k.string().optional(),listeningFromMe:k.boolean().optional(),stopBotFromMe:k.boolean().optional(),keepOpen:k.boolean().optional(),debounceTime:k.coerce.number().optional(),splitMessages:k.boolean().optional(),timePerChar:k.coerce.number().optional()});function zI({initialData:e,onSubmit:t,handleDelete:n,flowiseId:r,isModal:s=!1,isLoading:o=!1,openDeletionDialog:a=!1,setOpenDeletionDialog:c=()=>{}}){const{t:u}=Te(),i=zt({resolver:Ut(ote),defaultValues:e||{enabled:!0,description:"",apiUrl:"",apiKey:"",triggerType:"keyword",triggerOperator:"contains",triggerValue:"",expire:0,keywordFinish:"",delayMessage:0,unknownMessage:"",listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0,splitMessages:!1,timePerChar:0}}),d=i.watch("triggerType");return l.jsx(Mn,{...i,children:l.jsxs("form",{onSubmit:i.handleSubmit(t),className:"w-full space-y-6",children:[l.jsxs("div",{className:"space-y-4",children:[l.jsx(ge,{name:"enabled",label:u("flowise.form.enabled.label"),reverse:!0}),l.jsx($,{name:"description",label:u("flowise.form.description.label"),required:!0,children:l.jsx(F,{})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("flowise.form.flowiseSettings.label")}),l.jsx(ht,{})]}),l.jsx($,{name:"apiUrl",label:u("flowise.form.apiUrl.label"),required:!0,children:l.jsx(F,{})}),l.jsx($,{name:"apiKey",label:u("flowise.form.apiKey.label"),children:l.jsx(F,{type:"password"})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("flowise.form.triggerSettings.label")}),l.jsx(ht,{})]}),l.jsx(jt,{name:"triggerType",label:u("flowise.form.triggerType.label"),options:[{label:u("flowise.form.triggerType.keyword"),value:"keyword"},{label:u("flowise.form.triggerType.all"),value:"all"},{label:u("flowise.form.triggerType.advanced"),value:"advanced"},{label:u("flowise.form.triggerType.none"),value:"none"}]}),d==="keyword"&&l.jsxs(l.Fragment,{children:[l.jsx(jt,{name:"triggerOperator",label:u("flowise.form.triggerOperator.label"),options:[{label:u("flowise.form.triggerOperator.contains"),value:"contains"},{label:u("flowise.form.triggerOperator.equals"),value:"equals"},{label:u("flowise.form.triggerOperator.startsWith"),value:"startsWith"},{label:u("flowise.form.triggerOperator.endsWith"),value:"endsWith"},{label:u("flowise.form.triggerOperator.regex"),value:"regex"}]}),l.jsx($,{name:"triggerValue",label:u("flowise.form.triggerValue.label"),children:l.jsx(F,{})})]}),d==="advanced"&&l.jsx($,{name:"triggerValue",label:u("flowise.form.triggerConditions.label"),children:l.jsx(F,{})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("flowise.form.generalSettings.label")}),l.jsx(ht,{})]}),l.jsx($,{name:"expire",label:u("flowise.form.expire.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"keywordFinish",label:u("flowise.form.keywordFinish.label"),children:l.jsx(F,{})}),l.jsx($,{name:"delayMessage",label:u("flowise.form.delayMessage.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"unknownMessage",label:u("flowise.form.unknownMessage.label"),children:l.jsx(F,{})}),l.jsx(ge,{name:"listeningFromMe",label:u("flowise.form.listeningFromMe.label"),reverse:!0}),l.jsx(ge,{name:"stopBotFromMe",label:u("flowise.form.stopBotFromMe.label"),reverse:!0}),l.jsx(ge,{name:"keepOpen",label:u("flowise.form.keepOpen.label"),reverse:!0}),l.jsx($,{name:"debounceTime",label:u("flowise.form.debounceTime.label"),children:l.jsx(F,{type:"number"})}),l.jsx(ge,{name:"splitMessages",label:u("flowise.form.splitMessages.label"),reverse:!0}),i.watch("splitMessages")&&l.jsx($,{name:"timePerChar",label:u("flowise.form.timePerChar.label"),children:l.jsx(F,{type:"number"})})]}),s&&l.jsx(_t,{children:l.jsx(z,{disabled:o,type:"submit",children:u(o?"flowise.button.saving":"flowise.button.save")})}),!s&&l.jsxs("div",{children:[l.jsx(BI,{flowiseId:r}),l.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[l.jsxs(pt,{open:a,onOpenChange:c,children:[l.jsx(mt,{asChild:!0,children:l.jsx(z,{variant:"destructive",size:"sm",children:u("dify.button.delete")})}),l.jsx(ut,{children:l.jsxs(dt,{children:[l.jsx(yt,{children:u("modal.delete.title")}),l.jsx(_o,{children:u("modal.delete.messageSingle")}),l.jsxs(_t,{children:[l.jsx(z,{size:"sm",variant:"outline",onClick:()=>c(!1),children:u("button.cancel")}),l.jsx(z,{variant:"destructive",onClick:n,children:u("button.delete")})]})]})})]}),l.jsx(z,{disabled:o,type:"submit",children:u(o?"flowise.button.saving":"flowise.button.update")})]})]})]})})}function ate({resetTable:e}){const{t}=Te(),{instance:n}=Ve(),{createFlowise:r}=rm(),[s,o]=v.useState(!1),[a,c]=v.useState(!1),u=async i=>{var d,p,f;try{if(!n||!n.name)throw new Error("instance not found");o(!0);const g={enabled:i.enabled,description:i.description,apiUrl:i.apiUrl,apiKey:i.apiKey,triggerType:i.triggerType,triggerOperator:i.triggerOperator||"",triggerValue:i.triggerValue||"",expire:i.expire||0,keywordFinish:i.keywordFinish||"",delayMessage:i.delayMessage||0,unknownMessage:i.unknownMessage||"",listeningFromMe:i.listeningFromMe||!1,stopBotFromMe:i.stopBotFromMe||!1,keepOpen:i.keepOpen||!1,debounceTime:i.debounceTime||0,splitMessages:i.splitMessages||!1,timePerChar:i.timePerChar||0};await r({instanceName:n.name,token:n.token,data:g}),G.success(t("flowise.toast.success.create")),c(!1),e()}catch(g){console.error("Error:",g),G.error(`Error: ${(f=(p=(d=g==null?void 0:g.response)==null?void 0:d.data)==null?void 0:p.response)==null?void 0:f.message}`)}finally{o(!1)}};return l.jsxs(pt,{open:a,onOpenChange:c,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{size:"sm",children:[l.jsx(Ws,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:t("flowise.button.create")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[l.jsx(dt,{children:l.jsx(yt,{children:t("flowise.form.title")})}),l.jsx(zI,{onSubmit:u,isModal:!0,isLoading:s})]})]})}const ite=e=>["flowise","getFlowise",JSON.stringify(e)],lte=async({instanceName:e,token:t,flowiseId:n})=>{const r=await ie.get(`/flowise/fetch/${n}/${e}`,{headers:{apiKey:t}});return Array.isArray(r.data)?r.data[0]:r.data},cte=e=>{const{instanceName:t,token:n,flowiseId:r,...s}=e;return qe({...s,queryKey:ite({instanceName:t}),queryFn:()=>lte({instanceName:t,token:n,flowiseId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function ute({flowiseId:e,resetTable:t}){const{t:n}=Te(),{instance:r}=Ve(),s=an(),[o,a]=v.useState(!1),{deleteFlowise:c,updateFlowise:u}=rm(),{data:i,isLoading:d}=cte({instanceName:r==null?void 0:r.name,flowiseId:e}),p=v.useMemo(()=>({enabled:(i==null?void 0:i.enabled)??!0,description:(i==null?void 0:i.description)??"",apiUrl:(i==null?void 0:i.apiUrl)??"",apiKey:(i==null?void 0:i.apiKey)??"",triggerType:(i==null?void 0:i.triggerType)??"",triggerOperator:(i==null?void 0:i.triggerOperator)??"",triggerValue:i==null?void 0:i.triggerValue,expire:(i==null?void 0:i.expire)??0,keywordFinish:i==null?void 0:i.keywordFinish,delayMessage:(i==null?void 0:i.delayMessage)??0,unknownMessage:i==null?void 0:i.unknownMessage,listeningFromMe:i==null?void 0:i.listeningFromMe,stopBotFromMe:i==null?void 0:i.stopBotFromMe,keepOpen:i==null?void 0:i.keepOpen,debounceTime:(i==null?void 0:i.debounceTime)??0,splitMessages:(i==null?void 0:i.splitMessages)??!1,timePerChar:(i==null?void 0:i.timePerChar)??0}),[i==null?void 0:i.apiKey,i==null?void 0:i.apiUrl,i==null?void 0:i.debounceTime,i==null?void 0:i.delayMessage,i==null?void 0:i.description,i==null?void 0:i.enabled,i==null?void 0:i.expire,i==null?void 0:i.keepOpen,i==null?void 0:i.keywordFinish,i==null?void 0:i.listeningFromMe,i==null?void 0:i.stopBotFromMe,i==null?void 0:i.triggerOperator,i==null?void 0:i.triggerType,i==null?void 0:i.triggerValue,i==null?void 0:i.unknownMessage,i==null?void 0:i.splitMessages,i==null?void 0:i.timePerChar]),f=async h=>{var m,x,b;try{if(r&&r.name&&e){const y={enabled:h.enabled,description:h.description,apiUrl:h.apiUrl,apiKey:h.apiKey,triggerType:h.triggerType,triggerOperator:h.triggerOperator||"",triggerValue:h.triggerValue||"",expire:h.expire||0,keywordFinish:h.keywordFinish||"",delayMessage:h.delayMessage||1e3,unknownMessage:h.unknownMessage||"",listeningFromMe:h.listeningFromMe||!1,stopBotFromMe:h.stopBotFromMe||!1,keepOpen:h.keepOpen||!1,debounceTime:h.debounceTime||0,splitMessages:h.splitMessages||!1,timePerChar:h.timePerChar||0};await u({instanceName:r.name,flowiseId:e,data:y}),G.success(n("flowise.toast.success.update")),t(),s(`/manager/instance/${r.id}/flowise/${e}`)}else console.error("Token not found")}catch(y){console.error("Error:",y),G.error(`Error: ${(b=(x=(m=y==null?void 0:y.response)==null?void 0:m.data)==null?void 0:x.response)==null?void 0:b.message}`)}},g=async()=>{try{r&&r.name&&e?(await c({instanceName:r.name,flowiseId:e}),G.success(n("flowise.toast.success.delete")),a(!1),t(),s(`/manager/instance/${r.id}/flowise`)):console.error("instance not found")}catch(h){console.error("Erro ao excluir dify:",h)}};return d?l.jsx(Tn,{}):l.jsx("div",{className:"m-4",children:l.jsx(zI,{initialData:p,onSubmit:f,flowiseId:e,handleDelete:g,isModal:!1,isLoading:d,openDeletionDialog:o,setOpenDeletionDialog:a})})}function uE(){const{t:e}=Te(),t=Va("(min-width: 768px)"),{instance:n}=Ve(),{flowiseId:r}=gs(),{data:s,isLoading:o,refetch:a}=$I({instanceName:n==null?void 0:n.name}),c=an(),u=d=>{n&&c(`/manager/instance/${n.id}/flowise/${d}`)},i=()=>{a()};return l.jsxs("main",{className:"pt-5",children:[l.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[l.jsx("h3",{className:"text-lg font-medium",children:e("flowise.title")}),l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[l.jsx(BI,{}),l.jsx(tte,{}),l.jsx(ate,{resetTable:i})]})]}),l.jsx(ht,{className:"my-4"}),l.jsxs(za,{direction:t?"horizontal":"vertical",children:[l.jsx(Bn,{defaultSize:35,className:"pr-4",children:l.jsx("div",{className:"flex flex-col gap-3",children:o?l.jsx(Tn,{}):l.jsx(l.Fragment,{children:s&&s.length>0&&Array.isArray(s)?s.map(d=>l.jsx(z,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>u(`${d.id}`),variant:r===d.id?"secondary":"outline",children:l.jsx("h4",{className:"text-base",children:d.description||d.id})},d.id)):l.jsx(z,{variant:"link",children:e("flowise.table.none")})})})}),r&&l.jsxs(l.Fragment,{children:[l.jsx(Ua,{withHandle:!0,className:"border border-border"}),l.jsx(Bn,{children:l.jsx(ute,{flowiseId:r,resetTable:i})})]})]})]})}const dte=e=>["n8n","fetchN8n",JSON.stringify(e)],fte=async({instanceName:e,token:t})=>(await ie.get(`/n8n/find/${e}`,{headers:{apikey:t}})).data,UI=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:dte({instanceName:t,token:n}),queryFn:()=>fte({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},pte=async({instanceName:e,token:t,data:n})=>(await ie.post(`/n8n/create/${e}`,n,{headers:{apikey:t}})).data,gte=async({instanceName:e,n8nId:t,data:n})=>(await ie.put(`/n8n/update/${t}/${e}`,n)).data,hte=async({instanceName:e,n8nId:t})=>(await ie.delete(`/n8n/delete/${t}/${e}`)).data,mte=async({instanceName:e,token:t,data:n})=>(await ie.post(`/n8n/settings/${e}`,n,{headers:{apikey:t}})).data,vte=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await ie.post(`/n8n/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function sm(){const e=Le(mte,{invalidateKeys:[["n8n","fetchDefaultSettings"]]}),t=Le(vte,{invalidateKeys:[["n8n","getN8n"],["n8n","fetchSessions"]]}),n=Le(hte,{invalidateKeys:[["n8n","getN8n"],["n8n","fetchN8n"],["n8n","fetchSessions"]]}),r=Le(gte,{invalidateKeys:[["n8n","getN8n"],["n8n","fetchN8n"],["n8n","fetchSessions"]]}),s=Le(pte,{invalidateKeys:[["n8n","fetchN8n"]]});return{setDefaultSettingsN8n:e,changeStatusN8n:t,deleteN8n:n,updateN8n:r,createN8n:s}}const yte=e=>["n8n","fetchDefaultSettings",JSON.stringify(e)],bte=async({instanceName:e,token:t})=>(await ie.get(`/n8n/fetchSettings/${e}`,{headers:{apikey:t}})).data,xte=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:yte({instanceName:t,token:n}),queryFn:()=>bte({instanceName:t,token:n}),enabled:!!t})},wte=k.object({expire:k.string(),keywordFinish:k.string(),delayMessage:k.string(),unknownMessage:k.string(),listeningFromMe:k.boolean(),stopBotFromMe:k.boolean(),keepOpen:k.boolean(),debounceTime:k.string(),ignoreJids:k.array(k.string()).default([]),n8nIdFallback:k.union([k.null(),k.string()]).optional(),splitMessages:k.boolean(),timePerChar:k.string()});function Ste(){const{t:e}=Te(),{instance:t}=Ve(),{setDefaultSettingsN8n:n}=sm(),[r,s]=v.useState(!1),{data:o,refetch:a}=UI({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token,enabled:r}),{data:c,refetch:u}=xte({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token}),i=zt({resolver:Ut(wte),defaultValues:{expire:"0",keywordFinish:e("n8n.form.examples.keywordFinish"),delayMessage:"1000",unknownMessage:e("n8n.form.examples.unknownMessage"),listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:"0",ignoreJids:[],n8nIdFallback:void 0,splitMessages:!1,timePerChar:"0"}});v.useEffect(()=>{c&&i.reset({expire:c!=null&&c.expire?c.expire.toString():"0",keywordFinish:c.keywordFinish,delayMessage:c.delayMessage?c.delayMessage.toString():"0",unknownMessage:c.unknownMessage,listeningFromMe:c.listeningFromMe,stopBotFromMe:c.stopBotFromMe,keepOpen:c.keepOpen,debounceTime:c.debounceTime?c.debounceTime.toString():"0",ignoreJids:c.ignoreJids,n8nIdFallback:c.n8nIdFallback,splitMessages:c.splitMessages,timePerChar:c.timePerChar?c.timePerChar.toString():"0"})},[c]);const d=async f=>{var g,h,m;try{if(!t||!t.name)throw new Error("instance not found.");const x={expire:parseInt(f.expire),keywordFinish:f.keywordFinish,delayMessage:parseInt(f.delayMessage),unknownMessage:f.unknownMessage,listeningFromMe:f.listeningFromMe,stopBotFromMe:f.stopBotFromMe,keepOpen:f.keepOpen,debounceTime:parseInt(f.debounceTime),n8nIdFallback:f.n8nIdFallback||void 0,ignoreJids:f.ignoreJids,splitMessages:f.splitMessages,timePerChar:parseInt(f.timePerChar)};await n({instanceName:t.name,token:t.token,data:x}),G.success(e("n8n.toast.defaultSettings.success"))}catch(x){console.error("Error:",x),G.error(`Error: ${(m=(h=(g=x==null?void 0:x.response)==null?void 0:g.data)==null?void 0:h.response)==null?void 0:m.message}`)}};function p(){u(),a()}return l.jsxs(pt,{open:r,onOpenChange:s,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{variant:"secondary",size:"sm",children:[l.jsx(To,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:e("n8n.defaultSettings")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:p,children:[l.jsx(dt,{children:l.jsx(yt,{children:e("n8n.defaultSettings")})}),l.jsx(Mn,{...i,children:l.jsxs("form",{className:"w-full space-y-6",onSubmit:i.handleSubmit(d),children:[l.jsx("div",{children:l.jsxs("div",{className:"space-y-4",children:[l.jsx(jt,{name:"n8nIdFallback",label:e("n8n.form.n8nIdFallback.label"),options:(o==null?void 0:o.filter(f=>!!f.id).map(f=>({label:f.description,value:f.id})))??[]}),l.jsx($,{name:"expire",label:e("n8n.form.expire.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"keywordFinish",label:e("n8n.form.keywordFinish.label"),children:l.jsx(F,{})}),l.jsx($,{name:"delayMessage",label:e("n8n.form.delayMessage.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"unknownMessage",label:e("n8n.form.unknownMessage.label"),children:l.jsx(F,{})}),l.jsx(ge,{name:"listeningFromMe",label:e("n8n.form.listeningFromMe.label"),reverse:!0}),l.jsx(ge,{name:"stopBotFromMe",label:e("n8n.form.stopBotFromMe.label"),reverse:!0}),l.jsx(ge,{name:"keepOpen",label:e("n8n.form.keepOpen.label"),reverse:!0}),l.jsx($,{name:"debounceTime",label:e("n8n.form.debounceTime.label"),children:l.jsx(F,{type:"number"})}),l.jsx(ge,{name:"splitMessages",label:e("n8n.form.splitMessages.label"),reverse:!0}),l.jsx($,{name:"timePerChar",label:e("n8n.form.timePerChar.label"),children:l.jsx(F,{type:"number"})}),l.jsx(Ba,{name:"ignoreJids",label:e("n8n.form.ignoreJids.label"),placeholder:e("n8n.form.ignoreJids.placeholder")})]})}),l.jsx(_t,{children:l.jsx(z,{type:"submit",children:e("n8n.button.save")})})]})})]})]})}const Cte=e=>["n8n","fetchSessions",JSON.stringify(e)],Ete=async({n8nId:e,instanceName:t})=>(await ie.get(`/n8n/fetchSessions/${e}/${t}`)).data,kte=e=>{const{n8nId:t,instanceName:n,...r}=e;return qe({...r,queryKey:Cte({n8nId:t,instanceName:n}),queryFn:()=>Ete({n8nId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0),staleTime:1e3*10})};function VI({n8nId:e}){const{t}=Te(),{instance:n}=Ve(),{changeStatusN8n:r}=sm(),[s,o]=v.useState([]),{data:a,refetch:c}=kte({n8nId:e,instanceName:n==null?void 0:n.name}),[u,i]=v.useState(!1),[d,p]=v.useState("");function f(){c()}const g=async(m,x)=>{var b,y,w;try{if(!n)return;await r({instanceName:n.name,token:n.token,remoteJid:m,status:x}),G.success(t("n8n.toast.success.status")),f()}catch(S){console.error("Error:",S),G.error(`Error : ${(w=(y=(b=S==null?void 0:S.response)==null?void 0:b.data)==null?void 0:y.response)==null?void 0:w.message}`)}},h=[{accessorKey:"remoteJid",header:()=>l.jsx("div",{className:"text-center",children:t("n8n.sessions.table.remoteJid")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>l.jsx("div",{className:"text-center",children:t("n8n.sessions.table.pushName")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("pushName")})},{accessorKey:"sessionId",header:()=>l.jsx("div",{className:"text-center",children:t("n8n.sessions.table.sessionId")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("sessionId")})},{accessorKey:"status",header:()=>l.jsx("div",{className:"text-center",children:t("n8n.sessions.table.status")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:m})=>{const x=m.original;return l.jsxs(ms,{children:[l.jsx(vs,{asChild:!0,children:l.jsxs(z,{variant:"ghost",className:"h-8 w-8 p-0",children:[l.jsx("span",{className:"sr-only",children:t("n8n.sessions.table.actions.title")}),l.jsx(Ia,{className:"h-4 w-4"})]})}),l.jsxs(Mr,{align:"end",children:[l.jsx(No,{children:t("n8n.sessions.table.actions.title")}),l.jsx(Gs,{}),x.status!=="opened"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"opened"),children:[l.jsx(qi,{className:"mr-2 h-4 w-4"}),t("n8n.sessions.table.actions.open")]}),x.status!=="paused"&&x.status!=="closed"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"paused"),children:[l.jsx(Ki,{className:"mr-2 h-4 w-4"}),t("n8n.sessions.table.actions.pause")]}),x.status!=="closed"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"closed"),children:[l.jsx(Ui,{className:"mr-2 h-4 w-4"}),t("n8n.sessions.table.actions.close")]}),l.jsxs(tt,{onClick:()=>g(x.remoteJid,"delete"),children:[l.jsx(Vi,{className:"mr-2 h-4 w-4"}),t("n8n.sessions.table.actions.delete")]})]})]})}}];return l.jsxs(pt,{open:u,onOpenChange:i,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{variant:"secondary",size:"sm",children:[l.jsx(Hi,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:t("n8n.sessions.label")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-w-[950px]",onCloseAutoFocus:f,children:[l.jsx(dt,{children:l.jsx(yt,{children:t("n8n.sessions.label")})}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between gap-6 p-5",children:[l.jsx(F,{placeholder:t("n8n.sessions.search"),value:d,onChange:m=>p(m.target.value)}),l.jsx(z,{variant:"outline",onClick:f,size:"icon",children:l.jsx(Wi,{})})]}),l.jsx(Ka,{columns:h,data:a??[],onSortingChange:o,state:{sorting:s,globalFilter:d},onGlobalFilterChange:p,enableGlobalFilter:!0,noResultsMessage:t("n8n.sessions.table.none")})]})]})]})}const jte=k.object({enabled:k.boolean(),description:k.string(),webhookUrl:k.string(),basicAuthUser:k.string(),basicAuthPass:k.string(),triggerType:k.string(),triggerOperator:k.string().optional(),triggerValue:k.string().optional(),expire:k.coerce.number().optional(),keywordFinish:k.string().optional(),delayMessage:k.coerce.number().optional(),unknownMessage:k.string().optional(),listeningFromMe:k.boolean().optional(),stopBotFromMe:k.boolean().optional(),keepOpen:k.boolean().optional(),debounceTime:k.coerce.number().optional(),splitMessages:k.boolean().optional(),timePerChar:k.coerce.number().optional()});function HI({initialData:e,onSubmit:t,handleDelete:n,n8nId:r,isModal:s=!1,isLoading:o=!1,openDeletionDialog:a=!1,setOpenDeletionDialog:c=()=>{}}){const{t:u}=Te(),i=zt({resolver:Ut(jte),defaultValues:e||{enabled:!0,description:"",webhookUrl:"",basicAuthUser:"",basicAuthPass:"",triggerType:"keyword",triggerOperator:"contains",triggerValue:"",expire:0,keywordFinish:"",delayMessage:0,unknownMessage:"",listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0,splitMessages:!1,timePerChar:0}}),d=i.watch("triggerType");return l.jsx(Mn,{...i,children:l.jsxs("form",{onSubmit:i.handleSubmit(t),className:"w-full space-y-6",children:[l.jsxs("div",{className:"space-y-4",children:[l.jsx(ge,{name:"enabled",label:u("n8n.form.enabled.label"),reverse:!0}),l.jsx($,{name:"description",label:u("n8n.form.description.label"),children:l.jsx(F,{})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("n8n.form.n8nSettings.label")}),l.jsx(ht,{})]}),l.jsx($,{name:"webhookUrl",label:u("n8n.form.webhookUrl.label"),required:!0,children:l.jsx(F,{})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("n8n.form.basicAuth.label")}),l.jsx(ht,{})]}),l.jsxs("div",{className:"flex w-full flex-row gap-4",children:[l.jsx($,{name:"basicAuthUser",label:u("n8n.form.basicAuthUser.label"),className:"flex-1",children:l.jsx(F,{})}),l.jsx($,{name:"basicAuthPass",label:u("n8n.form.basicAuthPass.label"),className:"flex-1",children:l.jsx(F,{type:"password"})})]}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("n8n.form.triggerSettings.label")}),l.jsx(ht,{})]}),l.jsx(jt,{name:"triggerType",label:u("n8n.form.triggerType.label"),options:[{label:u("n8n.form.triggerType.keyword"),value:"keyword"},{label:u("n8n.form.triggerType.all"),value:"all"},{label:u("n8n.form.triggerType.advanced"),value:"advanced"},{label:u("n8n.form.triggerType.none"),value:"none"}]}),d==="keyword"&&l.jsxs(l.Fragment,{children:[l.jsx(jt,{name:"triggerOperator",label:u("n8n.form.triggerOperator.label"),options:[{label:u("n8n.form.triggerOperator.contains"),value:"contains"},{label:u("n8n.form.triggerOperator.equals"),value:"equals"},{label:u("n8n.form.triggerOperator.startsWith"),value:"startsWith"},{label:u("n8n.form.triggerOperator.endsWith"),value:"endsWith"},{label:u("n8n.form.triggerOperator.regex"),value:"regex"}]}),l.jsx($,{name:"triggerValue",label:u("n8n.form.triggerValue.label"),children:l.jsx(F,{})})]}),d==="advanced"&&l.jsx($,{name:"triggerValue",label:u("n8n.form.triggerConditions.label"),children:l.jsx(F,{})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("n8n.form.generalSettings.label")}),l.jsx(ht,{})]}),l.jsx($,{name:"expire",label:u("n8n.form.expire.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"keywordFinish",label:u("n8n.form.keywordFinish.label"),children:l.jsx(F,{})}),l.jsx($,{name:"delayMessage",label:u("n8n.form.delayMessage.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"unknownMessage",label:u("n8n.form.unknownMessage.label"),children:l.jsx(F,{})}),l.jsx(ge,{name:"listeningFromMe",label:u("n8n.form.listeningFromMe.label"),reverse:!0}),l.jsx(ge,{name:"stopBotFromMe",label:u("n8n.form.stopBotFromMe.label"),reverse:!0}),l.jsx(ge,{name:"keepOpen",label:u("n8n.form.keepOpen.label"),reverse:!0}),l.jsx($,{name:"debounceTime",label:u("n8n.form.debounceTime.label"),children:l.jsx(F,{type:"number"})}),l.jsx(ge,{name:"splitMessages",label:u("n8n.form.splitMessages.label"),reverse:!0}),i.watch("splitMessages")&&l.jsx($,{name:"timePerChar",label:u("n8n.form.timePerChar.label"),children:l.jsx(F,{type:"number"})})]}),s&&l.jsx(_t,{children:l.jsx(z,{disabled:o,type:"submit",children:u(o?"n8n.button.saving":"n8n.button.save")})}),!s&&l.jsxs("div",{children:[l.jsx(VI,{n8nId:r}),l.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[l.jsxs(pt,{open:a,onOpenChange:c,children:[l.jsx(mt,{asChild:!0,children:l.jsx(z,{variant:"destructive",size:"sm",children:u("n8n.button.delete")})}),l.jsx(ut,{children:l.jsxs(dt,{children:[l.jsx(yt,{children:u("modal.delete.title")}),l.jsx(_o,{children:u("modal.delete.messageSingle")}),l.jsxs(_t,{children:[l.jsx(z,{size:"sm",variant:"outline",onClick:()=>c(!1),children:u("button.cancel")}),l.jsx(z,{variant:"destructive",onClick:n,children:u("button.delete")})]})]})})]}),l.jsx(z,{disabled:o,type:"submit",children:u(o?"n8n.button.saving":"n8n.button.update")})]})]})]})})}function Tte({resetTable:e}){const{t}=Te(),{instance:n}=Ve(),[r,s]=v.useState(!1),[o,a]=v.useState(!1),{createN8n:c}=sm(),u=async i=>{var d,p,f;try{if(!n||!n.name)throw new Error("instance not found");s(!0);const g={enabled:i.enabled,description:i.description,webhookUrl:i.webhookUrl,basicAuthUser:i.basicAuthUser,basicAuthPass:i.basicAuthPass,triggerType:i.triggerType,triggerOperator:i.triggerOperator||"",triggerValue:i.triggerValue||"",expire:i.expire||0,keywordFinish:i.keywordFinish||"",delayMessage:i.delayMessage||0,unknownMessage:i.unknownMessage||"",listeningFromMe:i.listeningFromMe||!1,stopBotFromMe:i.stopBotFromMe||!1,keepOpen:i.keepOpen||!1,debounceTime:i.debounceTime||0,splitMessages:i.splitMessages||!1,timePerChar:i.timePerChar||0};await c({instanceName:n.name,token:n.token,data:g}),G.success(t("n8n.toast.success.create")),a(!1),e()}catch(g){console.error("Error:",g),G.error(`Error: ${(f=(p=(d=g==null?void 0:g.response)==null?void 0:d.data)==null?void 0:p.response)==null?void 0:f.message}`)}finally{s(!1)}};return l.jsxs(pt,{open:o,onOpenChange:a,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{size:"sm",children:[l.jsx(Ws,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:t("n8n.button.create")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[l.jsx(dt,{children:l.jsx(yt,{children:t("n8n.form.title")})}),l.jsx(HI,{onSubmit:u,isModal:!0,isLoading:r})]})]})}const Mte=e=>["n8n","getN8n",JSON.stringify(e)],Nte=async({n8nId:e,instanceName:t})=>(await ie.get(`/n8n/fetch/${e}/${t}`)).data,_te=e=>{const{n8nId:t,instanceName:n,...r}=e;return qe({...r,queryKey:Mte({n8nId:t,instanceName:n}),queryFn:()=>Nte({n8nId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0)})};function Pte({n8nId:e,resetTable:t}){const{t:n}=Te(),{instance:r}=Ve(),s=an(),[o,a]=v.useState(!1),{deleteN8n:c,updateN8n:u}=sm(),{data:i,isLoading:d}=_te({n8nId:e,instanceName:r==null?void 0:r.name}),p=v.useMemo(()=>({enabled:!!(i!=null&&i.enabled),description:(i==null?void 0:i.description)??"",webhookUrl:(i==null?void 0:i.webhookUrl)??"",basicAuthUser:(i==null?void 0:i.basicAuthUser)??"",basicAuthPass:(i==null?void 0:i.basicAuthPass)??"",triggerType:(i==null?void 0:i.triggerType)??"",triggerOperator:(i==null?void 0:i.triggerOperator)??"",triggerValue:(i==null?void 0:i.triggerValue)??"",expire:(i==null?void 0:i.expire)??0,keywordFinish:(i==null?void 0:i.keywordFinish)??"",delayMessage:(i==null?void 0:i.delayMessage)??0,unknownMessage:(i==null?void 0:i.unknownMessage)??"",listeningFromMe:!!(i!=null&&i.listeningFromMe),stopBotFromMe:!!(i!=null&&i.stopBotFromMe),keepOpen:!!(i!=null&&i.keepOpen),debounceTime:(i==null?void 0:i.debounceTime)??0,splitMessages:(i==null?void 0:i.splitMessages)??!1,timePerChar:(i==null?void 0:i.timePerChar)??0}),[i==null?void 0:i.webhookUrl,i==null?void 0:i.basicAuthUser,i==null?void 0:i.basicAuthPass,i==null?void 0:i.debounceTime,i==null?void 0:i.delayMessage,i==null?void 0:i.description,i==null?void 0:i.enabled,i==null?void 0:i.expire,i==null?void 0:i.keepOpen,i==null?void 0:i.keywordFinish,i==null?void 0:i.listeningFromMe,i==null?void 0:i.stopBotFromMe,i==null?void 0:i.triggerOperator,i==null?void 0:i.triggerType,i==null?void 0:i.triggerValue,i==null?void 0:i.unknownMessage,i==null?void 0:i.splitMessages,i==null?void 0:i.timePerChar]),f=async h=>{var m,x,b;try{if(r&&r.name&&e){const y={enabled:h.enabled,description:h.description,webhookUrl:h.webhookUrl,basicAuthUser:h.basicAuthUser,basicAuthPass:h.basicAuthPass,triggerType:h.triggerType,triggerOperator:h.triggerOperator||"",triggerValue:h.triggerValue||"",expire:h.expire||0,keywordFinish:h.keywordFinish||"",delayMessage:h.delayMessage||1e3,unknownMessage:h.unknownMessage||"",listeningFromMe:h.listeningFromMe||!1,stopBotFromMe:h.stopBotFromMe||!1,keepOpen:h.keepOpen||!1,debounceTime:h.debounceTime||0,splitMessages:h.splitMessages||!1,timePerChar:h.timePerChar||0};await u({instanceName:r.name,n8nId:e,data:y}),G.success(n("n8n.toast.success.update")),t(),s(`/manager/instance/${r.id}/n8n/${e}`)}else console.error("Token not found")}catch(y){console.error("Error:",y),G.error(`Error: ${(b=(x=(m=y==null?void 0:y.response)==null?void 0:m.data)==null?void 0:x.response)==null?void 0:b.message}`)}},g=async()=>{try{r&&r.name&&e?(await c({instanceName:r.name,n8nId:e}),G.success(n("n8n.toast.success.delete")),a(!1),t(),s(`/manager/instance/${r.id}/n8n`)):console.error("instance not found")}catch(h){console.error("Erro ao excluir n8n:",h)}};return d?l.jsx(Tn,{}):l.jsx("div",{className:"m-4",children:l.jsx(HI,{initialData:p,onSubmit:f,n8nId:e,handleDelete:g,isModal:!1,isLoading:d,openDeletionDialog:o,setOpenDeletionDialog:a})})}function dE(){const{t:e}=Te(),t=Va("(min-width: 768px)"),{instance:n}=Ve(),{n8nId:r}=gs(),{data:s,refetch:o,isLoading:a}=UI({instanceName:n==null?void 0:n.name}),c=an(),u=d=>{n&&c(`/manager/instance/${n.id}/n8n/${d}`)},i=()=>{o()};return l.jsxs("main",{className:"pt-5",children:[l.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[l.jsx("h3",{className:"text-lg font-medium",children:e("n8n.title")}),l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[l.jsx(VI,{}),l.jsx(Ste,{}),l.jsx(Tte,{resetTable:i})]})]}),l.jsx(ht,{className:"my-4"}),l.jsxs(za,{direction:t?"horizontal":"vertical",children:[l.jsx(Bn,{defaultSize:35,className:"pr-4",children:l.jsx("div",{className:"flex flex-col gap-3",children:a?l.jsx(Tn,{}):l.jsx(l.Fragment,{children:s&&s.length>0&&Array.isArray(s)?s.map(d=>l.jsx(z,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>u(`${d.id}`),variant:r===d.id?"secondary":"outline",children:l.jsx("h4",{className:"text-base",children:d.description||d.id})},d.id)):l.jsx(z,{variant:"link",children:e("n8n.table.none")})})})}),r&&l.jsxs(l.Fragment,{children:[l.jsx(Ua,{withHandle:!0,className:"border border-border"}),l.jsx(Bn,{children:l.jsx(Pte,{n8nId:r,resetTable:i})})]})]})]})}const Rte=e=>["openai","findOpenai",JSON.stringify(e)],Ote=async({instanceName:e,token:t})=>(await ie.get(`/openai/find/${e}`,{headers:{apiKey:t}})).data,KI=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:Rte({instanceName:t}),queryFn:()=>Ote({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},Ite=e=>["openai","findOpenaiCreds",JSON.stringify(e)],Dte=async({instanceName:e,token:t})=>(await ie.get(`/openai/creds/${e}`,{headers:{apiKey:t}})).data,Gw=e=>{const{instanceName:t,token:n,...r}=e;return qe({staleTime:1e3*60*60*6,...r,queryKey:Ite({instanceName:t}),queryFn:()=>Dte({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},Ate=async({instanceName:e,token:t,data:n})=>(await ie.post(`/openai/creds/${e}`,n,{headers:{apikey:t}})).data,Fte=async({openaiCredsId:e,instanceName:t})=>(await ie.delete(`/openai/creds/${e}/${t}`)).data,Lte=async({instanceName:e,token:t,data:n})=>(await ie.post(`/openai/create/${e}`,n,{headers:{apikey:t}})).data,$te=async({instanceName:e,token:t,openaiId:n,data:r})=>(await ie.put(`/openai/update/${n}/${e}`,r,{headers:{apikey:t}})).data,Bte=async({instanceName:e,token:t,openaiId:n})=>(await ie.delete(`/openai/delete/${n}/${e}`,{headers:{apikey:t}})).data,zte=async({instanceName:e,token:t,data:n})=>(await ie.post(`/openai/settings/${e}`,n,{headers:{apikey:t}})).data,Ute=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await ie.post(`/openai/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function sf(){const e=Le(zte,{invalidateKeys:[["openai","fetchDefaultSettings"]]}),t=Le(Ute,{invalidateKeys:[["openai","getOpenai"],["openai","fetchSessions"]]}),n=Le(Bte,{invalidateKeys:[["openai","getOpenai"],["openai","findOpenai"],["openai","fetchSessions"]]}),r=Le($te,{invalidateKeys:[["openai","getOpenai"],["openai","findOpenai"],["openai","fetchSessions"]]}),s=Le(Lte,{invalidateKeys:[["openai","findOpenai"]]}),o=Le(Ate,{invalidateKeys:[["openai","findOpenaiCreds"]]}),a=Le(Fte,{invalidateKeys:[["openai","findOpenaiCreds"]]});return{setDefaultSettingsOpenai:e,changeStatusOpenai:t,deleteOpenai:n,updateOpenai:r,createOpenai:s,createOpenaiCreds:o,deleteOpenaiCreds:a}}const Vte=k.object({name:k.string(),apiKey:k.string()});function qI({onCredentialsUpdate:e,showText:t=!0}){const{t:n}=Te(),{instance:r}=Ve(),{createOpenaiCreds:s,deleteOpenaiCreds:o}=sf(),[a,c]=v.useState(!1),[u,i]=v.useState([]),{data:d}=Gw({instanceName:r==null?void 0:r.name,enabled:a}),p=zt({resolver:Ut(Vte),defaultValues:{name:"",apiKey:""}}),f=async m=>{var x,b,y;try{if(!r||!r.name)throw new Error("instance not found.");const w={name:m.name,apiKey:m.apiKey};await s({instanceName:r.name,token:r.token,data:w}),G.success(n("openai.toast.success.credentialsCreate")),p.reset(),e&&e()}catch(w){console.error("Error:",w),G.error(`Error: ${(y=(b=(x=w==null?void 0:w.response)==null?void 0:x.data)==null?void 0:b.response)==null?void 0:y.message}`)}},g=async m=>{var x,b,y;if(!(r!=null&&r.name)){G.error("Instance not found.");return}try{await o({openaiCredsId:m,instanceName:r==null?void 0:r.name}),G.success(n("openai.toast.success.credentialsDelete")),e&&e()}catch(w){console.error("Error:",w),G.error(`Error: ${(y=(b=(x=w==null?void 0:w.response)==null?void 0:x.data)==null?void 0:b.response)==null?void 0:y.message}`)}},h=[{accessorKey:"name",header:({column:m})=>l.jsxs(z,{variant:"ghost",onClick:()=>m.toggleSorting(m.getIsSorted()==="asc"),children:[n("openai.credentials.table.name"),l.jsx($B,{className:"ml-2 h-4 w-4"})]}),cell:({row:m})=>l.jsx("div",{children:m.getValue("name")})},{accessorKey:"apiKey",header:()=>l.jsx("div",{className:"text-right",children:n("openai.credentials.table.apiKey")}),cell:({row:m})=>l.jsxs("div",{children:[`${m.getValue("apiKey")}`.slice(0,20),"..."]})},{id:"actions",enableHiding:!1,cell:({row:m})=>{const x=m.original;return l.jsxs(ms,{children:[l.jsx(vs,{asChild:!0,children:l.jsxs(z,{variant:"ghost",className:"h-8 w-8 p-0",children:[l.jsx("span",{className:"sr-only",children:n("openai.credentials.table.actions.title")}),l.jsx(Ia,{className:"h-4 w-4"})]})}),l.jsxs(Mr,{align:"end",children:[l.jsx(No,{children:n("openai.credentials.table.actions.title")}),l.jsx(Gs,{}),l.jsx(tt,{onClick:()=>g(x.id),children:n("openai.credentials.table.actions.delete")})]})]})}}];return l.jsxs(pt,{open:a,onOpenChange:c,children:[l.jsx(mt,{asChild:!0,children:l.jsx(z,{variant:"secondary",size:"sm",type:"button",children:t?l.jsxs(l.Fragment,{children:[l.jsx(n3,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden md:inline",children:n("openai.credentials.title")})]}):l.jsx(Ws,{size:16})})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[l.jsx(dt,{children:l.jsx(yt,{children:n("openai.credentials.title")})}),l.jsx(Mn,{...p,children:l.jsx("div",{onClick:m=>m.stopPropagation(),onSubmit:m=>m.stopPropagation(),onKeyDown:m=>m.stopPropagation(),children:l.jsxs("form",{onSubmit:m=>{m.preventDefault(),m.stopPropagation(),p.handleSubmit(f)(m)},className:"w-full space-y-6",children:[l.jsx("div",{children:l.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[l.jsx($,{name:"name",label:n("openai.credentials.table.name"),children:l.jsx(F,{})}),l.jsx($,{name:"apiKey",label:n("openai.credentials.table.apiKey"),children:l.jsx(F,{type:"password"})})]})}),l.jsx(_t,{children:l.jsx(z,{type:"submit",children:n("openai.button.save")})})]})})}),l.jsx(ht,{}),l.jsx("div",{children:l.jsx(Ka,{columns:h,data:d??[],onSortingChange:i,state:{sorting:u},noResultsMessage:n("openai.credentials.table.none")})})]})]})}const Hte=e=>["openai","fetchDefaultSettings",JSON.stringify(e)],Kte=async({instanceName:e,token:t})=>{const n=await ie.get(`/openai/fetchSettings/${e}`,{headers:{apiKey:t}});return Array.isArray(n.data)?n.data[0]:n.data},qte=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:Hte({instanceName:t}),queryFn:()=>Kte({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},Wte=k.object({openaiCredsId:k.string(),expire:k.coerce.number(),keywordFinish:k.string(),delayMessage:k.coerce.number().default(0),unknownMessage:k.string(),listeningFromMe:k.boolean(),stopBotFromMe:k.boolean(),keepOpen:k.boolean(),debounceTime:k.coerce.number(),speechToText:k.boolean(),ignoreJids:k.array(k.string()).default([]),openaiIdFallback:k.union([k.null(),k.string()]).optional(),splitMessages:k.boolean().optional(),timePerChar:k.coerce.number().optional()});function Gte(){const{t:e}=Te(),{instance:t}=Ve(),{setDefaultSettingsOpenai:n}=sf(),[r,s]=v.useState(!1),{data:o,refetch:a}=qte({instanceName:t==null?void 0:t.name,enabled:r}),{data:c,refetch:u}=KI({instanceName:t==null?void 0:t.name,enabled:r}),{data:i}=Gw({instanceName:t==null?void 0:t.name,enabled:r}),d=zt({resolver:Ut(Wte),defaultValues:{openaiCredsId:"",expire:0,keywordFinish:e("openai.form.examples.keywordFinish"),delayMessage:1e3,unknownMessage:e("openai.form.examples.unknownMessage"),listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0,speechToText:!1,ignoreJids:[],openaiIdFallback:void 0,splitMessages:!1,timePerChar:0}});v.useEffect(()=>{o&&d.reset({openaiCredsId:o.openaiCredsId,expire:(o==null?void 0:o.expire)??0,keywordFinish:o.keywordFinish,delayMessage:o.delayMessage??0,unknownMessage:o.unknownMessage,listeningFromMe:o.listeningFromMe,stopBotFromMe:o.stopBotFromMe,keepOpen:o.keepOpen,debounceTime:o.debounceTime??0,speechToText:o.speechToText,ignoreJids:o.ignoreJids,openaiIdFallback:o.openaiIdFallback,splitMessages:o.splitMessages,timePerChar:o.timePerChar??0})},[o]);const p=async g=>{var h,m,x;try{if(!t||!t.name)throw new Error("instance not found.");const b={openaiCredsId:g.openaiCredsId,expire:g.expire,keywordFinish:g.keywordFinish,delayMessage:g.delayMessage,unknownMessage:g.unknownMessage,listeningFromMe:g.listeningFromMe,stopBotFromMe:g.stopBotFromMe,keepOpen:g.keepOpen,debounceTime:g.debounceTime,speechToText:g.speechToText,openaiIdFallback:g.openaiIdFallback||void 0,ignoreJids:g.ignoreJids,splitMessages:g.splitMessages,timePerChar:g.timePerChar};await n({instanceName:t.name,token:t.token,data:b}),G.success(e("openai.toast.defaultSettings.success"))}catch(b){console.error("Error:",b),G.error(`Error: ${(x=(m=(h=b==null?void 0:b.response)==null?void 0:h.data)==null?void 0:m.response)==null?void 0:x.message}`)}};function f(){a(),u()}return l.jsxs(pt,{open:r,onOpenChange:s,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{variant:"secondary",size:"sm",children:[l.jsx(To,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden md:inline",children:e("openai.defaultSettings")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:f,children:[l.jsx(dt,{children:l.jsx(yt,{children:e("openai.defaultSettings")})}),l.jsx(Mn,{...d,children:l.jsxs("form",{className:"w-full space-y-6",onSubmit:d.handleSubmit(p),children:[l.jsx("div",{children:l.jsxs("div",{className:"space-y-4",children:[l.jsx(jt,{name:"openaiCredsId",label:e("openai.form.openaiCredsId.label"),options:(i==null?void 0:i.filter(g=>!!g.id).map(g=>({label:g.name?g.name:g.apiKey.substring(0,15)+"...",value:g.id})))||[]}),l.jsx(jt,{name:"openaiIdFallback",label:e("openai.form.openaiIdFallback.label"),options:(c==null?void 0:c.filter(g=>!!g.id).map(g=>({label:g.description,value:g.id})))??[]}),l.jsx($,{name:"expire",label:e("openai.form.expire.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"keywordFinish",label:e("openai.form.keywordFinish.label"),children:l.jsx(F,{})}),l.jsx($,{name:"delayMessage",label:e("openai.form.delayMessage.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"unknownMessage",label:e("openai.form.unknownMessage.label"),children:l.jsx(F,{})}),l.jsx(ge,{name:"listeningFromMe",label:e("openai.form.listeningFromMe.label"),reverse:!0}),l.jsx(ge,{name:"stopBotFromMe",label:e("openai.form.stopBotFromMe.label"),reverse:!0}),l.jsx(ge,{name:"keepOpen",label:e("openai.form.keepOpen.label"),reverse:!0}),l.jsx(ge,{name:"speechToText",label:e("openai.form.speechToText.label"),reverse:!0}),l.jsx($,{name:"debounceTime",label:e("openai.form.debounceTime.label"),children:l.jsx(F,{type:"number"})}),l.jsx(ge,{name:"splitMessages",label:e("openai.form.splitMessages.label"),reverse:!0}),d.watch("splitMessages")&&l.jsx($,{name:"timePerChar",label:e("openai.form.timePerChar.label"),children:l.jsx(F,{type:"number"})}),l.jsx(Ba,{name:"ignoreJids",label:e("openai.form.ignoreJids.label"),placeholder:e("openai.form.ignoreJids.placeholder")})]})}),l.jsx(_t,{children:l.jsx(z,{type:"submit",children:e("openai.button.save")})})]})})]})]})}const Jte=e=>["openai","getModels",JSON.stringify(e)],Qte=async({instanceName:e,openaiCredsId:t,token:n})=>{const r=t?{openaiCredsId:t}:{};return(await ie.get(`/openai/getModels/${e}`,{headers:{apiKey:n},params:r})).data},Zte=e=>{const{instanceName:t,openaiCredsId:n,token:r,...s}=e;return qe({staleTime:1e3*60*60*6,...s,queryKey:Jte({instanceName:t,openaiCredsId:n}),queryFn:()=>Qte({instanceName:t,openaiCredsId:n,token:r}),enabled:!!t&&!!n&&(e.enabled??!0)})},Yte=e=>["openai","fetchSessions",JSON.stringify(e)],Xte=async({instanceName:e,openaiId:t,token:n})=>(await ie.get(`/openai/fetchSessions/${t}/${e}`,{headers:{apiKey:n}})).data,ene=e=>{const{instanceName:t,token:n,openaiId:r,...s}=e;return qe({...s,queryKey:Yte({instanceName:t}),queryFn:()=>Xte({instanceName:t,token:n,openaiId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function WI({openaiId:e}){const{t}=Te(),{instance:n}=Ve(),{changeStatusOpenai:r}=sf(),[s,o]=v.useState([]),[a,c]=v.useState(!1),{data:u,refetch:i}=ene({instanceName:n==null?void 0:n.name,openaiId:e,enabled:a}),[d,p]=v.useState("");function f(){i()}const g=async(m,x)=>{var b,y,w;try{if(!n)return;await r({instanceName:n.name,token:n.token,remoteJid:m,status:x}),G.success(t("openai.toast.success.status")),f()}catch(S){console.error("Error:",S),G.error(`Error : ${(w=(y=(b=S==null?void 0:S.response)==null?void 0:b.data)==null?void 0:y.response)==null?void 0:w.message}`)}},h=[{accessorKey:"remoteJid",header:()=>l.jsx("div",{className:"text-center",children:t("openai.sessions.table.remoteJid")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>l.jsx("div",{className:"text-center",children:t("openai.sessions.table.pushName")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("pushName")})},{accessorKey:"sessionId",header:()=>l.jsx("div",{className:"text-center",children:t("openai.sessions.table.sessionId")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("sessionId")})},{accessorKey:"status",header:()=>l.jsx("div",{className:"text-center",children:t("openai.sessions.table.status")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:m})=>{const x=m.original;return l.jsxs(ms,{children:[l.jsx(vs,{asChild:!0,children:l.jsxs(z,{variant:"ghost",size:"icon",children:[l.jsx("span",{className:"sr-only",children:t("openai.sessions.table.actions.title")}),l.jsx(Ia,{className:"h-4 w-4"})]})}),l.jsxs(Mr,{align:"end",children:[l.jsx(No,{children:t("openai.sessions.table.actions.title")}),l.jsx(Gs,{}),x.status!=="opened"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"opened"),children:[l.jsx(qi,{className:"mr-2 h-4 w-4"}),t("openai.sessions.table.actions.open")]}),x.status!=="paused"&&x.status!=="closed"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"paused"),children:[l.jsx(Ki,{className:"mr-2 h-4 w-4"}),t("openai.sessions.table.actions.pause")]}),x.status!=="closed"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"closed"),children:[l.jsx(Ui,{className:"mr-2 h-4 w-4"}),t("openai.sessions.table.actions.close")]}),l.jsxs(tt,{onClick:()=>g(x.remoteJid,"delete"),children:[l.jsx(Vi,{className:"mr-2 h-4 w-4"}),t("openai.sessions.table.actions.delete")]})]})]})}}];return l.jsxs(pt,{open:a,onOpenChange:c,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{variant:"secondary",size:"sm",children:[l.jsx(Hi,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden md:inline",children:t("openai.sessions.label")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-w-[950px]",onCloseAutoFocus:f,children:[l.jsx(dt,{children:l.jsx(yt,{children:t("openai.sessions.label")})}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between gap-6 p-5",children:[l.jsx(F,{placeholder:t("openai.sessions.search"),value:d,onChange:m=>p(m.target.value)}),l.jsx(z,{variant:"outline",onClick:f,size:"icon",children:l.jsx(Wi,{size:16})})]}),l.jsx(Ka,{columns:h,data:u??[],onSortingChange:o,state:{sorting:s,globalFilter:d},onGlobalFilterChange:p,enableGlobalFilter:!0,noResultsMessage:t("openai.sessions.table.none")})]})]})]})}const tne=k.object({enabled:k.boolean(),description:k.string(),openaiCredsId:k.string(),botType:k.string(),assistantId:k.string().optional(),functionUrl:k.string().optional(),model:k.string().optional(),systemMessages:k.string().optional(),assistantMessages:k.string().optional(),userMessages:k.string().optional(),maxTokens:k.coerce.number().optional(),triggerType:k.string(),triggerOperator:k.string().optional(),triggerValue:k.string().optional(),expire:k.coerce.number().optional(),keywordFinish:k.string().optional(),delayMessage:k.coerce.number().optional(),unknownMessage:k.string().optional(),listeningFromMe:k.boolean().optional(),stopBotFromMe:k.boolean().optional(),keepOpen:k.boolean().optional(),debounceTime:k.coerce.number().optional(),splitMessages:k.boolean().optional(),timePerChar:k.coerce.number().optional()});function GI({initialData:e,onSubmit:t,handleDelete:n,openaiId:r,isModal:s=!1,isLoading:o=!1,openDeletionDialog:a=!1,setOpenDeletionDialog:c=()=>{},open:u}){const{t:i}=Te(),{instance:d}=Ve(),[p,f]=v.useState(!1),{data:g,refetch:h}=Gw({instanceName:d==null?void 0:d.name,enabled:u}),m=zt({resolver:Ut(tne),defaultValues:e||{enabled:!0,description:"",openaiCredsId:"",botType:"assistant",assistantId:"",functionUrl:"",model:"",systemMessages:"",assistantMessages:"",userMessages:"",maxTokens:0,triggerType:"keyword",triggerOperator:"contains",triggerValue:"",expire:0,keywordFinish:"",delayMessage:0,unknownMessage:"",listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0,splitMessages:!1,timePerChar:0}}),x=m.watch("botType"),b=m.watch("triggerType"),y=m.watch("openaiCredsId"),{data:w,isLoading:S,refetch:E}=Zte({instanceName:d==null?void 0:d.name,openaiCredsId:y,token:d==null?void 0:d.token,enabled:p&&!!y}),C=()=>{y&&(f(!0),E())},T=()=>{h()};return l.jsx(Mn,{...m,children:l.jsxs("form",{onSubmit:m.handleSubmit(t),className:"w-full space-y-6",children:[l.jsxs("div",{className:"space-y-4",children:[l.jsx(ge,{name:"enabled",label:i("openai.form.enabled.label"),reverse:!0}),l.jsx($,{name:"description",label:i("openai.form.description.label"),required:!0,children:l.jsx(F,{})}),l.jsx("div",{className:"space-y-2",children:l.jsxs("div",{className:"flex items-end gap-2",children:[l.jsx("div",{className:"flex-1",children:l.jsx(jt,{name:"openaiCredsId",label:i("openai.form.openaiCredsId.label"),required:!0,options:(g==null?void 0:g.filter(j=>!!j.id).map(j=>({label:j.name?j.name:j.apiKey.substring(0,15)+"...",value:j.id})))??[]})}),l.jsx(qI,{onCredentialsUpdate:T,showText:!1})]})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:i("openai.form.openaiSettings.label")}),l.jsx(ht,{})]}),l.jsx(jt,{name:"botType",label:i("openai.form.botType.label"),required:!0,options:[{label:i("openai.form.botType.assistant"),value:"assistant"},{label:i("openai.form.botType.chatCompletion"),value:"chatCompletion"}]}),x==="assistant"&&l.jsxs(l.Fragment,{children:[l.jsx($,{name:"assistantId",label:i("openai.form.assistantId.label"),required:!0,children:l.jsx(F,{})}),l.jsx($,{name:"functionUrl",label:i("openai.form.functionUrl.label"),required:!0,children:l.jsx(F,{})})]}),x==="chatCompletion"&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"space-y-2",children:l.jsxs("div",{className:"flex items-end gap-2",children:[l.jsx("div",{className:"flex-1",children:l.jsx(jt,{name:"model",label:i("openai.form.model.label"),required:!0,disabled:!w||w.length===0,options:(w==null?void 0:w.map(j=>({label:j.id,value:j.id})))??[]})}),l.jsx(z,{type:"button",variant:"outline",size:"sm",disabled:!y||S,onClick:C,className:"mb-2",children:S?l.jsxs(l.Fragment,{children:[l.jsx(rg,{className:"mr-2 h-4 w-4 animate-spin"}),i("openai.button.loading")]}):l.jsxs(l.Fragment,{children:[l.jsx(rg,{className:"mr-2 h-4 w-4"}),i("openai.button.loadModels")]})})]})}),l.jsx($,{name:"systemMessages",label:i("openai.form.systemMessages.label"),children:l.jsx(Vl,{})}),l.jsx($,{name:"assistantMessages",label:i("openai.form.assistantMessages.label"),children:l.jsx(Vl,{})}),l.jsx($,{name:"userMessages",label:i("openai.form.userMessages.label"),children:l.jsx(Vl,{})}),l.jsx($,{name:"maxTokens",label:i("openai.form.maxTokens.label"),children:l.jsx(F,{type:"number"})})]}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:i("openai.form.triggerSettings.label")}),l.jsx(ht,{})]}),l.jsx(jt,{name:"triggerType",label:i("openai.form.triggerType.label"),required:!0,options:[{label:i("openai.form.triggerType.keyword"),value:"keyword"},{label:i("openai.form.triggerType.all"),value:"all"},{label:i("openai.form.triggerType.advanced"),value:"advanced"},{label:i("openai.form.triggerType.none"),value:"none"}]}),b==="keyword"&&l.jsxs(l.Fragment,{children:[l.jsx(jt,{name:"triggerOperator",label:i("openai.form.triggerOperator.label"),required:!0,options:[{label:i("openai.form.triggerOperator.contains"),value:"contains"},{label:i("openai.form.triggerOperator.equals"),value:"equals"},{label:i("openai.form.triggerOperator.startsWith"),value:"startsWith"},{label:i("openai.form.triggerOperator.endsWith"),value:"endsWith"},{label:i("openai.form.triggerOperator.regex"),value:"regex"}]}),l.jsx($,{name:"triggerValue",label:i("openai.form.triggerValue.label"),required:!0,children:l.jsx(F,{})})]}),b==="advanced"&&l.jsx($,{name:"triggerValue",label:i("openai.form.triggerConditions.label"),required:!0,children:l.jsx(F,{})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:i("openai.form.generalSettings.label")}),l.jsx(ht,{})]}),l.jsx($,{name:"expire",label:i("openai.form.expire.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"keywordFinish",label:i("openai.form.keywordFinish.label"),children:l.jsx(F,{})}),l.jsx($,{name:"delayMessage",label:i("openai.form.delayMessage.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"unknownMessage",label:i("openai.form.unknownMessage.label"),children:l.jsx(F,{})}),l.jsx(ge,{name:"listeningFromMe",label:i("openai.form.listeningFromMe.label"),reverse:!0}),l.jsx(ge,{name:"stopBotFromMe",label:i("openai.form.stopBotFromMe.label"),reverse:!0}),l.jsx(ge,{name:"keepOpen",label:i("openai.form.keepOpen.label"),reverse:!0}),l.jsx($,{name:"debounceTime",label:i("openai.form.debounceTime.label"),children:l.jsx(F,{type:"number"})}),l.jsx(ge,{name:"splitMessages",label:i("openai.form.splitMessages.label"),reverse:!0}),m.watch("splitMessages")&&l.jsx($,{name:"timePerChar",label:i("openai.form.timePerChar.label"),children:l.jsx(F,{type:"number"})})]}),s&&l.jsx(_t,{children:l.jsx(z,{disabled:o,type:"submit",children:i(o?"openai.button.saving":"openai.button.save")})}),!s&&l.jsxs("div",{children:[l.jsx(WI,{openaiId:r}),l.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[l.jsxs(pt,{open:a,onOpenChange:c,children:[l.jsx(mt,{asChild:!0,children:l.jsx(z,{variant:"destructive",size:"sm",children:i("dify.button.delete")})}),l.jsx(ut,{children:l.jsxs(dt,{children:[l.jsx(yt,{children:i("modal.delete.title")}),l.jsx(_o,{children:i("modal.delete.messageSingle")}),l.jsxs(_t,{children:[l.jsx(z,{size:"sm",variant:"outline",onClick:()=>c(!1),children:i("button.cancel")}),l.jsx(z,{variant:"destructive",onClick:n,children:i("button.delete")})]})]})})]}),l.jsx(z,{disabled:o,type:"submit",children:i(o?"openai.button.saving":"openai.button.update")})]})]})]})})}function nne({resetTable:e}){const{t}=Te(),{instance:n}=Ve(),{createOpenai:r}=sf(),[s,o]=v.useState(!1),[a,c]=v.useState(!1),u=async i=>{var d,p,f;try{if(!n||!n.name)throw new Error("instance not found");o(!0);const g={enabled:i.enabled,description:i.description,openaiCredsId:i.openaiCredsId,botType:i.botType,assistantId:i.assistantId||"",functionUrl:i.functionUrl||"",model:i.model||"",systemMessages:[i.systemMessages||""],assistantMessages:[i.assistantMessages||""],userMessages:[i.userMessages||""],maxTokens:i.maxTokens||0,triggerType:i.triggerType,triggerOperator:i.triggerOperator||"",triggerValue:i.triggerValue||"",expire:i.expire||0,keywordFinish:i.keywordFinish||"",delayMessage:i.delayMessage||0,unknownMessage:i.unknownMessage||"",listeningFromMe:i.listeningFromMe||!1,stopBotFromMe:i.stopBotFromMe||!1,keepOpen:i.keepOpen||!1,debounceTime:i.debounceTime||0,splitMessages:i.splitMessages||!1,timePerChar:i.timePerChar||0};await r({instanceName:n.name,token:n.token,data:g}),G.success(t("openai.toast.success.create")),c(!1),e()}catch(g){console.error("Error:",g),G.error(`Error: ${(f=(p=(d=g==null?void 0:g.response)==null?void 0:d.data)==null?void 0:p.response)==null?void 0:f.message}`)}finally{o(!1)}};return l.jsxs(pt,{open:a,onOpenChange:c,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{size:"sm",children:[l.jsx(Ws,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:t("openai.button.create")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[l.jsx(dt,{children:l.jsx(yt,{children:t("openai.form.title")})}),l.jsx(GI,{onSubmit:u,isModal:!0,isLoading:s,open:a})]})]})}const rne=e=>["openai","getOpenai",JSON.stringify(e)],sne=async({instanceName:e,token:t,openaiId:n})=>{const r=await ie.get(`/openai/fetch/${n}/${e}`,{headers:{apiKey:t}});return Array.isArray(r.data)?r.data[0]:r.data},one=e=>{const{instanceName:t,token:n,openaiId:r,...s}=e;return qe({...s,queryKey:rne({instanceName:t}),queryFn:()=>sne({instanceName:t,token:n,openaiId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function ane({openaiId:e,resetTable:t}){const{t:n}=Te(),{instance:r}=Ve(),s=an(),[o,a]=v.useState(!1),{deleteOpenai:c,updateOpenai:u}=sf(),{data:i,isLoading:d}=one({instanceName:r==null?void 0:r.name,openaiId:e}),p=v.useMemo(()=>({enabled:(i==null?void 0:i.enabled)??!0,description:(i==null?void 0:i.description)??"",openaiCredsId:(i==null?void 0:i.openaiCredsId)??"",botType:(i==null?void 0:i.botType)??"",assistantId:(i==null?void 0:i.assistantId)||"",functionUrl:(i==null?void 0:i.functionUrl)||"",model:(i==null?void 0:i.model)||"",systemMessages:Array.isArray(i==null?void 0:i.systemMessages)?i==null?void 0:i.systemMessages.join(", "):(i==null?void 0:i.systemMessages)||"",assistantMessages:Array.isArray(i==null?void 0:i.assistantMessages)?i==null?void 0:i.assistantMessages.join(", "):(i==null?void 0:i.assistantMessages)||"",userMessages:Array.isArray(i==null?void 0:i.userMessages)?i==null?void 0:i.userMessages.join(", "):(i==null?void 0:i.userMessages)||"",maxTokens:(i==null?void 0:i.maxTokens)||0,triggerType:(i==null?void 0:i.triggerType)||"",triggerOperator:(i==null?void 0:i.triggerOperator)||"",triggerValue:i==null?void 0:i.triggerValue,expire:(i==null?void 0:i.expire)||0,keywordFinish:i==null?void 0:i.keywordFinish,delayMessage:(i==null?void 0:i.delayMessage)||0,unknownMessage:i==null?void 0:i.unknownMessage,listeningFromMe:i==null?void 0:i.listeningFromMe,stopBotFromMe:i==null?void 0:i.stopBotFromMe,keepOpen:i==null?void 0:i.keepOpen,debounceTime:(i==null?void 0:i.debounceTime)||0,splitMessages:(i==null?void 0:i.splitMessages)||!1,timePerChar:(i==null?void 0:i.timePerChar)||0}),[i==null?void 0:i.assistantId,i==null?void 0:i.assistantMessages,i==null?void 0:i.botType,i==null?void 0:i.debounceTime,i==null?void 0:i.delayMessage,i==null?void 0:i.description,i==null?void 0:i.enabled,i==null?void 0:i.expire,i==null?void 0:i.functionUrl,i==null?void 0:i.keepOpen,i==null?void 0:i.keywordFinish,i==null?void 0:i.listeningFromMe,i==null?void 0:i.maxTokens,i==null?void 0:i.model,i==null?void 0:i.openaiCredsId,i==null?void 0:i.stopBotFromMe,i==null?void 0:i.systemMessages,i==null?void 0:i.triggerOperator,i==null?void 0:i.triggerType,i==null?void 0:i.triggerValue,i==null?void 0:i.unknownMessage,i==null?void 0:i.userMessages,i==null?void 0:i.splitMessages,i==null?void 0:i.timePerChar]),f=async h=>{var m,x,b;try{if(r&&r.name&&e){const y={enabled:h.enabled,description:h.description,openaiCredsId:h.openaiCredsId,botType:h.botType,assistantId:h.assistantId||"",functionUrl:h.functionUrl||"",model:h.model||"",systemMessages:[h.systemMessages||""],assistantMessages:[h.assistantMessages||""],userMessages:[h.userMessages||""],maxTokens:h.maxTokens||0,triggerType:h.triggerType,triggerOperator:h.triggerOperator||"",triggerValue:h.triggerValue||"",expire:h.expire||0,keywordFinish:h.keywordFinish||"",delayMessage:h.delayMessage||1e3,unknownMessage:h.unknownMessage||"",listeningFromMe:h.listeningFromMe||!1,stopBotFromMe:h.stopBotFromMe||!1,keepOpen:h.keepOpen||!1,debounceTime:h.debounceTime||0,splitMessages:h.splitMessages||!1,timePerChar:h.timePerChar||0};await u({instanceName:r.name,openaiId:e,data:y}),G.success(n("openai.toast.success.update")),t(),s(`/manager/instance/${r.id}/openai/${e}`)}else console.error("Token not found")}catch(y){console.error("Error:",y),G.error(`Error: ${(b=(x=(m=y==null?void 0:y.response)==null?void 0:m.data)==null?void 0:x.response)==null?void 0:b.message}`)}},g=async()=>{try{r&&r.name&&e?(await c({instanceName:r.name,openaiId:e}),G.success(n("openai.toast.success.delete")),a(!1),t(),s(`/manager/instance/${r.id}/openai`)):console.error("instance not found")}catch(h){console.error("Erro ao excluir dify:",h)}};return d?l.jsx(Tn,{}):l.jsx("div",{className:"m-4",children:l.jsx(GI,{initialData:p,onSubmit:f,openaiId:e,handleDelete:g,isModal:!1,isLoading:d,openDeletionDialog:o,setOpenDeletionDialog:a})})}function fE(){const{t:e}=Te(),t=Va("(min-width: 768px)"),{instance:n}=Ve(),{botId:r}=gs(),{data:s,isLoading:o,refetch:a}=KI({instanceName:n==null?void 0:n.name}),c=an(),u=d=>{n&&c(`/manager/instance/${n.id}/openai/${d}`)},i=()=>{a()};return l.jsxs("main",{className:"pt-5",children:[l.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[l.jsx("h3",{className:"text-lg font-medium",children:e("openai.title")}),l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[l.jsx(WI,{}),l.jsx(Gte,{}),l.jsx(qI,{}),l.jsx(nne,{resetTable:i})]})]}),l.jsx(ht,{className:"my-4"}),l.jsxs(za,{direction:t?"horizontal":"vertical",children:[l.jsx(Bn,{defaultSize:35,className:"pr-4",children:l.jsx("div",{className:"flex flex-col gap-3",children:o?l.jsx(Tn,{}):l.jsx(l.Fragment,{children:s&&s.length>0&&Array.isArray(s)?s.map(d=>l.jsxs(z,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>u(`${d.id}`),variant:r===d.id?"secondary":"outline",children:[l.jsx("h4",{className:"text-base",children:d.description||d.id}),l.jsx("p",{className:"text-sm font-normal text-muted-foreground",children:d.botType})]},d.id)):l.jsx(z,{variant:"link",children:e("openai.table.none")})})})}),r&&l.jsxs(l.Fragment,{children:[l.jsx(Ua,{withHandle:!0,className:"border border-border"}),l.jsx(Bn,{children:l.jsx(ane,{openaiId:r,resetTable:i})})]})]})]})}const ine=e=>["proxy","fetchProxy",JSON.stringify(e)],lne=async({instanceName:e,token:t})=>(await ie.get(`/proxy/find/${e}`,{headers:{apiKey:t}})).data,cne=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:ine({instanceName:t,token:n}),queryFn:()=>lne({instanceName:t,token:n}),enabled:!!t})},une=async({instanceName:e,token:t,data:n})=>(await ie.post(`/proxy/set/${e}`,n,{headers:{apikey:t}})).data;function dne(){return{createProxy:Le(une,{invalidateKeys:[["proxy","fetchProxy"]]})}}const fne=k.object({enabled:k.boolean(),host:k.string(),port:k.string(),protocol:k.string(),username:k.string(),password:k.string()});function pne(){const{t:e}=Te(),{instance:t}=Ve(),[n,r]=v.useState(!1),{createProxy:s}=dne(),{data:o}=cne({instanceName:t==null?void 0:t.name}),a=zt({resolver:Ut(fne),defaultValues:{enabled:!1,host:"",port:"",protocol:"http",username:"",password:""}});v.useEffect(()=>{o&&a.reset({enabled:o.enabled,host:o.host,port:o.port,protocol:o.protocol,username:o.username,password:o.password})},[o]);const c=async u=>{var i,d,p;if(t){r(!0);try{const f={enabled:u.enabled,host:u.host,port:u.port,protocol:u.protocol,username:u.username,password:u.password};await s({instanceName:t.name,token:t.token,data:f}),G.success(e("proxy.toast.success"))}catch(f){console.error(e("proxy.toast.error"),f),G.error(`Error : ${(p=(d=(i=f==null?void 0:f.response)==null?void 0:i.data)==null?void 0:d.response)==null?void 0:p.message}`)}finally{r(!1)}}};return l.jsx(l.Fragment,{children:l.jsx(La,{...a,children:l.jsx("form",{onSubmit:a.handleSubmit(c),className:"w-full space-y-6",children:l.jsxs("div",{children:[l.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("proxy.title")}),l.jsx(Da,{className:"my-4"}),l.jsxs("div",{className:"mx-4 space-y-2 divide-y [&>*]:p-4",children:[l.jsx(ge,{name:"enabled",label:e("proxy.form.enabled.label"),className:"w-full justify-between",helper:e("proxy.form.enabled.description")}),l.jsxs("div",{className:"grid gap-4 sm:grid-cols-[10rem_1fr_10rem] md:gap-8",children:[l.jsx($,{name:"protocol",label:e("proxy.form.protocol.label"),children:l.jsx(F,{})}),l.jsx($,{name:"host",label:e("proxy.form.host.label"),children:l.jsx(F,{})}),l.jsx($,{name:"port",label:e("proxy.form.port.label"),children:l.jsx(F,{type:"number"})})]}),l.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 md:gap-8",children:[l.jsx($,{name:"username",label:e("proxy.form.username.label"),children:l.jsx(F,{})}),l.jsx($,{name:"password",label:e("proxy.form.password.label"),children:l.jsx(F,{type:"password"})})]}),l.jsx("div",{className:"flex justify-end px-4 pt-6",children:l.jsx(z,{type:"submit",disabled:n,children:e(n?"proxy.button.saving":"proxy.button.save")})})]})]})})})})}const gne=e=>["rabbitmq","fetchRabbitmq",JSON.stringify(e)],hne=async({instanceName:e,token:t})=>(await ie.get(`/rabbitmq/find/${e}`,{headers:{apiKey:t}})).data,mne=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:gne({instanceName:t,token:n}),queryFn:()=>hne({instanceName:t,token:n}),enabled:!!t})},vne=async({instanceName:e,token:t,data:n})=>(await ie.post(`/rabbitmq/set/${e}`,{rabbitmq:n},{headers:{apikey:t}})).data;function yne(){return{createRabbitmq:Le(vne,{invalidateKeys:[["rabbitmq","fetchRabbitmq"]]})}}const bne=k.object({enabled:k.boolean(),events:k.array(k.string())});function xne(){const{t:e}=Te(),{instance:t}=Ve(),[n,r]=v.useState(!1),{createRabbitmq:s}=yne(),{data:o}=mne({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token}),a=zt({resolver:Ut(bne),defaultValues:{enabled:!1,events:[]}});v.useEffect(()=>{o&&a.reset({enabled:o.enabled,events:o.events})},[o]);const c=async p=>{var f,g,h;if(t){r(!0);try{const m={enabled:p.enabled,events:p.events};await s({instanceName:t.name,token:t.token,data:m}),G.success(e("rabbitmq.toast.success"))}catch(m){console.error(e("rabbitmq.toast.error"),m),G.error(`Error: ${(h=(g=(f=m==null?void 0:m.response)==null?void 0:f.data)==null?void 0:g.response)==null?void 0:h.message}`)}finally{r(!1)}}},u=["APPLICATION_STARTUP","QRCODE_UPDATED","MESSAGES_SET","MESSAGES_UPSERT","MESSAGES_UPDATE","MESSAGES_DELETE","SEND_MESSAGE","CONTACTS_SET","CONTACTS_UPSERT","CONTACTS_UPDATE","PRESENCE_UPDATE","CHATS_SET","CHATS_UPSERT","CHATS_UPDATE","CHATS_DELETE","GROUPS_UPSERT","GROUP_UPDATE","GROUP_PARTICIPANTS_UPDATE","CONNECTION_UPDATE","REMOVE_INSTANCE","LOGOUT_INSTANCE","LABELS_EDIT","LABELS_ASSOCIATION","CALL","TYPEBOT_START","TYPEBOT_CHANGE_STATUS"],i=()=>{a.setValue("events",u)},d=()=>{a.setValue("events",[])};return l.jsx(l.Fragment,{children:l.jsx(La,{...a,children:l.jsx("form",{onSubmit:a.handleSubmit(c),className:"w-full space-y-6",children:l.jsxs("div",{children:[l.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("rabbitmq.title")}),l.jsx(Da,{className:"my-4"}),l.jsxs("div",{className:"mx-4 space-y-2 divide-y [&>*]:p-4",children:[l.jsx(ge,{name:"enabled",label:e("rabbitmq.form.enabled.label"),className:"w-full justify-between",helper:e("rabbitmq.form.enabled.description")}),l.jsxs("div",{className:"mb-4 flex justify-between",children:[l.jsx(z,{variant:"outline",type:"button",onClick:i,children:e("button.markAll")}),l.jsx(z,{variant:"outline",type:"button",onClick:d,children:e("button.unMarkAll")})]}),l.jsx($a,{control:a.control,name:"events",render:({field:p})=>l.jsxs(Ro,{className:"flex flex-col",children:[l.jsx(Er,{className:"my-2 text-lg",children:e("rabbitmq.form.events.label")}),l.jsx(qs,{children:l.jsx("div",{className:"flex flex-col gap-2 space-y-1 divide-y",children:u.sort((f,g)=>f.localeCompare(g)).map(f=>l.jsxs("div",{className:"flex items-center justify-between gap-3 pt-3",children:[l.jsx(Er,{className:me("break-all",p.value.includes(f)?"text-foreground":"text-muted-foreground"),children:f}),l.jsx($c,{checked:p.value.includes(f),onCheckedChange:g=>{g?p.onChange([...p.value,f]):p.onChange(p.value.filter(h=>h!==f))}})]},f))})})]})})]}),l.jsx("div",{className:"mx-4 flex justify-end pt-6",children:l.jsx(z,{type:"submit",disabled:n,children:e(n?"rabbitmq.button.saving":"rabbitmq.button.save")})})]})})})})}const wne=e=>["instance","fetchSettings",JSON.stringify(e)],Sne=async({instanceName:e,token:t})=>(await ie.get(`/settings/find/${e}`,{headers:{apikey:t}})).data,Cne=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:wne({instanceName:t,token:n}),queryFn:()=>Sne({instanceName:t,token:n}),enabled:!!t})},Ene=k.object({rejectCall:k.boolean(),msgCall:k.string().optional(),groupsIgnore:k.boolean(),alwaysOnline:k.boolean(),readMessages:k.boolean(),syncFullHistory:k.boolean(),readStatus:k.boolean()});function kne(){const{t:e}=Te(),[t,n]=v.useState(!1),{instance:r}=Ve(),{updateSettings:s}=Nh(),{data:o,isLoading:a}=Cne({instanceName:r==null?void 0:r.name,token:r==null?void 0:r.token}),c=zt({resolver:Ut(Ene),defaultValues:{rejectCall:!1,msgCall:"",groupsIgnore:!1,alwaysOnline:!1,readMessages:!1,syncFullHistory:!1,readStatus:!1}});v.useEffect(()=>{o&&c.reset({rejectCall:o.rejectCall,msgCall:o.msgCall||"",groupsIgnore:o.groupsIgnore,alwaysOnline:o.alwaysOnline,readMessages:o.readMessages,syncFullHistory:o.syncFullHistory,readStatus:o.readStatus})},[c,o]);const u=async p=>{try{if(!r||!r.name)throw new Error("instance not found");n(!0);const f={rejectCall:p.rejectCall,msgCall:p.msgCall,groupsIgnore:p.groupsIgnore,alwaysOnline:p.alwaysOnline,readMessages:p.readMessages,syncFullHistory:p.syncFullHistory,readStatus:p.readStatus};await s({instanceName:r.name,token:r.token,data:f}),G.success(e("settings.toast.success"))}catch(f){console.error(e("settings.toast.success"),f),G.error(e("settings.toast.error"))}finally{n(!1)}},i=[{name:"groupsIgnore",label:e("settings.form.groupsIgnore.label"),description:e("settings.form.groupsIgnore.description")},{name:"alwaysOnline",label:e("settings.form.alwaysOnline.label"),description:e("settings.form.alwaysOnline.description")},{name:"readMessages",label:e("settings.form.readMessages.label"),description:e("settings.form.readMessages.description")},{name:"syncFullHistory",label:e("settings.form.syncFullHistory.label"),description:e("settings.form.syncFullHistory.description")},{name:"readStatus",label:e("settings.form.readStatus.label"),description:e("settings.form.readStatus.description")}],d=c.watch("rejectCall");return a?l.jsx(Tn,{}):l.jsx(l.Fragment,{children:l.jsx(La,{...c,children:l.jsx("form",{onSubmit:c.handleSubmit(u),className:"w-full space-y-6",children:l.jsxs("div",{children:[l.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("settings.title")}),l.jsx(ht,{className:"my-4"}),l.jsxs("div",{className:"mx-4 space-y-2 divide-y",children:[l.jsxs("div",{className:"flex flex-col p-4",children:[l.jsx(ge,{name:"rejectCall",label:e("settings.form.rejectCall.label"),className:"w-full justify-between",helper:e("settings.form.rejectCall.description")}),d&&l.jsx("div",{className:"mr-16 mt-2",children:l.jsx($,{name:"msgCall",children:l.jsx(Vl,{placeholder:e("settings.form.msgCall.description")})})})]}),i.map(p=>l.jsx("div",{className:"flex p-4",children:l.jsx(ge,{name:p.name,label:p.label,className:"w-full justify-between",helper:p.description})},p.name)),l.jsx("div",{className:"flex justify-end pt-6",children:l.jsx(z,{type:"submit",disabled:t,children:e(t?"settings.button.saving":"settings.button.save")})})]})]})})})})}const jne=e=>["sqs","fetchSqs",JSON.stringify(e)],Tne=async({instanceName:e,token:t})=>(await ie.get(`/sqs/find/${e}`,{headers:{apiKey:t}})).data,Mne=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:jne({instanceName:t,token:n}),queryFn:()=>Tne({instanceName:t,token:n}),enabled:!!t})},Nne=async({instanceName:e,token:t,data:n})=>(await ie.post(`/sqs/set/${e}`,{sqs:n},{headers:{apikey:t}})).data;function _ne(){return{createSqs:Le(Nne,{invalidateKeys:[["sqs","fetchSqs"]]})}}const Pne=k.object({enabled:k.boolean(),events:k.array(k.string())});function Rne(){const{t:e}=Te(),{instance:t}=Ve(),[n,r]=v.useState(!1),{createSqs:s}=_ne(),{data:o}=Mne({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token}),a=zt({resolver:Ut(Pne),defaultValues:{enabled:!1,events:[]}});v.useEffect(()=>{o&&a.reset({enabled:o.enabled,events:o.events})},[o]);const c=async p=>{var f,g,h;if(t){r(!0);try{const m={enabled:p.enabled,events:p.events};await s({instanceName:t.name,token:t.token,data:m}),G.success(e("sqs.toast.success"))}catch(m){console.error(e("sqs.toast.error"),m),G.error(`Error: ${(h=(g=(f=m==null?void 0:m.response)==null?void 0:f.data)==null?void 0:g.response)==null?void 0:h.message}`)}finally{r(!1)}}},u=["APPLICATION_STARTUP","QRCODE_UPDATED","MESSAGES_SET","MESSAGES_UPSERT","MESSAGES_UPDATE","MESSAGES_DELETE","SEND_MESSAGE","CONTACTS_SET","CONTACTS_UPSERT","CONTACTS_UPDATE","PRESENCE_UPDATE","CHATS_SET","CHATS_UPSERT","CHATS_UPDATE","CHATS_DELETE","GROUPS_UPSERT","GROUP_UPDATE","GROUP_PARTICIPANTS_UPDATE","CONNECTION_UPDATE","REMOVE_INSTANCE","LOGOUT_INSTANCE","LABELS_EDIT","LABELS_ASSOCIATION","CALL","TYPEBOT_START","TYPEBOT_CHANGE_STATUS"],i=()=>{a.setValue("events",u)},d=()=>{a.setValue("events",[])};return l.jsx(l.Fragment,{children:l.jsx(La,{...a,children:l.jsx("form",{onSubmit:a.handleSubmit(c),className:"w-full space-y-6",children:l.jsxs("div",{children:[l.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("sqs.title")}),l.jsx(Da,{className:"my-4"}),l.jsxs("div",{className:"mx-4 space-y-2 divide-y [&>*]:p-4",children:[l.jsx(ge,{name:"enabled",label:e("sqs.form.enabled.label"),className:"w-full justify-between",helper:e("sqs.form.enabled.description")}),l.jsxs("div",{className:"mb-4 flex justify-between",children:[l.jsx(z,{variant:"outline",type:"button",onClick:i,children:e("button.markAll")}),l.jsx(z,{variant:"outline",type:"button",onClick:d,children:e("button.unMarkAll")})]}),l.jsx($a,{control:a.control,name:"events",render:({field:p})=>l.jsxs(Ro,{className:"flex flex-col",children:[l.jsx(Er,{className:"my-2 text-lg",children:e("sqs.form.events.label")}),l.jsx(qs,{children:l.jsx("div",{className:"flex flex-col gap-2 space-y-1 divide-y",children:u.sort((f,g)=>f.localeCompare(g)).map(f=>l.jsxs("div",{className:"flex items-center justify-between gap-3 pt-3",children:[l.jsx(Er,{className:me("break-all",p.value.includes(f)?"text-foreground":"text-muted-foreground"),children:f}),l.jsx($c,{checked:p.value.includes(f),onCheckedChange:g=>{g?p.onChange([...p.value,f]):p.onChange(p.value.filter(h=>h!==f))}})]},f))})})]})})]}),l.jsx("div",{className:"mx-4 flex justify-end pt-6",children:l.jsx(z,{type:"submit",disabled:n,children:e(n?"sqs.button.saving":"sqs.button.save")})})]})})})})}const One=e=>["typebot","findTypebot",JSON.stringify(e)],Ine=async({instanceName:e,token:t})=>(await ie.get(`/typebot/find/${e}`,{headers:{apiKey:t}})).data,JI=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:One({instanceName:t}),queryFn:()=>Ine({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},Dne=e=>["typebot","fetchDefaultSettings",JSON.stringify(e)],Ane=async({instanceName:e,token:t})=>{const n=await ie.get(`/typebot/fetchSettings/${e}`,{headers:{apiKey:t}});return Array.isArray(n.data)?n.data[0]:n.data},Fne=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:Dne({instanceName:t}),queryFn:()=>Ane({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},Lne=async({instanceName:e,token:t,data:n})=>(await ie.post(`/typebot/create/${e}`,n,{headers:{apikey:t}})).data,$ne=async({instanceName:e,token:t,typebotId:n,data:r})=>(await ie.put(`/typebot/update/${n}/${e}`,r,{headers:{apikey:t}})).data,Bne=async({instanceName:e,typebotId:t})=>(await ie.delete(`/typebot/delete/${t}/${e}`)).data,zne=async({instanceName:e,token:t,data:n})=>(await ie.post(`/typebot/settings/${e}`,n,{headers:{apikey:t}})).data,Une=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await ie.post(`/typebot/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function om(){const e=Le(zne,{invalidateKeys:[["typebot","fetchDefaultSettings"]]}),t=Le(Une,{invalidateKeys:[["typebot","getTypebot"],["typebot","fetchSessions"]]}),n=Le(Bne,{invalidateKeys:[["typebot","getTypebot"],["typebot","findTypebot"],["typebot","fetchSessions"]]}),r=Le($ne,{invalidateKeys:[["typebot","getTypebot"],["typebot","findTypebot"],["typebot","fetchSessions"]]}),s=Le(Lne,{invalidateKeys:[["typebot","findTypebot"]]});return{setDefaultSettingsTypebot:e,changeStatusTypebot:t,deleteTypebot:n,updateTypebot:r,createTypebot:s}}const Vne=k.object({expire:k.coerce.number(),keywordFinish:k.string(),delayMessage:k.coerce.number(),unknownMessage:k.string(),listeningFromMe:k.boolean(),stopBotFromMe:k.boolean(),keepOpen:k.boolean(),debounceTime:k.coerce.number()});function Hne(){const{t:e}=Te(),{instance:t}=Ve(),[n,r]=v.useState(!1),{setDefaultSettingsTypebot:s}=om(),{data:o,refetch:a}=Fne({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token,enabled:n}),{data:c,refetch:u}=JI({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token,enabled:n}),i=zt({resolver:Ut(Vne),defaultValues:{expire:0,keywordFinish:e("typebot.form.examples.keywordFinish"),delayMessage:1e3,unknownMessage:e("typebot.form.examples.unknownMessage"),listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0}});v.useEffect(()=>{o&&i.reset({expire:(o==null?void 0:o.expire)??0,keywordFinish:o.keywordFinish,delayMessage:o.delayMessage??0,unknownMessage:o.unknownMessage,listeningFromMe:o.listeningFromMe,stopBotFromMe:o.stopBotFromMe,keepOpen:o.keepOpen,debounceTime:o.debounceTime??0})},[o]);const d=async f=>{var g,h,m;try{if(!t||!t.name)throw new Error("instance not found.");const x={expire:f.expire,keywordFinish:f.keywordFinish,delayMessage:f.delayMessage,unknownMessage:f.unknownMessage,listeningFromMe:f.listeningFromMe,stopBotFromMe:f.stopBotFromMe,keepOpen:f.keepOpen,debounceTime:f.debounceTime};await s({instanceName:t.name,token:t.token,data:x}),G.success(e("typebot.toast.defaultSettings.success"))}catch(x){console.error(e("typebot.toast.defaultSettings.error"),x),G.error(`Error: ${(m=(h=(g=x==null?void 0:x.response)==null?void 0:g.data)==null?void 0:h.response)==null?void 0:m.message}`)}};function p(){a(),u()}return l.jsxs(pt,{open:n,onOpenChange:r,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{variant:"secondary",size:"sm",children:[l.jsx(To,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:e("typebot.button.defaultSettings")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:p,children:[l.jsx(dt,{children:l.jsx(yt,{children:e("typebot.modal.defaultSettings.title")})}),l.jsx(Mn,{...i,children:l.jsxs("form",{className:"w-full space-y-6",onSubmit:i.handleSubmit(d),children:[l.jsx("div",{children:l.jsxs("div",{className:"space-y-4",children:[l.jsx(jt,{name:"typebotIdFallback",label:e("typebot.form.typebotIdFallback.label"),options:(c==null?void 0:c.filter(f=>!!f.id).map(f=>({label:f.typebot,value:f.description})))??[]}),l.jsx($,{name:"expire",label:e("typebot.form.expire.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"keywordFinish",label:e("typebot.form.keywordFinish.label"),children:l.jsx(F,{})}),l.jsx($,{name:"delayMessage",label:e("typebot.form.delayMessage.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"unknownMessage",label:e("typebot.form.unknownMessage.label"),children:l.jsx(F,{})}),l.jsx(ge,{name:"listeningFromMe",label:e("typebot.form.listeningFromMe.label"),reverse:!0}),l.jsx(ge,{name:"stopBotFromMe",label:e("typebot.form.stopBotFromMe.label"),reverse:!0}),l.jsx(ge,{name:"keepOpen",label:e("typebot.form.keepOpen.label"),reverse:!0}),l.jsx($,{name:"debounceTime",label:e("typebot.form.debounceTime.label"),children:l.jsx(F,{type:"number"})}),l.jsx(Ba,{name:"ignoreJids",label:e("typebot.form.ignoreJids.label"),placeholder:e("typebot.form.ignoreJids.placeholder")})]})}),l.jsx(_t,{children:l.jsx(z,{type:"submit",children:e("typebot.button.save")})})]})})]})]})}const Kne=e=>["typebot","fetchSessions",JSON.stringify(e)],qne=async({instanceName:e,typebotId:t,token:n})=>(await ie.get(`/typebot/fetchSessions/${t}/${e}`,{headers:{apiKey:n}})).data,Wne=e=>{const{instanceName:t,token:n,typebotId:r,...s}=e;return qe({...s,queryKey:Kne({instanceName:t}),queryFn:()=>qne({instanceName:t,token:n,typebotId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function QI({typebotId:e}){const{t}=Te(),{instance:n}=Ve(),[r,s]=v.useState([]),[o,a]=v.useState(!1),[c,u]=v.useState(""),{changeStatusTypebot:i}=om(),{data:d,refetch:p}=Wne({instanceName:n==null?void 0:n.name,token:n==null?void 0:n.token,typebotId:e});function f(){p()}const g=async(m,x)=>{var b,y,w;try{if(!n)return;await i({instanceName:n.name,token:n.token,remoteJid:m,status:x}),G.success(t("typebot.toast.success.status")),f()}catch(S){console.error("Error:",S),G.error(`Error : ${(w=(y=(b=S==null?void 0:S.response)==null?void 0:b.data)==null?void 0:y.response)==null?void 0:w.message}`)}},h=[{accessorKey:"remoteJid",header:()=>l.jsx("div",{className:"text-center",children:t("typebot.sessions.table.remoteJid")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>l.jsx("div",{className:"text-center",children:t("typebot.sessions.table.pushName")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("pushName")})},{accessorKey:"sessionId",header:()=>l.jsx("div",{className:"text-center",children:t("typebot.sessions.table.sessionId")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("sessionId")})},{accessorKey:"status",header:()=>l.jsx("div",{className:"text-center",children:t("typebot.sessions.table.status")}),cell:({row:m})=>l.jsx("div",{children:m.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:m})=>{const x=m.original;return l.jsxs(ms,{children:[l.jsx(vs,{asChild:!0,children:l.jsxs(z,{variant:"ghost",className:"h-8 w-8 p-0",children:[l.jsx("span",{className:"sr-only",children:t("typebot.sessions.table.actions.title")}),l.jsx(Ia,{className:"h-4 w-4"})]})}),l.jsxs(Mr,{align:"end",children:[l.jsx(No,{children:"Actions"}),l.jsx(Gs,{}),x.status!=="opened"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"opened"),children:[l.jsx(qi,{className:"mr-2 h-4 w-4"}),t("typebot.sessions.table.actions.open")]}),x.status!=="paused"&&x.status!=="closed"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"paused"),children:[l.jsx(Ki,{className:"mr-2 h-4 w-4"}),t("typebot.sessions.table.actions.pause")]}),x.status!=="closed"&&l.jsxs(tt,{onClick:()=>g(x.remoteJid,"closed"),children:[l.jsx(Ui,{className:"mr-2 h-4 w-4"}),t("typebot.sessions.table.actions.close")]}),l.jsxs(tt,{onClick:()=>g(x.remoteJid,"delete"),children:[l.jsx(Vi,{className:"mr-2 h-4 w-4"}),t("typebot.sessions.table.actions.delete")]})]})]})}}];return l.jsxs(pt,{open:o,onOpenChange:a,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{variant:"secondary",size:"sm",children:[l.jsx(Hi,{size:16,className:"mr-1"})," ",l.jsx("span",{className:"hidden sm:inline",children:t("typebot.sessions.label")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-w-[950px]",onCloseAutoFocus:f,children:[l.jsx(dt,{children:l.jsx(yt,{children:t("typebot.sessions.label")})}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between gap-6 p-5",children:[l.jsx(F,{placeholder:t("typebot.sessions.search"),value:c,onChange:m=>u(m.target.value)}),l.jsx(z,{variant:"outline",onClick:f,size:"icon",children:l.jsx(Wi,{size:16})})]}),l.jsx(Ka,{columns:h,data:d??[],onSortingChange:s,state:{sorting:r,globalFilter:c},onGlobalFilterChange:u,enableGlobalFilter:!0,noResultsMessage:t("typebot.sessions.table.none")})]})]})]})}const Gne=k.object({enabled:k.boolean(),description:k.string(),url:k.string(),typebot:k.string().optional(),triggerType:k.string(),triggerOperator:k.string().optional(),triggerValue:k.string().optional(),expire:k.coerce.number().optional(),keywordFinish:k.string().optional(),delayMessage:k.coerce.number().optional(),unknownMessage:k.string().optional(),listeningFromMe:k.boolean().optional(),stopBotFromMe:k.boolean().optional(),keepOpen:k.boolean().optional(),debounceTime:k.coerce.number().optional()});function ZI({initialData:e,onSubmit:t,handleDelete:n,typebotId:r,isModal:s=!1,isLoading:o=!1,openDeletionDialog:a=!1,setOpenDeletionDialog:c=()=>{}}){const{t:u}=Te(),i=zt({resolver:Ut(Gne),defaultValues:e||{enabled:!0,description:"",url:"",typebot:"",triggerType:"keyword",triggerOperator:"contains",triggerValue:"",expire:0,keywordFinish:"",delayMessage:0,unknownMessage:"",listeningFromMe:!1,stopBotFromMe:!1,keepOpen:!1,debounceTime:0}}),d=i.watch("triggerType");return l.jsx(Mn,{...i,children:l.jsxs("form",{onSubmit:i.handleSubmit(t),className:"w-full space-y-6",children:[l.jsxs("div",{className:"space-y-4",children:[l.jsx(ge,{name:"enabled",label:u("typebot.form.enabled.label"),reverse:!0}),l.jsx($,{name:"description",label:u("typebot.form.description.label"),required:!0,children:l.jsx(F,{})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("typebot.form.typebotSettings.label")}),l.jsx(ht,{})]}),l.jsx($,{name:"url",label:u("typebot.form.url.label"),required:!0,children:l.jsx(F,{})}),l.jsx($,{name:"typebot",label:u("typebot.form.typebot.label"),children:l.jsx(F,{})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("typebot.form.triggerSettings.label")}),l.jsx(ht,{})]}),l.jsx(jt,{name:"triggerType",label:u("typebot.form.triggerType.label"),options:[{label:u("typebot.form.triggerType.keyword"),value:"keyword"},{label:u("typebot.form.triggerType.all"),value:"all"},{label:u("typebot.form.triggerType.advanced"),value:"advanced"},{label:u("typebot.form.triggerType.none"),value:"none"}]}),d==="keyword"&&l.jsxs(l.Fragment,{children:[l.jsx(jt,{name:"triggerOperator",label:u("typebot.form.triggerOperator.label"),options:[{label:u("typebot.form.triggerOperator.contains"),value:"contains"},{label:u("typebot.form.triggerOperator.equals"),value:"equals"},{label:u("typebot.form.triggerOperator.startsWith"),value:"startsWith"},{label:u("typebot.form.triggerOperator.endsWith"),value:"endsWith"},{label:u("typebot.form.triggerOperator.regex"),value:"regex"}]}),l.jsx($,{name:"triggerValue",label:u("typebot.form.triggerValue.label"),children:l.jsx(F,{})})]}),d==="advanced"&&l.jsx($,{name:"triggerValue",label:u("typebot.form.triggerConditions.label"),children:l.jsx(F,{})}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("h3",{className:"my-4 text-lg font-medium",children:u("typebot.form.generalSettings.label")}),l.jsx(ht,{})]}),l.jsx($,{name:"expire",label:u("typebot.form.expire.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"keywordFinish",label:u("typebot.form.keywordFinish.label"),children:l.jsx(F,{})}),l.jsx($,{name:"delayMessage",label:u("typebot.form.delayMessage.label"),children:l.jsx(F,{type:"number"})}),l.jsx($,{name:"unknownMessage",label:u("typebot.form.unknownMessage.label"),children:l.jsx(F,{})}),l.jsx(ge,{name:"listeningFromMe",label:u("typebot.form.listeningFromMe.label"),reverse:!0}),l.jsx(ge,{name:"stopBotFromMe",label:u("typebot.form.stopBotFromMe.label"),reverse:!0}),l.jsx(ge,{name:"keepOpen",label:u("typebot.form.keepOpen.label"),reverse:!0}),l.jsx($,{name:"debounceTime",label:u("typebot.form.debounceTime.label"),children:l.jsx(F,{type:"number"})})]}),s&&l.jsx(_t,{children:l.jsx(z,{disabled:o,type:"submit",children:u(o?"typebot.button.saving":"typebot.button.save")})}),!s&&l.jsxs("div",{children:[l.jsx(QI,{typebotId:r}),l.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[l.jsxs(pt,{open:a,onOpenChange:c,children:[l.jsx(mt,{asChild:!0,children:l.jsx(z,{variant:"destructive",size:"sm",children:u("dify.button.delete")})}),l.jsx(ut,{children:l.jsxs(dt,{children:[l.jsx(yt,{children:u("modal.delete.title")}),l.jsx(_o,{children:u("modal.delete.messageSingle")}),l.jsxs(_t,{children:[l.jsx(z,{size:"sm",variant:"outline",onClick:()=>c(!1),children:u("button.cancel")}),l.jsx(z,{variant:"destructive",onClick:n,children:u("button.delete")})]})]})})]}),l.jsx(z,{disabled:o,type:"submit",children:u(o?"typebot.button.saving":"typebot.button.update")})]})]})]})})}function Jne({resetTable:e}){const{t}=Te(),{instance:n}=Ve(),{createTypebot:r}=om(),[s,o]=v.useState(!1),[a,c]=v.useState(!1),u=async i=>{var d,p,f;try{if(!n||!n.name)throw new Error("instance not found");o(!0);const g={enabled:i.enabled,description:i.description,url:i.url,typebot:i.typebot||"",triggerType:i.triggerType,triggerOperator:i.triggerOperator||"",triggerValue:i.triggerValue||"",expire:i.expire||0,keywordFinish:i.keywordFinish||"",delayMessage:i.delayMessage||0,unknownMessage:i.unknownMessage||"",listeningFromMe:i.listeningFromMe||!1,stopBotFromMe:i.stopBotFromMe||!1,keepOpen:i.keepOpen||!1,debounceTime:i.debounceTime||0};await r({instanceName:n.name,token:n.token,data:g}),G.success(t("typebot.toast.success.create")),c(!1),e()}catch(g){console.error("Error:",g),G.error(`Error: ${(f=(p=(d=g==null?void 0:g.response)==null?void 0:d.data)==null?void 0:p.response)==null?void 0:f.message}`)}finally{o(!1)}};return l.jsxs(pt,{open:a,onOpenChange:c,children:[l.jsx(mt,{asChild:!0,children:l.jsxs(z,{size:"sm",children:[l.jsx(Ws,{size:16,className:"mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:t("typebot.button.create")})]})}),l.jsxs(ut,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[l.jsx(dt,{children:l.jsx(yt,{children:t("typebot.form.title")})}),l.jsx(ZI,{onSubmit:u,isModal:!0,isLoading:s})]})]})}const Qne=e=>["typebot","getTypebot",JSON.stringify(e)],Zne=async({instanceName:e,token:t,typebotId:n})=>{const r=await ie.get(`/typebot/fetch/${n}/${e}`,{headers:{apiKey:t}});return Array.isArray(r.data)?r.data[0]:r.data},Yne=e=>{const{instanceName:t,token:n,typebotId:r,...s}=e;return qe({...s,queryKey:Qne({instanceName:t}),queryFn:()=>Zne({instanceName:t,token:n,typebotId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function Xne({typebotId:e,resetTable:t}){const{t:n}=Te(),{instance:r}=Ve(),s=an(),[o,a]=v.useState(!1),{deleteTypebot:c,updateTypebot:u}=om(),{data:i,isLoading:d}=Yne({instanceName:r==null?void 0:r.name,typebotId:e}),p=v.useMemo(()=>({enabled:!!(i!=null&&i.enabled),description:(i==null?void 0:i.description)??"",url:(i==null?void 0:i.url)??"",typebot:(i==null?void 0:i.typebot)??"",triggerType:(i==null?void 0:i.triggerType)??"",triggerOperator:(i==null?void 0:i.triggerOperator)??"",triggerValue:i==null?void 0:i.triggerValue,expire:(i==null?void 0:i.expire)??0,keywordFinish:i==null?void 0:i.keywordFinish,delayMessage:(i==null?void 0:i.delayMessage)??0,unknownMessage:i==null?void 0:i.unknownMessage,listeningFromMe:!!(i!=null&&i.listeningFromMe),stopBotFromMe:!!(i!=null&&i.stopBotFromMe),keepOpen:!!(i!=null&&i.keepOpen),debounceTime:(i==null?void 0:i.debounceTime)??0}),[i==null?void 0:i.debounceTime,i==null?void 0:i.delayMessage,i==null?void 0:i.description,i==null?void 0:i.enabled,i==null?void 0:i.expire,i==null?void 0:i.keepOpen,i==null?void 0:i.keywordFinish,i==null?void 0:i.listeningFromMe,i==null?void 0:i.stopBotFromMe,i==null?void 0:i.triggerOperator,i==null?void 0:i.triggerType,i==null?void 0:i.triggerValue,i==null?void 0:i.typebot,i==null?void 0:i.unknownMessage,i==null?void 0:i.url]),f=async h=>{var m,x,b;try{if(r&&r.name&&e){const y={enabled:h.enabled,description:h.description,url:h.url,typebot:h.typebot||"",triggerType:h.triggerType,triggerOperator:h.triggerOperator||"",triggerValue:h.triggerValue||"",expire:h.expire||0,keywordFinish:h.keywordFinish||"",delayMessage:h.delayMessage||1e3,unknownMessage:h.unknownMessage||"",listeningFromMe:h.listeningFromMe||!1,stopBotFromMe:h.stopBotFromMe||!1,keepOpen:h.keepOpen||!1,debounceTime:h.debounceTime||0};await u({instanceName:r.name,typebotId:e,data:y}),G.success(n("typebot.toast.success.update")),t(),s(`/manager/instance/${r.id}/typebot/${e}`)}else console.error("Token not found")}catch(y){console.error("Error:",y),G.error(`Error: ${(b=(x=(m=y==null?void 0:y.response)==null?void 0:m.data)==null?void 0:x.response)==null?void 0:b.message}`)}},g=async()=>{try{r&&r.name&&e?(await c({instanceName:r.name,typebotId:e}),G.success(n("typebot.toast.success.delete")),a(!1),t(),s(`/manager/instance/${r.id}/typebot`)):console.error("instance not found")}catch(h){console.error("Erro ao excluir dify:",h)}};return d?l.jsx(Tn,{}):l.jsx("div",{className:"m-4",children:l.jsx(ZI,{initialData:p,onSubmit:f,typebotId:e,handleDelete:g,isModal:!1,isLoading:d,openDeletionDialog:o,setOpenDeletionDialog:a})})}function pE(){const{t:e}=Te(),t=Va("(min-width: 768px)"),{instance:n}=Ve(),{typebotId:r}=gs(),{data:s,isLoading:o,refetch:a}=JI({instanceName:n==null?void 0:n.name,token:n==null?void 0:n.token}),c=an(),u=d=>{n&&c(`/manager/instance/${n.id}/typebot/${d}`)},i=()=>{a()};return l.jsxs("main",{className:"pt-5",children:[l.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[l.jsx("h3",{className:"text-lg font-medium",children:e("typebot.title")}),l.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[l.jsx(QI,{}),l.jsx(Hne,{}),l.jsx(Jne,{resetTable:i})]})]}),l.jsx(ht,{className:"my-4"}),l.jsxs(za,{direction:t?"horizontal":"vertical",children:[l.jsx(Bn,{defaultSize:35,className:"pr-4",children:l.jsx("div",{className:"flex flex-col gap-3",children:o?l.jsx(Tn,{}):l.jsx(l.Fragment,{children:s&&s.length>0&&Array.isArray(s)?s.map(d=>l.jsx(z,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>u(`${d.id}`),variant:r===d.id?"secondary":"outline",children:d.description?l.jsxs(l.Fragment,{children:[l.jsx("h4",{className:"text-base",children:d.description}),l.jsxs("p",{className:"text-wrap text-sm font-normal text-muted-foreground",children:[d.url," - ",d.typebot]})]}):l.jsxs(l.Fragment,{children:[l.jsx("h4",{className:"text-base",children:d.url}),l.jsx("p",{className:"text-wrap text-sm font-normal text-muted-foreground",children:d.typebot})]})},d.id)):l.jsx(z,{variant:"link",children:e("typebot.table.none")})})})}),r&&l.jsxs(l.Fragment,{children:[l.jsx(Ua,{withHandle:!0,className:"border border-black"}),l.jsx(Bn,{children:l.jsx(Xne,{typebotId:r,resetTable:i})})]})]})]})}const ere=e=>["webhook","fetchWebhook",JSON.stringify(e)],tre=async({instanceName:e,token:t})=>(await ie.get(`/webhook/find/${e}`,{headers:{apiKey:t}})).data,nre=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:ere({instanceName:t,token:n}),queryFn:()=>tre({instanceName:t,token:n}),enabled:!!t})},rre=async({instanceName:e,token:t,data:n})=>(await ie.post(`/webhook/set/${e}`,{webhook:n},{headers:{apikey:t}})).data;function sre(){return{createWebhook:Le(rre,{invalidateKeys:[["webhook","fetchWebhook"]]})}}const ore=k.object({enabled:k.boolean(),url:k.string().url("Invalid URL format"),events:k.array(k.string()),base64:k.boolean(),byEvents:k.boolean()});function are(){const{t:e}=Te(),{instance:t}=Ve(),[n,r]=v.useState(!1),{createWebhook:s}=sre(),{data:o}=nre({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token}),a=zt({resolver:Ut(ore),defaultValues:{enabled:!1,url:"",events:[],base64:!1,byEvents:!1}});v.useEffect(()=>{o&&a.reset({enabled:o.enabled,url:o.url,events:o.events,base64:o.webhookBase64,byEvents:o.webhookByEvents})},[o]);const c=async p=>{var f,g,h;if(t){r(!0);try{const m={enabled:p.enabled,url:p.url,events:p.events,base64:p.base64,byEvents:p.byEvents};await s({instanceName:t.name,token:t.token,data:m}),G.success(e("webhook.toast.success"))}catch(m){console.error(e("webhook.toast.error"),m),G.error(`Error: ${(h=(g=(f=m==null?void 0:m.response)==null?void 0:f.data)==null?void 0:g.response)==null?void 0:h.message}`)}finally{r(!1)}}},u=["APPLICATION_STARTUP","QRCODE_UPDATED","MESSAGES_SET","MESSAGES_UPSERT","MESSAGES_UPDATE","MESSAGES_DELETE","SEND_MESSAGE","CONTACTS_SET","CONTACTS_UPSERT","CONTACTS_UPDATE","PRESENCE_UPDATE","CHATS_SET","CHATS_UPSERT","CHATS_UPDATE","CHATS_DELETE","GROUPS_UPSERT","GROUP_UPDATE","GROUP_PARTICIPANTS_UPDATE","CONNECTION_UPDATE","REMOVE_INSTANCE","LOGOUT_INSTANCE","LABELS_EDIT","LABELS_ASSOCIATION","CALL","TYPEBOT_START","TYPEBOT_CHANGE_STATUS"],i=()=>{a.setValue("events",u)},d=()=>{a.setValue("events",[])};return l.jsx(l.Fragment,{children:l.jsx(La,{...a,children:l.jsx("form",{onSubmit:a.handleSubmit(c),className:"w-full space-y-6",children:l.jsxs("div",{children:[l.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("webhook.title")}),l.jsx(Da,{className:"my-4"}),l.jsxs("div",{className:"mx-4 space-y-2 divide-y [&>*]:p-4",children:[l.jsx(ge,{name:"enabled",label:e("webhook.form.enabled.label"),className:"w-full justify-between",helper:e("webhook.form.enabled.description")}),l.jsx($,{name:"url",label:"URL",children:l.jsx(F,{})}),l.jsx(ge,{name:"byEvents",label:e("webhook.form.byEvents.label"),className:"w-full justify-between",helper:e("webhook.form.byEvents.description")}),l.jsx(ge,{name:"base64",label:e("webhook.form.base64.label"),className:"w-full justify-between",helper:e("webhook.form.base64.description")}),l.jsxs("div",{className:"mb-4 flex justify-between",children:[l.jsx(z,{variant:"outline",type:"button",onClick:i,children:e("button.markAll")}),l.jsx(z,{variant:"outline",type:"button",onClick:d,children:e("button.unMarkAll")})]}),l.jsx($a,{control:a.control,name:"events",render:({field:p})=>l.jsxs(Ro,{className:"flex flex-col",children:[l.jsx(Er,{className:"my-2 text-lg",children:e("webhook.form.events.label")}),l.jsx(qs,{children:l.jsx("div",{className:"flex flex-col gap-2 space-y-1 divide-y",children:u.sort((f,g)=>f.localeCompare(g)).map(f=>l.jsxs("div",{className:"flex items-center justify-between gap-3 pt-3",children:[l.jsx(Er,{className:me("break-all",p.value.includes(f)?"text-foreground":"text-muted-foreground"),children:f}),l.jsx($c,{checked:p.value.includes(f),onCheckedChange:g=>{g?p.onChange([...p.value,f]):p.onChange(p.value.filter(h=>h!==f))}})]},f))})})]})})]}),l.jsx("div",{className:"mx-4 flex justify-end pt-6",children:l.jsx(z,{type:"submit",disabled:n,children:e(n?"webhook.button.saving":"webhook.button.save")})})]})})})})}const ire=e=>["websocket","fetchWebsocket",JSON.stringify(e)],lre=async({instanceName:e,token:t})=>(await ie.get(`/websocket/find/${e}`,{headers:{apiKey:t}})).data,cre=e=>{const{instanceName:t,token:n,...r}=e;return qe({...r,queryKey:ire({instanceName:t,token:n}),queryFn:()=>lre({instanceName:t,token:n}),enabled:!!t})},ure=async({instanceName:e,token:t,data:n})=>(await ie.post(`/websocket/set/${e}`,{websocket:n},{headers:{apikey:t}})).data;function dre(){return{createWebsocket:Le(ure,{invalidateKeys:[["websocket","fetchWebsocket"]]})}}const fre=k.object({enabled:k.boolean(),events:k.array(k.string())});function pre(){const{t:e}=Te(),{instance:t}=Ve(),[n,r]=v.useState(!1),{createWebsocket:s}=dre(),{data:o}=cre({instanceName:t==null?void 0:t.name,token:t==null?void 0:t.token}),a=zt({resolver:Ut(fre),defaultValues:{enabled:!1,events:[]}});v.useEffect(()=>{o&&a.reset({enabled:o.enabled,events:o.events})},[o]);const c=async p=>{var f,g,h;if(t){r(!0);try{const m={enabled:p.enabled,events:p.events};await s({instanceName:t.name,token:t.token,data:m}),G.success(e("websocket.toast.success"))}catch(m){console.error(e("websocket.toast.error"),m),G.error(`Error: ${(h=(g=(f=m==null?void 0:m.response)==null?void 0:f.data)==null?void 0:g.response)==null?void 0:h.message}`)}finally{r(!1)}}},u=["APPLICATION_STARTUP","QRCODE_UPDATED","MESSAGES_SET","MESSAGES_UPSERT","MESSAGES_UPDATE","MESSAGES_DELETE","SEND_MESSAGE","CONTACTS_SET","CONTACTS_UPSERT","CONTACTS_UPDATE","PRESENCE_UPDATE","CHATS_SET","CHATS_UPSERT","CHATS_UPDATE","CHATS_DELETE","GROUPS_UPSERT","GROUP_UPDATE","GROUP_PARTICIPANTS_UPDATE","CONNECTION_UPDATE","REMOVE_INSTANCE","LOGOUT_INSTANCE","LABELS_EDIT","LABELS_ASSOCIATION","CALL","TYPEBOT_START","TYPEBOT_CHANGE_STATUS"],i=()=>{a.setValue("events",u)},d=()=>{a.setValue("events",[])};return l.jsx(l.Fragment,{children:l.jsx(La,{...a,children:l.jsx("form",{onSubmit:a.handleSubmit(c),className:"w-full space-y-6",children:l.jsxs("div",{children:[l.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("websocket.title")}),l.jsx(Da,{className:"my-4"}),l.jsxs("div",{className:"mx-4 space-y-2 divide-y [&>*]:p-4",children:[l.jsx(ge,{name:"enabled",label:e("websocket.form.enabled.label"),className:"w-full justify-between",helper:e("websocket.form.enabled.description")}),l.jsxs("div",{className:"mb-4 flex justify-between",children:[l.jsx(z,{variant:"outline",type:"button",onClick:i,children:e("button.markAll")}),l.jsx(z,{variant:"outline",type:"button",onClick:d,children:e("button.unMarkAll")})]}),l.jsx($a,{control:a.control,name:"events",render:({field:p})=>l.jsxs(Ro,{className:"flex flex-col",children:[l.jsx(Er,{className:"my-2 text-lg",children:e("websocket.form.events.label")}),l.jsx(qs,{children:l.jsx("div",{className:"flex flex-col gap-2 space-y-1 divide-y",children:u.sort((f,g)=>f.localeCompare(g)).map(f=>l.jsxs("div",{className:"flex items-center justify-between gap-3 pt-3",children:[l.jsx(Er,{className:me("break-all",p.value.includes(f)?"text-foreground":"text-muted-foreground"),children:f}),l.jsx($c,{checked:p.value.includes(f),onCheckedChange:g=>{g?p.onChange([...p.value,f]):p.onChange(p.value.filter(h=>h!==f))}})]},f))})})]})})]}),l.jsx("div",{className:"mx-4 flex justify-end pt-6",children:l.jsx(z,{type:"submit",disabled:n,children:e(n?"websocket.button.saving":"websocket.button.save")})})]})})})})}const gre=async({url:e,token:t})=>{try{const{data:n}=await Bt.post(`${e}/verify-creds`,{},{headers:{apikey:t}});return AT({facebookAppId:n.facebookAppId,facebookConfigId:n.facebookConfigId,facebookUserToken:n.facebookUserToken}),n}catch{return null}},hre=k.object({serverUrl:k.string({required_error:"serverUrl is required"}).url("URL inválida"),apiKey:k.string({required_error:"ApiKey is required"})});function mre(){const{t:e}=Te(),t=an(),n=zt({resolver:Ut(hre),defaultValues:{serverUrl:window.location.protocol+"//"+window.location.host,apiKey:""}}),r=async s=>{const o=await lM({url:s.serverUrl});if(!o||!o.version){FT(),n.setError("serverUrl",{type:"manual",message:e("login.message.invalidServer")});return}if(!await gre({token:s.apiKey,url:s.serverUrl})){n.setError("apiKey",{type:"manual",message:e("login.message.invalidCredentials")});return}AT({version:o.version,clientName:o.clientName,url:s.serverUrl,token:s.apiKey}),t("/manager/")};return l.jsxs("div",{className:"flex min-h-screen flex-col",children:[l.jsx("div",{className:"flex items-center justify-center pt-2",children:l.jsx("img",{className:"h-10",src:"/assets/images/evolution-logo.png",alt:"logo"})}),l.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:l.jsxs(oi,{className:"b-none w-[350px] shadow-none",children:[l.jsxs(ai,{children:[l.jsx(Iu,{className:"text-center",children:e("login.title")}),l.jsx(eP,{className:"text-center",children:e("login.description")})]}),l.jsx(La,{...n,children:l.jsxs("form",{onSubmit:n.handleSubmit(r),children:[l.jsx(ii,{children:l.jsxs("div",{className:"grid w-full items-center gap-4",children:[l.jsx($,{required:!0,name:"serverUrl",label:e("login.form.serverUrl"),children:l.jsx(F,{})}),l.jsx($,{required:!0,name:"apiKey",label:e("login.form.apiKey"),children:l.jsx(F,{type:"password"})})]})}),l.jsx(Mh,{className:"flex justify-center",children:l.jsx(z,{className:"w-full",type:"submit",children:e("login.button.login")})})]})})]})}),l.jsx(zx,{})]})}const vre=HL([{path:"/manager/login",element:l.jsx(x$,{children:l.jsx(mre,{})})},{path:"/manager/",element:l.jsx(Rt,{children:l.jsx(IV,{children:l.jsx(aZ,{})})})},{path:"/manager/instance/:instanceId/dashboard",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(IY,{})})})},{path:"/manager/instance/:instanceId/chat",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(tE,{})})})},{path:"/manager/instance/:instanceId/chat/:remoteJid",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(tE,{})})})},{path:"/manager/instance/:instanceId/settings",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(kne,{})})})},{path:"/manager/instance/:instanceId/openai",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(fE,{})})})},{path:"/manager/instance/:instanceId/openai/:botId",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(fE,{})})})},{path:"/manager/instance/:instanceId/webhook",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(are,{})})})},{path:"/manager/instance/:instanceId/websocket",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(pre,{})})})},{path:"/manager/instance/:instanceId/rabbitmq",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(xne,{})})})},{path:"/manager/instance/:instanceId/sqs",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(Rne,{})})})},{path:"/manager/instance/:instanceId/chatwoot",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(nY,{})})})},{path:"/manager/instance/:instanceId/typebot",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(pE,{})})})},{path:"/manager/instance/:instanceId/typebot/:typebotId",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(pE,{})})})},{path:"/manager/instance/:instanceId/dify",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(iE,{})})})},{path:"/manager/instance/:instanceId/dify/:difyId",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(iE,{})})})},{path:"/manager/instance/:instanceId/n8n",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(dE,{})})})},{path:"/manager/instance/:instanceId/n8n/:n8nId",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(dE,{})})})},{path:"/manager/instance/:instanceId/evoai",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(lE,{})})})},{path:"/manager/instance/:instanceId/evoai/:evoaiId",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(lE,{})})})},{path:"/manager/instance/:instanceId/evolutionBot",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(cE,{})})})},{path:"/manager/instance/:instanceId/evolutionBot/:evolutionBotId",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(cE,{})})})},{path:"/manager/instance/:instanceId/flowise",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(uE,{})})})},{path:"/manager/instance/:instanceId/flowise/:flowiseId",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(uE,{})})})},{path:"/manager/instance/:instanceId/proxy",element:l.jsx(Rt,{children:l.jsx(Lt,{children:l.jsx(pne,{})})})}]),yre={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class _g{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||yre,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r{this.observers[r]||(this.observers[r]=new Map);const s=this.observers[r].get(n)||0;this.observers[r].set(n,s+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s{let[c,u]=a;for(let i=0;i{let[c,u]=a;for(let i=0;i{let e,t;const n=new Promise((r,s)=>{e=r,t=s});return n.resolve=e,n.reject=t,n},gE=e=>e==null?"":""+e,bre=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},xre=/###/g,hE=e=>e&&e.indexOf("###")>-1?e.replace(xre,"."):e,mE=e=>!e||typeof e=="string",Bu=(e,t,n)=>{const r=typeof t!="string"?t:t.split(".");let s=0;for(;s{const{obj:r,k:s}=Bu(e,t,Object);if(r!==void 0||t.length===1){r[s]=n;return}let o=t[t.length-1],a=t.slice(0,t.length-1),c=Bu(e,a,Object);for(;c.obj===void 0&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),c=Bu(e,a,Object),c&&c.obj&&typeof c.obj[`${c.k}.${o}`]<"u"&&(c.obj=void 0);c.obj[`${c.k}.${o}`]=n},wre=(e,t,n,r)=>{const{obj:s,k:o}=Bu(e,t,Object);s[o]=s[o]||[],s[o].push(n)},Pg=(e,t)=>{const{obj:n,k:r}=Bu(e,t);if(n)return n[r]},Sre=(e,t,n)=>{const r=Pg(e,n);return r!==void 0?r:Pg(t,n)},YI=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):YI(e[r],t[r],n):e[r]=t[r]);return e},dl=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Cre={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const Ere=e=>typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>Cre[t]):e;class kre{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const jre=[" ",",","?","!",";"],Tre=new kre(20),Mre=(e,t,n)=>{t=t||"",n=n||"";const r=jre.filter(a=>t.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const s=Tre.getRegExp(`(${r.map(a=>a==="?"?"\\?":a).join("|")})`);let o=!s.test(e);if(!o){const a=e.indexOf(n);a>0&&!s.test(e.substring(0,a))&&(o=!0)}return o},Pb=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let s=e;for(let o=0;o-1&&ue&&e.indexOf("_")>0?e.replace("_","-"):e;class yE extends am{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,a=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let c;t.indexOf(".")>-1?c=t.split("."):(c=[t,n],r&&(Array.isArray(r)?c.push(...r):typeof r=="string"&&o?c.push(...r.split(o)):c.push(r)));const u=Pg(this.data,c);return!u&&!n&&!r&&t.indexOf(".")>-1&&(t=c[0],n=c[1],r=c.slice(2).join(".")),u||!a||typeof r!="string"?u:Pb(this.data&&this.data[t]&&this.data[t][n],r,o)}addResource(t,n,r,s){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let c=[t,n];r&&(c=c.concat(a?r.split(a):r)),t.indexOf(".")>-1&&(c=t.split("."),s=n,n=c[1]),this.addNamespaces(n),vE(this.data,c,s),o.silent||this.emit("added",t,n,r,s)}addResources(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const o in r)(typeof r[o]=="string"||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});s.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,s,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},c=[t,n];t.indexOf(".")>-1&&(c=t.split("."),s=r,r=n,n=c[1]),this.addNamespaces(n);let u=Pg(this.data,c)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?YI(u,r,o):u={...u,...r},vE(this.data,c,u),a.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,n)}:this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(s=>n[s]&&Object.keys(n[s]).length>0)}toJSON(){return this.data}}var XI={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,s){return e.forEach(o=>{this.processors[o]&&(t=this.processors[o].process(t,n,r,s))}),t}};const bE={};class Og extends am{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),bre(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Ls.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const r=this.resolve(t,n);return r&&r.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const a=r&&t.indexOf(r)>-1,c=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!Mre(t,r,s);if(a&&!c){const u=t.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:t,namespaces:o};const i=t.split(r);(r!==s||r===s&&this.options.ns.indexOf(i[0])>-1)&&(o=i.shift()),t=i.join(s)}return typeof o=="string"&&(o=[o]),{key:t,namespaces:o}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const s=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:a,namespaces:c}=this.extractFromKey(t[t.length-1],n),u=c[c.length-1],i=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(i&&i.toLowerCase()==="cimode"){if(d){const S=n.nsSeparator||this.options.nsSeparator;return s?{res:`${u}${S}${a}`,usedKey:a,exactUsedKey:a,usedLng:i,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:`${u}${S}${a}`}return s?{res:a,usedKey:a,exactUsedKey:a,usedLng:i,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:a}const p=this.resolve(t,n);let f=p&&p.res;const g=p&&p.usedKey||a,h=p&&p.exactUsedKey||a,m=Object.prototype.toString.apply(f),x=["[object Number]","[object Function]","[object RegExp]"],b=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject;if(y&&f&&(typeof f!="string"&&typeof f!="boolean"&&typeof f!="number")&&x.indexOf(m)<0&&!(typeof b=="string"&&Array.isArray(f))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const S=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,f,{...n,ns:c}):`key '${a} (${this.language})' returned an object instead of string.`;return s?(p.res=S,p.usedParams=this.getUsedParamsDetails(n),p):S}if(o){const S=Array.isArray(f),E=S?[]:{},C=S?h:g;for(const T in f)if(Object.prototype.hasOwnProperty.call(f,T)){const j=`${C}${o}${T}`;E[T]=this.translate(j,{...n,joinArrays:!1,ns:c}),E[T]===j&&(E[T]=f[T])}f=E}}else if(y&&typeof b=="string"&&Array.isArray(f))f=f.join(b),f&&(f=this.extendTranslation(f,t,n,r));else{let S=!1,E=!1;const C=n.count!==void 0&&typeof n.count!="string",T=Og.hasDefaultValue(n),j=C?this.pluralResolver.getSuffix(i,n.count,n):"",_=n.ordinal&&C?this.pluralResolver.getSuffix(i,n.count,{ordinal:!1}):"",O=C&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),K=O&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${j}`]||n[`defaultValue${_}`]||n.defaultValue;!this.isValidLookup(f)&&T&&(S=!0,f=K),this.isValidLookup(f)||(E=!0,f=a);const Y=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&E?void 0:f,q=T&&K!==f&&this.options.updateMissing;if(E||S||q){if(this.logger.log(q?"updateKey":"missingKey",i,u,a,q?K:f),o){const L=this.resolve(a,{...n,keySeparator:!1});L&&L.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let Z=[];const ee=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ee&&ee[0])for(let L=0;L{const fe=T&&X!==f?X:Y;this.options.missingKeyHandler?this.options.missingKeyHandler(L,u,A,fe,q,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(L,u,A,fe,q,n),this.emit("missingKey",L,u,A,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&C?Z.forEach(L=>{const A=this.pluralResolver.getSuffixes(L,n);O&&n[`defaultValue${this.options.pluralSeparator}zero`]&&A.indexOf(`${this.options.pluralSeparator}zero`)<0&&A.push(`${this.options.pluralSeparator}zero`),A.forEach(X=>{J([L],a+X,n[`defaultValue${X}`]||K)})}):J(Z,a,K))}f=this.extendTranslation(f,t,n,p,r),E&&f===a&&this.options.appendNamespaceToMissingKey&&(f=`${u}:${a}`),(E||S)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}:${a}`:a,S?f:void 0):f=this.options.parseMissingKeyHandler(f))}return s?(p.res=f,p.usedParams=this.getUsedParamsDetails(n),p):f}extendTranslation(t,n,r,s,o){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const i=typeof t=="string"&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let d;if(i){const f=t.match(this.interpolator.nestingRegexp);d=f&&f.length}let p=r.replace&&typeof r.replace!="string"?r.replace:r;if(this.options.interpolation.defaultVariables&&(p={...this.options.interpolation.defaultVariables,...p}),t=this.interpolator.interpolate(t,p,r.lng||this.language||s.usedLng,r),i){const f=t.match(this.interpolator.nestingRegexp),g=f&&f.length;d1&&arguments[1]!==void 0?arguments[1]:{},r,s,o,a,c;return typeof t=="string"&&(t=[t]),t.forEach(u=>{if(this.isValidLookup(r))return;const i=this.extractFromKey(u,n),d=i.key;s=d;let p=i.namespaces;this.options.fallbackNS&&(p=p.concat(this.options.fallbackNS));const f=n.count!==void 0&&typeof n.count!="string",g=f&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),h=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",m=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);p.forEach(x=>{this.isValidLookup(r)||(c=x,!bE[`${m[0]}-${x}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(c)&&(bE[`${m[0]}-${x}`]=!0,this.logger.warn(`key "${s}" for languages "${m.join(", ")}" won't get resolved as namespace "${c}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),m.forEach(b=>{if(this.isValidLookup(r))return;a=b;const y=[d];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(y,d,b,x,n);else{let S;f&&(S=this.pluralResolver.getSuffix(b,n.count,n));const E=`${this.options.pluralSeparator}zero`,C=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(y.push(d+S),n.ordinal&&S.indexOf(C)===0&&y.push(d+S.replace(C,this.options.pluralSeparator)),g&&y.push(d+E)),h){const T=`${d}${this.options.contextSeparator}${n.context}`;y.push(T),f&&(y.push(T+S),n.ordinal&&S.indexOf(C)===0&&y.push(T+S.replace(C,this.options.pluralSeparator)),g&&y.push(T+E))}}let w;for(;w=y.pop();)this.isValidLookup(r)||(o=w,r=this.getResource(b,x,w,n))}))})}),{res:r,usedKey:s,exactUsedKey:o,usedLng:a,usedNS:c}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,s):this.resourceStore.getResource(t,n,r,s)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&typeof t.replace!="string";let s=r?t.replace:t;if(r&&typeof t.count<"u"&&(s.count=t.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!r){s={...s};for(const o of n)delete s[o]}return s}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}const Tv=e=>e.charAt(0).toUpperCase()+e.slice(1);class xE{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ls.create("languageUtils")}getScriptPartFromCode(t){if(t=Rg(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=Rg(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=t.split("-");return this.options.lowerCaseLng?r=r.map(s=>s.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=Tv(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=Tv(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=Tv(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const s=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(s))&&(n=s)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const s=this.getLanguagePartFromCode(r);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(o=>{if(o===s)return o;if(!(o.indexOf("-")<0&&s.indexOf("-")<0)&&(o.indexOf("-")>0&&s.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===s||o.indexOf(s)===0&&s.length>1))return o})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),typeof t=="string"&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),s=[],o=a=>{a&&(this.isSupportedCode(a)?s.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return typeof t=="string"&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):typeof t=="string"&&o(this.formatLanguageCode(t)),r.forEach(a=>{s.indexOf(a)<0&&o(this.formatLanguageCode(a))}),s}}let Nre=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],_re={1:e=>+(e>1),2:e=>+(e!=1),3:e=>0,4:e=>e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,5:e=>e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5,6:e=>e==1?0:e>=2&&e<=4?1:2,7:e=>e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2,8:e=>e==1?0:e==2?1:e!=8&&e!=11?2:3,9:e=>+(e>=2),10:e=>e==1?0:e==2?1:e<7?2:e<11?3:4,11:e=>e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3,12:e=>+(e%10!=1||e%100==11),13:e=>+(e!==0),14:e=>e==1?0:e==2?1:e==3?2:3,15:e=>e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2,16:e=>e%10==1&&e%100!=11?0:e!==0?1:2,17:e=>e==1||e%10==1&&e%100!=11?0:1,18:e=>e==0?0:e==1?1:2,19:e=>e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3,20:e=>e==1?0:e==0||e%100>0&&e%100<20?1:2,21:e=>e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0,22:e=>e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3};const Pre=["v1","v2","v3"],Rre=["v4"],wE={zero:0,one:1,two:2,few:3,many:4,other:5},Ore=()=>{const e={};return Nre.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:_re[t.fc]}})}),e};class Ire{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=Ls.create("pluralResolver"),(!this.options.compatibilityJSON||Rre.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Ore(),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{const r=Rg(t==="dev"?"en":t),s=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:s});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];const a=new Intl.PluralRules(r,{type:s});return this.pluralRulesCache[o]=a,a}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(s=>`${n}${s}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((s,o)=>wE[s]-wE[o]).map(s=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s}`):r.numbers.map(s=>this.getSuffix(t,s,n)):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=this.getRule(t,r);return s?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${s.select(n)}`:this.getSuffixRetroCompatible(s,n):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,n){const r=t.noAbs?t.plurals(n):t.plurals(Math.abs(n));let s=t.numbers[r];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));const o=()=>this.options.prepend&&s.toString()?this.options.prepend+s.toString():s.toString();return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?`_plural_${s.toString()}`:o():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?o():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!Pre.includes(this.options.compatibilityJSON)}}const SE=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=Sre(e,t,n);return!o&&s&&typeof n=="string"&&(o=Pb(e,n,r),o===void 0&&(o=Pb(t,n,r))),o},Mv=e=>e.replace(/\$/g,"$$$$");class Dre{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Ls.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:s,prefix:o,prefixEscaped:a,suffix:c,suffixEscaped:u,formatSeparator:i,unescapeSuffix:d,unescapePrefix:p,nestingPrefix:f,nestingPrefixEscaped:g,nestingSuffix:h,nestingSuffixEscaped:m,nestingOptionsSeparator:x,maxReplaces:b,alwaysFormat:y}=t.interpolation;this.escape=n!==void 0?n:Ere,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=o?dl(o):a||"{{",this.suffix=c?dl(c):u||"}}",this.formatSeparator=i||",",this.unescapePrefix=d?"":p||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=f?dl(f):g||dl("$t("),this.nestingSuffix=h?dl(h):m||dl(")"),this.nestingOptionsSeparator=x||",",this.maxReplaces=b||1e3,this.alwaysFormat=y!==void 0?y:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n&&n.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,s){let o,a,c;const u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},i=g=>{if(g.indexOf(this.formatSeparator)<0){const b=SE(n,u,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(b,void 0,r,{...s,...n,interpolationkey:g}):b}const h=g.split(this.formatSeparator),m=h.shift().trim(),x=h.join(this.formatSeparator).trim();return this.format(SE(n,u,m,this.options.keySeparator,this.options.ignoreJSONStructure),x,r,{...s,...n,interpolationkey:m})};this.resetRegExp();const d=s&&s.missingInterpolationHandler||this.options.missingInterpolationHandler,p=s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>Mv(g)},{regex:this.regexp,safeValue:g=>this.escapeValue?Mv(this.escape(g)):Mv(g)}].forEach(g=>{for(c=0;o=g.regex.exec(t);){const h=o[1].trim();if(a=i(h),a===void 0)if(typeof d=="function"){const x=d(t,o,s);a=typeof x=="string"?x:""}else if(s&&Object.prototype.hasOwnProperty.call(s,h))a="";else if(p){a=o[0];continue}else this.logger.warn(`missed to pass in variable ${h} for interpolating ${t}`),a="";else typeof a!="string"&&!this.useRawValueToEscape&&(a=gE(a));const m=g.safeValue(a);if(t=t.replace(o[0],m),p?(g.regex.lastIndex+=a.length,g.regex.lastIndex-=o[0].length):g.regex.lastIndex=0,c++,c>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,o,a;const c=(u,i)=>{const d=this.nestingOptionsSeparator;if(u.indexOf(d)<0)return u;const p=u.split(new RegExp(`${d}[ ]*{`));let f=`{${p[1]}`;u=p[0],f=this.interpolate(f,a);const g=f.match(/'/g),h=f.match(/"/g);(g&&g.length%2===0&&!h||h.length%2!==0)&&(f=f.replace(/'/g,'"'));try{a=JSON.parse(f),i&&(a={...i,...a})}catch(m){return this.logger.warn(`failed parsing options string in nesting for key ${u}`,m),`${u}${d}${f}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,u};for(;s=this.nestingRegexp.exec(t);){let u=[];a={...r},a=a.replace&&typeof a.replace!="string"?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let i=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const d=s[1].split(this.formatSeparator).map(p=>p.trim());s[1]=d.shift(),u=d,i=!0}if(o=n(c.call(this,s[1].trim(),a),a),o&&s[0]===t&&typeof o!="string")return o;typeof o!="string"&&(o=gE(o)),o||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${t}`),o=""),i&&(o=u.reduce((d,p)=>this.format(d,p,r.lng,{...r,interpolationkey:s[1].trim()}),o.trim())),t=t.replace(s[0],o),this.regexp.lastIndex=0}return t}}const Are=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const s=r[1].substring(0,r[1].length-1);t==="currency"&&s.indexOf(":")<0?n.currency||(n.currency=s.trim()):t==="relativetime"&&s.indexOf(":")<0?n.range||(n.range=s.trim()):s.split(";").forEach(a=>{if(a){const[c,...u]=a.split(":"),i=u.join(":").trim().replace(/^'+|'+$/g,""),d=c.trim();n[d]||(n[d]=i),i==="false"&&(n[d]=!1),i==="true"&&(n[d]=!0),isNaN(i)||(n[d]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},fl=e=>{const t={};return(n,r,s)=>{let o=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(o={...o,[s.interpolationkey]:void 0});const a=r+JSON.stringify(o);let c=t[a];return c||(c=e(Rg(r),s),t[a]=c),c(n)}};class Fre{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Ls.create("formatter"),this.options=t,this.formats={number:fl((n,r)=>{const s=new Intl.NumberFormat(n,{...r});return o=>s.format(o)}),currency:fl((n,r)=>{const s=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>s.format(o)}),datetime:fl((n,r)=>{const s=new Intl.DateTimeFormat(n,{...r});return o=>s.format(o)}),relativetime:fl((n,r)=>{const s=new Intl.RelativeTimeFormat(n,{...r});return o=>s.format(o,r.range||"day")}),list:fl((n,r)=>{const s=new Intl.ListFormat(n,{...r});return o=>s.format(o)})},this.init(t)}init(t){const r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=fl(n)}format(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(c=>c.indexOf(")")>-1)){const c=o.findIndex(u=>u.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,c)].join(this.formatSeparator)}return o.reduce((c,u)=>{const{formatName:i,formatOptions:d}=Are(u);if(this.formats[i]){let p=c;try{const f=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},g=f.locale||f.lng||s.locale||s.lng||r;p=this.formats[i](c,g,{...d,...s,...f})}catch(f){this.logger.warn(f)}return p}else this.logger.warn(`there was no format function for ${i}`);return c},t)}}const Lre=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class $re extends am{constructor(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=s,this.logger=Ls.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,s.backend,s)}queueLoad(t,n,r,s){const o={},a={},c={},u={};return t.forEach(i=>{let d=!0;n.forEach(p=>{const f=`${i}|${p}`;!r.reload&&this.store.hasResourceBundle(i,p)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?a[f]===void 0&&(a[f]=!0):(this.state[f]=1,d=!1,a[f]===void 0&&(a[f]=!0),o[f]===void 0&&(o[f]=!0),u[p]===void 0&&(u[p]=!0)))}),d||(c[i]=!0)}),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(c),toLoadNamespaces:Object.keys(u)}}loaded(t,n,r){const s=t.split("|"),o=s[0],a=s[1];n&&this.emit("failedLoading",o,a,n),!n&&r&&this.store.addResourceBundle(o,a,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const c={};this.queue.forEach(u=>{wre(u.loaded,[o],a),Lre(u,t),n&&u.errors.push(n),u.pendingCount===0&&!u.done&&(Object.keys(u.loaded).forEach(i=>{c[i]||(c[i]={});const d=u.loaded[i];d.length&&d.forEach(p=>{c[i][p]===void 0&&(c[i][p]=!0)})}),u.done=!0,u.errors.length?u.callback(u.errors):u.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(u=>!u.done)}read(t,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:s,wait:o,callback:a});return}this.readingCalls++;const c=(i,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const p=this.waitingReads.shift();this.read(p.lng,p.ns,p.fcName,p.tried,p.wait,p.callback)}if(i&&d&&s{this.read.call(this,t,n,r,s+1,o*2,a)},o);return}a(i,d)},u=this.backend[r].bind(this.backend);if(u.length===2){try{const i=u(t,n);i&&typeof i.then=="function"?i.then(d=>c(null,d)).catch(c):c(null,i)}catch(i){c(i)}return}return u(t,n,c)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof n=="string"&&(n=[n]);const o=this.queueLoad(t,n,r,s);if(!o.toLoad.length)return o.pending.length||s(),null;o.toLoad.forEach(a=>{this.loadOne(a)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),s=r[0],o=r[1];this.read(s,o,"read",void 0,void 0,(a,c)=>{a&&this.logger.warn(`${n}loading namespace ${o} for language ${s} failed`,a),!a&&c&&this.logger.log(`${n}loaded namespace ${o} for language ${s}`,c),this.loaded(t,a,c)})}saveMissing(t,n,r,s,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},c=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend&&this.backend.create){const u={...a,isUpdate:o},i=this.backend.create.bind(this.backend);if(i.length<6)try{let d;i.length===5?d=i(t,n,r,s,u):d=i(t,n,r,s),d&&typeof d.then=="function"?d.then(p=>c(null,p)).catch(c):c(null,d)}catch(d){c(d)}else i(t,n,r,s,c,u)}!t||!t[0]||this.store.addResource(t[0],n,r,s)}}}const CE=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),typeof e[1]=="string"&&(t.defaultValue=e[1]),typeof e[2]=="string"&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),EE=e=>(typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),Zf=()=>{},Bre=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class Ad extends am{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=EE(t),this.services={},this.logger=Ls,this.modules={external:[]},Bre(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const s=CE();this.options={...s,...this.options,...EE(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...s.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const o=d=>d?typeof d=="function"?new d:d:null;if(!this.options.isClone){this.modules.logger?Ls.init(o(this.modules.logger),this.options):Ls.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:typeof Intl<"u"&&(d=Fre);const p=new xE(this.options);this.store=new yE(this.options.resources,this.options);const f=this.services;f.logger=Ls,f.resourceStore=this.store,f.languageUtils=p,f.pluralResolver=new Ire(p,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),d&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(f.formatter=o(d),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new Dre(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new $re(o(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(g){for(var h=arguments.length,m=new Array(h>1?h-1:0),x=1;x1?h-1:0),x=1;x{g.init&&g.init(this)})}if(this.format=this.options.interpolation.format,r||(r=Zf),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(d=>{this[d]=function(){return t.store[d](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=function(){return t.store[d](...arguments),t}});const u=uu(),i=()=>{const d=(p,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),u.resolve(f),r(p,f)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initImmediate?i():setTimeout(i,0),u}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Zf;const s=typeof t=="string"?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(s&&s.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const o=[],a=c=>{if(!c||c==="cimode")return;this.services.languageUtils.toResolveHierarchy(c).forEach(i=>{i!=="cimode"&&o.indexOf(i)<0&&o.push(i)})};s?a(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>a(u)),this.options.preload&&this.options.preload.forEach(c=>a(c)),this.services.backendConnector.load(o,this.options.ns,c=>{!c&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(c)})}else r(null)}reloadResources(t,n,r){const s=uu();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=Zf),this.services.backendConnector.reload(t,n,o=>{s.resolve(),r(o)}),s}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&XI.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const s=uu();this.emit("languageChanging",t);const o=u=>{this.language=u,this.languages=this.services.languageUtils.toResolveHierarchy(u),this.resolvedLanguage=void 0,this.setResolvedLanguage(u)},a=(u,i)=>{i?(o(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,s.resolve(function(){return r.t(...arguments)}),n&&n(u,function(){return r.t(...arguments)})},c=u=>{!t&&!u&&this.services.languageDetector&&(u=[]);const i=typeof u=="string"?u:this.services.languageUtils.getBestMatchFromCodes(u);i&&(this.language||o(i),this.translator.language||this.translator.changeLanguage(i),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(i)),this.loadResources(i,d=>{a(d,i)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(c):this.services.languageDetector.detect(c):c(t),s}getFixedT(t,n,r){var s=this;const o=function(a,c){let u;if(typeof c!="object"){for(var i=arguments.length,d=new Array(i>2?i-2:0),p=2;p`${u.keyPrefix}${f}${h}`):g=u.keyPrefix?`${u.keyPrefix}${f}${a}`:a,s.t(g,u)};return typeof t=="string"?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=r,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(c,u)=>{const i=this.services.backendConnector.state[`${c}|${u}`];return i===-1||i===0||i===2};if(n.precheck){const c=n.precheck(this,a);if(c!==void 0)return c}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,t)&&(!s||a(o,t)))}loadNamespaces(t,n){const r=uu();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=uu();typeof t=="string"&&(t=[t]);const s=this.options.preload||[],o=t.filter(a=>s.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return o.length?(this.options.preload=s.concat(o),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services&&this.services.languageUtils||new xE(CE());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new Ad(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Zf;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const s={...this.options,...t,isClone:!0},o=new Ad(s);return(t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(c=>{o[c]=this[c]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r&&(o.store=new yE(this.store.data,s),o.services.resourceStore=o.store),o.translator=new Og(o.services,s),o.translator.on("*",function(c){for(var u=arguments.length,i=new Array(u>1?u-1:0),d=1;d:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.75rem * var(--tw-space-x-reverse));margin-left:calc(.75rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * 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-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.divide-x>:not([hidden])~:not([hidden]){--tw-divide-x-reverse: 0;border-right-width:calc(1px * var(--tw-divide-x-reverse));border-left-width:calc(1px * calc(1 - var(--tw-divide-x-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))}.self-end{align-self:flex-end}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.overflow-ellipsis,.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-wrap{text-wrap:wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-3xl{border-radius:1.5rem}.rounded-\[16px\]{border-radius:16px}.rounded-\[2px\]{border-radius:2px}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-l-lg{border-top-left-radius:var(--radius);border-bottom-left-radius:var(--radius)}.border{border-width:1px}.border-2{border-width:2px}.border-\[1\.5px\]{border-width:1.5px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-\[--color-border\]{border-color:var(--color-border)}.border-amber-500\/20{border-color:#f59e0b33}.border-black{--tw-border-opacity: 1;border-color:rgb(0 0 0 / var(--tw-border-opacity))}.border-black\/10{border-color:#0000001a}.border-border{border-color:hsl(var(--border))}.border-border\/50{border-color:hsl(var(--border) / .5)}.border-emerald-500\/20{border-color:#10b98133}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.border-gray-600\/50{border-color:#4b556380}.border-input{border-color:hsl(var(--input))}.border-muted{border-color:hsl(var(--muted))}.border-red-500\/20{border-color:#ef444433}.border-sky-500\/20{border-color:#0ea5e933}.border-slate-600{--tw-border-opacity: 1;border-color:rgb(71 85 105 / var(--tw-border-opacity))}.border-transparent{border-color:transparent}.border-zinc-500\/20{border-color:#71717a33}.border-l-transparent{border-left-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-\[\#b2ece0\]{--tw-bg-opacity: 1;background-color:rgb(178 236 224 / var(--tw-bg-opacity))}.bg-\[\#c8fff2\]{--tw-bg-opacity: 1;background-color:rgb(200 255 242 / var(--tw-bg-opacity))}.bg-\[\#d2e2e2\]{--tw-bg-opacity: 1;background-color:rgb(210 226 226 / var(--tw-bg-opacity))}.bg-\[\#e0f0f0\]{--tw-bg-opacity: 1;background-color:rgb(224 240 240 / var(--tw-bg-opacity))}.bg-\[--color-bg\]{background-color:var(--color-bg)}.bg-amber-50\/50{background-color:#fffbeb80}.bg-amber-600{--tw-bg-opacity: 1;background-color:rgb(217 119 6 / var(--tw-bg-opacity))}.bg-background{background-color:hsl(var(--background))}.bg-background\/80{background-color:hsl(var(--background) / .8)}.bg-black\/10{background-color:#0000001a}.bg-black\/5{background-color:#0000000d}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity))}.bg-blue-700{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity))}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-emerald-50\/50{background-color:#ecfdf580}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.bg-muted{background-color:hsl(var(--muted))}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary\/20{background-color:hsl(var(--primary) / .2)}.bg-primary\/30{background-color:hsl(var(--primary) / .3)}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity))}.bg-red-50\/50{background-color:#fef2f280}.bg-secondary{background-color:hsl(var(--secondary))}.bg-sky-50\/50{background-color:#f0f9ff80}.bg-slate-700{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity))}.bg-zinc-50\/50{background-color:#fafafa80}.fill-current{fill:currentColor}.fill-gray-100{fill:#f3f4f6}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.p-\[0\.375rem_1rem_0_1rem\]{padding:.375rem 1rem 0}.p-\[1px\]{padding:1px}.px-1{padding-left:.25rem;padding-right:.25rem}.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-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-3{padding-bottom:.75rem}.pl-2{padding-left:.5rem}.pl-3{padding-left:.75rem}.pl-4{padding-left:1rem}.pl-8{padding-left:2rem}.pr-2{padding-right:.5rem}.pr-4{padding-right:1rem}.pt-0{padding-top:0}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-5{padding-top:1.25rem}.pt-6{padding-top:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.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-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-widest{letter-spacing:.1em}.text-\[\#008069\]{--tw-text-opacity: 1;color:rgb(0 128 105 / var(--tw-text-opacity))}.text-\[\#b03f3f\]{--tw-text-opacity: 1;color:rgb(176 63 63 / var(--tw-text-opacity))}.text-amber-100{--tw-text-opacity: 1;color:rgb(254 243 199 / var(--tw-text-opacity))}.text-amber-900{--tw-text-opacity: 1;color:rgb(120 53 15 / var(--tw-text-opacity))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-emerald-900{--tw-text-opacity: 1;color:rgb(6 78 59 / var(--tw-text-opacity))}.text-foreground{color:hsl(var(--foreground))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-muted-foreground\/80{color:hsl(var(--muted-foreground) / .8)}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}.text-red-800{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity))}.text-red-900{--tw-text-opacity: 1;color:rgb(127 29 29 / var(--tw-text-opacity))}.text-rose-600{--tw-text-opacity: 1;color:rgb(225 29 72 / var(--tw-text-opacity))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-sky-900{--tw-text-opacity: 1;color:rgb(12 74 110 / var(--tw-text-opacity))}.text-slate-300{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity))}.text-zinc-900{--tw-text-opacity: 1;color:rgb(24 24 27 / var(--tw-text-opacity))}.underline-offset-4{text-underline-offset:4px}.caret-transparent{caret-color:transparent}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-muted-foreground{--tw-ring-color: hsl(var(--muted-foreground))}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.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}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.paused{animation-play-state:paused}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:inset-y-0:after{content:var(--tw-content);top:0;bottom:0}.after\:bottom-\[12px\]:after{content:var(--tw-content);bottom:12px}.after\:left-1\/2:after{content:var(--tw-content);left:50%}.after\:w-1:after{content:var(--tw-content);width:.25rem}.after\:-translate-x-1\/2:after{content:var(--tw-content);--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.after\:border-\[8px\]:after{content:var(--tw-content);border-width:8px}.after\:border-solid:after{content:var(--tw-content);border-style:solid}.after\:bg-border:after{content:var(--tw-content);background-color:hsl(var(--border))}.hover\:bg-\[\#a4ecde\]:hover{--tw-bg-opacity: 1;background-color:rgb(164 236 222 / var(--tw-bg-opacity))}.hover\:bg-\[\#b2ece0\]:hover{--tw-bg-opacity: 1;background-color:rgb(178 236 224 / var(--tw-bg-opacity))}.hover\:bg-\[\#c2d2d2\]:hover{--tw-bg-opacity: 1;background-color:rgb(194 210 210 / var(--tw-bg-opacity))}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-amber-600\/80:hover{background-color:#d97706cc}.hover\:bg-amber-600\/90:hover{background-color:#d97706e6}.hover\:bg-black\/10:hover{background-color:#0000001a}.hover\:bg-destructive\/80:hover{background-color:hsl(var(--destructive) / .8)}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:stroke-destructive:hover{stroke:hsl(var(--destructive))}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-0:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-transparent:focus-visible{--tw-ring-color: transparent}.focus-visible\:ring-offset-0:focus-visible{--tw-ring-offset-width: 0px}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width: 1px}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.focus-visible\:ring-offset-transparent:focus-visible{--tw-ring-offset-color: transparent}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-default:disabled{cursor:default}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:visible{visibility:visible}.group:hover .group-hover\:opacity-100{opacity:1}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.aria-selected\:bg-accent[aria-selected=true]{background-color:hsl(var(--accent))}.aria-selected\:text-accent-foreground[aria-selected=true]{color:hsl(var(--accent-foreground))}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[panel-group-direction\=vertical\]\:h-px[data-panel-group-direction=vertical]{height:1px}.data-\[panel-group-direction\=vertical\]\:w-full[data-panel-group-direction=vertical]{width:100%}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:translate-x-5[data-state=checked]{--tw-translate-x: 1.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[panel-group-direction\=vertical\]\:flex-col[data-panel-group-direction=vertical]{flex-direction:column}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\[state\=active\]\:bg-primary[data-state=active],.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:hsl(var(--muted))}.data-\[state\=unchecked\]\:bg-slate-400[data-state=unchecked]{--tw-bg-opacity: 1;background-color:rgb(148 163 184 / var(--tw-bg-opacity))}.data-\[state\=active\]\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\[state\=active\]\:text-primary-foreground[data-state=active]{color:hsl(var(--primary-foreground))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[state\=open\]\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y: -48%}.data-\[panel-group-direction\=vertical\]\:after\:left-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);left:0}.data-\[panel-group-direction\=vertical\]\:after\:h-1[data-panel-group-direction=vertical]:after{content:var(--tw-content);height:.25rem}.data-\[panel-group-direction\=vertical\]\:after\:w-full[data-panel-group-direction=vertical]:after{content:var(--tw-content);width:100%}.data-\[panel-group-direction\=vertical\]\:after\:-translate-y-1\/2[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[panel-group-direction\=vertical\]\:after\:translate-x-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.dark\:-rotate-90:is(.dark *){--tw-rotate: -90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.dark\:rotate-0:is(.dark *){--tw-rotate: 0deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.dark\:scale-0:is(.dark *){--tw-scale-x: 0;--tw-scale-y: 0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.dark\:scale-100:is(.dark *){--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.dark\:border-amber-500\/30:is(.dark *){border-color:#f59e0b4d}.dark\:border-emerald-500\/30:is(.dark *){border-color:#10b9814d}.dark\:border-gray-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity))}.dark\:border-red-500\/30:is(.dark *){border-color:#ef44444d}.dark\:border-sky-500\/30:is(.dark *){border-color:#0ea5e94d}.dark\:border-white\/10:is(.dark *){border-color:#ffffff1a}.dark\:border-zinc-500\/30:is(.dark *){border-color:#71717a4d}.dark\:bg-\[\#082720\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(8 39 32 / var(--tw-bg-opacity))}.dark\:bg-\[\#0b332a\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(11 51 42 / var(--tw-bg-opacity))}.dark\:bg-\[\#0f1413\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(15 20 19 / var(--tw-bg-opacity))}.dark\:bg-\[\#1d2724\]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(29 39 36 / var(--tw-bg-opacity))}.dark\:bg-amber-500\/10:is(.dark *){background-color:#f59e0b1a}.dark\:bg-blue-300:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(147 197 253 / var(--tw-bg-opacity))}.dark\:bg-emerald-500\/10:is(.dark *){background-color:#10b9811a}.dark\:bg-gray-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.dark\:bg-gray-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.dark\:bg-red-500\/10:is(.dark *){background-color:#ef44441a}.dark\:bg-red-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(127 29 29 / var(--tw-bg-opacity))}.dark\:bg-sky-500\/10:is(.dark *){background-color:#0ea5e91a}.dark\:bg-white\/10:is(.dark *){background-color:#ffffff1a}.dark\:bg-white\/5:is(.dark *){background-color:#ffffff0d}.dark\:bg-yellow-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(66 32 6 / var(--tw-bg-opacity))}.dark\:bg-zinc-500\/10:is(.dark *){background-color:#71717a1a}.dark\:fill-gray-800:is(.dark *){fill:#1f2937}.dark\:text-\[\#00a884\]:is(.dark *){--tw-text-opacity: 1;color:rgb(0 168 132 / var(--tw-text-opacity))}.dark\:text-amber-200:is(.dark *){--tw-text-opacity: 1;color:rgb(253 230 138 / var(--tw-text-opacity))}.dark\:text-blue-300:is(.dark *){--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity))}.dark\:text-emerald-200:is(.dark *){--tw-text-opacity: 1;color:rgb(167 243 208 / var(--tw-text-opacity))}.dark\:text-gray-100:is(.dark *){--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity))}.dark\:text-gray-300:is(.dark *){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity))}.dark\:text-gray-400:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.dark\:text-red-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 202 202 / var(--tw-text-opacity))}.dark\:text-sky-200:is(.dark *){--tw-text-opacity: 1;color:rgb(186 230 253 / var(--tw-text-opacity))}.dark\:text-white:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.dark\:text-zinc-300:is(.dark *){--tw-text-opacity: 1;color:rgb(212 212 216 / var(--tw-text-opacity))}.dark\:hover\:bg-\[\#071f19\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(7 31 25 / var(--tw-bg-opacity))}.dark\:hover\:bg-\[\#082720\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(8 39 32 / var(--tw-bg-opacity))}.dark\:hover\:bg-\[\#141a18\]:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(20 26 24 / var(--tw-bg-opacity))}.dark\:hover\:bg-white\/10:hover:is(.dark *){background-color:#ffffff1a}@media (min-width: 640px){.sm\:m-4{margin:1rem}.sm\:inline{display:inline}.sm\:max-h-\[600px\]{max-height:600px}.sm\:max-w-\[650px\]{max-width:650px}.sm\:max-w-\[740px\]{max-width:740px}.sm\:max-w-\[950px\]{max-width:950px}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-\[10rem_1fr_10rem\]{grid-template-columns:10rem 1fr 10rem}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:text-left{text-align:left}}@media (min-width: 768px){.md\:inline{display:inline}.md\:flex{display:flex}.md\:w-64{width:16rem}.md\:w-full{width:100%}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:gap-8{gap:2rem}}@media (min-width: 1024px){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (min-width: 1280px){.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\&\>\*\]\:p-4>*{padding:1rem}.\[\&\>\*\]\:px-4>*{padding-left:1rem;padding-right:1rem}.\[\&\>\*\]\:py-2>*{padding-top:.5rem;padding-bottom:.5rem}.\[\&\>div\[style\]\]\:\!block>div[style]{display:block!important}.\[\&\>div\[style\]\]\:h-full>div[style]{height:100%}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y: -3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:left-4>svg{left:1rem}.\[\&\>svg\]\:top-4>svg{top:1rem}.\[\&\>svg\]\:h-2\.5>svg{height:.625rem}.\[\&\>svg\]\:h-3>svg{height:.75rem}.\[\&\>svg\]\:w-2\.5>svg{width:.625rem}.\[\&\>svg\]\:w-3>svg{width:.75rem}.\[\&\>svg\]\:fill-rose-600>svg{fill:#e11d48}.\[\&\>svg\]\:text-amber-500>svg{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity))}.\[\&\>svg\]\:text-emerald-600>svg{--tw-text-opacity: 1;color:rgb(5 150 105 / var(--tw-text-opacity))}.\[\&\>svg\]\:text-foreground>svg{color:hsl(var(--foreground))}.\[\&\>svg\]\:text-muted-foreground>svg{color:hsl(var(--muted-foreground))}.\[\&\>svg\]\:text-red-600>svg{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity))}.\[\&\>svg\]\:text-sky-500>svg{--tw-text-opacity: 1;color:rgb(14 165 233 / var(--tw-text-opacity))}.\[\&\>svg\]\:text-zinc-400>svg{--tw-text-opacity: 1;color:rgb(161 161 170 / var(--tw-text-opacity))}.hover\:\[\&\>svg\]\:fill-rose-700>svg:hover{fill:#be123c}.dark\:\[\&\>svg\]\:text-emerald-400\/80>svg:is(.dark *){color:#34d399cc}.dark\:\[\&\>svg\]\:text-red-400\/80>svg:is(.dark *){color:#f87171cc}.dark\:\[\&\>svg\]\:text-zinc-300>svg:is(.dark *){--tw-text-opacity: 1;color:rgb(212 212 216 / var(--tw-text-opacity))}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:1.75rem}.\[\&\>tr\]\:last\:border-b-0:last-child>tr{border-bottom-width:0px}.\[\&\[data-panel-group-direction\=vertical\]\>div\]\:rotate-90[data-panel-group-direction=vertical]>div{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&_\.recharts-cartesian-axis-tick_text\]\:fill-muted-foreground .recharts-cartesian-axis-tick text{fill:hsl(var(--muted-foreground))}.\[\&_\.recharts-cartesian-grid_line\[stroke\=\'\#ccc\'\]\]\:stroke-border\/50 .recharts-cartesian-grid line[stroke="#ccc"]{stroke:hsl(var(--border) / .5)}.\[\&_\.recharts-curve\.recharts-tooltip-cursor\]\:stroke-border .recharts-curve.recharts-tooltip-cursor{stroke:hsl(var(--border))}.\[\&_\.recharts-dot\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-dot[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-layer\]\:outline-none .recharts-layer{outline:2px solid transparent;outline-offset:2px}.\[\&_\.recharts-polar-grid_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-polar-grid [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-radial-bar-background-sector\]\:fill-muted .recharts-radial-bar-background-sector,.\[\&_\.recharts-rectangle\.recharts-tooltip-cursor\]\:fill-muted .recharts-rectangle.recharts-tooltip-cursor{fill:hsl(var(--muted))}.\[\&_\.recharts-reference-line_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-reference-line [stroke="#ccc"]{stroke:hsl(var(--border))}.\[\&_\.recharts-sector\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-sector[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-sector\]\:outline-none .recharts-sector,.\[\&_\.recharts-surface\]\:outline-none .recharts-surface{outline:2px solid transparent;outline-offset:2px}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-top:.375rem;padding-bottom:.375rem}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{font-weight:500}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:hsl(var(--muted-foreground))}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:3rem}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-top:.75rem;padding-bottom:.75rem}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:1.25rem}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:1.25rem}.\[\&_p\]\:leading-relaxed p{line-height:1.625}.\[\&_strong\]\:text-foreground strong{color:hsl(var(--foreground))}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-width:0px}.\[\&_tr\]\:border-b tr{border-bottom-width:1px}:root{--toastify-color-light: #fff;--toastify-color-dark: #121212;--toastify-color-info: #3498db;--toastify-color-success: #07bc0c;--toastify-color-warning: #f1c40f;--toastify-color-error: #e74c3c;--toastify-color-transparent: rgba(255, 255, 255, .7);--toastify-icon-color-info: var(--toastify-color-info);--toastify-icon-color-success: var(--toastify-color-success);--toastify-icon-color-warning: var(--toastify-color-warning);--toastify-icon-color-error: var(--toastify-color-error);--toastify-toast-width: 320px;--toastify-toast-offset: 16px;--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));--toastify-toast-background: #fff;--toastify-toast-min-height: 64px;--toastify-toast-max-height: 800px;--toastify-toast-bd-radius: 6px;--toastify-font-family: sans-serif;--toastify-z-index: 9999;--toastify-text-color-light: #757575;--toastify-text-color-dark: #fff;--toastify-text-color-info: #fff;--toastify-text-color-success: #fff;--toastify-text-color-warning: #fff;--toastify-text-color-error: #fff;--toastify-spinner-color: #616161;--toastify-spinner-color-empty-area: #e0e0e0;--toastify-color-progress-light: linear-gradient( to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55 );--toastify-color-progress-dark: #bb86fc;--toastify-color-progress-info: var(--toastify-color-info);--toastify-color-progress-success: var(--toastify-color-success);--toastify-color-progress-warning: var(--toastify-color-warning);--toastify-color-progress-error: var(--toastify-color-error);--toastify-color-progress-bgo: .2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translate3d(0,0,var(--toastify-z-index));position:fixed;padding:4px;width:var(--toastify-toast-width);box-sizing:border-box;color:#fff}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translate(-50%)}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right)}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translate(-50%)}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right)}@media only screen and (max-width : 480px){.Toastify__toast-container{width:100vw;padding:0;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-left,.Toastify__toast-container--top-center,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translate(0)}.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translate(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:initial}}.Toastify__toast{--y: 0;position:relative;touch-action:none;min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:8px;border-radius:var(--toastify-toast-bd-radius);box-shadow:0 4px 12px #0000001a;display:flex;justify-content:space-between;max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);cursor:default;direction:ltr;z-index:0;overflow:hidden}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,.Toastify__toast--stacked[data-collapsed] .Toastify__close-button{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-body{margin:auto 0;flex:1 1 auto;padding:6px;display:flex;align-items:center}.Toastify__toast-body>div:last-child{word-break:break-word;flex:1}.Toastify__toast-icon{margin-inline-end:10px;width:20px;flex-shrink:0;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}@media only screen and (max-width : 480px){.Toastify__toast{margin-bottom:0;border-radius:0}}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--light,.Toastify__toast-theme--colored.Toastify__toast--default{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;align-self:flex-start;z-index:1}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:hover,.Toastify__close-button:focus{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:var(--toastify-z-index);opacity:.7;transform-origin:left;border-bottom-left-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:initial;transform-origin:right;border-bottom-left-radius:initial;border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp{position:absolute;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--top-left,.Toastify__bounce-enter--bottom-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--top-right,.Toastify__bounce-enter--bottom-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--top-left,.Toastify__bounce-exit--bottom-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--top-right,.Toastify__bounce-exit--bottom-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--top-left,.Toastify__slide-enter--bottom-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--top-right,.Toastify__slide-enter--bottom-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--top-left,.Toastify__slide-exit--bottom-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-right,.Toastify__slide-exit--bottom-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.chat-item{display:flex;padding:10px;cursor:pointer;background-color:hsl(var(--background))}.chat-item:hover,.chat-item.active{background-color:#2f2f2f}.bubble{border-radius:16px;padding:12px;word-wrap:break-word;max-width:100%;overflow:hidden}.bubble-right .bubble{background-color:#0a0a0a;max-width:100%}.bubble-right .bubble>span{text-align:right;display:block}.bubble-left .bubble{background-color:#1b1b1b;max-width:100%}.bubble-right{align-self:flex-end;display:flex;justify-content:flex-end;width:80%}.bubble-left{align-self:flex-start;display:flex;justify-content:flex-start;width:80%}.input-message textarea{background-color:#2f2f2f;padding-left:48px}.input-message textarea:focus{outline:none;border:none;box-shadow:none}.message-container{flex:1;overflow-y:auto;max-height:calc(100vh - 110px);padding-top:50px}.tabs-chat{background-color:transparent;width:100%;border-radius:0}.contacts-container{height:calc(100vh - 180px);overflow-y:auto;display:flex;flex-direction:column}.chat-item{display:flex;padding:10px;cursor:pointer}.custom-scrollbar{scrollbar-width:none}.custom-scrollbar::-webkit-scrollbar{display:none}.input-container{position:sticky;bottom:0;display:flex;flex-direction:column;gap:.375rem;background-color:transparent;padding:.375rem 1rem;width:100%;max-width:48rem;margin:0 auto;box-sizing:border-box}.formatted-message{white-space:pre-wrap}.formatted-message p{margin-bottom:1em}.formatted-message strong{font-weight:700}.formatted-message em{font-style:italic}.formatted-message del{text-decoration:line-through}.formatted-message a{color:#170c96!important;text-decoration:underline!important}.highlight-quoted{animation:highlight 2s ease-out}@keyframes highlight{0%{background-color:#3b82f633}to{background-color:transparent}} diff --git a/manager/dist/index.html b/manager/dist/index.html index 286c28939..01a75fd5a 100644 --- a/manager/dist/index.html +++ b/manager/dist/index.html @@ -5,8 +5,8 @@ Evolution Manager - - + +
diff --git a/manager_install.sh b/manager_install.sh new file mode 100755 index 000000000..c6806744a --- /dev/null +++ b/manager_install.sh @@ -0,0 +1,8 @@ +#! /bin/bash + +cd evolution-manager-v2 +npm install +npm run build +cd .. +rm -rf manager/dist +cp -r evolution-manager-v2/dist manager/dist \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 70cfbaf6c..c45e8fef3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,26 +1,27 @@ { "name": "evolution-api", - "version": "2.3.2", + "version": "2.3.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "evolution-api", - "version": "2.3.2", + "version": "2.3.7", "license": "Apache-2.0", "dependencies": { "@adiwajshing/keyed-db": "^0.2.4", - "@aws-sdk/client-sqs": "^3.723.0", + "@aws-sdk/client-sqs": "^3.891.0", "@ffmpeg-installer/ffmpeg": "^1.1.0", "@figuro/chatwoot-sdk": "^1.1.16", "@hapi/boom": "^10.0.1", "@paralleldrive/cuid2": "^2.2.2", - "@prisma/client": "^6.1.0", - "@sentry/node": "^8.47.0", + "@prisma/client": "^6.16.2", + "@sentry/node": "^10.12.0", + "@types/uuid": "^10.0.0", "amqplib": "^0.10.5", "audio-decode": "^2.2.3", "axios": "^1.7.9", - "baileys": "github:WhiskeySockets/Baileys", + "baileys": "7.0.0-rc.9", "class-validator": "^0.14.1", "compression": "^1.7.5", "cors": "^2.8.5", @@ -30,6 +31,7 @@ "eventemitter2": "^6.4.9", "express": "^4.21.2", "express-async-errors": "^3.1.1", + "fetch-socks": "^1.3.2", "fluent-ffmpeg": "^2.1.3", "form-data": "^4.0.1", "https-proxy-agent": "^7.0.6", @@ -38,19 +40,21 @@ "json-schema": "^0.4.0", "jsonschema": "^1.4.1", "jsonwebtoken": "^9.0.2", + "kafkajs": "^2.2.4", + "libphonenumber-js": "^1.12.25", "link-preview-js": "^3.0.13", "long": "^5.2.3", "mediainfo.js": "^0.3.4", "mime": "^4.0.0", "mime-types": "^2.1.35", "minio": "^8.0.3", - "multer": "^1.4.5-lts.1", + "multer": "^2.0.2", "nats": "^2.29.1", "node-cache": "^5.1.2", "node-cron": "^3.0.3", "openai": "^4.77.3", "pg": "^8.13.1", - "pino": "^8.11.0", + "pino": "^9.10.0", "prisma": "^6.1.0", "pusher": "^5.2.0", "qrcode": "^1.5.4", @@ -62,42 +66,68 @@ "socket.io-client": "^4.8.1", "socks-proxy-agent": "^8.0.5", "swagger-ui-express": "^5.0.1", - "tsup": "^8.3.5" + "tsup": "^8.3.5", + "undici": "^7.16.0", + "uuid": "^13.0.0" }, "devDependencies": { + "@commitlint/cli": "^19.8.1", + "@commitlint/config-conventional": "^19.8.1", "@types/compression": "^1.7.5", "@types/cors": "^2.8.17", "@types/express": "^4.17.18", "@types/json-schema": "^7.0.15", "@types/mime": "^4.0.0", "@types/mime-types": "^2.1.4", - "@types/node": "^22.10.5", + "@types/node": "^24.5.2", "@types/node-cron": "^3.0.11", "@types/qrcode": "^1.5.5", "@types/qrcode-terminal": "^0.12.2", - "@types/uuid": "^10.0.0", - "@typescript-eslint/eslint-plugin": "^6.21.0", - "@typescript-eslint/parser": "^6.21.0", + "@typescript-eslint/eslint-plugin": "^8.44.0", + "@typescript-eslint/parser": "^8.44.0", + "commitizen": "^4.3.1", + "cz-conventional-changelog": "^3.3.0", "eslint": "^8.45.0", - "eslint-config-prettier": "^9.1.0", + "eslint-config-prettier": "^10.1.8", "eslint-plugin-import": "^2.31.0", "eslint-plugin-prettier": "^5.2.1", - "eslint-plugin-simple-import-sort": "^10.0.0", + "eslint-plugin-simple-import-sort": "^12.1.1", + "husky": "^9.1.7", + "lint-staged": "^16.1.6", "prettier": "^3.4.2", "tsconfig-paths": "^4.2.0", - "tsx": "^4.20.3", + "tsx": "^4.20.5", "typescript": "^5.7.2" } }, "node_modules/@adiwajshing/keyed-db": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/@adiwajshing/keyed-db/-/keyed-db-0.2.4.tgz", - "integrity": "sha512-yprSnAtj80/VKuDqRcFFLDYltoNV8tChNwFfIgcf6PGD4sjzWIBgs08pRuTqGH5mk5wgL6PBRSsMCZqtZwzFEw==" + "integrity": "sha512-yprSnAtj80/VKuDqRcFFLDYltoNV8tChNwFfIgcf6PGD4sjzWIBgs08pRuTqGH5mk5wgL6PBRSsMCZqtZwzFEw==", + "license": "MIT" + }, + "node_modules/@apm-js-collab/code-transformer": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/@apm-js-collab/code-transformer/-/code-transformer-0.8.2.tgz", + "integrity": "sha512-YRjJjNq5KFSjDUoqu5pFUWrrsvGOxl6c3bu+uMFc9HNNptZ2rNU/TI2nLw4jnhQNtka972Ee2m3uqbvDQtPeCA==", + "license": "Apache-2.0" + }, + "node_modules/@apm-js-collab/tracing-hooks": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@apm-js-collab/tracing-hooks/-/tracing-hooks-0.3.1.tgz", + "integrity": "sha512-Vu1CbmPURlN5fTboVuKMoJjbO5qcq9fA5YXpskx3dXe/zTBvjODFoerw+69rVBlRLrJpwPqSDqEuJDEKIrTldw==", + "license": "Apache-2.0", + "dependencies": { + "@apm-js-collab/code-transformer": "^0.8.0", + "debug": "^4.4.1", + "module-details-from-path": "^1.0.4" + } }, "node_modules/@aws-crypto/sha256-browser": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-browser/-/sha256-browser-5.2.0.tgz", "integrity": "sha512-AXfN/lGotSQwu6HNcEsIASo7kWXZ5HYWvfOmSNKDsEqC4OashTp8alTmaz+F7TC2L083SFv5RdB+qU3Vs1kZqw==", + "license": "Apache-2.0", "dependencies": { "@aws-crypto/sha256-js": "^5.2.0", "@aws-crypto/supports-web-crypto": "^5.2.0", @@ -112,6 +142,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-2.2.0.tgz", "integrity": "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==", + "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" }, @@ -123,6 +154,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-2.2.0.tgz", "integrity": "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==", + "license": "Apache-2.0", "dependencies": { "@smithy/is-array-buffer": "^2.2.0", "tslib": "^2.6.2" @@ -135,6 +167,7 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.3.0.tgz", "integrity": "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==", + "license": "Apache-2.0", "dependencies": { "@smithy/util-buffer-from": "^2.2.0", "tslib": "^2.6.2" @@ -147,6 +180,7 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-js/-/sha256-js-5.2.0.tgz", "integrity": "sha512-FFQQyu7edu4ufvIZ+OadFpHHOt+eSTBaYaki44c+akjg7qZg9oOQeLlk77F6tSYqjDAFClrHJk9tMf0HdVyOvA==", + "license": "Apache-2.0", "dependencies": { "@aws-crypto/util": "^5.2.0", "@aws-sdk/types": "^3.222.0", @@ -160,6 +194,7 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/@aws-crypto/supports-web-crypto/-/supports-web-crypto-5.2.0.tgz", "integrity": "sha512-iAvUotm021kM33eCdNfwIN//F77/IADDSs58i+MDaOqFrVjZo9bAal0NK7HurRuWLLpF1iLX7gbWrjHjeo+YFg==", + "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" } @@ -168,6 +203,7 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/@aws-crypto/util/-/util-5.2.0.tgz", "integrity": "sha512-4RkU9EsI6ZpBve5fseQlGNUWKMa1RLPQ1dnjnQoe07ldfIzcsGb5hC5W0Dm7u423KWzawlrpbjXBrXCEv9zazQ==", + "license": "Apache-2.0", "dependencies": { "@aws-sdk/types": "^3.222.0", "@smithy/util-utf8": "^2.0.0", @@ -178,6 +214,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-2.2.0.tgz", "integrity": "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==", + "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" }, @@ -189,6 +226,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-2.2.0.tgz", "integrity": "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==", + "license": "Apache-2.0", "dependencies": { "@smithy/is-array-buffer": "^2.2.0", "tslib": "^2.6.2" @@ -201,6 +239,7 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.3.0.tgz", "integrity": "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==", + "license": "Apache-2.0", "dependencies": { "@smithy/util-buffer-from": "^2.2.0", "tslib": "^2.6.2" @@ -210,50 +249,51 @@ } }, "node_modules/@aws-sdk/client-sqs": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sqs/-/client-sqs-3.840.0.tgz", - "integrity": "sha512-e14G4W8hw9uFrKh4w9CNUrIUuAd6sETOuuTQFD7FYPMoZDlNvEcStE53yr0Egw0D0poqNzedKF4aZJH5MzyB9A==", + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sqs/-/client-sqs-3.936.0.tgz", + "integrity": "sha512-JDYdeGV8L+zXr9Ce7gVeleQB2z0F3YWWmNvbE6cS20fR9E0XVIsYw5Grymjw9/3AG4wbOIQJ5Nayy+HgxKANjA==", + "license": "Apache-2.0", "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.840.0", - "@aws-sdk/credential-provider-node": "3.840.0", - "@aws-sdk/middleware-host-header": "3.840.0", - "@aws-sdk/middleware-logger": "3.840.0", - "@aws-sdk/middleware-recursion-detection": "3.840.0", - "@aws-sdk/middleware-sdk-sqs": "3.840.0", - "@aws-sdk/middleware-user-agent": "3.840.0", - "@aws-sdk/region-config-resolver": "3.840.0", - "@aws-sdk/types": "3.840.0", - "@aws-sdk/util-endpoints": "3.840.0", - "@aws-sdk/util-user-agent-browser": "3.840.0", - "@aws-sdk/util-user-agent-node": "3.840.0", - "@smithy/config-resolver": "^4.1.4", - "@smithy/core": "^3.6.0", - "@smithy/fetch-http-handler": "^5.0.4", - "@smithy/hash-node": "^4.0.4", - "@smithy/invalid-dependency": "^4.0.4", - "@smithy/md5-js": "^4.0.4", - "@smithy/middleware-content-length": "^4.0.4", - "@smithy/middleware-endpoint": "^4.1.13", - "@smithy/middleware-retry": "^4.1.14", - "@smithy/middleware-serde": "^4.0.8", - "@smithy/middleware-stack": "^4.0.4", - "@smithy/node-config-provider": "^4.1.3", - "@smithy/node-http-handler": "^4.0.6", - "@smithy/protocol-http": "^5.1.2", - "@smithy/smithy-client": "^4.4.5", - "@smithy/types": "^4.3.1", - "@smithy/url-parser": "^4.0.4", - "@smithy/util-base64": "^4.0.0", - "@smithy/util-body-length-browser": "^4.0.0", - "@smithy/util-body-length-node": "^4.0.0", - "@smithy/util-defaults-mode-browser": "^4.0.21", - "@smithy/util-defaults-mode-node": "^4.0.21", - "@smithy/util-endpoints": "^3.0.6", - "@smithy/util-middleware": "^4.0.4", - "@smithy/util-retry": "^4.0.6", - "@smithy/util-utf8": "^4.0.0", + "@aws-sdk/core": "3.936.0", + "@aws-sdk/credential-provider-node": "3.936.0", + "@aws-sdk/middleware-host-header": "3.936.0", + "@aws-sdk/middleware-logger": "3.936.0", + "@aws-sdk/middleware-recursion-detection": "3.936.0", + "@aws-sdk/middleware-sdk-sqs": "3.936.0", + "@aws-sdk/middleware-user-agent": "3.936.0", + "@aws-sdk/region-config-resolver": "3.936.0", + "@aws-sdk/types": "3.936.0", + "@aws-sdk/util-endpoints": "3.936.0", + "@aws-sdk/util-user-agent-browser": "3.936.0", + "@aws-sdk/util-user-agent-node": "3.936.0", + "@smithy/config-resolver": "^4.4.3", + "@smithy/core": "^3.18.5", + "@smithy/fetch-http-handler": "^5.3.6", + "@smithy/hash-node": "^4.2.5", + "@smithy/invalid-dependency": "^4.2.5", + "@smithy/md5-js": "^4.2.5", + "@smithy/middleware-content-length": "^4.2.5", + "@smithy/middleware-endpoint": "^4.3.12", + "@smithy/middleware-retry": "^4.4.12", + "@smithy/middleware-serde": "^4.2.6", + "@smithy/middleware-stack": "^4.2.5", + "@smithy/node-config-provider": "^4.3.5", + "@smithy/node-http-handler": "^4.4.5", + "@smithy/protocol-http": "^5.3.5", + "@smithy/smithy-client": "^4.9.8", + "@smithy/types": "^4.9.0", + "@smithy/url-parser": "^4.2.5", + "@smithy/util-base64": "^4.3.0", + "@smithy/util-body-length-browser": "^4.2.0", + "@smithy/util-body-length-node": "^4.2.1", + "@smithy/util-defaults-mode-browser": "^4.3.11", + "@smithy/util-defaults-mode-node": "^4.2.14", + "@smithy/util-endpoints": "^3.2.5", + "@smithy/util-middleware": "^4.2.5", + "@smithy/util-retry": "^4.2.5", + "@smithy/util-utf8": "^4.2.0", "tslib": "^2.6.2" }, "engines": { @@ -261,47 +301,48 @@ } }, "node_modules/@aws-sdk/client-sso": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.840.0.tgz", - "integrity": "sha512-3Zp+FWN2hhmKdpS0Ragi5V2ZPsZNScE3jlbgoJjzjI/roHZqO+e3/+XFN4TlM0DsPKYJNp+1TAjmhxN6rOnfYA==", + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.936.0.tgz", + "integrity": "sha512-0G73S2cDqYwJVvqL08eakj79MZG2QRaB56Ul8/Ps9oQxllr7DMI1IQ/N3j3xjxgpq/U36pkoFZ8aK1n7Sbr3IQ==", + "license": "Apache-2.0", "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.840.0", - "@aws-sdk/middleware-host-header": "3.840.0", - "@aws-sdk/middleware-logger": "3.840.0", - "@aws-sdk/middleware-recursion-detection": "3.840.0", - "@aws-sdk/middleware-user-agent": "3.840.0", - "@aws-sdk/region-config-resolver": "3.840.0", - "@aws-sdk/types": "3.840.0", - "@aws-sdk/util-endpoints": "3.840.0", - "@aws-sdk/util-user-agent-browser": "3.840.0", - "@aws-sdk/util-user-agent-node": "3.840.0", - "@smithy/config-resolver": "^4.1.4", - "@smithy/core": "^3.6.0", - "@smithy/fetch-http-handler": "^5.0.4", - "@smithy/hash-node": "^4.0.4", - "@smithy/invalid-dependency": "^4.0.4", - "@smithy/middleware-content-length": "^4.0.4", - "@smithy/middleware-endpoint": "^4.1.13", - "@smithy/middleware-retry": "^4.1.14", - "@smithy/middleware-serde": "^4.0.8", - "@smithy/middleware-stack": "^4.0.4", - "@smithy/node-config-provider": "^4.1.3", - "@smithy/node-http-handler": "^4.0.6", - "@smithy/protocol-http": "^5.1.2", - "@smithy/smithy-client": "^4.4.5", - "@smithy/types": "^4.3.1", - "@smithy/url-parser": "^4.0.4", - "@smithy/util-base64": "^4.0.0", - "@smithy/util-body-length-browser": "^4.0.0", - "@smithy/util-body-length-node": "^4.0.0", - "@smithy/util-defaults-mode-browser": "^4.0.21", - "@smithy/util-defaults-mode-node": "^4.0.21", - "@smithy/util-endpoints": "^3.0.6", - "@smithy/util-middleware": "^4.0.4", - "@smithy/util-retry": "^4.0.6", - "@smithy/util-utf8": "^4.0.0", + "@aws-sdk/core": "3.936.0", + "@aws-sdk/middleware-host-header": "3.936.0", + "@aws-sdk/middleware-logger": "3.936.0", + "@aws-sdk/middleware-recursion-detection": "3.936.0", + "@aws-sdk/middleware-user-agent": "3.936.0", + "@aws-sdk/region-config-resolver": "3.936.0", + "@aws-sdk/types": "3.936.0", + "@aws-sdk/util-endpoints": "3.936.0", + "@aws-sdk/util-user-agent-browser": "3.936.0", + "@aws-sdk/util-user-agent-node": "3.936.0", + "@smithy/config-resolver": "^4.4.3", + "@smithy/core": "^3.18.5", + "@smithy/fetch-http-handler": "^5.3.6", + "@smithy/hash-node": "^4.2.5", + "@smithy/invalid-dependency": "^4.2.5", + "@smithy/middleware-content-length": "^4.2.5", + "@smithy/middleware-endpoint": "^4.3.12", + "@smithy/middleware-retry": "^4.4.12", + "@smithy/middleware-serde": "^4.2.6", + "@smithy/middleware-stack": "^4.2.5", + "@smithy/node-config-provider": "^4.3.5", + "@smithy/node-http-handler": "^4.4.5", + "@smithy/protocol-http": "^5.3.5", + "@smithy/smithy-client": "^4.9.8", + "@smithy/types": "^4.9.0", + "@smithy/url-parser": "^4.2.5", + "@smithy/util-base64": "^4.3.0", + "@smithy/util-body-length-browser": "^4.2.0", + "@smithy/util-body-length-node": "^4.2.1", + "@smithy/util-defaults-mode-browser": "^4.3.11", + "@smithy/util-defaults-mode-node": "^4.2.14", + "@smithy/util-endpoints": "^3.2.5", + "@smithy/util-middleware": "^4.2.5", + "@smithy/util-retry": "^4.2.5", + "@smithy/util-utf8": "^4.2.0", "tslib": "^2.6.2" }, "engines": { @@ -309,24 +350,23 @@ } }, "node_modules/@aws-sdk/core": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.840.0.tgz", - "integrity": "sha512-x3Zgb39tF1h2XpU+yA4OAAQlW6LVEfXNlSedSYJ7HGKXqA/E9h3rWQVpYfhXXVVsLdYXdNw5KBUkoAoruoZSZA==", - "dependencies": { - "@aws-sdk/types": "3.840.0", - "@aws-sdk/xml-builder": "3.821.0", - "@smithy/core": "^3.6.0", - "@smithy/node-config-provider": "^4.1.3", - "@smithy/property-provider": "^4.0.4", - "@smithy/protocol-http": "^5.1.2", - "@smithy/signature-v4": "^5.1.2", - "@smithy/smithy-client": "^4.4.5", - "@smithy/types": "^4.3.1", - "@smithy/util-base64": "^4.0.0", - "@smithy/util-body-length-browser": "^4.0.0", - "@smithy/util-middleware": "^4.0.4", - "@smithy/util-utf8": "^4.0.0", - "fast-xml-parser": "4.4.1", + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.936.0.tgz", + "integrity": "sha512-eGJ2ySUMvgtOziHhDRDLCrj473RJoL4J1vPjVM3NrKC/fF3/LoHjkut8AAnKmrW6a2uTzNKubigw8dEnpmpERw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.936.0", + "@aws-sdk/xml-builder": "3.930.0", + "@smithy/core": "^3.18.5", + "@smithy/node-config-provider": "^4.3.5", + "@smithy/property-provider": "^4.2.5", + "@smithy/protocol-http": "^5.3.5", + "@smithy/signature-v4": "^5.3.5", + "@smithy/smithy-client": "^4.9.8", + "@smithy/types": "^4.9.0", + "@smithy/util-base64": "^4.3.0", + "@smithy/util-middleware": "^4.2.5", + "@smithy/util-utf8": "^4.2.0", "tslib": "^2.6.2" }, "engines": { @@ -334,14 +374,15 @@ } }, "node_modules/@aws-sdk/credential-provider-env": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.840.0.tgz", - "integrity": "sha512-EzF6VcJK7XvQ/G15AVEfJzN2mNXU8fcVpXo4bRyr1S6t2q5zx6UPH/XjDbn18xyUmOq01t+r8gG+TmHEVo18fA==", - "dependencies": { - "@aws-sdk/core": "3.840.0", - "@aws-sdk/types": "3.840.0", - "@smithy/property-provider": "^4.0.4", - "@smithy/types": "^4.3.1", + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.936.0.tgz", + "integrity": "sha512-dKajFuaugEA5i9gCKzOaVy9uTeZcApE+7Z5wdcZ6j40523fY1a56khDAUYkCfwqa7sHci4ccmxBkAo+fW1RChA==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.936.0", + "@aws-sdk/types": "3.936.0", + "@smithy/property-provider": "^4.2.5", + "@smithy/types": "^4.9.0", "tslib": "^2.6.2" }, "engines": { @@ -349,19 +390,20 @@ } }, "node_modules/@aws-sdk/credential-provider-http": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.840.0.tgz", - "integrity": "sha512-wbnUiPGLVea6mXbUh04fu+VJmGkQvmToPeTYdHE8eRZq3NRDi3t3WltT+jArLBKD/4NppRpMjf2ju4coMCz91g==", - "dependencies": { - "@aws-sdk/core": "3.840.0", - "@aws-sdk/types": "3.840.0", - "@smithy/fetch-http-handler": "^5.0.4", - "@smithy/node-http-handler": "^4.0.6", - "@smithy/property-provider": "^4.0.4", - "@smithy/protocol-http": "^5.1.2", - "@smithy/smithy-client": "^4.4.5", - "@smithy/types": "^4.3.1", - "@smithy/util-stream": "^4.2.2", + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.936.0.tgz", + "integrity": "sha512-5FguODLXG1tWx/x8fBxH+GVrk7Hey2LbXV5h9SFzYCx/2h50URBm0+9hndg0Rd23+xzYe14F6SI9HA9c1sPnjg==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.936.0", + "@aws-sdk/types": "3.936.0", + "@smithy/fetch-http-handler": "^5.3.6", + "@smithy/node-http-handler": "^4.4.5", + "@smithy/property-provider": "^4.2.5", + "@smithy/protocol-http": "^5.3.5", + "@smithy/smithy-client": "^4.9.8", + "@smithy/types": "^4.9.0", + "@smithy/util-stream": "^4.5.6", "tslib": "^2.6.2" }, "engines": { @@ -369,22 +411,43 @@ } }, "node_modules/@aws-sdk/credential-provider-ini": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.840.0.tgz", - "integrity": "sha512-7F290BsWydShHb+7InXd+IjJc3mlEIm9I0R57F/Pjl1xZB69MdkhVGCnuETWoBt4g53ktJd6NEjzm/iAhFXFmw==", - "dependencies": { - "@aws-sdk/core": "3.840.0", - "@aws-sdk/credential-provider-env": "3.840.0", - "@aws-sdk/credential-provider-http": "3.840.0", - "@aws-sdk/credential-provider-process": "3.840.0", - "@aws-sdk/credential-provider-sso": "3.840.0", - "@aws-sdk/credential-provider-web-identity": "3.840.0", - "@aws-sdk/nested-clients": "3.840.0", - "@aws-sdk/types": "3.840.0", - "@smithy/credential-provider-imds": "^4.0.6", - "@smithy/property-provider": "^4.0.4", - "@smithy/shared-ini-file-loader": "^4.0.4", - "@smithy/types": "^4.3.1", + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.936.0.tgz", + "integrity": "sha512-TbUv56ERQQujoHcLMcfL0Q6bVZfYF83gu/TjHkVkdSlHPOIKaG/mhE2XZSQzXv1cud6LlgeBbfzVAxJ+HPpffg==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.936.0", + "@aws-sdk/credential-provider-env": "3.936.0", + "@aws-sdk/credential-provider-http": "3.936.0", + "@aws-sdk/credential-provider-login": "3.936.0", + "@aws-sdk/credential-provider-process": "3.936.0", + "@aws-sdk/credential-provider-sso": "3.936.0", + "@aws-sdk/credential-provider-web-identity": "3.936.0", + "@aws-sdk/nested-clients": "3.936.0", + "@aws-sdk/types": "3.936.0", + "@smithy/credential-provider-imds": "^4.2.5", + "@smithy/property-provider": "^4.2.5", + "@smithy/shared-ini-file-loader": "^4.4.0", + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-login": { + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-login/-/credential-provider-login-3.936.0.tgz", + "integrity": "sha512-8DVrdRqPyUU66gfV7VZNToh56ZuO5D6agWrkLQE/xbLJOm2RbeRgh6buz7CqV8ipRd6m+zCl9mM4F3osQLZn8Q==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.936.0", + "@aws-sdk/nested-clients": "3.936.0", + "@aws-sdk/types": "3.936.0", + "@smithy/property-provider": "^4.2.5", + "@smithy/protocol-http": "^5.3.5", + "@smithy/shared-ini-file-loader": "^4.4.0", + "@smithy/types": "^4.9.0", "tslib": "^2.6.2" }, "engines": { @@ -392,21 +455,22 @@ } }, "node_modules/@aws-sdk/credential-provider-node": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.840.0.tgz", - "integrity": "sha512-KufP8JnxA31wxklLm63evUPSFApGcH8X86z3mv9SRbpCm5ycgWIGVCTXpTOdgq6rPZrwT9pftzv2/b4mV/9clg==", - "dependencies": { - "@aws-sdk/credential-provider-env": "3.840.0", - "@aws-sdk/credential-provider-http": "3.840.0", - "@aws-sdk/credential-provider-ini": "3.840.0", - "@aws-sdk/credential-provider-process": "3.840.0", - "@aws-sdk/credential-provider-sso": "3.840.0", - "@aws-sdk/credential-provider-web-identity": "3.840.0", - "@aws-sdk/types": "3.840.0", - "@smithy/credential-provider-imds": "^4.0.6", - "@smithy/property-provider": "^4.0.4", - "@smithy/shared-ini-file-loader": "^4.0.4", - "@smithy/types": "^4.3.1", + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.936.0.tgz", + "integrity": "sha512-rk/2PCtxX9xDsQW8p5Yjoca3StqmQcSfkmD7nQ61AqAHL1YgpSQWqHE+HjfGGiHDYKG7PvE33Ku2GyA7lEIJAw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/credential-provider-env": "3.936.0", + "@aws-sdk/credential-provider-http": "3.936.0", + "@aws-sdk/credential-provider-ini": "3.936.0", + "@aws-sdk/credential-provider-process": "3.936.0", + "@aws-sdk/credential-provider-sso": "3.936.0", + "@aws-sdk/credential-provider-web-identity": "3.936.0", + "@aws-sdk/types": "3.936.0", + "@smithy/credential-provider-imds": "^4.2.5", + "@smithy/property-provider": "^4.2.5", + "@smithy/shared-ini-file-loader": "^4.4.0", + "@smithy/types": "^4.9.0", "tslib": "^2.6.2" }, "engines": { @@ -414,15 +478,16 @@ } }, "node_modules/@aws-sdk/credential-provider-process": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.840.0.tgz", - "integrity": "sha512-HkDQWHy8tCI4A0Ps2NVtuVYMv9cB4y/IuD/TdOsqeRIAT12h8jDb98BwQPNLAImAOwOWzZJ8Cu0xtSpX7CQhMw==", - "dependencies": { - "@aws-sdk/core": "3.840.0", - "@aws-sdk/types": "3.840.0", - "@smithy/property-provider": "^4.0.4", - "@smithy/shared-ini-file-loader": "^4.0.4", - "@smithy/types": "^4.3.1", + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.936.0.tgz", + "integrity": "sha512-GpA4AcHb96KQK2PSPUyvChvrsEKiLhQ5NWjeef2IZ3Jc8JoosiedYqp6yhZR+S8cTysuvx56WyJIJc8y8OTrLA==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.936.0", + "@aws-sdk/types": "3.936.0", + "@smithy/property-provider": "^4.2.5", + "@smithy/shared-ini-file-loader": "^4.4.0", + "@smithy/types": "^4.9.0", "tslib": "^2.6.2" }, "engines": { @@ -430,17 +495,18 @@ } }, "node_modules/@aws-sdk/credential-provider-sso": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.840.0.tgz", - "integrity": "sha512-2qgdtdd6R0Z1y0KL8gzzwFUGmhBHSUx4zy85L2XV1CXhpRNwV71SVWJqLDVV5RVWVf9mg50Pm3AWrUC0xb0pcA==", - "dependencies": { - "@aws-sdk/client-sso": "3.840.0", - "@aws-sdk/core": "3.840.0", - "@aws-sdk/token-providers": "3.840.0", - "@aws-sdk/types": "3.840.0", - "@smithy/property-provider": "^4.0.4", - "@smithy/shared-ini-file-loader": "^4.0.4", - "@smithy/types": "^4.3.1", + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.936.0.tgz", + "integrity": "sha512-wHlEAJJvtnSyxTfNhN98JcU4taA1ED2JvuI2eePgawqBwS/Tzi0mhED1lvNIaWOkjfLd+nHALwszGrtJwEq4yQ==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/client-sso": "3.936.0", + "@aws-sdk/core": "3.936.0", + "@aws-sdk/token-providers": "3.936.0", + "@aws-sdk/types": "3.936.0", + "@smithy/property-provider": "^4.2.5", + "@smithy/shared-ini-file-loader": "^4.4.0", + "@smithy/types": "^4.9.0", "tslib": "^2.6.2" }, "engines": { @@ -448,15 +514,17 @@ } }, "node_modules/@aws-sdk/credential-provider-web-identity": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.840.0.tgz", - "integrity": "sha512-dpEeVXG8uNZSmVXReE4WP0lwoioX2gstk4RnUgrdUE3YaPq8A+hJiVAyc3h+cjDeIqfbsQbZm9qFetKC2LF9dQ==", - "dependencies": { - "@aws-sdk/core": "3.840.0", - "@aws-sdk/nested-clients": "3.840.0", - "@aws-sdk/types": "3.840.0", - "@smithy/property-provider": "^4.0.4", - "@smithy/types": "^4.3.1", + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.936.0.tgz", + "integrity": "sha512-v3qHAuoODkoRXsAF4RG+ZVO6q2P9yYBT4GMpMEfU9wXVNn7AIfwZgTwzSUfnjNiGva5BKleWVpRpJ9DeuLFbUg==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.936.0", + "@aws-sdk/nested-clients": "3.936.0", + "@aws-sdk/types": "3.936.0", + "@smithy/property-provider": "^4.2.5", + "@smithy/shared-ini-file-loader": "^4.4.0", + "@smithy/types": "^4.9.0", "tslib": "^2.6.2" }, "engines": { @@ -464,13 +532,14 @@ } }, "node_modules/@aws-sdk/middleware-host-header": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.840.0.tgz", - "integrity": "sha512-ub+hXJAbAje94+Ya6c6eL7sYujoE8D4Bumu1NUI8TXjUhVVn0HzVWQjpRLshdLsUp1AW7XyeJaxyajRaJQ8+Xg==", + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.936.0.tgz", + "integrity": "sha512-tAaObaAnsP1XnLGndfkGWFuzrJYuk9W0b/nLvol66t8FZExIAf/WdkT2NNAWOYxljVs++oHnyHBCxIlaHrzSiw==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.840.0", - "@smithy/protocol-http": "^5.1.2", - "@smithy/types": "^4.3.1", + "@aws-sdk/types": "3.936.0", + "@smithy/protocol-http": "^5.3.5", + "@smithy/types": "^4.9.0", "tslib": "^2.6.2" }, "engines": { @@ -478,12 +547,13 @@ } }, "node_modules/@aws-sdk/middleware-logger": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.840.0.tgz", - "integrity": "sha512-lSV8FvjpdllpGaRspywss4CtXV8M7NNNH+2/j86vMH+YCOZ6fu2T/TyFd/tHwZ92vDfHctWkRbQxg0bagqwovA==", + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.936.0.tgz", + "integrity": "sha512-aPSJ12d3a3Ea5nyEnLbijCaaYJT2QjQ9iW+zGh5QcZYXmOGWbKVyPSxmVOboZQG+c1M8t6d2O7tqrwzIq8L8qw==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.840.0", - "@smithy/types": "^4.3.1", + "@aws-sdk/types": "3.936.0", + "@smithy/types": "^4.9.0", "tslib": "^2.6.2" }, "engines": { @@ -491,13 +561,15 @@ } }, "node_modules/@aws-sdk/middleware-recursion-detection": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.840.0.tgz", - "integrity": "sha512-Gu7lGDyfddyhIkj1Z1JtrY5NHb5+x/CRiB87GjaSrKxkDaydtX2CU977JIABtt69l9wLbcGDIQ+W0uJ5xPof7g==", + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.936.0.tgz", + "integrity": "sha512-l4aGbHpXM45YNgXggIux1HgsCVAvvBoqHPkqLnqMl9QVapfuSTjJHfDYDsx1Xxct6/m7qSMUzanBALhiaGO2fA==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.840.0", - "@smithy/protocol-http": "^5.1.2", - "@smithy/types": "^4.3.1", + "@aws-sdk/types": "3.936.0", + "@aws/lambda-invoke-store": "^0.2.0", + "@smithy/protocol-http": "^5.3.5", + "@smithy/types": "^4.9.0", "tslib": "^2.6.2" }, "engines": { @@ -505,15 +577,16 @@ } }, "node_modules/@aws-sdk/middleware-sdk-sqs": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-sqs/-/middleware-sdk-sqs-3.840.0.tgz", - "integrity": "sha512-NJVSWkidhfKvU8CTqK17mJnP2IPuJxgbjbSHm3gmvamuewTM291cdgU/xM8eKhHfiF8Us8P7rji3ZhoOzz797w==", - "dependencies": { - "@aws-sdk/types": "3.840.0", - "@smithy/smithy-client": "^4.4.5", - "@smithy/types": "^4.3.1", - "@smithy/util-hex-encoding": "^4.0.0", - "@smithy/util-utf8": "^4.0.0", + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-sqs/-/middleware-sdk-sqs-3.936.0.tgz", + "integrity": "sha512-39WohFCCPeD6LV8zLQq7CyYbIieetEDDNLsEPeGJSh2Uv9qpY9r6zJRSTjb8hTuQbHDSEOGntHMYKpLoHdoxdQ==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.936.0", + "@smithy/smithy-client": "^4.9.8", + "@smithy/types": "^4.9.0", + "@smithy/util-hex-encoding": "^4.2.0", + "@smithy/util-utf8": "^4.2.0", "tslib": "^2.6.2" }, "engines": { @@ -521,16 +594,17 @@ } }, "node_modules/@aws-sdk/middleware-user-agent": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.840.0.tgz", - "integrity": "sha512-hiiMf7BP5ZkAFAvWRcK67Mw/g55ar7OCrvrynC92hunx/xhMkrgSLM0EXIZ1oTn3uql9kH/qqGF0nqsK6K555A==", - "dependencies": { - "@aws-sdk/core": "3.840.0", - "@aws-sdk/types": "3.840.0", - "@aws-sdk/util-endpoints": "3.840.0", - "@smithy/core": "^3.6.0", - "@smithy/protocol-http": "^5.1.2", - "@smithy/types": "^4.3.1", + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.936.0.tgz", + "integrity": "sha512-YB40IPa7K3iaYX0lSnV9easDOLPLh+fJyUDF3BH8doX4i1AOSsYn86L4lVldmOaSX+DwiaqKHpvk4wPBdcIPWw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.936.0", + "@aws-sdk/types": "3.936.0", + "@aws-sdk/util-endpoints": "3.936.0", + "@smithy/core": "^3.18.5", + "@smithy/protocol-http": "^5.3.5", + "@smithy/types": "^4.9.0", "tslib": "^2.6.2" }, "engines": { @@ -538,47 +612,48 @@ } }, "node_modules/@aws-sdk/nested-clients": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/nested-clients/-/nested-clients-3.840.0.tgz", - "integrity": "sha512-LXYYo9+n4hRqnRSIMXLBb+BLz+cEmjMtTudwK1BF6Bn2RfdDv29KuyeDRrPCS3TwKl7ZKmXUmE9n5UuHAPfBpA==", + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/nested-clients/-/nested-clients-3.936.0.tgz", + "integrity": "sha512-eyj2tz1XmDSLSZQ5xnB7cLTVKkSJnYAEoNDSUNhzWPxrBDYeJzIbatecOKceKCU8NBf8gWWZCK/CSY0mDxMO0A==", + "license": "Apache-2.0", "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.840.0", - "@aws-sdk/middleware-host-header": "3.840.0", - "@aws-sdk/middleware-logger": "3.840.0", - "@aws-sdk/middleware-recursion-detection": "3.840.0", - "@aws-sdk/middleware-user-agent": "3.840.0", - "@aws-sdk/region-config-resolver": "3.840.0", - "@aws-sdk/types": "3.840.0", - "@aws-sdk/util-endpoints": "3.840.0", - "@aws-sdk/util-user-agent-browser": "3.840.0", - "@aws-sdk/util-user-agent-node": "3.840.0", - "@smithy/config-resolver": "^4.1.4", - "@smithy/core": "^3.6.0", - "@smithy/fetch-http-handler": "^5.0.4", - "@smithy/hash-node": "^4.0.4", - "@smithy/invalid-dependency": "^4.0.4", - "@smithy/middleware-content-length": "^4.0.4", - "@smithy/middleware-endpoint": "^4.1.13", - "@smithy/middleware-retry": "^4.1.14", - "@smithy/middleware-serde": "^4.0.8", - "@smithy/middleware-stack": "^4.0.4", - "@smithy/node-config-provider": "^4.1.3", - "@smithy/node-http-handler": "^4.0.6", - "@smithy/protocol-http": "^5.1.2", - "@smithy/smithy-client": "^4.4.5", - "@smithy/types": "^4.3.1", - "@smithy/url-parser": "^4.0.4", - "@smithy/util-base64": "^4.0.0", - "@smithy/util-body-length-browser": "^4.0.0", - "@smithy/util-body-length-node": "^4.0.0", - "@smithy/util-defaults-mode-browser": "^4.0.21", - "@smithy/util-defaults-mode-node": "^4.0.21", - "@smithy/util-endpoints": "^3.0.6", - "@smithy/util-middleware": "^4.0.4", - "@smithy/util-retry": "^4.0.6", - "@smithy/util-utf8": "^4.0.0", + "@aws-sdk/core": "3.936.0", + "@aws-sdk/middleware-host-header": "3.936.0", + "@aws-sdk/middleware-logger": "3.936.0", + "@aws-sdk/middleware-recursion-detection": "3.936.0", + "@aws-sdk/middleware-user-agent": "3.936.0", + "@aws-sdk/region-config-resolver": "3.936.0", + "@aws-sdk/types": "3.936.0", + "@aws-sdk/util-endpoints": "3.936.0", + "@aws-sdk/util-user-agent-browser": "3.936.0", + "@aws-sdk/util-user-agent-node": "3.936.0", + "@smithy/config-resolver": "^4.4.3", + "@smithy/core": "^3.18.5", + "@smithy/fetch-http-handler": "^5.3.6", + "@smithy/hash-node": "^4.2.5", + "@smithy/invalid-dependency": "^4.2.5", + "@smithy/middleware-content-length": "^4.2.5", + "@smithy/middleware-endpoint": "^4.3.12", + "@smithy/middleware-retry": "^4.4.12", + "@smithy/middleware-serde": "^4.2.6", + "@smithy/middleware-stack": "^4.2.5", + "@smithy/node-config-provider": "^4.3.5", + "@smithy/node-http-handler": "^4.4.5", + "@smithy/protocol-http": "^5.3.5", + "@smithy/smithy-client": "^4.9.8", + "@smithy/types": "^4.9.0", + "@smithy/url-parser": "^4.2.5", + "@smithy/util-base64": "^4.3.0", + "@smithy/util-body-length-browser": "^4.2.0", + "@smithy/util-body-length-node": "^4.2.1", + "@smithy/util-defaults-mode-browser": "^4.3.11", + "@smithy/util-defaults-mode-node": "^4.2.14", + "@smithy/util-endpoints": "^3.2.5", + "@smithy/util-middleware": "^4.2.5", + "@smithy/util-retry": "^4.2.5", + "@smithy/util-utf8": "^4.2.0", "tslib": "^2.6.2" }, "engines": { @@ -586,15 +661,15 @@ } }, "node_modules/@aws-sdk/region-config-resolver": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.840.0.tgz", - "integrity": "sha512-Qjnxd/yDv9KpIMWr90ZDPtRj0v75AqGC92Lm9+oHXZ8p1MjG5JE2CW0HL8JRgK9iKzgKBL7pPQRXI8FkvEVfrA==", - "dependencies": { - "@aws-sdk/types": "3.840.0", - "@smithy/node-config-provider": "^4.1.3", - "@smithy/types": "^4.3.1", - "@smithy/util-config-provider": "^4.0.0", - "@smithy/util-middleware": "^4.0.4", + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.936.0.tgz", + "integrity": "sha512-wOKhzzWsshXGduxO4pqSiNyL9oUtk4BEvjWm9aaq6Hmfdoydq6v6t0rAGHWPjFwy9z2haovGRi3C8IxdMB4muw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.936.0", + "@smithy/config-resolver": "^4.4.3", + "@smithy/node-config-provider": "^4.3.5", + "@smithy/types": "^4.9.0", "tslib": "^2.6.2" }, "engines": { @@ -602,16 +677,17 @@ } }, "node_modules/@aws-sdk/token-providers": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.840.0.tgz", - "integrity": "sha512-6BuTOLTXvmgwjK7ve7aTg9JaWFdM5UoMolLVPMyh3wTv9Ufalh8oklxYHUBIxsKkBGO2WiHXytveuxH6tAgTYg==", - "dependencies": { - "@aws-sdk/core": "3.840.0", - "@aws-sdk/nested-clients": "3.840.0", - "@aws-sdk/types": "3.840.0", - "@smithy/property-provider": "^4.0.4", - "@smithy/shared-ini-file-loader": "^4.0.4", - "@smithy/types": "^4.3.1", + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.936.0.tgz", + "integrity": "sha512-vvw8+VXk0I+IsoxZw0mX9TMJawUJvEsg3EF7zcCSetwhNPAU8Xmlhv7E/sN/FgSmm7b7DsqKoW6rVtQiCs1PWQ==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.936.0", + "@aws-sdk/nested-clients": "3.936.0", + "@aws-sdk/types": "3.936.0", + "@smithy/property-provider": "^4.2.5", + "@smithy/shared-ini-file-loader": "^4.4.0", + "@smithy/types": "^4.9.0", "tslib": "^2.6.2" }, "engines": { @@ -619,11 +695,12 @@ } }, "node_modules/@aws-sdk/types": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.840.0.tgz", - "integrity": "sha512-xliuHaUFZxEx1NSXeLLZ9Dyu6+EJVQKEoD+yM+zqUo3YDZ7medKJWY6fIOKiPX/N7XbLdBYwajb15Q7IL8KkeA==", + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.936.0.tgz", + "integrity": "sha512-uz0/VlMd2pP5MepdrHizd+T+OKfyK4r3OA9JI+L/lPKg0YFQosdJNCKisr6o70E3dh8iMpFYxF1UN/4uZsyARg==", + "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.3.1", + "@smithy/types": "^4.9.0", "tslib": "^2.6.2" }, "engines": { @@ -631,13 +708,15 @@ } }, "node_modules/@aws-sdk/util-endpoints": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.840.0.tgz", - "integrity": "sha512-eqE9ROdg/Kk0rj3poutyRCFauPDXIf/WSvCqFiRDDVi6QOnCv/M0g2XW8/jSvkJlOyaXkNCptapIp6BeeFFGYw==", + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.936.0.tgz", + "integrity": "sha512-0Zx3Ntdpu+z9Wlm7JKUBOzS9EunwKAb4KdGUQQxDqh5Lc3ta5uBoub+FgmVuzwnmBu9U1Os8UuwVTH0Lgu+P5w==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.840.0", - "@smithy/types": "^4.3.1", - "@smithy/util-endpoints": "^3.0.6", + "@aws-sdk/types": "3.936.0", + "@smithy/types": "^4.9.0", + "@smithy/url-parser": "^4.2.5", + "@smithy/util-endpoints": "^3.2.5", "tslib": "^2.6.2" }, "engines": { @@ -645,9 +724,10 @@ } }, "node_modules/@aws-sdk/util-locate-window": { - "version": "3.804.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-locate-window/-/util-locate-window-3.804.0.tgz", - "integrity": "sha512-zVoRfpmBVPodYlnMjgVjfGoEZagyRF5IPn3Uo6ZvOZp24chnW/FRstH7ESDHDDRga4z3V+ElUQHKpFDXWyBW5A==", + "version": "3.893.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-locate-window/-/util-locate-window-3.893.0.tgz", + "integrity": "sha512-T89pFfgat6c8nMmpI8eKjBcDcgJq36+m9oiXbcUzeU55MP9ZuGgBomGjGnHaEyF36jenW9gmg3NfZDm0AO2XPg==", + "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" }, @@ -656,25 +736,27 @@ } }, "node_modules/@aws-sdk/util-user-agent-browser": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.840.0.tgz", - "integrity": "sha512-JdyZM3EhhL4PqwFpttZu1afDpPJCCc3eyZOLi+srpX11LsGj6sThf47TYQN75HT1CarZ7cCdQHGzP2uy3/xHfQ==", + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.936.0.tgz", + "integrity": "sha512-eZ/XF6NxMtu+iCma58GRNRxSq4lHo6zHQLOZRIeL/ghqYJirqHdenMOwrzPettj60KWlv827RVebP9oNVrwZbw==", + "license": "Apache-2.0", "dependencies": { - "@aws-sdk/types": "3.840.0", - "@smithy/types": "^4.3.1", + "@aws-sdk/types": "3.936.0", + "@smithy/types": "^4.9.0", "bowser": "^2.11.0", "tslib": "^2.6.2" } }, "node_modules/@aws-sdk/util-user-agent-node": { - "version": "3.840.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.840.0.tgz", - "integrity": "sha512-Fy5JUEDQU1tPm2Yw/YqRYYc27W5+QD/J4mYvQvdWjUGZLB5q3eLFMGD35Uc28ZFoGMufPr4OCxK/bRfWROBRHQ==", - "dependencies": { - "@aws-sdk/middleware-user-agent": "3.840.0", - "@aws-sdk/types": "3.840.0", - "@smithy/node-config-provider": "^4.1.3", - "@smithy/types": "^4.3.1", + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.936.0.tgz", + "integrity": "sha512-XOEc7PF9Op00pWV2AYCGDSu5iHgYjIO53Py2VUQTIvP7SRCaCsXmA33mjBvC2Ms6FhSyWNa4aK4naUGIz0hQcw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/middleware-user-agent": "3.936.0", + "@aws-sdk/types": "3.936.0", + "@smithy/node-config-provider": "^4.3.5", + "@smithy/types": "^4.9.0", "tslib": "^2.6.2" }, "engines": { @@ -690,51 +772,383 @@ } }, "node_modules/@aws-sdk/xml-builder": { - "version": "3.821.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/xml-builder/-/xml-builder-3.821.0.tgz", - "integrity": "sha512-DIIotRnefVL6DiaHtO6/21DhJ4JZnnIwdNbpwiAhdt/AVbttcE4yw925gsjur0OGv5BTYXQXU3YnANBYnZjuQA==", + "version": "3.930.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/xml-builder/-/xml-builder-3.930.0.tgz", + "integrity": "sha512-YIfkD17GocxdmlUVc3ia52QhcWuRIUJonbF8A2CYfcWNV3HzvAqpcPeC0bYUhkK+8e8YO1ARnLKZQE0TlwzorA==", + "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.3.1", + "@smithy/types": "^4.9.0", + "fast-xml-parser": "5.2.5", "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, + "node_modules/@aws/lambda-invoke-store": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@aws/lambda-invoke-store/-/lambda-invoke-store-0.2.1.tgz", + "integrity": "sha512-sIyFcoPZkTtNu9xFeEoynMef3bPJIAbOfUh+ueYcfhVl6xm2VRtMcMclSxmZCMnHHd4hlYKJeq/aggmBEWynww==", + "license": "Apache-2.0", + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.27.1", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", + "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/runtime": { - "version": "7.27.6", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.6.tgz", - "integrity": "sha512-vbavdySgbTTrmFE+EsiqUTzlOr5bzlnJtUv9PynGCAKvfQqjIXbvFdumPM/GxMDfyuGMJaJAU6TO4zc1Jf1i8Q==", + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.4.tgz", + "integrity": "sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ==", + "license": "MIT", "engines": { "node": ">=6.9.0" } }, + "node_modules/@borewit/text-codec": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@borewit/text-codec/-/text-codec-0.2.0.tgz", + "integrity": "sha512-X999CKBxGwX8wW+4gFibsbiNdwqmdQEXmUejIWaIqdrHBgS5ARIOOeyiQbHjP9G58xVEPcuvP6VwwH3A0OFTOA==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, + "node_modules/@cacheable/memory": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@cacheable/memory/-/memory-2.0.5.tgz", + "integrity": "sha512-fkiAxCvssEyJZ5fxX4tcdZFRmW9JehSTGvvqmXn6rTzG5cH6V/3C4ad8yb01vOjp2xBydHkHrgpW0qeGtzt6VQ==", + "license": "MIT", + "dependencies": { + "@cacheable/utils": "^2.3.0", + "@keyv/bigmap": "^1.1.0", + "hookified": "^1.12.2", + "keyv": "^5.5.4" + } + }, "node_modules/@cacheable/node-cache": { - "version": "1.5.8", - "resolved": "https://registry.npmjs.org/@cacheable/node-cache/-/node-cache-1.5.8.tgz", - "integrity": "sha512-jGemkxcOnc/quqRVfulTiX+fbFXqACd+dzf45iL7xCe6Tyu4ZUyfcjY5nPOGSim/+pV/yM7QxUFn2HICo8RHQg==", + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/@cacheable/node-cache/-/node-cache-1.7.5.tgz", + "integrity": "sha512-awY5UuLseuR5ytutXefzyEQeVXCm1reQqahAp1Qd39+mTzOaTV3VJx9qoX7juICEfYI0Q1SFj2m2+83l6+6UbQ==", + "license": "MIT", + "dependencies": { + "cacheable": "^2.2.0", + "hookified": "^1.13.0", + "keyv": "^5.5.4" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@cacheable/utils": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@cacheable/utils/-/utils-2.3.1.tgz", + "integrity": "sha512-38NJXjIr4W1Sghun8ju+uYWD8h2c61B4dKwfnQHVDFpAJ9oS28RpfqZQJ6Dgd3RceGkILDY9YT+72HJR3LoeSQ==", + "license": "MIT", + "dependencies": { + "hashery": "^1.2.0", + "keyv": "^5.5.4" + } + }, + "node_modules/@commitlint/cli": { + "version": "19.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-19.8.1.tgz", + "integrity": "sha512-LXUdNIkspyxrlV6VDHWBmCZRtkEVRpBKxi2Gtw3J54cGWhLCTouVD/Q6ZSaSvd2YaDObWK8mDjrz3TIKtaQMAA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/format": "^19.8.1", + "@commitlint/lint": "^19.8.1", + "@commitlint/load": "^19.8.1", + "@commitlint/read": "^19.8.1", + "@commitlint/types": "^19.8.1", + "tinyexec": "^1.0.0", + "yargs": "^17.0.0" + }, + "bin": { + "commitlint": "cli.js" + }, + "engines": { + "node": ">=v18" + } + }, + "node_modules/@commitlint/config-conventional": { + "version": "19.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/config-conventional/-/config-conventional-19.8.1.tgz", + "integrity": "sha512-/AZHJL6F6B/G959CsMAzrPKKZjeEiAVifRyEwXxcT6qtqbPwGw+iQxmNS+Bu+i09OCtdNRW6pNpBvgPrtMr9EQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/types": "^19.8.1", + "conventional-changelog-conventionalcommits": "^7.0.2" + }, + "engines": { + "node": ">=v18" + } + }, + "node_modules/@commitlint/config-validator": { + "version": "19.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/config-validator/-/config-validator-19.8.1.tgz", + "integrity": "sha512-0jvJ4u+eqGPBIzzSdqKNX1rvdbSU1lPNYlfQQRIFnBgLy26BtC0cFnr7c/AyuzExMxWsMOte6MkTi9I3SQ3iGQ==", + "dev": true, + "license": "MIT", "dependencies": { - "cacheable": "^1.10.1", - "hookified": "^1.10.0", - "keyv": "^5.3.4" + "@commitlint/types": "^19.8.1", + "ajv": "^8.11.0" + }, + "engines": { + "node": ">=v18" + } + }, + "node_modules/@commitlint/ensure": { + "version": "19.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/ensure/-/ensure-19.8.1.tgz", + "integrity": "sha512-mXDnlJdvDzSObafjYrOSvZBwkD01cqB4gbnnFuVyNpGUM5ijwU/r/6uqUmBXAAOKRfyEjpkGVZxaDsCVnHAgyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/types": "^19.8.1", + "lodash.camelcase": "^4.3.0", + "lodash.kebabcase": "^4.1.1", + "lodash.snakecase": "^4.1.1", + "lodash.startcase": "^4.4.0", + "lodash.upperfirst": "^4.3.1" + }, + "engines": { + "node": ">=v18" + } + }, + "node_modules/@commitlint/execute-rule": { + "version": "19.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/execute-rule/-/execute-rule-19.8.1.tgz", + "integrity": "sha512-YfJyIqIKWI64Mgvn/sE7FXvVMQER/Cd+s3hZke6cI1xgNT/f6ZAz5heND0QtffH+KbcqAwXDEE1/5niYayYaQA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=v18" + } + }, + "node_modules/@commitlint/format": { + "version": "19.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/format/-/format-19.8.1.tgz", + "integrity": "sha512-kSJj34Rp10ItP+Eh9oCItiuN/HwGQMXBnIRk69jdOwEW9llW9FlyqcWYbHPSGofmjsqeoxa38UaEA5tsbm2JWw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/types": "^19.8.1", + "chalk": "^5.3.0" + }, + "engines": { + "node": ">=v18" + } + }, + "node_modules/@commitlint/is-ignored": { + "version": "19.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-19.8.1.tgz", + "integrity": "sha512-AceOhEhekBUQ5dzrVhDDsbMaY5LqtN8s1mqSnT2Kz1ERvVZkNihrs3Sfk1Je/rxRNbXYFzKZSHaPsEJJDJV8dg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/types": "^19.8.1", + "semver": "^7.6.0" + }, + "engines": { + "node": ">=v18" + } + }, + "node_modules/@commitlint/lint": { + "version": "19.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/lint/-/lint-19.8.1.tgz", + "integrity": "sha512-52PFbsl+1EvMuokZXLRlOsdcLHf10isTPlWwoY1FQIidTsTvjKXVXYb7AvtpWkDzRO2ZsqIgPK7bI98x8LRUEw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/is-ignored": "^19.8.1", + "@commitlint/parse": "^19.8.1", + "@commitlint/rules": "^19.8.1", + "@commitlint/types": "^19.8.1" + }, + "engines": { + "node": ">=v18" + } + }, + "node_modules/@commitlint/load": { + "version": "19.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-19.8.1.tgz", + "integrity": "sha512-9V99EKG3u7z+FEoe4ikgq7YGRCSukAcvmKQuTtUyiYPnOd9a2/H9Ak1J9nJA1HChRQp9OA/sIKPugGS+FK/k1A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/config-validator": "^19.8.1", + "@commitlint/execute-rule": "^19.8.1", + "@commitlint/resolve-extends": "^19.8.1", + "@commitlint/types": "^19.8.1", + "chalk": "^5.3.0", + "cosmiconfig": "^9.0.0", + "cosmiconfig-typescript-loader": "^6.1.0", + "lodash.isplainobject": "^4.0.6", + "lodash.merge": "^4.6.2", + "lodash.uniq": "^4.5.0" + }, + "engines": { + "node": ">=v18" + } + }, + "node_modules/@commitlint/message": { + "version": "19.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/message/-/message-19.8.1.tgz", + "integrity": "sha512-+PMLQvjRXiU+Ae0Wc+p99EoGEutzSXFVwQfa3jRNUZLNW5odZAyseb92OSBTKCu+9gGZiJASt76Cj3dLTtcTdg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=v18" + } + }, + "node_modules/@commitlint/parse": { + "version": "19.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/parse/-/parse-19.8.1.tgz", + "integrity": "sha512-mmAHYcMBmAgJDKWdkjIGq50X4yB0pSGpxyOODwYmoexxxiUCy5JJT99t1+PEMK7KtsCtzuWYIAXYAiKR+k+/Jw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/types": "^19.8.1", + "conventional-changelog-angular": "^7.0.0", + "conventional-commits-parser": "^5.0.0" + }, + "engines": { + "node": ">=v18" + } + }, + "node_modules/@commitlint/read": { + "version": "19.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/read/-/read-19.8.1.tgz", + "integrity": "sha512-03Jbjb1MqluaVXKHKRuGhcKWtSgh3Jizqy2lJCRbRrnWpcM06MYm8th59Xcns8EqBYvo0Xqb+2DoZFlga97uXQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/top-level": "^19.8.1", + "@commitlint/types": "^19.8.1", + "git-raw-commits": "^4.0.0", + "minimist": "^1.2.8", + "tinyexec": "^1.0.0" + }, + "engines": { + "node": ">=v18" + } + }, + "node_modules/@commitlint/resolve-extends": { + "version": "19.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-19.8.1.tgz", + "integrity": "sha512-GM0mAhFk49I+T/5UCYns5ayGStkTt4XFFrjjf0L4S26xoMTSkdCf9ZRO8en1kuopC4isDFuEm7ZOm/WRVeElVg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/config-validator": "^19.8.1", + "@commitlint/types": "^19.8.1", + "global-directory": "^4.0.1", + "import-meta-resolve": "^4.0.0", + "lodash.mergewith": "^4.6.2", + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=v18" + } + }, + "node_modules/@commitlint/rules": { + "version": "19.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/rules/-/rules-19.8.1.tgz", + "integrity": "sha512-Hnlhd9DyvGiGwjfjfToMi1dsnw1EXKGJNLTcsuGORHz6SS9swRgkBsou33MQ2n51/boIDrbsg4tIBbRpEWK2kw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/ensure": "^19.8.1", + "@commitlint/message": "^19.8.1", + "@commitlint/to-lines": "^19.8.1", + "@commitlint/types": "^19.8.1" + }, + "engines": { + "node": ">=v18" + } + }, + "node_modules/@commitlint/to-lines": { + "version": "19.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/to-lines/-/to-lines-19.8.1.tgz", + "integrity": "sha512-98Mm5inzbWTKuZQr2aW4SReY6WUukdWXuZhrqf1QdKPZBCCsXuG87c+iP0bwtD6DBnmVVQjgp4whoHRVixyPBg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=v18" + } + }, + "node_modules/@commitlint/top-level": { + "version": "19.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/top-level/-/top-level-19.8.1.tgz", + "integrity": "sha512-Ph8IN1IOHPSDhURCSXBz44+CIu+60duFwRsg6HqaISFHQHbmBtxVw4ZrFNIYUzEP7WwrNPxa2/5qJ//NK1FGcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "find-up": "^7.0.0" + }, + "engines": { + "node": ">=v18" + } + }, + "node_modules/@commitlint/types": { + "version": "19.8.1", + "resolved": "https://registry.npmjs.org/@commitlint/types/-/types-19.8.1.tgz", + "integrity": "sha512-/yCrWGCoA1SVKOks25EGadP9Pnj0oAIHGpl2wH2M2Y46dPM2ueb8wyCVOD7O3WCTkaJ0IkKvzhl1JY7+uCT2Dw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/conventional-commits-parser": "^5.0.0", + "chalk": "^5.3.0" + }, + "engines": { + "node": ">=v18" } }, "node_modules/@emnapi/runtime": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.4.4.tgz", - "integrity": "sha512-hHyapA4A3gPaDCNfiqyZUStTMqIkKRshqPIuDOXv1hcBnD4U3l8cP0T1HMCfGRxQ6V64TGCcoswChANyOAwbQg==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.7.1.tgz", + "integrity": "sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA==", + "license": "MIT", "optional": true, "dependencies": { "tslib": "^2.4.0" } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.6.tgz", - "integrity": "sha512-ShbM/3XxwuxjFiuVBHA+d3j5dyac0aEVVq1oluIDf71hUw0aRF59dV/efUsIwFnR6m8JNM2FjZOzmaZ8yG61kw==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.0.tgz", + "integrity": "sha512-KuZrd2hRjz01y5JK9mEBSD3Vj3mbCvemhT466rSuJYeE/hjuBrHfjjcjMdTm/sz7au+++sdbJZJmuBwQLuw68A==", "cpu": [ "ppc64" ], + "license": "MIT", "optional": true, "os": [ "aix" @@ -744,12 +1158,13 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.6.tgz", - "integrity": "sha512-S8ToEOVfg++AU/bHwdksHNnyLyVM+eMVAOf6yRKFitnwnbwwPNqKr3srzFRe7nzV69RQKb5DgchIX5pt3L53xg==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.0.tgz", + "integrity": "sha512-j67aezrPNYWJEOHUNLPj9maeJte7uSMM6gMoxfPC9hOg8N02JuQi/T7ewumf4tNvJadFkvLZMlAq73b9uwdMyQ==", "cpu": [ "arm" ], + "license": "MIT", "optional": true, "os": [ "android" @@ -759,12 +1174,13 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.6.tgz", - "integrity": "sha512-hd5zdUarsK6strW+3Wxi5qWws+rJhCCbMiC9QZyzoxfk5uHRIE8T287giQxzVpEvCwuJ9Qjg6bEjcRJcgfLqoA==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.0.tgz", + "integrity": "sha512-CC3vt4+1xZrs97/PKDkl0yN7w8edvU2vZvAFGD16n9F0Cvniy5qvzRXjfO1l94efczkkQE6g1x0i73Qf5uthOQ==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "android" @@ -774,12 +1190,13 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.6.tgz", - "integrity": "sha512-0Z7KpHSr3VBIO9A/1wcT3NTy7EB4oNC4upJ5ye3R7taCc2GUdeynSLArnon5G8scPwaU866d3H4BCrE5xLW25A==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.0.tgz", + "integrity": "sha512-wurMkF1nmQajBO1+0CJmcN17U4BP6GqNSROP8t0X/Jiw2ltYGLHpEksp9MpoBqkrFR3kv2/te6Sha26k3+yZ9Q==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "android" @@ -789,12 +1206,13 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.6.tgz", - "integrity": "sha512-FFCssz3XBavjxcFxKsGy2DYK5VSvJqa6y5HXljKzhRZ87LvEi13brPrf/wdyl/BbpbMKJNOr1Sd0jtW4Ge1pAA==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.0.tgz", + "integrity": "sha512-uJOQKYCcHhg07DL7i8MzjvS2LaP7W7Pn/7uA0B5S1EnqAirJtbyw4yC5jQ5qcFjHK9l6o/MX9QisBg12kNkdHg==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "darwin" @@ -804,12 +1222,13 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.6.tgz", - "integrity": "sha512-GfXs5kry/TkGM2vKqK2oyiLFygJRqKVhawu3+DOCk7OxLy/6jYkWXhlHwOoTb0WqGnWGAS7sooxbZowy+pK9Yg==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.0.tgz", + "integrity": "sha512-8mG6arH3yB/4ZXiEnXof5MK72dE6zM9cDvUcPtxhUZsDjESl9JipZYW60C3JGreKCEP+p8P/72r69m4AZGJd5g==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "darwin" @@ -819,12 +1238,13 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.6.tgz", - "integrity": "sha512-aoLF2c3OvDn2XDTRvn8hN6DRzVVpDlj2B/F66clWd/FHLiHaG3aVZjxQX2DYphA5y/evbdGvC6Us13tvyt4pWg==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.0.tgz", + "integrity": "sha512-9FHtyO988CwNMMOE3YIeci+UV+x5Zy8fI2qHNpsEtSF83YPBmE8UWmfYAQg6Ux7Gsmd4FejZqnEUZCMGaNQHQw==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "freebsd" @@ -834,12 +1254,13 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.6.tgz", - "integrity": "sha512-2SkqTjTSo2dYi/jzFbU9Plt1vk0+nNg8YC8rOXXea+iA3hfNJWebKYPs3xnOUf9+ZWhKAaxnQNUf2X9LOpeiMQ==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.0.tgz", + "integrity": "sha512-zCMeMXI4HS/tXvJz8vWGexpZj2YVtRAihHLk1imZj4efx1BQzN76YFeKqlDr3bUWI26wHwLWPd3rwh6pe4EV7g==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "freebsd" @@ -849,12 +1270,13 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.6.tgz", - "integrity": "sha512-SZHQlzvqv4Du5PrKE2faN0qlbsaW/3QQfUUc6yO2EjFcA83xnwm91UbEEVx4ApZ9Z5oG8Bxz4qPE+HFwtVcfyw==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.0.tgz", + "integrity": "sha512-t76XLQDpxgmq2cNXKTVEB7O7YMb42atj2Re2Haf45HkaUpjM2J0UuJZDuaGbPbamzZ7bawyGFUkodL+zcE+jvQ==", "cpu": [ "arm" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -864,12 +1286,13 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.6.tgz", - "integrity": "sha512-b967hU0gqKd9Drsh/UuAm21Khpoh6mPBSgz8mKRq4P5mVK8bpA+hQzmm/ZwGVULSNBzKdZPQBRT3+WuVavcWsQ==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.0.tgz", + "integrity": "sha512-AS18v0V+vZiLJyi/4LphvBE+OIX682Pu7ZYNsdUHyUKSoRwdnOsMf6FDekwoAFKej14WAkOef3zAORJgAtXnlQ==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -879,12 +1302,13 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.6.tgz", - "integrity": "sha512-aHWdQ2AAltRkLPOsKdi3xv0mZ8fUGPdlKEjIEhxCPm5yKEThcUjHpWB1idN74lfXGnZ5SULQSgtr5Qos5B0bPw==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.0.tgz", + "integrity": "sha512-Mz1jxqm/kfgKkc/KLHC5qIujMvnnarD9ra1cEcrs7qshTUSksPihGrWHVG5+osAIQ68577Zpww7SGapmzSt4Nw==", "cpu": [ "ia32" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -894,12 +1318,13 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.6.tgz", - "integrity": "sha512-VgKCsHdXRSQ7E1+QXGdRPlQ/e08bN6WMQb27/TMfV+vPjjTImuT9PmLXupRlC90S1JeNNW5lzkAEO/McKeJ2yg==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.0.tgz", + "integrity": "sha512-QbEREjdJeIreIAbdG2hLU1yXm1uu+LTdzoq1KCo4G4pFOLlvIspBm36QrQOar9LFduavoWX2msNFAAAY9j4BDg==", "cpu": [ "loong64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -909,12 +1334,13 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.6.tgz", - "integrity": "sha512-WViNlpivRKT9/py3kCmkHnn44GkGXVdXfdc4drNmRl15zVQ2+D2uFwdlGh6IuK5AAnGTo2qPB1Djppj+t78rzw==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.0.tgz", + "integrity": "sha512-sJz3zRNe4tO2wxvDpH/HYJilb6+2YJxo/ZNbVdtFiKDufzWq4JmKAiHy9iGoLjAV7r/W32VgaHGkk35cUXlNOg==", "cpu": [ "mips64el" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -924,12 +1350,13 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.6.tgz", - "integrity": "sha512-wyYKZ9NTdmAMb5730I38lBqVu6cKl4ZfYXIs31Baf8aoOtB4xSGi3THmDYt4BTFHk7/EcVixkOV2uZfwU3Q2Jw==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.0.tgz", + "integrity": "sha512-z9N10FBD0DCS2dmSABDBb5TLAyF1/ydVb+N4pi88T45efQ/w4ohr/F/QYCkxDPnkhkp6AIpIcQKQ8F0ANoA2JA==", "cpu": [ "ppc64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -939,12 +1366,13 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.6.tgz", - "integrity": "sha512-KZh7bAGGcrinEj4qzilJ4hqTY3Dg2U82c8bv+e1xqNqZCrCyc+TL9AUEn5WGKDzm3CfC5RODE/qc96OcbIe33w==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.0.tgz", + "integrity": "sha512-pQdyAIZ0BWIC5GyvVFn5awDiO14TkT/19FTmFcPdDec94KJ1uZcmFs21Fo8auMXzD4Tt+diXu1LW1gHus9fhFQ==", "cpu": [ "riscv64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -954,12 +1382,13 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.6.tgz", - "integrity": "sha512-9N1LsTwAuE9oj6lHMyyAM+ucxGiVnEqUdp4v7IaMmrwb06ZTEVCIs3oPPplVsnjPfyjmxwHxHMF8b6vzUVAUGw==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.0.tgz", + "integrity": "sha512-hPlRWR4eIDDEci953RI1BLZitgi5uqcsjKMxwYfmi4LcwyWo2IcRP+lThVnKjNtk90pLS8nKdroXYOqW+QQH+w==", "cpu": [ "s390x" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -969,12 +1398,13 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.6.tgz", - "integrity": "sha512-A6bJB41b4lKFWRKNrWoP2LHsjVzNiaurf7wyj/XtFNTsnPuxwEBWHLty+ZE0dWBKuSK1fvKgrKaNjBS7qbFKig==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.0.tgz", + "integrity": "sha512-1hBWx4OUJE2cab++aVZ7pObD6s+DK4mPGpemtnAORBvb5l/g5xFGk0vc0PjSkrDs0XaXj9yyob3d14XqvnQ4gw==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -984,12 +1414,13 @@ } }, "node_modules/@esbuild/netbsd-arm64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.6.tgz", - "integrity": "sha512-IjA+DcwoVpjEvyxZddDqBY+uJ2Snc6duLpjmkXm/v4xuS3H+3FkLZlDm9ZsAbF9rsfP3zeA0/ArNDORZgrxR/Q==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.0.tgz", + "integrity": "sha512-6m0sfQfxfQfy1qRuecMkJlf1cIzTOgyaeXaiVaaki8/v+WB+U4hc6ik15ZW6TAllRlg/WuQXxWj1jx6C+dfy3w==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "netbsd" @@ -999,12 +1430,13 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.6.tgz", - "integrity": "sha512-dUXuZr5WenIDlMHdMkvDc1FAu4xdWixTCRgP7RQLBOkkGgwuuzaGSYcOpW4jFxzpzL1ejb8yF620UxAqnBrR9g==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.0.tgz", + "integrity": "sha512-xbbOdfn06FtcJ9d0ShxxvSn2iUsGd/lgPIO2V3VZIPDbEaIj1/3nBBe1AwuEZKXVXkMmpr6LUAgMkLD/4D2PPA==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "netbsd" @@ -1014,12 +1446,13 @@ } }, "node_modules/@esbuild/openbsd-arm64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.6.tgz", - "integrity": "sha512-l8ZCvXP0tbTJ3iaqdNf3pjaOSd5ex/e6/omLIQCVBLmHTlfXW3zAxQ4fnDmPLOB1x9xrcSi/xtCWFwCZRIaEwg==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.0.tgz", + "integrity": "sha512-fWgqR8uNbCQ/GGv0yhzttj6sU/9Z5/Sv/VGU3F5OuXK6J6SlriONKrQ7tNlwBrJZXRYk5jUhuWvF7GYzGguBZQ==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "openbsd" @@ -1029,12 +1462,13 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.6.tgz", - "integrity": "sha512-hKrmDa0aOFOr71KQ/19JC7az1P0GWtCN1t2ahYAf4O007DHZt/dW8ym5+CUdJhQ/qkZmI1HAF8KkJbEFtCL7gw==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.0.tgz", + "integrity": "sha512-aCwlRdSNMNxkGGqQajMUza6uXzR/U0dIl1QmLjPtRbLOx3Gy3otfFu/VjATy4yQzo9yFDGTxYDo1FfAD9oRD2A==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "openbsd" @@ -1044,12 +1478,13 @@ } }, "node_modules/@esbuild/openharmony-arm64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.6.tgz", - "integrity": "sha512-+SqBcAWoB1fYKmpWoQP4pGtx+pUUC//RNYhFdbcSA16617cchuryuhOCRpPsjCblKukAckWsV+aQ3UKT/RMPcA==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.0.tgz", + "integrity": "sha512-nyvsBccxNAsNYz2jVFYwEGuRRomqZ149A39SHWk4hV0jWxKM0hjBPm3AmdxcbHiFLbBSwG6SbpIcUbXjgyECfA==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "openharmony" @@ -1059,12 +1494,13 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.6.tgz", - "integrity": "sha512-dyCGxv1/Br7MiSC42qinGL8KkG4kX0pEsdb0+TKhmJZgCUDBGmyo1/ArCjNGiOLiIAgdbWgmWgib4HoCi5t7kA==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.0.tgz", + "integrity": "sha512-Q1KY1iJafM+UX6CFEL+F4HRTgygmEW568YMqDA5UV97AuZSm21b7SXIrRJDwXWPzr8MGr75fUZPV67FdtMHlHA==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "sunos" @@ -1074,12 +1510,13 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.6.tgz", - "integrity": "sha512-42QOgcZeZOvXfsCBJF5Afw73t4veOId//XD3i+/9gSkhSV6Gk3VPlWncctI+JcOyERv85FUo7RxuxGy+z8A43Q==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.0.tgz", + "integrity": "sha512-W1eyGNi6d+8kOmZIwi/EDjrL9nxQIQ0MiGqe/AWc6+IaHloxHSGoeRgDRKHFISThLmsewZ5nHFvGFWdBYlgKPg==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "win32" @@ -1089,12 +1526,13 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.6.tgz", - "integrity": "sha512-4AWhgXmDuYN7rJI6ORB+uU9DHLq/erBbuMoAuB4VWJTu5KtCgcKYPynF0YI1VkBNuEfjNlLrFr9KZPJzrtLkrQ==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.0.tgz", + "integrity": "sha512-30z1aKL9h22kQhilnYkORFYt+3wp7yZsHWus+wSKAJR8JtdfI76LJ4SBdMsCopTR3z/ORqVu5L1vtnHZWVj4cQ==", "cpu": [ "ia32" ], + "license": "MIT", "optional": true, "os": [ "win32" @@ -1104,12 +1542,13 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.6.tgz", - "integrity": "sha512-NgJPHHbEpLQgDH2MjQu90pzW/5vvXIZ7KOnPyNBm92A6WgZ/7b6fJyUBjoumLqeOQQGqY2QjQxRo97ah4Sj0cA==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.0.tgz", + "integrity": "sha512-aIitBcjQeyOhMTImhLZmtxfdOcuNRpwlPNmlFKPcHQYPhEssw75Cl1TSXJXpMkzaua9FUetx/4OQKq7eJul5Cg==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "win32" @@ -1121,13 +1560,15 @@ "node_modules/@eshaz/web-worker": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/@eshaz/web-worker/-/web-worker-1.2.2.tgz", - "integrity": "sha512-WxXiHFmD9u/owrzempiDlBB1ZYqiLnm9s6aPc8AlFQalq2tKmqdmMr9GXOupDgzXtqnBipj8Un0gkIm7Sjf8mw==" + "integrity": "sha512-WxXiHFmD9u/owrzempiDlBB1ZYqiLnm9s6aPc8AlFQalq2tKmqdmMr9GXOupDgzXtqnBipj8Un0gkIm7Sjf8mw==", + "license": "Apache-2.0" }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz", - "integrity": "sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==", + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz", + "integrity": "sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==", "dev": true, + "license": "MIT", "dependencies": { "eslint-visitor-keys": "^3.4.3" }, @@ -1142,10 +1583,11 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", - "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", "dev": true, + "license": "MIT", "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } @@ -1155,6 +1597,7 @@ "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", "dev": true, + "license": "MIT", "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", @@ -1173,21 +1616,57 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/@eslint/eslintrc/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { "version": "1.1.12", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, + "node_modules/@eslint/eslintrc/node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/@eslint/eslintrc/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, "node_modules/@eslint/eslintrc/node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -1200,6 +1679,7 @@ "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", "dev": true, + "license": "MIT", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } @@ -1212,6 +1692,7 @@ "arm64" ], "hasInstallScript": true, + "license": "https://git.ffmpeg.org/gitweb/ffmpeg.git/blob_plain/HEAD:/LICENSE.md", "optional": true, "os": [ "darwin" @@ -1225,6 +1706,7 @@ "x64" ], "hasInstallScript": true, + "license": "LGPL-2.1", "optional": true, "os": [ "darwin" @@ -1234,6 +1716,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/@ffmpeg-installer/ffmpeg/-/ffmpeg-1.1.0.tgz", "integrity": "sha512-Uq4rmwkdGxIa9A6Bd/VqqYbT7zqh1GrT5/rFwCwKM70b42W5gIjWeVETq6SdcL0zXqDtY081Ws/iJWhr1+xvQg==", + "license": "LGPL-2.1", "optionalDependencies": { "@ffmpeg-installer/darwin-arm64": "4.1.5", "@ffmpeg-installer/darwin-x64": "4.1.0", @@ -1253,6 +1736,7 @@ "arm" ], "hasInstallScript": true, + "license": "GPLv3", "optional": true, "os": [ "linux" @@ -1266,6 +1750,7 @@ "arm64" ], "hasInstallScript": true, + "license": "GPLv3", "optional": true, "os": [ "linux" @@ -1279,6 +1764,7 @@ "ia32" ], "hasInstallScript": true, + "license": "GPLv3", "optional": true, "os": [ "linux" @@ -1292,6 +1778,7 @@ "x64" ], "hasInstallScript": true, + "license": "GPLv3", "optional": true, "os": [ "linux" @@ -1304,6 +1791,7 @@ "cpu": [ "ia32" ], + "license": "GPLv3", "optional": true, "os": [ "win32" @@ -1316,6 +1804,7 @@ "cpu": [ "x64" ], + "license": "GPLv3", "optional": true, "os": [ "win32" @@ -1325,6 +1814,7 @@ "version": "1.1.17", "resolved": "https://registry.npmjs.org/@figuro/chatwoot-sdk/-/chatwoot-sdk-1.1.17.tgz", "integrity": "sha512-KfrBoMLMAan3379evYqmC2gUKYWGRJb0g+1EQZ44vUcDxOGlH5riddK1OB998Knvm0TYNZBqKhhwJHqDYBUpSw==", + "license": "MIT", "dependencies": { "axios": "^0.27.2" } @@ -1333,6 +1823,7 @@ "version": "0.27.2", "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", + "license": "MIT", "dependencies": { "follow-redirects": "^1.14.9", "form-data": "^4.0.0" @@ -1342,6 +1833,7 @@ "version": "10.0.1", "resolved": "https://registry.npmjs.org/@hapi/boom/-/boom-10.0.1.tgz", "integrity": "sha512-ERcCZaEjdH3OgSJlyjVk8pHIFeus91CjKP3v+MpgBNp5IvGzP2l/bRiD78nqYcKPaZdbKkK5vDBVPd2ohHBlsA==", + "license": "BSD-3-Clause", "dependencies": { "@hapi/hoek": "^11.0.2" } @@ -1349,7 +1841,8 @@ "node_modules/@hapi/hoek": { "version": "11.0.7", "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-11.0.7.tgz", - "integrity": "sha512-HV5undWkKzcB4RZUusqOpcgxOaq6VOAH7zhhIr2g3G8NF/MlFO75SjOr2NfuSx0Mh40+1FqCkagKLJRykUWoFQ==" + "integrity": "sha512-HV5undWkKzcB4RZUusqOpcgxOaq6VOAH7zhhIr2g3G8NF/MlFO75SjOr2NfuSx0Mh40+1FqCkagKLJRykUWoFQ==", + "license": "BSD-3-Clause" }, "node_modules/@humanwhocodes/config-array": { "version": "0.13.0", @@ -1357,6 +1850,7 @@ "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", "deprecated": "Use @eslint/config-array instead", "dev": true, + "license": "Apache-2.0", "dependencies": { "@humanwhocodes/object-schema": "^2.0.3", "debug": "^4.3.1", @@ -1371,6 +1865,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1381,6 +1876,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -1393,6 +1889,7 @@ "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", "dev": true, + "license": "Apache-2.0", "engines": { "node": ">=12.22" }, @@ -1406,15 +1903,26 @@ "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", "deprecated": "Use @eslint/object-schema instead", - "dev": true + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@img/colour": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.0.0.tgz", + "integrity": "sha512-A5P/LfWGFSl6nsckYtjw9da+19jB8hkJ6ACTGcDfEJ0aE+l2n2El7dsVM7UVHZQ9s2lmYMWlrS21YLy2IR1LUw==", + "license": "MIT", + "engines": { + "node": ">=18" + } }, "node_modules/@img/sharp-darwin-arm64": { - "version": "0.34.2", - "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.2.tgz", - "integrity": "sha512-OfXHZPppddivUJnqyKoi5YVeHRkkNE2zUFT2gbpKxp/JZCFYEYubnMg+gOp6lWfasPrTS+KPosKqdI+ELYVDtg==", + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.5.tgz", + "integrity": "sha512-imtQ3WMJXbMY4fxb/Ndp6HBTNVtWCUI0WdobyheGf5+ad6xX8VIDO8u2xE4qc/fr08CKG/7dDseFtn6M6g/r3w==", "cpu": [ "arm64" ], + "license": "Apache-2.0", "optional": true, "os": [ "darwin" @@ -1426,16 +1934,17 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-darwin-arm64": "1.1.0" + "@img/sharp-libvips-darwin-arm64": "1.2.4" } }, "node_modules/@img/sharp-darwin-x64": { - "version": "0.34.2", - "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.2.tgz", - "integrity": "sha512-dYvWqmjU9VxqXmjEtjmvHnGqF8GrVjM2Epj9rJ6BUIXvk8slvNDJbhGFvIoXzkDhrJC2jUxNLz/GUjjvSzfw+g==", + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.5.tgz", + "integrity": "sha512-YNEFAF/4KQ/PeW0N+r+aVVsoIY0/qxxikF2SWdp+NRkmMB7y9LBZAVqQ4yhGCm/H3H270OSykqmQMKLBhBJDEw==", "cpu": [ "x64" ], + "license": "Apache-2.0", "optional": true, "os": [ "darwin" @@ -1447,16 +1956,17 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-darwin-x64": "1.1.0" + "@img/sharp-libvips-darwin-x64": "1.2.4" } }, "node_modules/@img/sharp-libvips-darwin-arm64": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.1.0.tgz", - "integrity": "sha512-HZ/JUmPwrJSoM4DIQPv/BfNh9yrOA8tlBbqbLz4JZ5uew2+o22Ik+tHQJcih7QJuSa0zo5coHTfD5J8inqj9DA==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.2.4.tgz", + "integrity": "sha512-zqjjo7RatFfFoP0MkQ51jfuFZBnVE2pRiaydKJ1G/rHZvnsrHAOcQALIi9sA5co5xenQdTugCvtb1cuf78Vf4g==", "cpu": [ "arm64" ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "darwin" @@ -1466,12 +1976,13 @@ } }, "node_modules/@img/sharp-libvips-darwin-x64": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.1.0.tgz", - "integrity": "sha512-Xzc2ToEmHN+hfvsl9wja0RlnXEgpKNmftriQp6XzY/RaSfwD9th+MSh0WQKzUreLKKINb3afirxW7A0fz2YWuQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.2.4.tgz", + "integrity": "sha512-1IOd5xfVhlGwX+zXv2N93k0yMONvUlANylbJw1eTah8K/Jtpi15KC+WSiaX/nBmbm2HxRM1gZ0nSdjSsrZbGKg==", "cpu": [ "x64" ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "darwin" @@ -1481,12 +1992,13 @@ } }, "node_modules/@img/sharp-libvips-linux-arm": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.1.0.tgz", - "integrity": "sha512-s8BAd0lwUIvYCJyRdFqvsj+BJIpDBSxs6ivrOPm/R7piTs5UIwY5OjXrP2bqXC9/moGsyRa37eYWYCOGVXxVrA==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.2.4.tgz", + "integrity": "sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A==", "cpu": [ "arm" ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "linux" @@ -1496,12 +2008,13 @@ } }, "node_modules/@img/sharp-libvips-linux-arm64": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.1.0.tgz", - "integrity": "sha512-IVfGJa7gjChDET1dK9SekxFFdflarnUB8PwW8aGwEoF3oAsSDuNUTYS+SKDOyOJxQyDC1aPFMuRYLoDInyV9Ew==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.2.4.tgz", + "integrity": "sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw==", "cpu": [ "arm64" ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "linux" @@ -1511,12 +2024,29 @@ } }, "node_modules/@img/sharp-libvips-linux-ppc64": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.1.0.tgz", - "integrity": "sha512-tiXxFZFbhnkWE2LA8oQj7KYR+bWBkiV2nilRldT7bqoEZ4HiDOcePr9wVDAZPi/Id5fT1oY9iGnDq20cwUz8lQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.2.4.tgz", + "integrity": "sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA==", "cpu": [ "ppc64" ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-riscv64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.2.4.tgz", + "integrity": "sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA==", + "cpu": [ + "riscv64" + ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "linux" @@ -1526,12 +2056,13 @@ } }, "node_modules/@img/sharp-libvips-linux-s390x": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.1.0.tgz", - "integrity": "sha512-xukSwvhguw7COyzvmjydRb3x/09+21HykyapcZchiCUkTThEQEOMtBj9UhkaBRLuBrgLFzQ2wbxdeCCJW/jgJA==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.2.4.tgz", + "integrity": "sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ==", "cpu": [ "s390x" ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "linux" @@ -1541,12 +2072,13 @@ } }, "node_modules/@img/sharp-libvips-linux-x64": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.1.0.tgz", - "integrity": "sha512-yRj2+reB8iMg9W5sULM3S74jVS7zqSzHG3Ol/twnAAkAhnGQnpjj6e4ayUz7V+FpKypwgs82xbRdYtchTTUB+Q==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.2.4.tgz", + "integrity": "sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw==", "cpu": [ "x64" ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "linux" @@ -1556,12 +2088,13 @@ } }, "node_modules/@img/sharp-libvips-linuxmusl-arm64": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.1.0.tgz", - "integrity": "sha512-jYZdG+whg0MDK+q2COKbYidaqW/WTz0cc1E+tMAusiDygrM4ypmSCjOJPmFTvHHJ8j/6cAGyeDWZOsK06tP33w==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.2.4.tgz", + "integrity": "sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw==", "cpu": [ "arm64" ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "linux" @@ -1571,12 +2104,13 @@ } }, "node_modules/@img/sharp-libvips-linuxmusl-x64": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.1.0.tgz", - "integrity": "sha512-wK7SBdwrAiycjXdkPnGCPLjYb9lD4l6Ze2gSdAGVZrEL05AOUJESWU2lhlC+Ffn5/G+VKuSm6zzbQSzFX/P65A==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.2.4.tgz", + "integrity": "sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg==", "cpu": [ "x64" ], + "license": "LGPL-3.0-or-later", "optional": true, "os": [ "linux" @@ -1586,12 +2120,13 @@ } }, "node_modules/@img/sharp-linux-arm": { - "version": "0.34.2", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.2.tgz", - "integrity": "sha512-0DZzkvuEOqQUP9mo2kjjKNok5AmnOr1jB2XYjkaoNRwpAYMDzRmAqUIa1nRi58S2WswqSfPOWLNOr0FDT3H5RQ==", + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.5.tgz", + "integrity": "sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw==", "cpu": [ "arm" ], + "license": "Apache-2.0", "optional": true, "os": [ "linux" @@ -1603,16 +2138,61 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-arm": "1.1.0" + "@img/sharp-libvips-linux-arm": "1.2.4" } }, "node_modules/@img/sharp-linux-arm64": { - "version": "0.34.2", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.2.tgz", - "integrity": "sha512-D8n8wgWmPDakc83LORcfJepdOSN6MvWNzzz2ux0MnIbOqdieRZwVYY32zxVx+IFUT8er5KPcyU3XXsn+GzG/0Q==", + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.5.tgz", + "integrity": "sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg==", "cpu": [ "arm64" ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-ppc64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.34.5.tgz", + "integrity": "sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA==", + "cpu": [ + "ppc64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-ppc64": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-riscv64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.34.5.tgz", + "integrity": "sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw==", + "cpu": [ + "riscv64" + ], + "license": "Apache-2.0", "optional": true, "os": [ "linux" @@ -1624,16 +2204,17 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-arm64": "1.1.0" + "@img/sharp-libvips-linux-riscv64": "1.2.4" } }, "node_modules/@img/sharp-linux-s390x": { - "version": "0.34.2", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.2.tgz", - "integrity": "sha512-EGZ1xwhBI7dNISwxjChqBGELCWMGDvmxZXKjQRuqMrakhO8QoMgqCrdjnAqJq/CScxfRn+Bb7suXBElKQpPDiw==", + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.5.tgz", + "integrity": "sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg==", "cpu": [ "s390x" ], + "license": "Apache-2.0", "optional": true, "os": [ "linux" @@ -1645,16 +2226,17 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-s390x": "1.1.0" + "@img/sharp-libvips-linux-s390x": "1.2.4" } }, "node_modules/@img/sharp-linux-x64": { - "version": "0.34.2", - "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.2.tgz", - "integrity": "sha512-sD7J+h5nFLMMmOXYH4DD9UtSNBD05tWSSdWAcEyzqW8Cn5UxXvsHAxmxSesYUsTOBmUnjtxghKDl15EvfqLFbQ==", + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.5.tgz", + "integrity": "sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ==", "cpu": [ "x64" ], + "license": "Apache-2.0", "optional": true, "os": [ "linux" @@ -1666,16 +2248,17 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linux-x64": "1.1.0" + "@img/sharp-libvips-linux-x64": "1.2.4" } }, "node_modules/@img/sharp-linuxmusl-arm64": { - "version": "0.34.2", - "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.2.tgz", - "integrity": "sha512-NEE2vQ6wcxYav1/A22OOxoSOGiKnNmDzCYFOZ949xFmrWZOVII1Bp3NqVVpvj+3UeHMFyN5eP/V5hzViQ5CZNA==", + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.5.tgz", + "integrity": "sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg==", "cpu": [ "arm64" ], + "license": "Apache-2.0", "optional": true, "os": [ "linux" @@ -1687,16 +2270,17 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linuxmusl-arm64": "1.1.0" + "@img/sharp-libvips-linuxmusl-arm64": "1.2.4" } }, "node_modules/@img/sharp-linuxmusl-x64": { - "version": "0.34.2", - "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.2.tgz", - "integrity": "sha512-DOYMrDm5E6/8bm/yQLCWyuDJwUnlevR8xtF8bs+gjZ7cyUNYXiSf/E8Kp0Ss5xasIaXSHzb888V1BE4i1hFhAA==", + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.5.tgz", + "integrity": "sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q==", "cpu": [ "x64" ], + "license": "Apache-2.0", "optional": true, "os": [ "linux" @@ -1708,19 +2292,20 @@ "url": "https://opencollective.com/libvips" }, "optionalDependencies": { - "@img/sharp-libvips-linuxmusl-x64": "1.1.0" + "@img/sharp-libvips-linuxmusl-x64": "1.2.4" } }, "node_modules/@img/sharp-wasm32": { - "version": "0.34.2", - "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.34.2.tgz", - "integrity": "sha512-/VI4mdlJ9zkaq53MbIG6rZY+QRN3MLbR6usYlgITEzi4Rpx5S6LFKsycOQjkOGmqTNmkIdLjEvooFKwww6OpdQ==", + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.34.5.tgz", + "integrity": "sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw==", "cpu": [ "wasm32" ], + "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", "optional": true, "dependencies": { - "@emnapi/runtime": "^1.4.3" + "@emnapi/runtime": "^1.7.0" }, "engines": { "node": "^18.17.0 || ^20.3.0 || >=21.0.0" @@ -1730,12 +2315,13 @@ } }, "node_modules/@img/sharp-win32-arm64": { - "version": "0.34.2", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.34.2.tgz", - "integrity": "sha512-cfP/r9FdS63VA5k0xiqaNaEoGxBg9k7uE+RQGzuK9fHt7jib4zAVVseR9LsE4gJcNWgT6APKMNnCcnyOtmSEUQ==", + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.34.5.tgz", + "integrity": "sha512-WQ3AgWCWYSb2yt+IG8mnC6Jdk9Whs7O0gxphblsLvdhSpSTtmu69ZG1Gkb6NuvxsNACwiPV6cNSZNzt0KPsw7g==", "cpu": [ "arm64" ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", "optional": true, "os": [ "win32" @@ -1748,12 +2334,13 @@ } }, "node_modules/@img/sharp-win32-ia32": { - "version": "0.34.2", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.2.tgz", - "integrity": "sha512-QLjGGvAbj0X/FXl8n1WbtQ6iVBpWU7JO94u/P2M4a8CFYsvQi4GW2mRy/JqkRx0qpBzaOdKJKw8uc930EX2AHw==", + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.5.tgz", + "integrity": "sha512-FV9m/7NmeCmSHDD5j4+4pNI8Cp3aW+JvLoXcTUo0IqyjSfAZJ8dIUmijx1qaJsIiU+Hosw6xM5KijAWRJCSgNg==", "cpu": [ "ia32" ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", "optional": true, "os": [ "win32" @@ -1766,12 +2353,13 @@ } }, "node_modules/@img/sharp-win32-x64": { - "version": "0.34.2", - "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.2.tgz", - "integrity": "sha512-aUdT6zEYtDKCaxkofmmJDJYGCf0+pJg3eU9/oBuqvEeoB9dKI6ZLc/1iLJCTuJQDO4ptntAlkUmHgGjyuobZbw==", + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.5.tgz", + "integrity": "sha512-+29YMsqY2/9eFEiW93eqWnuLcWcufowXewwSNIT6UwZdUUCrM3oFjMWH/Z6/TMmb4hlFenmfAVbpWeup2jryCw==", "cpu": [ "x64" ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", "optional": true, "os": [ "win32" @@ -1783,99 +2371,11 @@ "url": "https://opencollective.com/libvips" } }, - "node_modules/@isaacs/cliui": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", - "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", - "dependencies": { - "string-width": "^5.1.2", - "string-width-cjs": "npm:string-width@^4.2.0", - "strip-ansi": "^7.0.1", - "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", - "wrap-ansi": "^8.1.0", - "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" - }, - "node_modules/@isaacs/cliui/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@isaacs/cliui/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, "node_modules/@jimp/core": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/core/-/core-1.6.0.tgz", "integrity": "sha512-EQQlKU3s9QfdJqiSrZWNTxBs3rKXgO2W+GxNXDtwchF3a4IqxDheFX1ti+Env9hdJXDiYLp2jTRjlxhPthsk8w==", + "license": "MIT", "dependencies": { "@jimp/file-ops": "1.6.0", "@jimp/types": "1.6.0", @@ -1893,6 +2393,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", + "license": "MIT", "bin": { "mime": "cli.js" }, @@ -1904,6 +2405,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/diff/-/diff-1.6.0.tgz", "integrity": "sha512-+yUAQ5gvRC5D1WHYxjBHZI7JBRusGGSLf8AmPRPCenTzh4PA+wZ1xv2+cYqQwTfQHU5tXYOhA0xDytfHUf1Zyw==", + "license": "MIT", "dependencies": { "@jimp/plugin-resize": "1.6.0", "@jimp/types": "1.6.0", @@ -1918,6 +2420,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/file-ops/-/file-ops-1.6.0.tgz", "integrity": "sha512-Dx/bVDmgnRe1AlniRpCKrGRm5YvGmUwbDzt+MAkgmLGf+jvBT75hmMEZ003n9HQI/aPnm/YKnXjg/hOpzNCpHQ==", + "license": "MIT", "engines": { "node": ">=18" } @@ -1926,6 +2429,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/js-bmp/-/js-bmp-1.6.0.tgz", "integrity": "sha512-FU6Q5PC/e3yzLyBDXupR3SnL3htU7S3KEs4e6rjDP6gNEOXRFsWs6YD3hXuXd50jd8ummy+q2WSwuGkr8wi+Gw==", + "license": "MIT", "dependencies": { "@jimp/core": "1.6.0", "@jimp/types": "1.6.0", @@ -1940,6 +2444,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/js-gif/-/js-gif-1.6.0.tgz", "integrity": "sha512-N9CZPHOrJTsAUoWkWZstLPpwT5AwJ0wge+47+ix3++SdSL/H2QzyMqxbcDYNFe4MoI5MIhATfb0/dl/wmX221g==", + "license": "MIT", "dependencies": { "@jimp/core": "1.6.0", "@jimp/types": "1.6.0", @@ -1954,6 +2459,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/js-jpeg/-/js-jpeg-1.6.0.tgz", "integrity": "sha512-6vgFDqeusblf5Pok6B2DUiMXplH8RhIKAryj1yn+007SIAQ0khM1Uptxmpku/0MfbClx2r7pnJv9gWpAEJdMVA==", + "license": "MIT", "dependencies": { "@jimp/core": "1.6.0", "@jimp/types": "1.6.0", @@ -1967,6 +2473,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/js-png/-/js-png-1.6.0.tgz", "integrity": "sha512-AbQHScy3hDDgMRNfG0tPjL88AV6qKAILGReIa3ATpW5QFjBKpisvUaOqhzJ7Reic1oawx3Riyv152gaPfqsBVg==", + "license": "MIT", "dependencies": { "@jimp/core": "1.6.0", "@jimp/types": "1.6.0", @@ -1980,6 +2487,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/js-tiff/-/js-tiff-1.6.0.tgz", "integrity": "sha512-zhReR8/7KO+adijj3h0ZQUOiun3mXUv79zYEAKvE0O+rP7EhgtKvWJOZfRzdZSNv0Pu1rKtgM72qgtwe2tFvyw==", + "license": "MIT", "dependencies": { "@jimp/core": "1.6.0", "@jimp/types": "1.6.0", @@ -1993,6 +2501,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-blit/-/plugin-blit-1.6.0.tgz", "integrity": "sha512-M+uRWl1csi7qilnSK8uxK4RJMSuVeBiO1AY0+7APnfUbQNZm6hCe0CCFv1Iyw1D/Dhb8ph8fQgm5mwM0eSxgVA==", + "license": "MIT", "dependencies": { "@jimp/types": "1.6.0", "@jimp/utils": "1.6.0", @@ -2006,6 +2515,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-blur/-/plugin-blur-1.6.0.tgz", "integrity": "sha512-zrM7iic1OTwUCb0g/rN5y+UnmdEsT3IfuCXCJJNs8SZzP0MkZ1eTvuwK9ZidCuMo4+J3xkzCidRwYXB5CyGZTw==", + "license": "MIT", "dependencies": { "@jimp/core": "1.6.0", "@jimp/utils": "1.6.0" @@ -2018,6 +2528,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-circle/-/plugin-circle-1.6.0.tgz", "integrity": "sha512-xt1Gp+LtdMKAXfDp3HNaG30SPZW6AQ7dtAtTnoRKorRi+5yCJjKqXRgkewS5bvj8DEh87Ko1ydJfzqS3P2tdWw==", + "license": "MIT", "dependencies": { "@jimp/types": "1.6.0", "zod": "^3.23.8" @@ -2030,6 +2541,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-color/-/plugin-color-1.6.0.tgz", "integrity": "sha512-J5q8IVCpkBsxIXM+45XOXTrsyfblyMZg3a9eAo0P7VPH4+CrvyNQwaYatbAIamSIN1YzxmO3DkIZXzRjFSz1SA==", + "license": "MIT", "dependencies": { "@jimp/core": "1.6.0", "@jimp/types": "1.6.0", @@ -2045,6 +2557,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-contain/-/plugin-contain-1.6.0.tgz", "integrity": "sha512-oN/n+Vdq/Qg9bB4yOBOxtY9IPAtEfES8J1n9Ddx+XhGBYT1/QTU/JYkGaAkIGoPnyYvmLEDqMz2SGihqlpqfzQ==", + "license": "MIT", "dependencies": { "@jimp/core": "1.6.0", "@jimp/plugin-blit": "1.6.0", @@ -2061,6 +2574,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-cover/-/plugin-cover-1.6.0.tgz", "integrity": "sha512-Iow0h6yqSC269YUJ8HC3Q/MpCi2V55sMlbkkTTx4zPvd8mWZlC0ykrNDeAy9IJegrQ7v5E99rJwmQu25lygKLA==", + "license": "MIT", "dependencies": { "@jimp/core": "1.6.0", "@jimp/plugin-crop": "1.6.0", @@ -2076,6 +2590,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-crop/-/plugin-crop-1.6.0.tgz", "integrity": "sha512-KqZkEhvs+21USdySCUDI+GFa393eDIzbi1smBqkUPTE+pRwSWMAf01D5OC3ZWB+xZsNla93BDS9iCkLHA8wang==", + "license": "MIT", "dependencies": { "@jimp/core": "1.6.0", "@jimp/types": "1.6.0", @@ -2090,6 +2605,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-displace/-/plugin-displace-1.6.0.tgz", "integrity": "sha512-4Y10X9qwr5F+Bo5ME356XSACEF55485j5nGdiyJ9hYzjQP9nGgxNJaZ4SAOqpd+k5sFaIeD7SQ0Occ26uIng5Q==", + "license": "MIT", "dependencies": { "@jimp/types": "1.6.0", "@jimp/utils": "1.6.0", @@ -2103,6 +2619,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-dither/-/plugin-dither-1.6.0.tgz", "integrity": "sha512-600d1RxY0pKwgyU0tgMahLNKsqEcxGdbgXadCiVCoGd6V6glyCvkNrnnwC0n5aJ56Htkj88PToSdF88tNVZEEQ==", + "license": "MIT", "dependencies": { "@jimp/types": "1.6.0" }, @@ -2114,6 +2631,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-fisheye/-/plugin-fisheye-1.6.0.tgz", "integrity": "sha512-E5QHKWSCBFtpgZarlmN3Q6+rTQxjirFqo44ohoTjzYVrDI6B6beXNnPIThJgPr0Y9GwfzgyarKvQuQuqCnnfbA==", + "license": "MIT", "dependencies": { "@jimp/types": "1.6.0", "@jimp/utils": "1.6.0", @@ -2127,6 +2645,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-flip/-/plugin-flip-1.6.0.tgz", "integrity": "sha512-/+rJVDuBIVOgwoyVkBjUFHtP+wmW0r+r5OQ2GpatQofToPVbJw1DdYWXlwviSx7hvixTWLKVgRWQ5Dw862emDg==", + "license": "MIT", "dependencies": { "@jimp/types": "1.6.0", "zod": "^3.23.8" @@ -2139,6 +2658,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-hash/-/plugin-hash-1.6.0.tgz", "integrity": "sha512-wWzl0kTpDJgYVbZdajTf+4NBSKvmI3bRI8q6EH9CVeIHps9VWVsUvEyb7rpbcwVLWYuzDtP2R0lTT6WeBNQH9Q==", + "license": "MIT", "dependencies": { "@jimp/core": "1.6.0", "@jimp/js-bmp": "1.6.0", @@ -2159,6 +2679,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-mask/-/plugin-mask-1.6.0.tgz", "integrity": "sha512-Cwy7ExSJMZszvkad8NV8o/Z92X2kFUFM8mcDAhNVxU0Q6tA0op2UKRJY51eoK8r6eds/qak3FQkXakvNabdLnA==", + "license": "MIT", "dependencies": { "@jimp/types": "1.6.0", "zod": "^3.23.8" @@ -2171,6 +2692,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-print/-/plugin-print-1.6.0.tgz", "integrity": "sha512-zarTIJi8fjoGMSI/M3Xh5yY9T65p03XJmPsuNet19K/Q7mwRU6EV2pfj+28++2PV2NJ+htDF5uecAlnGyxFN2A==", + "license": "MIT", "dependencies": { "@jimp/core": "1.6.0", "@jimp/js-jpeg": "1.6.0", @@ -2191,6 +2713,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-quantize/-/plugin-quantize-1.6.0.tgz", "integrity": "sha512-EmzZ/s9StYQwbpG6rUGBCisc3f64JIhSH+ncTJd+iFGtGo0YvSeMdAd+zqgiHpfZoOL54dNavZNjF4otK+mvlg==", + "license": "MIT", "dependencies": { "image-q": "^4.0.0", "zod": "^3.23.8" @@ -2203,6 +2726,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-resize/-/plugin-resize-1.6.0.tgz", "integrity": "sha512-uSUD1mqXN9i1SGSz5ov3keRZ7S9L32/mAQG08wUwZiEi5FpbV0K8A8l1zkazAIZi9IJzLlTauRNU41Mi8IF9fA==", + "license": "MIT", "dependencies": { "@jimp/core": "1.6.0", "@jimp/types": "1.6.0", @@ -2216,6 +2740,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-rotate/-/plugin-rotate-1.6.0.tgz", "integrity": "sha512-JagdjBLnUZGSG4xjCLkIpQOZZ3Mjbg8aGCCi4G69qR+OjNpOeGI7N2EQlfK/WE8BEHOW5vdjSyglNqcYbQBWRw==", + "license": "MIT", "dependencies": { "@jimp/core": "1.6.0", "@jimp/plugin-crop": "1.6.0", @@ -2232,6 +2757,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/plugin-threshold/-/plugin-threshold-1.6.0.tgz", "integrity": "sha512-M59m5dzLoHOVWdM41O8z9SyySzcDn43xHseOH0HavjsfQsT56GGCC4QzU1banJidbUrePhzoEdS42uFE8Fei8w==", + "license": "MIT", "dependencies": { "@jimp/core": "1.6.0", "@jimp/plugin-color": "1.6.0", @@ -2248,6 +2774,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/types/-/types-1.6.0.tgz", "integrity": "sha512-7UfRsiKo5GZTAATxm2qQ7jqmUXP0DxTArztllTcYdyw6Xi5oT4RaoXynVtCD4UyLK5gJgkZJcwonoijrhYFKfg==", + "license": "MIT", "dependencies": { "zod": "^3.23.8" }, @@ -2259,6 +2786,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@jimp/utils/-/utils-1.6.0.tgz", "integrity": "sha512-gqFTGEosKbOkYF/WFj26jMHOI5OH2jeP1MmC/zbK6BF6VJBf8rIC5898dPfSzZEbSA0wbbV5slbntWVc5PKLFA==", + "license": "MIT", "dependencies": { "@jimp/types": "1.6.0", "tinycolor2": "^1.6.0" @@ -2268,48 +2796,67 @@ } }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.12", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.12.tgz", - "integrity": "sha512-OuLGC46TjB5BbN1dH8JULVVZY4WTdkF7tV9Ys6wLL1rubZnCMstOhNHueU5bLCrnRuDhKPDM4g6sw4Bel5Gzqg==", + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "license": "MIT", "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0", "@jridgewell/trace-mapping": "^0.3.24" } }, - "node_modules/@jridgewell/gen-mapping/node_modules/@jridgewell/trace-mapping": { - "version": "0.3.29", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.29.tgz", - "integrity": "sha512-uw6guiW/gcAGPDhLmd77/6lW8QLeiV5RUTsAX46Db6oLhGaVj4lhnPwb184s1bkc8kdVg/+h988dro8GRDpmYQ==", - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "license": "MIT", "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.4.tgz", - "integrity": "sha512-VT2+G1VQs/9oz078bLrYbecdZKs912zQlkelYpuf+SXF+QvZDYJlbx/LSx+meSAwdDFnF8FVXW92AVjjkVmgFw==" + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "license": "MIT" }, - "node_modules/@keyv/serialize": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@keyv/serialize/-/serialize-1.0.3.tgz", - "integrity": "sha512-qnEovoOp5Np2JDGonIDL6Ayihw0RhnRh6vxPuHo4RDn1UOzwEo4AeIfpL6UGIrsceWrCMiVPgwRjbHu4vYFc3g==", + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "license": "MIT", "dependencies": { - "buffer": "^6.0.3" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@keyv/bigmap": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@keyv/bigmap/-/bigmap-1.3.0.tgz", + "integrity": "sha512-KT01GjzV6AQD5+IYrcpoYLkCu1Jod3nau1Z7EsEuViO3TZGRacSbO9MfHmbJ1WaOXFtWLxPVj169cn2WNKPkIg==", + "license": "MIT", + "dependencies": { + "hashery": "^1.2.0", + "hookified": "^1.13.0" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "keyv": "^5.5.4" } }, + "node_modules/@keyv/serialize": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@keyv/serialize/-/serialize-1.1.1.tgz", + "integrity": "sha512-dXn3FZhPv0US+7dtJsIi2R+c7qWYiReoEh5zUntWCf4oSpMNib8FDhSoed6m3QyZdx5hK7iLFkYk3rNxwt8vTA==", + "license": "MIT" + }, "node_modules/@noble/hashes": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz", "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==", + "license": "MIT", "engines": { "node": "^14.21.3 || >=16" }, @@ -2322,6 +2869,7 @@ "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -2335,6 +2883,7 @@ "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true, + "license": "MIT", "engines": { "node": ">= 8" } @@ -2344,6 +2893,7 @@ "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -2356,594 +2906,535 @@ "version": "1.9.0", "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz", "integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==", + "license": "Apache-2.0", "engines": { "node": ">=8.0.0" } }, "node_modules/@opentelemetry/api-logs": { - "version": "0.57.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.57.2.tgz", - "integrity": "sha512-uIX52NnTM0iBh84MShlpouI7UKqkZ7MrUszTmaypHBu4r7NofznSnQRfJ+uUeDtQDj6w8eFGg5KBLDAwAPz1+A==", + "version": "0.204.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.204.0.tgz", + "integrity": "sha512-DqxY8yoAaiBPivoJD4UtgrMS8gEmzZ5lnaxzPojzLVHBGqPxgWm4zcuvcUHZiqQ6kRX2Klel2r9y8cA2HAtqpw==", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/api": "^1.3.0" }, "engines": { - "node": ">=14" + "node": ">=8.0.0" } }, "node_modules/@opentelemetry/context-async-hooks": { - "version": "1.30.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/context-async-hooks/-/context-async-hooks-1.30.1.tgz", - "integrity": "sha512-s5vvxXPVdjqS3kTLKMeBMvop9hbWkwzBpu+mUO2M7sZtlkyDJGwFe33wRKnbaYDo8ExRVBIIdwIGrqpxHuKttA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/context-async-hooks/-/context-async-hooks-2.2.0.tgz", + "integrity": "sha512-qRkLWiUEZNAmYapZ7KGS5C4OmBLcP/H2foXeOEaowYCR0wi89fHejrfYfbuLVCMLp/dWZXKvQusdbUEZjERfwQ==", + "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": ">=1.0.0 <1.10.0" } }, "node_modules/@opentelemetry/core": { - "version": "1.30.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.30.1.tgz", - "integrity": "sha512-OOCM2C/QIURhJMuKaekP3TRBxBKxG/TWWA0TL2J6nXUtDnuCtccy49LUJF8xPFXMX+0LMcxFpCo8M9cGY1W6rQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-2.2.0.tgz", + "integrity": "sha512-FuabnnUm8LflnieVxs6eP7Z383hgQU4W1e3KJS6aOG3RxWxcHyBxH8fDMHNgu/gFx/M2jvTOW/4/PHhLz6bjWw==", + "license": "Apache-2.0", "dependencies": { - "@opentelemetry/semantic-conventions": "1.28.0" + "@opentelemetry/semantic-conventions": "^1.29.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": ">=1.0.0 <1.10.0" } }, - "node_modules/@opentelemetry/core/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.28.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.28.0.tgz", - "integrity": "sha512-lp4qAiMTD4sNWW4DbKLBkfiMZ4jbAboJIGOQr5DvciMRI494OapieI9qiODpOt0XBr1LjIDy1xAGAnVs5supTA==", - "engines": { - "node": ">=14" - } - }, "node_modules/@opentelemetry/instrumentation": { - "version": "0.57.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.57.2.tgz", - "integrity": "sha512-BdBGhQBh8IjZ2oIIX6F2/Q3LKm/FDDKi6ccYKcBTeilh6SNdNKveDOLk73BkSJjQLJk6qe4Yh+hHw1UPhCDdrg==", + "version": "0.204.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.204.0.tgz", + "integrity": "sha512-vV5+WSxktzoMP8JoYWKeopChy6G3HKk4UQ2hESCRDUUTZqQ3+nM3u8noVG0LmNfRWwcFBnbZ71GKC7vaYYdJ1g==", + "license": "Apache-2.0", "dependencies": { - "@opentelemetry/api-logs": "0.57.2", - "@types/shimmer": "^1.2.0", + "@opentelemetry/api-logs": "0.204.0", "import-in-the-middle": "^1.8.1", - "require-in-the-middle": "^7.1.1", - "semver": "^7.5.2", - "shimmer": "^1.2.1" + "require-in-the-middle": "^7.1.1" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-amqplib": { - "version": "0.46.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-amqplib/-/instrumentation-amqplib-0.46.1.tgz", - "integrity": "sha512-AyXVnlCf/xV3K/rNumzKxZqsULyITJH6OVLiW6730JPRqWA7Zc9bvYoVNpN6iOpTU8CasH34SU/ksVJmObFibQ==", + "version": "0.51.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-amqplib/-/instrumentation-amqplib-0.51.0.tgz", + "integrity": "sha512-XGmjYwjVRktD4agFnWBWQXo9SiYHKBxR6Ag3MLXwtLE4R99N3a08kGKM5SC1qOFKIELcQDGFEFT9ydXMH00Luw==", + "license": "Apache-2.0", "dependencies": { - "@opentelemetry/core": "^1.8.0", - "@opentelemetry/instrumentation": "^0.57.1", + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.204.0", "@opentelemetry/semantic-conventions": "^1.27.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-connect": { - "version": "0.43.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-connect/-/instrumentation-connect-0.43.0.tgz", - "integrity": "sha512-Q57JGpH6T4dkYHo9tKXONgLtxzsh1ZEW5M9A/OwKrZFyEpLqWgjhcZ3hIuVvDlhb426iDF1f9FPToV/mi5rpeA==", + "version": "0.48.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-connect/-/instrumentation-connect-0.48.0.tgz", + "integrity": "sha512-OMjc3SFL4pC16PeK+tDhwP7MRvDPalYCGSvGqUhX5rASkI2H0RuxZHOWElYeXkV0WP+70Gw6JHWac/2Zqwmhdw==", + "license": "Apache-2.0", "dependencies": { - "@opentelemetry/core": "^1.8.0", - "@opentelemetry/instrumentation": "^0.57.0", + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.204.0", "@opentelemetry/semantic-conventions": "^1.27.0", - "@types/connect": "3.4.36" + "@types/connect": "3.4.38" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-dataloader": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-dataloader/-/instrumentation-dataloader-0.16.0.tgz", - "integrity": "sha512-88+qCHZC02up8PwKHk0UQKLLqGGURzS3hFQBZC7PnGwReuoKjHXS1o29H58S+QkXJpkTr2GACbx8j6mUoGjNPA==", + "version": "0.22.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-dataloader/-/instrumentation-dataloader-0.22.0.tgz", + "integrity": "sha512-bXnTcwtngQsI1CvodFkTemrrRSQjAjZxqHVc+CJZTDnidT0T6wt3jkKhnsjU/Kkkc0lacr6VdRpCu2CUWa0OKw==", + "license": "Apache-2.0", "dependencies": { - "@opentelemetry/instrumentation": "^0.57.0" + "@opentelemetry/instrumentation": "^0.204.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-express": { - "version": "0.47.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-express/-/instrumentation-express-0.47.0.tgz", - "integrity": "sha512-XFWVx6k0XlU8lu6cBlCa29ONtVt6ADEjmxtyAyeF2+rifk8uBJbk1La0yIVfI0DoKURGbaEDTNelaXG9l/lNNQ==", - "dependencies": { - "@opentelemetry/core": "^1.8.0", - "@opentelemetry/instrumentation": "^0.57.0", - "@opentelemetry/semantic-conventions": "^1.27.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" - } - }, - "node_modules/@opentelemetry/instrumentation-fastify": { - "version": "0.44.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-fastify/-/instrumentation-fastify-0.44.1.tgz", - "integrity": "sha512-RoVeMGKcNttNfXMSl6W4fsYoCAYP1vi6ZAWIGhBY+o7R9Y0afA7f9JJL0j8LHbyb0P0QhSYk+6O56OwI2k4iRQ==", + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-express/-/instrumentation-express-0.53.0.tgz", + "integrity": "sha512-r/PBafQmFYRjuxLYEHJ3ze1iBnP2GDA1nXOSS6E02KnYNZAVjj6WcDA1MSthtdAUUK0XnotHvvWM8/qz7DMO5A==", + "license": "Apache-2.0", "dependencies": { - "@opentelemetry/core": "^1.8.0", - "@opentelemetry/instrumentation": "^0.57.0", + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.204.0", "@opentelemetry/semantic-conventions": "^1.27.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-fs": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-fs/-/instrumentation-fs-0.19.0.tgz", - "integrity": "sha512-JGwmHhBkRT2G/BYNV1aGI+bBjJu4fJUD/5/Jat0EWZa2ftrLV3YE8z84Fiij/wK32oMZ88eS8DI4ecLGZhpqsQ==", + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-fs/-/instrumentation-fs-0.24.0.tgz", + "integrity": "sha512-HjIxJ6CBRD770KNVaTdMXIv29Sjz4C1kPCCK5x1Ujpc6SNnLGPqUVyJYZ3LUhhnHAqdbrl83ogVWjCgeT4Q0yw==", + "license": "Apache-2.0", "dependencies": { - "@opentelemetry/core": "^1.8.0", - "@opentelemetry/instrumentation": "^0.57.0" + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.204.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-generic-pool": { - "version": "0.43.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-generic-pool/-/instrumentation-generic-pool-0.43.0.tgz", - "integrity": "sha512-at8GceTtNxD1NfFKGAuwtqM41ot/TpcLh+YsGe4dhf7gvv1HW/ZWdq6nfRtS6UjIvZJOokViqLPJ3GVtZItAnQ==", + "version": "0.48.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-generic-pool/-/instrumentation-generic-pool-0.48.0.tgz", + "integrity": "sha512-TLv/On8pufynNR+pUbpkyvuESVASZZKMlqCm4bBImTpXKTpqXaJJ3o/MUDeMlM91rpen+PEv2SeyOKcHCSlgag==", + "license": "Apache-2.0", "dependencies": { - "@opentelemetry/instrumentation": "^0.57.0" + "@opentelemetry/instrumentation": "^0.204.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-graphql": { - "version": "0.47.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-graphql/-/instrumentation-graphql-0.47.0.tgz", - "integrity": "sha512-Cc8SMf+nLqp0fi8oAnooNEfwZWFnzMiBHCGmDFYqmgjPylyLmi83b+NiTns/rKGwlErpW0AGPt0sMpkbNlzn8w==", + "version": "0.52.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-graphql/-/instrumentation-graphql-0.52.0.tgz", + "integrity": "sha512-3fEJ8jOOMwopvldY16KuzHbRhPk8wSsOTSF0v2psmOCGewh6ad+ZbkTx/xyUK9rUdUMWAxRVU0tFpj4Wx1vkPA==", + "license": "Apache-2.0", "dependencies": { - "@opentelemetry/instrumentation": "^0.57.0" + "@opentelemetry/instrumentation": "^0.204.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-hapi": { - "version": "0.45.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-hapi/-/instrumentation-hapi-0.45.1.tgz", - "integrity": "sha512-VH6mU3YqAKTePPfUPwfq4/xr049774qWtfTuJqVHoVspCLiT3bW+fCQ1toZxt6cxRPYASoYaBsMA3CWo8B8rcw==", + "version": "0.51.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-hapi/-/instrumentation-hapi-0.51.0.tgz", + "integrity": "sha512-qyf27DaFNL1Qhbo/da+04MSCw982B02FhuOS5/UF+PMhM61CcOiu7fPuXj8TvbqyReQuJFljXE6UirlvoT/62g==", + "license": "Apache-2.0", "dependencies": { - "@opentelemetry/core": "^1.8.0", - "@opentelemetry/instrumentation": "^0.57.0", + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.204.0", "@opentelemetry/semantic-conventions": "^1.27.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-http": { - "version": "0.57.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-http/-/instrumentation-http-0.57.1.tgz", - "integrity": "sha512-ThLmzAQDs7b/tdKI3BV2+yawuF09jF111OFsovqT1Qj3D8vjwKBwhi/rDE5xethwn4tSXtZcJ9hBsVAlWFQZ7g==", + "version": "0.204.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-http/-/instrumentation-http-0.204.0.tgz", + "integrity": "sha512-1afJYyGRA4OmHTv0FfNTrTAzoEjPQUYgd+8ih/lX0LlZBnGio/O80vxA0lN3knsJPS7FiDrsDrWq25K7oAzbkw==", + "license": "Apache-2.0", "dependencies": { - "@opentelemetry/core": "1.30.1", - "@opentelemetry/instrumentation": "0.57.1", - "@opentelemetry/semantic-conventions": "1.28.0", - "forwarded-parse": "2.1.2", - "semver": "^7.5.2" + "@opentelemetry/core": "2.1.0", + "@opentelemetry/instrumentation": "0.204.0", + "@opentelemetry/semantic-conventions": "^1.29.0", + "forwarded-parse": "2.1.2" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, - "node_modules/@opentelemetry/instrumentation-http/node_modules/@opentelemetry/api-logs": { - "version": "0.57.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.57.1.tgz", - "integrity": "sha512-I4PHczeujhQAQv6ZBzqHYEUiggZL4IdSMixtVD3EYqbdrjujE7kRfI5QohjlPoJm8BvenoW5YaTMWRrbpot6tg==", - "dependencies": { - "@opentelemetry/api": "^1.3.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@opentelemetry/instrumentation-http/node_modules/@opentelemetry/instrumentation": { - "version": "0.57.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.57.1.tgz", - "integrity": "sha512-SgHEKXoVxOjc20ZYusPG3Fh+RLIZTSa4x8QtD3NfgAUDyqdFFS9W1F2ZVbZkqDCdyMcQG02Ok4duUGLHJXHgbA==", + "node_modules/@opentelemetry/instrumentation-http/node_modules/@opentelemetry/core": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-2.1.0.tgz", + "integrity": "sha512-RMEtHsxJs/GiHHxYT58IY57UXAQTuUnZVco6ymDEqTNlJKTimM4qPUPVe8InNFyBjhHBEAx4k3Q8LtNayBsbUQ==", + "license": "Apache-2.0", "dependencies": { - "@opentelemetry/api-logs": "0.57.1", - "@types/shimmer": "^1.2.0", - "import-in-the-middle": "^1.8.1", - "require-in-the-middle": "^7.1.1", - "semver": "^7.5.2", - "shimmer": "^1.2.1" + "@opentelemetry/semantic-conventions": "^1.29.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { - "@opentelemetry/api": "^1.3.0" - } - }, - "node_modules/@opentelemetry/instrumentation-http/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.28.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.28.0.tgz", - "integrity": "sha512-lp4qAiMTD4sNWW4DbKLBkfiMZ4jbAboJIGOQr5DvciMRI494OapieI9qiODpOt0XBr1LjIDy1xAGAnVs5supTA==", - "engines": { - "node": ">=14" + "@opentelemetry/api": ">=1.0.0 <1.10.0" } }, "node_modules/@opentelemetry/instrumentation-ioredis": { - "version": "0.47.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-ioredis/-/instrumentation-ioredis-0.47.0.tgz", - "integrity": "sha512-4HqP9IBC8e7pW9p90P3q4ox0XlbLGme65YTrA3UTLvqvo4Z6b0puqZQP203YFu8m9rE/luLfaG7/xrwwqMUpJw==", + "version": "0.52.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-ioredis/-/instrumentation-ioredis-0.52.0.tgz", + "integrity": "sha512-rUvlyZwI90HRQPYicxpDGhT8setMrlHKokCtBtZgYxQWRF5RBbG4q0pGtbZvd7kyseuHbFpA3I/5z7M8b/5ywg==", + "license": "Apache-2.0", "dependencies": { - "@opentelemetry/instrumentation": "^0.57.0", - "@opentelemetry/redis-common": "^0.36.2", + "@opentelemetry/instrumentation": "^0.204.0", + "@opentelemetry/redis-common": "^0.38.0", "@opentelemetry/semantic-conventions": "^1.27.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-kafkajs": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-kafkajs/-/instrumentation-kafkajs-0.7.0.tgz", - "integrity": "sha512-LB+3xiNzc034zHfCtgs4ITWhq6Xvdo8bsq7amR058jZlf2aXXDrN9SV4si4z2ya9QX4tz6r4eZJwDkXOp14/AQ==", + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-kafkajs/-/instrumentation-kafkajs-0.14.0.tgz", + "integrity": "sha512-kbB5yXS47dTIdO/lfbbXlzhvHFturbux4EpP0+6H78Lk0Bn4QXiZQW7rmZY1xBCY16mNcCb8Yt0mhz85hTnSVA==", + "license": "Apache-2.0", "dependencies": { - "@opentelemetry/instrumentation": "^0.57.0", - "@opentelemetry/semantic-conventions": "^1.27.0" + "@opentelemetry/instrumentation": "^0.204.0", + "@opentelemetry/semantic-conventions": "^1.30.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-knex": { - "version": "0.44.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-knex/-/instrumentation-knex-0.44.0.tgz", - "integrity": "sha512-SlT0+bLA0Lg3VthGje+bSZatlGHw/vwgQywx0R/5u9QC59FddTQSPJeWNw29M6f8ScORMeUOOTwihlQAn4GkJQ==", + "version": "0.49.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-knex/-/instrumentation-knex-0.49.0.tgz", + "integrity": "sha512-NKsRRT27fbIYL4Ix+BjjP8h4YveyKc+2gD6DMZbr5R5rUeDqfC8+DTfIt3c3ex3BIc5Vvek4rqHnN7q34ZetLQ==", + "license": "Apache-2.0", "dependencies": { - "@opentelemetry/instrumentation": "^0.57.0", - "@opentelemetry/semantic-conventions": "^1.27.0" + "@opentelemetry/instrumentation": "^0.204.0", + "@opentelemetry/semantic-conventions": "^1.33.1" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-koa": { - "version": "0.47.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-koa/-/instrumentation-koa-0.47.0.tgz", - "integrity": "sha512-HFdvqf2+w8sWOuwtEXayGzdZ2vWpCKEQv5F7+2DSA74Te/Cv4rvb2E5So5/lh+ok4/RAIPuvCbCb/SHQFzMmbw==", + "version": "0.52.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-koa/-/instrumentation-koa-0.52.0.tgz", + "integrity": "sha512-JJSBYLDx/mNSy8Ibi/uQixu2rH0bZODJa8/cz04hEhRaiZQoeJ5UrOhO/mS87IdgVsHrnBOsZ6vDu09znupyuA==", + "license": "Apache-2.0", "dependencies": { - "@opentelemetry/core": "^1.8.0", - "@opentelemetry/instrumentation": "^0.57.0", + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.204.0", "@opentelemetry/semantic-conventions": "^1.27.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-lru-memoizer": { - "version": "0.44.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-lru-memoizer/-/instrumentation-lru-memoizer-0.44.0.tgz", - "integrity": "sha512-Tn7emHAlvYDFik3vGU0mdwvWJDwtITtkJ+5eT2cUquct6nIs+H8M47sqMJkCpyPe5QIBJoTOHxmc6mj9lz6zDw==", + "version": "0.49.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-lru-memoizer/-/instrumentation-lru-memoizer-0.49.0.tgz", + "integrity": "sha512-ctXu+O/1HSadAxtjoEg2w307Z5iPyLOMM8IRNwjaKrIpNAthYGSOanChbk1kqY6zU5CrpkPHGdAT6jk8dXiMqw==", + "license": "Apache-2.0", "dependencies": { - "@opentelemetry/instrumentation": "^0.57.0" + "@opentelemetry/instrumentation": "^0.204.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-mongodb": { - "version": "0.51.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mongodb/-/instrumentation-mongodb-0.51.0.tgz", - "integrity": "sha512-cMKASxCX4aFxesoj3WK8uoQ0YUrRvnfxaO72QWI2xLu5ZtgX/QvdGBlU3Ehdond5eb74c2s1cqRQUIptBnKz1g==", + "version": "0.57.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mongodb/-/instrumentation-mongodb-0.57.0.tgz", + "integrity": "sha512-KD6Rg0KSHWDkik+qjIOWoksi1xqSpix8TSPfquIK1DTmd9OTFb5PHmMkzJe16TAPVEuElUW8gvgP59cacFcrMQ==", + "license": "Apache-2.0", "dependencies": { - "@opentelemetry/instrumentation": "^0.57.0", + "@opentelemetry/instrumentation": "^0.204.0", "@opentelemetry/semantic-conventions": "^1.27.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-mongoose": { - "version": "0.46.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mongoose/-/instrumentation-mongoose-0.46.0.tgz", - "integrity": "sha512-mtVv6UeaaSaWTeZtLo4cx4P5/ING2obSqfWGItIFSunQBrYROfhuVe7wdIrFUs2RH1tn2YYpAJyMaRe/bnTTIQ==", + "version": "0.51.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mongoose/-/instrumentation-mongoose-0.51.0.tgz", + "integrity": "sha512-gwWaAlhhV2By7XcbyU3DOLMvzsgeaymwP/jktDC+/uPkCmgB61zurwqOQdeiRq9KAf22Y2dtE5ZLXxytJRbEVA==", + "license": "Apache-2.0", "dependencies": { - "@opentelemetry/core": "^1.8.0", - "@opentelemetry/instrumentation": "^0.57.0", + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.204.0", "@opentelemetry/semantic-conventions": "^1.27.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-mysql": { - "version": "0.45.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mysql/-/instrumentation-mysql-0.45.0.tgz", - "integrity": "sha512-tWWyymgwYcTwZ4t8/rLDfPYbOTF3oYB8SxnYMtIQ1zEf5uDm90Ku3i6U/vhaMyfHNlIHvDhvJh+qx5Nc4Z3Acg==", + "version": "0.50.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mysql/-/instrumentation-mysql-0.50.0.tgz", + "integrity": "sha512-duKAvMRI3vq6u9JwzIipY9zHfikN20bX05sL7GjDeLKr2qV0LQ4ADtKST7KStdGcQ+MTN5wghWbbVdLgNcB3rA==", + "license": "Apache-2.0", "dependencies": { - "@opentelemetry/instrumentation": "^0.57.0", + "@opentelemetry/instrumentation": "^0.204.0", "@opentelemetry/semantic-conventions": "^1.27.0", - "@types/mysql": "2.15.26" + "@types/mysql": "2.15.27" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-mysql2": { - "version": "0.45.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mysql2/-/instrumentation-mysql2-0.45.0.tgz", - "integrity": "sha512-qLslv/EPuLj0IXFvcE3b0EqhWI8LKmrgRPIa4gUd8DllbBpqJAvLNJSv3cC6vWwovpbSI3bagNO/3Q2SuXv2xA==", + "version": "0.51.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-mysql2/-/instrumentation-mysql2-0.51.0.tgz", + "integrity": "sha512-zT2Wg22Xn43RyfU3NOUmnFtb5zlDI0fKcijCj9AcK9zuLZ4ModgtLXOyBJSSfO+hsOCZSC1v/Fxwj+nZJFdzLQ==", + "license": "Apache-2.0", "dependencies": { - "@opentelemetry/instrumentation": "^0.57.0", + "@opentelemetry/instrumentation": "^0.204.0", "@opentelemetry/semantic-conventions": "^1.27.0", - "@opentelemetry/sql-common": "^0.40.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" - } - }, - "node_modules/@opentelemetry/instrumentation-nestjs-core": { - "version": "0.44.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-nestjs-core/-/instrumentation-nestjs-core-0.44.0.tgz", - "integrity": "sha512-t16pQ7A4WYu1yyQJZhRKIfUNvl5PAaF2pEteLvgJb/BWdd1oNuU1rOYt4S825kMy+0q4ngiX281Ss9qiwHfxFQ==", - "dependencies": { - "@opentelemetry/instrumentation": "^0.57.0", - "@opentelemetry/semantic-conventions": "^1.27.0" + "@opentelemetry/sql-common": "^0.41.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-pg": { - "version": "0.50.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-pg/-/instrumentation-pg-0.50.0.tgz", - "integrity": "sha512-TtLxDdYZmBhFswm8UIsrDjh/HFBeDXd4BLmE8h2MxirNHewLJ0VS9UUddKKEverb5Sm2qFVjqRjcU+8Iw4FJ3w==", - "dependencies": { - "@opentelemetry/core": "^1.26.0", - "@opentelemetry/instrumentation": "^0.57.0", - "@opentelemetry/semantic-conventions": "1.27.0", - "@opentelemetry/sql-common": "^0.40.1", - "@types/pg": "8.6.1", + "version": "0.57.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-pg/-/instrumentation-pg-0.57.0.tgz", + "integrity": "sha512-dWLGE+r5lBgm2A8SaaSYDE3OKJ/kwwy5WLyGyzor8PLhUL9VnJRiY6qhp4njwhnljiLtzeffRtG2Mf/YyWLeTw==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.204.0", + "@opentelemetry/semantic-conventions": "^1.34.0", + "@opentelemetry/sql-common": "^0.41.0", + "@types/pg": "8.15.5", "@types/pg-pool": "2.0.6" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, - "node_modules/@opentelemetry/instrumentation-pg/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.27.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz", - "integrity": "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==", - "engines": { - "node": ">=14" - } - }, - "node_modules/@opentelemetry/instrumentation-redis-4": { - "version": "0.46.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-redis-4/-/instrumentation-redis-4-0.46.0.tgz", - "integrity": "sha512-aTUWbzbFMFeRODn3720TZO0tsh/49T8H3h8vVnVKJ+yE36AeW38Uj/8zykQ/9nO8Vrtjr5yKuX3uMiG/W8FKNw==", + "node_modules/@opentelemetry/instrumentation-redis": { + "version": "0.53.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-redis/-/instrumentation-redis-0.53.0.tgz", + "integrity": "sha512-WUHV8fr+8yo5RmzyU7D5BIE1zwiaNQcTyZPwtxlfr7px6NYYx7IIpSihJK7WA60npWynfxxK1T67RAVF0Gdfjg==", + "license": "Apache-2.0", "dependencies": { - "@opentelemetry/instrumentation": "^0.57.0", - "@opentelemetry/redis-common": "^0.36.2", + "@opentelemetry/instrumentation": "^0.204.0", + "@opentelemetry/redis-common": "^0.38.0", "@opentelemetry/semantic-conventions": "^1.27.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-tedious": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-tedious/-/instrumentation-tedious-0.18.0.tgz", - "integrity": "sha512-9zhjDpUDOtD+coeADnYEJQ0IeLVCj7w/hqzIutdp5NqS1VqTAanaEfsEcSypyvYv5DX3YOsTUoF+nr2wDXPETA==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-tedious/-/instrumentation-tedious-0.23.0.tgz", + "integrity": "sha512-3TMTk/9VtlRonVTaU4tCzbg4YqW+Iq/l5VnN2e5whP6JgEg/PKfrGbqQ+CxQWNLfLaQYIUgEZqAn5gk/inh1uQ==", + "license": "Apache-2.0", "dependencies": { - "@opentelemetry/instrumentation": "^0.57.0", + "@opentelemetry/instrumentation": "^0.204.0", "@opentelemetry/semantic-conventions": "^1.27.0", "@types/tedious": "^4.0.14" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.3.0" } }, "node_modules/@opentelemetry/instrumentation-undici": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-undici/-/instrumentation-undici-0.10.0.tgz", - "integrity": "sha512-vm+V255NGw9gaSsPD6CP0oGo8L55BffBc8KnxqsMuc6XiAD1L8SFNzsW0RHhxJFqy9CJaJh+YiJ5EHXuZ5rZBw==", + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation-undici/-/instrumentation-undici-0.15.0.tgz", + "integrity": "sha512-sNFGA/iCDlVkNjzTzPRcudmI11vT/WAfAguRdZY9IspCw02N4WSC72zTuQhSMheh2a1gdeM9my1imnKRvEEvEg==", + "license": "Apache-2.0", "dependencies": { - "@opentelemetry/core": "^1.8.0", - "@opentelemetry/instrumentation": "^0.57.0" + "@opentelemetry/core": "^2.0.0", + "@opentelemetry/instrumentation": "^0.204.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.7.0" } }, "node_modules/@opentelemetry/redis-common": { - "version": "0.36.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/redis-common/-/redis-common-0.36.2.tgz", - "integrity": "sha512-faYX1N0gpLhej/6nyp6bgRjzAKXn5GOEMYY7YhciSfCoITAktLUtQ36d24QEWNA1/WA1y6qQunCe0OhHRkVl9g==", + "version": "0.38.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/redis-common/-/redis-common-0.38.2.tgz", + "integrity": "sha512-1BCcU93iwSRZvDAgwUxC/DV4T/406SkMfxGqu5ojc3AvNI+I9GhV7v0J1HljsczuuhcnFLYqD5VmwVXfCGHzxA==", + "license": "Apache-2.0", "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" } }, "node_modules/@opentelemetry/resources": { - "version": "1.30.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.30.1.tgz", - "integrity": "sha512-5UxZqiAgLYGFjS4s9qm5mBVo433u+dSPUFWVWXmLAD4wB65oMCoXaJP1KJa9DIYYMeHu3z4BZcStG3LC593cWA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-2.2.0.tgz", + "integrity": "sha512-1pNQf/JazQTMA0BiO5NINUzH0cbLbbl7mntLa4aJNmCCXSj0q03T5ZXXL0zw4G55TjdL9Tz32cznGClf+8zr5A==", + "license": "Apache-2.0", "dependencies": { - "@opentelemetry/core": "1.30.1", - "@opentelemetry/semantic-conventions": "1.28.0" + "@opentelemetry/core": "2.2.0", + "@opentelemetry/semantic-conventions": "^1.29.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.10.0" - } - }, - "node_modules/@opentelemetry/resources/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.28.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.28.0.tgz", - "integrity": "sha512-lp4qAiMTD4sNWW4DbKLBkfiMZ4jbAboJIGOQr5DvciMRI494OapieI9qiODpOt0XBr1LjIDy1xAGAnVs5supTA==", - "engines": { - "node": ">=14" + "@opentelemetry/api": ">=1.3.0 <1.10.0" } }, "node_modules/@opentelemetry/sdk-trace-base": { - "version": "1.30.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.30.1.tgz", - "integrity": "sha512-jVPgBbH1gCy2Lb7X0AVQ8XAfgg0pJ4nvl8/IiQA6nxOsPvS+0zMJaFSs2ltXe0J6C8dqjcnpyqINDJmU30+uOg==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-2.2.0.tgz", + "integrity": "sha512-xWQgL0Bmctsalg6PaXExmzdedSp3gyKV8mQBwK/j9VGdCDu2fmXIb2gAehBKbkXCpJ4HPkgv3QfoJWRT4dHWbw==", + "license": "Apache-2.0", "dependencies": { - "@opentelemetry/core": "1.30.1", - "@opentelemetry/resources": "1.30.1", - "@opentelemetry/semantic-conventions": "1.28.0" + "@opentelemetry/core": "2.2.0", + "@opentelemetry/resources": "2.2.0", + "@opentelemetry/semantic-conventions": "^1.29.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.10.0" - } - }, - "node_modules/@opentelemetry/sdk-trace-base/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.28.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.28.0.tgz", - "integrity": "sha512-lp4qAiMTD4sNWW4DbKLBkfiMZ4jbAboJIGOQr5DvciMRI494OapieI9qiODpOt0XBr1LjIDy1xAGAnVs5supTA==", - "engines": { - "node": ">=14" + "@opentelemetry/api": ">=1.3.0 <1.10.0" } }, "node_modules/@opentelemetry/semantic-conventions": { - "version": "1.34.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.34.0.tgz", - "integrity": "sha512-aKcOkyrorBGlajjRdVoJWHTxfxO1vCNHLJVlSDaRHDIdjU+pX8IYQPvPDkYiujKLbRnWU+1TBwEt0QRgSm4SGA==", + "version": "1.38.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.38.0.tgz", + "integrity": "sha512-kocjix+/sSggfJhwXqClZ3i9Y/MI0fp7b+g7kCRm6psy2dsf8uApTRclwG18h8Avm7C9+fnt+O36PspJ/OzoWg==", + "license": "Apache-2.0", "engines": { "node": ">=14" } }, "node_modules/@opentelemetry/sql-common": { - "version": "0.40.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sql-common/-/sql-common-0.40.1.tgz", - "integrity": "sha512-nSDlnHSqzC3pXn/wZEZVLuAuJ1MYMXPBwtv2qAbCa3847SaHItdE7SzUq/Jtb0KZmh1zfAbNi3AAMjztTT4Ugg==", + "version": "0.41.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/sql-common/-/sql-common-0.41.2.tgz", + "integrity": "sha512-4mhWm3Z8z+i508zQJ7r6Xi7y4mmoJpdvH0fZPFRkWrdp5fq7hhZ2HhYokEOLkfqSMgPR4Z9EyB3DBkbKGOqZiQ==", + "license": "Apache-2.0", "dependencies": { - "@opentelemetry/core": "^1.1.0" + "@opentelemetry/core": "^2.0.0" }, "engines": { - "node": ">=14" + "node": "^18.19.0 || >=20.6.0" }, "peerDependencies": { "@opentelemetry/api": "^1.1.0" } }, "node_modules/@paralleldrive/cuid2": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/@paralleldrive/cuid2/-/cuid2-2.2.2.tgz", - "integrity": "sha512-ZOBkgDwEdoYVlSeRbYYXs0S9MejQofiVYoTbKzy/6GQa39/q5tQU2IX46+shYnUkpEl3wc+J6wRlar7r2EK2xA==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@paralleldrive/cuid2/-/cuid2-2.3.1.tgz", + "integrity": "sha512-XO7cAxhnTZl0Yggq6jOgjiOHhbgcO4NqFqwSmQpjK3b6TEE6Uj/jfSk6wzYyemh3+I0sHirKSetjQwn5cZktFw==", + "license": "MIT", "dependencies": { "@noble/hashes": "^1.1.5" } }, - "node_modules/@pkgjs/parseargs": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", - "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", - "optional": true, - "engines": { - "node": ">=14" - } + "node_modules/@pinojs/redact": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@pinojs/redact/-/redact-0.4.0.tgz", + "integrity": "sha512-k2ENnmBugE/rzQfEcdWHcCY+/FM3VLzH9cYEsbdsoqrvzAKRhUZeRNhAZvB8OitQJ1TBed3yqWtdjzS6wJKBwg==", + "license": "MIT" }, "node_modules/@pkgr/core": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.2.7.tgz", - "integrity": "sha512-YLT9Zo3oNPJoBjBc4q8G2mjU4tqIbf5CEOORbUUr48dCD9q3umJ3IPlVqOqDakPfd2HuwccBaqlGhN4Gmr5OWg==", + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.2.9.tgz", + "integrity": "sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA==", "dev": true, + "license": "MIT", "engines": { "node": "^12.20.0 || ^14.18.0 || >=16.0.0" }, @@ -2952,10 +3443,11 @@ } }, "node_modules/@prisma/client": { - "version": "6.11.1", - "resolved": "https://registry.npmjs.org/@prisma/client/-/client-6.11.1.tgz", - "integrity": "sha512-5CLFh8QP6KxRm83pJ84jaVCeSVPQr8k0L2SEtOJHwdkS57/VQDcI/wQpGmdyOZi+D9gdNabdo8tj1Uk+w+upsQ==", + "version": "6.19.0", + "resolved": "https://registry.npmjs.org/@prisma/client/-/client-6.19.0.tgz", + "integrity": "sha512-QXFT+N/bva/QI2qoXmjBzL7D6aliPffIwP+81AdTGq0FXDoLxLkWivGMawG8iM5B9BKfxLIXxfWWAF6wbuJU6g==", "hasInstallScript": true, + "license": "Apache-2.0", "engines": { "node": ">=18.18" }, @@ -2973,80 +3465,93 @@ } }, "node_modules/@prisma/config": { - "version": "6.11.1", - "resolved": "https://registry.npmjs.org/@prisma/config/-/config-6.11.1.tgz", - "integrity": "sha512-z6rCTQN741wxDq82cpdzx2uVykpnQIXalLhrWQSR0jlBVOxCIkz3HZnd8ern3uYTcWKfB3IpVAF7K2FU8t/8AQ==", + "version": "6.19.0", + "resolved": "https://registry.npmjs.org/@prisma/config/-/config-6.19.0.tgz", + "integrity": "sha512-zwCayme+NzI/WfrvFEtkFhhOaZb/hI+X8TTjzjJ252VbPxAl2hWHK5NMczmnG9sXck2lsXrxIZuK524E25UNmg==", + "license": "Apache-2.0", "dependencies": { - "jiti": "2.4.2" + "c12": "3.1.0", + "deepmerge-ts": "7.1.5", + "effect": "3.18.4", + "empathic": "2.0.0" } }, "node_modules/@prisma/debug": { - "version": "6.11.1", - "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-6.11.1.tgz", - "integrity": "sha512-lWRb/YSWu8l4Yum1UXfGLtqFzZkVS2ygkWYpgkbgMHn9XJlMITIgeMvJyX5GepChzhmxuSuiq/MY/kGFweOpGw==" + "version": "6.19.0", + "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-6.19.0.tgz", + "integrity": "sha512-8hAdGG7JmxrzFcTzXZajlQCidX0XNkMJkpqtfbLV54wC6LSSX6Vni25W/G+nAANwLnZ2TmwkfIuWetA7jJxJFA==", + "license": "Apache-2.0" }, "node_modules/@prisma/engines": { - "version": "6.11.1", - "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-6.11.1.tgz", - "integrity": "sha512-6eKEcV6V8W2eZAUwX2xTktxqPM4vnx3sxz3SDtpZwjHKpC6lhOtc4vtAtFUuf5+eEqBk+dbJ9Dcaj6uQU+FNNg==", + "version": "6.19.0", + "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-6.19.0.tgz", + "integrity": "sha512-pMRJ+1S6NVdXoB8QJAPIGpKZevFjxhKt0paCkRDTZiczKb7F4yTgRP8M4JdVkpQwmaD4EoJf6qA+p61godDokw==", "hasInstallScript": true, + "license": "Apache-2.0", "dependencies": { - "@prisma/debug": "6.11.1", - "@prisma/engines-version": "6.11.1-1.f40f79ec31188888a2e33acda0ecc8fd10a853a9", - "@prisma/fetch-engine": "6.11.1", - "@prisma/get-platform": "6.11.1" + "@prisma/debug": "6.19.0", + "@prisma/engines-version": "6.19.0-26.2ba551f319ab1df4bc874a89965d8b3641056773", + "@prisma/fetch-engine": "6.19.0", + "@prisma/get-platform": "6.19.0" } }, "node_modules/@prisma/engines-version": { - "version": "6.11.1-1.f40f79ec31188888a2e33acda0ecc8fd10a853a9", - "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-6.11.1-1.f40f79ec31188888a2e33acda0ecc8fd10a853a9.tgz", - "integrity": "sha512-swFJTOOg4tHyOM1zB/pHb3MeH0i6t7jFKn5l+ZsB23d9AQACuIRo9MouvuKGvnDogzkcjbWnXi/NvOZ0+n5Jfw==" + "version": "6.19.0-26.2ba551f319ab1df4bc874a89965d8b3641056773", + "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-6.19.0-26.2ba551f319ab1df4bc874a89965d8b3641056773.tgz", + "integrity": "sha512-gV7uOBQfAFlWDvPJdQxMT1aSRur3a0EkU/6cfbAC5isV67tKDWUrPauyaHNpB+wN1ebM4A9jn/f4gH+3iHSYSQ==", + "license": "Apache-2.0" }, "node_modules/@prisma/fetch-engine": { - "version": "6.11.1", - "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-6.11.1.tgz", - "integrity": "sha512-NBYzmkXTkj9+LxNPRSndaAeALOL1Gr3tjvgRYNqruIPlZ6/ixLeuE/5boYOewant58tnaYFZ5Ne0jFBPfGXHpQ==", + "version": "6.19.0", + "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-6.19.0.tgz", + "integrity": "sha512-OOx2Lda0DGrZ1rodADT06ZGqHzr7HY7LNMaFE2Vp8dp146uJld58sRuasdX0OiwpHgl8SqDTUKHNUyzEq7pDdQ==", + "license": "Apache-2.0", "dependencies": { - "@prisma/debug": "6.11.1", - "@prisma/engines-version": "6.11.1-1.f40f79ec31188888a2e33acda0ecc8fd10a853a9", - "@prisma/get-platform": "6.11.1" + "@prisma/debug": "6.19.0", + "@prisma/engines-version": "6.19.0-26.2ba551f319ab1df4bc874a89965d8b3641056773", + "@prisma/get-platform": "6.19.0" } }, "node_modules/@prisma/get-platform": { - "version": "6.11.1", - "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-6.11.1.tgz", - "integrity": "sha512-b2Z8oV2gwvdCkFemBTFd0x4lsL4O2jLSx8lB7D+XqoFALOQZPa7eAPE1NU0Mj1V8gPHRxIsHnyUNtw2i92psUw==", + "version": "6.19.0", + "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-6.19.0.tgz", + "integrity": "sha512-ym85WDO2yDhC3fIXHWYpG3kVMBA49cL1XD2GCsCF8xbwoy2OkDQY44gEbAt2X46IQ4Apq9H6g0Ex1iFfPqEkHA==", + "license": "Apache-2.0", "dependencies": { - "@prisma/debug": "6.11.1" + "@prisma/debug": "6.19.0" } }, "node_modules/@prisma/instrumentation": { - "version": "5.22.0", - "resolved": "https://registry.npmjs.org/@prisma/instrumentation/-/instrumentation-5.22.0.tgz", - "integrity": "sha512-LxccF392NN37ISGxIurUljZSh1YWnphO34V5a0+T7FVQG2u9bhAXRTJpgmQ3483woVhkraQZFF7cbRrpbw/F4Q==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/@prisma/instrumentation/-/instrumentation-6.15.0.tgz", + "integrity": "sha512-6TXaH6OmDkMOQvOxwLZ8XS51hU2v4A3vmE2pSijCIiGRJYyNeMcL6nMHQMyYdZRD8wl7LF3Wzc+AMPMV/9Oo7A==", + "license": "Apache-2.0", "dependencies": { - "@opentelemetry/api": "^1.8", - "@opentelemetry/instrumentation": "^0.49 || ^0.50 || ^0.51 || ^0.52.0 || ^0.53.0", - "@opentelemetry/sdk-trace-base": "^1.22" + "@opentelemetry/instrumentation": "^0.52.0 || ^0.53.0 || ^0.54.0 || ^0.55.0 || ^0.56.0 || ^0.57.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.8" } }, "node_modules/@prisma/instrumentation/node_modules/@opentelemetry/api-logs": { - "version": "0.53.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.53.0.tgz", - "integrity": "sha512-8HArjKx+RaAI8uEIgcORbZIPklyh1YLjPSBus8hjRmvLi6DeFzgOcdZ7KwPabKj8mXF8dX0hyfAyGfycz0DbFw==", + "version": "0.57.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/api-logs/-/api-logs-0.57.2.tgz", + "integrity": "sha512-uIX52NnTM0iBh84MShlpouI7UKqkZ7MrUszTmaypHBu4r7NofznSnQRfJ+uUeDtQDj6w8eFGg5KBLDAwAPz1+A==", + "license": "Apache-2.0", "dependencies": { - "@opentelemetry/api": "^1.0.0" + "@opentelemetry/api": "^1.3.0" }, "engines": { "node": ">=14" } }, "node_modules/@prisma/instrumentation/node_modules/@opentelemetry/instrumentation": { - "version": "0.53.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.53.0.tgz", - "integrity": "sha512-DMwg0hy4wzf7K73JJtl95m/e0boSoWhH07rfvHvYzQtBD3Bmv0Wc1x733vyZBqmFm8OjJD0/pfiUg1W3JjFX0A==", + "version": "0.57.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.57.2.tgz", + "integrity": "sha512-BdBGhQBh8IjZ2oIIX6F2/Q3LKm/FDDKi6ccYKcBTeilh6SNdNKveDOLk73BkSJjQLJk6qe4Yh+hHw1UPhCDdrg==", + "license": "Apache-2.0", "dependencies": { - "@opentelemetry/api-logs": "0.53.0", + "@opentelemetry/api-logs": "0.57.2", "@types/shimmer": "^1.2.0", "import-in-the-middle": "^1.8.1", "require-in-the-middle": "^7.1.1", @@ -3063,27 +3568,32 @@ "node_modules/@protobufjs/aspromise": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/base64": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/codegen": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/eventemitter": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/fetch": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "license": "BSD-3-Clause", "dependencies": { "@protobufjs/aspromise": "^1.1.1", "@protobufjs/inquire": "^1.1.0" @@ -3092,32 +3602,38 @@ "node_modules/@protobufjs/float": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/inquire": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/path": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/pool": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/utf8": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", + "license": "BSD-3-Clause" }, "node_modules/@redis/bloom": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@redis/bloom/-/bloom-1.2.0.tgz", "integrity": "sha512-HG2DFjYKbpNmVXsa0keLHp/3leGJz1mjh09f2RLGGLQZzSHpkmZWuwJbAvo3QcRY8p80m5+ZdXZdYOSBLlp7Cg==", + "license": "MIT", "peerDependencies": { "@redis/client": "^1.0.0" } @@ -3126,6 +3642,7 @@ "version": "1.6.1", "resolved": "https://registry.npmjs.org/@redis/client/-/client-1.6.1.tgz", "integrity": "sha512-/KCsg3xSlR+nCK8/8ZYSknYxvXHwubJrU82F3Lm1Fp6789VQ0/3RJKfsmRXjqfaTA++23CvC3hqmqe/2GEt6Kw==", + "license": "MIT", "dependencies": { "cluster-key-slot": "1.1.2", "generic-pool": "3.9.0", @@ -3139,6 +3656,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/@redis/graph/-/graph-1.1.1.tgz", "integrity": "sha512-FEMTcTHZozZciLRl6GiiIB4zGm5z5F3F6a6FZCyrfxdKOhFlGkiAqlexWMBzCi4DcRoyiOsuLfW+cjlGWyExOw==", + "license": "MIT", "peerDependencies": { "@redis/client": "^1.0.0" } @@ -3147,6 +3665,7 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/@redis/json/-/json-1.0.7.tgz", "integrity": "sha512-6UyXfjVaTBTJtKNG4/9Z8PSpKE6XgSyEb8iwaqDcy+uKrd/DGYHTWkUdnQDyzm727V7p21WUMhsqz5oy65kPcQ==", + "license": "MIT", "peerDependencies": { "@redis/client": "^1.0.0" } @@ -3155,6 +3674,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/@redis/search/-/search-1.2.0.tgz", "integrity": "sha512-tYoDBbtqOVigEDMAcTGsRlMycIIjwMCgD8eR2t0NANeQmgK/lvxNAvYyb6bZDD4frHRhIHkJu2TBRvB0ERkOmw==", + "license": "MIT", "peerDependencies": { "@redis/client": "^1.0.0" } @@ -3163,245 +3683,292 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/@redis/time-series/-/time-series-1.1.0.tgz", "integrity": "sha512-c1Q99M5ljsIuc4YdaCwfUEXsofakb9c8+Zse2qxTadu8TalLXuAESzLvFAvNVbkmSlvlzIQOLpBCmWI9wTOt+g==", + "license": "MIT", "peerDependencies": { "@redis/client": "^1.0.0" } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.44.2.tgz", - "integrity": "sha512-g0dF8P1e2QYPOj1gu7s/3LVP6kze9A7m6x0BZ9iTdXK8N5c2V7cpBKHV3/9A4Zd8xxavdhK0t4PnqjkqVmUc9Q==", + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.53.3.tgz", + "integrity": "sha512-mRSi+4cBjrRLoaal2PnqH82Wqyb+d3HsPUN/W+WslCXsZsyHa9ZeQQX/pQsZaVIWDkPcpV6jJ+3KLbTbgnwv8w==", "cpu": [ "arm" ], + "license": "MIT", "optional": true, "os": [ "android" ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.44.2.tgz", - "integrity": "sha512-Yt5MKrOosSbSaAK5Y4J+vSiID57sOvpBNBR6K7xAaQvk3MkcNVV0f9fE20T+41WYN8hDn6SGFlFrKudtx4EoxA==", + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.53.3.tgz", + "integrity": "sha512-CbDGaMpdE9sh7sCmTrTUyllhrg65t6SwhjlMJsLr+J8YjFuPmCEjbBSx4Z/e4SmDyH3aB5hGaJUP2ltV/vcs4w==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "android" ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.44.2.tgz", - "integrity": "sha512-EsnFot9ZieM35YNA26nhbLTJBHD0jTwWpPwmRVDzjylQT6gkar+zenfb8mHxWpRrbn+WytRRjE0WKsfaxBkVUA==", + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.53.3.tgz", + "integrity": "sha512-Nr7SlQeqIBpOV6BHHGZgYBuSdanCXuw09hon14MGOLGmXAFYjx1wNvquVPmpZnl0tLjg25dEdr4IQ6GgyToCUA==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "darwin" ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.44.2.tgz", - "integrity": "sha512-dv/t1t1RkCvJdWWxQ2lWOO+b7cMsVw5YFaS04oHpZRWehI1h0fV1gF4wgGCTyQHHjJDfbNpwOi6PXEafRBBezw==", + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.53.3.tgz", + "integrity": "sha512-DZ8N4CSNfl965CmPktJ8oBnfYr3F8dTTNBQkRlffnUarJ2ohudQD17sZBa097J8xhQ26AwhHJ5mvUyQW8ddTsQ==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "darwin" ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.44.2.tgz", - "integrity": "sha512-W4tt4BLorKND4qeHElxDoim0+BsprFTwb+vriVQnFFtT/P6v/xO5I99xvYnVzKWrK6j7Hb0yp3x7V5LUbaeOMg==", + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.53.3.tgz", + "integrity": "sha512-yMTrCrK92aGyi7GuDNtGn2sNW+Gdb4vErx4t3Gv/Tr+1zRb8ax4z8GWVRfr3Jw8zJWvpGHNpss3vVlbF58DZ4w==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "freebsd" ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.44.2.tgz", - "integrity": "sha512-tdT1PHopokkuBVyHjvYehnIe20fxibxFCEhQP/96MDSOcyjM/shlTkZZLOufV3qO6/FQOSiJTBebhVc12JyPTA==", + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.53.3.tgz", + "integrity": "sha512-lMfF8X7QhdQzseM6XaX0vbno2m3hlyZFhwcndRMw8fbAGUGL3WFMBdK0hbUBIUYcEcMhVLr1SIamDeuLBnXS+Q==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "freebsd" ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.44.2.tgz", - "integrity": "sha512-+xmiDGGaSfIIOXMzkhJ++Oa0Gwvl9oXUeIiwarsdRXSe27HUIvjbSIpPxvnNsRebsNdUo7uAiQVgBD1hVriwSQ==", + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.53.3.tgz", + "integrity": "sha512-k9oD15soC/Ln6d2Wv/JOFPzZXIAIFLp6B+i14KhxAfnq76ajt0EhYc5YPeX6W1xJkAdItcVT+JhKl1QZh44/qw==", "cpu": [ "arm" ], + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.44.2.tgz", - "integrity": "sha512-bDHvhzOfORk3wt8yxIra8N4k/N0MnKInCW5OGZaeDYa/hMrdPaJzo7CSkjKZqX4JFUWjUGm88lI6QJLCM7lDrA==", + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.53.3.tgz", + "integrity": "sha512-vTNlKq+N6CK/8UktsrFuc+/7NlEYVxgaEgRXVUVK258Z5ymho29skzW1sutgYjqNnquGwVUObAaxae8rZ6YMhg==", "cpu": [ "arm" ], + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.44.2.tgz", - "integrity": "sha512-NMsDEsDiYghTbeZWEGnNi4F0hSbGnsuOG+VnNvxkKg0IGDvFh7UVpM/14mnMwxRxUf9AdAVJgHPvKXf6FpMB7A==", + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.53.3.tgz", + "integrity": "sha512-RGrFLWgMhSxRs/EWJMIFM1O5Mzuz3Xy3/mnxJp/5cVhZ2XoCAxJnmNsEyeMJtpK+wu0FJFWz+QF4mjCA7AUQ3w==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.44.2.tgz", - "integrity": "sha512-lb5bxXnxXglVq+7imxykIp5xMq+idehfl+wOgiiix0191av84OqbjUED+PRC5OA8eFJYj5xAGcpAZ0pF2MnW+A==", + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.53.3.tgz", + "integrity": "sha512-kASyvfBEWYPEwe0Qv4nfu6pNkITLTb32p4yTgzFCocHnJLAHs+9LjUu9ONIhvfT/5lv4YS5muBHyuV84epBo/A==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "linux" ] }, - "node_modules/@rollup/rollup-linux-loongarch64-gnu": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.44.2.tgz", - "integrity": "sha512-Yl5Rdpf9pIc4GW1PmkUGHdMtbx0fBLE1//SxDmuf3X0dUC57+zMepow2LK0V21661cjXdTn8hO2tXDdAWAqE5g==", + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.53.3.tgz", + "integrity": "sha512-JiuKcp2teLJwQ7vkJ95EwESWkNRFJD7TQgYmCnrPtlu50b4XvT5MOmurWNrCj3IFdyjBQ5p9vnrX4JM6I8OE7g==", "cpu": [ "loong64" ], + "license": "MIT", "optional": true, "os": [ "linux" ] }, - "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.44.2.tgz", - "integrity": "sha512-03vUDH+w55s680YYryyr78jsO1RWU9ocRMaeV2vMniJJW/6HhoTBwyyiiTPVHNWLnhsnwcQ0oH3S9JSBEKuyqw==", + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.53.3.tgz", + "integrity": "sha512-EoGSa8nd6d3T7zLuqdojxC20oBfNT8nexBbB/rkxgKj5T5vhpAQKKnD+h3UkoMuTyXkP5jTjK/ccNRmQrPNDuw==", "cpu": [ "ppc64" ], + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.44.2.tgz", - "integrity": "sha512-iYtAqBg5eEMG4dEfVlkqo05xMOk6y/JXIToRca2bAWuqjrJYJlx/I7+Z+4hSrsWU8GdJDFPL4ktV3dy4yBSrzg==", + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.53.3.tgz", + "integrity": "sha512-4s+Wped2IHXHPnAEbIB0YWBv7SDohqxobiiPA1FIWZpX+w9o2i4LezzH/NkFUl8LRci/8udci6cLq+jJQlh+0g==", "cpu": [ "riscv64" ], + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.44.2.tgz", - "integrity": "sha512-e6vEbgaaqz2yEHqtkPXa28fFuBGmUJ0N2dOJK8YUfijejInt9gfCSA7YDdJ4nYlv67JfP3+PSWFX4IVw/xRIPg==", + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.53.3.tgz", + "integrity": "sha512-68k2g7+0vs2u9CxDt5ktXTngsxOQkSEV/xBbwlqYcUrAVh6P9EgMZvFsnHy4SEiUl46Xf0IObWVbMvPrr2gw8A==", "cpu": [ "riscv64" ], + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.44.2.tgz", - "integrity": "sha512-evFOtkmVdY3udE+0QKrV5wBx7bKI0iHz5yEVx5WqDJkxp9YQefy4Mpx3RajIVcM6o7jxTvVd/qpC1IXUhGc1Mw==", + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.53.3.tgz", + "integrity": "sha512-VYsFMpULAz87ZW6BVYw3I6sWesGpsP9OPcyKe8ofdg9LHxSbRMd7zrVrr5xi/3kMZtpWL/wC+UIJWJYVX5uTKg==", "cpu": [ "s390x" ], + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.44.2.tgz", - "integrity": "sha512-/bXb0bEsWMyEkIsUL2Yt5nFB5naLAwyOWMEviQfQY1x3l5WsLKgvZf66TM7UTfED6erckUVUJQ/jJ1FSpm3pRQ==", + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.53.3.tgz", + "integrity": "sha512-3EhFi1FU6YL8HTUJZ51imGJWEX//ajQPfqWLI3BQq4TlvHy4X0MOr5q3D2Zof/ka0d5FNdPwZXm3Yyib/UEd+w==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "linux" ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.44.2.tgz", - "integrity": "sha512-3D3OB1vSSBXmkGEZR27uiMRNiwN08/RVAcBKwhUYPaiZ8bcvdeEwWPvbnXvvXHY+A/7xluzcN+kaiOFNiOZwWg==", + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.53.3.tgz", + "integrity": "sha512-eoROhjcc6HbZCJr+tvVT8X4fW3/5g/WkGvvmwz/88sDtSJzO7r/blvoBDgISDiCjDRZmHpwud7h+6Q9JxFwq1Q==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "linux" ] }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.53.3.tgz", + "integrity": "sha512-OueLAWgrNSPGAdUdIjSWXw+u/02BRTcnfw9PN41D2vq/JSEPnJnVuBgw18VkN8wcd4fjUs+jFHVM4t9+kBSNLw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.44.2.tgz", - "integrity": "sha512-VfU0fsMK+rwdK8mwODqYeM2hDrF2WiHaSmCBrS7gColkQft95/8tphyzv2EupVxn3iE0FI78wzffoULH1G+dkw==", + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.53.3.tgz", + "integrity": "sha512-GOFuKpsxR/whszbF/bzydebLiXIHSgsEUp6M0JI8dWvi+fFa1TD6YQa4aSZHtpmh2/uAlj/Dy+nmby3TJ3pkTw==", "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "win32" ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.44.2.tgz", - "integrity": "sha512-+qMUrkbUurpE6DVRjiJCNGZBGo9xM4Y0FXU5cjgudWqIBWbcLkjE3XprJUsOFgC6xjBClwVa9k6O3A7K3vxb5Q==", + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.53.3.tgz", + "integrity": "sha512-iah+THLcBJdpfZ1TstDFbKNznlzoxa8fmnFYK4V67HvmuNYkVdAywJSoteUszvBQ9/HqN2+9AZghbajMsFT+oA==", "cpu": [ "ia32" ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.53.3.tgz", + "integrity": "sha512-J9QDiOIZlZLdcot5NXEepDkstocktoVjkaKUtqzgzpt2yWjGlbYiKyp05rWwk4nypbYUNoFAztEgixoLaSETkg==", + "cpu": [ + "x64" + ], + "license": "MIT", "optional": true, "os": [ "win32" ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.44.2.tgz", - "integrity": "sha512-3+QZROYfJ25PDcxFF66UEk8jGWigHJeecZILvkPkyQN7oc5BvFo4YEXFkOs154j3FTMp9mn9Ky8RCOwastduEA==", + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.53.3.tgz", + "integrity": "sha512-UhTd8u31dXadv0MopwGgNOBpUVROFKWVQgAg5N1ESyCz8AuBcMqm4AuTjrwgQKGDfoFuz02EuMRHQIw/frmYKQ==", "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "win32" @@ -3411,92 +3978,121 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@scarf/scarf": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/@scarf/scarf/-/scarf-1.4.0.tgz", "integrity": "sha512-xxeapPiUXdZAE3che6f3xogoJPeZgig6omHEy1rIY5WVsB3H2BHNnZH+gHG6x91SCWyQCzWGsuL2Hh3ClO5/qQ==", - "hasInstallScript": true + "hasInstallScript": true, + "license": "Apache-2.0" }, "node_modules/@sentry/core": { - "version": "8.55.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-8.55.0.tgz", - "integrity": "sha512-6g7jpbefjHYs821Z+EBJ8r4Z7LT5h80YSWRJaylGS4nW5W5Z2KXzpdnyFarv37O7QjauzVC2E+PABmpkw5/JGA==", + "version": "10.26.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-10.26.0.tgz", + "integrity": "sha512-TjDe5QI37SLuV0q3nMOH8JcPZhv2e85FALaQMIhRILH9Ce6G7xW5GSjmH91NUVq8yc3XtiqYlz/EenEZActc4Q==", + "license": "MIT", "engines": { - "node": ">=14.18" + "node": ">=18" } }, "node_modules/@sentry/node": { - "version": "8.55.0", - "resolved": "https://registry.npmjs.org/@sentry/node/-/node-8.55.0.tgz", - "integrity": "sha512-h10LJLDTRAzYgay60Oy7moMookqqSZSviCWkkmHZyaDn+4WURnPp5SKhhfrzPRQcXKrweiOwDSHBgn1tweDssg==", + "version": "10.26.0", + "resolved": "https://registry.npmjs.org/@sentry/node/-/node-10.26.0.tgz", + "integrity": "sha512-VUwNoKYhRpnHQSj9lty1TgooO+1wcpS1V0K87HU8sZEas5gx3Ujiouk5ocPjlgbKreoYOApgOnEEIq5W/hfQcQ==", + "license": "MIT", "dependencies": { "@opentelemetry/api": "^1.9.0", - "@opentelemetry/context-async-hooks": "^1.30.1", - "@opentelemetry/core": "^1.30.1", - "@opentelemetry/instrumentation": "^0.57.1", - "@opentelemetry/instrumentation-amqplib": "^0.46.0", - "@opentelemetry/instrumentation-connect": "0.43.0", - "@opentelemetry/instrumentation-dataloader": "0.16.0", - "@opentelemetry/instrumentation-express": "0.47.0", - "@opentelemetry/instrumentation-fastify": "0.44.1", - "@opentelemetry/instrumentation-fs": "0.19.0", - "@opentelemetry/instrumentation-generic-pool": "0.43.0", - "@opentelemetry/instrumentation-graphql": "0.47.0", - "@opentelemetry/instrumentation-hapi": "0.45.1", - "@opentelemetry/instrumentation-http": "0.57.1", - "@opentelemetry/instrumentation-ioredis": "0.47.0", - "@opentelemetry/instrumentation-kafkajs": "0.7.0", - "@opentelemetry/instrumentation-knex": "0.44.0", - "@opentelemetry/instrumentation-koa": "0.47.0", - "@opentelemetry/instrumentation-lru-memoizer": "0.44.0", - "@opentelemetry/instrumentation-mongodb": "0.51.0", - "@opentelemetry/instrumentation-mongoose": "0.46.0", - "@opentelemetry/instrumentation-mysql": "0.45.0", - "@opentelemetry/instrumentation-mysql2": "0.45.0", - "@opentelemetry/instrumentation-nestjs-core": "0.44.0", - "@opentelemetry/instrumentation-pg": "0.50.0", - "@opentelemetry/instrumentation-redis-4": "0.46.0", - "@opentelemetry/instrumentation-tedious": "0.18.0", - "@opentelemetry/instrumentation-undici": "0.10.0", - "@opentelemetry/resources": "^1.30.1", - "@opentelemetry/sdk-trace-base": "^1.30.1", - "@opentelemetry/semantic-conventions": "^1.28.0", - "@prisma/instrumentation": "5.22.0", - "@sentry/core": "8.55.0", - "@sentry/opentelemetry": "8.55.0", - "import-in-the-middle": "^1.11.2" - }, - "engines": { - "node": ">=14.18" + "@opentelemetry/context-async-hooks": "^2.1.0", + "@opentelemetry/core": "^2.1.0", + "@opentelemetry/instrumentation": "^0.204.0", + "@opentelemetry/instrumentation-amqplib": "0.51.0", + "@opentelemetry/instrumentation-connect": "0.48.0", + "@opentelemetry/instrumentation-dataloader": "0.22.0", + "@opentelemetry/instrumentation-express": "0.53.0", + "@opentelemetry/instrumentation-fs": "0.24.0", + "@opentelemetry/instrumentation-generic-pool": "0.48.0", + "@opentelemetry/instrumentation-graphql": "0.52.0", + "@opentelemetry/instrumentation-hapi": "0.51.0", + "@opentelemetry/instrumentation-http": "0.204.0", + "@opentelemetry/instrumentation-ioredis": "0.52.0", + "@opentelemetry/instrumentation-kafkajs": "0.14.0", + "@opentelemetry/instrumentation-knex": "0.49.0", + "@opentelemetry/instrumentation-koa": "0.52.0", + "@opentelemetry/instrumentation-lru-memoizer": "0.49.0", + "@opentelemetry/instrumentation-mongodb": "0.57.0", + "@opentelemetry/instrumentation-mongoose": "0.51.0", + "@opentelemetry/instrumentation-mysql": "0.50.0", + "@opentelemetry/instrumentation-mysql2": "0.51.0", + "@opentelemetry/instrumentation-pg": "0.57.0", + "@opentelemetry/instrumentation-redis": "0.53.0", + "@opentelemetry/instrumentation-tedious": "0.23.0", + "@opentelemetry/instrumentation-undici": "0.15.0", + "@opentelemetry/resources": "^2.1.0", + "@opentelemetry/sdk-trace-base": "^2.1.0", + "@opentelemetry/semantic-conventions": "^1.37.0", + "@prisma/instrumentation": "6.15.0", + "@sentry/core": "10.26.0", + "@sentry/node-core": "10.26.0", + "@sentry/opentelemetry": "10.26.0", + "import-in-the-middle": "^1.14.2", + "minimatch": "^9.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@sentry/node-core": { + "version": "10.26.0", + "resolved": "https://registry.npmjs.org/@sentry/node-core/-/node-core-10.26.0.tgz", + "integrity": "sha512-7OrHVn8XAsq9mMVMlpL18XTKQEVcLOJSo0n2M7QGKfFk/OfVtSFMcUWGqN1qhYtT9aMTr2bjtR5+BI33djnNTQ==", + "license": "MIT", + "dependencies": { + "@apm-js-collab/tracing-hooks": "^0.3.1", + "@sentry/core": "10.26.0", + "@sentry/opentelemetry": "10.26.0", + "import-in-the-middle": "^1.14.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.9.0", + "@opentelemetry/context-async-hooks": "^1.30.1 || ^2.1.0", + "@opentelemetry/core": "^1.30.1 || ^2.1.0", + "@opentelemetry/instrumentation": ">=0.57.1 <1", + "@opentelemetry/resources": "^1.30.1 || ^2.1.0", + "@opentelemetry/sdk-trace-base": "^1.30.1 || ^2.1.0", + "@opentelemetry/semantic-conventions": "^1.37.0" } }, "node_modules/@sentry/opentelemetry": { - "version": "8.55.0", - "resolved": "https://registry.npmjs.org/@sentry/opentelemetry/-/opentelemetry-8.55.0.tgz", - "integrity": "sha512-UvatdmSr3Xf+4PLBzJNLZ2JjG1yAPWGe/VrJlJAqyTJ2gKeTzgXJJw8rp4pbvNZO8NaTGEYhhO+scLUj0UtLAQ==", + "version": "10.26.0", + "resolved": "https://registry.npmjs.org/@sentry/opentelemetry/-/opentelemetry-10.26.0.tgz", + "integrity": "sha512-ASJdOwn6NwMH2ZeBrnGJI+l/xkJp1AOiQ5FWkvTqLc/vHX+r3PDMO7c+koecY+LiZxSzZF4IV8sALXfOh6UnwA==", + "license": "MIT", "dependencies": { - "@sentry/core": "8.55.0" + "@sentry/core": "10.26.0" }, "engines": { - "node": ">=14.18" + "node": ">=18" }, "peerDependencies": { "@opentelemetry/api": "^1.9.0", - "@opentelemetry/context-async-hooks": "^1.30.1", - "@opentelemetry/core": "^1.30.1", - "@opentelemetry/instrumentation": "^0.57.1", - "@opentelemetry/sdk-trace-base": "^1.30.1", - "@opentelemetry/semantic-conventions": "^1.28.0" + "@opentelemetry/context-async-hooks": "^1.30.1 || ^2.1.0", + "@opentelemetry/core": "^1.30.1 || ^2.1.0", + "@opentelemetry/sdk-trace-base": "^1.30.1 || ^2.1.0", + "@opentelemetry/semantic-conventions": "^1.37.0" } }, "node_modules/@smithy/abort-controller": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-4.0.4.tgz", - "integrity": "sha512-gJnEjZMvigPDQWHrW3oPrFhQtkrgqBkyjj3pCIdF3A5M6vsZODG93KNlfJprv6bp4245bdT32fsHK4kkH3KYDA==", + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-4.2.5.tgz", + "integrity": "sha512-j7HwVkBw68YW8UmFRcjZOmssE77Rvk0GWAIN1oFBhsaovQmZWYCIcGa9/pwRB0ExI8Sk9MWNALTjftjHZea7VA==", + "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.3.1", + "@smithy/types": "^4.9.0", "tslib": "^2.6.2" }, "engines": { @@ -3504,14 +4100,16 @@ } }, "node_modules/@smithy/config-resolver": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-4.1.4.tgz", - "integrity": "sha512-prmU+rDddxHOH0oNcwemL+SwnzcG65sBF2yXRO7aeXIn/xTlq2pX7JLVbkBnVLowHLg4/OL4+jBmv9hVrVGS+w==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-4.4.3.tgz", + "integrity": "sha512-ezHLe1tKLUxDJo2LHtDuEDyWXolw8WGOR92qb4bQdWq/zKenO5BvctZGrVJBK08zjezSk7bmbKFOXIVyChvDLw==", + "license": "Apache-2.0", "dependencies": { - "@smithy/node-config-provider": "^4.1.3", - "@smithy/types": "^4.3.1", - "@smithy/util-config-provider": "^4.0.0", - "@smithy/util-middleware": "^4.0.4", + "@smithy/node-config-provider": "^4.3.5", + "@smithy/types": "^4.9.0", + "@smithy/util-config-provider": "^4.2.0", + "@smithy/util-endpoints": "^3.2.5", + "@smithy/util-middleware": "^4.2.5", "tslib": "^2.6.2" }, "engines": { @@ -3519,18 +4117,20 @@ } }, "node_modules/@smithy/core": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@smithy/core/-/core-3.7.0.tgz", - "integrity": "sha512-7ov8hu/4j0uPZv8b27oeOFtIBtlFmM3ibrPv/Omx1uUdoXvcpJ00U+H/OWWC/keAguLlcqwtyL2/jTlSnApgNQ==", - "dependencies": { - "@smithy/middleware-serde": "^4.0.8", - "@smithy/protocol-http": "^5.1.2", - "@smithy/types": "^4.3.1", - "@smithy/util-base64": "^4.0.0", - "@smithy/util-body-length-browser": "^4.0.0", - "@smithy/util-middleware": "^4.0.4", - "@smithy/util-stream": "^4.2.3", - "@smithy/util-utf8": "^4.0.0", + "version": "3.18.5", + "resolved": "https://registry.npmjs.org/@smithy/core/-/core-3.18.5.tgz", + "integrity": "sha512-6gnIz3h+PEPQGDj8MnRSjDvKBah042jEoPgjFGJ4iJLBE78L4lY/n98x14XyPF4u3lN179Ub/ZKFY5za9GeLQw==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/middleware-serde": "^4.2.6", + "@smithy/protocol-http": "^5.3.5", + "@smithy/types": "^4.9.0", + "@smithy/util-base64": "^4.3.0", + "@smithy/util-body-length-browser": "^4.2.0", + "@smithy/util-middleware": "^4.2.5", + "@smithy/util-stream": "^4.5.6", + "@smithy/util-utf8": "^4.2.0", + "@smithy/uuid": "^1.1.0", "tslib": "^2.6.2" }, "engines": { @@ -3538,14 +4138,15 @@ } }, "node_modules/@smithy/credential-provider-imds": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-4.0.6.tgz", - "integrity": "sha512-hKMWcANhUiNbCJouYkZ9V3+/Qf9pteR1dnwgdyzR09R4ODEYx8BbUysHwRSyex4rZ9zapddZhLFTnT4ZijR4pw==", + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-4.2.5.tgz", + "integrity": "sha512-BZwotjoZWn9+36nimwm/OLIcVe+KYRwzMjfhd4QT7QxPm9WY0HiOV8t/Wlh+HVUif0SBVV7ksq8//hPaBC/okQ==", + "license": "Apache-2.0", "dependencies": { - "@smithy/node-config-provider": "^4.1.3", - "@smithy/property-provider": "^4.0.4", - "@smithy/types": "^4.3.1", - "@smithy/url-parser": "^4.0.4", + "@smithy/node-config-provider": "^4.3.5", + "@smithy/property-provider": "^4.2.5", + "@smithy/types": "^4.9.0", + "@smithy/url-parser": "^4.2.5", "tslib": "^2.6.2" }, "engines": { @@ -3553,14 +4154,15 @@ } }, "node_modules/@smithy/fetch-http-handler": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-5.1.0.tgz", - "integrity": "sha512-mADw7MS0bYe2OGKkHYMaqarOXuDwRbO6ArD91XhHcl2ynjGCFF+hvqf0LyQcYxkA1zaWjefSkU7Ne9mqgApSgQ==", + "version": "5.3.6", + "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-5.3.6.tgz", + "integrity": "sha512-3+RG3EA6BBJ/ofZUeTFJA7mHfSYrZtQIrDP9dI8Lf7X6Jbos2jptuLrAAteDiFVrmbEmLSuRG/bUKzfAXk7dhg==", + "license": "Apache-2.0", "dependencies": { - "@smithy/protocol-http": "^5.1.2", - "@smithy/querystring-builder": "^4.0.4", - "@smithy/types": "^4.3.1", - "@smithy/util-base64": "^4.0.0", + "@smithy/protocol-http": "^5.3.5", + "@smithy/querystring-builder": "^4.2.5", + "@smithy/types": "^4.9.0", + "@smithy/util-base64": "^4.3.0", "tslib": "^2.6.2" }, "engines": { @@ -3568,13 +4170,14 @@ } }, "node_modules/@smithy/hash-node": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-4.0.4.tgz", - "integrity": "sha512-qnbTPUhCVnCgBp4z4BUJUhOEkVwxiEi1cyFM+Zj6o+aY8OFGxUQleKWq8ltgp3dujuhXojIvJWdoqpm6dVO3lQ==", + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-4.2.5.tgz", + "integrity": "sha512-DpYX914YOfA3UDT9CN1BM787PcHfWRBB43fFGCYrZFUH0Jv+5t8yYl+Pd5PW4+QzoGEDvn5d5QIO4j2HyYZQSA==", + "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.3.1", - "@smithy/util-buffer-from": "^4.0.0", - "@smithy/util-utf8": "^4.0.0", + "@smithy/types": "^4.9.0", + "@smithy/util-buffer-from": "^4.2.0", + "@smithy/util-utf8": "^4.2.0", "tslib": "^2.6.2" }, "engines": { @@ -3582,11 +4185,12 @@ } }, "node_modules/@smithy/invalid-dependency": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-4.0.4.tgz", - "integrity": "sha512-bNYMi7WKTJHu0gn26wg8OscncTt1t2b8KcsZxvOv56XA6cyXtOAAAaNP7+m45xfppXfOatXF3Sb1MNsLUgVLTw==", + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-4.2.5.tgz", + "integrity": "sha512-2L2erASEro1WC5nV+plwIMxrTXpvpfzl4e+Nre6vBVRR2HKeGGcvpJyyL3/PpiSg+cJG2KpTmZmq934Olb6e5A==", + "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.3.1", + "@smithy/types": "^4.9.0", "tslib": "^2.6.2" }, "engines": { @@ -3594,9 +4198,10 @@ } }, "node_modules/@smithy/is-array-buffer": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-4.0.0.tgz", - "integrity": "sha512-saYhF8ZZNoJDTvJBEWgeBccCg+yvp1CX+ed12yORU3NilJScfc6gfch2oVb4QgxZrGUx3/ZJlb+c/dJbyupxlw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-4.2.0.tgz", + "integrity": "sha512-DZZZBvC7sjcYh4MazJSGiWMI2L7E0oCiRHREDzIxi/M2LY79/21iXt6aPLHge82wi5LsuRF5A06Ds3+0mlh6CQ==", + "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" }, @@ -3605,12 +4210,13 @@ } }, "node_modules/@smithy/md5-js": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@smithy/md5-js/-/md5-js-4.0.4.tgz", - "integrity": "sha512-uGLBVqcOwrLvGh/v/jw423yWHq/ofUGK1W31M2TNspLQbUV1Va0F5kTxtirkoHawODAZcjXTSGi7JwbnPcDPJg==", + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@smithy/md5-js/-/md5-js-4.2.5.tgz", + "integrity": "sha512-Bt6jpSTMWfjCtC0s79gZ/WZ1w90grfmopVOWqkI2ovhjpD5Q2XRXuecIPB9689L2+cCySMbaXDhBPU56FKNDNg==", + "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.3.1", - "@smithy/util-utf8": "^4.0.0", + "@smithy/types": "^4.9.0", + "@smithy/util-utf8": "^4.2.0", "tslib": "^2.6.2" }, "engines": { @@ -3618,12 +4224,13 @@ } }, "node_modules/@smithy/middleware-content-length": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-4.0.4.tgz", - "integrity": "sha512-F7gDyfI2BB1Kc+4M6rpuOLne5LOcEknH1n6UQB69qv+HucXBR1rkzXBnQTB2q46sFy1PM/zuSJOB532yc8bg3w==", + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-4.2.5.tgz", + "integrity": "sha512-Y/RabVa5vbl5FuHYV2vUCwvh/dqzrEY/K2yWPSqvhFUwIY0atLqO4TienjBXakoy4zrKAMCZwg+YEqmH7jaN7A==", + "license": "Apache-2.0", "dependencies": { - "@smithy/protocol-http": "^5.1.2", - "@smithy/types": "^4.3.1", + "@smithy/protocol-http": "^5.3.5", + "@smithy/types": "^4.9.0", "tslib": "^2.6.2" }, "engines": { @@ -3631,17 +4238,18 @@ } }, "node_modules/@smithy/middleware-endpoint": { - "version": "4.1.14", - "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-4.1.14.tgz", - "integrity": "sha512-+BGLpK5D93gCcSEceaaYhUD/+OCGXM1IDaq/jKUQ+ujB0PTWlWN85noodKw/IPFZhIKFCNEe19PGd/reUMeLSQ==", - "dependencies": { - "@smithy/core": "^3.7.0", - "@smithy/middleware-serde": "^4.0.8", - "@smithy/node-config-provider": "^4.1.3", - "@smithy/shared-ini-file-loader": "^4.0.4", - "@smithy/types": "^4.3.1", - "@smithy/url-parser": "^4.0.4", - "@smithy/util-middleware": "^4.0.4", + "version": "4.3.12", + "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-4.3.12.tgz", + "integrity": "sha512-9pAX/H+VQPzNbouhDhkW723igBMLgrI8OtX+++M7iKJgg/zY/Ig3i1e6seCcx22FWhE6Q/S61BRdi2wXBORT+A==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/core": "^3.18.5", + "@smithy/middleware-serde": "^4.2.6", + "@smithy/node-config-provider": "^4.3.5", + "@smithy/shared-ini-file-loader": "^4.4.0", + "@smithy/types": "^4.9.0", + "@smithy/url-parser": "^4.2.5", + "@smithy/util-middleware": "^4.2.5", "tslib": "^2.6.2" }, "engines": { @@ -3649,31 +4257,33 @@ } }, "node_modules/@smithy/middleware-retry": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-4.1.15.tgz", - "integrity": "sha512-iKYUJpiyTQ33U2KlOZeUb0GwtzWR3C0soYcKuCnTmJrvt6XwTPQZhMfsjJZNw7PpQ3TU4Ati1qLSrkSJxnnSMQ==", + "version": "4.4.12", + "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-4.4.12.tgz", + "integrity": "sha512-S4kWNKFowYd0lID7/DBqWHOQxmxlsf0jBaos9chQZUWTVOjSW1Ogyh8/ib5tM+agFDJ/TCxuCTvrnlc+9cIBcQ==", + "license": "Apache-2.0", "dependencies": { - "@smithy/node-config-provider": "^4.1.3", - "@smithy/protocol-http": "^5.1.2", - "@smithy/service-error-classification": "^4.0.6", - "@smithy/smithy-client": "^4.4.6", - "@smithy/types": "^4.3.1", - "@smithy/util-middleware": "^4.0.4", - "@smithy/util-retry": "^4.0.6", - "tslib": "^2.6.2", - "uuid": "^9.0.1" + "@smithy/node-config-provider": "^4.3.5", + "@smithy/protocol-http": "^5.3.5", + "@smithy/service-error-classification": "^4.2.5", + "@smithy/smithy-client": "^4.9.8", + "@smithy/types": "^4.9.0", + "@smithy/util-middleware": "^4.2.5", + "@smithy/util-retry": "^4.2.5", + "@smithy/uuid": "^1.1.0", + "tslib": "^2.6.2" }, "engines": { "node": ">=18.0.0" } }, "node_modules/@smithy/middleware-serde": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-4.0.8.tgz", - "integrity": "sha512-iSSl7HJoJaGyMIoNn2B7czghOVwJ9nD7TMvLhMWeSB5vt0TnEYyRRqPJu/TqW76WScaNvYYB8nRoiBHR9S1Ddw==", + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-4.2.6.tgz", + "integrity": "sha512-VkLoE/z7e2g8pirwisLz8XJWedUSY8my/qrp81VmAdyrhi94T+riBfwP+AOEEFR9rFTSonC/5D2eWNmFabHyGQ==", + "license": "Apache-2.0", "dependencies": { - "@smithy/protocol-http": "^5.1.2", - "@smithy/types": "^4.3.1", + "@smithy/protocol-http": "^5.3.5", + "@smithy/types": "^4.9.0", "tslib": "^2.6.2" }, "engines": { @@ -3681,11 +4291,12 @@ } }, "node_modules/@smithy/middleware-stack": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-4.0.4.tgz", - "integrity": "sha512-kagK5ggDrBUCCzI93ft6DjteNSfY8Ulr83UtySog/h09lTIOAJ/xUSObutanlPT0nhoHAkpmW9V5K8oPyLh+QA==", + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-4.2.5.tgz", + "integrity": "sha512-bYrutc+neOyWxtZdbB2USbQttZN0mXaOyYLIsaTbJhFsfpXyGWUxJpEuO1rJ8IIJm2qH4+xJT0mxUSsEDTYwdQ==", + "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.3.1", + "@smithy/types": "^4.9.0", "tslib": "^2.6.2" }, "engines": { @@ -3693,13 +4304,14 @@ } }, "node_modules/@smithy/node-config-provider": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-4.1.3.tgz", - "integrity": "sha512-HGHQr2s59qaU1lrVH6MbLlmOBxadtzTsoO4c+bF5asdgVik3I8o7JIOzoeqWc5MjVa+vD36/LWE0iXKpNqooRw==", + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-4.3.5.tgz", + "integrity": "sha512-UTurh1C4qkVCtqggI36DGbLB2Kv8UlcFdMXDcWMbqVY2uRg0XmT9Pb4Vj6oSQ34eizO1fvR0RnFV4Axw4IrrAg==", + "license": "Apache-2.0", "dependencies": { - "@smithy/property-provider": "^4.0.4", - "@smithy/shared-ini-file-loader": "^4.0.4", - "@smithy/types": "^4.3.1", + "@smithy/property-provider": "^4.2.5", + "@smithy/shared-ini-file-loader": "^4.4.0", + "@smithy/types": "^4.9.0", "tslib": "^2.6.2" }, "engines": { @@ -3707,14 +4319,15 @@ } }, "node_modules/@smithy/node-http-handler": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-4.1.0.tgz", - "integrity": "sha512-vqfSiHz2v8b3TTTrdXi03vNz1KLYYS3bhHCDv36FYDqxT7jvTll1mMnCrkD+gOvgwybuunh/2VmvOMqwBegxEg==", + "version": "4.4.5", + "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-4.4.5.tgz", + "integrity": "sha512-CMnzM9R2WqlqXQGtIlsHMEZfXKJVTIrqCNoSd/QpAyp+Dw0a1Vps13l6ma1fH8g7zSPNsA59B/kWgeylFuA/lw==", + "license": "Apache-2.0", "dependencies": { - "@smithy/abort-controller": "^4.0.4", - "@smithy/protocol-http": "^5.1.2", - "@smithy/querystring-builder": "^4.0.4", - "@smithy/types": "^4.3.1", + "@smithy/abort-controller": "^4.2.5", + "@smithy/protocol-http": "^5.3.5", + "@smithy/querystring-builder": "^4.2.5", + "@smithy/types": "^4.9.0", "tslib": "^2.6.2" }, "engines": { @@ -3722,11 +4335,12 @@ } }, "node_modules/@smithy/property-provider": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-4.0.4.tgz", - "integrity": "sha512-qHJ2sSgu4FqF4U/5UUp4DhXNmdTrgmoAai6oQiM+c5RZ/sbDwJ12qxB1M6FnP+Tn/ggkPZf9ccn4jqKSINaquw==", + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-4.2.5.tgz", + "integrity": "sha512-8iLN1XSE1rl4MuxvQ+5OSk/Zb5El7NJZ1td6Tn+8dQQHIjp59Lwl6bd0+nzw6SKm2wSSriH2v/I9LPzUic7EOg==", + "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.3.1", + "@smithy/types": "^4.9.0", "tslib": "^2.6.2" }, "engines": { @@ -3734,11 +4348,12 @@ } }, "node_modules/@smithy/protocol-http": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-5.1.2.tgz", - "integrity": "sha512-rOG5cNLBXovxIrICSBm95dLqzfvxjEmuZx4KK3hWwPFHGdW3lxY0fZNXfv2zebfRO7sJZ5pKJYHScsqopeIWtQ==", + "version": "5.3.5", + "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-5.3.5.tgz", + "integrity": "sha512-RlaL+sA0LNMp03bf7XPbFmT5gN+w3besXSWMkA8rcmxLSVfiEXElQi4O2IWwPfxzcHkxqrwBFMbngB8yx/RvaQ==", + "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.3.1", + "@smithy/types": "^4.9.0", "tslib": "^2.6.2" }, "engines": { @@ -3746,12 +4361,13 @@ } }, "node_modules/@smithy/querystring-builder": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-4.0.4.tgz", - "integrity": "sha512-SwREZcDnEYoh9tLNgMbpop+UTGq44Hl9tdj3rf+yeLcfH7+J8OXEBaMc2kDxtyRHu8BhSg9ADEx0gFHvpJgU8w==", + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-4.2.5.tgz", + "integrity": "sha512-y98otMI1saoajeik2kLfGyRp11e5U/iJYH/wLCh3aTV/XutbGT9nziKGkgCaMD1ghK7p6htHMm6b6scl9JRUWg==", + "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.3.1", - "@smithy/util-uri-escape": "^4.0.0", + "@smithy/types": "^4.9.0", + "@smithy/util-uri-escape": "^4.2.0", "tslib": "^2.6.2" }, "engines": { @@ -3759,11 +4375,12 @@ } }, "node_modules/@smithy/querystring-parser": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-4.0.4.tgz", - "integrity": "sha512-6yZf53i/qB8gRHH/l2ZwUG5xgkPgQF15/KxH0DdXMDHjesA9MeZje/853ifkSY0x4m5S+dfDZ+c4x439PF0M2w==", + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-4.2.5.tgz", + "integrity": "sha512-031WCTdPYgiQRYNPXznHXof2YM0GwL6SeaSyTH/P72M1Vz73TvCNH2Nq8Iu2IEPq9QP2yx0/nrw5YmSeAi/AjQ==", + "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.3.1", + "@smithy/types": "^4.9.0", "tslib": "^2.6.2" }, "engines": { @@ -3771,22 +4388,24 @@ } }, "node_modules/@smithy/service-error-classification": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-4.0.6.tgz", - "integrity": "sha512-RRoTDL//7xi4tn5FrN2NzH17jbgmnKidUqd4KvquT0954/i6CXXkh1884jBiunq24g9cGtPBEXlU40W6EpNOOg==", + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-4.2.5.tgz", + "integrity": "sha512-8fEvK+WPE3wUAcDvqDQG1Vk3ANLR8Px979te96m84CbKAjBVf25rPYSzb4xU4hlTyho7VhOGnh5i62D/JVF0JQ==", + "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.3.1" + "@smithy/types": "^4.9.0" }, "engines": { "node": ">=18.0.0" } }, "node_modules/@smithy/shared-ini-file-loader": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-4.0.4.tgz", - "integrity": "sha512-63X0260LoFBjrHifPDs+nM9tV0VMkOTl4JRMYNuKh/f5PauSjowTfvF3LogfkWdcPoxsA9UjqEOgjeYIbhb7Nw==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-4.4.0.tgz", + "integrity": "sha512-5WmZ5+kJgJDjwXXIzr1vDTG+RhF9wzSODQBfkrQ2VVkYALKGvZX1lgVSxEkgicSAFnFhPj5rudJV0zoinqS0bA==", + "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.3.1", + "@smithy/types": "^4.9.0", "tslib": "^2.6.2" }, "engines": { @@ -3794,17 +4413,18 @@ } }, "node_modules/@smithy/signature-v4": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-5.1.2.tgz", - "integrity": "sha512-d3+U/VpX7a60seHziWnVZOHuEgJlclufjkS6zhXvxcJgkJq4UWdH5eOBLzHRMx6gXjsdT9h6lfpmLzbrdupHgQ==", - "dependencies": { - "@smithy/is-array-buffer": "^4.0.0", - "@smithy/protocol-http": "^5.1.2", - "@smithy/types": "^4.3.1", - "@smithy/util-hex-encoding": "^4.0.0", - "@smithy/util-middleware": "^4.0.4", - "@smithy/util-uri-escape": "^4.0.0", - "@smithy/util-utf8": "^4.0.0", + "version": "5.3.5", + "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-5.3.5.tgz", + "integrity": "sha512-xSUfMu1FT7ccfSXkoLl/QRQBi2rOvi3tiBZU2Tdy3I6cgvZ6SEi9QNey+lqps/sJRnogIS+lq+B1gxxbra2a/w==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/is-array-buffer": "^4.2.0", + "@smithy/protocol-http": "^5.3.5", + "@smithy/types": "^4.9.0", + "@smithy/util-hex-encoding": "^4.2.0", + "@smithy/util-middleware": "^4.2.5", + "@smithy/util-uri-escape": "^4.2.0", + "@smithy/util-utf8": "^4.2.0", "tslib": "^2.6.2" }, "engines": { @@ -3812,16 +4432,17 @@ } }, "node_modules/@smithy/smithy-client": { - "version": "4.4.6", - "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-4.4.6.tgz", - "integrity": "sha512-3wfhywdzB/CFszP6moa5L3lf5/zSfQoH0kvVSdkyK2az5qZet0sn2PAHjcTDiq296Y4RP5yxF7B6S6+3oeBUCQ==", - "dependencies": { - "@smithy/core": "^3.7.0", - "@smithy/middleware-endpoint": "^4.1.14", - "@smithy/middleware-stack": "^4.0.4", - "@smithy/protocol-http": "^5.1.2", - "@smithy/types": "^4.3.1", - "@smithy/util-stream": "^4.2.3", + "version": "4.9.8", + "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-4.9.8.tgz", + "integrity": "sha512-8xgq3LgKDEFoIrLWBho/oYKyWByw9/corz7vuh1upv7ZBm0ZMjGYBhbn6v643WoIqA9UTcx5A5htEp/YatUwMA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/core": "^3.18.5", + "@smithy/middleware-endpoint": "^4.3.12", + "@smithy/middleware-stack": "^4.2.5", + "@smithy/protocol-http": "^5.3.5", + "@smithy/types": "^4.9.0", + "@smithy/util-stream": "^4.5.6", "tslib": "^2.6.2" }, "engines": { @@ -3829,9 +4450,10 @@ } }, "node_modules/@smithy/types": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/@smithy/types/-/types-4.3.1.tgz", - "integrity": "sha512-UqKOQBL2x6+HWl3P+3QqFD4ncKq0I8Nuz9QItGv5WuKuMHuuwlhvqcZCoXGfc+P1QmfJE7VieykoYYmrOoFJxA==", + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/@smithy/types/-/types-4.9.0.tgz", + "integrity": "sha512-MvUbdnXDTwykR8cB1WZvNNwqoWVaTRA0RLlLmf/cIFNMM2cKWz01X4Ly6SMC4Kks30r8tT3Cty0jmeWfiuyHTA==", + "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" }, @@ -3840,12 +4462,13 @@ } }, "node_modules/@smithy/url-parser": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-4.0.4.tgz", - "integrity": "sha512-eMkc144MuN7B0TDA4U2fKs+BqczVbk3W+qIvcoCY6D1JY3hnAdCuhCZODC+GAeaxj0p6Jroz4+XMUn3PCxQQeQ==", + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-4.2.5.tgz", + "integrity": "sha512-VaxMGsilqFnK1CeBX+LXnSuaMx4sTL/6znSZh2829txWieazdVxr54HmiyTsIbpOTLcf5nYpq9lpzmwRdxj6rQ==", + "license": "Apache-2.0", "dependencies": { - "@smithy/querystring-parser": "^4.0.4", - "@smithy/types": "^4.3.1", + "@smithy/querystring-parser": "^4.2.5", + "@smithy/types": "^4.9.0", "tslib": "^2.6.2" }, "engines": { @@ -3853,12 +4476,13 @@ } }, "node_modules/@smithy/util-base64": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-4.0.0.tgz", - "integrity": "sha512-CvHfCmO2mchox9kjrtzoHkWHxjHZzaFojLc8quxXY7WAAMAg43nuxwv95tATVgQFNDwd4M9S1qFzj40Ul41Kmg==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-4.3.0.tgz", + "integrity": "sha512-GkXZ59JfyxsIwNTWFnjmFEI8kZpRNIBfxKjv09+nkAWPt/4aGaEWMM04m4sxgNVWkbt2MdSvE3KF/PfX4nFedQ==", + "license": "Apache-2.0", "dependencies": { - "@smithy/util-buffer-from": "^4.0.0", - "@smithy/util-utf8": "^4.0.0", + "@smithy/util-buffer-from": "^4.2.0", + "@smithy/util-utf8": "^4.2.0", "tslib": "^2.6.2" }, "engines": { @@ -3866,9 +4490,10 @@ } }, "node_modules/@smithy/util-body-length-browser": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-body-length-browser/-/util-body-length-browser-4.0.0.tgz", - "integrity": "sha512-sNi3DL0/k64/LO3A256M+m3CDdG6V7WKWHdAiBBMUN8S3hK3aMPhwnPik2A/a2ONN+9doY9UxaLfgqsIRg69QA==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-browser/-/util-body-length-browser-4.2.0.tgz", + "integrity": "sha512-Fkoh/I76szMKJnBXWPdFkQJl2r9SjPt3cMzLdOB6eJ4Pnpas8hVoWPYemX/peO0yrrvldgCUVJqOAjUrOLjbxg==", + "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" }, @@ -3877,9 +4502,10 @@ } }, "node_modules/@smithy/util-body-length-node": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-body-length-node/-/util-body-length-node-4.0.0.tgz", - "integrity": "sha512-q0iDP3VsZzqJyje8xJWEJCNIu3lktUGVoSy1KB0UWym2CL1siV3artm+u1DFYTLejpsrdGyCSWBdGNjJzfDPjg==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-node/-/util-body-length-node-4.2.1.tgz", + "integrity": "sha512-h53dz/pISVrVrfxV1iqXlx5pRg3V2YWFcSQyPyXZRrZoZj4R4DeWRDo1a7dd3CPTcFi3kE+98tuNyD2axyZReA==", + "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" }, @@ -3888,11 +4514,12 @@ } }, "node_modules/@smithy/util-buffer-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-4.0.0.tgz", - "integrity": "sha512-9TOQ7781sZvddgO8nxueKi3+yGvkY35kotA0Y6BWRajAv8jjmigQ1sBwz0UX47pQMYXJPahSKEKYFgt+rXdcug==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-4.2.0.tgz", + "integrity": "sha512-kAY9hTKulTNevM2nlRtxAG2FQ3B2OR6QIrPY3zE5LqJy1oxzmgBGsHLWTcNhWXKchgA0WHW+mZkQrng/pgcCew==", + "license": "Apache-2.0", "dependencies": { - "@smithy/is-array-buffer": "^4.0.0", + "@smithy/is-array-buffer": "^4.2.0", "tslib": "^2.6.2" }, "engines": { @@ -3900,9 +4527,10 @@ } }, "node_modules/@smithy/util-config-provider": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-config-provider/-/util-config-provider-4.0.0.tgz", - "integrity": "sha512-L1RBVzLyfE8OXH+1hsJ8p+acNUSirQnWQ6/EgpchV88G6zGBTDPdXiiExei6Z1wR2RxYvxY/XLw6AMNCCt8H3w==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-config-provider/-/util-config-provider-4.2.0.tgz", + "integrity": "sha512-YEjpl6XJ36FTKmD+kRJJWYvrHeUvm5ykaUS5xK+6oXffQPHeEM4/nXlZPe+Wu0lsgRUcNZiliYNh/y7q9c2y6Q==", + "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" }, @@ -3911,14 +4539,14 @@ } }, "node_modules/@smithy/util-defaults-mode-browser": { - "version": "4.0.22", - "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-4.0.22.tgz", - "integrity": "sha512-hjElSW18Wq3fUAWVk6nbk7pGrV7ZT14DL1IUobmqhV3lxcsIenr5FUsDe2jlTVaS8OYBI3x+Og9URv5YcKb5QA==", + "version": "4.3.11", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-4.3.11.tgz", + "integrity": "sha512-yHv+r6wSQXEXTPVCIQTNmXVWs7ekBTpMVErjqZoWkYN75HIFN5y9+/+sYOejfAuvxWGvgzgxbTHa/oz61YTbKw==", + "license": "Apache-2.0", "dependencies": { - "@smithy/property-provider": "^4.0.4", - "@smithy/smithy-client": "^4.4.6", - "@smithy/types": "^4.3.1", - "bowser": "^2.11.0", + "@smithy/property-provider": "^4.2.5", + "@smithy/smithy-client": "^4.9.8", + "@smithy/types": "^4.9.0", "tslib": "^2.6.2" }, "engines": { @@ -3926,16 +4554,17 @@ } }, "node_modules/@smithy/util-defaults-mode-node": { - "version": "4.0.22", - "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-4.0.22.tgz", - "integrity": "sha512-7B8mfQBtwwr2aNRRmU39k/bsRtv9B6/1mTMrGmmdJFKmLAH+KgIiOuhaqfKOBGh9sZ/VkZxbvm94rI4MMYpFjQ==", - "dependencies": { - "@smithy/config-resolver": "^4.1.4", - "@smithy/credential-provider-imds": "^4.0.6", - "@smithy/node-config-provider": "^4.1.3", - "@smithy/property-provider": "^4.0.4", - "@smithy/smithy-client": "^4.4.6", - "@smithy/types": "^4.3.1", + "version": "4.2.14", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-4.2.14.tgz", + "integrity": "sha512-ljZN3iRvaJUgulfvobIuG97q1iUuCMrvXAlkZ4msY+ZuVHQHDIqn7FKZCEj+bx8omz6kF5yQXms/xhzjIO5XiA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/config-resolver": "^4.4.3", + "@smithy/credential-provider-imds": "^4.2.5", + "@smithy/node-config-provider": "^4.3.5", + "@smithy/property-provider": "^4.2.5", + "@smithy/smithy-client": "^4.9.8", + "@smithy/types": "^4.9.0", "tslib": "^2.6.2" }, "engines": { @@ -3943,12 +4572,13 @@ } }, "node_modules/@smithy/util-endpoints": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-3.0.6.tgz", - "integrity": "sha512-YARl3tFL3WgPuLzljRUnrS2ngLiUtkwhQtj8PAL13XZSyUiNLQxwG3fBBq3QXFqGFUXepIN73pINp3y8c2nBmA==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-3.2.5.tgz", + "integrity": "sha512-3O63AAWu2cSNQZp+ayl9I3NapW1p1rR5mlVHcF6hAB1dPZUQFfRPYtplWX/3xrzWthPGj5FqB12taJJCfH6s8A==", + "license": "Apache-2.0", "dependencies": { - "@smithy/node-config-provider": "^4.1.3", - "@smithy/types": "^4.3.1", + "@smithy/node-config-provider": "^4.3.5", + "@smithy/types": "^4.9.0", "tslib": "^2.6.2" }, "engines": { @@ -3956,9 +4586,10 @@ } }, "node_modules/@smithy/util-hex-encoding": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-4.0.0.tgz", - "integrity": "sha512-Yk5mLhHtfIgW2W2WQZWSg5kuMZCVbvhFmC7rV4IO2QqnZdbEFPmQnCcGMAX2z/8Qj3B9hYYNjZOhWym+RwhePw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-4.2.0.tgz", + "integrity": "sha512-CCQBwJIvXMLKxVbO88IukazJD9a4kQ9ZN7/UMGBjBcJYvatpWk+9g870El4cB8/EJxfe+k+y0GmR9CAzkF+Nbw==", + "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" }, @@ -3967,11 +4598,12 @@ } }, "node_modules/@smithy/util-middleware": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-4.0.4.tgz", - "integrity": "sha512-9MLKmkBmf4PRb0ONJikCbCwORACcil6gUWojwARCClT7RmLzF04hUR4WdRprIXal7XVyrddadYNfp2eF3nrvtQ==", + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-4.2.5.tgz", + "integrity": "sha512-6Y3+rvBF7+PZOc40ybeZMcGln6xJGVeY60E7jy9Mv5iKpMJpHgRE6dKy9ScsVxvfAYuEX4Q9a65DQX90KaQ3bA==", + "license": "Apache-2.0", "dependencies": { - "@smithy/types": "^4.3.1", + "@smithy/types": "^4.9.0", "tslib": "^2.6.2" }, "engines": { @@ -3979,12 +4611,13 @@ } }, "node_modules/@smithy/util-retry": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-4.0.6.tgz", - "integrity": "sha512-+YekoF2CaSMv6zKrA6iI/N9yva3Gzn4L6n35Luydweu5MMPYpiGZlWqehPHDHyNbnyaYlz/WJyYAZnC+loBDZg==", + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-4.2.5.tgz", + "integrity": "sha512-GBj3+EZBbN4NAqJ/7pAhsXdfzdlznOh8PydUijy6FpNIMnHPSMO2/rP4HKu+UFeikJxShERk528oy7GT79YiJg==", + "license": "Apache-2.0", "dependencies": { - "@smithy/service-error-classification": "^4.0.6", - "@smithy/types": "^4.3.1", + "@smithy/service-error-classification": "^4.2.5", + "@smithy/types": "^4.9.0", "tslib": "^2.6.2" }, "engines": { @@ -3992,17 +4625,18 @@ } }, "node_modules/@smithy/util-stream": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-4.2.3.tgz", - "integrity": "sha512-cQn412DWHHFNKrQfbHY8vSFI3nTROY1aIKji9N0tpp8gUABRilr7wdf8fqBbSlXresobM+tQFNk6I+0LXK/YZg==", - "dependencies": { - "@smithy/fetch-http-handler": "^5.1.0", - "@smithy/node-http-handler": "^4.1.0", - "@smithy/types": "^4.3.1", - "@smithy/util-base64": "^4.0.0", - "@smithy/util-buffer-from": "^4.0.0", - "@smithy/util-hex-encoding": "^4.0.0", - "@smithy/util-utf8": "^4.0.0", + "version": "4.5.6", + "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-4.5.6.tgz", + "integrity": "sha512-qWw/UM59TiaFrPevefOZ8CNBKbYEP6wBAIlLqxn3VAIo9rgnTNc4ASbVrqDmhuwI87usnjhdQrxodzAGFFzbRQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/fetch-http-handler": "^5.3.6", + "@smithy/node-http-handler": "^4.4.5", + "@smithy/types": "^4.9.0", + "@smithy/util-base64": "^4.3.0", + "@smithy/util-buffer-from": "^4.2.0", + "@smithy/util-hex-encoding": "^4.2.0", + "@smithy/util-utf8": "^4.2.0", "tslib": "^2.6.2" }, "engines": { @@ -4010,9 +4644,10 @@ } }, "node_modules/@smithy/util-uri-escape": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-4.0.0.tgz", - "integrity": "sha512-77yfbCbQMtgtTylO9itEAdpPXSog3ZxMe09AEhm0dU0NLTalV70ghDZFR+Nfi1C60jnJoh/Re4090/DuZh2Omg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-4.2.0.tgz", + "integrity": "sha512-igZpCKV9+E/Mzrpq6YacdTQ0qTiLm85gD6N/IrmyDvQFA4UnU3d5g3m8tMT/6zG/vVkWSU+VxeUyGonL62DuxA==", + "license": "Apache-2.0", "dependencies": { "tslib": "^2.6.2" }, @@ -4021,11 +4656,24 @@ } }, "node_modules/@smithy/util-utf8": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-4.0.0.tgz", - "integrity": "sha512-b+zebfKCfRdgNJDknHCob3O7FpeYQN6ZG6YLExMcasDHsCXlsXCEuiPZeLnJLpwa5dvPetGlnGCiMHuLwGvFow==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-4.2.0.tgz", + "integrity": "sha512-zBPfuzoI8xyBtR2P6WQj63Rz8i3AmfAaJLuNG8dWsfvPe8lO4aCPYLn879mEgHndZH1zQ2oXmG8O1GGzzaoZiw==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^4.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/uuid": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/uuid/-/uuid-1.1.0.tgz", + "integrity": "sha512-4aUIteuyxtBUhVdiQqcDhKFitwfd9hqoSDYY2KRXiWtgoWJ9Bmise+KfEPDiVHWeJepvF8xJO9/9+WDIciMFFw==", + "license": "Apache-2.0", "dependencies": { - "@smithy/util-buffer-from": "^4.0.0", "tslib": "^2.6.2" }, "engines": { @@ -4035,12 +4683,19 @@ "node_modules/@socket.io/component-emitter": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.2.tgz", - "integrity": "sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==" + "integrity": "sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==", + "license": "MIT" + }, + "node_modules/@standard-schema/spec": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.0.0.tgz", + "integrity": "sha512-m2bOd0f2RT9k8QJx1JN85cZYyH1RqFBdlwtkSlf4tBDYLCiiZnv1fIIwacK6cqwXavOydf0NPToMQgpKq+dVlA==", + "license": "MIT" }, "node_modules/@thi.ng/bitstream": { - "version": "2.4.21", - "resolved": "https://registry.npmjs.org/@thi.ng/bitstream/-/bitstream-2.4.21.tgz", - "integrity": "sha512-ol302chc9iolVwIOgclqN+1LJV13xjHdJo/q/aDsgX4Rw44SpeaL2PoEwaO+P40qRMNHgZeOQdwFUgjsLSfGnQ==", + "version": "2.4.34", + "resolved": "https://registry.npmjs.org/@thi.ng/bitstream/-/bitstream-2.4.34.tgz", + "integrity": "sha512-1bS+601Ar/D2Smpv6xzr4Mk7pJV4CIs4LbLEpi2f09sAHssAByfnOeo2Vfh0MqX9Vt4jaOPXZqEVGcRX5rsgiw==", "funding": [ { "type": "github", @@ -4055,17 +4710,18 @@ "url": "https://liberapay.com/thi.ng" } ], + "license": "Apache-2.0", "dependencies": { - "@thi.ng/errors": "^2.5.35" + "@thi.ng/errors": "^2.5.48" }, "engines": { "node": ">=18" } }, "node_modules/@thi.ng/errors": { - "version": "2.5.35", - "resolved": "https://registry.npmjs.org/@thi.ng/errors/-/errors-2.5.35.tgz", - "integrity": "sha512-AUWVN2Mz23WbuREv/bmYmNNhMq+h8GzwAib6xnvsvv2LCy2Ekkt9/vupFGzTxcnFjT7e481/RaxMp6aHXy597A==", + "version": "2.5.48", + "resolved": "https://registry.npmjs.org/@thi.ng/errors/-/errors-2.5.48.tgz", + "integrity": "sha512-6LXqHT3DWruK3GrH+sIQPXZUQaoRrq0ASc90wd4MSPmGR53b4DuBLL6iE1dJtrQAmGx64LEor8yDIvAL8CZBzQ==", "funding": [ { "type": "github", @@ -4080,19 +4736,19 @@ "url": "https://liberapay.com/thi.ng" } ], + "license": "Apache-2.0", "engines": { "node": ">=18" } }, "node_modules/@tokenizer/inflate": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/@tokenizer/inflate/-/inflate-0.2.7.tgz", - "integrity": "sha512-MADQgmZT1eKjp06jpI2yozxaU9uVs4GzzgSL+uEq7bVcJ9V1ZXQkeGNql1fsSI0gMy1vhvNTNbUqrx+pZfJVmg==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@tokenizer/inflate/-/inflate-0.4.1.tgz", + "integrity": "sha512-2mAv+8pkG6GIZiF1kNg1jAjh27IDxEPKwdGul3snfztFerfPGI1LjDezZp3i7BElXompqEtPmoPx6c2wgtWsOA==", "license": "MIT", "dependencies": { - "debug": "^4.4.0", - "fflate": "^0.8.2", - "token-types": "^6.0.0" + "debug": "^4.4.3", + "token-types": "^6.1.1" }, "engines": { "node": ">=18" @@ -4102,12 +4758,23 @@ "url": "https://github.com/sponsors/Borewit" } }, + "node_modules/@tokenizer/inflate/node_modules/@borewit/text-codec": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@borewit/text-codec/-/text-codec-0.1.1.tgz", + "integrity": "sha512-5L/uBxmjaCIX5h8Z+uu+kA9BQLkc/Wl06UGR5ajNRxu+/XjonB5i8JpgFMrPj3LXTCPA0pv8yxUvbUi+QthGGA==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, "node_modules/@tokenizer/inflate/node_modules/token-types": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/token-types/-/token-types-6.0.3.tgz", - "integrity": "sha512-IKJ6EzuPPWtKtEIEPpIdXv9j5j2LGJEYk0CKY2efgKoYKLBiZdh6iQkLVBow/CB3phyWAWCyk+bZeaimJn6uRQ==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/token-types/-/token-types-6.1.1.tgz", + "integrity": "sha512-kh9LVIWH5CnL63Ipf0jhlBIy0UsrMj/NJDfpsy1SqOXlLKEVyXXYrnFxFT1yOOYVGBSApeVnjPw/sBz5BfEjAQ==", "license": "MIT", "dependencies": { + "@borewit/text-codec": "^0.1.0", "@tokenizer/token": "^0.3.0", "ieee754": "^1.2.1" }, @@ -4122,13 +4789,15 @@ "node_modules/@tokenizer/token": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz", - "integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==" + "integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==", + "license": "MIT" }, "node_modules/@types/body-parser": { "version": "1.19.6", "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.6.tgz", "integrity": "sha512-HLFeCYgz89uk22N5Qg3dvGvsv46B8GLvKKo1zKG4NybA8U2DiEO3w9lqGg29t/tfLRJpJ6iQxnVw4OnB7MoM9g==", "dev": true, + "license": "MIT", "dependencies": { "@types/connect": "*", "@types/node": "*" @@ -4139,15 +4808,27 @@ "resolved": "https://registry.npmjs.org/@types/compression/-/compression-1.8.1.tgz", "integrity": "sha512-kCFuWS0ebDbmxs0AXYn6e2r2nrGAb5KwQhknjSPSPgJcGd8+HVSILlUyFhGqML2gk39HcG7D1ydW9/qpYkN00Q==", "dev": true, + "license": "MIT", "dependencies": { "@types/express": "*", "@types/node": "*" } }, "node_modules/@types/connect": { - "version": "3.4.36", - "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.36.tgz", - "integrity": "sha512-P63Zd/JUGq+PdrM1lv0Wv5SBYeA2+CORvbrXbngriYY0jzLUWfQMQQxOhjONEz/wlHOAxOdY7CY65rgQdTjq2w==", + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/conventional-commits-parser": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@types/conventional-commits-parser/-/conventional-commits-parser-5.0.2.tgz", + "integrity": "sha512-BgT2szDXnVypgpNxOK8aL5SGjUdaQbC++WZNjF1Qge3Og2+zhHj+RWhmehLhYyvQwqAmvezruVfOf8+3m74W+g==", + "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*" } @@ -4156,6 +4837,7 @@ "version": "2.8.19", "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.19.tgz", "integrity": "sha512-mFNylyeyqN93lfe/9CSxOGREz8cpzAhH+E93xJ4xWQf62V8sQ/24reV2nyzUWM6H6Xji+GGHpkbLe7pVoUEskg==", + "license": "MIT", "dependencies": { "@types/node": "*" } @@ -4163,25 +4845,28 @@ "node_modules/@types/estree": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", - "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==" + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "license": "MIT" }, "node_modules/@types/express": { - "version": "4.17.23", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.23.tgz", - "integrity": "sha512-Crp6WY9aTYP3qPi2wGDo9iUe/rceX01UMhnF1jmwDcKCFM6cx7YhGP/Mpr3y9AASpfHixIG0E6azCcL5OcDHsQ==", + "version": "4.17.25", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.25.tgz", + "integrity": "sha512-dVd04UKsfpINUnK0yBoYHDF3xu7xVH4BuDotC/xGuycx4CgbP48X/KF/586bcObxT0HENHXEU8Nqtu6NR+eKhw==", "dev": true, + "license": "MIT", "dependencies": { "@types/body-parser": "*", "@types/express-serve-static-core": "^4.17.33", "@types/qs": "*", - "@types/serve-static": "*" + "@types/serve-static": "^1" } }, "node_modules/@types/express-serve-static-core": { - "version": "4.19.6", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.6.tgz", - "integrity": "sha512-N4LZ2xG7DatVqhCZzOGb1Yi5lMbXSZcmdLDe9EzSndPV2HpWYWzRbaerl2n27irrm94EPpprqa8KpskPT085+A==", + "version": "4.19.7", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.7.tgz", + "integrity": "sha512-FvPtiIf1LfhzsaIXhv/PHan/2FeQBbtBDtfX2QfvPxdUelMDEckK08SM6nqo1MIZY3RUlfA+HV8+hFUSio78qg==", "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*", "@types/qs": "*", @@ -4193,19 +4878,22 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.5.tgz", "integrity": "sha512-r8Tayk8HJnX0FztbZN7oVqGccWgw98T/0neJphO91KkmOzug1KkofZURD4UaD5uH8AqcFLfdPErnBod0u71/qg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/long": { "version": "4.0.2", @@ -4219,6 +4907,7 @@ "integrity": "sha512-5eEkJZ/BLvTE3vXGKkWlyTSUVZuzj23Wj8PoyOq2lt5I3CYbiLBOPb3XmCW6QcuOibIUE6emHXHt9E/F/rCa6w==", "deprecated": "This is a stub types definition. mime provides its own type definitions, so you do not need this installed.", "dev": true, + "license": "MIT", "dependencies": { "mime": "*" } @@ -4227,43 +4916,49 @@ "version": "2.1.4", "resolved": "https://registry.npmjs.org/@types/mime-types/-/mime-types-2.1.4.tgz", "integrity": "sha512-lfU4b34HOri+kAY5UheuFMWPDOI+OPceBSHZKp69gEyTL/mmJ4cnU6Y/rlme3UL3GyOn6Y42hyIEw0/q8sWx5w==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/mysql": { - "version": "2.15.26", - "resolved": "https://registry.npmjs.org/@types/mysql/-/mysql-2.15.26.tgz", - "integrity": "sha512-DSLCOXhkvfS5WNNPbfn2KdICAmk8lLc+/PNvnPnF7gOdMZCxopXduqv0OQ13y/yA/zXTSikZZqVgybUxOEg6YQ==", + "version": "2.15.27", + "resolved": "https://registry.npmjs.org/@types/mysql/-/mysql-2.15.27.tgz", + "integrity": "sha512-YfWiV16IY0OeBfBCk8+hXKmdTKrKlwKN1MNKAPBu5JYxLwBEZl7QzeEpGnlZb3VMGJrrGmB84gXiH+ofs/TezA==", + "license": "MIT", "dependencies": { "@types/node": "*" } }, "node_modules/@types/node": { - "version": "22.16.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.16.2.tgz", - "integrity": "sha512-Cdqa/eJTvt4fC4wmq1Mcc0CPUjp/Qy2FGqLza3z3pKymsI969TcZ54diNJv8UYUgeWxyb8FSbCkhdR6WqmUFhA==", + "version": "24.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz", + "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", + "license": "MIT", "dependencies": { - "undici-types": "~6.21.0" + "undici-types": "~7.16.0" } }, "node_modules/@types/node-cron": { "version": "3.0.11", "resolved": "https://registry.npmjs.org/@types/node-cron/-/node-cron-3.0.11.tgz", "integrity": "sha512-0ikrnug3/IyneSHqCBeslAhlK2aBfYek1fGo4bP4QnZPmiqSGRK+Oy7ZMisLWkesffJvQ1cqAcBnJC+8+nxIAg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/node-fetch": { - "version": "2.6.12", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.12.tgz", - "integrity": "sha512-8nneRWKCg3rMtF69nLQJnOYUcbafYeFSjqkw3jCRLsqkWFlHaoQrr5mXmofFGOx3DKn7UfmBMyov8ySvLRVldA==", + "version": "2.6.13", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.13.tgz", + "integrity": "sha512-QGpRVpzSaUs30JBSGPjOg4Uveu384erbHBoT1zeONvyCfwQxIkUshLAOqN/k9EjGviPRmWTTe6aH2qySWKTVSw==", + "license": "MIT", "dependencies": { "@types/node": "*", - "form-data": "^4.0.0" + "form-data": "^4.0.4" } }, "node_modules/@types/pg": { - "version": "8.6.1", - "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.6.1.tgz", - "integrity": "sha512-1Kc4oAGzAl7uqUStZCDvaLFqZrW9qWSjXOmBfdgyBP5La7Us6Mg4GBvRlSoaZMhQF/zSj1C8CtKMBkoiT8eL8w==", + "version": "8.15.5", + "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.15.5.tgz", + "integrity": "sha512-LF7lF6zWEKxuT3/OR8wAZGzkg4ENGXFNyiV/JeOt9z5B+0ZVwbql9McqX5c/WStFq1GaGso7H1AzP/qSzmlCKQ==", + "license": "MIT", "dependencies": { "@types/node": "*", "pg-protocol": "*", @@ -4274,15 +4969,17 @@ "version": "2.0.6", "resolved": "https://registry.npmjs.org/@types/pg-pool/-/pg-pool-2.0.6.tgz", "integrity": "sha512-TaAUE5rq2VQYxab5Ts7WZhKNmuN78Q6PiFonTDdpbx8a1H0M1vhy3rhiMjl+e2iHmogyMw7jZF4FrE6eJUy5HQ==", + "license": "MIT", "dependencies": { "@types/pg": "*" } }, "node_modules/@types/qrcode": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@types/qrcode/-/qrcode-1.5.5.tgz", - "integrity": "sha512-CdfBi/e3Qk+3Z/fXYShipBT13OJ2fDO2Q2w5CIP5anLTLIndQG9z6P1cnm+8zCWSpm5dnxMFd/uREtb0EXuQzg==", + "version": "1.5.6", + "resolved": "https://registry.npmjs.org/@types/qrcode/-/qrcode-1.5.6.tgz", + "integrity": "sha512-te7NQcV2BOvdj2b1hCAHzAoMNuj65kNBMz0KBaxM6c3VGBOhU0dURQKOtH8CFNI/dsKkwlv32p26qYQTWoB5bw==", "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*" } @@ -4291,62 +4988,74 @@ "version": "0.12.2", "resolved": "https://registry.npmjs.org/@types/qrcode-terminal/-/qrcode-terminal-0.12.2.tgz", "integrity": "sha512-v+RcIEJ+Uhd6ygSQ0u5YYY7ZM+la7GgPbs0V/7l/kFs2uO4S8BcIUEMoP7za4DNIqNnUD5npf0A/7kBhrCKG5Q==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/qs": { "version": "6.14.0", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.14.0.tgz", "integrity": "sha512-eOunJqu0K1923aExK6y8p6fsihYEn/BYuQ4g0CxAAgFc4b/ZLN4CrsRZ55srTdqoiLzU2B2evC+apEIxprEzkQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/range-parser": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", - "dev": true - }, - "node_modules/@types/semver": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.7.0.tgz", - "integrity": "sha512-k107IF4+Xr7UHjwDc7Cfd6PRQfbdkiRabXGRjo07b4WyPahFBZCZ1sE+BNxYIJPPg73UkfOsVOLwqVc/6ETrIA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/send": { - "version": "0.17.5", - "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.5.tgz", - "integrity": "sha512-z6F2D3cOStZvuk2SaP6YrwkNO65iTZcwA2ZkSABegdkAh/lf+Aa/YQndZVfmEXT5vgAp6zv06VQ3ejSVjAny4w==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@types/send/-/send-1.2.1.tgz", + "integrity": "sha512-arsCikDvlU99zl1g69TcAB3mzZPpxgw0UQnaHeC1Nwb015xp8bknZv5rIfri9xTOcMuaVgvabfIRA7PSZVuZIQ==", "dev": true, + "license": "MIT", "dependencies": { - "@types/mime": "^1", "@types/node": "*" } }, - "node_modules/@types/send/node_modules/@types/mime": { + "node_modules/@types/serve-static": { + "version": "1.15.10", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.10.tgz", + "integrity": "sha512-tRs1dB+g8Itk72rlSI2ZrW6vZg0YrLI81iQSTkMmOqnqCaNr/8Ek4VwWcN5vZgCYWbg/JJSGBlUaYGAOP73qBw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/http-errors": "*", + "@types/node": "*", + "@types/send": "<1" + } + }, + "node_modules/@types/serve-static/node_modules/@types/mime": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", - "dev": true + "dev": true, + "license": "MIT" }, - "node_modules/@types/serve-static": { - "version": "1.15.8", - "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.8.tgz", - "integrity": "sha512-roei0UY3LhpOJvjbIP6ZZFngyLKl5dskOtDhxY5THRSpO+ZI+nzJ+m5yUMzGrp89YRa7lvknKkMYjqQFGwA7Sg==", + "node_modules/@types/serve-static/node_modules/@types/send": { + "version": "0.17.6", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.6.tgz", + "integrity": "sha512-Uqt8rPBE8SY0RK8JB1EzVOIZ32uqy8HwdxCnoCOsYrvnswqmFZ/k+9Ikidlk/ImhsdvBsloHbAlewb2IEBV/Og==", "dev": true, + "license": "MIT", "dependencies": { - "@types/http-errors": "*", - "@types/node": "*", - "@types/send": "*" + "@types/mime": "^1", + "@types/node": "*" } }, "node_modules/@types/shimmer": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@types/shimmer/-/shimmer-1.2.0.tgz", - "integrity": "sha512-UE7oxhQLLd9gub6JKIAhDq06T0F6FnztwMNRvYgjeQSBeMc1ZG/tA47EwfduvkuQS8apbkM/lpLpWsaCeYsXVg==" + "integrity": "sha512-UE7oxhQLLd9gub6JKIAhDq06T0F6FnztwMNRvYgjeQSBeMc1ZG/tA47EwfduvkuQS8apbkM/lpLpWsaCeYsXVg==", + "license": "MIT" }, "node_modules/@types/tedious": { "version": "4.0.14", "resolved": "https://registry.npmjs.org/@types/tedious/-/tedious-4.0.14.tgz", "integrity": "sha512-KHPsfX/FoVbUGbyYvk1q9MMQHLPeRZhRJZdO45Q4YjvFkv4hMNghCWTvy7rdKessBsmtz4euWCWAB6/tVpI1Iw==", + "license": "MIT", "dependencies": { "@types/node": "*" } @@ -4355,127 +5064,159 @@ "version": "10.0.0", "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-10.0.0.tgz", "integrity": "sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==", - "dev": true + "license": "MIT" }, "node_modules/@types/validator": { - "version": "13.15.2", - "resolved": "https://registry.npmjs.org/@types/validator/-/validator-13.15.2.tgz", - "integrity": "sha512-y7pa/oEJJ4iGYBxOpfAKn5b9+xuihvzDVnC/OSvlVnGxVg0pOqmjiMafiJ1KVNQEaPZf9HsEp5icEwGg8uIe5Q==" + "version": "13.15.10", + "resolved": "https://registry.npmjs.org/@types/validator/-/validator-13.15.10.tgz", + "integrity": "sha512-T8L6i7wCuyoK8A/ZeLYt1+q0ty3Zb9+qbSSvrIVitzT3YjZqkTZ40IbRsPanlB4h1QB3JVL1SYCdR6ngtFYcuA==", + "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz", - "integrity": "sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.47.0.tgz", + "integrity": "sha512-fe0rz9WJQ5t2iaLfdbDc9T80GJy0AeO453q8C3YCilnGozvOyCG5t+EZtg7j7D88+c3FipfP/x+wzGnh1xp8ZA==", "dev": true, + "license": "MIT", "dependencies": { - "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.21.0", - "@typescript-eslint/type-utils": "6.21.0", - "@typescript-eslint/utils": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0", - "debug": "^4.3.4", + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.47.0", + "@typescript-eslint/type-utils": "8.47.0", + "@typescript-eslint/utils": "8.47.0", + "@typescript-eslint/visitor-keys": "8.47.0", "graphemer": "^1.4.0", - "ignore": "^5.2.4", + "ignore": "^7.0.0", "natural-compare": "^1.4.0", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" + "ts-api-utils": "^2.1.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", - "eslint": "^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "@typescript-eslint/parser": "^8.47.0", + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/parser": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.21.0.tgz", - "integrity": "sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.47.0.tgz", + "integrity": "sha512-lJi3PfxVmo0AkEY93ecfN+r8SofEqZNGByvHAI3GBLrvt1Cw6H5k1IM02nSzu0RfUafr2EvFSw0wAsZgubNplQ==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "6.21.0", - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/typescript-estree": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0", + "@typescript-eslint/scope-manager": "8.47.0", + "@typescript-eslint/types": "8.47.0", + "@typescript-eslint/typescript-estree": "8.47.0", + "@typescript-eslint/visitor-keys": "8.47.0", "debug": "^4.3.4" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, + "node_modules/@typescript-eslint/project-service": { + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.47.0.tgz", + "integrity": "sha512-2X4BX8hUeB5JcA1TQJ7GjcgulXQ+5UkNb0DL8gHsHUHdFoiCTJoYLTpib3LtSDPZsRET5ygN4qqIWrHyYIKERA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/tsconfig-utils": "^8.47.0", + "@typescript-eslint/types": "^8.47.0", + "debug": "^4.3.4" }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz", - "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.47.0.tgz", + "integrity": "sha512-a0TTJk4HXMkfpFkL9/WaGTNuv7JWfFTQFJd6zS9dVAjKsojmv9HT55xzbEpnZoY+VUb+YXLMp+ihMLz/UlZfDg==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0" + "@typescript-eslint/types": "8.47.0", + "@typescript-eslint/visitor-keys": "8.47.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.47.0.tgz", + "integrity": "sha512-ybUAvjy4ZCL11uryalkKxuT3w3sXJAuWhOoGS3T/Wu+iUu1tGJmk5ytSY8gbdACNARmcYEB0COksD2j6hfGK2g==", + "dev": true, + "license": "MIT", "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz", - "integrity": "sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.47.0.tgz", + "integrity": "sha512-QC9RiCmZ2HmIdCEvhd1aJELBlD93ErziOXXlHEZyuBo3tBiAZieya0HLIxp+DoDWlsQqDawyKuNEhORyku+P8A==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "6.21.0", - "@typescript-eslint/utils": "6.21.0", + "@typescript-eslint/types": "8.47.0", + "@typescript-eslint/typescript-estree": "8.47.0", + "@typescript-eslint/utils": "8.47.0", "debug": "^4.3.4", - "ts-api-utils": "^1.0.1" + "ts-api-utils": "^2.1.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/types": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz", - "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.47.0.tgz", + "integrity": "sha512-nHAE6bMKsizhA2uuYZbEbmp5z2UpffNrPEqiKIeN7VsV6UY/roxanWfoRrf6x/k9+Obf+GQdkm0nPU+vnMXo9A==", "dev": true, + "license": "MIT", "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -4483,94 +5224,111 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz", - "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.47.0.tgz", + "integrity": "sha512-k6ti9UepJf5NpzCjH31hQNLHQWupTRPhZ+KFF8WtTuTpy7uHPfeg2NM7cP27aCGajoEplxJDFVCEm9TGPYyiVg==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0", + "@typescript-eslint/project-service": "8.47.0", + "@typescript-eslint/tsconfig-utils": "8.47.0", + "@typescript-eslint/types": "8.47.0", + "@typescript-eslint/visitor-keys": "8.47.0", "debug": "^4.3.4", - "globby": "^11.1.0", + "fast-glob": "^3.3.2", "is-glob": "^4.0.3", - "minimatch": "9.0.3", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^2.1.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "peerDependencies": { + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/utils": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.21.0.tgz", - "integrity": "sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.47.0.tgz", + "integrity": "sha512-g7XrNf25iL4TJOiPqatNuaChyqt49a/onq5YsJ9+hXeugK+41LVg7AxikMfM02PC6jbNtZLCJj6AUcQXJS/jGQ==", "dev": true, + "license": "MIT", "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "@types/json-schema": "^7.0.12", - "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.21.0", - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/typescript-estree": "6.21.0", - "semver": "^7.5.4" + "@eslint-community/eslint-utils": "^4.7.0", + "@typescript-eslint/scope-manager": "8.47.0", + "@typescript-eslint/types": "8.47.0", + "@typescript-eslint/typescript-estree": "8.47.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", - "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.47.0.tgz", + "integrity": "sha512-SIV3/6eftCy1bNzCQoPmbWsRLujS8t5iDIZ4spZOBHqrM+yfX2ogg8Tt3PDTAVKw3sSCiUgg30uOAvK2r9zGjQ==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "6.21.0", - "eslint-visitor-keys": "^3.4.1" + "@typescript-eslint/types": "8.47.0", + "eslint-visitor-keys": "^4.2.1" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/@ungap/structured-clone": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/@wasm-audio-decoders/common": { "version": "9.0.7", "resolved": "https://registry.npmjs.org/@wasm-audio-decoders/common/-/common-9.0.7.tgz", "integrity": "sha512-WRaUuWSKV7pkttBygml/a6dIEpatq2nnZGFIoPTc5yPLkxL6Wk4YaslPM98OPQvWacvNZ+Py9xROGDtrFBDzag==", + "license": "MIT", "dependencies": { "@eshaz/web-worker": "1.2.2", "simple-yenc": "^1.0.4" } }, "node_modules/@wasm-audio-decoders/flac": { - "version": "0.2.8", - "resolved": "https://registry.npmjs.org/@wasm-audio-decoders/flac/-/flac-0.2.8.tgz", - "integrity": "sha512-CxvylHiUmtCrf0hUSzYQlD9RtoY/LsPuKR8M6ZjtQrXHzSLir0whWjPs1yb+hDZdK8R1NbESHcz2ZV88eMcKUg==", + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/@wasm-audio-decoders/flac/-/flac-0.2.10.tgz", + "integrity": "sha512-YfcyoD2rYRBa6ffawZKNi5qvV5HArJmNmuMVUPoutuZ2hhGi6WNSWIzgvbROGmPbFivLL764Am7xxJENWJDhjw==", + "license": "MIT", "dependencies": { "@wasm-audio-decoders/common": "9.0.7", "codec-parser": "2.5.0" @@ -4581,9 +5339,10 @@ } }, "node_modules/@wasm-audio-decoders/ogg-vorbis": { - "version": "0.1.18", - "resolved": "https://registry.npmjs.org/@wasm-audio-decoders/ogg-vorbis/-/ogg-vorbis-0.1.18.tgz", - "integrity": "sha512-kEg6b5vW4wAXfGAqe5wzvSuAs2FEhPY/rniYF/Gx3rgxQcPiRI86SBAyIRWFJ7O4CY/JJHX57B1OCDueMlBSLQ==", + "version": "0.1.20", + "resolved": "https://registry.npmjs.org/@wasm-audio-decoders/ogg-vorbis/-/ogg-vorbis-0.1.20.tgz", + "integrity": "sha512-zaQPasU5usRjUDXtXOHYED5tfkR4QMXd+EH3Nrz1+4+M5pCsdD+s9YxJqb0oqnTyRu/KUujOmu5Z/m/NT47vwg==", + "license": "MIT", "dependencies": { "@wasm-audio-decoders/common": "9.0.7", "codec-parser": "2.5.0" @@ -4594,9 +5353,10 @@ } }, "node_modules/@wasm-audio-decoders/opus-ml": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/@wasm-audio-decoders/opus-ml/-/opus-ml-0.0.1.tgz", - "integrity": "sha512-FALuUCz10HS2h8KB4L7wmfXncOuBDFvlKRk6Ga2rw8sr/zNIpwCjhhomxH4JKPhVLOnBjZfrPa8aTFIQq74vzQ==", + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/@wasm-audio-decoders/opus-ml/-/opus-ml-0.0.2.tgz", + "integrity": "sha512-58rWEqDGg+CKCyEeKm2KoxxSwTWtHh/NLTW9ObR4K8CGF6VwuuGudEI1CtniS/oSRmL1nJq/eh8MKARiluw4DQ==", + "license": "MIT", "dependencies": { "@wasm-audio-decoders/common": "9.0.7" }, @@ -4609,12 +5369,14 @@ "version": "0.9.0", "resolved": "https://registry.npmjs.org/@zxing/text-encoding/-/text-encoding-0.9.0.tgz", "integrity": "sha512-U/4aVJ2mxI0aDNI8Uq0wEhMgY+u4CNtEb0om3+y3+niDAsoTCOB33UF0sxpzqzdqXLqmvc+vZyAt4O8pPdfkwA==", + "license": "(Unlicense OR Apache-2.0)", "optional": true }, "node_modules/abort-controller": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "license": "MIT", "dependencies": { "event-target-shim": "^5.0.0" }, @@ -4626,6 +5388,7 @@ "version": "1.3.8", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "license": "MIT", "dependencies": { "mime-types": "~2.1.34", "negotiator": "0.6.3" @@ -4638,6 +5401,7 @@ "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -4646,6 +5410,7 @@ "version": "8.15.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -4657,6 +5422,7 @@ "version": "1.9.5", "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", + "license": "MIT", "peerDependencies": { "acorn": "^8" } @@ -4666,6 +5432,7 @@ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, + "license": "MIT", "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } @@ -4674,6 +5441,7 @@ "version": "7.1.4", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "license": "MIT", "engines": { "node": ">= 14" } @@ -4682,6 +5450,7 @@ "version": "4.6.0", "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.6.0.tgz", "integrity": "sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ==", + "license": "MIT", "dependencies": { "humanize-ms": "^1.2.1" }, @@ -4690,15 +5459,16 @@ } }, "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", "dev": true, + "license": "MIT", "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" }, "funding": { "type": "github", @@ -4706,9 +5476,10 @@ } }, "node_modules/amqplib": { - "version": "0.10.8", - "resolved": "https://registry.npmjs.org/amqplib/-/amqplib-0.10.8.tgz", - "integrity": "sha512-Tfn1O9sFgAP8DqeMEpt2IacsVTENBpblB3SqLdn0jK2AeX8iyCvbptBc8lyATT9bQ31MsjVwUSQ1g8f4jHOUfw==", + "version": "0.10.9", + "resolved": "https://registry.npmjs.org/amqplib/-/amqplib-0.10.9.tgz", + "integrity": "sha512-jwSftI4QjS3mizvnSnOrPGYiUnm1vI2OP1iXeOUz5pb74Ua0nbf6nPyyTzuiCLEE3fMpaJORXh2K/TQ08H5xGA==", + "license": "MIT", "dependencies": { "buffer-more-ints": "~1.0.0", "url-parse": "~1.5.10" @@ -4717,23 +5488,51 @@ "node": ">=10" } }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.21.3" + }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "^2.0.1" + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", "engines": { "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "license": "MIT", + "engines": { + "node": ">=12" }, "funding": { "url": "https://github.com/chalk/ansi-styles?sponsor=1" @@ -4742,29 +5541,34 @@ "node_modules/any-base": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/any-base/-/any-base-1.1.0.tgz", - "integrity": "sha512-uMgjozySS8adZZYePpaWs8cxB9/kdzmpX6SgJZ+wbz1K5eYk5QMYDVJaZKhxyIHUdnnJkfR7SVgStgH7LkGUyg==" + "integrity": "sha512-uMgjozySS8adZZYePpaWs8cxB9/kdzmpX6SgJZ+wbz1K5eYk5QMYDVJaZKhxyIHUdnnJkfR7SVgStgH7LkGUyg==", + "license": "MIT" }, "node_modules/any-promise": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==" + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "license": "MIT" }, "node_modules/append-field": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz", - "integrity": "sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==" + "integrity": "sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==", + "license": "MIT" }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true + "dev": true, + "license": "Python-2.0" }, "node_modules/array-buffer-byte-length": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==", "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.3", "is-array-buffer": "^3.0.5" @@ -4779,13 +5583,22 @@ "node_modules/array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", + "license": "MIT" + }, + "node_modules/array-ify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz", + "integrity": "sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng==", + "dev": true, + "license": "MIT" }, "node_modules/array-includes": { "version": "3.1.9", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.9.tgz", "integrity": "sha512-FmeCCAenzH0KH381SPT5FZmiA/TmpndpcaShhfgEN9eCVjnFBqq3l1xrI42y8+PPLI6hypzou4GXw00WHmPBLQ==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.4", @@ -4803,20 +5616,12 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/array.prototype.findlastindex": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.6.tgz", "integrity": "sha512-F/TKATkzseUExPlfvmwQKGITM3DGTK+vkAsCZoDc5daVygbJBnjEUCbgkAvVFsgfXfX4YIqZ/27G3k3tdXrTxQ==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.4", @@ -4838,6 +5643,7 @@ "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.3.tgz", "integrity": "sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "define-properties": "^1.2.1", @@ -4856,6 +5662,7 @@ "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.3.tgz", "integrity": "sha512-Y7Wt51eKJSyi80hFrJCePGGNo5ktJCslFuboqJsbf57CCPcm5zztluPlc4/aD8sWsKvlwatezpV4U1efk8kpjg==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "define-properties": "^1.2.1", @@ -4874,6 +5681,7 @@ "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz", "integrity": "sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==", "dev": true, + "license": "MIT", "dependencies": { "array-buffer-byte-length": "^1.0.1", "call-bind": "^1.0.8", @@ -4900,6 +5708,7 @@ "resolved": "https://registry.npmjs.org/async-function/-/async-function-1.0.0.tgz", "integrity": "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" } @@ -4908,6 +5717,7 @@ "version": "0.5.0", "resolved": "https://registry.npmjs.org/async-mutex/-/async-mutex-0.5.0.tgz", "integrity": "sha512-1A94B18jkJ3DYq284ohPxoXbfTA5HsQ7/Mf4DEhcyLx3Bz27Rh59iScbB6EPiP+B+joue6YCxcMXSbFC1tZKwA==", + "license": "MIT", "dependencies": { "tslib": "^2.4.0" } @@ -4915,12 +5725,24 @@ "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, + "node_modules/at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 4.0.0" + } }, "node_modules/atomic-sleep": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz", "integrity": "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==", + "license": "MIT", "engines": { "node": ">=8.0.0" } @@ -4928,12 +5750,14 @@ "node_modules/audio-buffer": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/audio-buffer/-/audio-buffer-5.0.0.tgz", - "integrity": "sha512-gsDyj1wwUp8u7NBB+eW6yhLb9ICf+0eBmDX8NGaAS00w8/fLqFdxUlL5Ge/U8kB64DlQhdonxYC59dXy1J7H/w==" + "integrity": "sha512-gsDyj1wwUp8u7NBB+eW6yhLb9ICf+0eBmDX8NGaAS00w8/fLqFdxUlL5Ge/U8kB64DlQhdonxYC59dXy1J7H/w==", + "license": "MIT" }, "node_modules/audio-decode": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/audio-decode/-/audio-decode-2.2.3.tgz", "integrity": "sha512-Z0lHvMayR/Pad9+O9ddzaBJE0DrhZkQlStrC1RwcAHF3AhQAsdwKHeLGK8fYKyp2DDU6xHxzGb4CLMui12yVrg==", + "license": "MIT", "dependencies": { "@wasm-audio-decoders/flac": "^0.2.4", "@wasm-audio-decoders/ogg-vorbis": "^0.1.15", @@ -4949,6 +5773,7 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/audio-type/-/audio-type-2.2.1.tgz", "integrity": "sha512-En9AY6EG1qYqEy5L/quryzbA4akBpJrnBZNxeKTqGHC2xT9Qc4aZ8b7CcbOMFTTc/MGdoNyp+SN4zInZNKxMYA==", + "license": "MIT", "engines": { "node": ">=14" } @@ -4957,6 +5782,7 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "license": "MIT", "dependencies": { "possible-typed-array-names": "^1.0.0" }, @@ -4971,32 +5797,36 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/await-to-js/-/await-to-js-3.0.0.tgz", "integrity": "sha512-zJAaP9zxTcvTHRlejau3ZOY4V7SRpiByf3/dxx2uyKxxor19tpmpV2QRsTKikckwhaPmr2dVpxxMr7jOCYVp5g==", + "license": "MIT", "engines": { "node": ">=6.0.0" } }, "node_modules/axios": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.10.0.tgz", - "integrity": "sha512-/1xYAC4MP/HEG+3duIhFr4ZQXR4sQXOIe+o6sdqzeykGLx6Upp/1p8MHqhINOvGeP7xyNHe7tsiJByc4SSVUxw==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.2.tgz", + "integrity": "sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA==", + "license": "MIT", "dependencies": { "follow-redirects": "^1.15.6", - "form-data": "^4.0.0", + "form-data": "^4.0.4", "proxy-from-env": "^1.1.0" } }, "node_modules/baileys": { - "version": "6.7.19", - "resolved": "git+ssh://git@github.com/WhiskeySockets/Baileys.git#9e04cce8d3eeb16025283a57849cc83aa26c6dd1", + "version": "7.0.0-rc.9", + "resolved": "https://registry.npmjs.org/baileys/-/baileys-7.0.0-rc.9.tgz", + "integrity": "sha512-Txd2dZ9MHbojvsHckeuCnAKPO/bQjKxua/0tQSJwOKXffK5vpS82k4eA/Nb46K0cK0Bx+fyY0zhnQHYMBriQcw==", "hasInstallScript": true, "license": "MIT", "dependencies": { "@cacheable/node-cache": "^1.4.0", "@hapi/boom": "^9.1.3", "async-mutex": "^0.5.0", - "axios": "^1.6.0", - "libsignal": "git+https://github.com/whiskeysockets/libsignal-node", + "libsignal": "git+https://github.com/whiskeysockets/libsignal-node.git", + "lru-cache": "^11.1.0", "music-metadata": "^11.7.0", + "p-queue": "^9.0.0", "pino": "^9.6", "protobufjs": "^7.2.4", "ws": "^8.13.0" @@ -5026,6 +5856,7 @@ "version": "9.1.4", "resolved": "https://registry.npmjs.org/@hapi/boom/-/boom-9.1.4.tgz", "integrity": "sha512-Ls1oH8jaN1vNsqcaHVYJrKmgMcKsC1wcp8bujvXrHaAqD2iDYq3HoOwsxwo09Cuda5R5nC0o0IxlrlTuvPuzSw==", + "license": "BSD-3-Clause", "dependencies": { "@hapi/hoek": "9.x.x" } @@ -5033,77 +5864,14 @@ "node_modules/baileys/node_modules/@hapi/hoek": { "version": "9.3.0", "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz", - "integrity": "sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==" - }, - "node_modules/baileys/node_modules/pino": { - "version": "9.7.0", - "resolved": "https://registry.npmjs.org/pino/-/pino-9.7.0.tgz", - "integrity": "sha512-vnMCM6xZTb1WDmLvtG2lE/2p+t9hDEIvTWJsu6FejkE62vB7gDhvzrpFR4Cw2to+9JNQxVnkAKVPA1KPB98vWg==", - "dependencies": { - "atomic-sleep": "^1.0.0", - "fast-redact": "^3.1.1", - "on-exit-leak-free": "^2.1.0", - "pino-abstract-transport": "^2.0.0", - "pino-std-serializers": "^7.0.0", - "process-warning": "^5.0.0", - "quick-format-unescaped": "^4.0.3", - "real-require": "^0.2.0", - "safe-stable-stringify": "^2.3.1", - "sonic-boom": "^4.0.1", - "thread-stream": "^3.0.0" - }, - "bin": { - "pino": "bin.js" - } - }, - "node_modules/baileys/node_modules/pino-abstract-transport": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-2.0.0.tgz", - "integrity": "sha512-F63x5tizV6WCh4R6RHyi2Ml+M70DNRXt/+HANowMflpgGFMAym/VKm6G7ZOQRjqN7XbGxK1Lg9t6ZrtzOaivMw==", - "dependencies": { - "split2": "^4.0.0" - } - }, - "node_modules/baileys/node_modules/pino-std-serializers": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-7.0.0.tgz", - "integrity": "sha512-e906FRY0+tV27iq4juKzSYPbUj2do2X2JX4EzSca1631EB2QJQUqGbDuERal7LCtOpxl6x3+nvo9NPZcmjkiFA==" - }, - "node_modules/baileys/node_modules/process-warning": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-5.0.0.tgz", - "integrity": "sha512-a39t9ApHNx2L4+HBnQKqxxHNs1r7KF+Intd8Q/g1bUh6q0WIp9voPXJ/x0j+ZL45KF1pJd9+q2jLIRMfvEshkA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/fastify" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/fastify" - } - ] - }, - "node_modules/baileys/node_modules/sonic-boom": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-4.2.0.tgz", - "integrity": "sha512-INb7TM37/mAcsGmc9hyyI6+QR3rR1zVRu36B0NeGXKnOOLiZOfER5SA+N7X7k3yUYRzLWafduTDvJAfDswwEww==", - "dependencies": { - "atomic-sleep": "^1.0.0" - } - }, - "node_modules/baileys/node_modules/thread-stream": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-3.1.0.tgz", - "integrity": "sha512-OqyPZ9u96VohAyMfJykzmivOrY2wfMSf3C5TtFJVgN+Hm6aj+voFhlK+kZEIv2FBh1X6Xp3DlnCOfEQ3B2J86A==", - "dependencies": { - "real-require": "^0.2.0" - } + "integrity": "sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==", + "license": "BSD-3-Clause" }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "license": "MIT" }, "node_modules/base64-js": { "version": "1.5.1", @@ -5122,20 +5890,35 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/base64id": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==", + "license": "MIT", "engines": { "node": "^4.5.0 || >= 5.9" } }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, "node_modules/block-stream2": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/block-stream2/-/block-stream2-2.1.0.tgz", "integrity": "sha512-suhjmLI57Ewpmq00qaygS8UgEq2ly2PCItenIyhMqVjo4t4pGzqMvfgJuX8iWTeSDdfSSqS6j38fL4ToNL7Pfg==", + "license": "MIT", "dependencies": { "readable-stream": "^3.4.0" } @@ -5143,12 +5926,14 @@ "node_modules/bmp-ts": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/bmp-ts/-/bmp-ts-1.0.9.tgz", - "integrity": "sha512-cTEHk2jLrPyi+12M3dhpEbnnPOsaZuq7C45ylbbQIiWgDFZq4UVYPEY5mlqjvsj/6gJv9qX5sa+ebDzLXT28Vw==" + "integrity": "sha512-cTEHk2jLrPyi+12M3dhpEbnnPOsaZuq7C45ylbbQIiWgDFZq4UVYPEY5mlqjvsj/6gJv9qX5sa+ebDzLXT28Vw==", + "license": "MIT" }, "node_modules/body-parser": { "version": "1.20.3", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", + "license": "MIT", "dependencies": { "bytes": "3.1.2", "content-type": "~1.0.5", @@ -5172,6 +5957,7 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", "dependencies": { "ms": "2.0.0" } @@ -5179,22 +5965,26 @@ "node_modules/body-parser/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" }, "node_modules/boolbase": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", - "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==" + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", + "license": "ISC" }, "node_modules/bowser": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.11.0.tgz", - "integrity": "sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==" + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.13.0.tgz", + "integrity": "sha512-yHAbSRuT6LTeKi6k2aS40csueHqgAsFEgmrOsfRyFpJnFv5O2hl9FYmWEUZ97gZ/dG17U4IQQcTx4YAFYPuWRQ==", + "license": "MIT" }, "node_modules/brace-expansion": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } @@ -5204,6 +5994,7 @@ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, + "license": "MIT", "dependencies": { "fill-range": "^7.1.1" }, @@ -5214,12 +6005,14 @@ "node_modules/browser-or-node": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/browser-or-node/-/browser-or-node-2.1.1.tgz", - "integrity": "sha512-8CVjaLJGuSKMVTxJ2DpBl5XnlNDiT4cQFeuCJJrvJmts9YrTZDizTX7PjC2s6W4x+MBGZeEY6dGMrF04/6Hgqg==" + "integrity": "sha512-8CVjaLJGuSKMVTxJ2DpBl5XnlNDiT4cQFeuCJJrvJmts9YrTZDizTX7PjC2s6W4x+MBGZeEY6dGMrF04/6Hgqg==", + "license": "MIT" }, "node_modules/buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, "funding": [ { "type": "github", @@ -5234,15 +6027,17 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "base64-js": "^1.3.1", - "ieee754": "^1.2.1" + "ieee754": "^1.1.13" } }, "node_modules/buffer-crc32": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-1.0.0.tgz", "integrity": "sha512-Db1SbgBS/fg/392AblrMJk97KggmvYhr4pB5ZIMTWtaivCPMWLkmb7m21cJvpvgK+J3nsU2CmmixNBZx4vFj/w==", + "license": "MIT", "engines": { "node": ">=8.0.0" } @@ -5250,22 +6045,26 @@ "node_modules/buffer-equal-constant-time": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", + "license": "BSD-3-Clause" }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "license": "MIT" }, "node_modules/buffer-more-ints": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/buffer-more-ints/-/buffer-more-ints-1.0.0.tgz", - "integrity": "sha512-EMetuGFz5SLsT0QTnXzINh4Ksr+oo4i+UGTXEshiGCQWnsgSs7ZhJ8fzlwQ+OzEMs0MpDAMr1hxnblp5a4vcHg==" + "integrity": "sha512-EMetuGFz5SLsT0QTnXzINh4Ksr+oo4i+UGTXEshiGCQWnsgSs7ZhJ8fzlwQ+OzEMs0MpDAMr1hxnblp5a4vcHg==", + "license": "MIT" }, "node_modules/bundle-require": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/bundle-require/-/bundle-require-5.1.0.tgz", "integrity": "sha512-3WrrOuZiyaaZPWiEt4G3+IffISVC9HYlWueJEBWED4ZH4aIAC2PnkdnuRrR94M+w6yGWn4AglWtJtBI8YqvgoA==", + "license": "MIT", "dependencies": { "load-tsconfig": "^0.2.3" }, @@ -5291,31 +6090,76 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", "engines": { "node": ">= 0.8" } }, + "node_modules/c12": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/c12/-/c12-3.1.0.tgz", + "integrity": "sha512-uWoS8OU1MEIsOv8p/5a82c3H31LsWVR5qiyXVfBNOzfffjUWtPnhAb4BYI2uG2HfGmZmFjCtui5XNWaps+iFuw==", + "license": "MIT", + "dependencies": { + "chokidar": "^4.0.3", + "confbox": "^0.2.2", + "defu": "^6.1.4", + "dotenv": "^16.6.1", + "exsolve": "^1.0.7", + "giget": "^2.0.0", + "jiti": "^2.4.2", + "ohash": "^2.0.11", + "pathe": "^2.0.3", + "perfect-debounce": "^1.0.0", + "pkg-types": "^2.2.0", + "rc9": "^2.1.2" + }, + "peerDependencies": { + "magicast": "^0.3.5" + }, + "peerDependenciesMeta": { + "magicast": { + "optional": true + } + } + }, "node_modules/cac": { "version": "6.7.14", "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/cacheable": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/cacheable/-/cacheable-1.10.1.tgz", - "integrity": "sha512-Fa2BZY0CS9F0PFc/6aVA6tgpOdw+hmv9dkZOlHXII5v5Hw+meJBIWDcPrG9q/dXxGcNbym5t77fzmawrBQfTmQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cacheable/-/cacheable-2.2.0.tgz", + "integrity": "sha512-LEJxRqfeomiiRd2t0uON6hxAtgOoWDfY3fugebbz+J3vDLO+SkdfFChQcOHTZhj9SYa9iwE9MGYNX72dKiOE4w==", + "license": "MIT", "dependencies": { - "hookified": "^1.10.0", - "keyv": "^5.3.4" + "@cacheable/memory": "^2.0.5", + "@cacheable/utils": "^2.3.0", + "hookified": "^1.13.0", + "keyv": "^5.5.4", + "qified": "^0.5.2" + } + }, + "node_modules/cachedir": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/cachedir/-/cachedir-2.3.0.tgz", + "integrity": "sha512-A+Fezp4zxnit6FanDmv9EqXNAi3vt9DWp51/71UEhXukb7QUuvtv9344h91dyAxuTLoSYJFU299qzR3tzwPAhw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" } }, "node_modules/call-bind": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", + "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.0", "es-define-property": "^1.0.0", @@ -5333,6 +6177,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" @@ -5345,6 +6190,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.2", "get-intrinsic": "^1.3.0" @@ -5361,6 +6207,7 @@ "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -5369,30 +6216,36 @@ "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", + "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, + "license": "MIT", "engines": { - "node": ">=10" + "node": "^12.17.0 || ^14.13 || >=16.0.0" }, "funding": { "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true, + "license": "MIT" + }, "node_modules/cheerio": { "version": "1.0.0-rc.11", "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.11.tgz", "integrity": "sha512-bQwNaDIBKID5ts/DsdhxrjqFXYfLw4ste+wMKqWA8DyKcS4qwsPP4Bk8ZNaTJjvpiX/qW3BT4sU7d6Bh5i+dag==", + "license": "MIT", "dependencies": { "cheerio-select": "^2.1.0", "dom-serializer": "^2.0.0", @@ -5414,6 +6267,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", + "license": "BSD-2-Clause", "dependencies": { "boolbase": "^1.0.0", "css-select": "^5.1.0", @@ -5426,96 +6280,214 @@ "url": "https://github.com/sponsors/fb55" } }, + "node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/citty": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/citty/-/citty-0.1.6.tgz", + "integrity": "sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==", + "license": "MIT", + "dependencies": { + "consola": "^3.2.3" + } + }, "node_modules/cjs-module-lexer": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.4.3.tgz", - "integrity": "sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q==" + "integrity": "sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q==", + "license": "MIT" }, "node_modules/class-validator": { - "version": "0.14.2", - "resolved": "https://registry.npmjs.org/class-validator/-/class-validator-0.14.2.tgz", - "integrity": "sha512-3kMVRF2io8N8pY1IFIXlho9r8IPUUIfHe2hYVtiebvAzU2XeQFXTv+XI4WX+TnXmtwXMDcjngcpkiPM0O9PvLw==", + "version": "0.14.3", + "resolved": "https://registry.npmjs.org/class-validator/-/class-validator-0.14.3.tgz", + "integrity": "sha512-rXXekcjofVN1LTOSw+u4u9WXVEUvNBVjORW154q/IdmYWy1nMbOU9aNtZB0t8m+FJQ9q91jlr2f9CwwUFdFMRA==", + "license": "MIT", "dependencies": { - "@types/validator": "^13.11.8", + "@types/validator": "^13.15.3", "libphonenumber-js": "^1.11.1", - "validator": "^13.9.0" + "validator": "^13.15.20" } }, - "node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "node_modules/cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "license": "MIT", "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" + "restore-cursor": "^3.1.0" }, "engines": { - "node": ">=12" - } - }, - "node_modules/clone": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", - "integrity": "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==", - "engines": { - "node": ">=0.8" + "node": ">=8" } }, - "node_modules/cluster-key-slot": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.2.tgz", - "integrity": "sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==", + "node_modules/cli-spinners": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", + "dev": true, + "license": "MIT", "engines": { - "node": ">=0.10.0" + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/codec-parser": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/codec-parser/-/codec-parser-2.5.0.tgz", - "integrity": "sha512-Ru9t80fV8B0ZiixQl8xhMTLru+dzuis/KQld32/x5T/+3LwZb0/YvQdSKytX9JqCnRdiupvAvyYJINKrXieziQ==" - }, - "node_modules/color": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", - "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", + "node_modules/cli-truncate": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-5.1.1.tgz", + "integrity": "sha512-SroPvNHxUnk+vIW/dOSfNqdy1sPEFkrTk6TUtqLCnBlo3N7TNYYkzzN7uSD6+jVjrdO4+p8nH7JzH6cIvUem6A==", + "dev": true, + "license": "MIT", "dependencies": { - "color-convert": "^2.0.1", - "color-string": "^1.9.0" + "slice-ansi": "^7.1.0", + "string-width": "^8.0.0" }, "engines": { - "node": ">=12.5.0" + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/cli-truncate/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/cli-truncate/node_modules/string-width": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-8.1.0.tgz", + "integrity": "sha512-Kxl3KJGb/gxkaUMOjRsQ8IrXiGW75O4E3RPjFIINOVH8AMl2SQ/yWdTzWwF3FevIX9LcMAjJW+GRwAlAbTSXdg==", + "dev": true, + "license": "MIT", "dependencies": { - "color-name": "~1.1.4" + "get-east-asian-width": "^1.3.0", + "strip-ansi": "^7.1.0" }, "engines": { - "node": ">=7.0.0" + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "node_modules/cli-truncate/node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } }, - "node_modules/color-string": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", - "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "node_modules/cli-width": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", + "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 10" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/clone": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", + "integrity": "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==", + "license": "MIT", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/cluster-key-slot": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.2.tgz", + "integrity": "sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==", + "license": "Apache-2.0", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/codec-parser": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/codec-parser/-/codec-parser-2.5.0.tgz", + "integrity": "sha512-Ru9t80fV8B0ZiixQl8xhMTLru+dzuis/KQld32/x5T/+3LwZb0/YvQdSKytX9JqCnRdiupvAvyYJINKrXieziQ==", + "license": "LGPL-3.0-or-later" + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "license": "MIT", "dependencies": { - "color-name": "^1.0.0", - "simple-swizzle": "^0.2.2" + "color-name": "1.1.3" } }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true, + "license": "MIT" + }, + "node_modules/colorette": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", + "dev": true, + "license": "MIT" + }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", "dependencies": { "delayed-stream": "~1.0.0" }, @@ -5524,17 +6496,72 @@ } }, "node_modules/commander": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", - "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "version": "14.0.2", + "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.2.tgz", + "integrity": "sha512-TywoWNNRbhoD0BXs1P3ZEScW8W5iKrnbithIl0YH+uCmBd0QpPOA8yc82DS3BIE5Ma6FnBVUsJ7wVUDz4dvOWQ==", + "dev": true, + "license": "MIT", "engines": { - "node": ">= 6" + "node": ">=20" + } + }, + "node_modules/commitizen": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/commitizen/-/commitizen-4.3.1.tgz", + "integrity": "sha512-gwAPAVTy/j5YcOOebcCRIijn+mSjWJC+IYKivTu6aG8Ei/scoXgfsMRnuAk6b0GRste2J4NGxVdMN3ZpfNaVaw==", + "dev": true, + "license": "MIT", + "dependencies": { + "cachedir": "2.3.0", + "cz-conventional-changelog": "3.3.0", + "dedent": "0.7.0", + "detect-indent": "6.1.0", + "find-node-modules": "^2.1.2", + "find-root": "1.1.0", + "fs-extra": "9.1.0", + "glob": "7.2.3", + "inquirer": "8.2.5", + "is-utf8": "^0.2.1", + "lodash": "4.17.21", + "minimist": "1.2.7", + "strip-bom": "4.0.0", + "strip-json-comments": "3.1.1" + }, + "bin": { + "commitizen": "bin/commitizen", + "cz": "bin/git-cz", + "git-cz": "bin/git-cz" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/commitizen/node_modules/minimist": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", + "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/compare-func": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", + "integrity": "sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-ify": "^1.0.0", + "dot-prop": "^5.1.0" } }, "node_modules/compressible": { "version": "2.0.18", "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", + "license": "MIT", "dependencies": { "mime-db": ">= 1.43.0 < 2" }, @@ -5543,15 +6570,16 @@ } }, "node_modules/compression": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/compression/-/compression-1.8.0.tgz", - "integrity": "sha512-k6WLKfunuqCYD3t6AsuPGvQWaKwuLLh2/xHNcX4qE+vIfDNXpSqnrhwA7O53R7WVQUnt8dVAIW+YHr7xTgOgGA==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/compression/-/compression-1.8.1.tgz", + "integrity": "sha512-9mAqGPHLakhCLeNyxPkK4xVo746zQ/czLH1Ky+vkitMnWfWZps8r0qXuwhwizagCRttsL4lfG4pIOvaWLpAP0w==", + "license": "MIT", "dependencies": { "bytes": "3.1.2", "compressible": "~2.0.18", "debug": "2.6.9", "negotiator": "~0.6.4", - "on-headers": "~1.0.2", + "on-headers": "~1.1.0", "safe-buffer": "5.2.1", "vary": "~1.1.2" }, @@ -5563,6 +6591,7 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", "dependencies": { "ms": "2.0.0" } @@ -5570,69 +6599,42 @@ "node_modules/compression/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", + "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", "engines": [ - "node >= 0.8" + "node >= 6.0" ], + "license": "MIT", "dependencies": { "buffer-from": "^1.0.0", "inherits": "^2.0.3", - "readable-stream": "^2.2.2", + "readable-stream": "^3.0.2", "typedarray": "^0.0.6" } }, - "node_modules/concat-stream/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" - }, - "node_modules/concat-stream/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/concat-stream/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "node_modules/concat-stream/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/confbox": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz", - "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==" + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.2.2.tgz", + "integrity": "sha512-1NB+BKqhtNipMsov4xI/NnhCKp9XG9NamYp5PVm9klAT0fsrNPjaFICsCFhNhwZJKNh7zB/3q8qXz0E9oaMNtQ==", + "license": "MIT" }, "node_modules/consola": { "version": "3.4.2", "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", + "license": "MIT", "engines": { "node": "^14.18.0 || >=16.10.0" } @@ -5641,6 +6643,7 @@ "version": "0.5.4", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "license": "MIT", "dependencies": { "safe-buffer": "5.2.1" }, @@ -5652,14 +6655,68 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", "engines": { "node": ">= 0.6" } }, + "node_modules/conventional-changelog-angular": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-7.0.0.tgz", + "integrity": "sha512-ROjNchA9LgfNMTTFSIWPzebCwOGFdgkEq45EnvvrmSLvCtAw0HSmrCs7/ty+wAeYUZyNay0YMUNYFTRL72PkBQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "compare-func": "^2.0.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/conventional-changelog-conventionalcommits": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-7.0.2.tgz", + "integrity": "sha512-NKXYmMR/Hr1DevQegFB4MwfM5Vv0m4UIxKZTTYuD98lpTknaZlSRrDOG4X7wIXpGkfsYxZTghUN+Qq+T0YQI7w==", + "dev": true, + "license": "ISC", + "dependencies": { + "compare-func": "^2.0.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/conventional-commit-types": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/conventional-commit-types/-/conventional-commit-types-3.0.0.tgz", + "integrity": "sha512-SmmCYnOniSsAa9GqWOeLqc179lfr5TRu5b4QFDkbsrJ5TZjPJx85wtOr3zn+1dbeNiXDKGPbZ72IKbPhLXh/Lg==", + "dev": true, + "license": "ISC" + }, + "node_modules/conventional-commits-parser": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-5.0.0.tgz", + "integrity": "sha512-ZPMl0ZJbw74iS9LuX9YIAiW8pfM5p3yh2o/NbXHbkFuZzY5jvdi5jFycEOkmBW5H5I7nA+D6f3UcsCLP2vvSEA==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-text-path": "^2.0.0", + "JSONStream": "^1.3.5", + "meow": "^12.0.1", + "split2": "^4.0.0" + }, + "bin": { + "conventional-commits-parser": "cli.mjs" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/cookie": { "version": "0.7.1", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -5667,17 +6724,14 @@ "node_modules/cookie-signature": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" - }, - "node_modules/core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", + "license": "MIT" }, "node_modules/cors": { "version": "2.8.5", "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "license": "MIT", "dependencies": { "object-assign": "^4", "vary": "^1" @@ -5686,10 +6740,57 @@ "node": ">= 0.10" } }, + "node_modules/cosmiconfig": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-9.0.0.tgz", + "integrity": "sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==", + "dev": true, + "license": "MIT", + "dependencies": { + "env-paths": "^2.2.1", + "import-fresh": "^3.3.0", + "js-yaml": "^4.1.0", + "parse-json": "^5.2.0" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/d-fischer" + }, + "peerDependencies": { + "typescript": ">=4.9.5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/cosmiconfig-typescript-loader": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-6.2.0.tgz", + "integrity": "sha512-GEN39v7TgdxgIoNcdkRE3uiAzQt3UXLyHbRHD6YoL048XAeOomyxaP+Hh/+2C6C2wYjxJ2onhJcsQp+L4YEkVQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "jiti": "^2.6.1" + }, + "engines": { + "node": ">=v18" + }, + "peerDependencies": { + "@types/node": "*", + "cosmiconfig": ">=9", + "typescript": ">=5" + } + }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -5703,6 +6804,7 @@ "version": "5.2.2", "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.2.2.tgz", "integrity": "sha512-TizTzUddG/xYLA3NXodFM0fSbNizXjOKhqiQQwvhlspadZokn1KDy0NZFS0wuEubIYAV5/c1/lAr0TaaFXEXzw==", + "license": "BSD-2-Clause", "dependencies": { "boolbase": "^1.0.0", "css-what": "^6.1.0", @@ -5718,6 +6820,7 @@ "version": "6.2.2", "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.2.2.tgz", "integrity": "sha512-u/O3vwbptzhMs3L1fQE82ZSLHQQfto5gyZzwteVIEyeaY5Fc7R4dapF/BvRoSYFeqfBk4m0V1Vafq5Pjv25wvA==", + "license": "BSD-2-Clause", "engines": { "node": ">= 6" }, @@ -5731,45 +6834,120 @@ "integrity": "sha512-axn2UMEnkhyDUPWOwVKBMVIzSQy2ejH2xRGy1wq81dqRwApXfIzfbE3hIX0ZRFBIihf/KDqK158DLwESu4AK1w==", "license": "MIT" }, - "node_modules/data-view-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", - "integrity": "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==", + "node_modules/cz-conventional-changelog": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/cz-conventional-changelog/-/cz-conventional-changelog-3.3.0.tgz", + "integrity": "sha512-U466fIzU5U22eES5lTNiNbZ+d8dfcHcssH4o7QsdWaCcRs/feIPCxKYSWkYBNs5mny7MvEfwpTLWjvbm94hecw==", "dev": true, + "license": "MIT", "dependencies": { - "call-bound": "^1.0.3", - "es-errors": "^1.3.0", - "is-data-view": "^1.0.2" + "chalk": "^2.4.1", + "commitizen": "^4.0.3", + "conventional-commit-types": "^3.0.0", + "lodash.map": "^4.5.1", + "longest": "^2.0.1", + "word-wrap": "^1.0.3" }, "engines": { - "node": ">= 0.4" + "node": ">= 10" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "optionalDependencies": { + "@commitlint/load": ">6.1.1" } }, - "node_modules/data-view-byte-length": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz", - "integrity": "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==", + "node_modules/cz-conventional-changelog/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, + "license": "MIT", "dependencies": { - "call-bound": "^1.0.3", - "es-errors": "^1.3.0", - "is-data-view": "^1.0.2" + "color-convert": "^1.9.0" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/inspect-js" + "node": ">=4" } }, - "node_modules/data-view-byte-offset": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz", - "integrity": "sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==", + "node_modules/cz-conventional-changelog/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/cz-conventional-changelog/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/dargs": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/dargs/-/dargs-8.1.0.tgz", + "integrity": "sha512-wAV9QHOsNbwnWdNW2FYvE1P56wtgSbM+3SZcdGiWQILwVjACCXDCI3Ai8QlCjMDB8YK5zySiXZYBiwGmNY3lnw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/data-view-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", + "integrity": "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz", + "integrity": "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/inspect-js" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz", + "integrity": "sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==", + "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", @@ -5783,14 +6961,16 @@ } }, "node_modules/dayjs": { - "version": "1.11.13", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.13.tgz", - "integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==" + "version": "1.11.19", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.19.tgz", + "integrity": "sha512-t5EcLVS6QPBNqM2z8fakk/NKel+Xzshgt8FFKAn+qwlD1pzZWxh0nVCrvFK7ZDb6XucZeF9z8C7CBWTRIVApAw==", + "license": "MIT" }, "node_modules/debug": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", - "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", "dependencies": { "ms": "^2.1.3" }, @@ -5807,6 +6987,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -5815,20 +6996,62 @@ "version": "0.2.2", "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==", + "license": "MIT", "engines": { "node": ">=0.10" } }, + "node_modules/dedent": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==", + "dev": true, + "license": "MIT" + }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true + "dev": true, + "license": "MIT" + }, + "node_modules/deepmerge-ts": { + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/deepmerge-ts/-/deepmerge-ts-7.1.5.tgz", + "integrity": "sha512-HOJkrhaYsweh+W+e74Yn7YStZOilkoPb6fycpwNLKzSPtruFs48nYis0zy5yJz1+ktUhHxoRDJ27RQAWLIJVJw==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/defaults": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "clone": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/defaults/node_modules/clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8" + } }, "node_modules/define-data-property": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "license": "MIT", "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", @@ -5846,6 +7069,7 @@ "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", "dev": true, + "license": "MIT", "dependencies": { "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", @@ -5858,10 +7082,17 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/defu": { + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.4.tgz", + "integrity": "sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==", + "license": "MIT" + }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", "engines": { "node": ">=0.4.0" } @@ -5870,23 +7101,52 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", "engines": { "node": ">= 0.8" } }, + "node_modules/destr": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/destr/-/destr-2.0.5.tgz", + "integrity": "sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==", + "license": "MIT" + }, "node_modules/destroy": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "license": "MIT", "engines": { "node": ">= 0.8", "npm": "1.2.8000 || >= 1.4.16" } }, + "node_modules/detect-file": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", + "integrity": "sha512-DtCOLG98P007x7wiiOmfI0fi3eIKyWiLTGJ2MDnVi/E04lWGbf+JzrRHMm0rgIIZJGtHpKpbVgLWHrv8xXpc3Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/detect-indent": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.1.0.tgz", + "integrity": "sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/detect-libc": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.4.tgz", - "integrity": "sha512-3UDv+G9CsCKO1WKMGw9fwq/SWJYbI0c5Y7LU1AXYoDdbhE2AHQ6N6Nb34sG8Fj7T5APy8qXDCKuuIHd1BR0tVA==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "license": "Apache-2.0", "engines": { "node": ">=8" } @@ -5894,25 +7154,15 @@ "node_modules/dijkstrajs": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.3.tgz", - "integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==" - }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } + "integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==", + "license": "MIT" }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, + "license": "Apache-2.0", "dependencies": { "esutils": "^2.0.2" }, @@ -5924,6 +7174,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "license": "MIT", "dependencies": { "domelementtype": "^2.3.0", "domhandler": "^5.0.2", @@ -5942,12 +7193,14 @@ "type": "github", "url": "https://github.com/sponsors/fb55" } - ] + ], + "license": "BSD-2-Clause" }, "node_modules/domhandler": { "version": "5.0.3", "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "license": "BSD-2-Clause", "dependencies": { "domelementtype": "^2.3.0" }, @@ -5962,6 +7215,7 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.2.2.tgz", "integrity": "sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==", + "license": "BSD-2-Clause", "dependencies": { "dom-serializer": "^2.0.0", "domelementtype": "^2.3.0", @@ -5971,10 +7225,24 @@ "url": "https://github.com/fb55/domutils?sponsor=1" } }, + "node_modules/dot-prop": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", + "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-obj": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/dotenv": { "version": "16.6.1", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz", "integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==", + "license": "BSD-2-Clause", "engines": { "node": ">=12" }, @@ -5986,6 +7254,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.1", "es-errors": "^1.3.0", @@ -5995,15 +7264,11 @@ "node": ">= 0.4" } }, - "node_modules/eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" - }, "node_modules/ecdsa-sig-formatter": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "license": "Apache-2.0", "dependencies": { "safe-buffer": "^5.0.1" } @@ -6011,18 +7276,39 @@ "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/effect": { + "version": "3.18.4", + "resolved": "https://registry.npmjs.org/effect/-/effect-3.18.4.tgz", + "integrity": "sha512-b1LXQJLe9D11wfnOKAk3PKxuqYshQ0Heez+y5pnkd3jLj1yx9QhM72zZ9uUrOQyNvrs2GZZd/3maL0ZV18YuDA==", + "license": "MIT", + "dependencies": { + "@standard-schema/spec": "^1.0.0", + "fast-check": "^3.23.1" + } }, "node_modules/emoji-regex": { - "version": "10.4.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz", - "integrity": "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==", + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", + "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", "license": "MIT" }, + "node_modules/empathic": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/empathic/-/empathic-2.0.0.tgz", + "integrity": "sha512-i6UzDscO/XfAcNYD75CfICkmfLedpyPDdozrLMmQc5ORaQcdMoc21OnlEylMIqI7U8eniKrPMxxtj8k0vhmJhA==", + "license": "MIT", + "engines": { + "node": ">=14" + } + }, "node_modules/encodeurl": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", "engines": { "node": ">= 0.8" } @@ -6031,6 +7317,7 @@ "version": "6.6.4", "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.6.4.tgz", "integrity": "sha512-ZCkIjSYNDyGn0R6ewHDtXgns/Zre/NT6Agvq1/WobF7JXgFff4SeDroKiCO3fNJreU9YG429Sc81o4w5ok/W5g==", + "license": "MIT", "dependencies": { "@types/cors": "^2.8.12", "@types/node": ">=10.0.0", @@ -6050,6 +7337,7 @@ "version": "6.6.3", "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.6.3.tgz", "integrity": "sha512-T0iLjnyNWahNyv/lcjS2y4oE358tVS/SYQNxYXGAJ9/GLgH4VCvOQ/mhTjqU88mLZCQgiG8RIegFHYCdVC+j5w==", + "license": "MIT", "dependencies": { "@socket.io/component-emitter": "~3.1.0", "debug": "~4.3.1", @@ -6062,6 +7350,7 @@ "version": "4.3.7", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "license": "MIT", "dependencies": { "ms": "^2.1.3" }, @@ -6078,6 +7367,7 @@ "version": "8.17.1", "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", + "license": "MIT", "engines": { "node": ">=10.0.0" }, @@ -6098,6 +7388,7 @@ "version": "5.2.3", "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.3.tgz", "integrity": "sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q==", + "license": "MIT", "engines": { "node": ">=10.0.0" } @@ -6106,6 +7397,7 @@ "version": "0.7.2", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -6114,6 +7406,7 @@ "version": "4.3.7", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "license": "MIT", "dependencies": { "ms": "^2.1.3" }, @@ -6130,6 +7423,7 @@ "version": "8.17.1", "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", + "license": "MIT", "engines": { "node": ">=10.0.0" }, @@ -6150,6 +7444,7 @@ "version": "4.5.0", "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "license": "BSD-2-Clause", "engines": { "node": ">=0.12" }, @@ -6157,11 +7452,45 @@ "url": "https://github.com/fb55/entities?sponsor=1" } }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/environment": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz", + "integrity": "sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/error-ex": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.4.tgz", + "integrity": "sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, "node_modules/es-abstract": { "version": "1.24.0", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.24.0.tgz", "integrity": "sha512-WSzPgsdLtTcQwm4CROfS5ju2Wa1QQcVeT37jFjYzdFz1r9ahadC8B8/a4qxJxM+09F18iumCdRmlr96ZYkQvEg==", "dev": true, + "license": "MIT", "dependencies": { "array-buffer-byte-length": "^1.0.2", "arraybuffer.prototype.slice": "^1.0.4", @@ -6229,6 +7558,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", "engines": { "node": ">= 0.4" } @@ -6237,6 +7567,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", "engines": { "node": ">= 0.4" } @@ -6245,6 +7576,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", "dependencies": { "es-errors": "^1.3.0" }, @@ -6256,6 +7588,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "get-intrinsic": "^1.2.6", @@ -6271,6 +7604,7 @@ "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.1.0.tgz", "integrity": "sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw==", "dev": true, + "license": "MIT", "dependencies": { "hasown": "^2.0.2" }, @@ -6283,6 +7617,7 @@ "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.3.0.tgz", "integrity": "sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==", "dev": true, + "license": "MIT", "dependencies": { "is-callable": "^1.2.7", "is-date-object": "^1.0.5", @@ -6296,10 +7631,11 @@ } }, "node_modules/esbuild": { - "version": "0.25.6", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.6.tgz", - "integrity": "sha512-GVuzuUwtdsghE3ocJ9Bs8PNoF13HNQ5TXbEi2AhvVb8xU1Iwt9Fos9FEamfoee+u/TOsn7GUWc04lz46n2bbTg==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.0.tgz", + "integrity": "sha512-jd0f4NHbD6cALCyGElNpGAOtWxSq46l9X/sWB0Nzd5er4Kz2YTm+Vl0qKFT9KUJvD8+fiO8AvoHhFvEatfVixA==", "hasInstallScript": true, + "license": "MIT", "bin": { "esbuild": "bin/esbuild" }, @@ -6307,38 +7643,39 @@ "node": ">=18" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.25.6", - "@esbuild/android-arm": "0.25.6", - "@esbuild/android-arm64": "0.25.6", - "@esbuild/android-x64": "0.25.6", - "@esbuild/darwin-arm64": "0.25.6", - "@esbuild/darwin-x64": "0.25.6", - "@esbuild/freebsd-arm64": "0.25.6", - "@esbuild/freebsd-x64": "0.25.6", - "@esbuild/linux-arm": "0.25.6", - "@esbuild/linux-arm64": "0.25.6", - "@esbuild/linux-ia32": "0.25.6", - "@esbuild/linux-loong64": "0.25.6", - "@esbuild/linux-mips64el": "0.25.6", - "@esbuild/linux-ppc64": "0.25.6", - "@esbuild/linux-riscv64": "0.25.6", - "@esbuild/linux-s390x": "0.25.6", - "@esbuild/linux-x64": "0.25.6", - "@esbuild/netbsd-arm64": "0.25.6", - "@esbuild/netbsd-x64": "0.25.6", - "@esbuild/openbsd-arm64": "0.25.6", - "@esbuild/openbsd-x64": "0.25.6", - "@esbuild/openharmony-arm64": "0.25.6", - "@esbuild/sunos-x64": "0.25.6", - "@esbuild/win32-arm64": "0.25.6", - "@esbuild/win32-ia32": "0.25.6", - "@esbuild/win32-x64": "0.25.6" + "@esbuild/aix-ppc64": "0.27.0", + "@esbuild/android-arm": "0.27.0", + "@esbuild/android-arm64": "0.27.0", + "@esbuild/android-x64": "0.27.0", + "@esbuild/darwin-arm64": "0.27.0", + "@esbuild/darwin-x64": "0.27.0", + "@esbuild/freebsd-arm64": "0.27.0", + "@esbuild/freebsd-x64": "0.27.0", + "@esbuild/linux-arm": "0.27.0", + "@esbuild/linux-arm64": "0.27.0", + "@esbuild/linux-ia32": "0.27.0", + "@esbuild/linux-loong64": "0.27.0", + "@esbuild/linux-mips64el": "0.27.0", + "@esbuild/linux-ppc64": "0.27.0", + "@esbuild/linux-riscv64": "0.27.0", + "@esbuild/linux-s390x": "0.27.0", + "@esbuild/linux-x64": "0.27.0", + "@esbuild/netbsd-arm64": "0.27.0", + "@esbuild/netbsd-x64": "0.27.0", + "@esbuild/openbsd-arm64": "0.27.0", + "@esbuild/openbsd-x64": "0.27.0", + "@esbuild/openharmony-arm64": "0.27.0", + "@esbuild/sunos-x64": "0.27.0", + "@esbuild/win32-arm64": "0.27.0", + "@esbuild/win32-ia32": "0.27.0", + "@esbuild/win32-x64": "0.27.0" } }, "node_modules/escalade": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "license": "MIT", "engines": { "node": ">=6" } @@ -6346,13 +7683,15 @@ "node_modules/escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" }, "node_modules/escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -6366,6 +7705,7 @@ "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -6417,13 +7757,17 @@ } }, "node_modules/eslint-config-prettier": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", - "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", + "version": "10.1.8", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.8.tgz", + "integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==", "dev": true, + "license": "MIT", "bin": { "eslint-config-prettier": "bin/cli.js" }, + "funding": { + "url": "https://opencollective.com/eslint-config-prettier" + }, "peerDependencies": { "eslint": ">=7.0.0" } @@ -6433,6 +7777,7 @@ "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", "dev": true, + "license": "MIT", "dependencies": { "debug": "^3.2.7", "is-core-module": "^2.13.0", @@ -6444,6 +7789,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, + "license": "MIT", "dependencies": { "ms": "^2.1.1" } @@ -6453,6 +7799,7 @@ "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.12.1.tgz", "integrity": "sha512-L8jSWTze7K2mTg0vos/RuLRS5soomksDPoJLXIslC7c8Wmut3bx7CPpJijDcBZtxQ5lrbUdM+s0OlNbz0DCDNw==", "dev": true, + "license": "MIT", "dependencies": { "debug": "^3.2.7" }, @@ -6470,6 +7817,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, + "license": "MIT", "dependencies": { "ms": "^2.1.1" } @@ -6479,6 +7827,7 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.32.0.tgz", "integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==", "dev": true, + "license": "MIT", "dependencies": { "@rtsao/scc": "^1.1.0", "array-includes": "^3.1.9", @@ -6512,6 +7861,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -6522,6 +7872,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, + "license": "MIT", "dependencies": { "ms": "^2.1.1" } @@ -6531,6 +7882,7 @@ "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "dev": true, + "license": "Apache-2.0", "dependencies": { "esutils": "^2.0.2" }, @@ -6543,6 +7895,7 @@ "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dev": true, + "license": "MIT", "dependencies": { "minimist": "^1.2.0" }, @@ -6555,6 +7908,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -6567,15 +7921,27 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver.js" } }, + "node_modules/eslint-plugin-import/node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, "node_modules/eslint-plugin-import/node_modules/tsconfig-paths": { "version": "3.15.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", "dev": true, + "license": "MIT", "dependencies": { "@types/json5": "^0.0.29", "json5": "^1.0.2", @@ -6584,10 +7950,11 @@ } }, "node_modules/eslint-plugin-prettier": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.1.tgz", - "integrity": "sha512-dobTkHT6XaEVOo8IO90Q4DOSxnm3Y151QxPJlM/vKC0bVy+d6cVWQZLlFiuZPP0wS6vZwSKeJgKkcS+KfMBlRw==", + "version": "5.5.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.4.tgz", + "integrity": "sha512-swNtI95SToIz05YINMA6Ox5R057IMAmWZ26GqPxusAp1TZzj+IdY9tXNWWD3vkF/wEqydCONcwjTFpxybBqZsg==", "dev": true, + "license": "MIT", "dependencies": { "prettier-linter-helpers": "^1.0.0", "synckit": "^0.11.7" @@ -6614,10 +7981,11 @@ } }, "node_modules/eslint-plugin-simple-import-sort": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-10.0.0.tgz", - "integrity": "sha512-AeTvO9UCMSNzIHRkg8S6c3RPy5YEwKWSQPx3DYghLedo2ZQxowPFLGDN1AZ2evfg6r6mjBSZSLxLFsWSu3acsw==", + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-12.1.1.tgz", + "integrity": "sha512-6nuzu4xwQtE3332Uz0to+TxDQYRLTKRESSc2hefVT48Zc8JthmN23Gx9lnYhu0FtkRSL1oxny3kJ2aveVhmOVA==", "dev": true, + "license": "MIT", "peerDependencies": { "eslint": ">=5.0.0" } @@ -6627,6 +7995,7 @@ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" @@ -6643,6 +8012,7 @@ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true, + "license": "Apache-2.0", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -6650,21 +8020,153 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint/node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "node_modules/eslint/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, + "license": "MIT", "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/eslint/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "node_modules/eslint/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/eslint/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/eslint/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/eslint/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/eslint/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/eslint/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/eslint/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -6672,11 +8174,80 @@ "node": "*" } }, + "node_modules/eslint/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/espree": { "version": "9.6.1", "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "acorn": "^8.9.0", "acorn-jsx": "^5.3.2", @@ -6694,6 +8265,7 @@ "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "estraverse": "^5.1.0" }, @@ -6706,6 +8278,7 @@ "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "estraverse": "^5.2.0" }, @@ -6718,6 +8291,7 @@ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, + "license": "BSD-2-Clause", "engines": { "node": ">=4.0" } @@ -6727,6 +8301,7 @@ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true, + "license": "BSD-2-Clause", "engines": { "node": ">=0.10.0" } @@ -6735,6 +8310,7 @@ "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -6743,6 +8319,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "license": "MIT", "engines": { "node": ">=6" } @@ -6750,17 +8327,20 @@ "node_modules/eventemitter2": { "version": "6.4.9", "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.9.tgz", - "integrity": "sha512-JEPTiaOt9f04oa6NOkc4aH+nVp5I3wEjpHbIPqfgCdD5v5bUzy7xQqwcVO2aDQgOWhI28da57HksMrzK9HlRxg==" + "integrity": "sha512-JEPTiaOt9f04oa6NOkc4aH+nVp5I3wEjpHbIPqfgCdD5v5bUzy7xQqwcVO2aDQgOWhI28da57HksMrzK9HlRxg==", + "license": "MIT" }, "node_modules/eventemitter3": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", - "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==" + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", + "license": "MIT" }, "node_modules/events": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "license": "MIT", "engines": { "node": ">=0.8.x" } @@ -6770,10 +8350,24 @@ "resolved": "https://registry.npmjs.org/exif-parser/-/exif-parser-0.1.12.tgz", "integrity": "sha512-c2bQfLNbMzLPmzQuOr8fy0csy84WmwnER81W88DzTp9CYNPJ6yzOj2EZAh9pywYpqHnshVLHQJ8WzldAyfY+Iw==" }, + "node_modules/expand-tilde": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha512-A5EmesHW6rfnZ9ysHQjPdJRni0SRar0tjtG5MNtm9n5TUvsYU8oozprtRD4AqHxcZWWlVuAmQo2nWKfN9oyjTw==", + "dev": true, + "license": "MIT", + "dependencies": { + "homedir-polyfill": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/express": { "version": "4.21.2", "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", + "license": "MIT", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", @@ -6819,6 +8413,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/express-async-errors/-/express-async-errors-3.1.1.tgz", "integrity": "sha512-h6aK1da4tpqWSbyCa3FxB/V6Ehd4EEB15zyQq9qe75OZBp0krinNKuH4rAY+S/U/2I36vdLAUFSjQJ+TFmODng==", + "license": "ISC", "peerDependencies": { "express": "^4.16.2" } @@ -6827,6 +8422,7 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", "dependencies": { "ms": "2.0.0" } @@ -6834,25 +8430,72 @@ "node_modules/express/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/exsolve": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/exsolve/-/exsolve-1.0.8.tgz", + "integrity": "sha512-LmDxfWXwcTArk8fUEnOfSZpHOJ6zOMUJKOtFLFqJLoKJetuQG874Uc7/Kki7zFLzYybmZhp1M7+98pfMqeX8yA==", + "license": "MIT" + }, + "node_modules/external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dev": true, + "license": "MIT", + "dependencies": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/fast-check": { + "version": "3.23.2", + "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-3.23.2.tgz", + "integrity": "sha512-h5+1OzzfCC3Ef7VbtKdcv7zsstUQwUDlYpUTvjeUsJAssPgLn7QzbboPtL5ro04Mq0rPOsMzl7q5hIbRs2wD1A==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ], + "license": "MIT", + "dependencies": { + "pure-rand": "^6.1.0" + }, + "engines": { + "node": ">=8.0.0" + } }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fast-diff": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", - "dev": true + "dev": true, + "license": "Apache-2.0" }, "node_modules/fast-glob": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -6869,6 +8512,7 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, + "license": "ISC", "dependencies": { "is-glob": "^4.0.1" }, @@ -6880,38 +8524,46 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true + "dev": true, + "license": "MIT" }, - "node_modules/fast-redact": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.5.0.tgz", - "integrity": "sha512-dwsoQlS7h9hMeYUq1W++23NDcBLV4KqONnITDV9DjfS3q1SgDGVrBdvvTLUotWtPSD7asWDV9/CmsZPy8Hf70A==", - "engines": { - "node": ">=6" - } + "node_modules/fast-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz", + "integrity": "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause" }, "node_modules/fast-xml-parser": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz", - "integrity": "sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw==", + "version": "5.2.5", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.2.5.tgz", + "integrity": "sha512-pfX9uG9Ki0yekDHx2SiuRIyFdyAr1kMIMitPvb0YBo8SUfKvia7w7FIyd/l6av85pFYRhZscS75MwMnbvY+hcQ==", "funding": [ { "type": "github", "url": "https://github.com/sponsors/NaturalIntelligence" - }, - { - "type": "paypal", - "url": "https://paypal.me/naturalintelligence" } ], + "license": "MIT", "dependencies": { - "strnum": "^1.0.5" + "strnum": "^2.1.0" }, "bin": { "fxparser": "src/cli/cli.js" @@ -6922,21 +8574,53 @@ "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", "dev": true, + "license": "ISC", "dependencies": { "reusify": "^1.0.4" } }, - "node_modules/fflate": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz", - "integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==", - "license": "MIT" - }, - "node_modules/file-entry-cache": { - "version": "6.0.1", + "node_modules/fetch-socks": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fetch-socks/-/fetch-socks-1.3.2.tgz", + "integrity": "sha512-vkH5+Zgj2yEbU57Cei0iyLgTZ4OkEKJj56Xu3ViB5dpsl599JgEooQ3x6NVagIFRHWnWJ+7K0MO0aIV1TMgvnw==", + "license": "MIT", + "dependencies": { + "socks": "^2.8.2", + "undici": ">=6" + } + }, + "node_modules/figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/figures/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", "dev": true, + "license": "MIT", "dependencies": { "flat-cache": "^3.0.4" }, @@ -6948,6 +8632,7 @@ "version": "16.5.4", "resolved": "https://registry.npmjs.org/file-type/-/file-type-16.5.4.tgz", "integrity": "sha512-/yFHK0aGjFEgDJjEKP0pWCplsPFPhwyfwevf/pVxiN0tmE4L9LmwWxWukdJSHdoCli4VgQLehjJtwQBnqmsKcw==", + "license": "MIT", "dependencies": { "readable-web-to-node-stream": "^3.0.0", "strtok3": "^6.2.4", @@ -6965,6 +8650,7 @@ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, + "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -6976,6 +8662,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-1.1.0.tgz", "integrity": "sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -6984,6 +8671,7 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", + "license": "MIT", "dependencies": { "debug": "2.6.9", "encodeurl": "~2.0.0", @@ -7001,6 +8689,7 @@ "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", "dependencies": { "ms": "2.0.0" } @@ -7008,28 +8697,66 @@ "node_modules/finalhandler/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/find-node-modules": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/find-node-modules/-/find-node-modules-2.1.3.tgz", + "integrity": "sha512-UC2I2+nx1ZuOBclWVNdcnbDR5dlrOdVb7xNjmT/lHE+LsgztWks3dG7boJ37yTS/venXw84B/mAW9uHVoC5QRg==", + "dev": true, + "license": "MIT", + "dependencies": { + "findup-sync": "^4.0.0", + "merge": "^2.1.1" + } + }, + "node_modules/find-root": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", + "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==", + "dev": true, + "license": "MIT" }, "node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-7.0.0.tgz", + "integrity": "sha512-YyZM99iHrqLKjmt4LJDj58KI+fYyufRLBSYcqycxf//KpBk9FoewoGX0450m9nB44qrZnovzC2oeP5hUibxc/g==", "dev": true, + "license": "MIT", "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" + "locate-path": "^7.2.0", + "path-exists": "^5.0.0", + "unicorn-magic": "^0.1.0" }, "engines": { - "node": ">=10" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/findup-sync": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-4.0.0.tgz", + "integrity": "sha512-6jvvn/12IC4quLBL1KNokxC7wWTvYncaVUYSoxWw7YykPLuRrnv4qdHcSOywOI5RpkOVGeQRtWM8/q+G6W6qfQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "detect-file": "^1.0.0", + "is-glob": "^4.0.0", + "micromatch": "^4.0.2", + "resolve-dir": "^1.0.1" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/fix-dts-default-cjs-exports": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/fix-dts-default-cjs-exports/-/fix-dts-default-cjs-exports-1.0.1.tgz", "integrity": "sha512-pVIECanWFC61Hzl2+oOCtoJ3F17kglZC/6N94eRWycFgBH35hHx0Li604ZIzhseh97mf2p0cv7vVrOZGoqhlEg==", + "license": "MIT", "dependencies": { "magic-string": "^0.30.17", "mlly": "^1.7.4", @@ -7041,6 +8768,7 @@ "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", "dev": true, + "license": "MIT", "dependencies": { "flatted": "^3.2.9", "keyv": "^4.5.3", @@ -7055,6 +8783,7 @@ "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "dev": true, + "license": "MIT", "dependencies": { "json-buffer": "3.0.1" } @@ -7063,13 +8792,15 @@ "version": "3.3.3", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/fluent-ffmpeg": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/fluent-ffmpeg/-/fluent-ffmpeg-2.1.3.tgz", "integrity": "sha512-Be3narBNt2s6bsaqP6Jzq91heDgOEaDCJAXcE3qcma/EJBSy5FB4cvO31XBInuAuKBx8Kptf8dkhjK0IOru39Q==", "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "license": "MIT", "dependencies": { "async": "^0.2.9", "which": "^1.1.1" @@ -7082,6 +8813,7 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, @@ -7090,15 +8822,16 @@ } }, "node_modules/follow-redirects": { - "version": "1.15.9", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", - "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", + "version": "1.15.11", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz", + "integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==", "funding": [ { "type": "individual", "url": "https://github.com/sponsors/RubenVerborgh" } ], + "license": "MIT", "engines": { "node": ">=4.0" }, @@ -7112,6 +8845,7 @@ "version": "0.3.5", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", + "license": "MIT", "dependencies": { "is-callable": "^1.2.7" }, @@ -7122,25 +8856,11 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/foreground-child": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", - "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", - "dependencies": { - "cross-spawn": "^7.0.6", - "signal-exit": "^4.0.1" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/form-data": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.3.tgz", - "integrity": "sha512-qsITQPfmvMOSAdeyZ+12I1c+CKSstAFAwu+97zrnWAbIr5u8wfsExUzCesVLC8NgHuRUqNN4Zy6UPWUTRGslcA==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz", + "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==", + "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -7155,12 +8875,14 @@ "node_modules/form-data-encoder": { "version": "1.7.2", "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-1.7.2.tgz", - "integrity": "sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A==" + "integrity": "sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A==", + "license": "MIT" }, "node_modules/formdata-node": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/formdata-node/-/formdata-node-4.4.1.tgz", "integrity": "sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ==", + "license": "MIT", "dependencies": { "node-domexception": "1.0.0", "web-streams-polyfill": "4.0.0-beta.3" @@ -7173,6 +8895,7 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -7180,27 +8903,47 @@ "node_modules/forwarded-parse": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/forwarded-parse/-/forwarded-parse-2.1.2.tgz", - "integrity": "sha512-alTFZZQDKMporBH77856pXgzhEzaUVmLCDk+egLgIgHst3Tpndzz8MnKe+GzRJRfvVdn69HhpW7cmXzvtLvJAw==" + "integrity": "sha512-alTFZZQDKMporBH77856pXgzhEzaUVmLCDk+egLgIgHst3Tpndzz8MnKe+GzRJRfvVdn69HhpW7cmXzvtLvJAw==", + "license": "MIT" }, "node_modules/fresh": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "license": "MIT", "engines": { "node": ">= 0.6" } }, + "node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "hasInstallScript": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -7213,6 +8956,7 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -7222,6 +8966,7 @@ "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.8.tgz", "integrity": "sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", @@ -7242,14 +8987,25 @@ "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", "dev": true, + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/generator-function": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/generator-function/-/generator-function-2.0.1.tgz", + "integrity": "sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/generic-pool": { "version": "3.9.0", "resolved": "https://registry.npmjs.org/generic-pool/-/generic-pool-3.9.0.tgz", "integrity": "sha512-hymDOu5B53XvN4QT9dBmZxPX4CWhBPPLguTZ9MMFeFa/Kg0xWVfylOVNlJji/E7yTZWFd/q9GO5TxDLq156D7g==", + "license": "MIT", "engines": { "node": ">= 4" } @@ -7258,14 +9014,28 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "license": "ISC", "engines": { "node": "6.* || 8.* || >= 10.*" } }, + "node_modules/get-east-asian-width": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.4.0.tgz", + "integrity": "sha512-QZjmEOC+IT1uk6Rx0sX22V6uHWVwbdbxf1faPqJ1QhLdGgsRGCZoyaQBm/piRdJy/D2um6hM1UP7ZEeQ4EkP+Q==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/get-intrinsic": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", @@ -7289,6 +9059,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", "dependencies": { "dunder-proto": "^1.0.1", "es-object-atoms": "^1.0.0" @@ -7302,6 +9073,7 @@ "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz", "integrity": "sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==", "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.3", "es-errors": "^1.3.0", @@ -7315,9 +9087,9 @@ } }, "node_modules/get-tsconfig": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.10.1.tgz", - "integrity": "sha512-auHyJ4AgMz7vgS8Hp3N6HXSmlMdUyhSUrfBF16w153rxtLIEOE+HGqaBppczZvnHLqQJfiHotCYpNhl0lUROFQ==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.13.0.tgz", + "integrity": "sha512-1VKTZJCwBrvbd+Wn3AOgQP/2Av+TfTCOlE4AcRJE72W1ksZXbAx8PPBR9RzgTeSPzlPMHrbANMH3LbltH73wxQ==", "devOptional": true, "license": "MIT", "dependencies": { @@ -7331,17 +9103,54 @@ "version": "0.10.1", "resolved": "https://registry.npmjs.org/gifwrap/-/gifwrap-0.10.1.tgz", "integrity": "sha512-2760b1vpJHNmLzZ/ubTtNnEx5WApN/PYWJvXvgS+tL1egTTthayFYIQQNi136FLEDcN/IyEY2EcGpIITD6eYUw==", + "license": "MIT", "dependencies": { "image-q": "^4.0.0", "omggif": "^1.0.10" } }, + "node_modules/giget": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/giget/-/giget-2.0.0.tgz", + "integrity": "sha512-L5bGsVkxJbJgdnwyuheIunkGatUF/zssUoxxjACCseZYAVbaqdh9Tsmmlkl8vYan09H7sbvKt4pS8GqKLBrEzA==", + "license": "MIT", + "dependencies": { + "citty": "^0.1.6", + "consola": "^3.4.0", + "defu": "^6.1.4", + "node-fetch-native": "^1.6.6", + "nypm": "^0.6.0", + "pathe": "^2.0.3" + }, + "bin": { + "giget": "dist/cli.mjs" + } + }, + "node_modules/git-raw-commits": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-4.0.0.tgz", + "integrity": "sha512-ICsMM1Wk8xSGMowkOmPrzo2Fgmfo4bMHLNX6ytHjajRJUqvHOw/TFapQ+QG75c3X/tTDDhOSRPGC52dDbNM8FQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "dargs": "^8.0.0", + "meow": "^12.0.1", + "split2": "^4.0.0" + }, + "bin": { + "git-raw-commits": "cli.mjs" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, + "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -7362,6 +9171,7 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, + "license": "ISC", "dependencies": { "is-glob": "^4.0.3" }, @@ -7374,6 +9184,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -7384,6 +9195,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -7391,11 +9203,80 @@ "node": "*" } }, + "node_modules/global-directory": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/global-directory/-/global-directory-4.0.1.tgz", + "integrity": "sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ini": "4.1.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/global-modules": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", + "dev": true, + "license": "MIT", + "dependencies": { + "global-prefix": "^1.0.1", + "is-windows": "^1.0.1", + "resolve-dir": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/global-prefix": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", + "integrity": "sha512-5lsx1NUDHtSjfg0eHlmYvZKv8/nVqX4ckFbM+FrGcQ+04KWcWFo9P5MxPZYSzUvyzmdTbI7Eix8Q4IbELDqzKg==", + "dev": true, + "license": "MIT", + "dependencies": { + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", + "ini": "^1.3.4", + "is-windows": "^1.0.1", + "which": "^1.2.14" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/global-prefix/node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true, + "license": "ISC" + }, + "node_modules/global-prefix/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, "node_modules/globals": { "version": "13.24.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, + "license": "MIT", "dependencies": { "type-fest": "^0.20.2" }, @@ -7411,6 +9292,7 @@ "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", "dev": true, + "license": "MIT", "dependencies": { "define-properties": "^1.2.1", "gopd": "^1.0.1" @@ -7422,30 +9304,11 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/gopd": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -7453,17 +9316,26 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC" + }, "node_modules/graphemer": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/has-bigints": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", "integrity": "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -7472,18 +9344,20 @@ } }, "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, + "license": "MIT", "engines": { - "node": ">=8" + "node": ">=4" } }, "node_modules/has-property-descriptors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "license": "MIT", "dependencies": { "es-define-property": "^1.0.0" }, @@ -7496,6 +9370,7 @@ "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.2.0.tgz", "integrity": "sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==", "dev": true, + "license": "MIT", "dependencies": { "dunder-proto": "^1.0.0" }, @@ -7510,6 +9385,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -7521,6 +9397,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", "dependencies": { "has-symbols": "^1.0.3" }, @@ -7531,10 +9408,23 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/hashery": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/hashery/-/hashery-1.2.0.tgz", + "integrity": "sha512-43XJKpwle72Ik5Zpam7MuzRWyNdwwdf6XHlh8wCj2PggvWf+v/Dm5B0dxGZOmddidgeO6Ofu9As/o231Ti/9PA==", + "license": "MIT", + "dependencies": { + "hookified": "^1.13.0" + }, + "engines": { + "node": ">=20" + } + }, "node_modules/hasown": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", "dependencies": { "function-bind": "^1.1.2" }, @@ -7542,10 +9432,24 @@ "node": ">= 0.4" } }, + "node_modules/homedir-polyfill": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", + "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "parse-passwd": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/hookified": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/hookified/-/hookified-1.10.0.tgz", - "integrity": "sha512-dJw0492Iddsj56U1JsSTm9E/0B/29a1AuoSLRAte8vQg/kaTGF3IgjEWT8c8yG4cC10+HisE1x5QAwR0Xwc+DA==" + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/hookified/-/hookified-1.13.0.tgz", + "integrity": "sha512-6sPYUY8olshgM/1LDNW4QZQN0IqgKhtl/1C8koNZBJrKLBk3AZl6chQtNwpNztvfiApHMEwMHek5rv993PRbWw==", + "license": "MIT" }, "node_modules/htmlparser2": { "version": "8.0.2", @@ -7558,6 +9462,7 @@ "url": "https://github.com/sponsors/fb55" } ], + "license": "MIT", "dependencies": { "domelementtype": "^2.3.0", "domhandler": "^5.0.3", @@ -7569,6 +9474,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "license": "MIT", "dependencies": { "depd": "2.0.0", "inherits": "2.0.4", @@ -7584,6 +9490,7 @@ "version": "7.0.6", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "license": "MIT", "dependencies": { "agent-base": "^7.1.2", "debug": "4" @@ -7596,10 +9503,27 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", + "license": "MIT", "dependencies": { "ms": "^2.0.0" } }, + "node_modules/husky": { + "version": "9.1.7", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz", + "integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==", + "dev": true, + "license": "MIT", + "bin": { + "husky": "bin.js" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/typicode" + } + }, "node_modules/i18next": { "version": "23.16.8", "resolved": "https://registry.npmjs.org/i18next/-/i18next-23.16.8.tgz", @@ -7618,6 +9542,7 @@ "url": "https://www.i18next.com/how-to/faq#i18next-is-awesome.-how-can-i-support-the-project" } ], + "license": "MIT", "dependencies": { "@babel/runtime": "^7.23.2" } @@ -7626,6 +9551,7 @@ "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3" }, @@ -7650,13 +9576,15 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "BSD-3-Clause" }, "node_modules/ignore": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", - "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", + "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 4" } @@ -7665,6 +9593,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/image-q/-/image-q-4.0.0.tgz", "integrity": "sha512-PfJGVgIfKQJuq3s0tTDOKtztksibuUEbJQIYT3by6wctQo+Rdlh7ef4evJ5NCdxY4CfMbvFkocEwbl4BF8RlJw==", + "license": "MIT", "dependencies": { "@types/node": "16.9.1" } @@ -7672,13 +9601,15 @@ "node_modules/image-q/node_modules/@types/node": { "version": "16.9.1", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.1.tgz", - "integrity": "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==" + "integrity": "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==", + "license": "MIT" }, "node_modules/import-fresh": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", "dev": true, + "license": "MIT", "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -7690,10 +9621,21 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/import-fresh/node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, "node_modules/import-in-the-middle": { - "version": "1.14.2", - "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.14.2.tgz", - "integrity": "sha512-5tCuY9BV8ujfOpwtAGgsTx9CGUapcFMEEyByLv1B+v2+6DhAcw+Zr0nhQT7uwaZ7DiourxFEscghOR8e1aPLQw==", + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.15.0.tgz", + "integrity": "sha512-bpQy+CrsRmYmoPMAE/0G33iwRqwW4ouqdRg8jgbH3aKuCtOc8lxgmYXg2dMM92CRiGP660EtBcymH/eVUpCSaA==", + "license": "Apache-2.0", "dependencies": { "acorn": "^8.14.0", "acorn-import-attributes": "^1.9.5", @@ -7701,11 +9643,23 @@ "module-details-from-path": "^1.0.3" } }, + "node_modules/import-meta-resolve": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.2.0.tgz", + "integrity": "sha512-Iqv2fzaTQN28s/FwZAoFq0ZSs/7hMAHJVX+w8PZl3cY19Pxk6jFFalxQoIfW2826i/fDLXv8IiEZRIT0lDuWcg==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8.19" } @@ -7716,6 +9670,7 @@ "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", "dev": true, + "license": "ISC", "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -7724,13 +9679,128 @@ "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ini": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.1.tgz", + "integrity": "sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/inquirer": { + "version": "8.2.5", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.5.tgz", + "integrity": "sha512-QAgPDQMEgrDssk1XiwwHoOGYF9BAbUcc1+j+FhEvaOt8/cKRqyLn0U5qA6F74fGhTMGxf92pOvPBeh29jQJDTQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.1", + "cli-cursor": "^3.1.0", + "cli-width": "^3.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.21", + "mute-stream": "0.0.8", + "ora": "^5.4.1", + "run-async": "^2.4.0", + "rxjs": "^7.5.5", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/inquirer/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/inquirer/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/inquirer/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/inquirer/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/inquirer/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/inquirer/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } }, "node_modules/internal-slot": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", "dev": true, + "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "hasown": "^2.0.2", @@ -7741,14 +9811,10 @@ } }, "node_modules/ip-address": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", - "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.1.0.tgz", + "integrity": "sha512-XXADHxXmvT9+CRxhXg56LJovE+bmWnEWB78LB83VZTprKTmaC5QfruXocxzTZ2Kl0DNwKuBdlIhjL8LeY8Sf8Q==", "license": "MIT", - "dependencies": { - "jsbn": "1.1.0", - "sprintf-js": "^1.1.3" - }, "engines": { "node": ">= 12" } @@ -7757,6 +9823,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.2.0.tgz", "integrity": "sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==", + "license": "MIT", "engines": { "node": ">= 10" } @@ -7765,6 +9832,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.2.0.tgz", "integrity": "sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA==", + "license": "MIT", "dependencies": { "call-bound": "^1.0.2", "has-tostringtag": "^1.0.2" @@ -7781,6 +9849,7 @@ "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", @@ -7794,15 +9863,18 @@ } }, "node_modules/is-arrayish": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", - "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true, + "license": "MIT" }, "node_modules/is-async-function": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.1.tgz", "integrity": "sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==", "dev": true, + "license": "MIT", "dependencies": { "async-function": "^1.0.0", "call-bound": "^1.0.3", @@ -7821,6 +9893,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-base64/-/is-base64-1.1.0.tgz", "integrity": "sha512-Nlhg7Z2dVC4/PTvIFkgVVNvPHSO2eR/Yd0XzhGiXCXEvWnptXlXa/clQ8aePPiMuxEGcWfzWbGw2Fe3d+Y3v1g==", + "license": "MIT", "bin": { "is_base64": "bin/is-base64", "is-base64": "bin/is-base64" @@ -7831,6 +9904,7 @@ "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz", "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==", "dev": true, + "license": "MIT", "dependencies": { "has-bigints": "^1.0.2" }, @@ -7846,6 +9920,7 @@ "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz", "integrity": "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==", "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.3", "has-tostringtag": "^1.0.2" @@ -7861,6 +9936,7 @@ "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -7872,6 +9948,7 @@ "version": "2.16.1", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "license": "MIT", "dependencies": { "hasown": "^2.0.2" }, @@ -7887,6 +9964,7 @@ "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.2.tgz", "integrity": "sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==", "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.2", "get-intrinsic": "^1.2.6", @@ -7904,6 +9982,7 @@ "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.2", "has-tostringtag": "^1.0.2" @@ -7920,6 +9999,7 @@ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -7929,6 +10009,7 @@ "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz", "integrity": "sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==", "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.3" }, @@ -7940,20 +10021,30 @@ } }, "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.1.0.tgz", + "integrity": "sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-east-asian-width": "^1.3.1" + }, "engines": { - "node": ">=8" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-generator-function": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.0.tgz", - "integrity": "sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.2.tgz", + "integrity": "sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA==", + "license": "MIT", "dependencies": { - "call-bound": "^1.0.3", - "get-proto": "^1.0.0", + "call-bound": "^1.0.4", + "generator-function": "^2.0.0", + "get-proto": "^1.0.1", "has-tostringtag": "^1.0.2", "safe-regex-test": "^1.1.0" }, @@ -7969,6 +10060,7 @@ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, + "license": "MIT", "dependencies": { "is-extglob": "^2.1.1" }, @@ -7976,11 +10068,22 @@ "node": ">=0.10.0" } }, + "node_modules/is-interactive": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/is-map": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -7993,6 +10096,7 @@ "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -8005,6 +10109,7 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.12.0" } @@ -8014,6 +10119,7 @@ "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz", "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.3", "has-tostringtag": "^1.0.2" @@ -8025,11 +10131,22 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/is-path-inside": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -8038,6 +10155,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", + "license": "MIT", "dependencies": { "call-bound": "^1.0.2", "gopd": "^1.2.0", @@ -8056,6 +10174,7 @@ "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -8068,6 +10187,7 @@ "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.3" }, @@ -8083,6 +10203,7 @@ "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.3", "has-tostringtag": "^1.0.2" @@ -8099,6 +10220,7 @@ "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz", "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.2", "has-symbols": "^1.1.0", @@ -8111,10 +10233,24 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-text-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-text-path/-/is-text-path-2.0.0.tgz", + "integrity": "sha512-+oDTluR6WEjdXEJMnC2z6A4FRwFoYuvShVVEGsS7ewc0UTi2QtAKMDJuL4BDEVt+5T7MjFo12RP8ghOM75oKJw==", + "dev": true, + "license": "MIT", + "dependencies": { + "text-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/is-typed-array": { "version": "1.1.15", "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", + "license": "MIT", "dependencies": { "which-typed-array": "^1.1.16" }, @@ -8125,11 +10261,32 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha512-rMYPYvCzsXywIsldgLaSoPlw5PfoB/ssr7hY4pLfcodrA5M/eArza1a9VmTiNIBNMjOGr1Ow9mTyU2o69U6U9Q==", + "dev": true, + "license": "MIT" + }, "node_modules/is-weakmap": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -8142,6 +10299,7 @@ "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.1.tgz", "integrity": "sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==", "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.3" }, @@ -8157,6 +10315,7 @@ "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz", "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.3", "get-intrinsic": "^1.2.6" @@ -8168,35 +10327,34 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/isarray": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" - }, - "node_modules/jackspeak": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", - "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", - "dependencies": { - "@isaacs/cliui": "^8.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "optionalDependencies": { - "@pkgjs/parseargs": "^0.11.0" - } + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "license": "ISC" }, "node_modules/jimp": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/jimp/-/jimp-1.6.0.tgz", "integrity": "sha512-YcwCHw1kiqEeI5xRpDlPPBGL2EOpBKLwO4yIBJcXWHPj5PnA5urGq0jbyhM5KoNpypQ6VboSoxc9D8HyfvngSg==", + "license": "MIT", "dependencies": { "@jimp/core": "1.6.0", "@jimp/diff": "1.6.0", @@ -8231,9 +10389,10 @@ } }, "node_modules/jiti": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.4.2.tgz", - "integrity": "sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.6.1.tgz", + "integrity": "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==", + "license": "MIT", "bin": { "jiti": "lib/jiti-cli.mjs" } @@ -8242,6 +10401,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz", "integrity": "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==", + "license": "MIT", "engines": { "node": ">=10" } @@ -8249,13 +10409,22 @@ "node_modules/jpeg-js": { "version": "0.4.4", "resolved": "https://registry.npmjs.org/jpeg-js/-/jpeg-js-0.4.4.tgz", - "integrity": "sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg==" + "integrity": "sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg==", + "license": "BSD-3-Clause" + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT" }, "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", "dev": true, + "license": "MIT", "dependencies": { "argparse": "^2.0.1" }, @@ -8263,40 +10432,46 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/jsbn": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", - "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==", - "license": "MIT" - }, "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "dev": true + "dev": true, + "license": "MIT" + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true, + "license": "MIT" }, "node_modules/json-schema": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", + "license": "(AFL-2.1 OR BSD-3-Clause)" }, "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true, + "license": "MIT" }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/json5": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, + "license": "MIT", "bin": { "json5": "lib/cli.js" }, @@ -8304,18 +10479,60 @@ "node": ">=6" } }, - "node_modules/jsonschema": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.5.0.tgz", - "integrity": "sha512-K+A9hhqbn0f3pJX17Q/7H6yQfD/5OXgdrR5UE12gMXCiN9D5Xq2o5mddV2QEcX/bjla99ASsAAQUyMCCRWAEhw==", - "engines": { - "node": "*" - } - }, - "node_modules/jsonwebtoken": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", + "node_modules/jsonfile": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", + "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", + "dev": true, + "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==", + "dev": true, + "engines": [ + "node >= 0.2.0" + ], + "license": "MIT" + }, + "node_modules/jsonschema": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.5.0.tgz", + "integrity": "sha512-K+A9hhqbn0f3pJX17Q/7H6yQfD/5OXgdrR5UE12gMXCiN9D5Xq2o5mddV2QEcX/bjla99ASsAAQUyMCCRWAEhw==", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/JSONStream": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", + "dev": true, + "license": "(MIT OR Apache-2.0)", + "dependencies": { + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" + }, + "bin": { + "JSONStream": "bin.js" + }, + "engines": { + "node": "*" + } + }, + "node_modules/jsonwebtoken": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", + "license": "MIT", "dependencies": { "jws": "^3.2.2", "lodash.includes": "^4.3.0", @@ -8337,6 +10554,7 @@ "version": "1.4.2", "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.2.tgz", "integrity": "sha512-eeH5JO+21J78qMvTIDdBXidBd6nG2kZjg5Ohz/1fpa28Z4CcsWUzJ1ZZyFq/3z3N17aZy+ZuBoHljASbL1WfOw==", + "license": "MIT", "dependencies": { "buffer-equal-constant-time": "^1.0.1", "ecdsa-sig-formatter": "1.0.11", @@ -8347,17 +10565,28 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "license": "MIT", "dependencies": { "jwa": "^1.4.1", "safe-buffer": "^5.0.1" } }, + "node_modules/kafkajs": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/kafkajs/-/kafkajs-2.2.4.tgz", + "integrity": "sha512-j/YeapB1vfPT2iOIUn/vxdyKEuhuY2PxMBvf5JWux6iSaukAccrMtXEY/Lb7OvavDhOWME589bpLrEdnVHjfjA==", + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/keyv": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-5.3.4.tgz", - "integrity": "sha512-ypEvQvInNpUe+u+w8BIcPkQvEqXquyyibWE/1NB5T2BTzIpS5cGEV1LZskDzPSTvNAaT4+5FutvzlvnkxOSKlw==", + "version": "5.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-5.5.4.tgz", + "integrity": "sha512-eohl3hKTiVyD1ilYdw9T0OiB4hnjef89e3dMYKz+mVKDzj+5IteTseASUsOB+EU9Tf6VNTCjDePcP6wkDGmLKQ==", + "license": "MIT", "dependencies": { - "@keyv/serialize": "^1.0.3" + "@keyv/serialize": "^1.1.1" } }, "node_modules/levn": { @@ -8365,6 +10594,7 @@ "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, + "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" @@ -8374,14 +10604,15 @@ } }, "node_modules/libphonenumber-js": { - "version": "1.12.9", - "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.12.9.tgz", - "integrity": "sha512-VWwAdNeJgN7jFOD+wN4qx83DTPMVPPAUyx9/TUkBXKLiNkuWWk6anV0439tgdtwaJDrEdqkvdN22iA6J4bUCZg==" + "version": "1.12.29", + "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.12.29.tgz", + "integrity": "sha512-P2aLrbeqHbmh8+9P35LXQfXOKc7XJ0ymUKl7tyeyQjdRNfzunXWxQXGc4yl3fUf28fqLRfPY+vIVvFXK7KEBTw==", + "license": "MIT" }, "node_modules/libsignal": { "name": "@whiskeysockets/libsignal-node", "version": "2.0.1", - "resolved": "git+ssh://git@github.com/whiskeysockets/libsignal-node.git#4d08331a833727c338c1a90041d17b870210dfae", + "resolved": "git+ssh://git@github.com/whiskeysockets/libsignal-node.git#1c30d7d7e76a3b0aa120b04dc6a26f5a12dccf67", "license": "GPL-3.0", "dependencies": { "curve25519-js": "^0.0.4", @@ -8430,6 +10661,7 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", + "license": "MIT", "engines": { "node": ">=14" }, @@ -8440,12 +10672,14 @@ "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==" + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "license": "MIT" }, "node_modules/link-preview-js": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/link-preview-js/-/link-preview-js-3.1.0.tgz", - "integrity": "sha512-hSvdHCy7tZJ8ohdgN5WcTBKaubpX7saYBzrSmNDDHnC7P6q+F4we+dwXuEr9LuplnkiGxkD4SaO4rrschfCZ2A==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/link-preview-js/-/link-preview-js-3.2.0.tgz", + "integrity": "sha512-FvrLltjOPGbTzt+RugbzM7g8XuUNLPO2U/INSLczrYdAA32E7nZVUrVL1gr61DGOArGJA2QkPGMEvNMLLsXREA==", + "license": "MIT", "dependencies": { "cheerio": "1.0.0-rc.11", "url": "0.11.0" @@ -8454,24 +10688,134 @@ "node": ">=18" } }, + "node_modules/lint-staged": { + "version": "16.2.7", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-16.2.7.tgz", + "integrity": "sha512-lDIj4RnYmK7/kXMya+qJsmkRFkGolciXjrsZ6PC25GdTfWOAWetR0ZbsNXRAj1EHHImRSalc+whZFg56F5DVow==", + "dev": true, + "license": "MIT", + "dependencies": { + "commander": "^14.0.2", + "listr2": "^9.0.5", + "micromatch": "^4.0.8", + "nano-spawn": "^2.0.0", + "pidtree": "^0.6.0", + "string-argv": "^0.3.2", + "yaml": "^2.8.1" + }, + "bin": { + "lint-staged": "bin/lint-staged.js" + }, + "engines": { + "node": ">=20.17" + }, + "funding": { + "url": "https://opencollective.com/lint-staged" + } + }, + "node_modules/listr2": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-9.0.5.tgz", + "integrity": "sha512-ME4Fb83LgEgwNw96RKNvKV4VTLuXfoKudAmm2lP8Kk87KaMK0/Xrx/aAkMWmT8mDb+3MlFDspfbCs7adjRxA2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "cli-truncate": "^5.0.0", + "colorette": "^2.0.20", + "eventemitter3": "^5.0.1", + "log-update": "^6.1.0", + "rfdc": "^1.4.1", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/listr2/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/listr2/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/listr2/node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/listr2/node_modules/wrap-ansi": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", + "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/load-tsconfig": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/load-tsconfig/-/load-tsconfig-0.2.5.tgz", "integrity": "sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==", + "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, "node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.2.0.tgz", + "integrity": "sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==", "dev": true, + "license": "MIT", "dependencies": { - "p-locate": "^5.0.0" + "p-locate": "^6.0.0" }, "engines": { - "node": ">=10" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -8480,3178 +10824,4757 @@ "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "license": "MIT" + }, + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", + "dev": true, + "license": "MIT" }, "node_modules/lodash.includes": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", - "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==" + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==", + "license": "MIT" }, "node_modules/lodash.isboolean": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", - "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==" + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==", + "license": "MIT" }, "node_modules/lodash.isinteger": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", - "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==" + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==", + "license": "MIT" }, "node_modules/lodash.isnumber": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", - "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==" + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==", + "license": "MIT" }, "node_modules/lodash.isplainobject": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", + "license": "MIT" }, "node_modules/lodash.isstring": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", - "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", + "license": "MIT" + }, + "node_modules/lodash.kebabcase": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz", + "integrity": "sha512-N8XRTIMMqqDgSy4VLKPnJ/+hpGZN+PHQiJnSenYqPaVV/NCqEogTnAdZLQiGKhxX+JCs8waWq2t1XHWKOmlY8g==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.map": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.map/-/lodash.map-4.6.0.tgz", + "integrity": "sha512-worNHGKLDetmcEYDvh2stPCrrQRkP20E4l0iIS7F8EvzMqBBi7ltvFN5m1HvTf1P7Jk1txKhvFcmYsCr8O2F1Q==", + "dev": true, + "license": "MIT" }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.mergewith": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz", + "integrity": "sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==", + "dev": true, + "license": "MIT" }, "node_modules/lodash.once": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", - "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==" - }, - "node_modules/lodash.sortby": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", - "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==" + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", + "license": "MIT" }, - "node_modules/long": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz", - "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==" + "node_modules/lodash.snakecase": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", + "integrity": "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==", + "dev": true, + "license": "MIT" }, - "node_modules/lru-cache": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", - "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==" + "node_modules/lodash.startcase": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.startcase/-/lodash.startcase-4.4.0.tgz", + "integrity": "sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==", + "dev": true, + "license": "MIT" }, - "node_modules/magic-string": { - "version": "0.30.17", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz", - "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0" - } + "node_modules/lodash.uniq": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", + "integrity": "sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==", + "dev": true, + "license": "MIT" }, - "node_modules/math-intrinsics": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", - "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", - "engines": { - "node": ">= 0.4" - } + "node_modules/lodash.upperfirst": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz", + "integrity": "sha512-sReKOYJIJf74dhJONhU4e0/shzi1trVbSWDOhKYE5XV2O+H7Sb2Dihwuc7xWxVl+DgFPyTqIN3zMfT9cq5iWDg==", + "dev": true, + "license": "MIT" }, - "node_modules/media-typer": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", - "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/mediainfo.js": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/mediainfo.js/-/mediainfo.js-0.3.5.tgz", - "integrity": "sha512-frLJzKOoAUC0sbPzmg9VOR+WFbNj5CarbTuOzXeH9cOl33haU/CGcyXUTWK00HPXCVS2N5eT0o0dirVxaPIOIw==", "dependencies": { - "yargs": "^17.7.2" - }, - "bin": { - "mediainfo.js": "dist/esm/cli.js" + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" }, "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/merge-descriptors": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", - "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "node": ">=10" + }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "node_modules/log-symbols/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, "engines": { - "node": ">= 8" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "node_modules/log-symbols/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, "engines": { - "node": ">= 0.6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/micromatch": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", - "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "node_modules/log-symbols/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, + "license": "MIT", "dependencies": { - "braces": "^3.0.3", - "picomatch": "^2.3.1" + "color-name": "~1.1.4" }, "engines": { - "node": ">=8.6" + "node": ">=7.0.0" } }, - "node_modules/mime": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/mime/-/mime-4.0.7.tgz", - "integrity": "sha512-2OfDPL+e03E0LrXaGYOtTFIYhiuzep94NSsuhrNULq+stylcJedcHdzHtz0atMUuGwJfFYs0YL5xeC/Ca2x0eQ==", - "funding": [ - "https://github.com/sponsors/broofa" - ], - "bin": { - "mime": "bin/cli.js" - }, - "engines": { - "node": ">=16" - } + "node_modules/log-symbols/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" }, - "node_modules/mime-db": { - "version": "1.54.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", - "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "node_modules/log-symbols/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", "engines": { - "node": ">= 0.6" + "node": ">=8" } }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "node_modules/log-symbols/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", "dependencies": { - "mime-db": "1.52.0" + "has-flag": "^4.0.0" }, "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types/node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "engines": { - "node": ">= 0.6" + "node": ">=8" } }, - "node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "node_modules/log-update": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-6.1.0.tgz", + "integrity": "sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==", "dev": true, + "license": "MIT", "dependencies": { - "brace-expansion": "^2.0.1" + "ansi-escapes": "^7.0.0", + "cli-cursor": "^5.0.0", + "slice-ansi": "^7.1.0", + "strip-ansi": "^7.1.0", + "wrap-ansi": "^9.0.0" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": ">=18" }, "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/minio": { - "version": "8.0.5", - "resolved": "https://registry.npmjs.org/minio/-/minio-8.0.5.tgz", - "integrity": "sha512-/vAze1uyrK2R/DSkVutE4cjVoAowvIQ18RAwn7HrqnLecLlMazFnY0oNBqfuoAWvu7mZIGX75AzpuV05TJeoHg==", + "node_modules/log-update/node_modules/ansi-escapes": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.2.0.tgz", + "integrity": "sha512-g6LhBsl+GBPRWGWsBtutpzBYuIIdBkLEvad5C/va/74Db018+5TZiyA26cZJAr3Rft5lprVqOIPxf5Vid6tqAw==", + "dev": true, + "license": "MIT", "dependencies": { - "async": "^3.2.4", - "block-stream2": "^2.1.0", - "browser-or-node": "^2.1.1", - "buffer-crc32": "^1.0.0", - "eventemitter3": "^5.0.1", - "fast-xml-parser": "^4.4.1", - "ipaddr.js": "^2.0.1", - "lodash": "^4.17.21", - "mime-types": "^2.1.35", - "query-string": "^7.1.3", - "stream-json": "^1.8.0", - "through2": "^4.0.2", - "web-encoding": "^1.1.5", - "xml2js": "^0.5.0 || ^0.6.2" + "environment": "^1.0.0" }, "engines": { - "node": "^16 || ^18 || >=20" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/minio/node_modules/async": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", - "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==" - }, - "node_modules/minipass": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "node_modules/log-update/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "dev": true, + "license": "MIT", "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "node_modules/mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "dependencies": { - "minimist": "^1.2.6" + "node": ">=12" }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, - "node_modules/mlly": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.7.4.tgz", - "integrity": "sha512-qmdSIPC4bDJXgZTCR7XosJiNKySV7O215tsPtDN9iEO/7q/76b/ijtgRu/+epFXSJhijtTCCGp3DWS549P3xKw==", - "dependencies": { - "acorn": "^8.14.0", - "pathe": "^2.0.1", - "pkg-types": "^1.3.0", - "ufo": "^1.5.4" + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, - "node_modules/module-details-from-path": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/module-details-from-path/-/module-details-from-path-1.0.4.tgz", - "integrity": "sha512-EGWKgxALGMgzvxYF1UyGTy0HXX/2vHLkw6+NvDKW2jypWbHpjQuj4UMcqQWXHERJhVGKikolT06G3bcKe4fi7w==" - }, - "node_modules/mpg123-decoder": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/mpg123-decoder/-/mpg123-decoder-1.0.2.tgz", - "integrity": "sha512-cw0Laz57gumQsfCqnNeGtgq64EcyrK/z4qx+kq4iba7iSSXfI7uO3jiHjdHxNp4PB2v08VZYZ2Fr68VM1JkaPQ==", + "node_modules/log-update/node_modules/cli-cursor": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz", + "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==", + "dev": true, + "license": "MIT", "dependencies": { - "@wasm-audio-decoders/common": "9.0.7" + "restore-cursor": "^5.0.0" + }, + "engines": { + "node": ">=18" }, "funding": { - "type": "individual", - "url": "https://github.com/sponsors/eshaz" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - }, - "node_modules/multer": { - "version": "1.4.5-lts.2", - "resolved": "https://registry.npmjs.org/multer/-/multer-1.4.5-lts.2.tgz", - "integrity": "sha512-VzGiVigcG9zUAoCNU+xShztrlr1auZOlurXynNvO9GiWD1/mTBbUljOKY+qMeazBqXgRnjzeEgJI/wyjJUHg9A==", - "deprecated": "Multer 1.x is impacted by a number of vulnerabilities, which have been patched in 2.x. You should upgrade to the latest 2.x version.", + "node_modules/log-update/node_modules/onetime": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz", + "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==", + "dev": true, + "license": "MIT", "dependencies": { - "append-field": "^1.0.0", - "busboy": "^1.0.0", - "concat-stream": "^1.5.2", - "mkdirp": "^0.5.4", - "object-assign": "^4.1.1", - "type-is": "^1.6.4", - "xtend": "^4.0.0" + "mimic-function": "^5.0.0" }, "engines": { - "node": ">= 6.0.0" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/music-metadata": { - "version": "11.7.1", - "resolved": "https://registry.npmjs.org/music-metadata/-/music-metadata-11.7.1.tgz", - "integrity": "sha512-qoimzvpOnOi2VJpGz6Nz4SwmcYKe39TsAwlcNilgnDrGKNQDib35t0kj5fy1E71DQgqGApBeAKLmcV9pO3l/2w==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/Borewit" - }, - { - "type": "buymeacoffee", - "url": "https://buymeacoffee.com/borewit" - } - ], + "node_modules/log-update/node_modules/restore-cursor": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz", + "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==", + "dev": true, "license": "MIT", "dependencies": { - "@tokenizer/token": "^0.3.0", - "content-type": "^1.0.5", - "debug": "^4.4.1", - "file-type": "^21.0.0", - "media-typer": "^1.1.0", - "strtok3": "^10.3.2", - "token-types": "^6.0.3", - "uint8array-extras": "^1.4.0" + "onetime": "^7.0.0", + "signal-exit": "^4.1.0" }, "engines": { "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/music-metadata/node_modules/file-type": { - "version": "21.0.0", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-21.0.0.tgz", - "integrity": "sha512-ek5xNX2YBYlXhiUXui3D/BXa3LdqPmoLJ7rqEx2bKJ7EAUEfmXgW0Das7Dc6Nr9MvqaOnIqiPV0mZk/r/UpNAg==", - "license": "MIT", - "dependencies": { - "@tokenizer/inflate": "^0.2.7", - "strtok3": "^10.2.2", - "token-types": "^6.0.0", - "uint8array-extras": "^1.4.0" - }, + "node_modules/log-update/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", "engines": { - "node": ">=20" + "node": ">=14" }, "funding": { - "url": "https://github.com/sindresorhus/file-type?sponsor=1" + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/music-metadata/node_modules/strtok3": { - "version": "10.3.2", - "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-10.3.2.tgz", - "integrity": "sha512-or9w505RhhY66+uoe5YOC5QO/bRuATaoim3XTh+pGKx5VMWi/HDhMKuCjDLsLJouU2zg9Hf1nLPcNW7IHv80kQ==", + "node_modules/log-update/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "dev": true, "license": "MIT", "dependencies": { - "@tokenizer/token": "^0.3.0" + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" }, "engines": { "node": ">=18" }, "funding": { - "type": "github", - "url": "https://github.com/sponsors/Borewit" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/music-metadata/node_modules/token-types": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/token-types/-/token-types-6.0.3.tgz", - "integrity": "sha512-IKJ6EzuPPWtKtEIEPpIdXv9j5j2LGJEYk0CKY2efgKoYKLBiZdh6iQkLVBow/CB3phyWAWCyk+bZeaimJn6uRQ==", + "node_modules/log-update/node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "dev": true, "license": "MIT", "dependencies": { - "@tokenizer/token": "^0.3.0", - "ieee754": "^1.2.1" + "ansi-regex": "^6.0.1" }, "engines": { - "node": ">=14.16" + "node": ">=12" }, "funding": { - "type": "github", - "url": "https://github.com/sponsors/Borewit" - } - }, - "node_modules/mz": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", - "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", - "dependencies": { - "any-promise": "^1.0.0", - "object-assign": "^4.0.1", - "thenify-all": "^1.0.0" + "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, - "node_modules/nats": { - "version": "2.29.3", - "resolved": "https://registry.npmjs.org/nats/-/nats-2.29.3.tgz", - "integrity": "sha512-tOQCRCwC74DgBTk4pWZ9V45sk4d7peoE2njVprMRCBXrhJ5q5cYM7i6W+Uvw2qUrcfOSnuisrX7bEx3b3Wx4QA==", + "node_modules/log-update/node_modules/wrap-ansi": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", + "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", + "dev": true, + "license": "MIT", "dependencies": { - "nkeys.js": "1.1.0" + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" }, "engines": { - "node": ">= 14.0.0" + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true + "node_modules/long": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz", + "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", + "license": "Apache-2.0" }, - "node_modules/negotiator": { - "version": "0.6.4", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.4.tgz", - "integrity": "sha512-myRT3DiWPHqho5PrJaIRyaMv2kgYf0mUVgBNOYMuCH5Ki1yEiQaf/ZJuQ62nvpc44wL5WDbTX7yGJi1Neevw8w==", + "node_modules/longest": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-2.0.1.tgz", + "integrity": "sha512-Ajzxb8CM6WAnFjgiloPsI3bF+WCxcvhdIG3KNA2KN962+tdBsHcuQ4k4qX/EcS/2CRkcc0iAkR956Nib6aXU/Q==", + "dev": true, + "license": "MIT", "engines": { - "node": ">= 0.6" + "node": ">=0.10.0" } }, - "node_modules/nkeys.js": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/nkeys.js/-/nkeys.js-1.1.0.tgz", - "integrity": "sha512-tB/a0shZL5UZWSwsoeyqfTszONTt4k2YS0tuQioMOD180+MbombYVgzDUYHlx+gejYK6rgf08n/2Df99WY0Sxg==", - "dependencies": { - "tweetnacl": "1.0.3" - }, + "node_modules/lru-cache": { + "version": "11.2.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.2.tgz", + "integrity": "sha512-F9ODfyqML2coTIsQpSkRHnLSZMtkU8Q+mSfcaIyKwy58u+8k5nvAYeiNhsyMARvzNcXJ9QfWVrcPsC9e9rAxtg==", + "license": "ISC", "engines": { - "node": ">=10.0.0" + "node": "20 || >=22" } }, - "node_modules/node-cache": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/node-cache/-/node-cache-5.1.2.tgz", - "integrity": "sha512-t1QzWwnk4sjLWaQAS8CHgOJ+RAfmHpxFWmc36IWTiWHQfs0w5JDMBS1b1ZxQteo0vVVuWJvIUKHDkkeK7vIGCg==", + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "license": "MIT", "dependencies": { - "clone": "2.x" - }, - "engines": { - "node": ">= 8.0.0" + "@jridgewell/sourcemap-codec": "^1.5.5" } }, - "node_modules/node-cron": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/node-cron/-/node-cron-3.0.3.tgz", - "integrity": "sha512-dOal67//nohNgYWb+nWmg5dkFdIwDm8EpeGYMekPMrngV3637lqnX0lbUcCtgibHTz6SEz7DAIjKvKDFYCnO1A==", - "dependencies": { - "uuid": "8.3.2" - }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/node-cron/node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "bin": { - "uuid": "dist/bin/uuid" + "node": ">= 0.4" } }, - "node_modules/node-domexception": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", - "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", - "deprecated": "Use your platform's native DOMException instead", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "github", - "url": "https://paypal.me/jimmywarting" - } - ], + "node_modules/media-typer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", + "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", + "license": "MIT", "engines": { - "node": ">=10.5.0" + "node": ">= 0.8" } }, - "node_modules/node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "node_modules/mediainfo.js": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/mediainfo.js/-/mediainfo.js-0.3.6.tgz", + "integrity": "sha512-3xVRlxwlVWIZV3z1q7pb8LzFOO7iKi/DXoRiFRZdOlrUEhPyJDaaRt0uK32yQJabArQicRBeq7cRxmdZlIBTyA==", + "license": "BSD-2-Clause", "dependencies": { - "whatwg-url": "^5.0.0" + "yargs": "^18.0.0" }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" + "bin": { + "mediainfo.js": "dist/esm/cli.js" }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/node-wav": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/node-wav/-/node-wav-0.0.2.tgz", - "integrity": "sha512-M6Rm/bbG6De/gKGxOpeOobx/dnGuP0dz40adqx38boqHhlWssBJZgLCPBNtb9NkrmnKYiV04xELq+R6PFOnoLA==", "engines": { - "node": ">=4.4.0" + "node": ">=18.0.0" } }, - "node_modules/nth-check": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", - "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", - "dependencies": { - "boolbase": "^1.0.0" + "node_modules/mediainfo.js/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "license": "MIT", + "engines": { + "node": ">=12" }, "funding": { - "url": "https://github.com/fb55/nth-check?sponsor=1" + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "node_modules/mediainfo.js/node_modules/cliui": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-9.0.1.tgz", + "integrity": "sha512-k7ndgKhwoQveBL+/1tqGJYNz097I7WOvwbmmU2AR5+magtbjPWQTS1C5vzGkBC8Ym8UWRzfKUzUUqFLypY4Q+w==", + "license": "ISC", + "dependencies": { + "string-width": "^7.2.0", + "strip-ansi": "^7.1.0", + "wrap-ansi": "^9.0.0" + }, "engines": { - "node": ">=0.10.0" + "node": ">=20" } }, - "node_modules/object-inspect": { - "version": "1.13.4", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", - "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "node_modules/mediainfo.js/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, "engines": { - "node": ">= 0.4" + "node": ">=18" }, "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, - "engines": { - "node": ">= 0.4" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/object.assign": { - "version": "4.1.7", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", - "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", - "dev": true, + "node_modules/mediainfo.js/node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "license": "MIT", "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.3", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.0.0", - "has-symbols": "^1.1.0", - "object-keys": "^1.1.1" + "ansi-regex": "^6.0.1" }, "engines": { - "node": ">= 0.4" + "node": ">=12" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, - "node_modules/object.fromentries": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", - "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", - "dev": true, + "node_modules/mediainfo.js/node_modules/wrap-ansi": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", + "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", + "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.2", - "es-object-atoms": "^1.0.0" + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" }, "engines": { - "node": ">= 0.4" + "node": ">=18" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/object.groupby": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", - "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", - "dev": true, + "node_modules/mediainfo.js/node_modules/yargs": { + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-18.0.0.tgz", + "integrity": "sha512-4UEqdc2RYGHZc7Doyqkrqiln3p9X2DZVxaGbwhn2pi7MrRagKaOcIKe8L3OxYcbhXLgLFUS3zAYuQjKBQgmuNg==", + "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.2" + "cliui": "^9.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "string-width": "^7.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^22.0.0" }, "engines": { - "node": ">= 0.4" + "node": "^20.19.0 || ^22.12.0 || >=23" } }, - "node_modules/object.values": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.1.tgz", - "integrity": "sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA==", + "node_modules/mediainfo.js/node_modules/yargs-parser": { + "version": "22.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-22.0.0.tgz", + "integrity": "sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw==", + "license": "ISC", + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=23" + } + }, + "node_modules/meow": { + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-12.1.1.tgz", + "integrity": "sha512-BhXM0Au22RwUneMPwSCnyhTOizdWoIEPU9sp0Aqa1PnDMR5Wv2FGXYDjuzJEIX+Eo2Rb8xuYe5jrnm5QowQFkw==", "dev": true, - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.3", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.0.0" - }, + "license": "MIT", "engines": { - "node": ">= 0.4" + "node": ">=16.10" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/ogg-opus-decoder": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/ogg-opus-decoder/-/ogg-opus-decoder-1.7.0.tgz", - "integrity": "sha512-/lrj4+ZGjxZCCNiDSlNEckLrCL+UU9N9XtqES7sXq/Lm6PMi8Pwn/D6TTsbvG45krt21ohAh2FqdEsMuI7ZN4w==", - "dependencies": { - "@wasm-audio-decoders/common": "9.0.7", - "@wasm-audio-decoders/opus-ml": "0.0.1", - "codec-parser": "2.5.0", - "opus-decoder": "0.7.10" - }, + "node_modules/merge": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/merge/-/merge-2.1.1.tgz", + "integrity": "sha512-jz+Cfrg9GWOZbQAnDQ4hlVnQky+341Yk5ru8bZSe6sIDTCIg8n9i/u7hSQGSVOF3C7lH6mGtqjkiT9G4wFLL0w==", + "dev": true, + "license": "MIT" + }, + "node_modules/merge-descriptors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "license": "MIT", "funding": { - "type": "individual", - "url": "https://github.com/sponsors/eshaz" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/omggif": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/omggif/-/omggif-1.0.10.tgz", - "integrity": "sha512-LMJTtvgc/nugXj0Vcrrs68Mn2D1r0zf630VNtqtpI1FEO7e+O9FP4gqs9AcnBaSEeoHIPm28u6qgPR0oyEpGSw==" + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } }, - "node_modules/on-exit-leak-free": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/on-exit-leak-free/-/on-exit-leak-free-2.1.2.tgz", - "integrity": "sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==", + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "license": "MIT", "engines": { - "node": ">=14.0.0" + "node": ">= 0.6" } }, - "node_modules/on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "license": "MIT", "dependencies": { - "ee-first": "1.1.1" + "braces": "^3.0.3", + "picomatch": "^2.3.1" }, "engines": { - "node": ">= 0.8" + "node": ">=8.6" } }, - "node_modules/on-headers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", - "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", + "node_modules/mime": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-4.1.0.tgz", + "integrity": "sha512-X5ju04+cAzsojXKes0B/S4tcYtFAJ6tTMuSPBEn9CPGlrWr8Fiw7qYeLT0XyH80HSoAoqWCaz+MWKh22P7G1cw==", + "funding": [ + "https://github.com/sponsors/broofa" + ], + "license": "MIT", + "bin": { + "mime": "bin/cli.js" + }, "engines": { - "node": ">= 0.8" + "node": ">=16" } }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "dependencies": { - "wrappy": "1" + "node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" } }, - "node_modules/openai": { - "version": "4.104.0", - "resolved": "https://registry.npmjs.org/openai/-/openai-4.104.0.tgz", - "integrity": "sha512-p99EFNsA/yX6UhVO93f5kJsDRLAg+CTA2RBqdHK4RtK8u5IJw32Hyb2dTGKbnnFmnuoBv5r7Z2CURI9sGZpSuA==", + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", "dependencies": { - "@types/node": "^18.11.18", - "@types/node-fetch": "^2.6.4", - "abort-controller": "^3.0.0", - "agentkeepalive": "^4.2.1", - "form-data-encoder": "1.7.2", - "formdata-node": "^4.3.2", - "node-fetch": "^2.6.7" - }, - "bin": { - "openai": "bin/cli" - }, - "peerDependencies": { - "ws": "^8.18.0", - "zod": "^3.23.8" + "mime-db": "1.52.0" }, - "peerDependenciesMeta": { - "ws": { - "optional": true - }, - "zod": { - "optional": true - } + "engines": { + "node": ">= 0.6" } }, - "node_modules/openai/node_modules/@types/node": { - "version": "18.19.117", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.117.tgz", - "integrity": "sha512-hcxGs9TfQGghOM8atpRT+bBMUX7V8WosdYt98bQ59wUToJck55eCOlemJ+0FpOZOQw5ff7LSi9+IO56KvYEFyQ==", - "dependencies": { - "undici-types": "~5.26.4" + "node_modules/mime-types/node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" } }, - "node_modules/openai/node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" - }, - "node_modules/optionator": { - "version": "0.9.4", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", - "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true, - "dependencies": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.5" - }, + "license": "MIT", "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/opus-decoder": { - "version": "0.7.10", - "resolved": "https://registry.npmjs.org/opus-decoder/-/opus-decoder-0.7.10.tgz", - "integrity": "sha512-qUZdyAK+kKy/wUSd/oZ0ULE9U/yskp332n2oBvSP/Jz/wHsHiVRg33f/tRUR8TRiw+ka7AQUclxcr5TbUJo+VA==", - "dependencies": { - "@wasm-audio-decoders/common": "9.0.7" - }, - "funding": { - "type": "individual", - "url": "https://github.com/sponsors/eshaz" + "node": ">=6" } }, - "node_modules/own-keys": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz", - "integrity": "sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==", + "node_modules/mimic-function": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", + "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==", "dev": true, - "dependencies": { - "get-intrinsic": "^1.2.6", - "object-keys": "^1.1.1", - "safe-push-apply": "^1.0.0" - }, + "license": "MIT", "engines": { - "node": ">= 0.4" + "node": ">=18" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, + "node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "license": "ISC", "dependencies": { - "yocto-queue": "^0.1.0" + "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=10" + "node": ">=16 || 14 >=14.17" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "license": "MIT", "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "node_modules/minio": { + "version": "8.0.6", + "resolved": "https://registry.npmjs.org/minio/-/minio-8.0.6.tgz", + "integrity": "sha512-sOeh2/b/XprRmEtYsnNRFtOqNRTPDvYtMWh+spWlfsuCV/+IdxNeKVUMKLqI7b5Dr07ZqCPuaRGU/rB9pZYVdQ==", + "license": "Apache-2.0", + "dependencies": { + "async": "^3.2.4", + "block-stream2": "^2.1.0", + "browser-or-node": "^2.1.1", + "buffer-crc32": "^1.0.0", + "eventemitter3": "^5.0.1", + "fast-xml-parser": "^4.4.1", + "ipaddr.js": "^2.0.1", + "lodash": "^4.17.21", + "mime-types": "^2.1.35", + "query-string": "^7.1.3", + "stream-json": "^1.8.0", + "through2": "^4.0.2", + "web-encoding": "^1.1.5", + "xml2js": "^0.5.0 || ^0.6.2" + }, "engines": { - "node": ">=6" + "node": "^16 || ^18 || >=20" } }, - "node_modules/package-json-from-dist": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", - "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==" - }, - "node_modules/pako": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==" + "node_modules/minio/node_modules/async": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "license": "MIT" }, - "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, + "node_modules/minio/node_modules/fast-xml-parser": { + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.5.3.tgz", + "integrity": "sha512-RKihhV+SHsIUGXObeVy9AXiBbFwkVk7Syp8XgwN5U3JV416+Gwp/GO9i0JYKmikykgz/UHRrrV4ROuZEo/T0ig==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT", "dependencies": { - "callsites": "^3.0.0" + "strnum": "^1.1.1" }, - "engines": { - "node": ">=6" + "bin": { + "fxparser": "src/cli/cli.js" } }, - "node_modules/parse-bmfont-ascii": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/parse-bmfont-ascii/-/parse-bmfont-ascii-1.0.6.tgz", - "integrity": "sha512-U4RrVsUFCleIOBsIGYOMKjn9PavsGOXxbvYGtMOEfnId0SVNsgehXh1DxUdVPLoxd5mvcEtvmKs2Mmf0Mpa1ZA==" - }, - "node_modules/parse-bmfont-binary": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/parse-bmfont-binary/-/parse-bmfont-binary-1.0.6.tgz", - "integrity": "sha512-GxmsRea0wdGdYthjuUeWTMWPqm2+FAd4GI8vCvhgJsFnoGhTrLhXDDupwTo7rXVAgaLIGoVHDZS9p/5XbSqeWA==" + "node_modules/minio/node_modules/strnum": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.1.2.tgz", + "integrity": "sha512-vrN+B7DBIoTTZjnPNewwhx6cBA/H+IS7rfW68n7XxC1y7uoiGQBxaKzqucGUgavX15dJgiGztLJ8vxuEzwqBdA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT" }, - "node_modules/parse-bmfont-xml": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/parse-bmfont-xml/-/parse-bmfont-xml-1.1.6.tgz", - "integrity": "sha512-0cEliVMZEhrFDwMh4SxIyVJpqYoOWDJ9P895tFuS+XuNzI5UBmBk5U5O4KuJdTnZpSBI4LFA2+ZiJaiwfSwlMA==", + "node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "license": "MIT", "dependencies": { - "xml-parse-from-string": "^1.0.0", - "xml2js": "^0.5.0" + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" } }, - "node_modules/parse-bmfont-xml/node_modules/xml2js": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.5.0.tgz", - "integrity": "sha512-drPFnkQJik/O+uPKpqSgr22mpuFHqKdbS835iAQrUC73L2F5WkboIRd63ai/2Yg6I1jzifPFKH2NTK+cfglkIA==", + "node_modules/mlly": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.8.0.tgz", + "integrity": "sha512-l8D9ODSRWLe2KHJSifWGwBqpTZXIXTeo8mlKjY+E2HAakaTeNpqAyBZ8GSqLzHgw4XmHmC8whvpjJNMbFZN7/g==", + "license": "MIT", "dependencies": { - "sax": ">=0.6.0", - "xmlbuilder": "~11.0.0" - }, - "engines": { - "node": ">=4.0.0" + "acorn": "^8.15.0", + "pathe": "^2.0.3", + "pkg-types": "^1.3.1", + "ufo": "^1.6.1" } }, - "node_modules/parse5": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz", - "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==", + "node_modules/mlly/node_modules/confbox": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz", + "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==", + "license": "MIT" + }, + "node_modules/mlly/node_modules/pkg-types": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.3.1.tgz", + "integrity": "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==", + "license": "MIT", "dependencies": { - "entities": "^6.0.0" - }, - "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" + "confbox": "^0.1.8", + "mlly": "^1.7.4", + "pathe": "^2.0.1" } }, - "node_modules/parse5-htmlparser2-tree-adapter": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.1.0.tgz", - "integrity": "sha512-ruw5xyKs6lrpo9x9rCZqZZnIUntICjQAd0Wsmp396Ul9lN/h+ifgVV1x1gZHi8euej6wTfpqX8j+BFQxF0NS/g==", + "node_modules/module-details-from-path": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/module-details-from-path/-/module-details-from-path-1.0.4.tgz", + "integrity": "sha512-EGWKgxALGMgzvxYF1UyGTy0HXX/2vHLkw6+NvDKW2jypWbHpjQuj4UMcqQWXHERJhVGKikolT06G3bcKe4fi7w==", + "license": "MIT" + }, + "node_modules/mpg123-decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/mpg123-decoder/-/mpg123-decoder-1.0.3.tgz", + "integrity": "sha512-+fjxnWigodWJm3+4pndi+KUg9TBojgn31DPk85zEsim7C6s0X5Ztc/hQYdytXkwuGXH+aB0/aEkG40Emukv6oQ==", + "license": "MIT", "dependencies": { - "domhandler": "^5.0.3", - "parse5": "^7.0.0" + "@wasm-audio-decoders/common": "9.0.7" }, "funding": { - "url": "https://github.com/inikulin/parse5?sponsor=1" + "type": "individual", + "url": "https://github.com/sponsors/eshaz" } }, - "node_modules/parse5/node_modules/entities": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", - "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", - "engines": { - "node": ">=0.12" - }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" }, - "node_modules/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "node_modules/multer": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/multer/-/multer-2.0.2.tgz", + "integrity": "sha512-u7f2xaZ/UG8oLXHvtF/oWTRvT44p9ecwBBqTwgJVq0+4BW1g8OW01TyMEGWBHbyMOYVHXslaut7qEQ1meATXgw==", + "license": "MIT", + "dependencies": { + "append-field": "^1.0.0", + "busboy": "^1.6.0", + "concat-stream": "^2.0.0", + "mkdirp": "^0.5.6", + "object-assign": "^4.1.1", + "type-is": "^1.6.18", + "xtend": "^4.0.2" + }, "engines": { - "node": ">= 0.8" + "node": ">= 10.16.0" } }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "node_modules/music-metadata": { + "version": "11.10.3", + "resolved": "https://registry.npmjs.org/music-metadata/-/music-metadata-11.10.3.tgz", + "integrity": "sha512-j0g/x4cNNZW6I5gdcPAY+GFkJY9WHTpkFDMBJKQLxJQyvSfQbXm57fTE3haGFFuOzCgtsTd4Plwc49Sn9RacDQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + }, + { + "type": "buymeacoffee", + "url": "https://buymeacoffee.com/borewit" + } + ], + "license": "MIT", + "dependencies": { + "@borewit/text-codec": "^0.2.0", + "@tokenizer/token": "^0.3.0", + "content-type": "^1.0.5", + "debug": "^4.4.3", + "file-type": "^21.1.1", + "media-typer": "^1.1.0", + "strtok3": "^10.3.4", + "token-types": "^6.1.1", + "uint8array-extras": "^1.5.0" + }, "engines": { - "node": ">=8" + "node": ">=18" } }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, + "node_modules/music-metadata/node_modules/file-type": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-21.1.1.tgz", + "integrity": "sha512-ifJXo8zUqbQ/bLbl9sFoqHNTNWbnPY1COImFfM6CCy7z+E+jC1eY9YfOKkx0fckIg+VljAy2/87T61fp0+eEkg==", + "license": "MIT", + "dependencies": { + "@tokenizer/inflate": "^0.4.1", + "strtok3": "^10.3.4", + "token-types": "^6.1.1", + "uint8array-extras": "^1.4.0" + }, "engines": { - "node": ">=0.10.0" + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sindresorhus/file-type?sponsor=1" } }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "node_modules/music-metadata/node_modules/strtok3": { + "version": "10.3.4", + "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-10.3.4.tgz", + "integrity": "sha512-KIy5nylvC5le1OdaaoCJ07L+8iQzJHGH6pWDuzS+d07Cu7n1MZ2x26P8ZKIWfbK02+XIL8Mp4RkWeqdUCrDMfg==", + "license": "MIT", + "dependencies": { + "@tokenizer/token": "^0.3.0" + }, "engines": { - "node": ">=8" + "node": ">=18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" } }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" - }, - "node_modules/path-scurry": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", - "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "node_modules/music-metadata/node_modules/token-types": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/token-types/-/token-types-6.1.1.tgz", + "integrity": "sha512-kh9LVIWH5CnL63Ipf0jhlBIy0UsrMj/NJDfpsy1SqOXlLKEVyXXYrnFxFT1yOOYVGBSApeVnjPw/sBz5BfEjAQ==", + "license": "MIT", "dependencies": { - "lru-cache": "^10.2.0", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + "@borewit/text-codec": "^0.1.0", + "@tokenizer/token": "^0.3.0", + "ieee754": "^1.2.1" }, "engines": { - "node": ">=16 || 14 >=14.18" + "node": ">=14.16" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "type": "github", + "url": "https://github.com/sponsors/Borewit" } }, - "node_modules/path-to-regexp": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", - "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==" + "node_modules/music-metadata/node_modules/token-types/node_modules/@borewit/text-codec": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@borewit/text-codec/-/text-codec-0.1.1.tgz", + "integrity": "sha512-5L/uBxmjaCIX5h8Z+uu+kA9BQLkc/Wl06UGR5ajNRxu+/XjonB5i8JpgFMrPj3LXTCPA0pv8yxUvbUi+QthGGA==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "node_modules/mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", "dev": true, - "engines": { - "node": ">=8" - } + "license": "ISC" }, - "node_modules/pathe": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", - "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==" + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } }, - "node_modules/peek-readable": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-4.1.0.tgz", - "integrity": "sha512-ZI3LnwUv5nOGbQzD9c2iDG6toheuXSZP5esSHBjopsXH4dg19soufvpUGA3uohi5anFtGb2lhAVdHzH6R/Evvg==", + "node_modules/nano-spawn": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/nano-spawn/-/nano-spawn-2.0.0.tgz", + "integrity": "sha512-tacvGzUY5o2D8CBh2rrwxyNojUsZNU2zjNTzKQrkgGJQTbGAfArVWXSKMBokBeeg6C7OLRGUEyoFlYbfeWQIqw==", + "dev": true, + "license": "MIT", "engines": { - "node": ">=8" + "node": ">=20.17" }, "funding": { - "type": "github", - "url": "https://github.com/sponsors/Borewit" + "url": "https://github.com/sindresorhus/nano-spawn?sponsor=1" } }, - "node_modules/pg": { - "version": "8.16.3", - "resolved": "https://registry.npmjs.org/pg/-/pg-8.16.3.tgz", - "integrity": "sha512-enxc1h0jA/aq5oSDMvqyW3q89ra6XIIDZgCX9vkMrnz5DFTw/Ny3Li2lFQ+pt3L6MCgm/5o2o8HW9hiJji+xvw==", + "node_modules/nats": { + "version": "2.29.3", + "resolved": "https://registry.npmjs.org/nats/-/nats-2.29.3.tgz", + "integrity": "sha512-tOQCRCwC74DgBTk4pWZ9V45sk4d7peoE2njVprMRCBXrhJ5q5cYM7i6W+Uvw2qUrcfOSnuisrX7bEx3b3Wx4QA==", + "license": "Apache-2.0", "dependencies": { - "pg-connection-string": "^2.9.1", - "pg-pool": "^3.10.1", - "pg-protocol": "^1.10.3", - "pg-types": "2.2.0", - "pgpass": "1.0.5" + "nkeys.js": "1.1.0" }, "engines": { - "node": ">= 16.0.0" - }, - "optionalDependencies": { - "pg-cloudflare": "^1.2.7" - }, - "peerDependencies": { - "pg-native": ">=3.0.1" - }, - "peerDependenciesMeta": { - "pg-native": { - "optional": true - } + "node": ">= 14.0.0" } }, - "node_modules/pg-cloudflare": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.2.7.tgz", - "integrity": "sha512-YgCtzMH0ptvZJslLM1ffsY4EuGaU0cx4XSdXLRFae8bPP4dS5xL1tNB3k2o/N64cHJpwU7dxKli/nZ2lUa5fLg==", - "optional": true - }, - "node_modules/pg-connection-string": { - "version": "2.9.1", - "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.9.1.tgz", - "integrity": "sha512-nkc6NpDcvPVpZXxrreI/FOtX3XemeLl8E0qFr6F2Lrm/I8WOnaWNhIPK2Z7OHpw7gh5XJThi6j6ppgNoaT1w4w==" + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" }, - "node_modules/pg-int8": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", - "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==", + "node_modules/negotiator": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.4.tgz", + "integrity": "sha512-myRT3DiWPHqho5PrJaIRyaMv2kgYf0mUVgBNOYMuCH5Ki1yEiQaf/ZJuQ62nvpc44wL5WDbTX7yGJi1Neevw8w==", + "license": "MIT", "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/pg-pool": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.10.1.tgz", - "integrity": "sha512-Tu8jMlcX+9d8+QVzKIvM/uJtp07PKr82IUOYEphaWcoBhIYkoHpLXN3qO59nAI11ripznDsEzEv8nUxBVWajGg==", - "peerDependencies": { - "pg": ">=8.0" + "node": ">= 0.6" } }, - "node_modules/pg-protocol": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.10.3.tgz", - "integrity": "sha512-6DIBgBQaTKDJyxnXaLiLR8wBpQQcGWuAESkRBX/t6OwA8YsqP+iVSiond2EDy6Y/dsGk8rh/jtax3js5NeV7JQ==" - }, - "node_modules/pg-types": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", - "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", + "node_modules/nkeys.js": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/nkeys.js/-/nkeys.js-1.1.0.tgz", + "integrity": "sha512-tB/a0shZL5UZWSwsoeyqfTszONTt4k2YS0tuQioMOD180+MbombYVgzDUYHlx+gejYK6rgf08n/2Df99WY0Sxg==", + "license": "Apache-2.0", "dependencies": { - "pg-int8": "1.0.1", - "postgres-array": "~2.0.0", - "postgres-bytea": "~1.0.0", - "postgres-date": "~1.0.4", - "postgres-interval": "^1.1.0" + "tweetnacl": "1.0.3" }, "engines": { - "node": ">=4" + "node": ">=10.0.0" } }, - "node_modules/pgpass": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz", - "integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==", + "node_modules/node-cache": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/node-cache/-/node-cache-5.1.2.tgz", + "integrity": "sha512-t1QzWwnk4sjLWaQAS8CHgOJ+RAfmHpxFWmc36IWTiWHQfs0w5JDMBS1b1ZxQteo0vVVuWJvIUKHDkkeK7vIGCg==", + "license": "MIT", "dependencies": { - "split2": "^4.1.0" - } - }, - "node_modules/picocolors": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==" - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "engines": { - "node": ">=8.6" + "clone": "2.x" }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" + "engines": { + "node": ">= 8.0.0" } }, - "node_modules/pino": { - "version": "8.21.0", - "resolved": "https://registry.npmjs.org/pino/-/pino-8.21.0.tgz", - "integrity": "sha512-ip4qdzjkAyDDZklUaZkcRFb2iA118H9SgRh8yzTkSQK8HilsOJF7rSY8HoW5+I0M46AZgX/pxbprf2vvzQCE0Q==", + "node_modules/node-cron": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/node-cron/-/node-cron-3.0.3.tgz", + "integrity": "sha512-dOal67//nohNgYWb+nWmg5dkFdIwDm8EpeGYMekPMrngV3637lqnX0lbUcCtgibHTz6SEz7DAIjKvKDFYCnO1A==", + "license": "ISC", "dependencies": { - "atomic-sleep": "^1.0.0", - "fast-redact": "^3.1.1", - "on-exit-leak-free": "^2.1.0", - "pino-abstract-transport": "^1.2.0", - "pino-std-serializers": "^6.0.0", - "process-warning": "^3.0.0", - "quick-format-unescaped": "^4.0.3", - "real-require": "^0.2.0", - "safe-stable-stringify": "^2.3.1", - "sonic-boom": "^3.7.0", - "thread-stream": "^2.6.0" + "uuid": "8.3.2" }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/node-cron/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "license": "MIT", "bin": { - "pino": "bin.js" + "uuid": "dist/bin/uuid" } }, - "node_modules/pino-abstract-transport": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-1.2.0.tgz", - "integrity": "sha512-Guhh8EZfPCfH+PMXAb6rKOjGQEoy0xlAIn+irODG5kgfYV+BQ0rGYYWTIel3P5mmyXqkYkPmdIkywsn6QKUR1Q==", - "dependencies": { - "readable-stream": "^4.0.0", - "split2": "^4.0.0" - } - }, - "node_modules/pino-abstract-transport/node_modules/readable-stream": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.7.0.tgz", - "integrity": "sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg==", - "dependencies": { - "abort-controller": "^3.0.0", - "buffer": "^6.0.3", - "events": "^3.3.0", - "process": "^0.11.10", - "string_decoder": "^1.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/pino-std-serializers": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-6.2.2.tgz", - "integrity": "sha512-cHjPPsE+vhj/tnhCy/wiMh3M3z3h/j15zHQX+S9GkTBgqJuTuJzYJ4gUyACLhDaJ7kk9ba9iRDmbH2tJU03OiA==" - }, - "node_modules/pirates": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", - "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", - "engines": { - "node": ">= 6" - } - }, - "node_modules/pixelmatch": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/pixelmatch/-/pixelmatch-5.3.0.tgz", - "integrity": "sha512-o8mkY4E/+LNUf6LzX96ht6k6CEDi65k9G2rjMtBe9Oo+VPKSvl+0GKHuH/AlG+GA5LPG/i5hrekkxUc3s2HU+Q==", - "dependencies": { - "pngjs": "^6.0.0" - }, - "bin": { - "pixelmatch": "bin/pixelmatch" - } - }, - "node_modules/pixelmatch/node_modules/pngjs": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-6.0.0.tgz", - "integrity": "sha512-TRzzuFRRmEoSW/p1KVAmiOgPco2Irlah+bGFCeNfJXxxYGwSw7YwAOAcd7X28K/m5bjBWKsC29KyoMfHbypayg==", - "engines": { - "node": ">=12.13.0" - } - }, - "node_modules/pkg-types": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.3.1.tgz", - "integrity": "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==", - "dependencies": { - "confbox": "^0.1.8", - "mlly": "^1.7.4", - "pathe": "^2.0.1" - } - }, - "node_modules/pngjs": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-7.0.0.tgz", - "integrity": "sha512-LKWqWJRhstyYo9pGvgor/ivk2w94eSjE3RGVuzLGlr3NmD8bf7RcYGze1mNdEHRP6TRP6rMuDHk5t44hnTRyow==", - "engines": { - "node": ">=14.19.0" - } - }, - "node_modules/possible-typed-array-names": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", - "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/postcss-load-config": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-6.0.1.tgz", - "integrity": "sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==", + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "deprecated": "Use your platform's native DOMException instead", "funding": [ { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" }, { "type": "github", - "url": "https://github.com/sponsors/ai" + "url": "https://paypal.me/jimmywarting" } ], + "license": "MIT", + "engines": { + "node": ">=10.5.0" + } + }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "license": "MIT", "dependencies": { - "lilconfig": "^3.1.1" + "whatwg-url": "^5.0.0" }, "engines": { - "node": ">= 18" + "node": "4.x || >=6.0.0" }, "peerDependencies": { - "jiti": ">=1.21.0", - "postcss": ">=8.0.9", - "tsx": "^4.8.1", - "yaml": "^2.4.2" + "encoding": "^0.1.0" }, "peerDependenciesMeta": { - "jiti": { - "optional": true - }, - "postcss": { - "optional": true - }, - "tsx": { - "optional": true - }, - "yaml": { + "encoding": { "optional": true } } }, - "node_modules/postgres-array": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", - "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==", + "node_modules/node-fetch-native": { + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/node-fetch-native/-/node-fetch-native-1.6.7.tgz", + "integrity": "sha512-g9yhqoedzIUm0nTnTqAQvueMPVOuIY16bqgAJJC8XOOubYFNwz6IER9qs0Gq2Xd0+CecCKFjtdDTMA4u4xG06Q==", + "license": "MIT" + }, + "node_modules/node-wav": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/node-wav/-/node-wav-0.0.2.tgz", + "integrity": "sha512-M6Rm/bbG6De/gKGxOpeOobx/dnGuP0dz40adqx38boqHhlWssBJZgLCPBNtb9NkrmnKYiV04xELq+R6PFOnoLA==", + "license": "MIT", "engines": { - "node": ">=4" + "node": ">=4.4.0" } }, - "node_modules/postgres-bytea": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", - "integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==", + "node_modules/nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "license": "BSD-2-Clause", + "dependencies": { + "boolbase": "^1.0.0" + }, + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" + } + }, + "node_modules/nypm": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/nypm/-/nypm-0.6.2.tgz", + "integrity": "sha512-7eM+hpOtrKrBDCh7Ypu2lJ9Z7PNZBdi/8AT3AX8xoCj43BBVHD0hPSTEvMtkMpfs8FCqBGhxB+uToIQimA111g==", + "license": "MIT", + "dependencies": { + "citty": "^0.1.6", + "consola": "^3.4.2", + "pathe": "^2.0.3", + "pkg-types": "^2.3.0", + "tinyexec": "^1.0.1" + }, + "bin": { + "nypm": "dist/cli.mjs" + }, "engines": { - "node": ">=0.10.0" + "node": "^14.16.0 || >=16.10.0" } }, - "node_modules/postgres-date": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", - "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", "engines": { "node": ">=0.10.0" } }, - "node_modules/postgres-interval": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", - "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", - "dependencies": { - "xtend": "^4.0.0" - }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true, + "license": "MIT", "engines": { - "node": ">= 0.8.0" + "node": ">= 0.4" } }, - "node_modules/prettier": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz", - "integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==", + "node_modules/object.assign": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", + "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", "dev": true, - "bin": { - "prettier": "bin/prettier.cjs" + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0", + "has-symbols": "^1.1.0", + "object-keys": "^1.1.1" }, "engines": { - "node": ">=14" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/prettier-linter-helpers": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", - "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "node_modules/object.fromentries": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", + "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", "dev": true, + "license": "MIT", "dependencies": { - "fast-diff": "^1.1.2" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" }, "engines": { - "node": ">=6.0.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/prisma": { - "version": "6.11.1", - "resolved": "https://registry.npmjs.org/prisma/-/prisma-6.11.1.tgz", - "integrity": "sha512-VzJToRlV0s9Vu2bfqHiRJw73hZNCG/AyJeX+kopbu4GATTjTUdEWUteO3p4BLYoHpMS4o8pD3v6tF44BHNZI1w==", - "hasInstallScript": true, + "node_modules/object.groupby": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", + "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", + "dev": true, + "license": "MIT", "dependencies": { - "@prisma/config": "6.11.1", - "@prisma/engines": "6.11.1" - }, - "bin": { - "prisma": "build/index.js" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2" }, "engines": { - "node": ">=18.18" - }, - "peerDependencies": { - "typescript": ">=5.1.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "node": ">= 0.4" } }, - "node_modules/process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", - "engines": { - "node": ">= 0.6.0" - } - }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" - }, - "node_modules/process-warning": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-3.0.0.tgz", - "integrity": "sha512-mqn0kFRl0EoqhnL0GQ0veqFHyIN1yig9RHh/InzORTUiZHFRAur+aMtRkELNwGs9aNwKS6tg/An4NYBPGwvtzQ==" - }, - "node_modules/protobufjs": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.3.tgz", - "integrity": "sha512-sildjKwVqOI2kmFDiXQ6aEB0fjYTafpEvIBs8tOR8qI4spuL9OPROLVu2qZqi/xgCfsHIwVqlaF8JBjWFHnKbw==", - "hasInstallScript": true, + "node_modules/object.values": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.1.tgz", + "integrity": "sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA==", + "dev": true, + "license": "MIT", "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/node": ">=13.7.0", - "long": "^5.0.0" + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" }, "engines": { - "node": ">=12.0.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/proxy-addr": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "node_modules/ogg-opus-decoder": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/ogg-opus-decoder/-/ogg-opus-decoder-1.7.3.tgz", + "integrity": "sha512-w47tiZpkLgdkpa+34VzYD8mHUj8I9kfWVZa82mBbNwDvB1byfLXSSzW/HxA4fI3e9kVlICSpXGFwMLV1LPdjwg==", + "license": "MIT", "dependencies": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" + "@wasm-audio-decoders/common": "9.0.7", + "@wasm-audio-decoders/opus-ml": "0.0.2", + "codec-parser": "2.5.0", + "opus-decoder": "0.7.11" }, - "engines": { - "node": ">= 0.10" + "funding": { + "type": "individual", + "url": "https://github.com/sponsors/eshaz" } }, - "node_modules/proxy-addr/node_modules/ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", - "engines": { - "node": ">= 0.10" - } + "node_modules/ohash": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/ohash/-/ohash-2.0.11.tgz", + "integrity": "sha512-RdR9FQrFwNBNXAr4GixM8YaRZRJ5PUWbKYbE5eOsrwAjJW0q2REGcf79oYPsLyskQCZG1PLN+S/K1V00joZAoQ==", + "license": "MIT" }, - "node_modules/proxy-from-env": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + "node_modules/omggif": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/omggif/-/omggif-1.0.10.tgz", + "integrity": "sha512-LMJTtvgc/nugXj0Vcrrs68Mn2D1r0zf630VNtqtpI1FEO7e+O9FP4gqs9AcnBaSEeoHIPm28u6qgPR0oyEpGSw==", + "license": "MIT" }, - "node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "node_modules/on-exit-leak-free": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/on-exit-leak-free/-/on-exit-leak-free-2.1.2.tgz", + "integrity": "sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==", + "license": "MIT", "engines": { - "node": ">=6" + "node": ">=14.0.0" } }, - "node_modules/pusher": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/pusher/-/pusher-5.2.0.tgz", - "integrity": "sha512-F6LNiZyJsIkoHLz+YurjKZ1HH8V1/cMggn4k97kihjP3uTvm0P4mZzSFeHOWIy+PlJ2VInJBhUFJBYLsFR5cjg==", + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", "dependencies": { - "@types/node-fetch": "^2.5.7", - "abort-controller": "^3.0.0", - "is-base64": "^1.1.0", - "node-fetch": "^2.6.1", - "tweetnacl": "^1.0.0", - "tweetnacl-util": "^0.15.0" + "ee-first": "1.1.1" }, "engines": { - "node": ">= 4.0.0" + "node": ">= 0.8" } }, - "node_modules/qoa-format": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/qoa-format/-/qoa-format-1.0.1.tgz", - "integrity": "sha512-dMB0Z6XQjdpz/Cw4Rf6RiBpQvUSPCfYlQMWvmuWlWkAT7nDQD29cVZ1SwDUB6DYJSitHENwbt90lqfI+7bvMcw==", + "node_modules/on-headers": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.1.0.tgz", + "integrity": "sha512-737ZY3yNnXy37FHkQxPzt4UZ2UWPWiCZWLvFZ4fu5cueciegX0zGPnrlY6bwRg4FdQOe9YU8MkmJwGhoMybl8A==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "license": "ISC", "dependencies": { - "@thi.ng/bitstream": "^2.2.12" + "wrappy": "1" } }, - "node_modules/qrcode": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.5.4.tgz", - "integrity": "sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg==", + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "license": "MIT", "dependencies": { - "dijkstrajs": "^1.0.1", - "pngjs": "^5.0.0", - "yargs": "^15.3.1" - }, - "bin": { - "qrcode": "bin/qrcode" + "mimic-fn": "^2.1.0" }, "engines": { - "node": ">=10.13.0" + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/qrcode-terminal": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/qrcode-terminal/-/qrcode-terminal-0.12.0.tgz", - "integrity": "sha512-EXtzRZmC+YGmGlDFbXKxQiMZNwCLEO6BANKXG4iCtSIM0yqc/pappSx3RIKr4r0uh5JsBckOXeKrB3Iz7mdQpQ==", + "node_modules/openai": { + "version": "4.104.0", + "resolved": "https://registry.npmjs.org/openai/-/openai-4.104.0.tgz", + "integrity": "sha512-p99EFNsA/yX6UhVO93f5kJsDRLAg+CTA2RBqdHK4RtK8u5IJw32Hyb2dTGKbnnFmnuoBv5r7Z2CURI9sGZpSuA==", + "license": "Apache-2.0", + "dependencies": { + "@types/node": "^18.11.18", + "@types/node-fetch": "^2.6.4", + "abort-controller": "^3.0.0", + "agentkeepalive": "^4.2.1", + "form-data-encoder": "1.7.2", + "formdata-node": "^4.3.2", + "node-fetch": "^2.6.7" + }, "bin": { - "qrcode-terminal": "bin/qrcode-terminal.js" + "openai": "bin/cli" + }, + "peerDependencies": { + "ws": "^8.18.0", + "zod": "^3.23.8" + }, + "peerDependenciesMeta": { + "ws": { + "optional": true + }, + "zod": { + "optional": true + } } }, - "node_modules/qrcode/node_modules/cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "node_modules/openai/node_modules/@types/node": { + "version": "18.19.130", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.130.tgz", + "integrity": "sha512-GRaXQx6jGfL8sKfaIDD6OupbIHBr9jv7Jnaml9tB7l4v068PAOXqfcujMMo5PhbIs6ggR1XODELqahT2R8v0fg==", + "license": "MIT", "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" + "undici-types": "~5.26.4" } }, - "node_modules/qrcode/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "node_modules/openai/node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "license": "MIT" + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" }, "engines": { - "node": ">=8" + "node": ">= 0.8.0" } }, - "node_modules/qrcode/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "node_modules/opus-decoder": { + "version": "0.7.11", + "resolved": "https://registry.npmjs.org/opus-decoder/-/opus-decoder-0.7.11.tgz", + "integrity": "sha512-+e+Jz3vGQLxRTBHs8YJQPRPc1Tr+/aC6coV/DlZylriA29BdHQAYXhvNRKtjftof17OFng0+P4wsFIqQu3a48A==", + "license": "MIT", "dependencies": { - "p-locate": "^4.1.0" + "@wasm-audio-decoders/common": "9.0.7" }, - "engines": { - "node": ">=8" + "funding": { + "type": "individual", + "url": "https://github.com/sponsors/eshaz" } }, - "node_modules/qrcode/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "node_modules/ora": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", + "dev": true, + "license": "MIT", "dependencies": { - "p-try": "^2.0.0" + "bl": "^4.1.0", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" }, "engines": { - "node": ">=6" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/qrcode/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "node_modules/ora/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", "dependencies": { - "p-limit": "^2.2.0" + "color-convert": "^2.0.1" }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/qrcode/node_modules/pngjs": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz", - "integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==", + "node_modules/ora/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/qrcode/node_modules/wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/ora/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" + "color-name": "~1.1.4" }, "engines": { - "node": ">=8" + "node": ">=7.0.0" } }, - "node_modules/qrcode/node_modules/y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" + "node_modules/ora/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" }, - "node_modules/qrcode/node_modules/yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", - "dependencies": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" - }, + "node_modules/ora/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, - "node_modules/qrcode/node_modules/yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "node_modules/ora/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=6" + "node": ">=8" } }, - "node_modules/qs": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", - "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/own-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz", + "integrity": "sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==", + "dev": true, + "license": "MIT", "dependencies": { - "side-channel": "^1.0.6" + "get-intrinsic": "^1.2.6", + "object-keys": "^1.1.1", + "safe-push-apply": "^1.0.0" }, "engines": { - "node": ">=0.6" + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/query-string": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/query-string/-/query-string-7.1.3.tgz", - "integrity": "sha512-hh2WYhq4fi8+b+/2Kg9CEge4fDPvHS534aOOvOZeQ3+Vf2mCFsaFBYj0i+iXcAq6I9Vzp5fjMFBlONvayDC1qg==", + "node_modules/p-limit": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "dev": true, + "license": "MIT", "dependencies": { - "decode-uri-component": "^0.2.2", - "filter-obj": "^1.1.0", - "split-on-first": "^1.0.0", - "strict-uri-encode": "^2.0.0" + "yocto-queue": "^1.0.0" }, "engines": { - "node": ">=6" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/querystring": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g==", - "deprecated": "The querystring API is considered Legacy. new code should use the URLSearchParams API instead.", + "node_modules/p-locate": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", + "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^4.0.0" + }, "engines": { - "node": ">=0.4.x" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/querystringify": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", - "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==" - }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] + "node_modules/p-queue": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-9.0.1.tgz", + "integrity": "sha512-RhBdVhSwJb7Ocn3e8ULk4NMwBEuOxe+1zcgphUy9c2e5aR/xbEsdVXxHJ3lynw6Qiqu7OINEyHlZkiblEpaq7w==", + "license": "MIT", + "dependencies": { + "eventemitter3": "^5.0.1", + "p-timeout": "^7.0.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "node_modules/quick-format-unescaped": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz", - "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==" + "node_modules/p-timeout": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-7.0.1.tgz", + "integrity": "sha512-AxTM2wDGORHGEkPCt8yqxOTMgpfbEHqF51f/5fJCmwFC3C/zNcGT63SymH2ttOAaiIws2zVg4+izQCjrakcwHg==", + "license": "MIT", + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "license": "MIT", "engines": { - "node": ">= 0.6" + "node": ">=6" } }, - "node_modules/raw-body": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", - "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "node_modules/pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", + "license": "(MIT AND Zlib)" + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "license": "MIT", "dependencies": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" + "callsites": "^3.0.0" }, "engines": { - "node": ">= 0.8" + "node": ">=6" } }, - "node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "node_modules/parse-bmfont-ascii": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/parse-bmfont-ascii/-/parse-bmfont-ascii-1.0.6.tgz", + "integrity": "sha512-U4RrVsUFCleIOBsIGYOMKjn9PavsGOXxbvYGtMOEfnId0SVNsgehXh1DxUdVPLoxd5mvcEtvmKs2Mmf0Mpa1ZA==", + "license": "MIT" + }, + "node_modules/parse-bmfont-binary": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/parse-bmfont-binary/-/parse-bmfont-binary-1.0.6.tgz", + "integrity": "sha512-GxmsRea0wdGdYthjuUeWTMWPqm2+FAd4GI8vCvhgJsFnoGhTrLhXDDupwTo7rXVAgaLIGoVHDZS9p/5XbSqeWA==", + "license": "MIT" + }, + "node_modules/parse-bmfont-xml": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/parse-bmfont-xml/-/parse-bmfont-xml-1.1.6.tgz", + "integrity": "sha512-0cEliVMZEhrFDwMh4SxIyVJpqYoOWDJ9P895tFuS+XuNzI5UBmBk5U5O4KuJdTnZpSBI4LFA2+ZiJaiwfSwlMA==", + "license": "MIT", "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" + "xml-parse-from-string": "^1.0.0", + "xml2js": "^0.5.0" + } + }, + "node_modules/parse-bmfont-xml/node_modules/xml2js": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.5.0.tgz", + "integrity": "sha512-drPFnkQJik/O+uPKpqSgr22mpuFHqKdbS835iAQrUC73L2F5WkboIRd63ai/2Yg6I1jzifPFKH2NTK+cfglkIA==", + "license": "MIT", + "dependencies": { + "sax": ">=0.6.0", + "xmlbuilder": "~11.0.0" }, "engines": { - "node": ">= 6" + "node": ">=4.0.0" } }, - "node_modules/readable-web-to-node-stream": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/readable-web-to-node-stream/-/readable-web-to-node-stream-3.0.4.tgz", - "integrity": "sha512-9nX56alTf5bwXQ3ZDipHJhusu9NTQJ/CVPtb/XHAJCXihZeitfJvIRS4GqQ/mfIoOE3IelHMrpayVrosdHBuLw==", + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "license": "MIT", "dependencies": { - "readable-stream": "^4.7.0" + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" }, "engines": { "node": ">=8" }, "funding": { - "type": "github", - "url": "https://github.com/sponsors/Borewit" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/readable-web-to-node-stream/node_modules/readable-stream": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.7.0.tgz", - "integrity": "sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg==", - "dependencies": { - "abort-controller": "^3.0.0", - "buffer": "^6.0.3", - "events": "^3.3.0", - "process": "^0.11.10", - "string_decoder": "^1.3.0" - }, + "node_modules/parse-passwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q==", + "dev": true, + "license": "MIT", "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": ">=0.10.0" } }, - "node_modules/real-require": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/real-require/-/real-require-0.2.0.tgz", - "integrity": "sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==", - "engines": { - "node": ">= 12.13.0" - } - }, - "node_modules/redis": { - "version": "4.7.1", - "resolved": "https://registry.npmjs.org/redis/-/redis-4.7.1.tgz", - "integrity": "sha512-S1bJDnqLftzHXHP8JsT5II/CtHWQrASX5K96REjWjlmWKrviSOLWmM7QnRLstAWsu1VBBV1ffV6DzCvxNP0UJQ==", - "dependencies": { - "@redis/bloom": "1.2.0", - "@redis/client": "1.6.1", - "@redis/graph": "1.1.1", - "@redis/json": "1.0.7", - "@redis/search": "1.2.0", - "@redis/time-series": "1.1.0" - } - }, - "node_modules/reflect.getprototypeof": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", - "integrity": "sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==", - "dev": true, + "node_modules/parse5": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz", + "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==", + "license": "MIT", "dependencies": { - "call-bind": "^1.0.8", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.9", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", - "get-intrinsic": "^1.2.7", - "get-proto": "^1.0.1", - "which-builtin-type": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" + "entities": "^6.0.0" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/inikulin/parse5?sponsor=1" } }, - "node_modules/regexp.prototype.flags": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", - "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==", - "dev": true, + "node_modules/parse5-htmlparser2-tree-adapter": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.1.0.tgz", + "integrity": "sha512-ruw5xyKs6lrpo9x9rCZqZZnIUntICjQAd0Wsmp396Ul9lN/h+ifgVV1x1gZHi8euej6wTfpqX8j+BFQxF0NS/g==", + "license": "MIT", "dependencies": { - "call-bind": "^1.0.8", - "define-properties": "^1.2.1", - "es-errors": "^1.3.0", - "get-proto": "^1.0.1", - "gopd": "^1.2.0", - "set-function-name": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" + "domhandler": "^5.0.3", + "parse5": "^7.0.0" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/inikulin/parse5?sponsor=1" } }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "node_modules/parse5/node_modules/entities": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", + "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", + "license": "BSD-2-Clause", "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/require-in-the-middle": { - "version": "7.5.2", - "resolved": "https://registry.npmjs.org/require-in-the-middle/-/require-in-the-middle-7.5.2.tgz", - "integrity": "sha512-gAZ+kLqBdHarXB64XpAe2VCjB7rIRv+mU8tfRWziHRJ5umKsIHN2tLLv6EtMw7WCdP19S0ERVMldNvxYCHnhSQ==", - "dependencies": { - "debug": "^4.3.5", - "module-details-from-path": "^1.0.3", - "resolve": "^1.22.8" + "node": ">=0.12" }, - "engines": { - "node": ">=8.6.0" + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" } }, - "node_modules/require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" - }, - "node_modules/requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" - }, - "node_modules/resolve": { - "version": "1.22.10", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", - "integrity": "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==", - "dependencies": { - "is-core-module": "^2.16.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">= 0.8" } }, - "node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", "dev": true, + "license": "MIT", "engines": { - "node": ">=4" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, - "node_modules/resolve-pkg-maps": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", - "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", - "devOptional": true, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, "license": "MIT", - "funding": { - "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + "engines": { + "node": ">=0.10.0" } }, - "node_modules/reusify": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", - "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, + "license": "MIT", "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "deprecated": "Rimraf versions prior to v4 are no longer supported", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "license": "MIT" + }, + "node_modules/path-to-regexp": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", + "license": "MIT" + }, + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "license": "MIT" + }, + "node_modules/peek-readable": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-4.1.0.tgz", + "integrity": "sha512-ZI3LnwUv5nOGbQzD9c2iDG6toheuXSZP5esSHBjopsXH4dg19soufvpUGA3uohi5anFtGb2lhAVdHzH6R/Evvg==", + "license": "MIT", + "engines": { + "node": ">=8" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "type": "github", + "url": "https://github.com/sponsors/Borewit" } }, - "node_modules/rollup": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.44.2.tgz", - "integrity": "sha512-PVoapzTwSEcelaWGth3uR66u7ZRo6qhPHc0f2uRO9fX6XDVNrIiGYS0Pj9+R8yIIYSD/mCx2b16Ws9itljKSPg==", + "node_modules/perfect-debounce": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/perfect-debounce/-/perfect-debounce-1.0.0.tgz", + "integrity": "sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==", + "license": "MIT" + }, + "node_modules/pg": { + "version": "8.16.3", + "resolved": "https://registry.npmjs.org/pg/-/pg-8.16.3.tgz", + "integrity": "sha512-enxc1h0jA/aq5oSDMvqyW3q89ra6XIIDZgCX9vkMrnz5DFTw/Ny3Li2lFQ+pt3L6MCgm/5o2o8HW9hiJji+xvw==", + "license": "MIT", "dependencies": { - "@types/estree": "1.0.8" - }, - "bin": { - "rollup": "dist/bin/rollup" + "pg-connection-string": "^2.9.1", + "pg-pool": "^3.10.1", + "pg-protocol": "^1.10.3", + "pg-types": "2.2.0", + "pgpass": "1.0.5" }, "engines": { - "node": ">=18.0.0", - "npm": ">=8.0.0" + "node": ">= 16.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.44.2", - "@rollup/rollup-android-arm64": "4.44.2", - "@rollup/rollup-darwin-arm64": "4.44.2", - "@rollup/rollup-darwin-x64": "4.44.2", - "@rollup/rollup-freebsd-arm64": "4.44.2", - "@rollup/rollup-freebsd-x64": "4.44.2", - "@rollup/rollup-linux-arm-gnueabihf": "4.44.2", - "@rollup/rollup-linux-arm-musleabihf": "4.44.2", - "@rollup/rollup-linux-arm64-gnu": "4.44.2", - "@rollup/rollup-linux-arm64-musl": "4.44.2", - "@rollup/rollup-linux-loongarch64-gnu": "4.44.2", - "@rollup/rollup-linux-powerpc64le-gnu": "4.44.2", - "@rollup/rollup-linux-riscv64-gnu": "4.44.2", - "@rollup/rollup-linux-riscv64-musl": "4.44.2", - "@rollup/rollup-linux-s390x-gnu": "4.44.2", - "@rollup/rollup-linux-x64-gnu": "4.44.2", - "@rollup/rollup-linux-x64-musl": "4.44.2", - "@rollup/rollup-win32-arm64-msvc": "4.44.2", - "@rollup/rollup-win32-ia32-msvc": "4.44.2", - "@rollup/rollup-win32-x64-msvc": "4.44.2", - "fsevents": "~2.3.2" - } - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" + "pg-cloudflare": "^1.2.7" + }, + "peerDependencies": { + "pg-native": ">=3.0.1" + }, + "peerDependenciesMeta": { + "pg-native": { + "optional": true } - ], - "dependencies": { - "queue-microtask": "^1.2.2" } }, - "node_modules/rxjs": { - "version": "7.8.2", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", - "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.1.0" - } + "node_modules/pg-cloudflare": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.2.7.tgz", + "integrity": "sha512-YgCtzMH0ptvZJslLM1ffsY4EuGaU0cx4XSdXLRFae8bPP4dS5xL1tNB3k2o/N64cHJpwU7dxKli/nZ2lUa5fLg==", + "license": "MIT", + "optional": true }, - "node_modules/safe-array-concat": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.3.tgz", - "integrity": "sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.2", - "get-intrinsic": "^1.2.6", - "has-symbols": "^1.1.0", - "isarray": "^2.0.5" - }, + "node_modules/pg-connection-string": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.9.1.tgz", + "integrity": "sha512-nkc6NpDcvPVpZXxrreI/FOtX3XemeLl8E0qFr6F2Lrm/I8WOnaWNhIPK2Z7OHpw7gh5XJThi6j6ppgNoaT1w4w==", + "license": "MIT" + }, + "node_modules/pg-int8": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", + "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==", + "license": "ISC", "engines": { - "node": ">=0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=4.0.0" } }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] + "node_modules/pg-pool": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.10.1.tgz", + "integrity": "sha512-Tu8jMlcX+9d8+QVzKIvM/uJtp07PKr82IUOYEphaWcoBhIYkoHpLXN3qO59nAI11ripznDsEzEv8nUxBVWajGg==", + "license": "MIT", + "peerDependencies": { + "pg": ">=8.0" + } }, - "node_modules/safe-push-apply": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz", - "integrity": "sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==", - "dev": true, + "node_modules/pg-protocol": { + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.10.3.tgz", + "integrity": "sha512-6DIBgBQaTKDJyxnXaLiLR8wBpQQcGWuAESkRBX/t6OwA8YsqP+iVSiond2EDy6Y/dsGk8rh/jtax3js5NeV7JQ==", + "license": "MIT" + }, + "node_modules/pg-types": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", + "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", + "license": "MIT", "dependencies": { - "es-errors": "^1.3.0", - "isarray": "^2.0.5" + "pg-int8": "1.0.1", + "postgres-array": "~2.0.0", + "postgres-bytea": "~1.0.0", + "postgres-date": "~1.0.4", + "postgres-interval": "^1.1.0" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=4" } }, - "node_modules/safe-regex-test": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", - "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", + "node_modules/pgpass": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz", + "integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==", + "license": "MIT", "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "is-regex": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "split2": "^4.1.0" } }, - "node_modules/safe-stable-stringify": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz", - "integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==", + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", "engines": { - "node": ">=10" + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "node_modules/sax": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz", - "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==" - }, - "node_modules/semver": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", - "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "node_modules/pidtree": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.6.0.tgz", + "integrity": "sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==", + "dev": true, + "license": "MIT", "bin": { - "semver": "bin/semver.js" + "pidtree": "bin/pidtree.js" }, "engines": { - "node": ">=10" + "node": ">=0.10" } }, - "node_modules/send": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", - "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", + "node_modules/pino": { + "version": "9.14.0", + "resolved": "https://registry.npmjs.org/pino/-/pino-9.14.0.tgz", + "integrity": "sha512-8OEwKp5juEvb/MjpIc4hjqfgCNysrS94RIOMXYvpYCdm/jglrKEiAYmiumbmGhCvs+IcInsphYDFwqrjr7398w==", + "license": "MIT", "dependencies": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "2.4.1", - "range-parser": "~1.2.1", - "statuses": "2.0.1" + "@pinojs/redact": "^0.4.0", + "atomic-sleep": "^1.0.0", + "on-exit-leak-free": "^2.1.0", + "pino-abstract-transport": "^2.0.0", + "pino-std-serializers": "^7.0.0", + "process-warning": "^5.0.0", + "quick-format-unescaped": "^4.0.3", + "real-require": "^0.2.0", + "safe-stable-stringify": "^2.3.1", + "sonic-boom": "^4.0.1", + "thread-stream": "^3.0.0" }, - "engines": { - "node": ">= 0.8.0" + "bin": { + "pino": "bin.js" } }, - "node_modules/send/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "node_modules/pino-abstract-transport": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-2.0.0.tgz", + "integrity": "sha512-F63x5tizV6WCh4R6RHyi2Ml+M70DNRXt/+HANowMflpgGFMAym/VKm6G7ZOQRjqN7XbGxK1Lg9t6ZrtzOaivMw==", + "license": "MIT", "dependencies": { - "ms": "2.0.0" + "split2": "^4.0.0" } }, - "node_modules/send/node_modules/debug/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + "node_modules/pino-std-serializers": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-7.0.0.tgz", + "integrity": "sha512-e906FRY0+tV27iq4juKzSYPbUj2do2X2JX4EzSca1631EB2QJQUqGbDuERal7LCtOpxl6x3+nvo9NPZcmjkiFA==", + "license": "MIT" }, - "node_modules/send/node_modules/encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "node_modules/pirates": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", + "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", + "license": "MIT", "engines": { - "node": ">= 0.8" + "node": ">= 6" } }, - "node_modules/send/node_modules/mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "bin": { - "mime": "cli.js" + "node_modules/pixelmatch": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/pixelmatch/-/pixelmatch-5.3.0.tgz", + "integrity": "sha512-o8mkY4E/+LNUf6LzX96ht6k6CEDi65k9G2rjMtBe9Oo+VPKSvl+0GKHuH/AlG+GA5LPG/i5hrekkxUc3s2HU+Q==", + "license": "ISC", + "dependencies": { + "pngjs": "^6.0.0" }, + "bin": { + "pixelmatch": "bin/pixelmatch" + } + }, + "node_modules/pixelmatch/node_modules/pngjs": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-6.0.0.tgz", + "integrity": "sha512-TRzzuFRRmEoSW/p1KVAmiOgPco2Irlah+bGFCeNfJXxxYGwSw7YwAOAcd7X28K/m5bjBWKsC29KyoMfHbypayg==", + "license": "MIT", "engines": { - "node": ">=4" + "node": ">=12.13.0" } }, - "node_modules/serve-static": { - "version": "1.16.2", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", - "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", + "node_modules/pkg-types": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-2.3.0.tgz", + "integrity": "sha512-SIqCzDRg0s9npO5XQ3tNZioRY1uK06lA41ynBC1YmFTmnY6FjUjVt6s4LoADmwoig1qqD0oK8h1p/8mlMx8Oig==", + "license": "MIT", "dependencies": { - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.19.0" - }, - "engines": { - "node": ">= 0.8.0" + "confbox": "^0.2.2", + "exsolve": "^1.0.7", + "pathe": "^2.0.3" } }, - "node_modules/set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" + "node_modules/pngjs": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-7.0.0.tgz", + "integrity": "sha512-LKWqWJRhstyYo9pGvgor/ivk2w94eSjE3RGVuzLGlr3NmD8bf7RcYGze1mNdEHRP6TRP6rMuDHk5t44hnTRyow==", + "license": "MIT", + "engines": { + "node": ">=14.19.0" + } }, - "node_modules/set-function-length": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", - "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.2" - }, + "node_modules/possible-typed-array-names": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", + "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", + "license": "MIT", "engines": { "node": ">= 0.4" } }, - "node_modules/set-function-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", - "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", - "dev": true, + "node_modules/postcss-load-config": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-6.0.1.tgz", + "integrity": "sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "functions-have-names": "^1.2.3", - "has-property-descriptors": "^1.0.2" + "lilconfig": "^3.1.1" }, "engines": { - "node": ">= 0.4" + "node": ">= 18" + }, + "peerDependencies": { + "jiti": ">=1.21.0", + "postcss": ">=8.0.9", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + }, + "postcss": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } } }, - "node_modules/set-proto": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/set-proto/-/set-proto-1.0.0.tgz", - "integrity": "sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==", - "dev": true, - "dependencies": { - "dunder-proto": "^1.0.1", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0" - }, + "node_modules/postgres-array": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", + "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==", + "license": "MIT", "engines": { - "node": ">= 0.4" + "node": ">=4" } }, - "node_modules/setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + "node_modules/postgres-bytea": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", + "integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } }, - "node_modules/sharp": { - "version": "0.34.2", - "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.34.2.tgz", - "integrity": "sha512-lszvBmB9QURERtyKT2bNmsgxXK0ShJrL/fvqlonCo7e6xBF8nT8xU6pW+PMIbLsz0RxQk3rgH9kd8UmvOzlMJg==", - "hasInstallScript": true, - "dependencies": { - "color": "^4.2.3", - "detect-libc": "^2.0.4", - "semver": "^7.7.2" - }, + "node_modules/postgres-date": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", + "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", + "license": "MIT", "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "funding": { - "url": "https://opencollective.com/libvips" - }, - "optionalDependencies": { - "@img/sharp-darwin-arm64": "0.34.2", - "@img/sharp-darwin-x64": "0.34.2", - "@img/sharp-libvips-darwin-arm64": "1.1.0", - "@img/sharp-libvips-darwin-x64": "1.1.0", - "@img/sharp-libvips-linux-arm": "1.1.0", - "@img/sharp-libvips-linux-arm64": "1.1.0", - "@img/sharp-libvips-linux-ppc64": "1.1.0", - "@img/sharp-libvips-linux-s390x": "1.1.0", - "@img/sharp-libvips-linux-x64": "1.1.0", - "@img/sharp-libvips-linuxmusl-arm64": "1.1.0", - "@img/sharp-libvips-linuxmusl-x64": "1.1.0", - "@img/sharp-linux-arm": "0.34.2", - "@img/sharp-linux-arm64": "0.34.2", - "@img/sharp-linux-s390x": "0.34.2", - "@img/sharp-linux-x64": "0.34.2", - "@img/sharp-linuxmusl-arm64": "0.34.2", - "@img/sharp-linuxmusl-x64": "0.34.2", - "@img/sharp-wasm32": "0.34.2", - "@img/sharp-win32-arm64": "0.34.2", - "@img/sharp-win32-ia32": "0.34.2", - "@img/sharp-win32-x64": "0.34.2" + "node": ">=0.10.0" } }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "node_modules/postgres-interval": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", + "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", + "license": "MIT", "dependencies": { - "shebang-regex": "^3.0.0" + "xtend": "^4.0.0" }, "engines": { - "node": ">=8" + "node": ">=0.10.0" } }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", "engines": { - "node": ">=8" + "node": ">= 0.8.0" } }, - "node_modules/shimmer": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/shimmer/-/shimmer-1.2.1.tgz", - "integrity": "sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==" - }, - "node_modules/side-channel": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", - "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", - "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.3", - "side-channel-list": "^1.0.0", - "side-channel-map": "^1.0.1", - "side-channel-weakmap": "^1.0.2" + "node_modules/prettier": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz", + "integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">= 0.4" + "node": ">=14" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/prettier/prettier?sponsor=1" } }, - "node_modules/side-channel-list": { + "node_modules/prettier-linter-helpers": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", - "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "license": "MIT", "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.3" + "fast-diff": "^1.1.2" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=6.0.0" } }, - "node_modules/side-channel-map": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", - "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "node_modules/prisma": { + "version": "6.19.0", + "resolved": "https://registry.npmjs.org/prisma/-/prisma-6.19.0.tgz", + "integrity": "sha512-F3eX7K+tWpkbhl3l4+VkFtrwJlLXbAM+f9jolgoUZbFcm1DgHZ4cq9AgVEgUym2au5Ad/TDLN8lg83D+M10ycw==", + "hasInstallScript": true, + "license": "Apache-2.0", "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3" - }, - "engines": { - "node": ">= 0.4" + "@prisma/config": "6.19.0", + "@prisma/engines": "6.19.0" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-weakmap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", - "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3", - "side-channel-map": "^1.0.1" + "bin": { + "prisma": "build/index.js" }, "engines": { - "node": ">= 0.4" + "node": ">=18.18" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "peerDependencies": { + "typescript": ">=5.1.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, - "node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", + "license": "MIT", "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": ">= 0.6.0" } }, - "node_modules/simple-swizzle": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", - "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", - "dependencies": { - "is-arrayish": "^0.3.1" - } + "node_modules/process-warning": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-5.0.0.tgz", + "integrity": "sha512-a39t9ApHNx2L4+HBnQKqxxHNs1r7KF+Intd8Q/g1bUh6q0WIp9voPXJ/x0j+ZL45KF1pJd9+q2jLIRMfvEshkA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT" }, - "node_modules/simple-xml-to-json": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/simple-xml-to-json/-/simple-xml-to-json-1.2.3.tgz", - "integrity": "sha512-kWJDCr9EWtZ+/EYYM5MareWj2cRnZGF93YDNpH4jQiHB+hBIZnfPFSQiVMzZOdk+zXWqTZ/9fTeQNu2DqeiudA==", + "node_modules/protobufjs": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.4.tgz", + "integrity": "sha512-CvexbZtbov6jW2eXAvLukXjXUW1TzFaivC46BpWc/3BpcCysb5Vffu+B3XHMm8lVEuy2Mm4XGex8hBSg1yapPg==", + "hasInstallScript": true, + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + }, "engines": { - "node": ">=20.12.2" + "node": ">=12.0.0" } }, - "node_modules/simple-yenc": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/simple-yenc/-/simple-yenc-1.0.4.tgz", - "integrity": "sha512-5gvxpSd79e9a3V4QDYUqnqxeD4HGlhCakVpb6gMnDD7lexJggSBJRBO5h52y/iJrdXRilX9UCuDaIJhSWm5OWw==", - "funding": { - "type": "individual", - "url": "https://github.com/sponsors/eshaz" + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" } }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, + "node_modules/proxy-addr/node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", "engines": { - "node": ">=8" + "node": ">= 0.10" } }, - "node_modules/smart-buffer": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", - "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "license": "MIT" + }, + "node_modules/punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw==", + "license": "MIT" + }, + "node_modules/pure-rand": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", + "integrity": "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ], + "license": "MIT" + }, + "node_modules/pusher": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/pusher/-/pusher-5.2.0.tgz", + "integrity": "sha512-F6LNiZyJsIkoHLz+YurjKZ1HH8V1/cMggn4k97kihjP3uTvm0P4mZzSFeHOWIy+PlJ2VInJBhUFJBYLsFR5cjg==", "license": "MIT", + "dependencies": { + "@types/node-fetch": "^2.5.7", + "abort-controller": "^3.0.0", + "is-base64": "^1.1.0", + "node-fetch": "^2.6.1", + "tweetnacl": "^1.0.0", + "tweetnacl-util": "^0.15.0" + }, "engines": { - "node": ">= 6.0.0", - "npm": ">= 3.0.0" + "node": ">= 4.0.0" } }, - "node_modules/socket.io": { - "version": "4.8.1", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.8.1.tgz", - "integrity": "sha512-oZ7iUCxph8WYRHHcjBEc9unw3adt5CmSNlppj/5Q4k2RIrhl8Z5yY2Xr4j9zj0+wzVZ0bxmYoGSzKJnRl6A4yg==", + "node_modules/qified": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/qified/-/qified-0.5.2.tgz", + "integrity": "sha512-7gJ6mxcQb9vUBOtbKm5mDevbe2uRcOEVp1g4gb/Q+oLntB3HY8eBhOYRxFI2mlDFlY1e4DOSCptzxarXRvzxCA==", + "license": "MIT", "dependencies": { - "accepts": "~1.3.4", - "base64id": "~2.0.0", - "cors": "~2.8.5", - "debug": "~4.3.2", - "engine.io": "~6.6.0", - "socket.io-adapter": "~2.5.2", - "socket.io-parser": "~4.2.4" + "hookified": "^1.13.0" }, "engines": { - "node": ">=10.2.0" + "node": ">=20" } }, - "node_modules/socket.io-adapter": { - "version": "2.5.5", - "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.5.tgz", - "integrity": "sha512-eLDQas5dzPgOWCk9GuuJC2lBqItuhKI4uxGgo9aIV7MYbk2h9Q6uULEh8WBzThoI7l+qU9Ast9fVUmkqPP9wYg==", + "node_modules/qoa-format": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/qoa-format/-/qoa-format-1.0.1.tgz", + "integrity": "sha512-dMB0Z6XQjdpz/Cw4Rf6RiBpQvUSPCfYlQMWvmuWlWkAT7nDQD29cVZ1SwDUB6DYJSitHENwbt90lqfI+7bvMcw==", + "license": "MIT", "dependencies": { - "debug": "~4.3.4", - "ws": "~8.17.1" + "@thi.ng/bitstream": "^2.2.12" } }, - "node_modules/socket.io-adapter/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "node_modules/qrcode": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.5.4.tgz", + "integrity": "sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg==", + "license": "MIT", "dependencies": { - "ms": "^2.1.3" + "dijkstrajs": "^1.0.1", + "pngjs": "^5.0.0", + "yargs": "^15.3.1" }, - "engines": { - "node": ">=6.0" + "bin": { + "qrcode": "bin/qrcode" }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "engines": { + "node": ">=10.13.0" } }, - "node_modules/socket.io-adapter/node_modules/ws": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", - "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": ">=5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } + "node_modules/qrcode-terminal": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/qrcode-terminal/-/qrcode-terminal-0.12.0.tgz", + "integrity": "sha512-EXtzRZmC+YGmGlDFbXKxQiMZNwCLEO6BANKXG4iCtSIM0yqc/pappSx3RIKr4r0uh5JsBckOXeKrB3Iz7mdQpQ==", + "bin": { + "qrcode-terminal": "bin/qrcode-terminal.js" } }, - "node_modules/socket.io-client": { - "version": "4.8.1", - "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.8.1.tgz", - "integrity": "sha512-hJVXfu3E28NmzGk8o1sHhN3om52tRvwYeidbj7xKy2eIIse5IoKX3USlS6Tqt3BHAtflLIkCQBkzVrEEfWUyYQ==", + "node_modules/qrcode/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", "dependencies": { - "@socket.io/component-emitter": "~3.1.0", - "debug": "~4.3.2", - "engine.io-client": "~6.6.1", - "socket.io-parser": "~4.2.4" + "color-convert": "^2.0.1" }, "engines": { - "node": ">=10.0.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/socket.io-client/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "node_modules/qrcode/node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "license": "ISC", "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" } }, - "node_modules/socket.io-parser": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.4.tgz", - "integrity": "sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==", + "node_modules/qrcode/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", "dependencies": { - "@socket.io/component-emitter": "~3.1.0", - "debug": "~4.3.1" + "color-name": "~1.1.4" }, "engines": { - "node": ">=10.0.0" + "node": ">=7.0.0" } }, - "node_modules/socket.io-parser/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "node_modules/qrcode/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" + }, + "node_modules/qrcode/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "license": "MIT", "dependencies": { - "ms": "^2.1.3" + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" }, "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "node": ">=8" } }, - "node_modules/socket.io/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "node_modules/qrcode/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "license": "MIT", "dependencies": { - "ms": "^2.1.3" + "p-locate": "^4.1.0" }, "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "node": ">=8" } }, - "node_modules/socks": { - "version": "2.8.6", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.6.tgz", - "integrity": "sha512-pe4Y2yzru68lXCb38aAqRf5gvN8YdjP1lok5o0J7BOHljkyCGKVz7H3vpVIXKD27rj2giOJ7DwVyk/GWrPHDWA==", + "node_modules/qrcode/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "license": "MIT", "dependencies": { - "ip-address": "^9.0.5", - "smart-buffer": "^4.2.0" + "p-try": "^2.0.0" }, "engines": { - "node": ">= 10.0.0", - "npm": ">= 3.0.0" + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/socks-proxy-agent": { - "version": "8.0.5", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz", - "integrity": "sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==", + "node_modules/qrcode/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "license": "MIT", "dependencies": { - "agent-base": "^7.1.2", - "debug": "^4.3.4", - "socks": "^2.8.3" + "p-limit": "^2.2.0" }, "engines": { - "node": ">= 14" - } - }, - "node_modules/sonic-boom": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-3.8.1.tgz", - "integrity": "sha512-y4Z8LCDBuum+PBP3lSV7RHrXscqksve/bi0as7mhwVnBW+/wUqKT/2Kb7um8yqcFy0duYbbPxzt89Zy2nOCaxg==", - "dependencies": { - "atomic-sleep": "^1.0.0" - } - }, - "node_modules/split-on-first": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz", - "integrity": "sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==", - "engines": { - "node": ">=6" - } - }, - "node_modules/split2": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", - "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", - "engines": { - "node": ">= 10.x" - } - }, - "node_modules/sprintf-js": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", - "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", - "license": "BSD-3-Clause" - }, - "node_modules/statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/stop-iteration-iterator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz", - "integrity": "sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==", - "dev": true, - "dependencies": { - "es-errors": "^1.3.0", - "internal-slot": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/stream-chain": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/stream-chain/-/stream-chain-2.2.5.tgz", - "integrity": "sha512-1TJmBx6aSWqZ4tx7aTpBDXK0/e2hhcNSTV8+CbFJtDjbb+I1mZ8lHit0Grw9GRT+6JbIrrDd8esncgBi8aBXGA==" - }, - "node_modules/stream-json": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/stream-json/-/stream-json-1.9.1.tgz", - "integrity": "sha512-uWkjJ+2Nt/LO9Z/JyKZbMusL8Dkh97uUBTv3AJQ74y07lVahLY4eEFsPsE97pxYBwr8nnjMAIch5eqI0gPShyw==", - "dependencies": { - "stream-chain": "^2.2.5" + "node": ">=8" } }, - "node_modules/streamsearch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", - "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "node_modules/qrcode/node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "license": "MIT", "engines": { - "node": ">=10.0.0" + "node": ">=8" } }, - "node_modules/strict-uri-encode": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz", - "integrity": "sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ==", + "node_modules/qrcode/node_modules/pngjs": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz", + "integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==", + "license": "MIT", "engines": { - "node": ">=4" - } - }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dependencies": { - "safe-buffer": "~5.2.0" + "node": ">=10.13.0" } }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "node_modules/qrcode/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "license": "MIT", "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" }, "engines": { "node": ">=8" } }, - "node_modules/string-width-cjs": { - "name": "string-width", - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "node_modules/qrcode/node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "license": "ISC" + }, + "node_modules/qrcode/node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "license": "MIT", "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" }, "engines": { "node": ">=8" } }, - "node_modules/string-width-cjs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "license": "MIT" - }, - "node_modules/string-width/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "license": "MIT" - }, - "node_modules/string.prototype.trim": { - "version": "1.2.10", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz", - "integrity": "sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==", - "dev": true, + "node_modules/qrcode/node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "license": "ISC", "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.2", - "define-data-property": "^1.1.4", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.5", - "es-object-atoms": "^1.0.0", - "has-property-descriptors": "^1.0.2" + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=6" } }, - "node_modules/string.prototype.trimend": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz", - "integrity": "sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==", - "dev": true, + "node_modules/qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "license": "BSD-3-Clause", "dependencies": { - "call-bind": "^1.0.8", - "call-bound": "^1.0.2", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.0.0" + "side-channel": "^1.0.6" }, "engines": { - "node": ">= 0.4" + "node": ">=0.6" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/string.prototype.trimstart": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", - "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", - "dev": true, + "node_modules/query-string": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-7.1.3.tgz", + "integrity": "sha512-hh2WYhq4fi8+b+/2Kg9CEge4fDPvHS534aOOvOZeQ3+Vf2mCFsaFBYj0i+iXcAq6I9Vzp5fjMFBlONvayDC1qg==", + "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.0.0" + "decode-uri-component": "^0.2.2", + "filter-obj": "^1.1.0", + "split-on-first": "^1.0.0", + "strict-uri-encode": "^2.0.0" }, "engines": { - "node": ">= 0.4" + "node": ">=6" }, "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/strip-ansi-cjs": { - "name": "strip-ansi", - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dependencies": { - "ansi-regex": "^5.0.1" - }, + "node_modules/querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g==", + "deprecated": "The querystring API is considered Legacy. new code should use the URLSearchParams API instead.", "engines": { - "node": ">=8" + "node": ">=0.4.x" } }, - "node_modules/strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", - "dev": true, - "engines": { - "node": ">=4" - } + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "license": "MIT" }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/strnum": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.1.2.tgz", - "integrity": "sha512-vrN+B7DBIoTTZjnPNewwhx6cBA/H+IS7rfW68n7XxC1y7uoiGQBxaKzqucGUgavX15dJgiGztLJ8vxuEzwqBdA==", "funding": [ { "type": "github", - "url": "https://github.com/sponsors/NaturalIntelligence" + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, - "node_modules/strtok3": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-6.3.0.tgz", - "integrity": "sha512-fZtbhtvI9I48xDSywd/somNqgUHl2L2cstmXCCif0itOf96jeW18MBSyrLuNicYQVkvpOxkZtkzujiTJ9LW5Jw==", - "dependencies": { - "@tokenizer/token": "^0.3.0", - "peek-readable": "^4.1.0" - }, + "node_modules/quick-format-unescaped": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz", + "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==", + "license": "MIT" + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", "engines": { - "node": ">=10" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Borewit" + "node": ">= 0.6" } }, - "node_modules/sucrase": { - "version": "3.35.0", - "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.0.tgz", - "integrity": "sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==", + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "license": "MIT", "dependencies": { - "@jridgewell/gen-mapping": "^0.3.2", - "commander": "^4.0.0", - "glob": "^10.3.10", - "lines-and-columns": "^1.1.6", - "mz": "^2.7.0", - "pirates": "^4.0.1", - "ts-interface-checker": "^0.1.9" - }, - "bin": { - "sucrase": "bin/sucrase", - "sucrase-node": "bin/sucrase-node" + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": ">= 0.8" } }, - "node_modules/sucrase/node_modules/glob": { - "version": "10.4.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", - "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "node_modules/rc9": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/rc9/-/rc9-2.1.2.tgz", + "integrity": "sha512-btXCnMmRIBINM2LDZoEmOogIZU7Qe7zn4BpomSKZ/ykbLObuBdvG+mFq11DL6fjH1DRwHhrlgtYWG96bJiC7Cg==", + "license": "MIT", "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^3.1.2", - "minimatch": "^9.0.4", - "minipass": "^7.1.2", - "package-json-from-dist": "^1.0.0", - "path-scurry": "^1.11.1" - }, - "bin": { - "glob": "dist/esm/bin.mjs" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "defu": "^6.1.4", + "destr": "^2.0.3" } }, - "node_modules/sucrase/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", "dependencies": { - "brace-expansion": "^2.0.1" + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" }, "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": ">= 6" } }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, + "node_modules/readable-web-to-node-stream": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/readable-web-to-node-stream/-/readable-web-to-node-stream-3.0.4.tgz", + "integrity": "sha512-9nX56alTf5bwXQ3ZDipHJhusu9NTQJ/CVPtb/XHAJCXihZeitfJvIRS4GqQ/mfIoOE3IelHMrpayVrosdHBuLw==", + "license": "MIT", "dependencies": { - "has-flag": "^4.0.0" + "readable-stream": "^4.7.0" }, "engines": { "node": ">=8" - } - }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "engines": { - "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "type": "github", + "url": "https://github.com/sponsors/Borewit" } }, - "node_modules/swagger-ui-dist": { - "version": "5.26.2", - "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-5.26.2.tgz", - "integrity": "sha512-WmMS9iMlHQejNm/Uw5ZTo4e3M2QMmEavRz7WLWVsq7Mlx4PSHJbY+VCrLsAz9wLxyHVgrJdt7N8+SdQLa52Ykg==", + "node_modules/readable-web-to-node-stream/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", "dependencies": { - "@scarf/scarf": "=1.4.0" + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" } }, - "node_modules/swagger-ui-express": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/swagger-ui-express/-/swagger-ui-express-5.0.1.tgz", - "integrity": "sha512-SrNU3RiBGTLLmFU8GIJdOdanJTl4TOmT27tt3bWWHppqYmAZ6IDuEuBvMU6nZq0zLEe6b/1rACXCgLZqO6ZfrA==", + "node_modules/readable-web-to-node-stream/node_modules/readable-stream": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.7.0.tgz", + "integrity": "sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg==", + "license": "MIT", "dependencies": { - "swagger-ui-dist": ">=5.0.0" + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" }, "engines": { - "node": ">= v0.10.32" - }, - "peerDependencies": { - "express": ">=4.0.0 || >=5.0.0-beta" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/synckit": { - "version": "0.11.8", - "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.11.8.tgz", - "integrity": "sha512-+XZ+r1XGIJGeQk3VvXhT6xx/VpbHsRzsTkGgF6E5RX9TTXD0118l87puaEBZ566FhqblC6U0d4XnubznJDm30A==", - "dev": true, - "dependencies": { - "@pkgr/core": "^0.2.4" - }, + "node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "license": "MIT", "engines": { - "node": "^14.18.0 || >=16.0.0" + "node": ">= 14.18.0" }, "funding": { - "url": "https://opencollective.com/synckit" + "type": "individual", + "url": "https://paulmillr.com/funding/" } }, - "node_modules/text-table": { + "node_modules/real-require": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true - }, - "node_modules/thenify": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", - "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", - "dependencies": { - "any-promise": "^1.0.0" - } - }, - "node_modules/thenify-all": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", - "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", - "dependencies": { - "thenify": ">= 3.1.0 < 4" - }, + "resolved": "https://registry.npmjs.org/real-require/-/real-require-0.2.0.tgz", + "integrity": "sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==", + "license": "MIT", "engines": { - "node": ">=0.8" + "node": ">= 12.13.0" } }, - "node_modules/thread-stream": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-2.7.0.tgz", - "integrity": "sha512-qQiRWsU/wvNolI6tbbCKd9iKaTnCXsTwVxhhKM6nctPdujTyztjlbUkUTUymidWcMnZ5pWR0ej4a0tjsW021vw==", + "node_modules/redis": { + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/redis/-/redis-4.7.1.tgz", + "integrity": "sha512-S1bJDnqLftzHXHP8JsT5II/CtHWQrASX5K96REjWjlmWKrviSOLWmM7QnRLstAWsu1VBBV1ffV6DzCvxNP0UJQ==", + "license": "MIT", + "workspaces": [ + "./packages/*" + ], "dependencies": { - "real-require": "^0.2.0" + "@redis/bloom": "1.2.0", + "@redis/client": "1.6.1", + "@redis/graph": "1.1.1", + "@redis/json": "1.0.7", + "@redis/search": "1.2.0", + "@redis/time-series": "1.1.0" } }, - "node_modules/through2": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", - "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", + "node_modules/reflect.getprototypeof": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", + "integrity": "sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==", + "dev": true, + "license": "MIT", "dependencies": { - "readable-stream": "3" + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.9", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.7", + "get-proto": "^1.0.1", + "which-builtin-type": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/tinycolor2": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.6.0.tgz", - "integrity": "sha512-XPaBkWQJdsf3pLKJV9p4qN/S+fm2Oj8AIPo1BTUhg5oxkvm9+SVEGFdhyOz7tTdUTfvxMiAs4sp6/eZO2Ew+pw==" - }, - "node_modules/tinyexec": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", - "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==" - }, - "node_modules/tinyglobby": { - "version": "0.2.14", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.14.tgz", - "integrity": "sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==", + "node_modules/regexp.prototype.flags": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", + "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==", + "dev": true, + "license": "MIT", "dependencies": { - "fdir": "^6.4.4", - "picomatch": "^4.0.2" + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "set-function-name": "^2.0.2" }, "engines": { - "node": ">=12.0.0" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/SuperchupuDev" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/tinyglobby/node_modules/fdir": { - "version": "6.4.6", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.6.tgz", - "integrity": "sha512-hiFoqpyZcfNm1yc4u8oWCf9A2c4D3QjCrks3zmoVKVxpQRzmPNar1hUJcBG2RQHvEVGDN+Jm81ZheVLAQMK6+w==", - "peerDependencies": { - "picomatch": "^3 || ^4" - }, - "peerDependenciesMeta": { - "picomatch": { - "optional": true - } + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" } }, - "node_modules/tinyglobby/node_modules/picomatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", - "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "license": "MIT", "engines": { - "node": ">=12" + "node": ">=0.10.0" + } + }, + "node_modules/require-in-the-middle": { + "version": "7.5.2", + "resolved": "https://registry.npmjs.org/require-in-the-middle/-/require-in-the-middle-7.5.2.tgz", + "integrity": "sha512-gAZ+kLqBdHarXB64XpAe2VCjB7rIRv+mU8tfRWziHRJ5umKsIHN2tLLv6EtMw7WCdP19S0ERVMldNvxYCHnhSQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.3.5", + "module-details-from-path": "^1.0.3", + "resolve": "^1.22.8" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "license": "ISC" + }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "license": "MIT" + }, + "node_modules/resolve": { + "version": "1.22.11", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.11.tgz", + "integrity": "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==", + "license": "MIT", + "dependencies": { + "is-core-module": "^2.16.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/jonschlinkert" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "node_modules/resolve-dir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", + "integrity": "sha512-R7uiTjECzvOsWSfdM0QKFNBVFcK27aHOUwdvK53BcW8zqnGdYp0Fbj82cy54+2A4P2tFM22J5kRfe1R+lM/1yg==", "dev": true, + "license": "MIT", "dependencies": { - "is-number": "^7.0.0" + "expand-tilde": "^2.0.0", + "global-modules": "^1.0.0" }, "engines": { - "node": ">=8.0" + "node": ">=0.10.0" } }, - "node_modules/toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "license": "MIT", "engines": { - "node": ">=0.6" + "node": ">=8" } }, - "node_modules/token-types": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/token-types/-/token-types-4.2.1.tgz", - "integrity": "sha512-6udB24Q737UD/SDsKAHI9FCRP7Bqc9D/MQUV02ORQg5iskjtLJlZJNdN4kKtcdtwCeWIwIHDGaUsTsCCAa8sFQ==", + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "devOptional": true, + "license": "MIT", + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, + "node_modules/restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "license": "MIT", "dependencies": { - "@tokenizer/token": "^0.3.0", - "ieee754": "^1.2.1" + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" }, "engines": { - "node": ">=10" + "node": ">=8" + } + }, + "node_modules/reusify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rfdc": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", + "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", + "dev": true, + "license": "MIT" + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" }, "funding": { - "type": "github", - "url": "https://github.com/sponsors/Borewit" + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" - }, - "node_modules/tree-kill": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", - "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "node_modules/rollup": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.53.3.tgz", + "integrity": "sha512-w8GmOxZfBmKknvdXU1sdM9NHcoQejwF/4mNgj2JuEEdRaHwwF12K7e9eXn1nLZ07ad+du76mkVsyeb2rKGllsA==", + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.8" + }, "bin": { - "tree-kill": "cli.js" + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.53.3", + "@rollup/rollup-android-arm64": "4.53.3", + "@rollup/rollup-darwin-arm64": "4.53.3", + "@rollup/rollup-darwin-x64": "4.53.3", + "@rollup/rollup-freebsd-arm64": "4.53.3", + "@rollup/rollup-freebsd-x64": "4.53.3", + "@rollup/rollup-linux-arm-gnueabihf": "4.53.3", + "@rollup/rollup-linux-arm-musleabihf": "4.53.3", + "@rollup/rollup-linux-arm64-gnu": "4.53.3", + "@rollup/rollup-linux-arm64-musl": "4.53.3", + "@rollup/rollup-linux-loong64-gnu": "4.53.3", + "@rollup/rollup-linux-ppc64-gnu": "4.53.3", + "@rollup/rollup-linux-riscv64-gnu": "4.53.3", + "@rollup/rollup-linux-riscv64-musl": "4.53.3", + "@rollup/rollup-linux-s390x-gnu": "4.53.3", + "@rollup/rollup-linux-x64-gnu": "4.53.3", + "@rollup/rollup-linux-x64-musl": "4.53.3", + "@rollup/rollup-openharmony-arm64": "4.53.3", + "@rollup/rollup-win32-arm64-msvc": "4.53.3", + "@rollup/rollup-win32-ia32-msvc": "4.53.3", + "@rollup/rollup-win32-x64-gnu": "4.53.3", + "@rollup/rollup-win32-x64-msvc": "4.53.3", + "fsevents": "~2.3.2" } }, - "node_modules/ts-api-utils": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.3.tgz", - "integrity": "sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==", + "node_modules/run-async": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", "dev": true, + "license": "MIT", "engines": { - "node": ">=16" - }, - "peerDependencies": { - "typescript": ">=4.2.0" + "node": ">=0.12.0" } }, - "node_modules/ts-interface-checker": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", - "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==" + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } }, - "node_modules/tsconfig-paths": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz", - "integrity": "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==", + "node_modules/rxjs": { + "version": "7.8.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", + "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/safe-array-concat": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.3.tgz", + "integrity": "sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==", "dev": true, + "license": "MIT", "dependencies": { - "json5": "^2.2.2", - "minimist": "^1.2.6", - "strip-bom": "^3.0.0" + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "has-symbols": "^1.1.0", + "isarray": "^2.0.5" }, "engines": { - "node": ">=6" + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/tslib": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", - "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" }, - "node_modules/tsup": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/tsup/-/tsup-8.5.0.tgz", - "integrity": "sha512-VmBp77lWNQq6PfuMqCHD3xWl22vEoWsKajkF8t+yMBawlUS8JzEI+vOVMeuNZIuMML8qXRizFKi9oD5glKQVcQ==", + "node_modules/safe-push-apply": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz", + "integrity": "sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==", + "dev": true, + "license": "MIT", "dependencies": { - "bundle-require": "^5.1.0", - "cac": "^6.7.14", - "chokidar": "^4.0.3", - "consola": "^3.4.0", - "debug": "^4.4.0", - "esbuild": "^0.25.0", - "fix-dts-default-cjs-exports": "^1.0.0", - "joycon": "^3.1.1", - "picocolors": "^1.1.1", - "postcss-load-config": "^6.0.1", - "resolve-from": "^5.0.0", - "rollup": "^4.34.8", - "source-map": "0.8.0-beta.0", - "sucrase": "^3.35.0", - "tinyexec": "^0.3.2", - "tinyglobby": "^0.2.11", - "tree-kill": "^1.2.2" + "es-errors": "^1.3.0", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-regex-test": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", + "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-regex": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-stable-stringify": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz", + "integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/sax": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.3.tgz", + "integrity": "sha512-yqYn1JhPczigF94DMS+shiDMjDowYO6y9+wB/4WgO0Y19jWYk0lQ4tuG5KI7kj4FTp1wxPj5IFfcrz/s1c3jjQ==", + "license": "BlueOak-1.0.0" + }, + "node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "license": "ISC", "bin": { - "tsup": "dist/cli-default.js", - "tsup-node": "dist/cli-node.js" + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/send": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/send/node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/send/node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/send/node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/serve-static": { + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", + "license": "MIT", + "dependencies": { + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.19.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "license": "ISC" + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-proto": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/set-proto/-/set-proto-1.0.0.tgz", + "integrity": "sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/sharp": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.34.5.tgz", + "integrity": "sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg==", + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@img/colour": "^1.0.0", + "detect-libc": "^2.1.2", + "semver": "^7.7.3" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-darwin-arm64": "0.34.5", + "@img/sharp-darwin-x64": "0.34.5", + "@img/sharp-libvips-darwin-arm64": "1.2.4", + "@img/sharp-libvips-darwin-x64": "1.2.4", + "@img/sharp-libvips-linux-arm": "1.2.4", + "@img/sharp-libvips-linux-arm64": "1.2.4", + "@img/sharp-libvips-linux-ppc64": "1.2.4", + "@img/sharp-libvips-linux-riscv64": "1.2.4", + "@img/sharp-libvips-linux-s390x": "1.2.4", + "@img/sharp-libvips-linux-x64": "1.2.4", + "@img/sharp-libvips-linuxmusl-arm64": "1.2.4", + "@img/sharp-libvips-linuxmusl-x64": "1.2.4", + "@img/sharp-linux-arm": "0.34.5", + "@img/sharp-linux-arm64": "0.34.5", + "@img/sharp-linux-ppc64": "0.34.5", + "@img/sharp-linux-riscv64": "0.34.5", + "@img/sharp-linux-s390x": "0.34.5", + "@img/sharp-linux-x64": "0.34.5", + "@img/sharp-linuxmusl-arm64": "0.34.5", + "@img/sharp-linuxmusl-x64": "0.34.5", + "@img/sharp-wasm32": "0.34.5", + "@img/sharp-win32-arm64": "0.34.5", + "@img/sharp-win32-ia32": "0.34.5", + "@img/sharp-win32-x64": "0.34.5" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/shimmer": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/shimmer/-/shimmer-1.2.1.tgz", + "integrity": "sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==", + "license": "BSD-2-Clause" + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/simple-xml-to-json": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/simple-xml-to-json/-/simple-xml-to-json-1.2.3.tgz", + "integrity": "sha512-kWJDCr9EWtZ+/EYYM5MareWj2cRnZGF93YDNpH4jQiHB+hBIZnfPFSQiVMzZOdk+zXWqTZ/9fTeQNu2DqeiudA==", + "license": "MIT", + "engines": { + "node": ">=20.12.2" + } + }, + "node_modules/simple-yenc": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/simple-yenc/-/simple-yenc-1.0.4.tgz", + "integrity": "sha512-5gvxpSd79e9a3V4QDYUqnqxeD4HGlhCakVpb6gMnDD7lexJggSBJRBO5h52y/iJrdXRilX9UCuDaIJhSWm5OWw==", + "license": "MIT", + "funding": { + "type": "individual", + "url": "https://github.com/sponsors/eshaz" + } + }, + "node_modules/slice-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.2.tgz", + "integrity": "sha512-iOBWFgUX7caIZiuutICxVgX1SdxwAVFFKwt1EvMYYec/NWO5meOJ6K5uQxhrYBdQJne4KxiqZc+KptFOWFSI9w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "is-fullwidth-code-point": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "license": "MIT", + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socket.io": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.8.1.tgz", + "integrity": "sha512-oZ7iUCxph8WYRHHcjBEc9unw3adt5CmSNlppj/5Q4k2RIrhl8Z5yY2Xr4j9zj0+wzVZ0bxmYoGSzKJnRl6A4yg==", + "license": "MIT", + "dependencies": { + "accepts": "~1.3.4", + "base64id": "~2.0.0", + "cors": "~2.8.5", + "debug": "~4.3.2", + "engine.io": "~6.6.0", + "socket.io-adapter": "~2.5.2", + "socket.io-parser": "~4.2.4" + }, + "engines": { + "node": ">=10.2.0" + } + }, + "node_modules/socket.io-adapter": { + "version": "2.5.5", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.5.tgz", + "integrity": "sha512-eLDQas5dzPgOWCk9GuuJC2lBqItuhKI4uxGgo9aIV7MYbk2h9Q6uULEh8WBzThoI7l+qU9Ast9fVUmkqPP9wYg==", + "license": "MIT", + "dependencies": { + "debug": "~4.3.4", + "ws": "~8.17.1" + } + }, + "node_modules/socket.io-adapter/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/socket.io-adapter/node_modules/ws": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/socket.io-client": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.8.1.tgz", + "integrity": "sha512-hJVXfu3E28NmzGk8o1sHhN3om52tRvwYeidbj7xKy2eIIse5IoKX3USlS6Tqt3BHAtflLIkCQBkzVrEEfWUyYQ==", + "license": "MIT", + "dependencies": { + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.3.2", + "engine.io-client": "~6.6.1", + "socket.io-parser": "~4.2.4" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/socket.io-client/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/socket.io-parser": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.4.tgz", + "integrity": "sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==", + "license": "MIT", + "dependencies": { + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.3.1" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/socket.io-parser/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/socket.io/node_modules/debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/socks": { + "version": "2.8.7", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.7.tgz", + "integrity": "sha512-HLpt+uLy/pxB+bum/9DzAgiKS8CX1EvbWxI4zlmgGCExImLdiad2iCwXT5Z4c9c3Eq8rP2318mPW2c+QbtjK8A==", + "license": "MIT", + "dependencies": { + "ip-address": "^10.0.1", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz", + "integrity": "sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "^4.3.4", + "socks": "^2.8.3" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/sonic-boom": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-4.2.0.tgz", + "integrity": "sha512-INb7TM37/mAcsGmc9hyyI6+QR3rR1zVRu36B0NeGXKnOOLiZOfER5SA+N7X7k3yUYRzLWafduTDvJAfDswwEww==", + "license": "MIT", + "dependencies": { + "atomic-sleep": "^1.0.0" + } + }, + "node_modules/source-map": { + "version": "0.7.6", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz", + "integrity": "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==", + "license": "BSD-3-Clause", + "engines": { + "node": ">= 12" + } + }, + "node_modules/split-on-first": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz", + "integrity": "sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/split2": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", + "license": "ISC", + "engines": { + "node": ">= 10.x" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/stop-iteration-iterator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz", + "integrity": "sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "internal-slot": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/stream-chain": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/stream-chain/-/stream-chain-2.2.5.tgz", + "integrity": "sha512-1TJmBx6aSWqZ4tx7aTpBDXK0/e2hhcNSTV8+CbFJtDjbb+I1mZ8lHit0Grw9GRT+6JbIrrDd8esncgBi8aBXGA==", + "license": "BSD-3-Clause" + }, + "node_modules/stream-json": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/stream-json/-/stream-json-1.9.1.tgz", + "integrity": "sha512-uWkjJ+2Nt/LO9Z/JyKZbMusL8Dkh97uUBTv3AJQ74y07lVahLY4eEFsPsE97pxYBwr8nnjMAIch5eqI0gPShyw==", + "license": "BSD-3-Clause", + "dependencies": { + "stream-chain": "^2.2.5" + } + }, + "node_modules/streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/strict-uri-encode": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz", + "integrity": "sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-argv": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", + "integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.6.19" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "node_modules/string-width/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/string.prototype.trim": { + "version": "1.2.10", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz", + "integrity": "sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-data-property": "^1.1.4", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-object-atoms": "^1.0.0", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz", + "integrity": "sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/strnum": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-2.1.1.tgz", + "integrity": "sha512-7ZvoFTiCnGxBtDqJ//Cu6fWtZtc7Y3x+QOirG15wztbdngGSkht27o2pyGWrVy0b4WAy3jbKmnoK6g5VlVNUUw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT" + }, + "node_modules/strtok3": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-6.3.0.tgz", + "integrity": "sha512-fZtbhtvI9I48xDSywd/somNqgUHl2L2cstmXCCif0itOf96jeW18MBSyrLuNicYQVkvpOxkZtkzujiTJ9LW5Jw==", + "license": "MIT", + "dependencies": { + "@tokenizer/token": "^0.3.0", + "peek-readable": "^4.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, + "node_modules/sucrase": { + "version": "3.35.1", + "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.1.tgz", + "integrity": "sha512-DhuTmvZWux4H1UOnWMB3sk0sbaCVOoQZjv8u1rDoTV0HTdGem9hkAZtl4JZy8P2z4Bg0nT+YMeOFyVr4zcG5Tw==", + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.2", + "commander": "^4.0.0", + "lines-and-columns": "^1.1.6", + "mz": "^2.7.0", + "pirates": "^4.0.1", + "tinyglobby": "^0.2.11", + "ts-interface-checker": "^0.1.9" + }, + "bin": { + "sucrase": "bin/sucrase", + "sucrase-node": "bin/sucrase-node" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/sucrase/node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/swagger-ui-dist": { + "version": "5.30.2", + "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-5.30.2.tgz", + "integrity": "sha512-HWCg1DTNE/Nmapt+0m2EPXFwNKNeKK4PwMjkwveN/zn1cV2Kxi9SURd+m0SpdcSgWEK/O64sf8bzXdtUhigtHA==", + "license": "Apache-2.0", + "dependencies": { + "@scarf/scarf": "=1.4.0" + } + }, + "node_modules/swagger-ui-express": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/swagger-ui-express/-/swagger-ui-express-5.0.1.tgz", + "integrity": "sha512-SrNU3RiBGTLLmFU8GIJdOdanJTl4TOmT27tt3bWWHppqYmAZ6IDuEuBvMU6nZq0zLEe6b/1rACXCgLZqO6ZfrA==", + "license": "MIT", + "dependencies": { + "swagger-ui-dist": ">=5.0.0" + }, + "engines": { + "node": ">= v0.10.32" + }, + "peerDependencies": { + "express": ">=4.0.0 || >=5.0.0-beta" + } + }, + "node_modules/synckit": { + "version": "0.11.11", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.11.11.tgz", + "integrity": "sha512-MeQTA1r0litLUf0Rp/iisCaL8761lKAZHaimlbGK4j0HysC4PLfqygQj9srcs0m2RdtDYnF8UuYyKpbjHYp7Jw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@pkgr/core": "^0.2.9" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/synckit" + } + }, + "node_modules/text-extensions": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-2.4.0.tgz", + "integrity": "sha512-te/NtwBwfiNRLf9Ijqx3T0nlqZiQ2XrrtBvu+cLL8ZRrGkO0NHTug8MYFKyoSrv/sHTaSKfilUkizV6XhxMJ3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true, + "license": "MIT" + }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "license": "MIT", + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/thread-stream": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-3.1.0.tgz", + "integrity": "sha512-OqyPZ9u96VohAyMfJykzmivOrY2wfMSf3C5TtFJVgN+Hm6aj+voFhlK+kZEIv2FBh1X6Xp3DlnCOfEQ3B2J86A==", + "license": "MIT", + "dependencies": { + "real-require": "^0.2.0" + } + }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", + "dev": true, + "license": "MIT" + }, + "node_modules/through2": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", + "license": "MIT", + "dependencies": { + "readable-stream": "3" + } + }, + "node_modules/tinycolor2": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.6.0.tgz", + "integrity": "sha512-XPaBkWQJdsf3pLKJV9p4qN/S+fm2Oj8AIPo1BTUhg5oxkvm9+SVEGFdhyOz7tTdUTfvxMiAs4sp6/eZO2Ew+pw==", + "license": "MIT" + }, + "node_modules/tinyexec": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.0.2.tgz", + "integrity": "sha512-W/KYk+NFhkmsYpuHq5JykngiOCnxeVL8v8dFnqxSD8qEEdRfXk1SDM6JzNqcERbcGYj9tMrDQBYV9cjgnunFIg==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", + "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "os-tmpdir": "~1.0.2" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/token-types": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/token-types/-/token-types-4.2.1.tgz", + "integrity": "sha512-6udB24Q737UD/SDsKAHI9FCRP7Bqc9D/MQUV02ORQg5iskjtLJlZJNdN4kKtcdtwCeWIwIHDGaUsTsCCAa8sFQ==", + "license": "MIT", + "dependencies": { + "@tokenizer/token": "^0.3.0", + "ieee754": "^1.2.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "license": "MIT" + }, + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "license": "MIT", + "bin": { + "tree-kill": "cli.js" + } + }, + "node_modules/ts-api-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", + "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + } + }, + "node_modules/ts-interface-checker": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", + "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", + "license": "Apache-2.0" + }, + "node_modules/tsconfig-paths": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz", + "integrity": "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==", + "dev": true, + "license": "MIT", + "dependencies": { + "json5": "^2.2.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tsconfig-paths/node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/tsup": { + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/tsup/-/tsup-8.5.1.tgz", + "integrity": "sha512-xtgkqwdhpKWr3tKPmCkvYmS9xnQK3m3XgxZHwSUjvfTjp7YfXe5tT3GgWi0F2N+ZSMsOeWeZFh7ZZFg5iPhing==", + "license": "MIT", + "dependencies": { + "bundle-require": "^5.1.0", + "cac": "^6.7.14", + "chokidar": "^4.0.3", + "consola": "^3.4.0", + "debug": "^4.4.0", + "esbuild": "^0.27.0", + "fix-dts-default-cjs-exports": "^1.0.0", + "joycon": "^3.1.1", + "picocolors": "^1.1.1", + "postcss-load-config": "^6.0.1", + "resolve-from": "^5.0.0", + "rollup": "^4.34.8", + "source-map": "^0.7.6", + "sucrase": "^3.35.0", + "tinyexec": "^0.3.2", + "tinyglobby": "^0.2.11", + "tree-kill": "^1.2.2" + }, + "bin": { + "tsup": "dist/cli-default.js", + "tsup-node": "dist/cli-node.js" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@microsoft/api-extractor": "^7.36.0", + "@swc/core": "^1", + "postcss": "^8.4.12", + "typescript": ">=4.5.0" + }, + "peerDependenciesMeta": { + "@microsoft/api-extractor": { + "optional": true + }, + "@swc/core": { + "optional": true + }, + "postcss": { + "optional": true + }, + "typescript": { + "optional": true + } + } + }, + "node_modules/tsup/node_modules/tinyexec": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", + "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", + "license": "MIT" + }, + "node_modules/tsx": { + "version": "4.20.6", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.20.6.tgz", + "integrity": "sha512-ytQKuwgmrrkDTFP4LjR0ToE2nqgy886GpvRSpU0JAnrdBYppuY5rLkRUYPU1yCryb24SsKBTL/hlDQAEFVwtZg==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "esbuild": "~0.25.0", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/tsx/node_modules/@esbuild/aix-ppc64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz", + "integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.12.tgz", + "integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz", + "integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.12.tgz", + "integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz", + "integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz", + "integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz", + "integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz", + "integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz", + "integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz", + "integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ia32": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz", + "integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-loong64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz", + "integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-mips64el": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz", + "integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ppc64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz", + "integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-riscv64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz", + "integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-s390x": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz", + "integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz", + "integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/netbsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz", + "integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/netbsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz", + "integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/openbsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz", + "integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], "engines": { "node": ">=18" - }, - "peerDependencies": { - "@microsoft/api-extractor": "^7.36.0", - "@swc/core": "^1", - "postcss": "^8.4.12", - "typescript": ">=4.5.0" - }, - "peerDependenciesMeta": { - "@microsoft/api-extractor": { - "optional": true - }, - "@swc/core": { - "optional": true - }, - "postcss": { - "optional": true - }, - "typescript": { - "optional": true - } } }, - "node_modules/tsup/node_modules/chokidar": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", - "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", - "dependencies": { - "readdirp": "^4.0.1" - }, + "node_modules/tsx/node_modules/@esbuild/openbsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz", + "integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], "engines": { - "node": ">= 14.16.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" + "node": ">=18" } }, - "node_modules/tsup/node_modules/readdirp": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", - "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "node_modules/tsx/node_modules/@esbuild/openharmony-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz", + "integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], "engines": { - "node": ">= 14.18.0" - }, - "funding": { - "type": "individual", - "url": "https://paulmillr.com/funding/" + "node": ">=18" } }, - "node_modules/tsup/node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "node_modules/tsx/node_modules/@esbuild/sunos-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz", + "integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], "engines": { - "node": ">=8" + "node": ">=18" } }, - "node_modules/tsup/node_modules/source-map": { - "version": "0.8.0-beta.0", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.8.0-beta.0.tgz", - "integrity": "sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==", - "dependencies": { - "whatwg-url": "^7.0.0" - }, + "node_modules/tsx/node_modules/@esbuild/win32-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz", + "integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": ">= 8" + "node": ">=18" } }, - "node_modules/tsup/node_modules/tr46": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", - "integrity": "sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==", - "dependencies": { - "punycode": "^2.1.0" + "node_modules/tsx/node_modules/@esbuild/win32-ia32": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz", + "integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" } }, - "node_modules/tsup/node_modules/webidl-conversions": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==" - }, - "node_modules/tsup/node_modules/whatwg-url": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", - "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", - "dependencies": { - "lodash.sortby": "^4.7.0", - "tr46": "^1.0.1", - "webidl-conversions": "^4.0.2" + "node_modules/tsx/node_modules/@esbuild/win32-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz", + "integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" } }, - "node_modules/tsx": { - "version": "4.20.3", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.20.3.tgz", - "integrity": "sha512-qjbnuR9Tr+FJOMBqJCW5ehvIo/buZq7vH7qD7JziU98h6l3qGy0a/yPFjwO+y0/T7GFpNgNAvEcPPVfyT8rrPQ==", + "node_modules/tsx/node_modules/esbuild": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz", + "integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==", "devOptional": true, + "hasInstallScript": true, "license": "MIT", - "dependencies": { - "esbuild": "~0.25.0", - "get-tsconfig": "^4.7.5" - }, "bin": { - "tsx": "dist/cli.mjs" + "esbuild": "bin/esbuild" }, "engines": { - "node": ">=18.0.0" + "node": ">=18" }, "optionalDependencies": { - "fsevents": "~2.3.3" + "@esbuild/aix-ppc64": "0.25.12", + "@esbuild/android-arm": "0.25.12", + "@esbuild/android-arm64": "0.25.12", + "@esbuild/android-x64": "0.25.12", + "@esbuild/darwin-arm64": "0.25.12", + "@esbuild/darwin-x64": "0.25.12", + "@esbuild/freebsd-arm64": "0.25.12", + "@esbuild/freebsd-x64": "0.25.12", + "@esbuild/linux-arm": "0.25.12", + "@esbuild/linux-arm64": "0.25.12", + "@esbuild/linux-ia32": "0.25.12", + "@esbuild/linux-loong64": "0.25.12", + "@esbuild/linux-mips64el": "0.25.12", + "@esbuild/linux-ppc64": "0.25.12", + "@esbuild/linux-riscv64": "0.25.12", + "@esbuild/linux-s390x": "0.25.12", + "@esbuild/linux-x64": "0.25.12", + "@esbuild/netbsd-arm64": "0.25.12", + "@esbuild/netbsd-x64": "0.25.12", + "@esbuild/openbsd-arm64": "0.25.12", + "@esbuild/openbsd-x64": "0.25.12", + "@esbuild/openharmony-arm64": "0.25.12", + "@esbuild/sunos-x64": "0.25.12", + "@esbuild/win32-arm64": "0.25.12", + "@esbuild/win32-ia32": "0.25.12", + "@esbuild/win32-x64": "0.25.12" } }, "node_modules/tweetnacl": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", - "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==", + "license": "Unlicense" }, "node_modules/tweetnacl-util": { "version": "0.15.1", "resolved": "https://registry.npmjs.org/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz", - "integrity": "sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==" + "integrity": "sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==", + "license": "Unlicense" }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, + "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1" }, @@ -11664,6 +15587,7 @@ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true, + "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" }, @@ -11675,6 +15599,7 @@ "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "license": "MIT", "dependencies": { "media-typer": "0.3.0", "mime-types": "~2.1.24" @@ -11687,6 +15612,7 @@ "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -11696,6 +15622,7 @@ "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==", "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.3", "es-errors": "^1.3.0", @@ -11710,6 +15637,7 @@ "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz", "integrity": "sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "for-each": "^0.3.3", @@ -11729,6 +15657,7 @@ "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.4.tgz", "integrity": "sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==", "dev": true, + "license": "MIT", "dependencies": { "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.8", @@ -11750,6 +15679,7 @@ "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.7.tgz", "integrity": "sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==", "dev": true, + "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "for-each": "^0.3.3", @@ -11768,13 +15698,15 @@ "node_modules/typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", + "license": "MIT" }, "node_modules/typescript": { - "version": "5.8.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", - "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "devOptional": true, + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -11786,12 +15718,13 @@ "node_modules/ufo": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.1.tgz", - "integrity": "sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==" + "integrity": "sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==", + "license": "MIT" }, "node_modules/uint8array-extras": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/uint8array-extras/-/uint8array-extras-1.4.0.tgz", - "integrity": "sha512-ZPtzy0hu4cZjv3z5NW9gfKnNLjoz4y6uv4HlelAjDK7sY/xOkKZv9xK/WQpcsBB3jEybChz9DPC2U/+cusjJVQ==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/uint8array-extras/-/uint8array-extras-1.5.0.tgz", + "integrity": "sha512-rvKSBiC5zqCCiDZ9kAOszZcDvdAHwwIKJG33Ykj43OKcWsnmcBRL09YTU4nOeHZ8Y2a7l1MgTd08SBe9A8Qj6A==", "license": "MIT", "engines": { "node": ">=18" @@ -11805,6 +15738,7 @@ "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz", "integrity": "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==", "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.3", "has-bigints": "^1.0.2", @@ -11818,15 +15752,49 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/undici": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-7.16.0.tgz", + "integrity": "sha512-QEg3HPMll0o3t2ourKwOeUAZ159Kn9mx5pnzHRQO8+Wixmh88YdZRiIwat0iNzNNXn0yoEtXJqFpyW7eM8BV7g==", + "license": "MIT", + "engines": { + "node": ">=20.18.1" + } + }, "node_modules/undici-types": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", - "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==" + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "license": "MIT" + }, + "node_modules/unicorn-magic": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", + "integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } }, "node_modules/unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", "engines": { "node": ">= 0.8" } @@ -11836,14 +15804,26 @@ "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "punycode": "^2.1.0" } }, + "node_modules/uri-js/node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/url": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", "integrity": "sha512-kbailJa29QrtXnxgq+DdCEGlbTeYM2eJUxsz6vjZavrCYPMIFHMKQmSKYAIuUK2i7hgPm28a8piX5NTUtM/LKQ==", + "license": "MIT", "dependencies": { "punycode": "1.3.2", "querystring": "0.2.0" @@ -11853,20 +15833,17 @@ "version": "1.5.10", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "license": "MIT", "dependencies": { "querystringify": "^2.1.1", "requires-port": "^1.0.0" } }, - "node_modules/url/node_modules/punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw==" - }, "node_modules/utif2": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/utif2/-/utif2-4.1.0.tgz", "integrity": "sha512-+oknB9FHrJ7oW7A2WZYajOcv4FcDR4CfoGB0dPNfxbi4GO05RRnFmt5oa23+9w32EanrYcSJWspUiJkLMs+37w==", + "license": "MIT", "dependencies": { "pako": "^1.0.11" } @@ -11875,6 +15852,7 @@ "version": "0.12.5", "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", + "license": "MIT", "dependencies": { "inherits": "^2.0.3", "is-arguments": "^1.0.4", @@ -11886,32 +15864,36 @@ "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT" }, "node_modules/utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "license": "MIT", "engines": { "node": ">= 0.4.0" } }, "node_modules/uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-13.0.0.tgz", + "integrity": "sha512-XQegIaBTVUjSHliKqcnFqYypAd4S+WCYt5NIeRs6w/UAry7z8Y9j5ZwRRL4kzq9U3sD6v+85er9FvkEaBpji2w==", "funding": [ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" ], + "license": "MIT", "bin": { - "uuid": "dist/bin/uuid" + "uuid": "dist-node/bin/uuid" } }, "node_modules/validator": { - "version": "13.15.15", - "resolved": "https://registry.npmjs.org/validator/-/validator-13.15.15.tgz", - "integrity": "sha512-BgWVbCI72aIQy937xbawcs+hrVaN/CZ2UwutgaJ36hGqRrLNM+f5LUT/YPRbo8IV/ASeFzXszezV+y2+rq3l8A==", + "version": "13.15.23", + "resolved": "https://registry.npmjs.org/validator/-/validator-13.15.23.tgz", + "integrity": "sha512-4yoz1kEWqUjzi5zsPbAS/903QXSYp0UOtHsPpp7p9rHAw/W+dkInskAE386Fat3oKRROwO98d9ZB0G4cObgUyw==", + "license": "MIT", "engines": { "node": ">= 0.10" } @@ -11920,14 +15902,26 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", "engines": { "node": ">= 0.8" } }, + "node_modules/wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", + "dev": true, + "license": "MIT", + "dependencies": { + "defaults": "^1.0.3" + } + }, "node_modules/web-encoding": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/web-encoding/-/web-encoding-1.1.5.tgz", "integrity": "sha512-HYLeVCdJ0+lBYV2FvNZmv3HJ2Nt0QYXqZojk3d9FJOLkwnuhzM9tmamh8d7HPM8QqjKH8DeHkFTx+CFlWpZZDA==", + "license": "MIT", "dependencies": { "util": "^0.12.3" }, @@ -11939,6 +15933,7 @@ "version": "4.0.0-beta.3", "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.3.tgz", "integrity": "sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug==", + "license": "MIT", "engines": { "node": ">= 14" } @@ -11946,12 +15941,14 @@ "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "license": "BSD-2-Clause" }, "node_modules/whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "license": "MIT", "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" @@ -11961,6 +15958,8 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, @@ -11976,6 +15975,7 @@ "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz", "integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==", "dev": true, + "license": "MIT", "dependencies": { "is-bigint": "^1.1.0", "is-boolean-object": "^1.2.1", @@ -11995,6 +15995,7 @@ "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.2.1.tgz", "integrity": "sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==", "dev": true, + "license": "MIT", "dependencies": { "call-bound": "^1.0.2", "function.prototype.name": "^1.1.6", @@ -12022,6 +16023,7 @@ "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", "dev": true, + "license": "MIT", "dependencies": { "is-map": "^2.0.3", "is-set": "^2.0.3", @@ -12038,12 +16040,14 @@ "node_modules/which-module": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", - "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==" + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", + "license": "ISC" }, "node_modules/which-typed-array": { "version": "1.1.19", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.19.tgz", "integrity": "sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==", + "license": "MIT", "dependencies": { "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.8", @@ -12065,6 +16069,7 @@ "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -12073,6 +16078,8 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -12085,33 +16092,54 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/wrap-ansi-cjs": { - "name": "wrap-ansi", - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" + "color-convert": "^2.0.1" }, "engines": { - "node": ">=10" + "node": ">=8" }, "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" } }, + "node_modules/wrap-ansi/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/ws": { "version": "8.18.3", "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz", "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==", + "license": "MIT", "engines": { "node": ">=10.0.0" }, @@ -12131,12 +16159,14 @@ "node_modules/xml-parse-from-string": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/xml-parse-from-string/-/xml-parse-from-string-1.0.1.tgz", - "integrity": "sha512-ErcKwJTF54uRzzNMXq2X5sMIy88zJvfN2DmdoQvy7PAFJ+tPRU6ydWuOKNMyfmOjdyBQTFREi60s0Y0SyI0G0g==" + "integrity": "sha512-ErcKwJTF54uRzzNMXq2X5sMIy88zJvfN2DmdoQvy7PAFJ+tPRU6ydWuOKNMyfmOjdyBQTFREi60s0Y0SyI0G0g==", + "license": "MIT" }, "node_modules/xml2js": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.6.2.tgz", "integrity": "sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA==", + "license": "MIT", "dependencies": { "sax": ">=0.6.0", "xmlbuilder": "~11.0.0" @@ -12149,6 +16179,7 @@ "version": "11.0.1", "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", + "license": "MIT", "engines": { "node": ">=4.0" } @@ -12165,6 +16196,7 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "license": "MIT", "engines": { "node": ">=0.4" } @@ -12173,6 +16205,7 @@ "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "license": "ISC", "engines": { "node": ">=10" } @@ -12180,12 +16213,28 @@ "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC" + }, + "node_modules/yaml": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz", + "integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==", + "devOptional": true, + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + } }, "node_modules/yargs": { "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", @@ -12203,17 +16252,20 @@ "version": "21.1.1", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", "engines": { "node": ">=12" } }, "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.2.2.tgz", + "integrity": "sha512-4LCcse/U2MHZ63HAJVE+v71o7yOdIe4cZ70Wpf8D/IyjDKYQLV5GD46B+hSTjJsvV5PztjvHoU580EftxjDZFQ==", "dev": true, + "license": "MIT", "engines": { - "node": ">=10" + "node": ">=12.20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -12223,6 +16275,7 @@ "version": "3.25.76", "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "license": "MIT", "funding": { "url": "https://github.com/sponsors/colinhacks" } diff --git a/package.json b/package.json index e91d1ea70..56e32fcc8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "evolution-api", - "version": "2.3.2", + "version": "2.3.7", "description": "Rest api for communication with WhatsApp", "main": "./dist/main.js", "type": "commonjs", @@ -12,12 +12,15 @@ "test": "tsx watch ./test/all.test.ts", "lint": "eslint --fix --ext .ts src", "lint:check": "eslint --ext .ts src", + "commit": "cz", + "commitlint": "commitlint --edit", "db:generate": "node runWithProvider.js \"npx prisma generate --schema ./prisma/DATABASE_PROVIDER-schema.prisma\"", "db:deploy": "node runWithProvider.js \"rm -rf ./prisma/migrations && cp -r ./prisma/DATABASE_PROVIDER-migrations ./prisma/migrations && npx prisma migrate deploy --schema ./prisma/DATABASE_PROVIDER-schema.prisma\"", "db:deploy:win": "node runWithProvider.js \"xcopy /E /I prisma\\DATABASE_PROVIDER-migrations prisma\\migrations && npx prisma migrate deploy --schema prisma\\DATABASE_PROVIDER-schema.prisma\"", "db:studio": "node runWithProvider.js \"npx prisma studio --schema ./prisma/DATABASE_PROVIDER-schema.prisma\"", "db:migrate:dev": "node runWithProvider.js \"rm -rf ./prisma/migrations && cp -r ./prisma/DATABASE_PROVIDER-migrations ./prisma/migrations && npx prisma migrate dev --schema ./prisma/DATABASE_PROVIDER-schema.prisma && cp -r ./prisma/migrations/* ./prisma/DATABASE_PROVIDER-migrations\"", - "db:migrate:dev:win": "node runWithProvider.js \"xcopy /E /I prisma\\DATABASE_PROVIDER-migrations prisma\\migrations && npx prisma migrate dev --schema prisma\\DATABASE_PROVIDER-schema.prisma\"" + "db:migrate:dev:win": "node runWithProvider.js \"xcopy /E /I prisma\\DATABASE_PROVIDER-migrations prisma\\migrations && npx prisma migrate dev --schema prisma\\DATABASE_PROVIDER-schema.prisma\"", + "prepare": "husky" }, "repository": { "type": "git", @@ -48,19 +51,33 @@ "url": "https://github.com/EvolutionAPI/evolution-api/issues" }, "homepage": "https://github.com/EvolutionAPI/evolution-api#readme", + "lint-staged": { + "src/**/*.{ts,js}": [ + "eslint --fix" + ], + "src/**/*.ts": [ + "sh -c 'tsc --noEmit'" + ] + }, + "config": { + "commitizen": { + "path": "cz-conventional-changelog" + } + }, "dependencies": { "@adiwajshing/keyed-db": "^0.2.4", - "@aws-sdk/client-sqs": "^3.723.0", + "@aws-sdk/client-sqs": "^3.891.0", "@ffmpeg-installer/ffmpeg": "^1.1.0", "@figuro/chatwoot-sdk": "^1.1.16", "@hapi/boom": "^10.0.1", "@paralleldrive/cuid2": "^2.2.2", - "@prisma/client": "^6.1.0", - "@sentry/node": "^8.47.0", + "@prisma/client": "^6.16.2", + "@sentry/node": "^10.12.0", + "@types/uuid": "^10.0.0", "amqplib": "^0.10.5", "audio-decode": "^2.2.3", "axios": "^1.7.9", - "baileys": "github:WhiskeySockets/Baileys", + "baileys": "7.0.0-rc.9", "class-validator": "^0.14.1", "compression": "^1.7.5", "cors": "^2.8.5", @@ -73,24 +90,27 @@ "fluent-ffmpeg": "^2.1.3", "form-data": "^4.0.1", "https-proxy-agent": "^7.0.6", + "fetch-socks": "^1.3.2", "i18next": "^23.7.19", "jimp": "^1.6.0", "json-schema": "^0.4.0", "jsonschema": "^1.4.1", "jsonwebtoken": "^9.0.2", + "kafkajs": "^2.2.4", + "libphonenumber-js": "^1.12.25", "link-preview-js": "^3.0.13", "long": "^5.2.3", "mediainfo.js": "^0.3.4", "mime": "^4.0.0", "mime-types": "^2.1.35", "minio": "^8.0.3", - "multer": "^1.4.5-lts.1", + "multer": "^2.0.2", "nats": "^2.29.1", "node-cache": "^5.1.2", "node-cron": "^3.0.3", "openai": "^4.77.3", "pg": "^8.13.1", - "pino": "^8.11.0", + "pino": "^9.10.0", "prisma": "^6.1.0", "pusher": "^5.2.0", "qrcode": "^1.5.4", @@ -102,30 +122,37 @@ "socket.io-client": "^4.8.1", "socks-proxy-agent": "^8.0.5", "swagger-ui-express": "^5.0.1", - "tsup": "^8.3.5" + "tsup": "^8.3.5", + "undici": "^7.16.0", + "uuid": "^13.0.0" }, "devDependencies": { + "@commitlint/cli": "^19.8.1", + "@commitlint/config-conventional": "^19.8.1", "@types/compression": "^1.7.5", "@types/cors": "^2.8.17", "@types/express": "^4.17.18", "@types/json-schema": "^7.0.15", "@types/mime": "^4.0.0", "@types/mime-types": "^2.1.4", - "@types/node": "^22.10.5", + "@types/node": "^24.5.2", "@types/node-cron": "^3.0.11", "@types/qrcode": "^1.5.5", "@types/qrcode-terminal": "^0.12.2", - "@types/uuid": "^10.0.0", - "@typescript-eslint/eslint-plugin": "^6.21.0", - "@typescript-eslint/parser": "^6.21.0", + "@typescript-eslint/eslint-plugin": "^8.44.0", + "@typescript-eslint/parser": "^8.44.0", + "commitizen": "^4.3.1", + "cz-conventional-changelog": "^3.3.0", "eslint": "^8.45.0", - "eslint-config-prettier": "^9.1.0", + "eslint-config-prettier": "^10.1.8", "eslint-plugin-import": "^2.31.0", "eslint-plugin-prettier": "^5.2.1", - "eslint-plugin-simple-import-sort": "^10.0.0", + "eslint-plugin-simple-import-sort": "^12.1.1", + "husky": "^9.1.7", + "lint-staged": "^16.1.6", "prettier": "^3.4.2", "tsconfig-paths": "^4.2.0", - "tsx": "^4.20.3", + "tsx": "^4.20.5", "typescript": "^5.7.2" } } diff --git a/prisma/mysql-migrations/20250918183910_add_kafka_integration/migration.sql b/prisma/mysql-migrations/20250918183910_add_kafka_integration/migration.sql new file mode 100644 index 000000000..c3a089bd0 --- /dev/null +++ b/prisma/mysql-migrations/20250918183910_add_kafka_integration/migration.sql @@ -0,0 +1,231 @@ +/* + Warnings: + + - You are about to alter the column `createdAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Chat` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Chatwoot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Contact` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Dify` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `DifySetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Evoai` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Evoai` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `EvoaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `EvoaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `EvolutionBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `EvolutionBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `EvolutionBotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `EvolutionBotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Flowise` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Flowise` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `FlowiseSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `FlowiseSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `disconnectionAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Instance` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `IntegrationSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `IntegrationSession` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to drop the column `lid` on the `IsOnWhatsapp` table. All the data in the column will be lost. + - You are about to alter the column `createdAt` on the `IsOnWhatsapp` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `IsOnWhatsapp` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Label` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Media` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `N8n` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `N8n` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `N8nSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `N8nSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Nats` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Nats` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `OpenaiBot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `OpenaiCreds` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `OpenaiSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Proxy` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Pusher` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Pusher` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Rabbitmq` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Session` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Setting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Sqs` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Template` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to drop the column `splitMessages` on the `Typebot` table. All the data in the column will be lost. + - You are about to drop the column `timePerChar` on the `Typebot` table. All the data in the column will be lost. + - You are about to alter the column `createdAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Typebot` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to drop the column `splitMessages` on the `TypebotSetting` table. All the data in the column will be lost. + - You are about to drop the column `timePerChar` on the `TypebotSetting` table. All the data in the column will be lost. + - You are about to alter the column `createdAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `TypebotSetting` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Webhook` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `createdAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + - You are about to alter the column `updatedAt` on the `Websocket` table. The data in that column could be lost. The data in that column will be cast from `Timestamp(0)` to `Timestamp`. + +*/ +-- DropIndex +DROP INDEX `unique_remote_instance` ON `Chat`; + +-- AlterTable +ALTER TABLE `Chat` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NULL; + +-- AlterTable +ALTER TABLE `Chatwoot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `Contact` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NULL; + +-- AlterTable +ALTER TABLE `Dify` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `DifySetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `Evoai` MODIFY `triggerType` ENUM('all', 'keyword', 'none', 'advanced') NULL, + MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `EvoaiSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `EvolutionBot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `EvolutionBotSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `Flowise` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `FlowiseSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `Instance` MODIFY `disconnectionAt` TIMESTAMP NULL, + MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NULL; + +-- AlterTable +ALTER TABLE `IntegrationSession` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `IsOnWhatsapp` DROP COLUMN `lid`, + MODIFY `createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `Label` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `Media` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP; + +-- AlterTable +ALTER TABLE `N8n` MODIFY `triggerType` ENUM('all', 'keyword', 'none', 'advanced') NULL, + MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `N8nSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `Nats` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `OpenaiBot` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `OpenaiCreds` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `OpenaiSetting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `Proxy` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `Pusher` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `Rabbitmq` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `Session` MODIFY `createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP; + +-- AlterTable +ALTER TABLE `Setting` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `Sqs` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `Template` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `Typebot` DROP COLUMN `splitMessages`, + DROP COLUMN `timePerChar`, + MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NULL; + +-- AlterTable +ALTER TABLE `TypebotSetting` DROP COLUMN `splitMessages`, + DROP COLUMN `timePerChar`, + MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `Webhook` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- AlterTable +ALTER TABLE `Websocket` MODIFY `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + MODIFY `updatedAt` TIMESTAMP NOT NULL; + +-- CreateTable +CREATE TABLE `Kafka` ( + `id` VARCHAR(191) NOT NULL, + `enabled` BOOLEAN NOT NULL DEFAULT false, + `events` JSON NOT NULL, + `createdAt` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, + `updatedAt` TIMESTAMP NOT NULL, + `instanceId` VARCHAR(191) NOT NULL, + + UNIQUE INDEX `Kafka_instanceId_key`(`instanceId`), + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- AddForeignKey +ALTER TABLE `Kafka` ADD CONSTRAINT `Kafka_instanceId_fkey` FOREIGN KEY (`instanceId`) REFERENCES `Instance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/prisma/mysql-schema.prisma b/prisma/mysql-schema.prisma index 70efea470..71b5a743f 100644 --- a/prisma/mysql-schema.prisma +++ b/prisma/mysql-schema.prisma @@ -88,6 +88,7 @@ model Instance { Rabbitmq Rabbitmq? Nats Nats? Sqs Sqs? + Kafka Kafka? Websocket Websocket? Typebot Typebot[] Session Session? @@ -105,8 +106,11 @@ model Instance { EvolutionBotSetting EvolutionBotSetting? Flowise Flowise[] FlowiseSetting FlowiseSetting? - Pusher Pusher? N8n N8n[] + N8nSetting N8nSetting? + Evoai Evoai[] + EvoaiSetting EvoaiSetting? + Pusher Pusher? } model Session { @@ -309,6 +313,16 @@ model Sqs { instanceId String @unique } +model Kafka { + id String @id @default(cuid()) + enabled Boolean @default(false) + events Json @db.Json + createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp + updatedAt DateTime @updatedAt @db.Timestamp + Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade) + instanceId String @unique +} + model Websocket { id String @id @default(cuid()) enabled Boolean @default(false) @@ -647,7 +661,7 @@ model IsOnWhatsapp { model N8n { id String @id @default(cuid()) - enabled Boolean @default(true) @db.TinyInt(1) + enabled Boolean @default(true) @db.TinyInt() description String? @db.VarChar(255) webhookUrl String? @db.VarChar(255) basicAuthUser String? @db.VarChar(255) @@ -666,7 +680,7 @@ model N8n { triggerType TriggerType? triggerOperator TriggerOperator? triggerValue String? - createdAt DateTime? @default(now()) @db.Timestamp + createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp updatedAt DateTime @updatedAt @db.Timestamp Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade) instanceId String @@ -686,7 +700,7 @@ model N8nSetting { ignoreJids Json? splitMessages Boolean? @default(false) timePerChar Int? @default(50) @db.Int - createdAt DateTime? @default(now()) @db.Timestamp + createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp updatedAt DateTime @updatedAt @db.Timestamp Fallback N8n? @relation(fields: [n8nIdFallback], references: [id]) n8nIdFallback String? @db.VarChar(100) @@ -696,7 +710,7 @@ model N8nSetting { model Evoai { id String @id @default(cuid()) - enabled Boolean @default(true) @db.TinyInt(1) + enabled Boolean @default(true) @db.TinyInt() description String? @db.VarChar(255) agentUrl String? @db.VarChar(255) apiKey String? @db.VarChar(255) @@ -714,7 +728,7 @@ model Evoai { triggerType TriggerType? triggerOperator TriggerOperator? triggerValue String? - createdAt DateTime? @default(now()) @db.Timestamp + createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp updatedAt DateTime @updatedAt @db.Timestamp Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade) instanceId String @@ -734,7 +748,7 @@ model EvoaiSetting { ignoreJids Json? splitMessages Boolean? @default(false) timePerChar Int? @default(50) @db.Int - createdAt DateTime? @default(now()) @db.Timestamp + createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp updatedAt DateTime @updatedAt @db.Timestamp Fallback Evoai? @relation(fields: [evoaiIdFallback], references: [id]) evoaiIdFallback String? @db.VarChar(100) diff --git a/prisma/postgresql-migrations/20250918182355_add_kafka_integration/migration.sql b/prisma/postgresql-migrations/20250918182355_add_kafka_integration/migration.sql new file mode 100644 index 000000000..2985c5502 --- /dev/null +++ b/prisma/postgresql-migrations/20250918182355_add_kafka_integration/migration.sql @@ -0,0 +1,17 @@ +-- CreateTable +CREATE TABLE "Kafka" ( + "id" TEXT NOT NULL, + "enabled" BOOLEAN NOT NULL DEFAULT false, + "events" JSONB NOT NULL, + "createdAt" TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP NOT NULL, + "instanceId" TEXT NOT NULL, + + CONSTRAINT "Kafka_pkey" PRIMARY KEY ("id") +); + +-- CreateIndex +CREATE UNIQUE INDEX "Kafka_instanceId_key" ON "Kafka"("instanceId"); + +-- AddForeignKey +ALTER TABLE "Kafka" ADD CONSTRAINT "Kafka_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "Instance"("id") ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/prisma/postgresql-migrations/20251122003044_add_chat_instance_remotejid_unique/migration.sql b/prisma/postgresql-migrations/20251122003044_add_chat_instance_remotejid_unique/migration.sql new file mode 100644 index 000000000..8b27cc1ef --- /dev/null +++ b/prisma/postgresql-migrations/20251122003044_add_chat_instance_remotejid_unique/migration.sql @@ -0,0 +1,16 @@ +-- 1. Cleanup: Remove duplicate chats, keeping the most recently updated one +DELETE FROM "Chat" +WHERE id IN ( + SELECT id FROM ( + SELECT id, + ROW_NUMBER() OVER ( + PARTITION BY "instanceId", "remoteJid" + ORDER BY "updatedAt" DESC + ) as row_num + FROM "Chat" + ) t + WHERE t.row_num > 1 +); + +-- 2. Create the unique index (Constraint) +CREATE UNIQUE INDEX "Chat_instanceId_remoteJid_key" ON "Chat"("instanceId", "remoteJid"); diff --git a/prisma/postgresql-schema.prisma b/prisma/postgresql-schema.prisma index 221d69d9d..6b98f88da 100644 --- a/prisma/postgresql-schema.prisma +++ b/prisma/postgresql-schema.prisma @@ -88,6 +88,7 @@ model Instance { Rabbitmq Rabbitmq? Nats Nats? Sqs Sqs? + Kafka Kafka? Websocket Websocket? Typebot Typebot[] Session Session? @@ -131,6 +132,7 @@ model Chat { instanceId String unreadMessages Int @default(0) + @@unique([instanceId, remoteJid]) @@index([instanceId]) @@index([remoteJid]) } @@ -312,6 +314,16 @@ model Sqs { instanceId String @unique } +model Kafka { + id String @id @default(cuid()) + enabled Boolean @default(false) @db.Boolean + events Json @db.JsonB + createdAt DateTime? @default(now()) @db.Timestamp + updatedAt DateTime @updatedAt @db.Timestamp + Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade) + instanceId String @unique +} + model Websocket { id String @id @default(cuid()) enabled Boolean @default(false) @db.Boolean diff --git a/prisma/psql_bouncer-schema.prisma b/prisma/psql_bouncer-schema.prisma index 4754f1656..a3f4dbe90 100644 --- a/prisma/psql_bouncer-schema.prisma +++ b/prisma/psql_bouncer-schema.prisma @@ -89,6 +89,7 @@ model Instance { Rabbitmq Rabbitmq? Nats Nats? Sqs Sqs? + Kafka Kafka? Websocket Websocket? Typebot Typebot[] Session Session? @@ -313,6 +314,16 @@ model Sqs { instanceId String @unique } +model Kafka { + id String @id @default(cuid()) + enabled Boolean @default(false) @db.Boolean + events Json @db.JsonB + createdAt DateTime? @default(now()) @db.Timestamp + updatedAt DateTime @updatedAt @db.Timestamp + Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade) + instanceId String @unique +} + model Websocket { id String @id @default(cuid()) enabled Boolean @default(false) @db.Boolean diff --git a/prometheus.yml.example b/prometheus.yml.example new file mode 100644 index 000000000..bcb3b332d --- /dev/null +++ b/prometheus.yml.example @@ -0,0 +1,76 @@ +# Prometheus configuration example for Evolution API +# Copy this file to prometheus.yml and adjust the settings + +global: + scrape_interval: 15s + evaluation_interval: 15s + +rule_files: + # - "first_rules.yml" + # - "second_rules.yml" + +scrape_configs: + # Evolution API metrics + - job_name: 'evolution-api' + static_configs: + - targets: ['localhost:8080'] # Adjust to your Evolution API URL + + # Metrics endpoint path + metrics_path: '/metrics' + + # Scrape interval for this job + scrape_interval: 30s + + # Basic authentication (if METRICS_AUTH_REQUIRED=true) + basic_auth: + username: 'prometheus' # Should match METRICS_USER + password: 'secure_random_password_here' # Should match METRICS_PASSWORD + + # Optional: Add custom labels + relabel_configs: + - source_labels: [__address__] + target_label: __param_target + - source_labels: [__param_target] + target_label: instance + - target_label: __address__ + replacement: localhost:8080 # Evolution API address + +# Alerting configuration (optional) +alerting: + alertmanagers: + - static_configs: + - targets: + # - alertmanager:9093 + +# Example alert rules for Evolution API +# Create a file called evolution_alerts.yml with these rules: +# +# groups: +# - name: evolution-api +# rules: +# - alert: EvolutionAPIDown +# expr: up{job="evolution-api"} == 0 +# for: 1m +# labels: +# severity: critical +# annotations: +# summary: "Evolution API is down" +# description: "Evolution API has been down for more than 1 minute." +# +# - alert: EvolutionInstanceDown +# expr: evolution_instance_up == 0 +# for: 2m +# labels: +# severity: warning +# annotations: +# summary: "Evolution instance {{ $labels.instance }} is down" +# description: "Instance {{ $labels.instance }} has been down for more than 2 minutes." +# +# - alert: HighInstanceCount +# expr: evolution_instances_total > 100 +# for: 5m +# labels: +# severity: warning +# annotations: +# summary: "High number of Evolution instances" +# description: "Evolution API is managing {{ $value }} instances." diff --git a/src/api/controllers/instance.controller.ts b/src/api/controllers/instance.controller.ts index 31441b42d..6a6910688 100644 --- a/src/api/controllers/instance.controller.ts +++ b/src/api/controllers/instance.controller.ts @@ -92,6 +92,15 @@ export class InstanceController { instanceId: instanceId, }); + const instanceDto: InstanceDto = { + instanceName: instance.instanceName, + instanceId: instance.instanceId, + connectionStatus: + typeof instance.connectionStatus === 'string' + ? instance.connectionStatus + : instance.connectionStatus?.state || 'unknown', + }; + if (instanceData.proxyHost && instanceData.proxyPort && instanceData.proxyProtocol) { const testProxy = await this.proxyService.testProxy({ host: instanceData.proxyHost, @@ -103,8 +112,7 @@ export class InstanceController { if (!testProxy) { throw new BadRequestException('Invalid proxy'); } - - await this.proxyService.createProxy(instance, { + await this.proxyService.createProxy(instanceDto, { enabled: true, host: instanceData.proxyHost, port: instanceData.proxyPort, @@ -125,7 +133,7 @@ export class InstanceController { wavoipToken: instanceData.wavoipToken || '', }; - await this.settingsService.create(instance, settings); + await this.settingsService.create(instanceDto, settings); let webhookWaBusiness = null, accessTokenWaBusiness = ''; @@ -155,7 +163,10 @@ export class InstanceController { integration: instanceData.integration, webhookWaBusiness, accessTokenWaBusiness, - status: instance.connectionStatus.state, + status: + typeof instance.connectionStatus === 'string' + ? instance.connectionStatus + : instance.connectionStatus?.state || 'unknown', }, hash, webhook: { @@ -217,7 +228,7 @@ export class InstanceController { const urlServer = this.configService.get('SERVER').URL; try { - this.chatwootService.create(instance, { + this.chatwootService.create(instanceDto, { enabled: true, accountId: instanceData.chatwootAccountId, token: instanceData.chatwootToken, @@ -246,7 +257,10 @@ export class InstanceController { integration: instanceData.integration, webhookWaBusiness, accessTokenWaBusiness, - status: instance.connectionStatus.state, + status: + typeof instance.connectionStatus === 'string' + ? instance.connectionStatus + : instance.connectionStatus?.state || 'unknown', }, hash, webhook: { @@ -338,20 +352,38 @@ export class InstanceController { throw new BadRequestException('The "' + instanceName + '" instance does not exist'); } - if (state == 'close') { + if (state === 'close') { throw new BadRequestException('The "' + instanceName + '" instance is not connected'); - } else if (state == 'open') { + } + this.logger.info(`Restarting instance: ${instanceName}`); + + if (typeof instance.restart === 'function') { + await instance.restart(); + // Wait a bit for the reconnection to be established + await new Promise((r) => setTimeout(r, 2000)); + return { + instance: { + instanceName: instanceName, + status: instance.connectionStatus?.state || 'connecting', + }, + }; + } + + // Fallback for Baileys (uses different mechanism) + if (state === 'open' || state === 'connecting') { if (this.configService.get('CHATWOOT').ENABLED) instance.clearCacheChatwoot(); - this.logger.info('restarting instance' + instanceName); - instance.client?.ws?.close(); - instance.client?.end(new Error('restart')); - return await this.connectToWhatsapp({ instanceName }); - } else if (state == 'connecting') { instance.client?.ws?.close(); instance.client?.end(new Error('restart')); return await this.connectToWhatsapp({ instanceName }); } + + return { + instance: { + instanceName: instanceName, + status: state, + }, + }; } catch (error) { this.logger.error(error); return { error: true, message: error.toString() }; @@ -409,7 +441,7 @@ export class InstanceController { } try { - this.waMonitor.waInstances[instanceName]?.logoutInstance(); + await this.waMonitor.waInstances[instanceName]?.logoutInstance(); return { status: 'SUCCESS', error: false, response: { message: 'Instance logged out' } }; } catch (error) { diff --git a/src/api/controllers/template.controller.ts b/src/api/controllers/template.controller.ts index d9b620457..52f8182b3 100644 --- a/src/api/controllers/template.controller.ts +++ b/src/api/controllers/template.controller.ts @@ -12,4 +12,15 @@ export class TemplateController { public async findTemplate(instance: InstanceDto) { return this.templateService.find(instance); } + + public async editTemplate( + instance: InstanceDto, + data: { templateId: string; category?: string; components?: any; allowCategoryChange?: boolean; ttl?: number }, + ) { + return this.templateService.edit(instance, data); + } + + public async deleteTemplate(instance: InstanceDto, data: { name: string; hsmId?: string }) { + return this.templateService.delete(instance, data); + } } diff --git a/src/api/dto/instance.dto.ts b/src/api/dto/instance.dto.ts index 1da3bf1c1..85c5b69c3 100644 --- a/src/api/dto/instance.dto.ts +++ b/src/api/dto/instance.dto.ts @@ -12,6 +12,7 @@ export class InstanceDto extends IntegrationDto { token?: string; status?: string; ownerJid?: string; + connectionStatus?: string; profileName?: string; profilePicUrl?: string; // settings diff --git a/src/api/dto/template.dto.ts b/src/api/dto/template.dto.ts index cec7d6c53..9b0339e88 100644 --- a/src/api/dto/template.dto.ts +++ b/src/api/dto/template.dto.ts @@ -6,3 +6,16 @@ export class TemplateDto { components: any; webhookUrl?: string; } + +export class TemplateEditDto { + templateId: string; + category?: 'AUTHENTICATION' | 'MARKETING' | 'UTILITY'; + allowCategoryChange?: boolean; + ttl?: number; + components?: any; +} + +export class TemplateDeleteDto { + name: string; + hsmId?: string; +} diff --git a/src/api/integrations/channel/evolution/evolution.channel.service.ts b/src/api/integrations/channel/evolution/evolution.channel.service.ts index 1b4773ce9..87bea08e6 100644 --- a/src/api/integrations/channel/evolution/evolution.channel.service.ts +++ b/src/api/integrations/channel/evolution/evolution.channel.service.ts @@ -13,9 +13,10 @@ import { chatbotController } from '@api/server.module'; import { CacheService } from '@api/services/cache.service'; import { ChannelStartupService } from '@api/services/channel.service'; import { Events, wa } from '@api/types/wa.types'; -import { Chatwoot, ConfigService, Openai, S3 } from '@config/env.config'; +import { AudioConverter, Chatwoot, ConfigService, Openai, S3 } from '@config/env.config'; import { BadRequestException, InternalServerErrorException } from '@exceptions'; import { createJid } from '@utils/createJid'; +import { sendTelemetry } from '@utils/sendTelemetry'; import axios from 'axios'; import { isBase64, isURL } from 'class-validator'; import EventEmitter2 from 'eventemitter2'; @@ -171,6 +172,8 @@ export class EvolutionStartupService extends ChannelStartupService { this.logger.log(messageRaw); + sendTelemetry(`received.message.${messageRaw.messageType ?? 'unknown'}`); + this.sendDataWebhook(Events.MESSAGES_UPSERT, messageRaw); await chatbotController.emit({ @@ -323,8 +326,8 @@ export class EvolutionStartupService extends ChannelStartupService { messageRaw = { key: { fromMe: true, id: messageId, remoteJid: number }, message: { - base64: isBase64(message.media) ? message.media : undefined, - mediaUrl: isURL(message.media) ? message.media : undefined, + base64: isBase64(message.media) ? message.media : null, + mediaUrl: isURL(message.media) ? message.media : null, quoted, }, messageType: 'imageMessage', @@ -337,8 +340,8 @@ export class EvolutionStartupService extends ChannelStartupService { messageRaw = { key: { fromMe: true, id: messageId, remoteJid: number }, message: { - base64: isBase64(message.media) ? message.media : undefined, - mediaUrl: isURL(message.media) ? message.media : undefined, + base64: isBase64(message.media) ? message.media : null, + mediaUrl: isURL(message.media) ? message.media : null, quoted, }, messageType: 'videoMessage', @@ -351,8 +354,8 @@ export class EvolutionStartupService extends ChannelStartupService { messageRaw = { key: { fromMe: true, id: messageId, remoteJid: number }, message: { - base64: isBase64(message.media) ? message.media : undefined, - mediaUrl: isURL(message.media) ? message.media : undefined, + base64: isBase64(message.media) ? message.media : null, + mediaUrl: isURL(message.media) ? message.media : null, quoted, }, messageType: 'audioMessage', @@ -372,8 +375,8 @@ export class EvolutionStartupService extends ChannelStartupService { messageRaw = { key: { fromMe: true, id: messageId, remoteJid: number }, message: { - base64: isBase64(message.media) ? message.media : undefined, - mediaUrl: isURL(message.media) ? message.media : undefined, + base64: isBase64(message.media) ? message.media : null, + mediaUrl: isURL(message.media) ? message.media : null, quoted, }, messageType: 'documentMessage', @@ -449,7 +452,7 @@ export class EvolutionStartupService extends ChannelStartupService { } } - const base64 = messageRaw.message.base64; + const { base64 } = messageRaw.message; delete messageRaw.message.base64; if (base64 || file || audioFile) { @@ -622,7 +625,8 @@ export class EvolutionStartupService extends ChannelStartupService { number = number.replace(/\D/g, ''); const hash = `${number}-${new Date().getTime()}`; - if (process.env.API_AUDIO_CONVERTER) { + const audioConverterConfig = this.configService.get('AUDIO_CONVERTER'); + if (audioConverterConfig.API_URL) { try { this.logger.verbose('Using audio converter API'); const formData = new FormData(); @@ -640,10 +644,10 @@ export class EvolutionStartupService extends ChannelStartupService { formData.append('format', 'mp4'); - const response = await axios.post(process.env.API_AUDIO_CONVERTER, formData, { + const response = await axios.post(audioConverterConfig.API_URL, formData, { headers: { ...formData.getHeaders(), - apikey: process.env.API_AUDIO_CONVERTER_KEY, + apikey: audioConverterConfig.API_KEY, }, }); diff --git a/src/api/integrations/channel/meta/whatsapp.business.service.ts b/src/api/integrations/channel/meta/whatsapp.business.service.ts index d3c35bee3..1e4808c15 100644 --- a/src/api/integrations/channel/meta/whatsapp.business.service.ts +++ b/src/api/integrations/channel/meta/whatsapp.business.service.ts @@ -20,10 +20,11 @@ import { chatbotController } from '@api/server.module'; import { CacheService } from '@api/services/cache.service'; import { ChannelStartupService } from '@api/services/channel.service'; import { Events, wa } from '@api/types/wa.types'; -import { Chatwoot, ConfigService, Database, Openai, S3, WaBusiness } from '@config/env.config'; +import { AudioConverter, Chatwoot, ConfigService, Database, Openai, S3, WaBusiness } from '@config/env.config'; import { BadRequestException, InternalServerErrorException } from '@exceptions'; import { createJid } from '@utils/createJid'; import { status } from '@utils/renderStatus'; +import { sendTelemetry } from '@utils/sendTelemetry'; import axios from 'axios'; import { arrayUnique, isURL } from 'class-validator'; import EventEmitter2 from 'eventemitter2'; @@ -459,6 +460,15 @@ export class BusinessStartupService extends ChannelStartupService { mediaType = 'video'; } + if (mediaType == 'video' && !this.configService.get('S3').SAVE_VIDEO) { + this.logger?.info?.('Video upload attempted but is disabled by configuration.'); + return { + success: false, + message: + 'Video upload is currently disabled. Please contact support if you need this feature enabled.', + }; + } + const mimetype = result.data?.mime_type || result.headers['content-type']; const contentDisposition = result.headers['content-disposition']; @@ -506,7 +516,9 @@ export class BusinessStartupService extends ChannelStartupService { const mediaUrl = await s3Service.getObjectUrl(fullName); messageRaw.message.mediaUrl = mediaUrl; - messageRaw.message.base64 = buffer.data.toString('base64'); + if (this.localWebhook.enabled && this.localWebhook.webhookBase64) { + messageRaw.message.base64 = buffer.data.toString('base64'); + } // Processar OpenAI speech-to-text para áudio após o mediaUrl estar disponível if (this.configService.get('OPENAI').ENABLED && mediaType === 'audio') { @@ -544,11 +556,19 @@ export class BusinessStartupService extends ChannelStartupService { this.logger.error(['Error on upload file to minio', error?.message, error?.stack]); } } else { - const buffer = await this.downloadMediaMessage(received?.messages[0]); - messageRaw.message.base64 = buffer.toString('base64'); + if (this.localWebhook.enabled && this.localWebhook.webhookBase64) { + const buffer = await this.downloadMediaMessage(received?.messages[0]); + messageRaw.message.base64 = buffer.toString('base64'); + } // Processar OpenAI speech-to-text para áudio mesmo sem S3 if (this.configService.get('OPENAI').ENABLED && message.type === 'audio') { + let openAiBase64 = messageRaw.message.base64; + if (!openAiBase64) { + const buffer = await this.downloadMediaMessage(received?.messages[0]); + openAiBase64 = buffer.toString('base64'); + } + const openAiDefaultSettings = await this.prismaRepository.openaiSetting.findFirst({ where: { instanceId: this.instanceId, @@ -564,7 +584,7 @@ export class BusinessStartupService extends ChannelStartupService { openAiDefaultSettings.OpenaiCreds, { message: { - base64: messageRaw.message.base64, + base64: openAiBase64, ...messageRaw, }, }, @@ -646,6 +666,8 @@ export class BusinessStartupService extends ChannelStartupService { this.logger.log(messageRaw); + sendTelemetry(`received.message.${messageRaw.messageType ?? 'unknown'}`); + this.sendDataWebhook(Events.MESSAGES_UPSERT, messageRaw); await chatbotController.emit({ @@ -1004,6 +1026,7 @@ export class BusinessStartupService extends ChannelStartupService { [message['mediaType']]: { [message['type']]: message['id'], ...(message['mediaType'] !== 'audio' && + message['mediaType'] !== 'video' && message['fileName'] && !isImage && { filename: message['fileName'] }), ...(message['mediaType'] !== 'audio' && message['caption'] && { caption: message['caption'] }), @@ -1291,7 +1314,8 @@ export class BusinessStartupService extends ChannelStartupService { number = number.replace(/\D/g, ''); const hash = `${number}-${new Date().getTime()}`; - if (process.env.API_AUDIO_CONVERTER) { + const audioConverterConfig = this.configService.get('AUDIO_CONVERTER'); + if (audioConverterConfig.API_URL) { this.logger.verbose('Using audio converter API'); const formData = new FormData(); @@ -1308,10 +1332,10 @@ export class BusinessStartupService extends ChannelStartupService { formData.append('format', 'mp3'); - const response = await axios.post(process.env.API_AUDIO_CONVERTER, formData, { + const response = await axios.post(audioConverterConfig.API_URL, formData, { headers: { ...formData.getHeaders(), - apikey: process.env.API_AUDIO_CONVERTER_KEY, + apikey: audioConverterConfig.API_KEY, }, }); @@ -1593,9 +1617,14 @@ export class BusinessStartupService extends ChannelStartupService { const messageType = msg.messageType.includes('Message') ? msg.messageType : msg.messageType + 'Message'; const mediaMessage = msg.message[messageType]; + if (!msg.message?.base64) { + const buffer = await this.downloadMediaMessage({ type: messageType, ...msg.message }); + msg.message.base64 = buffer.toString('base64'); + } + return { mediaType: msg.messageType, - fileName: mediaMessage?.fileName, + fileName: mediaMessage?.fileName || mediaMessage?.filename, caption: mediaMessage?.caption, size: { fileLength: mediaMessage?.fileLength, diff --git a/src/api/integrations/channel/whatsapp/baileysMessage.processor.ts b/src/api/integrations/channel/whatsapp/baileysMessage.processor.ts index 79fedd930..fbe1864a1 100644 --- a/src/api/integrations/channel/whatsapp/baileysMessage.processor.ts +++ b/src/api/integrations/channel/whatsapp/baileysMessage.processor.ts @@ -1,5 +1,5 @@ import { Logger } from '@config/logger.config'; -import { BaileysEventMap, MessageUpsertType, proto } from 'baileys'; +import { BaileysEventMap, MessageUpsertType, WAMessage } from 'baileys'; import { catchError, concatMap, delay, EMPTY, from, retryWhen, Subject, Subscription, take, tap } from 'rxjs'; type MessageUpsertPayload = BaileysEventMap['messages.upsert']; @@ -12,13 +12,29 @@ export class BaileysMessageProcessor { private subscription?: Subscription; protected messageSubject = new Subject<{ - messages: proto.IWebMessageInfo[]; + messages: WAMessage[]; type: MessageUpsertType; requestId?: string; settings: any; }>(); mount({ onMessageReceive }: MountProps) { + // Se já existe subscription, fazer cleanup primeiro + if (this.subscription && !this.subscription.closed) { + this.subscription.unsubscribe(); + } + + // Se o Subject foi completado, recriar + if (this.messageSubject.closed) { + this.processorLogs.warn('MessageSubject was closed, recreating...'); + this.messageSubject = new Subject<{ + messages: WAMessage[]; + type: MessageUpsertType; + requestId?: string; + settings: any; + }>(); + } + this.subscription = this.messageSubject .pipe( tap(({ messages }) => { diff --git a/src/api/integrations/channel/whatsapp/voiceCalls/useVoiceCallsBaileys.ts b/src/api/integrations/channel/whatsapp/voiceCalls/useVoiceCallsBaileys.ts index 951be1a05..cb667f9ca 100644 --- a/src/api/integrations/channel/whatsapp/voiceCalls/useVoiceCallsBaileys.ts +++ b/src/api/integrations/channel/whatsapp/voiceCalls/useVoiceCallsBaileys.ts @@ -71,7 +71,7 @@ export const useVoiceCallsBaileys = async ( socket.on('assertSessions', async (jids, force, callback) => { try { - const response = await baileys_sock.assertSessions(jids, force); + const response = await baileys_sock.assertSessions(jids); callback(response); diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index c70ab6f6e..60e857fcc 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -62,6 +62,7 @@ import { ChannelStartupService } from '@api/services/channel.service'; import { Events, MessageSubtype, TypeMediaMessage, wa } from '@api/types/wa.types'; import { CacheEngine } from '@cache/cacheengine'; import { + AudioConverter, CacheConf, Chatwoot, ConfigService, @@ -81,9 +82,10 @@ import { createId as cuid } from '@paralleldrive/cuid2'; import { Instance, Message } from '@prisma/client'; import { createJid } from '@utils/createJid'; import { fetchLatestWaWebVersion } from '@utils/fetchLatestWaWebVersion'; -import { makeProxyAgent } from '@utils/makeProxyAgent'; +import { makeProxyAgent, makeProxyAgentUndici } from '@utils/makeProxyAgent'; import { getOnWhatsappCache, saveOnWhatsappCache } from '@utils/onWhatsappCache'; import { status } from '@utils/renderStatus'; +import { sendTelemetry } from '@utils/sendTelemetry'; import useMultiFileAuthStatePrisma from '@utils/use-multi-file-auth-state-prisma'; import { AuthStateProvider } from '@utils/use-multi-file-auth-state-provider-files'; import { useMultiFileAuthStateRedisDb } from '@utils/use-multi-file-auth-state-redis-db'; @@ -97,6 +99,7 @@ import makeWASocket, { Chat, ConnectionState, Contact, + decryptPollVote, delay, DisconnectReason, downloadContentFromMessage, @@ -110,7 +113,8 @@ import makeWASocket, { isJidBroadcast, isJidGroup, isJidNewsletter, - isJidUser, + isPnUser, + jidNormalizedUser, makeCacheableSignalKeyStore, MessageUpsertType, MessageUserReceiptUpdate, @@ -131,7 +135,7 @@ import { Label } from 'baileys/lib/Types/Label'; import { LabelAssociation } from 'baileys/lib/Types/LabelAssociation'; import { spawn } from 'child_process'; import { isArray, isBase64, isURL } from 'class-validator'; -import { randomBytes } from 'crypto'; +import { createHash } from 'crypto'; import EventEmitter2 from 'eventemitter2'; import ffmpeg from 'fluent-ffmpeg'; import FormData from 'form-data'; @@ -151,6 +155,13 @@ import { v4 } from 'uuid'; import { BaileysMessageProcessor } from './baileysMessage.processor'; import { useVoiceCallsBaileys } from './voiceCalls/useVoiceCallsBaileys'; +export interface ExtendedIMessageKey extends proto.IMessageKey { + remoteJidAlt?: string; + participantAlt?: string; + server_id?: string; + isViewOnce?: boolean; +} + const groupMetadataCache = new CacheService(new CacheEngine(configService, 'groups').getEngine()); // Adicione a função getVideoDuration no início do arquivo @@ -239,6 +250,11 @@ export class BaileysStartupService extends ChannelStartupService { private readonly userDevicesCache: CacheStore = new NodeCache({ stdTTL: 300000, useClones: false }); private endSession = false; private logBaileys = this.configService.get('LOG').BAILEYS; + private eventProcessingQueue: Promise = Promise.resolve(); + + // Cache TTL constants (in seconds) + private readonly MESSAGE_CACHE_TTL_SECONDS = 5 * 60; // 5 minutes - avoid duplicate message processing + private readonly UPDATE_CACHE_TTL_SECONDS = 30 * 60; // 30 minutes - avoid duplicate status updates public stateConnection: wa.StateConnection = { state: 'close' }; @@ -254,6 +270,28 @@ export class BaileysStartupService extends ChannelStartupService { this.client?.ws?.close(); + const db = this.configService.get('DATABASE'); + const cache = this.configService.get('CACHE'); + const provider = this.configService.get('PROVIDER'); + + if (provider?.ENABLED) { + const authState = await this.authStateProvider.authStateProvider(this.instance.id); + + await authState.removeCreds(); + } + + if (cache?.REDIS.ENABLED && cache?.REDIS.SAVE_INSTANCES) { + const authState = await useMultiFileAuthStateRedisDb(this.instance.id, this.cache); + + await authState.removeCreds(); + } + + if (db.SAVE_DATA.INSTANCE) { + const authState = await useMultiFileAuthStatePrisma(this.instance.id, this.cache); + + await authState.removeCreds(); + } + const sessionExists = await this.prismaRepository.session.findFirst({ where: { sessionId: this.instanceId } }); if (sessionExists) { await this.prismaRepository.session.delete({ where: { sessionId: this.instanceId } }); @@ -431,7 +469,7 @@ export class BaileysStartupService extends ChannelStartupService { try { const profilePic = await this.profilePicture(this.instance.wuid); this.instance.profilePictureUrl = profilePic.profilePictureUrl; - } catch (error) { + } catch { this.instance.profilePictureUrl = null; } const formattedWuid = this.instance.wuid.split('@')[0].padEnd(30, ' '); @@ -484,9 +522,13 @@ export class BaileysStartupService extends ChannelStartupService { private async getMessage(key: proto.IMessageKey, full = false) { try { - const webMessageInfo = (await this.prismaRepository.message.findMany({ - where: { instanceId: this.instanceId, key: { path: ['id'], equals: key.id } }, - })) as unknown as proto.IWebMessageInfo[]; + // Use raw SQL to avoid JSON path issues + const webMessageInfo = (await this.prismaRepository.$queryRaw` + SELECT * FROM "Message" + WHERE "instanceId" = ${this.instanceId} + AND "key"->>'id' = ${key.id} + `) as proto.IWebMessageInfo[]; + if (full) { return webMessageInfo[0]; } @@ -506,7 +548,7 @@ export class BaileysStartupService extends ChannelStartupService { } return webMessageInfo[0].message; - } catch (error) { + } catch { return { conversation: '' }; } } @@ -553,15 +595,6 @@ export class BaileysStartupService extends ChannelStartupService { const version = baileysVersion.version; const log = `Baileys version: ${version.join('.')}`; - // if (session.VERSION) { - // version = session.VERSION.split('.'); - // log = `Baileys version env: ${version}`; - // } else { - // const baileysVersion = await fetchLatestWaWebVersion({}); - // version = baileysVersion.version; - // log = `Baileys version: ${version}`; - // } - this.logger.info(log); this.logger.info(`Group Ignore: ${this.localSettings.groupsIgnore}`); @@ -578,8 +611,8 @@ export class BaileysStartupService extends ChannelStartupService { const proxyUrls = text.split('\r\n'); const rand = Math.floor(Math.random() * Math.floor(proxyUrls.length)); const proxyUrl = 'http://' + proxyUrls[rand]; - options = { agent: makeProxyAgent(proxyUrl), fetchAgent: makeProxyAgent(proxyUrl) }; - } catch (error) { + options = { agent: makeProxyAgent(proxyUrl), fetchAgent: makeProxyAgentUndici(proxyUrl) }; + } catch { this.localProxy.enabled = false; } } else { @@ -591,7 +624,7 @@ export class BaileysStartupService extends ChannelStartupService { username: this.localProxy.username, password: this.localProxy.password, }), - fetchAgent: makeProxyAgent({ + fetchAgent: makeProxyAgentUndici({ host: this.localProxy.host, port: this.localProxy.port, protocol: this.localProxy.protocol, @@ -694,6 +727,11 @@ export class BaileysStartupService extends ChannelStartupService { this.loadWebhook(); this.loadProxy(); + // Remontar o messageProcessor para garantir que está funcionando após reconexão + this.messageProcessor.mount({ + onMessageReceive: this.messageHandle['messages.upsert'].bind(this), + }); + return await this.createClient(number); } catch (error) { this.logger.error(error); @@ -823,10 +861,12 @@ export class BaileysStartupService extends ChannelStartupService { this.sendDataWebhook(Events.CONTACTS_UPDATE, updatedContacts); await Promise.all( updatedContacts.map(async (contact) => { - const update = this.prismaRepository.contact.updateMany({ - where: { remoteJid: contact.remoteJid, instanceId: this.instanceId }, - data: { profilePicUrl: contact.profilePicUrl }, - }); + if (this.configService.get('DATABASE').SAVE_DATA.CONTACTS) { + await this.prismaRepository.contact.updateMany({ + where: { remoteJid: contact.remoteJid, instanceId: this.instanceId }, + data: { profilePicUrl: contact.profilePicUrl }, + }); + } if (this.configService.get('CHATWOOT').ENABLED && this.localChatwoot?.enabled) { const instance = { instanceName: this.instance.name, instanceId: this.instance.id }; @@ -845,8 +885,6 @@ export class BaileysStartupService extends ChannelStartupService { avatar_url: contact.profilePicUrl, }); } - - return update; }), ); } @@ -859,6 +897,7 @@ export class BaileysStartupService extends ChannelStartupService { 'contacts.update': async (contacts: Partial[]) => { const contactsRaw: { remoteJid: string; pushName?: string; profilePicUrl?: string; instanceId: string }[] = []; for await (const contact of contacts) { + this.logger.debug(`Updating contact: ${JSON.stringify(contact, null, 2)}`); contactsRaw.push({ remoteJid: contact.id, pushName: contact?.name ?? contact?.verifiedName, @@ -869,19 +908,18 @@ export class BaileysStartupService extends ChannelStartupService { this.sendDataWebhook(Events.CONTACTS_UPDATE, contactsRaw); - const updateTransactions = contactsRaw.map((contact) => - this.prismaRepository.contact.upsert({ - where: { remoteJid_instanceId: { remoteJid: contact.remoteJid, instanceId: contact.instanceId } }, - create: contact, - update: contact, - }), - ); - await this.prismaRepository.$transaction(updateTransactions); - - const usersContacts = contactsRaw.filter((c) => c.remoteJid.includes('@s.whatsapp')); - if (usersContacts) { - await saveOnWhatsappCache(usersContacts.map((c) => ({ remoteJid: c.remoteJid }))); + if (this.configService.get('DATABASE').SAVE_DATA.CONTACTS) { + const updateTransactions = contactsRaw.map((contact) => + this.prismaRepository.contact.upsert({ + where: { remoteJid_instanceId: { remoteJid: contact.remoteJid, instanceId: contact.instanceId } }, + create: contact, + update: contact, + }), + ); + await this.prismaRepository.$transaction(updateTransactions); } + + //const usersContacts = contactsRaw.filter((c) => c.remoteJid.includes('@s.whatsapp')); }, }; @@ -982,10 +1020,6 @@ export class BaileysStartupService extends ChannelStartupService { continue; } - if (m.key.remoteJid?.includes('@lid') && m.key.senderPn) { - m.key.remoteJid = m.key.senderPn; - } - if (Long.isLong(m?.messageTimestamp)) { m.messageTimestamp = m.messageTimestamp?.toNumber(); } @@ -1012,7 +1046,10 @@ export class BaileysStartupService extends ChannelStartupService { messagesRaw.push(this.prepareMessage(m)); } - this.sendDataWebhook(Events.MESSAGES_SET, [...messagesRaw]); + this.sendDataWebhook(Events.MESSAGES_SET, [...messagesRaw], true, undefined, { + isLatest, + progress, + }); if (this.configService.get('DATABASE').SAVE_DATA.HISTORIC) { await this.prismaRepository.message.createMany({ data: messagesRaw, skipDuplicates: true }); @@ -1048,10 +1085,6 @@ export class BaileysStartupService extends ChannelStartupService { ) => { try { for (const received of messages) { - if (received.key.remoteJid?.includes('@lid') && received.key.senderPn) { - (received.key as { previousRemoteJid?: string | null }).previousRemoteJid = received.key.remoteJid; - received.key.remoteJid = received.key.senderPn; - } if ( received?.messageStubParameters?.some?.((param) => [ @@ -1062,6 +1095,7 @@ export class BaileysStartupService extends ChannelStartupService { 'Invalid PreKey ID', 'No session record', 'No session found to decrypt message', + 'Message absent from node', ].some((err) => param?.includes?.(err)), ) ) { @@ -1097,11 +1131,16 @@ export class BaileysStartupService extends ChannelStartupService { ); await this.sendDataWebhook(Events.MESSAGES_EDITED, editedMessage); + + if (received.key?.id && editedMessage.key?.id) { + await this.baileysCache.set(`protocol_${received.key.id}`, editedMessage.key.id, 60 * 60 * 24); + } + const oldMessage = await this.getMessage(editedMessage.key, true); if ((oldMessage as any)?.id) { - const editedMessageTimestamp = Long.isLong(editedMessage?.timestampMs) - ? Math.floor(editedMessage.timestampMs.toNumber() / 1000) - : Math.floor((editedMessage.timestampMs as number) / 1000); + const editedMessageTimestamp = Long.isLong(received?.messageTimestamp) + ? Math.floor(received?.messageTimestamp.toNumber()) + : Math.floor(received?.messageTimestamp as number); await this.prismaRepository.message.update({ where: { id: (oldMessage as any).id }, @@ -1124,22 +1163,7 @@ export class BaileysStartupService extends ChannelStartupService { } } - const messageKey = `${this.instance.id}_${received.key.id}`; - const cached = await this.baileysCache.get(messageKey); - - if (cached && !editedMessage) { - this.logger.info(`Message duplicated ignored: ${received.key.id}`); - continue; - } - - await this.baileysCache.set(messageKey, true, 5 * 60); - - if ( - (type !== 'notify' && type !== 'append') || - editedMessage || - received.message?.pollUpdateMessage || - !received?.message - ) { + if ((type !== 'notify' && type !== 'append') || editedMessage || !received?.message) { continue; } @@ -1171,7 +1195,7 @@ export class BaileysStartupService extends ChannelStartupService { where: { id: existingChat.id }, data: { name: received.pushName }, }); - } catch (error) { + } catch { console.log(`Chat insert record ignored: ${received.key.remoteJid} - ${this.instanceId}`); } } @@ -1179,6 +1203,107 @@ export class BaileysStartupService extends ChannelStartupService { const messageRaw = this.prepareMessage(received); + if (messageRaw.messageType === 'pollUpdateMessage') { + const pollCreationKey = messageRaw.message.pollUpdateMessage.pollCreationMessageKey; + const pollMessage = (await this.getMessage(pollCreationKey, true)) as proto.IWebMessageInfo; + const pollMessageSecret = (await this.getMessage(pollCreationKey)) as any; + + if (pollMessage) { + const pollOptions = + (pollMessage.message as any).pollCreationMessage?.options || + (pollMessage.message as any).pollCreationMessageV3?.options || + []; + const pollVote = messageRaw.message.pollUpdateMessage.vote; + + const voterJid = received.key.fromMe + ? this.instance.wuid + : received.key.participant || received.key.remoteJid; + + let pollEncKey = pollMessageSecret?.messageContextInfo?.messageSecret; + + let successfulVoterJid = voterJid; + + if (typeof pollEncKey === 'string') { + pollEncKey = Buffer.from(pollEncKey, 'base64'); + } else if (pollEncKey?.type === 'Buffer' && Array.isArray(pollEncKey.data)) { + pollEncKey = Buffer.from(pollEncKey.data); + } + + if (Buffer.isBuffer(pollEncKey) && pollEncKey.length === 44) { + pollEncKey = Buffer.from(pollEncKey.toString('utf8'), 'base64'); + } + + if (pollVote.encPayload && pollEncKey) { + const creatorCandidates = [ + this.instance.wuid, + this.client.user?.lid, + pollMessage.key.participant, + (pollMessage.key as any).participantAlt, + pollMessage.key.remoteJid, + ]; + + const key = received.key as any; + const voterCandidates = [ + this.instance.wuid, + this.client.user?.lid, + key.participant, + key.participantAlt, + key.remoteJidAlt, + key.remoteJid, + ]; + + const uniqueCreators = [ + ...new Set(creatorCandidates.filter(Boolean).map((id) => jidNormalizedUser(id))), + ]; + const uniqueVoters = [...new Set(voterCandidates.filter(Boolean).map((id) => jidNormalizedUser(id)))]; + + let decryptedVote; + + for (const creator of uniqueCreators) { + for (const voter of uniqueVoters) { + try { + decryptedVote = decryptPollVote(pollVote, { + pollCreatorJid: creator, + pollMsgId: pollMessage.key.id, + pollEncKey, + voterJid: voter, + } as any); + if (decryptedVote) { + successfulVoterJid = voter; + break; + } + } catch { + // Continue trying + } + } + if (decryptedVote) break; + } + + if (decryptedVote) { + Object.assign(pollVote, decryptedVote); + } + } + + const selectedOptions = pollVote?.selectedOptions || []; + + const selectedOptionNames = pollOptions + .filter((option) => { + const hash = createHash('sha256').update(option.optionName).digest(); + return selectedOptions.some((selected) => Buffer.compare(selected, hash) === 0); + }) + .map((option) => option.optionName); + + messageRaw.message.pollUpdateMessage.vote.selectedOptions = selectedOptionNames; + + const pollUpdates = pollOptions.map((option) => ({ + name: option.optionName, + voters: selectedOptionNames.includes(option.optionName) ? [successfulVoterJid] : [], + })); + + messageRaw.pollUpdates = pollUpdates; + } + } + const isMedia = received?.message?.imageMessage || received?.message?.videoMessage || @@ -1188,6 +1313,8 @@ export class BaileysStartupService extends ChannelStartupService { received?.message?.ptvMessage || received?.message?.audioMessage; + const isVideo = received?.message?.videoMessage; + if (this.localSettings.readMessages && received.key.id !== 'status@broadcast') { await this.client.readMessages([received.key]); } @@ -1226,7 +1353,9 @@ export class BaileysStartupService extends ChannelStartupService { } if (this.configService.get('DATABASE').SAVE_DATA.NEW_MESSAGE) { - const msg = await this.prismaRepository.message.create({ data: messageRaw }); + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const { pollUpdates, ...messageData } = messageRaw; + const msg = await this.prismaRepository.message.create({ data: messageData }); const { remoteJid } = received.key; const timestamp = msg.messageTimestamp; @@ -1250,7 +1379,7 @@ export class BaileysStartupService extends ChannelStartupService { await this.updateMessagesReadedByTimestamp(remoteJid, timestamp); } - await this.baileysCache.set(messageKey, true, 5 * 60); + await this.baileysCache.set(messageKey, true, this.MESSAGE_CACHE_TTL_SECONDS); } else { this.logger.info(`Update readed messages duplicated ignored [avoid deadlock]: ${messageKey}`); } @@ -1258,6 +1387,12 @@ export class BaileysStartupService extends ChannelStartupService { if (isMedia) { if (this.configService.get('S3').ENABLE) { try { + if (isVideo && !this.configService.get('S3').SAVE_VIDEO) { + this.logger.warn('Video upload is disabled. Skipping video upload.'); + // Skip video upload by returning early from this block + return; + } + const message: any = received; // Verificação adicional para garantir que há conteúdo de mídia real @@ -1268,6 +1403,11 @@ export class BaileysStartupService extends ChannelStartupService { } else { const media = await this.getBase64FromMediaMessage({ message }, true); + if (!media) { + this.logger.verbose('No valid media to upload (messageContextInfo only), skipping MinIO'); + return; + } + const { buffer, mediaType, fileName, size } = media; const mimetype = mimeTypes.lookup(fileName).toString(); const fullName = join( @@ -1332,7 +1472,13 @@ export class BaileysStartupService extends ChannelStartupService { } } - this.logger.log(messageRaw); + this.logger.verbose(messageRaw); + + sendTelemetry(`received.message.${messageRaw.messageType ?? 'unknown'}`); + if (messageRaw.key.remoteJid?.includes('@lid') && messageRaw.key.remoteJidAlt) { + messageRaw.key.remoteJid = messageRaw.key.remoteJidAlt; + } + console.log(messageRaw); this.sendDataWebhook(Events.MESSAGES_UPSERT, messageRaw); @@ -1347,7 +1493,12 @@ export class BaileysStartupService extends ChannelStartupService { where: { remoteJid: received.key.remoteJid, instanceId: this.instanceId }, }); - const contactRaw: { remoteJid: string; pushName: string; profilePicUrl?: string; instanceId: string } = { + const contactRaw: { + remoteJid: string; + pushName: string; + profilePicUrl?: string; + instanceId: string; + } = { remoteJid: received.key.remoteJid, pushName: received.key.fromMe ? '' : received.key.fromMe == null ? '' : received.pushName, profilePicUrl: (await this.profilePicture(received.key.remoteJid)).profilePictureUrl, @@ -1358,6 +1509,17 @@ export class BaileysStartupService extends ChannelStartupService { continue; } + if (contactRaw.remoteJid.includes('@s.whatsapp') || contactRaw.remoteJid.includes('@lid')) { + await saveOnWhatsappCache([ + { + remoteJid: + messageRaw.key.addressingMode === 'lid' ? messageRaw.key.remoteJidAlt : messageRaw.key.remoteJid, + remoteJidAlt: messageRaw.key.remoteJidAlt, + lid: messageRaw.key.addressingMode === 'lid' ? 'lid' : null, + }, + ]); + } + if (contact) { this.sendDataWebhook(Events.CONTACTS_UPDATE, contactRaw); @@ -1387,10 +1549,6 @@ export class BaileysStartupService extends ChannelStartupService { update: contactRaw, create: contactRaw, }); - - if (contactRaw.remoteJid.includes('@s.whatsapp')) { - await saveOnWhatsappCache([{ remoteJid: contactRaw.remoteJid }]); - } } } catch (error) { this.logger.error(error); @@ -1398,7 +1556,7 @@ export class BaileysStartupService extends ChannelStartupService { }, 'messages.update': async (args: { update: Partial; key: WAMessageKey }[], settings: any) => { - this.logger.log(`Update messages ${JSON.stringify(args, undefined, 2)}`); + this.logger.verbose(`Update messages ${JSON.stringify(args, undefined, 2)}`); const readChatToUpdate: Record = {}; // {remoteJid: true} @@ -1407,20 +1565,26 @@ export class BaileysStartupService extends ChannelStartupService { continue; } - if (key.remoteJid?.includes('@lid') && key.senderPn) { - key.remoteJid = key.senderPn; - } - const updateKey = `${this.instance.id}_${key.id}_${update.status}`; const cached = await this.baileysCache.get(updateKey); - if (cached) { - this.logger.info(`Message duplicated ignored [avoid deadlock]: ${updateKey}`); + const secondsSinceEpoch = Math.floor(Date.now() / 1000); + console.log('CACHE:', { cached, updateKey, messageTimestamp: update.messageTimestamp, secondsSinceEpoch }); + + if ( + (update.messageTimestamp && update.messageTimestamp === cached) || + (!update.messageTimestamp && secondsSinceEpoch === cached) + ) { + this.logger.info(`Update Message duplicated ignored [avoid deadlock]: ${updateKey}`); continue; } - await this.baileysCache.set(updateKey, true, 30 * 60); + if (update.messageTimestamp) { + await this.baileysCache.set(updateKey, update.messageTimestamp, 30 * 60); + } else { + await this.baileysCache.set(updateKey, secondsSinceEpoch, 30 * 60); + } if (status[update.status] === 'READ' && key.fromMe) { if (this.configService.get('CHATWOOT').ENABLED && this.localChatwoot?.enabled) { @@ -1450,24 +1614,46 @@ export class BaileysStartupService extends ChannelStartupService { keyId: key.id, remoteJid: key?.remoteJid, fromMe: key.fromMe, - participant: key?.remoteJid, - status: status[update.status] ?? 'DELETED', + participant: key?.participant, + status: status[update.status] ?? 'SERVER_ACK', pollUpdates, instanceId: this.instanceId, }; + if (update.message) { + message.message = update.message; + } + let findMessage: any; const configDatabaseData = this.configService.get('DATABASE').SAVE_DATA; if (configDatabaseData.HISTORIC || configDatabaseData.NEW_MESSAGE) { - findMessage = await this.prismaRepository.message.findFirst({ - where: { instanceId: this.instanceId, key: { path: ['id'], equals: key.id } }, - }); + // Use raw SQL to avoid JSON path issues + const protocolMapKey = `protocol_${key.id}`; + const originalMessageId = (await this.baileysCache.get(protocolMapKey)) as string; + + if (originalMessageId) { + message.keyId = originalMessageId; + } - if (findMessage) message.messageId = findMessage.id; + const searchId = originalMessageId || key.id; + + const messages = (await this.prismaRepository.$queryRaw` + SELECT * FROM "Message" + WHERE "instanceId" = ${this.instanceId} + AND "key"->>'id' = ${searchId} + LIMIT 1 + `) as any[]; + findMessage = messages[0] || null; + + if (!findMessage?.id) { + this.logger.warn(`Original message not found for update. Skipping. Key: ${JSON.stringify(key)}`); + continue; + } + message.messageId = findMessage.id; } if (update.message === null && update.status === undefined) { - this.sendDataWebhook(Events.MESSAGES_DELETE, key); + this.sendDataWebhook(Events.MESSAGES_DELETE, { ...key, status: 'DELETED' }); if (this.configService.get('DATABASE').SAVE_DATA.MESSAGE_UPDATE) await this.prismaRepository.messageUpdate.create({ data: message }); @@ -1498,7 +1684,7 @@ export class BaileysStartupService extends ChannelStartupService { if (status[update.status] === status[4]) { this.logger.log(`Update as read in message.update ${remoteJid} - ${timestamp}`); await this.updateMessagesReadedByTimestamp(remoteJid, timestamp); - await this.baileysCache.set(messageKey, true, 5 * 60); + await this.baileysCache.set(messageKey, true, this.MESSAGE_CACHE_TTL_SECONDS); } await this.prismaRepository.message.update({ @@ -1515,8 +1701,11 @@ export class BaileysStartupService extends ChannelStartupService { this.sendDataWebhook(Events.MESSAGES_UPDATE, message); - if (this.configService.get('DATABASE').SAVE_DATA.MESSAGE_UPDATE) - await this.prismaRepository.messageUpdate.create({ data: message }); + if (this.configService.get('DATABASE').SAVE_DATA.MESSAGE_UPDATE) { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const { message: _msg, ...messageData } = message; + await this.prismaRepository.messageUpdate.create({ data: messageData }); + } const existingChat = await this.prismaRepository.chat.findFirst({ where: { instanceId: this.instanceId, remoteJid: message.remoteJid }, @@ -1529,7 +1718,7 @@ export class BaileysStartupService extends ChannelStartupService { if (this.configService.get('DATABASE').SAVE_DATA.CHATS) { try { await this.prismaRepository.chat.update({ where: { id: existingChat.id }, data: chatToInsert }); - } catch (error) { + } catch { console.log(`Chat insert record ignored: ${chatToInsert.remoteJid} - ${chatToInsert.instanceId}`); } } @@ -1556,12 +1745,66 @@ export class BaileysStartupService extends ChannelStartupService { }); }, - 'group-participants.update': (participantsUpdate: { + 'group-participants.update': async (participantsUpdate: { id: string; participants: string[]; action: ParticipantAction; }) => { - this.sendDataWebhook(Events.GROUP_PARTICIPANTS_UPDATE, participantsUpdate); + // ENHANCEMENT: Adds participantsData field while maintaining backward compatibility + // MAINTAINS: participants: string[] (original JID strings) + // ADDS: participantsData: { jid: string, phoneNumber: string, name?: string, imgUrl?: string }[] + // This enables LID to phoneNumber conversion without breaking existing webhook consumers + + // Helper to normalize participantId as phone number + const normalizePhoneNumber = (id: string | null | undefined): string => { + // Remove @lid, @s.whatsapp.net suffixes and extract just the number part + return String(id || '').split('@')[0]; + }; + + try { + // Usa o mesmo método que o endpoint /group/participants + const groupParticipants = await this.findParticipants({ groupJid: participantsUpdate.id }); + + // Validação para garantir que temos dados válidos + if (!groupParticipants?.participants || !Array.isArray(groupParticipants.participants)) { + throw new Error('Invalid participant data received from findParticipants'); + } + + // Filtra apenas os participantes que estão no evento + const resolvedParticipants = participantsUpdate.participants.map((participantId) => { + const participantData = groupParticipants.participants.find((p) => p.id === participantId); + + let phoneNumber: string; + if (participantData?.phoneNumber) { + phoneNumber = participantData.phoneNumber; + } else { + phoneNumber = normalizePhoneNumber(participantId); + } + + return { + jid: participantId, + phoneNumber, + name: participantData?.name, + imgUrl: participantData?.imgUrl, + }; + }); + + // Mantém formato original + adiciona dados resolvidos + const enhancedParticipantsUpdate = { + ...participantsUpdate, + participants: participantsUpdate.participants, // Mantém array original de strings + // Adiciona dados resolvidos em campo separado + participantsData: resolvedParticipants, + }; + + this.sendDataWebhook(Events.GROUP_PARTICIPANTS_UPDATE, enhancedParticipantsUpdate); + } catch (error) { + this.logger.error( + `Failed to resolve participant data for GROUP_PARTICIPANTS_UPDATE webhook: ${error.message} | Group: ${participantsUpdate.id} | Participants: ${participantsUpdate.participants.length}`, + ); + // Fallback - envia sem conversão + this.sendDataWebhook(Events.GROUP_PARTICIPANTS_UPDATE, participantsUpdate); + } this.updateGroupMetadataCache(participantsUpdate.id); }, @@ -1631,132 +1874,141 @@ export class BaileysStartupService extends ChannelStartupService { private eventHandler() { this.client.ev.process(async (events) => { - if (!this.endSession) { - const database = this.configService.get('DATABASE'); - const settings = await this.findSettings(); + this.eventProcessingQueue = this.eventProcessingQueue.then(async () => { + try { + if (!this.endSession) { + const database = this.configService.get('DATABASE'); + const settings = await this.findSettings(); - if (events.call) { - const call = events.call[0]; + if (events.call) { + const call = events.call[0]; - if (settings?.rejectCall && call.status == 'offer') { - this.client.rejectCall(call.id, call.from); - } + if (settings?.rejectCall && call.status == 'offer') { + this.client.rejectCall(call.id, call.from); + } - if (settings?.msgCall?.trim().length > 0 && call.status == 'offer') { - const msg = await this.client.sendMessage(call.from, { text: settings.msgCall }); + if (settings?.msgCall?.trim().length > 0 && call.status == 'offer') { + if (call.from.endsWith('@lid')) { + call.from = await this.client.signalRepository.lidMapping.getPNForLID(call.from as string); + } + const msg = await this.client.sendMessage(call.from, { text: settings.msgCall }); - this.client.ev.emit('messages.upsert', { messages: [msg], type: 'notify' }); - } + this.client.ev.emit('messages.upsert', { messages: [msg], type: 'notify' }); + } - this.sendDataWebhook(Events.CALL, call); - } + this.sendDataWebhook(Events.CALL, call); + } - if (events['connection.update']) { - this.connectionUpdate(events['connection.update']); - } + if (events['connection.update']) { + this.connectionUpdate(events['connection.update']); + } - if (events['creds.update']) { - this.instance.authState.saveCreds(); - } + if (events['creds.update']) { + this.instance.authState.saveCreds(); + } - if (events['messaging-history.set']) { - const payload = events['messaging-history.set']; - this.messageHandle['messaging-history.set'](payload); - } + if (events['messaging-history.set']) { + const payload = events['messaging-history.set']; + await this.messageHandle['messaging-history.set'](payload); + } - if (events['messages.upsert']) { - const payload = events['messages.upsert']; + if (events['messages.upsert']) { + const payload = events['messages.upsert']; - this.messageProcessor.processMessage(payload, settings); - // this.messageHandle['messages.upsert'](payload, settings); - } + // this.messageProcessor.processMessage(payload, settings); + await this.messageHandle['messages.upsert'](payload, settings); + } - if (events['messages.update']) { - const payload = events['messages.update']; - this.messageHandle['messages.update'](payload, settings); - } + if (events['messages.update']) { + const payload = events['messages.update']; + await this.messageHandle['messages.update'](payload, settings); + } - if (events['message-receipt.update']) { - const payload = events['message-receipt.update'] as MessageUserReceiptUpdate[]; - const remotesJidMap: Record = {}; + if (events['message-receipt.update']) { + const payload = events['message-receipt.update'] as MessageUserReceiptUpdate[]; + const remotesJidMap: Record = {}; - for (const event of payload) { - if (typeof event.key.remoteJid === 'string' && typeof event.receipt.readTimestamp === 'number') { - remotesJidMap[event.key.remoteJid] = event.receipt.readTimestamp; - } - } + for (const event of payload) { + if (typeof event.key.remoteJid === 'string' && typeof event.receipt.readTimestamp === 'number') { + remotesJidMap[event.key.remoteJid] = event.receipt.readTimestamp; + } + } - await Promise.all( - Object.keys(remotesJidMap).map(async (remoteJid) => - this.updateMessagesReadedByTimestamp(remoteJid, remotesJidMap[remoteJid]), - ), - ); - } + await Promise.all( + Object.keys(remotesJidMap).map(async (remoteJid) => + this.updateMessagesReadedByTimestamp(remoteJid, remotesJidMap[remoteJid]), + ), + ); + } - if (events['presence.update']) { - const payload = events['presence.update']; + if (events['presence.update']) { + const payload = events['presence.update']; - if (settings?.groupsIgnore && payload.id.includes('@g.us')) { - return; - } + if (settings?.groupsIgnore && payload.id.includes('@g.us')) { + return; + } - this.sendDataWebhook(Events.PRESENCE_UPDATE, payload); - } + this.sendDataWebhook(Events.PRESENCE_UPDATE, payload); + } - if (!settings?.groupsIgnore) { - if (events['groups.upsert']) { - const payload = events['groups.upsert']; - this.groupHandler['groups.upsert'](payload); - } + if (!settings?.groupsIgnore) { + if (events['groups.upsert']) { + const payload = events['groups.upsert']; + this.groupHandler['groups.upsert'](payload); + } - if (events['groups.update']) { - const payload = events['groups.update']; - this.groupHandler['groups.update'](payload); - } + if (events['groups.update']) { + const payload = events['groups.update']; + this.groupHandler['groups.update'](payload); + } - if (events['group-participants.update']) { - const payload = events['group-participants.update']; - this.groupHandler['group-participants.update'](payload); - } - } + if (events['group-participants.update']) { + const payload = events['group-participants.update'] as any; + this.groupHandler['group-participants.update'](payload); + } + } - if (events['chats.upsert']) { - const payload = events['chats.upsert']; - this.chatHandle['chats.upsert'](payload); - } + if (events['chats.upsert']) { + const payload = events['chats.upsert']; + this.chatHandle['chats.upsert'](payload); + } - if (events['chats.update']) { - const payload = events['chats.update']; - this.chatHandle['chats.update'](payload); - } + if (events['chats.update']) { + const payload = events['chats.update']; + this.chatHandle['chats.update'](payload); + } - if (events['chats.delete']) { - const payload = events['chats.delete']; - this.chatHandle['chats.delete'](payload); - } + if (events['chats.delete']) { + const payload = events['chats.delete']; + this.chatHandle['chats.delete'](payload); + } - if (events['contacts.upsert']) { - const payload = events['contacts.upsert']; - this.contactHandle['contacts.upsert'](payload); - } + if (events['contacts.upsert']) { + const payload = events['contacts.upsert']; + this.contactHandle['contacts.upsert'](payload); + } - if (events['contacts.update']) { - const payload = events['contacts.update']; - this.contactHandle['contacts.update'](payload); - } + if (events['contacts.update']) { + const payload = events['contacts.update']; + this.contactHandle['contacts.update'](payload); + } - if (events[Events.LABELS_ASSOCIATION]) { - const payload = events[Events.LABELS_ASSOCIATION]; - this.labelHandle[Events.LABELS_ASSOCIATION](payload, database); - return; - } + if (events[Events.LABELS_ASSOCIATION]) { + const payload = events[Events.LABELS_ASSOCIATION]; + this.labelHandle[Events.LABELS_ASSOCIATION](payload, database); + return; + } - if (events[Events.LABELS_EDIT]) { - const payload = events[Events.LABELS_EDIT]; - this.labelHandle[Events.LABELS_EDIT](payload); - return; + if (events[Events.LABELS_EDIT]) { + const payload = events[Events.LABELS_EDIT]; + this.labelHandle[Events.LABELS_EDIT](payload); + return; + } + } + } catch (error) { + this.logger.error(error); } - } + }); }); } @@ -1797,7 +2049,7 @@ export class BaileysStartupService extends ChannelStartupService { const profilePictureUrl = await this.client.profilePictureUrl(jid, 'image'); return { wuid: jid, profilePictureUrl }; - } catch (error) { + } catch { return { wuid: jid, profilePictureUrl: null }; } } @@ -1807,7 +2059,7 @@ export class BaileysStartupService extends ChannelStartupService { try { return { wuid: jid, status: (await this.client.fetchStatus(jid))[0]?.status }; - } catch (error) { + } catch { return { wuid: jid, status: null }; } } @@ -1856,7 +2108,7 @@ export class BaileysStartupService extends ChannelStartupService { website: business?.website?.shift(), }; } - } catch (error) { + } catch { return { wuid: jid, name: null, picture: null, status: null, os: null, isBusiness: false }; } } @@ -1883,6 +2135,7 @@ export class BaileysStartupService extends ChannelStartupService { quoted: any, messageId?: string, ephemeralExpiration?: number, + contextInfo?: any, // participants?: GroupParticipant[], ) { sender = sender.toLowerCase(); @@ -1899,8 +2152,8 @@ export class BaileysStartupService extends ChannelStartupService { if (ephemeralExpiration) option.ephemeralExpiration = ephemeralExpiration; + // NOTE: NÃO DEVEMOS GERAR O messageId AQUI, SOMENTE SE VIER INFORMADO POR PARAMETRO. A GERAÇÃO ANTERIOR IMPEDE O WZAP DE IDENTIFICAR A SOURCE. if (messageId) option.messageId = messageId; - else option.messageId = '3EB0' + randomBytes(18).toString('hex').toUpperCase(); if (message['viewOnceMessage']) { const m = generateWAMessageFromContent(sender, message, { @@ -1910,7 +2163,7 @@ export class BaileysStartupService extends ChannelStartupService { quoted, }); const id = await this.client.relayMessage(sender, message, { messageId }); - m.key = { id: id, remoteJid: sender, participant: isJidUser(sender) ? sender : undefined, fromMe: true }; + m.key = { id: id, remoteJid: sender, participant: isPnUser(sender) ? sender : undefined, fromMe: true }; for (const [key, value] of Object.entries(m)) { if (!value || (isArray(value) && value.length) === 0) { delete m[key]; @@ -1937,10 +2190,19 @@ export class BaileysStartupService extends ChannelStartupService { } } + if (contextInfo) { + message['contextInfo'] = contextInfo; + } + if (message['conversation']) { return await this.client.sendMessage( sender, - { text: message['conversation'], mentions, linkPreview: linkPreview } as unknown as AnyMessageContent, + { + text: message['conversation'], + mentions, + linkPreview: linkPreview, + contextInfo: message['contextInfo'], + } as unknown as AnyMessageContent, option as unknown as MiscMessageGenerationOptions, ); } @@ -1948,7 +2210,11 @@ export class BaileysStartupService extends ChannelStartupService { if (!message['audio'] && !message['poll'] && !message['sticker'] && sender != 'status@broadcast') { return await this.client.sendMessage( sender, - { forward: { key: { remoteJid: this.instance.wuid, fromMe: true }, message }, mentions }, + { + forward: { key: { remoteJid: this.instance.wuid, fromMe: true }, message }, + mentions, + contextInfo: message['contextInfo'], + }, option as unknown as MiscMessageGenerationOptions, ); } @@ -2079,7 +2345,7 @@ export class BaileysStartupService extends ChannelStartupService { if (options?.quoted) { const m = options?.quoted; - const msg = m?.message ? m : ((await this.getMessage(m.key, true)) as proto.IWebMessageInfo); + const msg = m?.message ? m : ((await this.getMessage(m.key, true)) as WAMessage); if (msg) { quoted = msg; @@ -2089,6 +2355,8 @@ export class BaileysStartupService extends ChannelStartupService { let messageSent: WAMessage; let mentions: string[]; + let contextInfo: any; + if (isJidGroup(sender)) { let group; try { @@ -2096,7 +2364,7 @@ export class BaileysStartupService extends ChannelStartupService { if (!cache.REDIS.ENABLED && !cache.LOCAL.ENABLED) group = await this.findGroup({ groupJid: sender }, 'inner'); else group = await this.getGroupMetadataCache(sender); // group = await this.findGroup({ groupJid: sender }, 'inner'); - } catch (error) { + } catch { throw new NotFoundException('Group not found'); } @@ -2127,7 +2395,27 @@ export class BaileysStartupService extends ChannelStartupService { // group?.participants, ); } else { - messageSent = await this.sendMessage(sender, message, mentions, linkPreview, quoted); + contextInfo = { + mentionedJid: [], + groupMentions: [], + //expiration: 7776000, + ephemeralSettingTimestamp: { + low: Math.floor(Date.now() / 1000) - 172800, + high: 0, + unsigned: false, + }, + disappearingMode: { initiator: 0 }, + }; + messageSent = await this.sendMessage( + sender, + message, + mentions, + linkPreview, + quoted, + null, + undefined, + contextInfo, + ); } if (Long.isLong(messageSent?.messageTimestamp)) { @@ -2146,6 +2434,8 @@ export class BaileysStartupService extends ChannelStartupService { messageSent?.message?.ptvMessage || messageSent?.message?.audioMessage; + const isVideo = messageSent?.message?.videoMessage; + if (this.configService.get('CHATWOOT').ENABLED && this.localChatwoot?.enabled && !isIntegration) { this.chatwootService.eventWhatsapp( Events.SEND_MESSAGE, @@ -2170,6 +2460,10 @@ export class BaileysStartupService extends ChannelStartupService { if (isMedia && this.configService.get('S3').ENABLE) { try { + if (isVideo && !this.configService.get('S3').SAVE_VIDEO) { + throw new Error('Video upload is disabled.'); + } + const message: any = messageRaw; // Verificação adicional para garantir que há conteúdo de mídia real @@ -2180,6 +2474,11 @@ export class BaileysStartupService extends ChannelStartupService { } else { const media = await this.getBase64FromMediaMessage({ message }, true); + if (!media) { + this.logger.verbose('No valid media to upload (messageContextInfo only), skipping MinIO'); + return; + } + const { buffer, mediaType, fileName, size } = media; const mimetype = mimeTypes.lookup(fileName).toString(); @@ -2241,7 +2540,7 @@ export class BaileysStartupService extends ChannelStartupService { } } - this.logger.log(messageRaw); + this.logger.verbose(messageSent); this.sendDataWebhook(Events.SEND_MESSAGE, messageRaw); @@ -2568,6 +2867,13 @@ export class BaileysStartupService extends ChannelStartupService { } } + if (mediaMessage?.fileName) { + mimetype = mimeTypes.lookup(mediaMessage.fileName).toString(); + if (mimetype === 'application/mp4') { + mimetype = 'video/mp4'; + } + } + prepareMedia[mediaType].caption = mediaMessage?.caption; prepareMedia[mediaType].mimetype = mimetype; prepareMedia[mediaType].fileName = mediaMessage.fileName; @@ -2794,7 +3100,8 @@ export class BaileysStartupService extends ChannelStartupService { } public async processAudio(audio: string): Promise { - if (process.env.API_AUDIO_CONVERTER) { + const audioConverterConfig = this.configService.get('AUDIO_CONVERTER'); + if (audioConverterConfig.API_URL) { this.logger.verbose('Using audio converter API'); const formData = new FormData(); @@ -2804,8 +3111,8 @@ export class BaileysStartupService extends ChannelStartupService { formData.append('base64', audio); } - const { data } = await axios.post(process.env.API_AUDIO_CONVERTER, formData, { - headers: { ...formData.getHeaders(), apikey: process.env.API_AUDIO_CONVERTER_KEY }, + const { data } = await axios.post(audioConverterConfig.API_URL, formData, { + headers: { ...formData.getHeaders(), apikey: audioConverterConfig.API_KEY }, }); if (!data.audio) { @@ -3240,125 +3547,128 @@ export class BaileysStartupService extends ChannelStartupService { where: { instanceId: this.instanceId, remoteJid: { in: jids.users.map(({ jid }) => jid) } }, }); - // Separate @lid numbers from normal numbers - const lidUsers = jids.users.filter(({ jid }) => jid.includes('@lid')); - const normalUsers = jids.users.filter(({ jid }) => !jid.includes('@lid')); + // Unified cache verification for all numbers (normal and LID) + const numbersToVerify = jids.users.map(({ jid }) => jid.replace('+', '')); - // For normal numbers, use traditional Baileys verification - let normalVerifiedUsers: OnWhatsAppDto[] = []; - if (normalUsers.length > 0) { - console.log('normalUsers', normalUsers); - const numbersToVerify = normalUsers.map(({ jid }) => jid.replace('+', '')); - console.log('numbersToVerify', numbersToVerify); + // Get all numbers from cache + const cachedNumbers = await getOnWhatsappCache(numbersToVerify); - const cachedNumbers = await getOnWhatsappCache(numbersToVerify); - console.log('cachedNumbers', cachedNumbers); + // Separate numbers that are and are not in cache + const cachedJids = new Set(cachedNumbers.flatMap((cached) => cached.jidOptions)); + const numbersNotInCache = numbersToVerify.filter((jid) => !cachedJids.has(jid)); - const filteredNumbers = numbersToVerify.filter( - (jid) => !cachedNumbers.some((cached) => cached.jidOptions.includes(jid)), - ); - console.log('filteredNumbers', filteredNumbers); - - const verify = await this.client.onWhatsApp(...filteredNumbers); - console.log('verify', verify); - normalVerifiedUsers = await Promise.all( - normalUsers.map(async (user) => { - let numberVerified: (typeof verify)[0] | null = null; - - const cached = cachedNumbers.find((cached) => cached.jidOptions.includes(user.jid.replace('+', ''))); - if (cached) { - return new OnWhatsAppDto( - cached.remoteJid, - true, - user.number, - contacts.find((c) => c.remoteJid === cached.remoteJid)?.pushName, - cached.lid || (cached.remoteJid.includes('@lid') ? cached.remoteJid.split('@')[1] : undefined), - ); - } + // Only call Baileys for normal numbers (@s.whatsapp.net) that are not in cache + let verify: { jid: string; exists: boolean }[] = []; + const normalNumbersNotInCache = numbersNotInCache.filter((jid) => !jid.includes('@lid')); - // Brazilian numbers - if (user.number.startsWith('55')) { - const numberWithDigit = - user.number.slice(4, 5) === '9' && user.number.length === 13 - ? user.number - : `${user.number.slice(0, 4)}9${user.number.slice(4)}`; - const numberWithoutDigit = - user.number.length === 12 ? user.number : user.number.slice(0, 4) + user.number.slice(5); - - numberVerified = verify.find( - (v) => v.jid === `${numberWithDigit}@s.whatsapp.net` || v.jid === `${numberWithoutDigit}@s.whatsapp.net`, - ); - } + if (normalNumbersNotInCache.length > 0) { + this.logger.verbose(`Checking ${normalNumbersNotInCache.length} numbers via Baileys (not found in cache)`); + verify = await this.client.onWhatsApp(...normalNumbersNotInCache); + } - // Mexican/Argentina numbers - // Ref: https://faq.whatsapp.com/1294841057948784 - if (!numberVerified && (user.number.startsWith('52') || user.number.startsWith('54'))) { - let prefix = ''; - if (user.number.startsWith('52')) { - prefix = '1'; - } - if (user.number.startsWith('54')) { - prefix = '9'; - } + const verifiedUsers = await Promise.all( + jids.users.map(async (user) => { + // Try to get from cache first (works for all: normal and LID) + const cached = cachedNumbers.find((cached) => cached.jidOptions.includes(user.jid.replace('+', ''))); + + if (cached) { + this.logger.verbose(`Number ${user.number} found in cache`); + return new OnWhatsAppDto( + cached.remoteJid, + true, + user.number, + contacts.find((c) => c.remoteJid === cached.remoteJid)?.pushName, + cached.lid || (cached.remoteJid.includes('@lid') ? 'lid' : undefined), + ); + } - const numberWithDigit = - user.number.slice(2, 3) === prefix && user.number.length === 13 - ? user.number - : `${user.number.slice(0, 2)}${prefix}${user.number.slice(2)}`; - const numberWithoutDigit = - user.number.length === 12 ? user.number : user.number.slice(0, 2) + user.number.slice(3); + // If it's a LID number and not in cache, consider it valid + if (user.jid.includes('@lid')) { + return new OnWhatsAppDto( + user.jid, + true, + user.number, + contacts.find((c) => c.remoteJid === user.jid)?.pushName, + 'lid', + ); + } - numberVerified = verify.find( - (v) => v.jid === `${numberWithDigit}@s.whatsapp.net` || v.jid === `${numberWithoutDigit}@s.whatsapp.net`, - ); - } + // If not in cache and is a normal number, use Baileys verification + let numberVerified: (typeof verify)[0] | null = null; - if (!numberVerified) { - numberVerified = verify.find((v) => v.jid === user.jid); + // Brazilian numbers + if (user.number.startsWith('55')) { + const numberWithDigit = + user.number.slice(4, 5) === '9' && user.number.length === 13 + ? user.number + : `${user.number.slice(0, 4)}9${user.number.slice(4)}`; + const numberWithoutDigit = + user.number.length === 12 ? user.number : user.number.slice(0, 4) + user.number.slice(5); + + numberVerified = verify.find( + (v) => v.jid === `${numberWithDigit}@s.whatsapp.net` || v.jid === `${numberWithoutDigit}@s.whatsapp.net`, + ); + } + + // Mexican/Argentina numbers + // Ref: https://faq.whatsapp.com/1294841057948784 + if (!numberVerified && (user.number.startsWith('52') || user.number.startsWith('54'))) { + let prefix = ''; + if (user.number.startsWith('52')) { + prefix = '1'; + } + if (user.number.startsWith('54')) { + prefix = '9'; } - const numberJid = numberVerified?.jid || user.jid; - const lid = - typeof numberVerified?.lid === 'string' - ? numberVerified.lid - : numberJid.includes('@lid') - ? numberJid.split('@')[1] - : undefined; - return new OnWhatsAppDto( - numberJid, - !!numberVerified?.exists, - user.number, - contacts.find((c) => c.remoteJid === numberJid)?.pushName, - lid, + const numberWithDigit = + user.number.slice(2, 3) === prefix && user.number.length === 13 + ? user.number + : `${user.number.slice(0, 2)}${prefix}${user.number.slice(2)}`; + const numberWithoutDigit = + user.number.length === 12 ? user.number : user.number.slice(0, 2) + user.number.slice(3); + + numberVerified = verify.find( + (v) => v.jid === `${numberWithDigit}@s.whatsapp.net` || v.jid === `${numberWithoutDigit}@s.whatsapp.net`, ); - }), - ); - } + } - // For @lid numbers, always consider them as valid - const lidVerifiedUsers: OnWhatsAppDto[] = lidUsers.map((user) => { - return new OnWhatsAppDto( - user.jid, - true, - user.number, - contacts.find((c) => c.remoteJid === user.jid)?.pushName, - user.jid.split('@')[1], - ); - }); + if (!numberVerified) { + numberVerified = verify.find((v) => v.jid === user.jid); + } + + const numberJid = numberVerified?.jid || user.jid; + + return new OnWhatsAppDto( + numberJid, + !!numberVerified?.exists, + user.number, + contacts.find((c) => c.remoteJid === numberJid)?.pushName, + undefined, + ); + }), + ); // Combine results - onWhatsapp.push(...normalVerifiedUsers, ...lidVerifiedUsers); + onWhatsapp.push(...verifiedUsers); + + // TODO: Salvar no cache apenas números que NÃO estavam no cache + const numbersToCache = onWhatsapp.filter((user) => { + if (!user.exists) return false; + // Verifica se estava no cache usando jidOptions + const cached = cachedNumbers?.find((cached) => cached.jidOptions.includes(user.jid.replace('+', ''))); + return !cached; + }); - // Save to cache only valid numbers - await saveOnWhatsappCache( - onWhatsapp - .filter((user) => user.exists) - .map((user) => ({ + if (numbersToCache.length > 0) { + this.logger.verbose(`Salvando ${numbersToCache.length} números no cache`); + await saveOnWhatsappCache( + numbersToCache.map((user) => ({ remoteJid: user.jid, - jidOptions: user.jid.replace('+', ''), - lid: user.lid, + lid: user.lid === 'lid' ? 'lid' : undefined, })), - ); + ); + } return onWhatsapp; } @@ -3367,7 +3677,7 @@ export class BaileysStartupService extends ChannelStartupService { try { const keys: proto.IMessageKey[] = []; data.readMessages.forEach((read) => { - if (isJidGroup(read.remoteJid) || isJidUser(read.remoteJid)) { + if (isJidGroup(read.remoteJid) || isPnUser(read.remoteJid)) { keys.push({ remoteJid: read.remoteJid, fromMe: read.fromMe, id: read.id }); } }); @@ -3481,7 +3791,7 @@ export class BaileysStartupService extends ChannelStartupService { keyId: messageId, remoteJid: response.key.remoteJid, fromMe: response.key.fromMe, - participant: response.key?.remoteJid, + participant: response.key?.participant, status: 'DELETED', instanceId: this.instanceId, }; @@ -3542,7 +3852,8 @@ export class BaileysStartupService extends ChannelStartupService { } if ('messageContextInfo' in msg.message && Object.keys(msg.message).length === 1) { - throw 'The message is messageContextInfo'; + this.logger.verbose('Message contains only messageContextInfo, skipping media processing'); + return null; } let mediaMessage: any; @@ -3579,7 +3890,7 @@ export class BaileysStartupService extends ChannelStartupService { } if (typeof mediaMessage['mediaKey'] === 'object') { - msg.message = JSON.parse(JSON.stringify(msg.message)); + msg.message[mediaType].mediaKey = Uint8Array.from(Object.values(mediaMessage['mediaKey'])); } let buffer: Buffer; @@ -3591,7 +3902,7 @@ export class BaileysStartupService extends ChannelStartupService { {}, { logger: P({ level: 'error' }) as any, reuploadRequest: this.client.updateMediaMessage }, ); - } catch (err) { + } catch { this.logger.error('Download Media failed, trying to retry in 5 seconds...'); await new Promise((resolve) => setTimeout(resolve, 5000)); const mediaType = Object.keys(msg.message).find((key) => key.endsWith('Message')); @@ -3916,7 +4227,7 @@ export class BaileysStartupService extends ChannelStartupService { keyId: messageId, remoteJid: messageSent.key.remoteJid, fromMe: messageSent.key.fromMe, - participant: messageSent.key?.remoteJid, + participant: messageSent.key?.participant, status: 'EDITED', instanceId: this.instanceId, }; @@ -4181,7 +4492,7 @@ export class BaileysStartupService extends ChannelStartupService { public async inviteInfo(id: GroupInvite) { try { return await this.client.groupGetInviteInfo(id.inviteCode); - } catch (error) { + } catch { throw new NotFoundException('No invite info', id.inviteCode); } } @@ -4204,7 +4515,7 @@ export class BaileysStartupService extends ChannelStartupService { } return { send: true, inviteUrl }; - } catch (error) { + } catch { throw new NotFoundException('No send invite'); } } @@ -4299,22 +4610,63 @@ export class BaileysStartupService extends ChannelStartupService { throw new Error('Method not available in the Baileys service'); } + private deserializeMessageBuffers(obj: any): any { + if (obj === null || obj === undefined) { + return obj; + } + + if (typeof obj === 'object' && !Array.isArray(obj) && !Buffer.isBuffer(obj)) { + const keys = Object.keys(obj); + const isIndexedObject = keys.every((key) => !isNaN(Number(key))); + + if (isIndexedObject && keys.length > 0) { + const values = keys.sort((a, b) => Number(a) - Number(b)).map((key) => obj[key]); + return new Uint8Array(values); + } + } + + // Is Buffer?, converter to Uint8Array + if (Buffer.isBuffer(obj)) { + return new Uint8Array(obj); + } + + // Process arrays recursively + if (Array.isArray(obj)) { + return obj.map((item) => this.deserializeMessageBuffers(item)); + } + + // Process objects recursively + if (typeof obj === 'object') { + const converted: any = {}; + for (const key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + converted[key] = this.deserializeMessageBuffers(obj[key]); + } + } + return converted; + } + + return obj; + } + private prepareMessage(message: proto.IWebMessageInfo): any { const contentType = getContentType(message.message); const contentMsg = message?.message[contentType] as any; const messageRaw = { - key: message.key, + key: message.key, // Save key exactly as it comes from Baileys pushName: message.pushName || (message.key.fromMe ? 'Você' : message?.participant || (message.key?.participant ? message.key.participant.split('@')[0] : null)), status: status[message.status], - message: { ...message.message }, - contextInfo: contentMsg?.contextInfo, + message: this.deserializeMessageBuffers({ ...message.message }), + contextInfo: this.deserializeMessageBuffers(contentMsg?.contextInfo), messageType: contentType || 'unknown', - messageTimestamp: message.messageTimestamp as number, + messageTimestamp: Long.isLong(message.messageTimestamp) + ? message.messageTimestamp.toNumber() + : (message.messageTimestamp as number), instanceId: this.instanceId, source: getDevice(message.key.id), }; @@ -4357,7 +4709,22 @@ export class BaileysStartupService extends ChannelStartupService { const prepare = (message: any) => this.prepareMessage(message); this.chatwootService.syncLostMessages({ instanceName: this.instance.name }, chatwootConfig, prepare); + // Generate ID for this cron task and store in cache + const cronId = cuid(); + const cronKey = `chatwoot:syncLostMessages`; + await this.chatwootService.getCache()?.hSet(cronKey, this.instance.name, cronId); + const task = cron.schedule('0,30 * * * *', async () => { + // Check ID before executing (only if cache is available) + const cache = this.chatwootService.getCache(); + if (cache) { + const storedId = await cache.hGet(cronKey, this.instance.name); + if (storedId && storedId !== cronId) { + this.logger.info(`Stopping syncChatwootLostMessages cron - ID mismatch: ${cronId} vs ${storedId}`); + task.stop(); + return; + } + } this.chatwootService.syncLostMessages({ instanceName: this.instance.name }, chatwootConfig, prepare); }); task.start(); @@ -4367,24 +4734,23 @@ export class BaileysStartupService extends ChannelStartupService { private async updateMessagesReadedByTimestamp(remoteJid: string, timestamp?: number): Promise { if (timestamp === undefined || timestamp === null) return 0; - const result = await this.prismaRepository.message.updateMany({ - where: { - AND: [ - { key: { path: ['remoteJid'], equals: remoteJid } }, - { key: { path: ['fromMe'], equals: false } }, - { messageTimestamp: { lte: timestamp } }, - { OR: [{ status: null }, { status: status[3] }] }, - ], - }, - data: { status: status[4] }, - }); + // Use raw SQL to avoid JSON path issues + const result = await this.prismaRepository.$executeRaw` + UPDATE "Message" + SET "status" = ${status[4]} + WHERE "instanceId" = ${this.instanceId} + AND "key"->>'remoteJid' = ${remoteJid} + AND ("key"->>'fromMe')::boolean = false + AND "messageTimestamp" <= ${timestamp} + AND ("status" IS NULL OR "status" = ${status[3]}) + `; if (result) { - if (result.count > 0) { + if (result > 0) { this.updateChatUnreadMessages(remoteJid); } - return result.count; + return result; } return 0; @@ -4393,15 +4759,14 @@ export class BaileysStartupService extends ChannelStartupService { private async updateChatUnreadMessages(remoteJid: string): Promise { const [chat, unreadMessages] = await Promise.all([ this.prismaRepository.chat.findFirst({ where: { remoteJid } }), - this.prismaRepository.message.count({ - where: { - AND: [ - { key: { path: ['remoteJid'], equals: remoteJid } }, - { key: { path: ['fromMe'], equals: false } }, - { status: { equals: status[3] } }, - ], - }, - }), + // Use raw SQL to avoid JSON path issues + this.prismaRepository.$queryRaw` + SELECT COUNT(*)::int as count FROM "Message" + WHERE "instanceId" = ${this.instanceId} + AND "key"->>'remoteJid' = ${remoteJid} + AND ("key"->>'fromMe')::boolean = false + AND "status" = ${status[3]} + `.then((result: any[]) => result[0]?.count || 0), ]); if (chat && chat.unreadMessages !== unreadMessages) { @@ -4471,8 +4836,8 @@ export class BaileysStartupService extends ChannelStartupService { return response; } - public async baileysAssertSessions(jids: string[], force: boolean) { - const response = await this.client.assertSessions(jids, force); + public async baileysAssertSessions(jids: string[]) { + const response = await this.client.assertSessions(jids); return response; } @@ -4627,7 +4992,7 @@ export class BaileysStartupService extends ChannelStartupService { collectionsLength: collections?.length, collections: collections, }; - } catch (error) { + } catch { return { wuid: jid, name: null, isBusiness: false }; } } @@ -4649,12 +5014,7 @@ export class BaileysStartupService extends ChannelStartupService { } public async fetchMessages(query: Query) { - const keyFilters = query?.where?.key as { - id?: string; - fromMe?: boolean; - remoteJid?: string; - participants?: string; - }; + const keyFilters = query?.where?.key as ExtendedIMessageKey; const timestampFilter = {}; if (query?.where?.messageTimestamp) { @@ -4676,8 +5036,13 @@ export class BaileysStartupService extends ChannelStartupService { AND: [ keyFilters?.id ? { key: { path: ['id'], equals: keyFilters?.id } } : {}, keyFilters?.fromMe ? { key: { path: ['fromMe'], equals: keyFilters?.fromMe } } : {}, - keyFilters?.remoteJid ? { key: { path: ['remoteJid'], equals: keyFilters?.remoteJid } } : {}, - keyFilters?.participants ? { key: { path: ['participants'], equals: keyFilters?.participants } } : {}, + keyFilters?.participant ? { key: { path: ['participant'], equals: keyFilters?.participant } } : {}, + { + OR: [ + keyFilters?.remoteJid ? { key: { path: ['remoteJid'], equals: keyFilters?.remoteJid } } : {}, + keyFilters?.remoteJidAlt ? { key: { path: ['remoteJidAlt'], equals: keyFilters?.remoteJidAlt } } : {}, + ], + }, ], }, }); @@ -4700,8 +5065,13 @@ export class BaileysStartupService extends ChannelStartupService { AND: [ keyFilters?.id ? { key: { path: ['id'], equals: keyFilters?.id } } : {}, keyFilters?.fromMe ? { key: { path: ['fromMe'], equals: keyFilters?.fromMe } } : {}, - keyFilters?.remoteJid ? { key: { path: ['remoteJid'], equals: keyFilters?.remoteJid } } : {}, - keyFilters?.participants ? { key: { path: ['participants'], equals: keyFilters?.participants } } : {}, + keyFilters?.participant ? { key: { path: ['participant'], equals: keyFilters?.participant } } : {}, + { + OR: [ + keyFilters?.remoteJid ? { key: { path: ['remoteJid'], equals: keyFilters?.remoteJid } } : {}, + keyFilters?.remoteJidAlt ? { key: { path: ['remoteJidAlt'], equals: keyFilters?.remoteJidAlt } } : {}, + ], + }, ], }, orderBy: { messageTimestamp: 'desc' }, diff --git a/src/api/integrations/chatbot/base-chatbot.controller.ts b/src/api/integrations/chatbot/base-chatbot.controller.ts index 3a472cd8b..a5b83e257 100644 --- a/src/api/integrations/chatbot/base-chatbot.controller.ts +++ b/src/api/integrations/chatbot/base-chatbot.controller.ts @@ -2,6 +2,7 @@ import { IgnoreJidDto } from '@api/dto/chatbot.dto'; import { InstanceDto } from '@api/dto/instance.dto'; import { PrismaRepository } from '@api/repository/repository.service'; import { WAMonitoringService } from '@api/services/monitor.service'; +import { Events } from '@api/types/wa.types'; import { Logger } from '@config/logger.config'; import { BadRequestException } from '@exceptions'; import { TriggerOperator, TriggerType } from '@prisma/client'; @@ -446,6 +447,16 @@ export abstract class BaseChatbotController { try { JSON.parse(str); return true; - } catch (e) { + } catch { return false; } } @@ -180,6 +180,7 @@ export abstract class BaseChatbotService { remoteJid: string, message: string, settings: SettingsType, + linkPreview: boolean = true, ): Promise { if (!message) return; @@ -202,7 +203,7 @@ export abstract class BaseChatbotService { if (mediaType) { // Send accumulated text before sending media if (textBuffer.trim()) { - await this.sendFormattedText(instance, remoteJid, textBuffer.trim(), settings, splitMessages); + await this.sendFormattedText(instance, remoteJid, textBuffer.trim(), settings, splitMessages, linkPreview); textBuffer = ''; } @@ -210,7 +211,7 @@ export abstract class BaseChatbotService { try { if (mediaType === 'audio') { await instance.audioWhatsapp({ - number: remoteJid.split('@')[0], + number: remoteJid.includes('@lid') ? remoteJid : remoteJid.split('@')[0], delay: (settings as any)?.delayMessage || 1000, audio: url, caption: altText, @@ -218,7 +219,7 @@ export abstract class BaseChatbotService { } else { await instance.mediaMessage( { - number: remoteJid.split('@')[0], + number: remoteJid.includes('@lid') ? remoteJid : remoteJid.split('@')[0], delay: (settings as any)?.delayMessage || 1000, mediatype: mediaType, media: url, @@ -252,80 +253,86 @@ export abstract class BaseChatbotService { // Send any remaining text if (textBuffer.trim()) { - await this.sendFormattedText(instance, remoteJid, textBuffer.trim(), settings, splitMessages); + await this.sendFormattedText(instance, remoteJid, textBuffer.trim(), settings, splitMessages, linkPreview); } } /** - * Helper method to send formatted text with proper typing indicators and delays + * Split message by double line breaks and return array of message parts */ - private async sendFormattedText( + private splitMessageByDoubleLineBreaks(message: string): string[] { + return message.split('\n\n').filter((part) => part.trim().length > 0); + } + + /** + * Send a single message with proper typing indicators and delays + */ + private async sendSingleMessage( instance: any, remoteJid: string, - text: string, + message: string, settings: any, - splitMessages: boolean, + linkPreview: boolean = true, ): Promise { const timePerChar = settings?.timePerChar ?? 0; const minDelay = 1000; const maxDelay = 20000; + const delay = Math.min(Math.max(message.length * timePerChar, minDelay), maxDelay); - if (splitMessages) { - const multipleMessages = text.split('\n\n'); - for (let index = 0; index < multipleMessages.length; index++) { - const message = multipleMessages[index]; - if (!message.trim()) continue; + this.logger.debug(`[BaseChatbot] Sending single message with linkPreview: ${linkPreview}`); - const delay = Math.min(Math.max(message.length * timePerChar, minDelay), maxDelay); + if (instance.integration === Integration.WHATSAPP_BAILEYS) { + await instance.client.presenceSubscribe(remoteJid); + await instance.client.sendPresenceUpdate('composing', remoteJid); + } - if (instance.integration === Integration.WHATSAPP_BAILEYS) { - await instance.client.presenceSubscribe(remoteJid); - await instance.client.sendPresenceUpdate('composing', remoteJid); - } + await new Promise((resolve) => { + setTimeout(async () => { + await instance.textMessage( + { + number: remoteJid.includes('@lid') ? remoteJid : remoteJid.split('@')[0], + delay: settings?.delayMessage || 1000, + text: message, + linkPreview, + }, + false, + ); + resolve(); + }, delay); + }); - await new Promise((resolve) => { - setTimeout(async () => { - await instance.textMessage( - { - number: remoteJid.split('@')[0], - delay: settings?.delayMessage || 1000, - text: message, - }, - false, - ); - resolve(); - }, delay); - }); + if (instance.integration === Integration.WHATSAPP_BAILEYS) { + await instance.client.sendPresenceUpdate('paused', remoteJid); + } + } - if (instance.integration === Integration.WHATSAPP_BAILEYS) { - await instance.client.sendPresenceUpdate('paused', remoteJid); - } - } - } else { - const delay = Math.min(Math.max(text.length * timePerChar, minDelay), maxDelay); + /** + * Helper method to send formatted text with proper typing indicators and delays + */ + private async sendFormattedText( + instance: any, + remoteJid: string, + text: string, + settings: any, + splitMessages: boolean, + linkPreview: boolean = true, + ): Promise { + if (splitMessages) { + const messageParts = this.splitMessageByDoubleLineBreaks(text); - if (instance.integration === Integration.WHATSAPP_BAILEYS) { - await instance.client.presenceSubscribe(remoteJid); - await instance.client.sendPresenceUpdate('composing', remoteJid); - } + this.logger.debug(`[BaseChatbot] Splitting message into ${messageParts.length} parts`); - await new Promise((resolve) => { - setTimeout(async () => { - await instance.textMessage( - { - number: remoteJid.split('@')[0], - delay: settings?.delayMessage || 1000, - text: text, - }, - false, - ); - resolve(); - }, delay); - }); + for (let index = 0; index < messageParts.length; index++) { + const message = messageParts[index]; - if (instance.integration === Integration.WHATSAPP_BAILEYS) { - await instance.client.sendPresenceUpdate('paused', remoteJid); + this.logger.debug(`[BaseChatbot] Sending message part ${index + 1}/${messageParts.length}`); + await this.sendSingleMessage(instance, remoteJid, message, settings, linkPreview); } + + this.logger.debug(`[BaseChatbot] All message parts sent successfully`); + } else { + this.logger.debug(`[BaseChatbot] Sending single message`); + await this.sendSingleMessage(instance, remoteJid, text, settings, linkPreview); } } diff --git a/src/api/integrations/chatbot/chatbot.controller.ts b/src/api/integrations/chatbot/chatbot.controller.ts index a2312f6e0..74f1427a9 100644 --- a/src/api/integrations/chatbot/chatbot.controller.ts +++ b/src/api/integrations/chatbot/chatbot.controller.ts @@ -91,19 +91,19 @@ export class ChatbotController { pushName, isIntegration, }; - await evolutionBotController.emit(emitData); + evolutionBotController.emit(emitData); - await typebotController.emit(emitData); + typebotController.emit(emitData); - await openaiController.emit(emitData); + openaiController.emit(emitData); - await difyController.emit(emitData); + difyController.emit(emitData); - await n8nController.emit(emitData); + n8nController.emit(emitData); - await evoaiController.emit(emitData); + evoaiController.emit(emitData); - await flowiseController.emit(emitData); + flowiseController.emit(emitData); } public processDebounce( diff --git a/src/api/integrations/chatbot/chatwoot/controllers/chatwoot.controller.ts b/src/api/integrations/chatbot/chatwoot/controllers/chatwoot.controller.ts index 17cdce01d..a55c134a4 100644 --- a/src/api/integrations/chatbot/chatwoot/controllers/chatwoot.controller.ts +++ b/src/api/integrations/chatbot/chatwoot/controllers/chatwoot.controller.ts @@ -1,10 +1,6 @@ import { InstanceDto } from '@api/dto/instance.dto'; import { ChatwootDto } from '@api/integrations/chatbot/chatwoot/dto/chatwoot.dto'; import { ChatwootService } from '@api/integrations/chatbot/chatwoot/services/chatwoot.service'; -import { PrismaRepository } from '@api/repository/repository.service'; -import { waMonitor } from '@api/server.module'; -import { CacheService } from '@api/services/cache.service'; -import { CacheEngine } from '@cache/cacheengine'; import { Chatwoot, ConfigService, HttpServer } from '@config/env.config'; import { BadRequestException } from '@exceptions'; import { isURL } from 'class-validator'; @@ -13,7 +9,6 @@ export class ChatwootController { constructor( private readonly chatwootService: ChatwootService, private readonly configService: ConfigService, - private readonly prismaRepository: PrismaRepository, ) {} public async createChatwoot(instance: InstanceDto, data: ChatwootDto) { @@ -84,9 +79,6 @@ export class ChatwootController { public async receiveWebhook(instance: InstanceDto, data: any) { if (!this.configService.get('CHATWOOT').ENABLED) throw new BadRequestException('Chatwoot is disabled'); - const chatwootCache = new CacheService(new CacheEngine(this.configService, ChatwootService.name).getEngine()); - const chatwootService = new ChatwootService(waMonitor, this.configService, this.prismaRepository, chatwootCache); - - return chatwootService.receiveWebhook(instance, data); + return this.chatwootService.receiveWebhook(instance, data); } } diff --git a/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts b/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts index badaba136..906fff188 100644 --- a/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts +++ b/src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts @@ -23,10 +23,11 @@ import { Chatwoot as ChatwootModel, Contact as ContactModel, Message as MessageM import i18next from '@utils/i18n'; import { sendTelemetry } from '@utils/sendTelemetry'; import axios from 'axios'; -import { proto } from 'baileys'; +import { WAMessageContent, WAMessageKey } from 'baileys'; import dayjs from 'dayjs'; import FormData from 'form-data'; import { Jimp, JimpMime } from 'jimp'; +import { parsePhoneNumberFromString } from 'libphonenumber-js'; import Long from 'long'; import mimeTypes from 'mime-types'; import path from 'path'; @@ -43,6 +44,9 @@ interface ChatwootMessage { export class ChatwootService { private readonly logger = new Logger('ChatwootService'); + // Lock polling delay + private readonly LOCK_POLLING_DELAY_MS = 300; // Delay between lock status checks + private provider: any; constructor( @@ -129,7 +133,7 @@ export class ChatwootService { public async find(instance: InstanceDto): Promise { try { return await this.waMonitor.waInstances[instance.instanceName].findChatwoot(); - } catch (error) { + } catch { this.logger.error('chatwoot not found'); return { enabled: null, url: '' }; } @@ -342,6 +346,16 @@ export class ChatwootService { return contact; } catch (error) { + if ((error.status === 422 || error.response?.status === 422) && jid) { + this.logger.warn(`Contact with identifier ${jid} creation failed (422). Checking if it already exists...`); + const existingContact = await this.findContactByIdentifier(instance, jid); + if (existingContact) { + const contactId = existingContact.id; + await this.addLabelToContact(this.provider.nameInbox, contactId); + return existingContact; + } + } + this.logger.error('Error creating contact'); console.log(error); return null; @@ -369,7 +383,7 @@ export class ChatwootService { }); return contact; - } catch (error) { + } catch { return null; } } @@ -406,11 +420,60 @@ export class ChatwootService { } return true; - } catch (error) { + } catch { return false; } } + public async findContactByIdentifier(instance: InstanceDto, identifier: string) { + const client = await this.clientCw(instance); + + if (!client) { + this.logger.warn('client not found'); + return null; + } + + // Direct search by query (q) - most common way to search by identifier/email/phone + const contact = (await (client as any).get('contacts/search', { + params: { + q: identifier, + sort: 'name', + }, + })) as any; + + if (contact && contact.data && contact.data.payload && contact.data.payload.length > 0) { + return contact.data.payload[0]; + } + + // Fallback for older API versions or different response structures + if (contact && contact.payload && contact.payload.length > 0) { + return contact.payload[0]; + } + + // Try search by attribute + const contactByAttr = (await (client as any).post('contacts/filter', { + payload: [ + { + attribute_key: 'identifier', + filter_operator: 'equal_to', + values: [identifier], + query_operator: null, + }, + ], + })) as any; + + if (contactByAttr && contactByAttr.payload && contactByAttr.payload.length > 0) { + return contactByAttr.payload[0]; + } + + // Check inside data property if using axios interceptors wrapper + if (contactByAttr && contactByAttr.data && contactByAttr.data.payload && contactByAttr.data.payload.length > 0) { + return contactByAttr.data.payload[0]; + } + + return null; + } + public async findContact(instance: InstanceDto, phoneNumber: string) { const client = await this.clientCw(instance); @@ -567,34 +630,31 @@ export class ChatwootService { } public async createConversation(instance: InstanceDto, body: any) { - if (!body?.key) { - this.logger.warn( - `body.key is null or undefined in createConversation. Full body object: ${JSON.stringify(body)}`, - ); - return null; - } - - const isLid = body.key.previousRemoteJid?.includes('@lid') && body.key.senderPn; - const remoteJid = body.key.remoteJid; + const isLid = body.key.addressingMode === 'lid'; + const isGroup = body.key.remoteJid.endsWith('@g.us'); + const phoneNumber = isLid && !isGroup ? body.key.remoteJidAlt : body.key.remoteJid; + const { remoteJid } = body.key; const cacheKey = `${instance.instanceName}:createConversation-${remoteJid}`; const lockKey = `${instance.instanceName}:lock:createConversation-${remoteJid}`; - const maxWaitTime = 5000; // 5 secounds + const maxWaitTime = 5000; // 5 seconds + const client = await this.clientCw(instance); + if (!client) return null; try { // Processa atualização de contatos já criados @lid - if (isLid && body.key.senderPn !== body.key.previousRemoteJid) { - const contact = await this.findContact(instance, body.key.remoteJid.split('@')[0]); - if (contact && contact.identifier !== body.key.senderPn) { + if (phoneNumber && remoteJid && !isGroup) { + const contact = await this.findContact(instance, phoneNumber.split('@')[0]); + if (contact && contact.identifier !== remoteJid) { this.logger.verbose( - `Identifier needs update: (contact.identifier: ${contact.identifier}, body.key.remoteJid: ${body.key.remoteJid}, body.key.senderPn: ${body.key.senderPn}`, + `Identifier needs update: (contact.identifier: ${contact.identifier}, phoneNumber: ${phoneNumber}, body.key.remoteJidAlt: ${remoteJid}`, ); const updateContact = await this.updateContact(instance, contact.id, { - identifier: body.key.senderPn, - phone_number: `+${body.key.senderPn.split('@')[0]}`, + identifier: phoneNumber, + phone_number: `+${phoneNumber.split('@')[0]}`, }); if (updateContact === null) { - const baseContact = await this.findContact(instance, body.key.senderPn.split('@')[0]); + const baseContact = await this.findContact(instance, phoneNumber.split('@')[0]); if (baseContact) { await this.mergeContacts(baseContact.id, contact.id); this.logger.verbose( @@ -610,7 +670,25 @@ export class ChatwootService { // If it already exists in the cache, return conversationId if (await this.cache.has(cacheKey)) { const conversationId = (await this.cache.get(cacheKey)) as number; - this.logger.verbose(`Found conversation to: ${remoteJid}, conversation ID: ${conversationId}`); + this.logger.verbose(`Found conversation to: ${phoneNumber}, conversation ID: ${conversationId}`); + let conversationExists: any; + try { + conversationExists = await client.conversations.get({ + accountId: this.provider.accountId, + conversationId: conversationId, + }); + this.logger.verbose( + `Conversation exists: ID: ${conversationExists.id} - Name: ${conversationExists.meta.sender.name} - Identifier: ${conversationExists.meta.sender.identifier}`, + ); + } catch (error) { + this.logger.error(`Error getting conversation: ${error}`); + conversationExists = false; + } + if (!conversationExists) { + this.logger.verbose('Conversation does not exist, re-calling createConversation'); + this.cache.delete(cacheKey); + return await this.createConversation(instance, body); + } return conversationId; } @@ -623,7 +701,7 @@ export class ChatwootService { this.logger.warn(`Timeout aguardando lock para ${remoteJid}`); break; } - await new Promise((res) => setTimeout(res, 300)); + await new Promise((res) => setTimeout(res, this.LOCK_POLLING_DELAY_MS)); if (await this.cache.has(cacheKey)) { const conversationId = (await this.cache.get(cacheKey)) as number; this.logger.verbose(`Resolves creation of: ${remoteJid}, conversation ID: ${conversationId}`); @@ -645,11 +723,7 @@ export class ChatwootService { return (await this.cache.get(cacheKey)) as number; } - const client = await this.clientCw(instance); - if (!client) return null; - - const isGroup = remoteJid.includes('@g.us'); - const chatId = isGroup ? remoteJid : remoteJid.split('@')[0]; + const chatId = isGroup ? remoteJid : phoneNumber.split('@')[0].split(':')[0]; let nameContact = !body.key.fromMe ? body.pushName : chatId; const filterInbox = await this.getInbox(instance); if (!filterInbox) return null; @@ -657,19 +731,22 @@ export class ChatwootService { if (isGroup) { this.logger.verbose(`Processing group conversation`); const group = await this.waMonitor.waInstances[instance.instanceName].client.groupMetadata(chatId); - this.logger.verbose(`Group metadata: ${JSON.stringify(group)}`); + this.logger.verbose(`Group metadata: JID:${group.JID} - Subject:${group?.subject || group?.Name}`); + const participantJid = isLid && !body.key.fromMe ? body.key.participantAlt : body.key.participant; nameContact = `${group.subject} (GROUP)`; const picture_url = await this.waMonitor.waInstances[instance.instanceName].profilePicture( - body.key.participant.split('@')[0], + participantJid.split('@')[0], ); this.logger.verbose(`Participant profile picture URL: ${JSON.stringify(picture_url)}`); - const findParticipant = await this.findContact(instance, body.key.participant.split('@')[0]); - this.logger.verbose(`Found participant: ${JSON.stringify(findParticipant)}`); + const findParticipant = await this.findContact(instance, participantJid.split('@')[0]); if (findParticipant) { + this.logger.verbose( + `Found participant: ID:${findParticipant.id} - Name: ${findParticipant.name} - identifier: ${findParticipant.identifier}`, + ); if (!findParticipant.name || findParticipant.name === chatId) { await this.updateContact(instance, findParticipant.id, { name: body.pushName, @@ -679,12 +756,12 @@ export class ChatwootService { } else { await this.createContact( instance, - body.key.participant.split('@')[0], + participantJid.split('@')[0].split(':')[0], filterInbox.id, false, body.pushName, picture_url.profilePictureUrl || null, - body.key.participant, + participantJid, ); } } @@ -692,23 +769,17 @@ export class ChatwootService { const picture_url = await this.waMonitor.waInstances[instance.instanceName].profilePicture(chatId); this.logger.verbose(`Contact profile picture URL: ${JSON.stringify(picture_url)}`); + this.logger.verbose(`Searching contact for: ${chatId}`); let contact = await this.findContact(instance, chatId); if (contact) { - this.logger.verbose(`Found contact: ${JSON.stringify(contact)}`); + this.logger.verbose(`Found contact: ID:${contact.id} - Name:${contact.name}`); if (!body.key.fromMe) { const waProfilePictureFile = picture_url?.profilePictureUrl?.split('#')[0].split('?')[0].split('/').pop() || ''; const chatwootProfilePictureFile = contact?.thumbnail?.split('#')[0].split('?')[0].split('/').pop() || ''; const pictureNeedsUpdate = waProfilePictureFile !== chatwootProfilePictureFile; - const nameNeedsUpdate = - !contact.name || - contact.name === chatId || - (`+${chatId}`.startsWith('+55') - ? this.getNumbers(`+${chatId}`).some( - (v) => contact.name === v || contact.name === v.substring(3) || contact.name === v.substring(1), - ) - : false); + const nameNeedsUpdate = !contact.name || contact.name === chatId; this.logger.verbose(`Picture needs update: ${pictureNeedsUpdate}`); this.logger.verbose(`Name needs update: ${nameNeedsUpdate}`); if (pictureNeedsUpdate || nameNeedsUpdate) { @@ -727,7 +798,7 @@ export class ChatwootService { isGroup, nameContact, picture_url.profilePictureUrl || null, - remoteJid, + phoneNumber, ); } @@ -743,7 +814,6 @@ export class ChatwootService { accountId: this.provider.accountId, id: contactId, })) as any; - this.logger.verbose(`Contact conversations: ${JSON.stringify(contactConversations)}`); if (!contactConversations || !contactConversations.payload) { this.logger.error(`No conversations found or payload is undefined`); @@ -755,7 +825,9 @@ export class ChatwootService { ); if (inboxConversation) { if (this.provider.reopenConversation) { - this.logger.verbose(`Found conversation in reopenConversation mode: ${JSON.stringify(inboxConversation)}`); + this.logger.verbose( + `Found conversation in reopenConversation mode: ID: ${inboxConversation.id} - Name: ${inboxConversation.meta.sender.name} - Identifier: ${inboxConversation.meta.sender.identifier}`, + ); if (inboxConversation && this.provider.conversationPending && inboxConversation.status !== 'open') { await client.conversations.toggleStatus({ accountId: this.provider.accountId, @@ -775,7 +847,7 @@ export class ChatwootService { if (inboxConversation) { this.logger.verbose(`Returning existing conversation ID: ${inboxConversation.id}`); - this.cache.set(cacheKey, inboxConversation.id); + this.cache.set(cacheKey, inboxConversation.id, 1800); return inboxConversation.id; } } @@ -789,14 +861,6 @@ export class ChatwootService { data['status'] = 'pending'; } - /* - Triple check after lock - Utilizei uma nova verificação para evitar que outra thread execute entre o terminio do while e o set lock - */ - if (await this.cache.has(cacheKey)) { - return (await this.cache.get(cacheKey)) as number; - } - const conversation = await client.conversations.create({ accountId: this.provider.accountId, data, @@ -808,7 +872,7 @@ export class ChatwootService { } this.logger.verbose(`New conversation created of ${remoteJid} with ID: ${conversation.id}`); - this.cache.set(cacheKey, conversation.id); + this.cache.set(cacheKey, conversation.id, 1800); return conversation.id; } finally { await this.cache.delete(lockKey); @@ -1164,7 +1228,7 @@ export class ChatwootService { const data: SendAudioDto = { number: number, audio: media, - delay: 1200, + delay: Math.floor(Math.random() * (2000 - 500 + 1)) + 500, quoted: options?.quoted, }; @@ -1175,7 +1239,7 @@ export class ChatwootService { return messageSent; } - const documentExtensions = ['.gif', '.svg', '.tiff', '.tif']; + const documentExtensions = ['.gif', '.svg', '.tiff', '.tif', '.dxf', '.dwg']; if (type === 'image' && parsedMedia && documentExtensions.includes(parsedMedia?.ext)) { type = 'document'; } @@ -1200,6 +1264,7 @@ export class ChatwootService { return messageSent; } catch (error) { this.logger.error(error); + throw error; // Re-throw para que o erro seja tratado pelo caller } } @@ -1281,6 +1346,7 @@ export class ChatwootService { const senderName = body?.conversation?.messages[0]?.sender?.available_name || body?.sender?.name; const waInstance = this.waMonitor.waInstances[instance.instanceName]; + instance.instanceId = waInstance.instanceId; if (body.event === 'message_updated' && body.content_attributes?.deleted) { const message = await this.prismaRepository.message.findFirst({ @@ -1291,12 +1357,7 @@ export class ChatwootService { }); if (message) { - const key = message.key as { - id: string; - remoteJid: string; - fromMe: boolean; - participant: string; - }; + const key = message.key as WAMessageKey; await waInstance?.client.sendMessage(key.remoteJid, { delete: key }); @@ -1428,7 +1489,6 @@ export class ChatwootService { await this.updateChatwootMessageId( { ...messageSent, - owner: instance.instanceName, }, { messageId: body.id, @@ -1443,7 +1503,7 @@ export class ChatwootService { const data: SendTextDto = { number: chatId, text: formatText, - delay: 1200, + delay: Math.floor(Math.random() * (2000 - 500 + 1)) + 500, quoted: await this.getQuotedMessage(body, instance), }; @@ -1463,7 +1523,6 @@ export class ChatwootService { await this.updateChatwootMessageId( { ...messageSent, - instanceId: instance.instanceId, }, { messageId: body.id, @@ -1494,12 +1553,7 @@ export class ChatwootService { }, }); if (lastMessage && !lastMessage.chatwootIsRead) { - const key = lastMessage.key as { - id: string; - fromMe: boolean; - remoteJid: string; - participant?: string; - }; + const key = lastMessage.key as WAMessageKey; waInstance?.markMessageAsRead({ readMessages: [ @@ -1536,7 +1590,7 @@ export class ChatwootService { const data: SendTextDto = { number: chatId, text: body.content.replace(/\\\r\n|\\\n|\n/g, '\n'), - delay: 1200, + delay: Math.floor(Math.random() * (2000 - 500 + 1)) + 500, }; sendTelemetry('/message/sendText'); @@ -1557,51 +1611,46 @@ export class ChatwootService { chatwootMessageIds: ChatwootMessage, instance: InstanceDto, ) { - const key = message.key as { - id: string; - fromMe: boolean; - remoteJid: string; - participant?: string; - }; + const key = message.key as WAMessageKey; if (!chatwootMessageIds.messageId || !key?.id) { return; } - await this.prismaRepository.message.updateMany({ - where: { - key: { - path: ['id'], - equals: key.id, - }, - instanceId: instance.instanceId, - }, - data: { - chatwootMessageId: chatwootMessageIds.messageId, - chatwootConversationId: chatwootMessageIds.conversationId, - chatwootInboxId: chatwootMessageIds.inboxId, - chatwootContactInboxSourceId: chatwootMessageIds.contactInboxSourceId, - chatwootIsRead: chatwootMessageIds.isRead, - }, - }); + // Use raw SQL to avoid JSON path issues + const result = await this.prismaRepository.$executeRaw` + UPDATE "Message" + SET + "chatwootMessageId" = ${chatwootMessageIds.messageId}, + "chatwootConversationId" = ${chatwootMessageIds.conversationId}, + "chatwootInboxId" = ${chatwootMessageIds.inboxId}, + "chatwootContactInboxSourceId" = ${chatwootMessageIds.contactInboxSourceId}, + "chatwootIsRead" = ${chatwootMessageIds.isRead || false} + WHERE "instanceId" = ${instance.instanceId} + AND "key"->>'id' = ${key.id} + `; + + this.logger.verbose(`Update result: ${result} rows affected`); if (this.isImportHistoryAvailable()) { - chatwootImport.updateMessageSourceID(chatwootMessageIds.messageId, key.id); + try { + await chatwootImport.updateMessageSourceID(chatwootMessageIds.messageId, key.id); + } catch (error) { + this.logger.error(`Error updating Chatwoot message source ID: ${error}`); + } } } private async getMessageByKeyId(instance: InstanceDto, keyId: string): Promise { - const messages = await this.prismaRepository.message.findFirst({ - where: { - key: { - path: ['id'], - equals: keyId, - }, - instanceId: instance.instanceId, - }, - }); - - return messages || null; + // Use raw SQL query to avoid JSON path issues with Prisma + const messages = await this.prismaRepository.$queryRaw` + SELECT * FROM "Message" + WHERE "instanceId" = ${instance.instanceId} + AND "key"->>'id' = ${keyId} + LIMIT 1 + `; + + return (messages as MessageModel[])[0] || null; } private async getReplyToIds( @@ -1636,17 +1685,13 @@ export class ChatwootService { }, }); - const key = message?.key as { - id: string; - fromMe: boolean; - remoteJid: string; - participant?: string; - }; + const key = message?.key as WAMessageKey; + const messageContent = message?.message as WAMessageContent; - if (message && key?.id) { + if (messageContent && key?.id) { return { - key: message.key as proto.IMessageKey, - message: message.message as proto.IMessage, + key: key, + message: messageContent, }; } } @@ -1672,6 +1717,10 @@ export class ChatwootService { return result; } + private isInteractiveButtonMessage(messageType: string, message: any) { + return messageType === 'interactiveMessage' && message.interactiveMessage?.nativeFlowMessage?.buttons?.length > 0; + } + private getAdsMessage(msg: any) { interface AdsMessage { title: string; @@ -1900,12 +1949,6 @@ export class ChatwootService { public async eventWhatsapp(event: string, instance: InstanceDto, body: any) { try { - // Ignore events that are not messages (like EPHEMERAL_SYNC_RESPONSE) - if (body?.type && body.type !== 'message' && body.type !== 'conversation') { - this.logger.verbose(`Ignoring non-message event type: ${body.type}`); - return; - } - const waInstance = this.waMonitor.waInstances[instance.instanceName]; if (!waInstance) { @@ -1951,11 +1994,7 @@ export class ChatwootService { } if (event === 'messages.upsert' || event === 'send.message') { - if (!body?.key) { - this.logger.warn(`body.key is null or undefined. Full body object: ${JSON.stringify(body)}`); - return; - } - + this.logger.info(`[${event}] New message received - Instance: ${JSON.stringify(body, null, 2)}`); if (body.key.remoteJid === 'status@broadcast') { return; } @@ -2000,8 +2039,9 @@ export class ChatwootService { const adsMessage = this.getAdsMessage(body); const reactionMessage = this.getReactionMessage(body.message); + const isInteractiveButtonMessage = this.isInteractiveButtonMessage(body.messageType, body.message); - if (!bodyMessage && !isMedia && !reactionMessage) { + if (!bodyMessage && !isMedia && !reactionMessage && !isInteractiveButtonMessage) { this.logger.warn('no body message found'); return; } @@ -2046,23 +2086,20 @@ export class ChatwootService { if (body.key.remoteJid.includes('@g.us')) { const participantName = body.pushName; - const rawPhoneNumber = body.key.participant.split('@')[0]; - const phoneMatch = rawPhoneNumber.match(/^(\d{2})(\d{2})(\d{4})(\d{4})$/); - - let formattedPhoneNumber: string; - - if (phoneMatch) { - formattedPhoneNumber = `+${phoneMatch[1]} (${phoneMatch[2]}) ${phoneMatch[3]}-${phoneMatch[4]}`; - } else { - formattedPhoneNumber = `+${rawPhoneNumber}`; - } + const rawPhoneNumber = + body.key.addressingMode === 'lid' && !body.key.fromMe && body.key.participantAlt + ? body.key.participantAlt.split('@')[0].split(':')[0] + : body.key.participant.split('@')[0].split(':')[0]; + const formattedPhoneNumber = parsePhoneNumberFromString(`+${rawPhoneNumber}`).formatInternational(); let content: string; if (!body.key.fromMe) { - content = `**${formattedPhoneNumber} - ${participantName}:**\n\n${bodyMessage}`; + content = bodyMessage + ? `**${formattedPhoneNumber} - ${participantName}:**\n\n${bodyMessage}` + : `**${formattedPhoneNumber} - ${participantName}:**`; } else { - content = `${bodyMessage}`; + content = bodyMessage || ''; } const send = await this.sendData( @@ -2129,6 +2166,50 @@ export class ChatwootService { return; } + if (isInteractiveButtonMessage) { + const buttons = body.message.interactiveMessage.nativeFlowMessage.buttons; + this.logger.info('is Interactive Button Message: ' + JSON.stringify(buttons)); + + for (const button of buttons) { + const buttonParams = JSON.parse(button.buttonParamsJson); + const paymentSettings = buttonParams.payment_settings; + + if (button.name === 'payment_info' && paymentSettings[0].type === 'pix_static_code') { + const pixSettings = paymentSettings[0].pix_static_code; + const pixKeyType = (() => { + switch (pixSettings.key_type) { + case 'EVP': + return 'Chave Aleatória'; + case 'EMAIL': + return 'E-mail'; + case 'PHONE': + return 'Telefone'; + default: + return pixSettings.key_type; + } + })(); + const pixKey = pixSettings.key_type === 'PHONE' ? pixSettings.key.replace('+55', '') : pixSettings.key; + const content = `*${pixSettings.merchant_name}*\nChave PIX: ${pixKey} (${pixKeyType})`; + + const send = await this.createMessage( + instance, + getConversation, + content, + messageType, + false, + [], + body, + 'WAID:' + body.key.id, + quotedMsg, + ); + if (!send) this.logger.warn('message not sent'); + } else { + this.logger.warn('Interactive Button Message not mapped'); + } + } + return; + } + const isAdsMessage = (adsMessage && adsMessage.title) || adsMessage.body || adsMessage.thumbnailUrl; if (isAdsMessage) { const imgBuffer = await axios.get(adsMessage.thumbnailUrl, { responseType: 'arraybuffer' }); @@ -2187,16 +2268,11 @@ export class ChatwootService { if (body.key.remoteJid.includes('@g.us')) { const participantName = body.pushName; - const rawPhoneNumber = body.key.participant.split('@')[0]; - const phoneMatch = rawPhoneNumber.match(/^(\d{2})(\d{2})(\d{4})(\d{4})$/); - - let formattedPhoneNumber: string; - - if (phoneMatch) { - formattedPhoneNumber = `+${phoneMatch[1]} (${phoneMatch[2]}) ${phoneMatch[3]}-${phoneMatch[4]}`; - } else { - formattedPhoneNumber = `+${rawPhoneNumber}`; - } + const rawPhoneNumber = + body.key.addressingMode === 'lid' && !body.key.fromMe && body.key.participantAlt + ? body.key.participantAlt.split('@')[0].split(':')[0] + : body.key.participant.split('@')[0].split(':')[0]; + const formattedPhoneNumber = parsePhoneNumberFromString(`+${rawPhoneNumber}`).formatInternational(); let content: string; @@ -2278,33 +2354,36 @@ export class ChatwootService { } if (event === 'messages.edit' || event === 'send.message.update') { - // Ignore events that are not messages (like EPHEMERAL_SYNC_RESPONSE) - if (body?.type && body.type !== 'message') { - this.logger.verbose(`Ignoring non-message event type: ${body.type}`); + const editedMessageContentRaw = + body?.editedMessage?.conversation ?? + body?.editedMessage?.extendedTextMessage?.text ?? + body?.editedMessage?.imageMessage?.caption ?? + body?.editedMessage?.videoMessage?.caption ?? + body?.editedMessage?.documentMessage?.caption ?? + (typeof body?.text === 'string' ? body.text : undefined); + + const editedMessageContent = (editedMessageContentRaw ?? '').trim(); + + if (!editedMessageContent) { + this.logger.info('[CW.EDIT] Conteúdo vazio — ignorando (DELETE tratará se for revoke).'); return; } - if (!body?.key?.id) { - this.logger.warn( - `body.key.id is null or undefined in messages.edit. Full body object: ${JSON.stringify(body)}`, - ); + const message = await this.getMessageByKeyId(instance, body?.key?.id); + + if (!message) { + this.logger.warn('Message not found for edit event'); return; } - const editedText = `${ - body?.editedMessage?.conversation || body?.editedMessage?.extendedTextMessage?.text - }\n\n_\`${i18next.t('cw.message.edited')}.\`_`; - const message = await this.getMessageByKeyId(instance, body.key.id); - const key = message.key as { - id: string; - fromMe: boolean; - remoteJid: string; - participant?: string; - }; + const key = message.key as WAMessageKey; const messageType = key?.fromMe ? 'outgoing' : 'incoming'; - if (message && message.chatwootConversationId) { + if (message && message.chatwootConversationId && message.chatwootMessageId) { + // Criar nova mensagem com formato: "Mensagem editada:\n\nteste1" + const editedText = `\n\n\`${i18next.t('cw.message.edited')}:\`\n\n${editedMessageContent}`; + const send = await this.createMessage( instance, message.chatwootConversationId, @@ -2356,7 +2435,7 @@ export class ChatwootService { const url = `/public/api/v1/inboxes/${inbox.inbox_identifier}/contacts/${sourceId}` + `/conversations/${conversationId}/update_last_seen`; - chatwootRequest(this.getClientCwConfig(), { + await chatwootRequest(this.getClientCwConfig(), { method: 'POST', url: url, }); @@ -2382,15 +2461,30 @@ export class ChatwootService { await this.createBotMessage(instance, msgStatus, 'incoming'); } - if (event === 'connection.update') { - if (body.status === 'open') { - // if we have qrcode count then we understand that a new connection was established - if (this.waMonitor.waInstances[instance.instanceName].qrCode.count > 0) { - const msgConnection = i18next.t('cw.inbox.connected'); - await this.createBotMessage(instance, msgConnection, 'incoming'); - this.waMonitor.waInstances[instance.instanceName].qrCode.count = 0; - chatwootImport.clearAll(instance); - } + if (event === 'connection.update' && body.status === 'open') { + const waInstance = this.waMonitor.waInstances[instance.instanceName]; + if (!waInstance) return; + + const now = Date.now(); + const timeSinceLastNotification = now - (waInstance.lastConnectionNotification || 0); + + // Se a conexão foi estabelecida via QR code, notifica imediatamente. + if (waInstance.qrCode && waInstance.qrCode.count > 0) { + const msgConnection = i18next.t('cw.inbox.connected'); + await this.createBotMessage(instance, msgConnection, 'incoming'); + waInstance.qrCode.count = 0; + waInstance.lastConnectionNotification = now; + chatwootImport.clearAll(instance); + } + // Se não foi via QR code, verifica o throttling. + else if (timeSinceLastNotification >= 30000) { + const msgConnection = i18next.t('cw.inbox.connected'); + await this.createBotMessage(instance, msgConnection, 'incoming'); + waInstance.lastConnectionNotification = now; + } else { + this.logger.warn( + `Connection notification skipped for ${instance.instanceName} - too frequent (${timeSinceLastNotification}ms since last)`, + ); } } @@ -2433,7 +2527,13 @@ export class ChatwootService { } } - public getNumberFromRemoteJid(remoteJid: string) { + public normalizeJidIdentifier(remoteJid: string) { + if (!remoteJid) { + return ''; + } + if (remoteJid.includes('@lid')) { + return remoteJid; + } return remoteJid.replace(/:\d+/, '').split('@')[0]; } @@ -2578,7 +2678,7 @@ export class ChatwootService { const savedMessages = await this.prismaRepository.message.findMany({ where: { Instance: { name: instance.instanceName }, - messageTimestamp: { gte: dayjs().subtract(6, 'hours').unix() }, + messageTimestamp: { gte: Number(dayjs().subtract(6, 'hours').unix()) }, AND: ids.map((id) => ({ key: { path: ['id'], not: id } })), }, }); @@ -2607,7 +2707,7 @@ export class ChatwootService { await chatwootImport.importHistoryMessages(instance, this, inbox, this.provider); const waInstance = this.waMonitor.waInstances[instance.instanceName]; waInstance.clearCacheChatwoot(); - } catch (error) { + } catch { return; } } diff --git a/src/api/integrations/chatbot/chatwoot/utils/chatwoot-import-helper.ts b/src/api/integrations/chatbot/chatwoot/utils/chatwoot-import-helper.ts index aac7c95c6..7d55da416 100644 --- a/src/api/integrations/chatbot/chatwoot/utils/chatwoot-import-helper.ts +++ b/src/api/integrations/chatbot/chatwoot/utils/chatwoot-import-helper.ts @@ -112,12 +112,19 @@ class ChatwootImport { const bindInsert = [provider.accountId]; for (const contact of contactsChunk) { - bindInsert.push(contact.pushName); - const bindName = `$${bindInsert.length}`; + const isGroup = this.isIgnorePhoneNumber(contact.remoteJid); - bindInsert.push(`+${contact.remoteJid.split('@')[0]}`); - const bindPhoneNumber = `$${bindInsert.length}`; + const contactName = isGroup ? `${contact.pushName} (GROUP)` : contact.pushName; + bindInsert.push(contactName); + const bindName = `$${bindInsert.length}`; + let bindPhoneNumber: string; + if (!isGroup) { + bindInsert.push(`+${contact.remoteJid.split('@')[0]}`); + bindPhoneNumber = `$${bindInsert.length}`; + } else { + bindPhoneNumber = 'NULL'; + } bindInsert.push(contact.remoteJid); const bindIdentifier = `$${bindInsert.length}`; @@ -130,7 +137,7 @@ class ChatwootImport { DO UPDATE SET name = EXCLUDED.name, phone_number = EXCLUDED.phone_number, - identifier = EXCLUDED.identifier`; + updated_at = NOW()`; totalContactsImported += (await pgClient.query(sqlInsert, bindInsert))?.rowCount ?? 0; diff --git a/src/api/integrations/chatbot/dify/services/dify.service.ts b/src/api/integrations/chatbot/dify/services/dify.service.ts index 773efe498..a00594ec3 100644 --- a/src/api/integrations/chatbot/dify/services/dify.service.ts +++ b/src/api/integrations/chatbot/dify/services/dify.service.ts @@ -4,6 +4,7 @@ import { Integration } from '@api/types/wa.types'; import { ConfigService, HttpServer } from '@config/env.config'; import { Dify, DifySetting, IntegrationSession } from '@prisma/client'; import axios from 'axios'; +import { isURL } from 'class-validator'; import { BaseChatbotService } from '../../base-chatbot.service'; import { OpenaiService } from '../../openai/services/openai.service'; @@ -78,15 +79,35 @@ export class DifyService extends BaseChatbotService { // Handle image messages if (this.isImageMessage(content)) { - const contentSplit = content.split('|'); - payload.files = [ - { - type: 'image', - transfer_method: 'remote_url', - url: contentSplit[1].split('?')[0], - }, - ]; - payload.query = contentSplit[2] || content; + const media = content.split('|'); + + if (msg.message.mediaUrl || msg.message.base64) { + let mediaBase64 = msg.message.base64 || null; + + if (msg.message.mediaUrl && isURL(msg.message.mediaUrl)) { + const result = await axios.get(msg.message.mediaUrl, { responseType: 'arraybuffer' }); + mediaBase64 = Buffer.from(result.data).toString('base64'); + } + + if (mediaBase64) { + payload.files = [ + { + type: 'image', + transfer_method: 'remote_url', + url: mediaBase64, + }, + ]; + } + } else { + payload.files = [ + { + type: 'image', + transfer_method: 'remote_url', + url: media[1].split('?')[0], + }, + ]; + } + payload.query = media[2] || content; } if (instance.integration === Integration.WHATSAPP_BAILEYS) { @@ -107,7 +128,7 @@ export class DifyService extends BaseChatbotService { const conversationId = response?.data?.conversation_id; if (message) { - await this.sendMessageWhatsApp(instance, remoteJid, message, settings); + await this.sendMessageWhatsApp(instance, remoteJid, message, settings, true); } await this.prismaRepository.integrationSession.update({ @@ -140,15 +161,35 @@ export class DifyService extends BaseChatbotService { // Handle image messages if (this.isImageMessage(content)) { - const contentSplit = content.split('|'); - payload.files = [ - { - type: 'image', - transfer_method: 'remote_url', - url: contentSplit[1].split('?')[0], - }, - ]; - payload.inputs.query = contentSplit[2] || content; + const media = content.split('|'); + + if (msg.message.mediaUrl || msg.message.base64) { + let mediaBase64 = msg.message.base64 || null; + + if (msg.message.mediaUrl && isURL(msg.message.mediaUrl)) { + const result = await axios.get(msg.message.mediaUrl, { responseType: 'arraybuffer' }); + mediaBase64 = Buffer.from(result.data).toString('base64'); + } + + if (mediaBase64) { + payload.files = [ + { + type: 'image', + transfer_method: 'remote_url', + url: mediaBase64, + }, + ]; + } + } else { + payload.files = [ + { + type: 'image', + transfer_method: 'remote_url', + url: media[1].split('?')[0], + }, + ]; + payload.inputs.query = media[2] || content; + } } if (instance.integration === Integration.WHATSAPP_BAILEYS) { @@ -169,7 +210,7 @@ export class DifyService extends BaseChatbotService { const conversationId = response?.data?.conversation_id; if (message) { - await this.sendMessageWhatsApp(instance, remoteJid, message, settings); + await this.sendMessageWhatsApp(instance, remoteJid, message, settings, true); } await this.prismaRepository.integrationSession.update({ @@ -202,15 +243,26 @@ export class DifyService extends BaseChatbotService { // Handle image messages if (this.isImageMessage(content)) { - const contentSplit = content.split('|'); - payload.files = [ - { - type: 'image', - transfer_method: 'remote_url', - url: contentSplit[1].split('?')[0], - }, - ]; - payload.query = contentSplit[2] || content; + const media = content.split('|'); + + if (msg.message.mediaUrl || msg.message.base64) { + payload.files = [ + { + type: 'image', + transfer_method: 'remote_url', + url: msg.message.mediaUrl || msg.message.base64, + }, + ]; + } else { + payload.files = [ + { + type: 'image', + transfer_method: 'remote_url', + url: media[1].split('?')[0], + }, + ]; + payload.query = media[2] || content; + } } if (instance.integration === Integration.WHATSAPP_BAILEYS) { @@ -246,7 +298,7 @@ export class DifyService extends BaseChatbotService { await instance.client.sendPresenceUpdate('paused', remoteJid); if (answer) { - await this.sendMessageWhatsApp(instance, remoteJid, answer, settings); + await this.sendMessageWhatsApp(instance, remoteJid, answer, settings, true); } await this.prismaRepository.integrationSession.update({ diff --git a/src/api/integrations/chatbot/evoai/services/evoai.service.ts b/src/api/integrations/chatbot/evoai/services/evoai.service.ts index 173ebe34d..c6ce5badc 100644 --- a/src/api/integrations/chatbot/evoai/services/evoai.service.ts +++ b/src/api/integrations/chatbot/evoai/services/evoai.service.ts @@ -5,6 +5,7 @@ import { ConfigService, HttpServer } from '@config/env.config'; import { Evoai, EvoaiSetting, IntegrationSession } from '@prisma/client'; import axios from 'axios'; import { downloadMediaMessage } from 'baileys'; +import { isURL } from 'class-validator'; import { v4 as uuidv4 } from 'uuid'; import { BaseChatbotService } from '../../base-chatbot.service'; @@ -82,23 +83,43 @@ export class EvoaiService extends BaseChatbotService { // Handle image message if present if (this.isImageMessage(content) && msg) { - const contentSplit = content.split('|'); - parts[0].text = contentSplit[2] || content; + const media = content.split('|'); + parts[0].text = media[2] || content; try { - // Download the image - const mediaBuffer = await downloadMediaMessage(msg, 'buffer', {}); - const fileContent = Buffer.from(mediaBuffer).toString('base64'); - const fileName = contentSplit[2] || `${msg.key?.id || 'image'}.jpg`; - - parts.push({ - type: 'file', - file: { - name: fileName, - mimeType: 'image/jpeg', - bytes: fileContent, - }, - } as any); + if (msg.message.mediaUrl || msg.message.base64) { + let mediaBase64 = msg.message.base64 || null; + + if (msg.message.mediaUrl && isURL(msg.message.mediaUrl)) { + const result = await axios.get(msg.message.mediaUrl, { responseType: 'arraybuffer' }); + mediaBase64 = Buffer.from(result.data).toString('base64'); + } + + if (mediaBase64) { + parts.push({ + type: 'file', + file: { + name: msg.key.id + '.jpeg', + mimeType: 'image/jpeg', + bytes: mediaBase64, + }, + } as any); + } + } else { + // Download the image + const mediaBuffer = await downloadMediaMessage(msg, 'buffer', {}); + const fileContent = Buffer.from(mediaBuffer).toString('base64'); + const fileName = media[2] || `${msg.key?.id || 'image'}.jpg`; + + parts.push({ + type: 'file', + file: { + name: fileName, + mimeType: 'image/jpeg', + bytes: fileContent, + }, + } as any); + } } catch (fileErr) { this.logger.error(`[EvoAI] Failed to process image: ${fileErr}`); } @@ -174,7 +195,7 @@ export class EvoaiService extends BaseChatbotService { this.logger.debug(`[EvoAI] Extracted message to send: ${message}`); if (message) { - await this.sendMessageWhatsApp(instance, remoteJid, message, settings); + await this.sendMessageWhatsApp(instance, remoteJid, message, settings, true); } } catch (error) { this.logger.error( diff --git a/src/api/integrations/chatbot/evolutionBot/services/evolutionBot.service.ts b/src/api/integrations/chatbot/evolutionBot/services/evolutionBot.service.ts index 081c2ffcc..13f3e9aaf 100644 --- a/src/api/integrations/chatbot/evolutionBot/services/evolutionBot.service.ts +++ b/src/api/integrations/chatbot/evolutionBot/services/evolutionBot.service.ts @@ -6,6 +6,7 @@ import { ConfigService, HttpServer } from '@config/env.config'; import { EvolutionBot, EvolutionBotSetting, IntegrationSession } from '@prisma/client'; import { sendTelemetry } from '@utils/sendTelemetry'; import axios from 'axios'; +import { isURL } from 'class-validator'; import { BaseChatbotService } from '../../base-chatbot.service'; import { OpenaiService } from '../../openai/services/openai.service'; @@ -71,16 +72,26 @@ export class EvolutionBotService extends BaseChatbotService { overrideConfig: { sessionId: remoteJid, vars: { + messageId: msg?.key?.id, + fromMe: msg?.key?.fromMe, remoteJid: remoteJid, pushName: pushName, instanceName: instance.instanceName, @@ -80,17 +83,28 @@ export class FlowiseService extends BaseChatbotService { } if (this.isImageMessage(content)) { - const contentSplit = content.split('|'); - - payload.uploads = [ - { - data: contentSplit[1].split('?')[0], - type: 'url', - name: 'Flowise.png', - mime: 'image/png', - }, - ]; - payload.question = contentSplit[2] || content; + const media = content.split('|'); + + if (msg.message.mediaUrl || msg.message.base64) { + payload.uploads = [ + { + data: msg.message.base64 || msg.message.mediaUrl, + type: 'url', + name: 'Flowise.png', + mime: 'image/png', + }, + ]; + } else { + payload.uploads = [ + { + data: media[1].split('?')[0], + type: 'url', + name: 'Flowise.png', + mime: 'image/png', + }, + ]; + payload.question = media[2] || content; + } } if (instance.integration === Integration.WHATSAPP_BAILEYS) { @@ -128,7 +142,7 @@ export class FlowiseService extends BaseChatbotService { if (message) { // Use the base class method to send the message to WhatsApp - await this.sendMessageWhatsApp(instance, remoteJid, message, settings); + await this.sendMessageWhatsApp(instance, remoteJid, message, settings, true); } } diff --git a/src/api/integrations/chatbot/n8n/services/n8n.service.ts b/src/api/integrations/chatbot/n8n/services/n8n.service.ts index 5bb408904..7da8ac28b 100644 --- a/src/api/integrations/chatbot/n8n/services/n8n.service.ts +++ b/src/api/integrations/chatbot/n8n/services/n8n.service.ts @@ -51,6 +51,7 @@ export class N8nService extends BaseChatbotService { pushName: pushName, keyId: msg?.key?.id, fromMe: msg?.key?.fromMe, + quotedMessage: msg?.contextInfo?.quotedMessage, instanceName: instance.instanceName, serverUrl: this.configService.get('SERVER').URL, apiKey: instance.token, @@ -78,7 +79,7 @@ export class N8nService extends BaseChatbotService { const message = response?.data?.output || response?.data?.answer; // Use base class method instead of custom implementation - await this.sendMessageWhatsApp(instance, remoteJid, message, settings); + await this.sendMessageWhatsApp(instance, remoteJid, message, settings, true); await this.prismaRepository.integrationSession.update({ where: { diff --git a/src/api/integrations/chatbot/openai/services/openai.service.ts b/src/api/integrations/chatbot/openai/services/openai.service.ts index dd00b04c5..4f0cbd396 100644 --- a/src/api/integrations/chatbot/openai/services/openai.service.ts +++ b/src/api/integrations/chatbot/openai/services/openai.service.ts @@ -6,6 +6,7 @@ import { IntegrationSession, OpenaiBot, OpenaiSetting } from '@prisma/client'; import { sendTelemetry } from '@utils/sendTelemetry'; import axios from 'axios'; import { downloadMediaMessage } from 'baileys'; +import { isURL } from 'class-validator'; import FormData from 'form-data'; import OpenAI from 'openai'; import P from 'pino'; @@ -85,6 +86,7 @@ export class OpenaiService extends BaseChatbotService remoteJid, "Sorry, I couldn't transcribe your audio message. Could you please type your message instead?", settings, + true, ); return; } @@ -173,7 +175,7 @@ export class OpenaiService extends BaseChatbotService } // Process with the appropriate API based on bot type - await this.sendMessageToBot(instance, session, settings, openaiBot, remoteJid, pushName || '', content); + await this.sendMessageToBot(instance, session, settings, openaiBot, remoteJid, pushName || '', content, msg); } catch (error) { this.logger.error(`Error in process: ${error.message || JSON.stringify(error)}`); return; @@ -191,6 +193,7 @@ export class OpenaiService extends BaseChatbotService remoteJid: string, pushName: string, content: string, + msg?: any, ): Promise { this.logger.log(`Sending message to bot for remoteJid: ${remoteJid}, bot type: ${openaiBot.botType}`); @@ -222,10 +225,11 @@ export class OpenaiService extends BaseChatbotService pushName, false, // Not fromMe content, + msg, ); } else { this.logger.log('Processing with ChatCompletion API'); - message = await this.processChatCompletionMessage(instance, openaiBot, remoteJid, content); + message = await this.processChatCompletionMessage(instance, openaiBot, remoteJid, content, msg); } this.logger.log(`Got response from OpenAI: ${message?.substring(0, 50)}${message?.length > 50 ? '...' : ''}`); @@ -233,7 +237,7 @@ export class OpenaiService extends BaseChatbotService // Send the response if (message) { this.logger.log('Sending message to WhatsApp'); - await this.sendMessageWhatsApp(instance, remoteJid, message, settings); + await this.sendMessageWhatsApp(instance, remoteJid, message, settings, true); } else { this.logger.error('No message to send to WhatsApp'); } @@ -268,6 +272,7 @@ export class OpenaiService extends BaseChatbotService pushName: string, fromMe: boolean, content: string, + msg?: any, ): Promise { const messageData: any = { role: fromMe ? 'assistant' : 'user', @@ -276,18 +281,35 @@ export class OpenaiService extends BaseChatbotService // Handle image messages if (this.isImageMessage(content)) { - const contentSplit = content.split('|'); - const url = contentSplit[1].split('?')[0]; + const media = content.split('|'); - messageData.content = [ - { type: 'text', text: contentSplit[2] || content }, - { - type: 'image_url', - image_url: { - url: url, + if (msg.message.mediaUrl || msg.message.base64) { + let mediaBase64 = msg.message.base64 || null; + + if (msg.message.mediaUrl && isURL(msg.message.mediaUrl)) { + const result = await axios.get(msg.message.mediaUrl, { responseType: 'arraybuffer' }); + mediaBase64 = Buffer.from(result.data).toString('base64'); + } + + if (mediaBase64) { + messageData.content = [ + { type: 'text', text: media[2] || content }, + { type: 'image_url', image_url: { url: mediaBase64 } }, + ]; + } + } else { + const url = media[1].split('?')[0]; + + messageData.content = [ + { type: 'text', text: media[2] || content }, + { + type: 'image_url', + image_url: { + url: url, + }, }, - }, - ]; + ]; + } } // Get thread ID from session or create new thread @@ -376,6 +398,7 @@ export class OpenaiService extends BaseChatbotService openaiBot: OpenaiBot, remoteJid: string, content: string, + msg?: any, ): Promise { this.logger.log('Starting processChatCompletionMessage'); @@ -468,18 +491,26 @@ export class OpenaiService extends BaseChatbotService // Handle image messages if (this.isImageMessage(content)) { this.logger.log('Found image message'); - const contentSplit = content.split('|'); - const url = contentSplit[1].split('?')[0]; + const media = content.split('|'); - messageData.content = [ - { type: 'text', text: contentSplit[2] || content }, - { - type: 'image_url', - image_url: { - url: url, + if (msg.message.mediaUrl || msg.message.base64) { + messageData.content = [ + { type: 'text', text: media[2] || content }, + { type: 'image_url', image_url: { url: msg.message.base64 || msg.message.mediaUrl } }, + ]; + } else { + const url = media[1].split('?')[0]; + + messageData.content = [ + { type: 'text', text: media[2] || content }, + { + type: 'image_url', + image_url: { + url: url, + }, }, - }, - ]; + ]; + } } // Combine all messages: system messages, pre-defined messages, conversation history, and current message diff --git a/src/api/integrations/chatbot/typebot/services/typebot.service.ts b/src/api/integrations/chatbot/typebot/services/typebot.service.ts index e7ae24e6f..03712bfdb 100644 --- a/src/api/integrations/chatbot/typebot/services/typebot.service.ts +++ b/src/api/integrations/chatbot/typebot/services/typebot.service.ts @@ -1,5 +1,6 @@ import { PrismaRepository } from '@api/repository/repository.service'; import { WAMonitoringService } from '@api/services/monitor.service'; +import { Events } from '@api/types/wa.types'; import { Auth, ConfigService, HttpServer, Typebot } from '@config/env.config'; import { Instance, IntegrationSession, Message, Typebot as TypebotModel } from '@prisma/client'; import { getConversationMessage } from '@utils/getConversationMessage'; @@ -151,6 +152,14 @@ export class TypebotService extends BaseChatbotService { }, }); } + + const typebotData = { + remoteJid: data.remoteJid, + status: 'opened', + session, + }; + this.waMonitor.waInstances[instance.name].sendDataWebhook(Events.TYPEBOT_CHANGE_STATUS, typebotData); + return { ...request.data, session }; } catch (error) { this.logger.error(error); @@ -309,7 +318,7 @@ export class TypebotService extends BaseChatbotService { } else if (formattedText.includes('[buttons]')) { await this.processButtonMessage(instance, formattedText, session.remoteJid); } else { - await this.sendMessageWhatsApp(instance, session.remoteJid, formattedText, settings); + await this.sendMessageWhatsApp(instance, session.remoteJid, formattedText, settings, true); } sendTelemetry('/message/sendText'); @@ -318,7 +327,7 @@ export class TypebotService extends BaseChatbotService { if (message.type === 'image') { await instance.mediaMessage( { - number: session.remoteJid.split('@')[0], + number: session.remoteJid, delay: settings?.delayMessage || 1000, mediatype: 'image', media: message.content.url, @@ -333,7 +342,7 @@ export class TypebotService extends BaseChatbotService { if (message.type === 'video') { await instance.mediaMessage( { - number: session.remoteJid.split('@')[0], + number: session.remoteJid, delay: settings?.delayMessage || 1000, mediatype: 'video', media: message.content.url, @@ -348,7 +357,7 @@ export class TypebotService extends BaseChatbotService { if (message.type === 'audio') { await instance.audioWhatsapp( { - number: session.remoteJid.split('@')[0], + number: session.remoteJid, delay: settings?.delayMessage || 1000, encoding: true, audio: message.content.url, @@ -384,7 +393,7 @@ export class TypebotService extends BaseChatbotService { } else if (formattedText.includes('[buttons]')) { await this.processButtonMessage(instance, formattedText, session.remoteJid); } else { - await this.sendMessageWhatsApp(instance, session.remoteJid, formattedText, settings); + await this.sendMessageWhatsApp(instance, session.remoteJid, formattedText, settings, true); } sendTelemetry('/message/sendText'); @@ -399,12 +408,14 @@ export class TypebotService extends BaseChatbotService { }, }); } else { + let statusChange = 'closed'; if (!settings?.keepOpen) { await prismaRepository.integrationSession.deleteMany({ where: { id: session.id, }, }); + statusChange = 'delete'; } else { await prismaRepository.integrationSession.update({ where: { @@ -415,6 +426,13 @@ export class TypebotService extends BaseChatbotService { }, }); } + + const typebotData = { + remoteJid: session.remoteJid, + status: statusChange, + session, + }; + instance.sendDataWebhook(Events.TYPEBOT_CHANGE_STATUS, typebotData); } } @@ -423,7 +441,7 @@ export class TypebotService extends BaseChatbotService { */ private async processListMessage(instance: any, formattedText: string, remoteJid: string) { const listJson = { - number: remoteJid.split('@')[0], + number: remoteJid, title: '', description: '', buttonText: '', @@ -472,7 +490,7 @@ export class TypebotService extends BaseChatbotService { */ private async processButtonMessage(instance: any, formattedText: string, remoteJid: string) { const buttonJson = { - number: remoteJid.split('@')[0], + number: remoteJid, thumbnailUrl: undefined, title: '', description: '', @@ -624,21 +642,28 @@ export class TypebotService extends BaseChatbotService { if (!content) { if (unknownMessage) { - await this.sendMessageWhatsApp(waInstance, remoteJid, unknownMessage, { - delayMessage, - expire, - keywordFinish, - listeningFromMe, - stopBotFromMe, - keepOpen, + await this.sendMessageWhatsApp( + waInstance, + remoteJid, unknownMessage, - }); + { + delayMessage, + expire, + keywordFinish, + listeningFromMe, + stopBotFromMe, + keepOpen, + unknownMessage, + }, + true, + ); sendTelemetry('/message/sendText'); } return; } if (keywordFinish && content.toLowerCase() === keywordFinish.toLowerCase()) { + let statusChange = 'closed'; if (keepOpen) { await this.prismaRepository.integrationSession.update({ where: { @@ -649,6 +674,7 @@ export class TypebotService extends BaseChatbotService { }, }); } else { + statusChange = 'delete'; await this.prismaRepository.integrationSession.deleteMany({ where: { botId: findTypebot.id, @@ -656,6 +682,14 @@ export class TypebotService extends BaseChatbotService { }, }); } + + const typebotData = { + remoteJid: remoteJid, + status: statusChange, + session, + }; + waInstance.sendDataWebhook(Events.TYPEBOT_CHANGE_STATUS, typebotData); + return; } @@ -773,21 +807,28 @@ export class TypebotService extends BaseChatbotService { if (!data?.messages || data.messages.length === 0) { if (!content) { if (unknownMessage) { - await this.sendMessageWhatsApp(waInstance, remoteJid, unknownMessage, { - delayMessage, - expire, - keywordFinish, - listeningFromMe, - stopBotFromMe, - keepOpen, + await this.sendMessageWhatsApp( + waInstance, + remoteJid, unknownMessage, - }); + { + delayMessage, + expire, + keywordFinish, + listeningFromMe, + stopBotFromMe, + keepOpen, + unknownMessage, + }, + true, + ); sendTelemetry('/message/sendText'); } return; } if (keywordFinish && content.toLowerCase() === keywordFinish.toLowerCase()) { + let statusChange = 'closed'; if (keepOpen) { await this.prismaRepository.integrationSession.update({ where: { @@ -798,6 +839,7 @@ export class TypebotService extends BaseChatbotService { }, }); } else { + statusChange = 'delete'; await this.prismaRepository.integrationSession.deleteMany({ where: { botId: findTypebot.id, @@ -806,6 +848,13 @@ export class TypebotService extends BaseChatbotService { }); } + const typebotData = { + remoteJid: remoteJid, + status: statusChange, + session, + }; + waInstance.sendDataWebhook(Events.TYPEBOT_CHANGE_STATUS, typebotData); + return; } @@ -866,21 +915,28 @@ export class TypebotService extends BaseChatbotService { if (!content) { if (unknownMessage) { - await this.sendMessageWhatsApp(waInstance, remoteJid, unknownMessage, { - delayMessage, - expire, - keywordFinish, - listeningFromMe, - stopBotFromMe, - keepOpen, + await this.sendMessageWhatsApp( + waInstance, + remoteJid, unknownMessage, - }); + { + delayMessage, + expire, + keywordFinish, + listeningFromMe, + stopBotFromMe, + keepOpen, + unknownMessage, + }, + true, + ); sendTelemetry('/message/sendText'); } return; } if (keywordFinish && content.toLowerCase() === keywordFinish.toLowerCase()) { + let statusChange = 'closed'; if (keepOpen) { await this.prismaRepository.integrationSession.update({ where: { @@ -891,6 +947,7 @@ export class TypebotService extends BaseChatbotService { }, }); } else { + statusChange = 'delete'; await this.prismaRepository.integrationSession.deleteMany({ where: { botId: findTypebot.id, @@ -898,6 +955,15 @@ export class TypebotService extends BaseChatbotService { }, }); } + + const typebotData = { + remoteJid: remoteJid, + status: statusChange, + session, + }; + + waInstance.sendDataWebhook(Events.TYPEBOT_CHANGE_STATUS, typebotData); + return; } diff --git a/src/api/integrations/event/event.controller.ts b/src/api/integrations/event/event.controller.ts index 7df3de924..39b52184b 100644 --- a/src/api/integrations/event/event.controller.ts +++ b/src/api/integrations/event/event.controller.ts @@ -14,12 +14,24 @@ export type EmitData = { apiKey?: string; local?: boolean; integration?: string[]; + extra?: Record; }; export interface EventControllerInterface { set(instanceName: string, data: any): Promise; get(instanceName: string): Promise; - emit({ instanceName, origin, event, data, serverUrl, dateTime, sender, apiKey, local }: EmitData): Promise; + emit({ + instanceName, + origin, + event, + data, + serverUrl, + dateTime, + sender, + apiKey, + local, + extra, + }: EmitData): Promise; } export class EventController { diff --git a/src/api/integrations/event/event.dto.ts b/src/api/integrations/event/event.dto.ts index 84426764a..b5292993d 100644 --- a/src/api/integrations/event/event.dto.ts +++ b/src/api/integrations/event/event.dto.ts @@ -40,6 +40,11 @@ export class EventDto { useTLS?: boolean; events?: string[]; }; + + kafka?: { + enabled?: boolean; + events?: string[]; + }; } export function EventInstanceMixin(Base: TBase) { @@ -82,5 +87,10 @@ export function EventInstanceMixin(Base: TBase) { useTLS?: boolean; events?: string[]; }; + + kafka?: { + enabled?: boolean; + events?: string[]; + }; }; } diff --git a/src/api/integrations/event/event.manager.ts b/src/api/integrations/event/event.manager.ts index 4b4a310ce..5dd3fcf26 100644 --- a/src/api/integrations/event/event.manager.ts +++ b/src/api/integrations/event/event.manager.ts @@ -1,3 +1,4 @@ +import { KafkaController } from '@api/integrations/event/kafka/kafka.controller'; import { NatsController } from '@api/integrations/event/nats/nats.controller'; import { PusherController } from '@api/integrations/event/pusher/pusher.controller'; import { RabbitmqController } from '@api/integrations/event/rabbitmq/rabbitmq.controller'; @@ -17,6 +18,7 @@ export class EventManager { private natsController: NatsController; private sqsController: SqsController; private pusherController: PusherController; + private kafkaController: KafkaController; constructor(prismaRepository: PrismaRepository, waMonitor: WAMonitoringService) { this.prisma = prismaRepository; @@ -28,6 +30,7 @@ export class EventManager { this.nats = new NatsController(prismaRepository, waMonitor); this.sqs = new SqsController(prismaRepository, waMonitor); this.pusher = new PusherController(prismaRepository, waMonitor); + this.kafka = new KafkaController(prismaRepository, waMonitor); } public set prisma(prisma: PrismaRepository) { @@ -93,25 +96,34 @@ export class EventManager { return this.pusherController; } + public set kafka(kafka: KafkaController) { + this.kafkaController = kafka; + } + public get kafka() { + return this.kafkaController; + } + public init(httpServer: Server): void { this.websocket.init(httpServer); this.rabbitmq.init(); this.nats.init(); this.sqs.init(); this.pusher.init(); + this.kafka.init(); } public async emit(eventData: { instanceName: string; origin: string; event: string; - data: Object; + data: object; serverUrl: string; dateTime: string; sender: string; apiKey?: string; local?: boolean; integration?: string[]; + extra?: Record; }): Promise { await this.websocket.emit(eventData); await this.rabbitmq.emit(eventData); @@ -119,42 +131,47 @@ export class EventManager { await this.sqs.emit(eventData); await this.webhook.emit(eventData); await this.pusher.emit(eventData); + await this.kafka.emit(eventData); } public async setInstance(instanceName: string, data: any): Promise { - if (data.websocket) + if (data.websocket) { await this.websocket.set(instanceName, { websocket: { enabled: true, events: data.websocket?.events, }, }); + } - if (data.rabbitmq) + if (data.rabbitmq) { await this.rabbitmq.set(instanceName, { rabbitmq: { enabled: true, events: data.rabbitmq?.events, }, }); + } - if (data.nats) + if (data.nats) { await this.nats.set(instanceName, { nats: { enabled: true, events: data.nats?.events, }, }); + } - if (data.sqs) + if (data.sqs) { await this.sqs.set(instanceName, { sqs: { enabled: true, events: data.sqs?.events, }, }); + } - if (data.webhook) + if (data.webhook) { await this.webhook.set(instanceName, { webhook: { enabled: true, @@ -165,8 +182,9 @@ export class EventManager { byEvents: data.webhook?.byEvents, }, }); + } - if (data.pusher) + if (data.pusher) { await this.pusher.set(instanceName, { pusher: { enabled: true, @@ -178,5 +196,15 @@ export class EventManager { useTLS: data.pusher?.useTLS, }, }); + } + + if (data.kafka) { + await this.kafka.set(instanceName, { + kafka: { + enabled: true, + events: data.kafka?.events, + }, + }); + } } } diff --git a/src/api/integrations/event/event.router.ts b/src/api/integrations/event/event.router.ts index 49a6ec60a..f80907bcd 100644 --- a/src/api/integrations/event/event.router.ts +++ b/src/api/integrations/event/event.router.ts @@ -1,3 +1,4 @@ +import { KafkaRouter } from '@api/integrations/event/kafka/kafka.router'; import { NatsRouter } from '@api/integrations/event/nats/nats.router'; import { PusherRouter } from '@api/integrations/event/pusher/pusher.router'; import { RabbitmqRouter } from '@api/integrations/event/rabbitmq/rabbitmq.router'; @@ -18,5 +19,6 @@ export class EventRouter { this.router.use('/nats', new NatsRouter(...guards).router); this.router.use('/pusher', new PusherRouter(...guards).router); this.router.use('/sqs', new SqsRouter(...guards).router); + this.router.use('/kafka', new KafkaRouter(...guards).router); } } diff --git a/src/api/integrations/event/event.schema.ts b/src/api/integrations/event/event.schema.ts index 464ee02b1..812bbd534 100644 --- a/src/api/integrations/event/event.schema.ts +++ b/src/api/integrations/event/event.schema.ts @@ -22,6 +22,9 @@ export const eventSchema: JSONSchema7 = { sqs: { $ref: '#/$defs/event', }, + kafka: { + $ref: '#/$defs/event', + }, }, $defs: { event: { diff --git a/src/api/integrations/event/kafka/kafka.controller.ts b/src/api/integrations/event/kafka/kafka.controller.ts new file mode 100644 index 000000000..543c759ad --- /dev/null +++ b/src/api/integrations/event/kafka/kafka.controller.ts @@ -0,0 +1,416 @@ +import { PrismaRepository } from '@api/repository/repository.service'; +import { WAMonitoringService } from '@api/services/monitor.service'; +import { configService, Kafka, Log } from '@config/env.config'; +import { Logger } from '@config/logger.config'; +import { Consumer, ConsumerConfig, Kafka as KafkaJS, KafkaConfig, Producer, ProducerConfig } from 'kafkajs'; + +import { EmitData, EventController, EventControllerInterface } from '../event.controller'; + +export class KafkaController extends EventController implements EventControllerInterface { + private kafkaClient: KafkaJS | null = null; + private producer: Producer | null = null; + private consumer: Consumer | null = null; + private readonly logger = new Logger('KafkaController'); + private reconnectAttempts = 0; + private maxReconnectAttempts = 10; + private reconnectDelay = 5000; // 5 seconds + private isReconnecting = false; + + constructor(prismaRepository: PrismaRepository, waMonitor: WAMonitoringService) { + super(prismaRepository, waMonitor, configService.get('KAFKA')?.ENABLED, 'kafka'); + } + + public async init(): Promise { + if (!this.status) { + return; + } + + await this.connect(); + } + + private async connect(): Promise { + try { + const kafkaConfig = configService.get('KAFKA'); + + const clientConfig: KafkaConfig = { + clientId: kafkaConfig.CLIENT_ID || 'evolution-api', + brokers: kafkaConfig.BROKERS || ['localhost:9092'], + connectionTimeout: kafkaConfig.CONNECTION_TIMEOUT || 3000, + requestTimeout: kafkaConfig.REQUEST_TIMEOUT || 30000, + retry: { + initialRetryTime: 100, + retries: 8, + }, + }; + + // Add SASL authentication if configured + if (kafkaConfig.SASL?.ENABLED) { + clientConfig.sasl = { + mechanism: (kafkaConfig.SASL.MECHANISM as any) || 'plain', + username: kafkaConfig.SASL.USERNAME, + password: kafkaConfig.SASL.PASSWORD, + }; + } + + // Add SSL configuration if enabled + if (kafkaConfig.SSL?.ENABLED) { + clientConfig.ssl = { + rejectUnauthorized: kafkaConfig.SSL.REJECT_UNAUTHORIZED !== false, + ca: kafkaConfig.SSL.CA ? [kafkaConfig.SSL.CA] : undefined, + key: kafkaConfig.SSL.KEY, + cert: kafkaConfig.SSL.CERT, + }; + } + + this.kafkaClient = new KafkaJS(clientConfig); + + // Initialize producer + const producerConfig: ProducerConfig = { + maxInFlightRequests: 1, + idempotent: true, + transactionTimeout: 30000, + }; + + this.producer = this.kafkaClient.producer(producerConfig); + await this.producer.connect(); + + // Initialize consumer for global events if enabled + if (kafkaConfig.GLOBAL_ENABLED) { + await this.initGlobalConsumer(); + } + + this.reconnectAttempts = 0; + this.isReconnecting = false; + + this.logger.info('Kafka initialized successfully'); + + // Create topics if they don't exist + if (kafkaConfig.AUTO_CREATE_TOPICS) { + await this.createTopics(); + } + } catch (error) { + this.logger.error({ + local: 'KafkaController.connect', + message: 'Failed to connect to Kafka', + error: error.message || error, + }); + this.scheduleReconnect(); + throw error; + } + } + + private async initGlobalConsumer(): Promise { + try { + const kafkaConfig = configService.get('KAFKA'); + + const consumerConfig: ConsumerConfig = { + groupId: kafkaConfig.CONSUMER_GROUP_ID || 'evolution-api-consumers', + sessionTimeout: 30000, + heartbeatInterval: 3000, + }; + + this.consumer = this.kafkaClient.consumer(consumerConfig); + await this.consumer.connect(); + + // Subscribe to global topics + const events = kafkaConfig.EVENTS; + if (events) { + const eventKeys = Object.keys(events).filter((event) => events[event]); + + for (const event of eventKeys) { + const topicName = this.getTopicName(event, true); + await this.consumer.subscribe({ topic: topicName }); + } + + // Start consuming messages + await this.consumer.run({ + eachMessage: async ({ topic, message }) => { + try { + const data = JSON.parse(message.value?.toString() || '{}'); + this.logger.debug(`Received message from topic ${topic}: ${JSON.stringify(data)}`); + + // Process the message here if needed + // This is where you can add custom message processing logic + } catch (error) { + this.logger.error(`Error processing message from topic ${topic}: ${error}`); + } + }, + }); + + this.logger.info('Global Kafka consumer initialized'); + } + } catch (error) { + this.logger.error(`Failed to initialize global Kafka consumer: ${error}`); + } + } + + private async createTopics(): Promise { + try { + const kafkaConfig = configService.get('KAFKA'); + const admin = this.kafkaClient.admin(); + await admin.connect(); + + const topics = []; + + // Create global topics if enabled + if (kafkaConfig.GLOBAL_ENABLED && kafkaConfig.EVENTS) { + const eventKeys = Object.keys(kafkaConfig.EVENTS).filter((event) => kafkaConfig.EVENTS[event]); + + for (const event of eventKeys) { + const topicName = this.getTopicName(event, true); + topics.push({ + topic: topicName, + numPartitions: kafkaConfig.NUM_PARTITIONS || 1, + replicationFactor: kafkaConfig.REPLICATION_FACTOR || 1, + }); + } + } + + if (topics.length > 0) { + await admin.createTopics({ + topics, + waitForLeaders: true, + }); + + this.logger.info(`Created ${topics.length} Kafka topics`); + } + + await admin.disconnect(); + } catch (error) { + this.logger.error(`Failed to create Kafka topics: ${error}`); + } + } + + private getTopicName(event: string, isGlobal: boolean = false, instanceName?: string): string { + const kafkaConfig = configService.get('KAFKA'); + const prefix = kafkaConfig.TOPIC_PREFIX || 'evolution'; + + if (isGlobal) { + return `${prefix}.global.${event.toLowerCase().replace(/_/g, '.')}`; + } else { + return `${prefix}.${instanceName}.${event.toLowerCase().replace(/_/g, '.')}`; + } + } + + private handleConnectionLoss(): void { + if (this.isReconnecting) { + return; + } + + this.cleanup(); + this.scheduleReconnect(); + } + + private scheduleReconnect(): void { + if (this.reconnectAttempts >= this.maxReconnectAttempts) { + this.logger.error( + `Maximum reconnect attempts (${this.maxReconnectAttempts}) reached. Stopping reconnection attempts.`, + ); + return; + } + + if (this.isReconnecting) { + return; + } + + this.isReconnecting = true; + this.reconnectAttempts++; + + const delay = this.reconnectDelay * Math.pow(2, Math.min(this.reconnectAttempts - 1, 5)); + + this.logger.info( + `Scheduling Kafka reconnection attempt ${this.reconnectAttempts}/${this.maxReconnectAttempts} in ${delay}ms`, + ); + + setTimeout(async () => { + try { + this.logger.info( + `Attempting to reconnect to Kafka (attempt ${this.reconnectAttempts}/${this.maxReconnectAttempts})`, + ); + await this.connect(); + this.logger.info('Successfully reconnected to Kafka'); + } catch (error) { + this.logger.error({ + local: 'KafkaController.scheduleReconnect', + message: `Reconnection attempt ${this.reconnectAttempts} failed`, + error: error.message || error, + }); + this.isReconnecting = false; + this.scheduleReconnect(); + } + }, delay); + } + + private async ensureConnection(): Promise { + if (!this.producer) { + this.logger.warn('Kafka producer is not available, attempting to reconnect...'); + if (!this.isReconnecting) { + this.scheduleReconnect(); + } + return false; + } + return true; + } + + public async emit({ + instanceName, + origin, + event, + data, + serverUrl, + dateTime, + sender, + apiKey, + integration, + extra, + }: EmitData): Promise { + if (integration && !integration.includes('kafka')) { + return; + } + + if (!this.status) { + return; + } + + if (!(await this.ensureConnection())) { + this.logger.warn(`Failed to emit event ${event} for instance ${instanceName}: No Kafka connection`); + return; + } + + const instanceKafka = await this.get(instanceName); + const kafkaLocal = instanceKafka?.events; + const kafkaGlobal = configService.get('KAFKA').GLOBAL_ENABLED; + const kafkaEvents = configService.get('KAFKA').EVENTS; + const we = event.replace(/[.-]/gm, '_').toUpperCase(); + const logEnabled = configService.get('LOG').LEVEL.includes('WEBHOOKS'); + + const message = { + ...(extra ?? {}), + event, + instance: instanceName, + data, + server_url: serverUrl, + date_time: dateTime, + sender, + apikey: apiKey, + timestamp: Date.now(), + }; + + const messageValue = JSON.stringify(message); + + // Instance-specific events + if (instanceKafka?.enabled && this.producer && Array.isArray(kafkaLocal) && kafkaLocal.includes(we)) { + const topicName = this.getTopicName(event, false, instanceName); + + let retry = 0; + while (retry < 3) { + try { + await this.producer.send({ + topic: topicName, + messages: [ + { + key: instanceName, + value: messageValue, + headers: { + event, + instance: instanceName, + origin, + timestamp: dateTime, + }, + }, + ], + }); + + if (logEnabled) { + const logData = { + local: `${origin}.sendData-Kafka`, + ...message, + }; + this.logger.log(logData); + } + + break; + } catch (error) { + this.logger.error({ + local: 'KafkaController.emit', + message: `Error publishing local Kafka message (attempt ${retry + 1}/3)`, + error: error.message || error, + }); + retry++; + if (retry >= 3) { + this.handleConnectionLoss(); + } + } + } + } + + // Global events + if (kafkaGlobal && kafkaEvents[we] && this.producer) { + const topicName = this.getTopicName(event, true); + + let retry = 0; + while (retry < 3) { + try { + await this.producer.send({ + topic: topicName, + messages: [ + { + key: `${instanceName}-${event}`, + value: messageValue, + headers: { + event, + instance: instanceName, + origin, + timestamp: dateTime, + }, + }, + ], + }); + + if (logEnabled) { + const logData = { + local: `${origin}.sendData-Kafka-Global`, + ...message, + }; + this.logger.log(logData); + } + + break; + } catch (error) { + this.logger.error({ + local: 'KafkaController.emit', + message: `Error publishing global Kafka message (attempt ${retry + 1}/3)`, + error: error.message || error, + }); + retry++; + if (retry >= 3) { + this.handleConnectionLoss(); + } + } + } + } + } + + public async cleanup(): Promise { + try { + if (this.consumer) { + await this.consumer.disconnect(); + this.consumer = null; + } + if (this.producer) { + await this.producer.disconnect(); + this.producer = null; + } + this.kafkaClient = null; + } catch (error) { + this.logger.warn({ + local: 'KafkaController.cleanup', + message: 'Error during cleanup', + error: error.message || error, + }); + this.producer = null; + this.consumer = null; + this.kafkaClient = null; + } + } +} diff --git a/src/api/integrations/event/kafka/kafka.router.ts b/src/api/integrations/event/kafka/kafka.router.ts new file mode 100644 index 000000000..eb8465086 --- /dev/null +++ b/src/api/integrations/event/kafka/kafka.router.ts @@ -0,0 +1,36 @@ +import { RouterBroker } from '@api/abstract/abstract.router'; +import { InstanceDto } from '@api/dto/instance.dto'; +import { EventDto } from '@api/integrations/event/event.dto'; +import { HttpStatus } from '@api/routes/index.router'; +import { eventManager } from '@api/server.module'; +import { eventSchema, instanceSchema } from '@validate/validate.schema'; +import { RequestHandler, Router } from 'express'; + +export class KafkaRouter extends RouterBroker { + constructor(...guards: RequestHandler[]) { + super(); + this.router + .post(this.routerPath('set'), ...guards, async (req, res) => { + const response = await this.dataValidate({ + request: req, + schema: eventSchema, + ClassRef: EventDto, + execute: (instance, data) => eventManager.kafka.set(instance.instanceName, data), + }); + + res.status(HttpStatus.CREATED).json(response); + }) + .get(this.routerPath('find'), ...guards, async (req, res) => { + const response = await this.dataValidate({ + request: req, + schema: instanceSchema, + ClassRef: InstanceDto, + execute: (instance) => eventManager.kafka.get(instance.instanceName), + }); + + res.status(HttpStatus.OK).json(response); + }); + } + + public readonly router: Router = Router(); +} diff --git a/src/api/integrations/event/kafka/kafka.schema.ts b/src/api/integrations/event/kafka/kafka.schema.ts new file mode 100644 index 000000000..3decb27e2 --- /dev/null +++ b/src/api/integrations/event/kafka/kafka.schema.ts @@ -0,0 +1,21 @@ +import { JSONSchema7 } from 'json-schema'; +import { v4 } from 'uuid'; + +import { EventController } from '../event.controller'; + +export const kafkaSchema: JSONSchema7 = { + $id: v4(), + type: 'object', + properties: { + enabled: { type: 'boolean', enum: [true, false] }, + events: { + type: 'array', + minItems: 0, + items: { + type: 'string', + enum: EventController.events, + }, + }, + }, + required: ['enabled'], +}; diff --git a/src/api/integrations/event/nats/nats.controller.ts b/src/api/integrations/event/nats/nats.controller.ts index 09b597797..1ff4fbae8 100644 --- a/src/api/integrations/event/nats/nats.controller.ts +++ b/src/api/integrations/event/nats/nats.controller.ts @@ -47,6 +47,7 @@ export class NatsController extends EventController implements EventControllerIn sender, apiKey, integration, + extra, }: EmitData): Promise { if (integration && !integration.includes('nats')) { return; @@ -65,6 +66,7 @@ export class NatsController extends EventController implements EventControllerIn const logEnabled = configService.get('LOG').LEVEL.includes('WEBHOOKS'); const message = { + ...(extra ?? {}), event, instance: instanceName, data, diff --git a/src/api/integrations/event/pusher/pusher.controller.ts b/src/api/integrations/event/pusher/pusher.controller.ts index eef244b2a..045f7cc4f 100644 --- a/src/api/integrations/event/pusher/pusher.controller.ts +++ b/src/api/integrations/event/pusher/pusher.controller.ts @@ -121,6 +121,7 @@ export class PusherController extends EventController implements EventController apiKey, local, integration, + extra, }: EmitData): Promise { if (integration && !integration.includes('pusher')) { return; @@ -133,6 +134,7 @@ export class PusherController extends EventController implements EventController const enabledLog = configService.get('LOG').LEVEL.includes('WEBHOOKS'); const eventName = event.replace(/_/g, '.').toLowerCase(); const pusherData = { + ...(extra ?? {}), event, instance: instanceName, data, diff --git a/src/api/integrations/event/rabbitmq/rabbitmq.controller.ts b/src/api/integrations/event/rabbitmq/rabbitmq.controller.ts index 3295b12de..b4625508b 100644 --- a/src/api/integrations/event/rabbitmq/rabbitmq.controller.ts +++ b/src/api/integrations/event/rabbitmq/rabbitmq.controller.ts @@ -209,6 +209,7 @@ export class RabbitmqController extends EventController implements EventControll sender, apiKey, integration, + extra, }: EmitData): Promise { if (integration && !integration.includes('rabbitmq')) { return; @@ -233,6 +234,7 @@ export class RabbitmqController extends EventController implements EventControll const logEnabled = configService.get('LOG').LEVEL.includes('WEBHOOKS'); const message = { + ...(extra ?? {}), event, instance: instanceName, data, diff --git a/src/api/integrations/event/sqs/sqs.controller.ts b/src/api/integrations/event/sqs/sqs.controller.ts index 05bf618bf..2b0398ef2 100644 --- a/src/api/integrations/event/sqs/sqs.controller.ts +++ b/src/api/integrations/event/sqs/sqs.controller.ts @@ -1,7 +1,8 @@ +import * as s3Service from '@api/integrations/storage/s3/libs/minio.server'; import { PrismaRepository } from '@api/repository/repository.service'; import { WAMonitoringService } from '@api/services/monitor.service'; import { CreateQueueCommand, DeleteQueueCommand, ListQueuesCommand, SQS } from '@aws-sdk/client-sqs'; -import { configService, Log, Sqs } from '@config/env.config'; +import { configService, HttpServer, Log, S3, Sqs } from '@config/env.config'; import { Logger } from '@config/logger.config'; import { EmitData, EventController, EventControllerInterface } from '../event.controller'; @@ -15,27 +16,29 @@ export class SqsController extends EventController implements EventControllerInt super(prismaRepository, waMonitor, configService.get('SQS')?.ENABLED, 'sqs'); } - public init(): void { + public async init(): Promise { if (!this.status) { return; } - new Promise((resolve) => { - const awsConfig = configService.get('SQS'); + const awsConfig = configService.get('SQS'); - this.sqs = new SQS({ - credentials: { - accessKeyId: awsConfig.ACCESS_KEY_ID, - secretAccessKey: awsConfig.SECRET_ACCESS_KEY, - }, + this.sqs = new SQS({ + credentials: { + accessKeyId: awsConfig.ACCESS_KEY_ID, + secretAccessKey: awsConfig.SECRET_ACCESS_KEY, + }, - region: awsConfig.REGION, - }); + region: awsConfig.REGION, + }); - this.logger.info('SQS initialized'); + this.logger.info('SQS initialized'); - resolve(); - }); + const sqsConfig = configService.get('SQS'); + if (this.sqs && sqsConfig.GLOBAL_ENABLED) { + const sqsEvents = Object.keys(sqsConfig.EVENTS).filter((e) => sqsConfig.EVENTS[e]); + await this.saveQueues(sqsConfig.GLOBAL_PREFIX_NAME, sqsEvents, true); + } } private set channel(sqs: SQS) { @@ -47,7 +50,7 @@ export class SqsController extends EventController implements EventControllerInt } override async set(instanceName: string, data: EventDto): Promise { - if (!this.status) { + if (!this.status || configService.get('SQS').GLOBAL_ENABLED) { return; } @@ -75,6 +78,7 @@ export class SqsController extends EventController implements EventControllerInt instanceId: this.monitor.waInstances[instanceName].instanceId, }, }; + console.log('*** payload: ', payload); return this.prisma[this.name].upsert(payload); } @@ -89,6 +93,7 @@ export class SqsController extends EventController implements EventControllerInt sender, apiKey, integration, + extra, }: EmitData): Promise { if (integration && !integration.includes('sqs')) { return; @@ -98,100 +103,154 @@ export class SqsController extends EventController implements EventControllerInt return; } - const instanceSqs = await this.get(instanceName); - const sqsLocal = instanceSqs?.events; - const we = event.replace(/[.-]/gm, '_').toUpperCase(); - - if (instanceSqs?.enabled) { - if (this.sqs) { - if (Array.isArray(sqsLocal) && sqsLocal.includes(we)) { - const eventFormatted = `${event.replace('.', '_').toLowerCase()}`; - const queueName = `${instanceName}_${eventFormatted}.fifo`; - const sqsConfig = configService.get('SQS'); - const sqsUrl = `https://sqs.${sqsConfig.REGION}.amazonaws.com/${sqsConfig.ACCOUNT_ID}/${queueName}`; - - const message = { - event, - instance: instanceName, - data, - server_url: serverUrl, - date_time: dateTime, - sender, - apikey: apiKey, - }; - - const params = { - MessageBody: JSON.stringify(message), - MessageGroupId: 'evolution', - MessageDeduplicationId: `${instanceName}_${eventFormatted}_${Date.now()}`, - QueueUrl: sqsUrl, - }; - - this.sqs.sendMessage(params, (err) => { - if (err) { - this.logger.error({ - local: `${origin}.sendData-SQS`, - message: err?.message, - hostName: err?.hostname, - code: err?.code, - stack: err?.stack, - name: err?.name, - url: queueName, - server_url: serverUrl, - }); - } else { - if (configService.get('LOG').LEVEL.includes('WEBHOOKS')) { - const logData = { - local: `${origin}.sendData-SQS`, - ...message, - }; - - this.logger.log(logData); - } - } + if (this.sqs) { + const serverConfig = configService.get('SERVER'); + const sqsConfig = configService.get('SQS'); + + const we = event.replace(/[.-]/gm, '_').toUpperCase(); + + let sqsEvents = []; + if (sqsConfig.GLOBAL_ENABLED) { + sqsEvents = Object.keys(sqsConfig.EVENTS).filter((e) => sqsConfig.EVENTS[e]); + } else { + const instanceSqs = await this.get(instanceName); + if (instanceSqs?.enabled && Array.isArray(instanceSqs?.events)) { + sqsEvents = instanceSqs?.events; + } + } + + if (Array.isArray(sqsEvents) && sqsEvents.includes(we)) { + const prefixName = sqsConfig.GLOBAL_ENABLED ? sqsConfig.GLOBAL_PREFIX_NAME : instanceName; + const eventFormatted = + sqsConfig.GLOBAL_ENABLED && sqsConfig.GLOBAL_FORCE_SINGLE_QUEUE + ? 'singlequeue' + : `${event.replace('.', '_').toLowerCase()}`; + const queueName = `${prefixName}_${eventFormatted}.fifo`; + const sqsUrl = `https://sqs.${sqsConfig.REGION}.amazonaws.com/${sqsConfig.ACCOUNT_ID}/${queueName}`; + + const message = { + ...(extra ?? {}), + event, + instance: instanceName, + dataType: 'json', + data, + server: serverConfig.NAME, + server_url: serverUrl, + date_time: dateTime, + sender, + apikey: apiKey, + }; + + const jsonStr = JSON.stringify(message); + const size = Buffer.byteLength(jsonStr, 'utf8'); + if (size > sqsConfig.MAX_PAYLOAD_SIZE) { + if (!configService.get('S3').ENABLE) { + this.logger.error( + `${instanceName} - ${eventFormatted} - SQS ignored: payload (${size} bytes) exceeds SQS size limit (${sqsConfig.MAX_PAYLOAD_SIZE} bytes) and S3 storage is not enabled.`, + ); + return; + } + + const buffer = Buffer.from(jsonStr, 'utf8'); + const fullName = `messages/${instanceName}_${eventFormatted}_${Date.now()}.json`; + + await s3Service.uploadFile(fullName, buffer, size, { + 'Content-Type': 'application/json', + 'Cache-Control': 'no-store', }); + + const fileUrl = await s3Service.getObjectUrl(fullName); + + message.data = { fileUrl }; + message.dataType = 's3'; } + + const messageGroupId = sqsConfig.GLOBAL_ENABLED + ? `${serverConfig.NAME}-${eventFormatted}-${instanceName}` + : 'evolution'; + const isGlobalEnabled = sqsConfig.GLOBAL_ENABLED; + const params = { + MessageBody: JSON.stringify(message), + MessageGroupId: messageGroupId, + QueueUrl: sqsUrl, + ...(!isGlobalEnabled && { + MessageDeduplicationId: `${instanceName}_${eventFormatted}_${Date.now()}`, + }), + }; + + this.sqs.sendMessage(params, (err) => { + if (err) { + this.logger.error({ + local: `${origin}.sendData-SQS`, + params: JSON.stringify(message), + sqsUrl: sqsUrl, + message: err?.message, + hostName: err?.hostname, + code: err?.code, + stack: err?.stack, + name: err?.name, + url: queueName, + server_url: serverUrl, + }); + } else if (configService.get('LOG').LEVEL.includes('WEBHOOKS')) { + const logData = { + local: `${origin}.sendData-SQS`, + ...message, + }; + + this.logger.log(logData); + } + }); } } } - private async saveQueues(instanceName: string, events: string[], enable: boolean) { + private async saveQueues(prefixName: string, events: string[], enable: boolean) { if (enable) { - const eventsFinded = await this.listQueuesByInstance(instanceName); + const sqsConfig = configService.get('SQS'); + const eventsFinded = await this.listQueues(prefixName); console.log('eventsFinded', eventsFinded); for (const event of events) { - const normalizedEvent = event.toLowerCase(); - + const normalizedEvent = + sqsConfig.GLOBAL_ENABLED && sqsConfig.GLOBAL_FORCE_SINGLE_QUEUE ? 'singlequeue' : event.toLowerCase(); if (eventsFinded.includes(normalizedEvent)) { this.logger.info(`A queue para o evento "${normalizedEvent}" já existe. Ignorando criação.`); continue; } - const queueName = `${instanceName}_${normalizedEvent}.fifo`; - + const queueName = `${prefixName}_${normalizedEvent}.fifo`; try { + const isGlobalEnabled = sqsConfig.GLOBAL_ENABLED; const createCommand = new CreateQueueCommand({ QueueName: queueName, Attributes: { FifoQueue: 'true', + ...(isGlobalEnabled && { ContentBasedDeduplication: 'true' }), }, }); + const data = await this.sqs.send(createCommand); this.logger.info(`Queue ${queueName} criada: ${data.QueueUrl}`); } catch (err: any) { this.logger.error(`Erro ao criar queue ${queueName}: ${err.message}`); } + + if (sqsConfig.GLOBAL_ENABLED && sqsConfig.GLOBAL_FORCE_SINGLE_QUEUE) { + break; + } } } } - private async listQueuesByInstance(instanceName: string) { + private async listQueues(prefixName: string) { let existingQueues: string[] = []; + try { const listCommand = new ListQueuesCommand({ - QueueNamePrefix: `${instanceName}_`, + QueueNamePrefix: `${prefixName}_`, }); + const listData = await this.sqs.send(listCommand); if (listData.QueueUrls && listData.QueueUrls.length > 0) { // Extrai o nome da fila a partir da URL @@ -201,7 +260,7 @@ export class SqsController extends EventController implements EventControllerInt }); } } catch (error: any) { - this.logger.error(`Erro ao listar filas para a instância ${instanceName}: ${error.message}`); + this.logger.error(`Erro ao listar filas para ${prefixName}: ${error.message}`); return; } @@ -209,8 +268,8 @@ export class SqsController extends EventController implements EventControllerInt return existingQueues .map((queueName) => { // Espera-se que o nome seja `${instanceName}_${event}.fifo` - if (queueName.startsWith(`${instanceName}_`) && queueName.endsWith('.fifo')) { - return queueName.substring(instanceName.length + 1, queueName.length - 5).toLowerCase(); + if (queueName.startsWith(`${prefixName}_`) && queueName.endsWith('.fifo')) { + return queueName.substring(prefixName.length + 1, queueName.length - 5).toLowerCase(); } return ''; }) @@ -218,15 +277,15 @@ export class SqsController extends EventController implements EventControllerInt } // Para uma futura feature de exclusão forçada das queues - private async removeQueuesByInstance(instanceName: string) { + private async removeQueuesByInstance(prefixName: string) { try { const listCommand = new ListQueuesCommand({ - QueueNamePrefix: `${instanceName}_`, + QueueNamePrefix: `${prefixName}_`, }); const listData = await this.sqs.send(listCommand); if (!listData.QueueUrls || listData.QueueUrls.length === 0) { - this.logger.info(`No queues found for instance ${instanceName}`); + this.logger.info(`No queues found for ${prefixName}`); return; } @@ -240,7 +299,7 @@ export class SqsController extends EventController implements EventControllerInt } } } catch (err: any) { - this.logger.error(`Error listing queues for instance ${instanceName}: ${err.message}`); + this.logger.error(`Error listing queues for ${prefixName}: ${err.message}`); } } } diff --git a/src/api/integrations/event/webhook/webhook.controller.ts b/src/api/integrations/event/webhook/webhook.controller.ts index bd4e5fe01..7f1dd8dc0 100644 --- a/src/api/integrations/event/webhook/webhook.controller.ts +++ b/src/api/integrations/event/webhook/webhook.controller.ts @@ -65,6 +65,7 @@ export class WebhookController extends EventController implements EventControlle apiKey, local, integration, + extra, }: EmitData): Promise { if (integration && !integration.includes('webhook')) { return; @@ -90,6 +91,7 @@ export class WebhookController extends EventController implements EventControlle const regex = /^(https?:\/\/)/; const webhookData = { + ...(extra ?? {}), event, instance: instanceName, data, diff --git a/src/api/integrations/event/websocket/websocket.controller.ts b/src/api/integrations/event/websocket/websocket.controller.ts index 3f4afd9b1..3c763f08d 100644 --- a/src/api/integrations/event/websocket/websocket.controller.ts +++ b/src/api/integrations/event/websocket/websocket.controller.ts @@ -31,11 +31,17 @@ export class WebsocketController extends EventController implements EventControl const params = new URLSearchParams(url.search); const { remoteAddress } = req.socket; - const isLocalhost = - remoteAddress === '127.0.0.1' || remoteAddress === '::1' || remoteAddress === '::ffff:127.0.0.1'; - - // Permite conexões internas do Socket.IO (EIO=4 é o Engine.IO v4) - if (params.has('EIO') && isLocalhost) { + const websocketConfig = configService.get('WEBSOCKET'); + const allowedHosts = websocketConfig.ALLOWED_HOSTS || '127.0.0.1,::1,::ffff:127.0.0.1'; + const allowAllHosts = allowedHosts.trim() === '*'; + const isAllowedHost = + allowAllHosts || + allowedHosts + .split(',') + .map((h) => h.trim()) + .includes(remoteAddress); + + if (params.has('EIO') && isAllowedHost) { return callback(null, true); } @@ -112,6 +118,7 @@ export class WebsocketController extends EventController implements EventControl sender, apiKey, integration, + extra, }: EmitData): Promise { if (integration && !integration.includes('websocket')) { return; @@ -124,6 +131,7 @@ export class WebsocketController extends EventController implements EventControl const configEv = event.replace(/[.-]/gm, '_').toUpperCase(); const logEnabled = configService.get('LOG').LEVEL.includes('WEBSOCKET'); const message = { + ...(extra ?? {}), event, instance: instanceName, data, diff --git a/src/api/integrations/storage/s3/libs/minio.server.ts b/src/api/integrations/storage/s3/libs/minio.server.ts index 30c81876e..47145a4cb 100644 --- a/src/api/integrations/storage/s3/libs/minio.server.ts +++ b/src/api/integrations/storage/s3/libs/minio.server.ts @@ -26,14 +26,14 @@ const minioClient = (() => { } })(); -const bucketName = process.env.S3_BUCKET; +const bucketName = BUCKET.BUCKET_NAME; const bucketExists = async () => { if (minioClient) { try { const list = await minioClient.listBuckets(); return list.find((bucket) => bucket.name === bucketName); - } catch (error) { + } catch { return false; } } diff --git a/src/api/routes/business.router.ts b/src/api/routes/business.router.ts index 1e510a4ff..faca7b33f 100644 --- a/src/api/routes/business.router.ts +++ b/src/api/routes/business.router.ts @@ -1,6 +1,7 @@ import { RouterBroker } from '@api/abstract/abstract.router'; import { NumberDto } from '@api/dto/chat.dto'; import { businessController } from '@api/server.module'; +import { createMetaErrorResponse } from '@utils/errorResponse'; import { catalogSchema, collectionsSchema } from '@validate/validate.schema'; import { RequestHandler, Router } from 'express'; @@ -11,25 +12,43 @@ export class BusinessRouter extends RouterBroker { super(); this.router .post(this.routerPath('getCatalog'), ...guards, async (req, res) => { - const response = await this.dataValidate({ - request: req, - schema: catalogSchema, - ClassRef: NumberDto, - execute: (instance, data) => businessController.fetchCatalog(instance, data), - }); - - return res.status(HttpStatus.OK).json(response); + try { + const response = await this.dataValidate({ + request: req, + schema: catalogSchema, + ClassRef: NumberDto, + execute: (instance, data) => businessController.fetchCatalog(instance, data), + }); + + return res.status(HttpStatus.OK).json(response); + } catch (error) { + // Log error for debugging + console.error('Business catalog error:', error); + + // Use utility function to create standardized error response + const errorResponse = createMetaErrorResponse(error, 'business_catalog'); + return res.status(errorResponse.status).json(errorResponse); + } }) .post(this.routerPath('getCollections'), ...guards, async (req, res) => { - const response = await this.dataValidate({ - request: req, - schema: collectionsSchema, - ClassRef: NumberDto, - execute: (instance, data) => businessController.fetchCollections(instance, data), - }); - - return res.status(HttpStatus.OK).json(response); + try { + const response = await this.dataValidate({ + request: req, + schema: collectionsSchema, + ClassRef: NumberDto, + execute: (instance, data) => businessController.fetchCollections(instance, data), + }); + + return res.status(HttpStatus.OK).json(response); + } catch (error) { + // Log error for debugging + console.error('Business collections error:', error); + + // Use utility function to create standardized error response + const errorResponse = createMetaErrorResponse(error, 'business_collections'); + return res.status(errorResponse.status).json(errorResponse); + } }); } diff --git a/src/api/routes/index.router.ts b/src/api/routes/index.router.ts index 48954ea01..45c43fca5 100644 --- a/src/api/routes/index.router.ts +++ b/src/api/routes/index.router.ts @@ -5,9 +5,10 @@ import { ChannelRouter } from '@api/integrations/channel/channel.router'; import { ChatbotRouter } from '@api/integrations/chatbot/chatbot.router'; import { EventRouter } from '@api/integrations/event/event.router'; import { StorageRouter } from '@api/integrations/storage/storage.router'; -import { configService } from '@config/env.config'; +import { waMonitor } from '@api/server.module'; +import { configService, Database, Facebook } from '@config/env.config'; import { fetchLatestWaWebVersion } from '@utils/fetchLatestWaWebVersion'; -import { Router } from 'express'; +import { NextFunction, Request, Response, Router } from 'express'; import fs from 'fs'; import mimeTypes from 'mime-types'; import path from 'path'; @@ -36,23 +37,154 @@ enum HttpStatus { const router: Router = Router(); const serverConfig = configService.get('SERVER'); +const databaseConfig = configService.get('DATABASE'); const guards = [instanceExistsGuard, instanceLoggedGuard, authGuard['apikey']]; const telemetry = new Telemetry(); const packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf8')); +// Middleware for metrics IP whitelist +const metricsIPWhitelist = (req: Request, res: Response, next: NextFunction) => { + const metricsConfig = configService.get('METRICS'); + const allowedIPs = metricsConfig.ALLOWED_IPS?.split(',').map((ip) => ip.trim()) || ['127.0.0.1']; + const clientIPs = [ + req.ip, + req.connection.remoteAddress, + req.socket.remoteAddress, + req.headers['x-forwarded-for'], + ].filter((ip) => ip !== undefined); + + if (allowedIPs.filter((ip) => clientIPs.includes(ip)) === 0) { + return res.status(403).send('Forbidden: IP not allowed'); + } + + next(); +}; + +// Middleware for metrics Basic Authentication +const metricsBasicAuth = (req: Request, res: Response, next: NextFunction) => { + const metricsConfig = configService.get('METRICS'); + const metricsUser = metricsConfig.USER; + const metricsPass = metricsConfig.PASSWORD; + + if (!metricsUser || !metricsPass) { + return res.status(500).send('Metrics authentication not configured'); + } + + const auth = req.get('Authorization'); + if (!auth || !auth.startsWith('Basic ')) { + res.set('WWW-Authenticate', 'Basic realm="Evolution API Metrics"'); + return res.status(401).send('Authentication required'); + } + + const credentials = Buffer.from(auth.slice(6), 'base64').toString(); + const [user, pass] = credentials.split(':'); + + if (user !== metricsUser || pass !== metricsPass) { + return res.status(401).send('Invalid credentials'); + } + + next(); +}; + +// Expose Prometheus metrics when enabled by env flag +const metricsConfig = configService.get('METRICS'); +if (metricsConfig.ENABLED) { + const metricsMiddleware = []; + + // Add IP whitelist if configured + if (metricsConfig.ALLOWED_IPS) { + metricsMiddleware.push(metricsIPWhitelist); + } + + // Add Basic Auth if required + if (metricsConfig.AUTH_REQUIRED) { + metricsMiddleware.push(metricsBasicAuth); + } + + router.get('/metrics', ...metricsMiddleware, async (req, res) => { + res.set('Content-Type', 'text/plain; version=0.0.4; charset=utf-8'); + res.set('Cache-Control', 'no-cache, no-store, must-revalidate'); + + const escapeLabel = (value: unknown) => + String(value ?? '') + .replace(/\\/g, '\\\\') + .replace(/\n/g, '\\n') + .replace(/"/g, '\\"'); + + const lines: string[] = []; + + const clientName = databaseConfig.CONNECTION.CLIENT_NAME || 'unknown'; + const serverUrl = serverConfig.URL || ''; + + // environment info + lines.push('# HELP evolution_environment_info Environment information'); + lines.push('# TYPE evolution_environment_info gauge'); + lines.push( + `evolution_environment_info{version="${escapeLabel(packageJson.version)}",clientName="${escapeLabel( + clientName, + )}",serverUrl="${escapeLabel(serverUrl)}"} 1`, + ); + + const instances = (waMonitor && waMonitor.waInstances) || {}; + const instanceEntries = Object.entries(instances); + + // total instances + lines.push('# HELP evolution_instances_total Total number of instances'); + lines.push('# TYPE evolution_instances_total gauge'); + lines.push(`evolution_instances_total ${instanceEntries.length}`); + + // per-instance status + lines.push('# HELP evolution_instance_up 1 if instance state is open, else 0'); + lines.push('# TYPE evolution_instance_up gauge'); + lines.push('# HELP evolution_instance_state Instance state as a labelled metric'); + lines.push('# TYPE evolution_instance_state gauge'); + + for (const [name, instance] of instanceEntries) { + const state = instance?.connectionStatus?.state || 'unknown'; + const integration = instance?.integration || ''; + const up = state === 'open' ? 1 : 0; + + lines.push( + `evolution_instance_up{instance="${escapeLabel(name)}",integration="${escapeLabel(integration)}"} ${up}`, + ); + lines.push( + `evolution_instance_state{instance="${escapeLabel(name)}",integration="${escapeLabel( + integration, + )}",state="${escapeLabel(state)}"} 1`, + ); + } + + res.send(lines.join('\n') + '\n'); + }); +} + if (!serverConfig.DISABLE_MANAGER) router.use('/manager', new ViewsRouter().router); router.get('/assets/*', (req, res) => { const fileName = req.params[0]; + + // Security: Reject paths containing traversal patterns + if (!fileName || fileName.includes('..') || fileName.includes('\\') || path.isAbsolute(fileName)) { + return res.status(403).send('Forbidden'); + } + const basePath = path.join(process.cwd(), 'manager', 'dist'); + const assetsPath = path.join(basePath, 'assets'); + const filePath = path.join(assetsPath, fileName); - const filePath = path.join(basePath, 'assets/', fileName); + // Security: Ensure the resolved path is within the assets directory + const resolvedPath = path.resolve(filePath); + const resolvedAssetsPath = path.resolve(assetsPath); + + if (!resolvedPath.startsWith(resolvedAssetsPath + path.sep) && resolvedPath !== resolvedAssetsPath) { + return res.status(403).send('Forbidden'); + } - if (fs.existsSync(filePath)) { - res.set('Content-Type', mimeTypes.lookup(filePath) || 'text/css'); - res.send(fs.readFileSync(filePath)); + if (fs.existsSync(resolvedPath)) { + res.set('Content-Type', mimeTypes.lookup(resolvedPath) || 'text/css'); + res.send(fs.readFileSync(resolvedPath)); } else { res.status(404).send('File not found'); } @@ -66,19 +198,20 @@ router status: HttpStatus.OK, message: 'Welcome to the Evolution API, it is working!', version: packageJson.version, - clientName: process.env.DATABASE_CONNECTION_CLIENT_NAME, + clientName: databaseConfig.CONNECTION.CLIENT_NAME, manager: !serverConfig.DISABLE_MANAGER ? `${req.protocol}://${req.get('host')}/manager` : undefined, documentation: `https://doc.evolution-api.com`, whatsappWebVersion: (await fetchLatestWaWebVersion({})).version.join('.'), }); }) .post('/verify-creds', authGuard['apikey'], async (req, res) => { + const facebookConfig = configService.get('FACEBOOK'); return res.status(HttpStatus.OK).json({ status: HttpStatus.OK, message: 'Credentials are valid', - facebookAppId: process.env.FACEBOOK_APP_ID, - facebookConfigId: process.env.FACEBOOK_CONFIG_ID, - facebookUserToken: process.env.FACEBOOK_USER_TOKEN, + facebookAppId: facebookConfig.APP_ID, + facebookConfigId: facebookConfig.CONFIG_ID, + facebookUserToken: facebookConfig.USER_TOKEN, }); }) .use('/instance', new InstanceRouter(configService, ...guards).router) diff --git a/src/api/routes/template.router.ts b/src/api/routes/template.router.ts index b77b7d834..249019a0c 100644 --- a/src/api/routes/template.router.ts +++ b/src/api/routes/template.router.ts @@ -1,8 +1,11 @@ import { RouterBroker } from '@api/abstract/abstract.router'; import { InstanceDto } from '@api/dto/instance.dto'; -import { TemplateDto } from '@api/dto/template.dto'; +import { TemplateDeleteDto, TemplateDto, TemplateEditDto } from '@api/dto/template.dto'; import { templateController } from '@api/server.module'; import { ConfigService } from '@config/env.config'; +import { createMetaErrorResponse } from '@utils/errorResponse'; +import { templateDeleteSchema } from '@validate/templateDelete.schema'; +import { templateEditSchema } from '@validate/templateEdit.schema'; import { instanceSchema, templateSchema } from '@validate/validate.schema'; import { RequestHandler, Router } from 'express'; @@ -16,24 +19,74 @@ export class TemplateRouter extends RouterBroker { super(); this.router .post(this.routerPath('create'), ...guards, async (req, res) => { - const response = await this.dataValidate({ - request: req, - schema: templateSchema, - ClassRef: TemplateDto, - execute: (instance, data) => templateController.createTemplate(instance, data), - }); - - res.status(HttpStatus.CREATED).json(response); + try { + const response = await this.dataValidate({ + request: req, + schema: templateSchema, + ClassRef: TemplateDto, + execute: (instance, data) => templateController.createTemplate(instance, data), + }); + + res.status(HttpStatus.CREATED).json(response); + } catch (error) { + // Log error for debugging + console.error('Template creation error:', error); + + // Use utility function to create standardized error response + const errorResponse = createMetaErrorResponse(error, 'template_creation'); + res.status(errorResponse.status).json(errorResponse); + } + }) + .post(this.routerPath('edit'), ...guards, async (req, res) => { + try { + const response = await this.dataValidate({ + request: req, + schema: templateEditSchema, + ClassRef: TemplateEditDto, + execute: (instance, data) => templateController.editTemplate(instance, data), + }); + + res.status(HttpStatus.OK).json(response); + } catch (error) { + console.error('Template edit error:', error); + const errorResponse = createMetaErrorResponse(error, 'template_edit'); + res.status(errorResponse.status).json(errorResponse); + } + }) + .delete(this.routerPath('delete'), ...guards, async (req, res) => { + try { + const response = await this.dataValidate({ + request: req, + schema: templateDeleteSchema, + ClassRef: TemplateDeleteDto, + execute: (instance, data) => templateController.deleteTemplate(instance, data), + }); + + res.status(HttpStatus.OK).json(response); + } catch (error) { + console.error('Template delete error:', error); + const errorResponse = createMetaErrorResponse(error, 'template_delete'); + res.status(errorResponse.status).json(errorResponse); + } }) .get(this.routerPath('find'), ...guards, async (req, res) => { - const response = await this.dataValidate({ - request: req, - schema: instanceSchema, - ClassRef: InstanceDto, - execute: (instance) => templateController.findTemplate(instance), - }); - - res.status(HttpStatus.OK).json(response); + try { + const response = await this.dataValidate({ + request: req, + schema: instanceSchema, + ClassRef: InstanceDto, + execute: (instance) => templateController.findTemplate(instance), + }); + + res.status(HttpStatus.OK).json(response); + } catch (error) { + // Log error for debugging + console.error('Template find error:', error); + + // Use utility function to create standardized error response + const errorResponse = createMetaErrorResponse(error, 'template_find'); + res.status(errorResponse.status).json(errorResponse); + } }); } diff --git a/src/api/server.module.ts b/src/api/server.module.ts index 385fe17b1..668b9e272 100644 --- a/src/api/server.module.ts +++ b/src/api/server.module.ts @@ -82,7 +82,7 @@ const proxyService = new ProxyService(waMonitor); export const proxyController = new ProxyController(proxyService, waMonitor); const chatwootService = new ChatwootService(waMonitor, configService, prismaRepository, chatwootCache); -export const chatwootController = new ChatwootController(chatwootService, configService, prismaRepository); +export const chatwootController = new ChatwootController(chatwootService, configService); const settingsService = new SettingsService(waMonitor); export const settingsController = new SettingsController(settingsService); diff --git a/src/api/services/channel.service.ts b/src/api/services/channel.service.ts index dc754ab6c..56bec0802 100644 --- a/src/api/services/channel.service.ts +++ b/src/api/services/channel.service.ts @@ -9,7 +9,7 @@ import { TypebotService } from '@api/integrations/chatbot/typebot/services/typeb import { PrismaRepository, Query } from '@api/repository/repository.service'; import { eventManager, waMonitor } from '@api/server.module'; import { Events, wa } from '@api/types/wa.types'; -import { Auth, Chatwoot, ConfigService, HttpServer } from '@config/env.config'; +import { Auth, Chatwoot, ConfigService, HttpServer, Proxy } from '@config/env.config'; import { Logger } from '@config/logger.config'; import { NotFoundException } from '@exceptions'; import { Contact, Message, Prisma } from '@prisma/client'; @@ -60,6 +60,7 @@ export class ChannelStartupService { this.instance.number = instance.number; this.instance.token = instance.token; this.instance.businessId = instance.businessId; + this.instance.ownerJid = instance.ownerJid; if (this.configService.get('CHATWOOT').ENABLED && this.localChatwoot?.enabled) { this.chatwootService.eventWhatsapp( @@ -364,13 +365,14 @@ export class ChannelStartupService { public async loadProxy() { this.localProxy.enabled = false; - if (process.env.PROXY_HOST) { + const proxyConfig = this.configService.get('PROXY'); + if (proxyConfig.HOST) { this.localProxy.enabled = true; - this.localProxy.host = process.env.PROXY_HOST; - this.localProxy.port = process.env.PROXY_PORT || '80'; - this.localProxy.protocol = process.env.PROXY_PROTOCOL || 'http'; - this.localProxy.username = process.env.PROXY_USERNAME; - this.localProxy.password = process.env.PROXY_PASSWORD; + this.localProxy.host = proxyConfig.HOST; + this.localProxy.port = proxyConfig.PORT || '80'; + this.localProxy.protocol = proxyConfig.PROTOCOL || 'http'; + this.localProxy.username = proxyConfig.USERNAME; + this.localProxy.password = proxyConfig.PASSWORD; } const data = await this.prismaRepository.proxy.findUnique({ @@ -430,7 +432,13 @@ export class ChannelStartupService { return data; } - public async sendDataWebhook(event: Events, data: T, local = true, integration?: string[]) { + public async sendDataWebhook( + event: Events, + data: T, + local = true, + integration?: string[], + extra?: Record, + ) { const serverUrl = this.configService.get('SERVER').URL; const tzoffset = new Date().getTimezoneOffset() * 60000; //offset in milliseconds const localISOTime = new Date(Date.now() - tzoffset).toISOString(); @@ -451,6 +459,7 @@ export class ChannelStartupService { apiKey: expose && instanceApikey ? instanceApikey : null, local, integration, + extra, }); } @@ -489,20 +498,23 @@ export class ChannelStartupService { } public async fetchContacts(query: Query) { - const remoteJid = query?.where?.remoteJid - ? query?.where?.remoteJid.includes('@') - ? query.where?.remoteJid - : createJid(query.where?.remoteJid) - : null; - - const where = { + const where: any = { instanceId: this.instanceId, }; - if (remoteJid) { + if (query?.where?.remoteJid) { + const remoteJid = query.where.remoteJid.includes('@') ? query.where.remoteJid : createJid(query.where.remoteJid); where['remoteJid'] = remoteJid; } + if (query?.where?.id) { + where['id'] = query.where.id; + } + + if (query?.where?.pushName) { + where['pushName'] = query.where.pushName; + } + const contactFindManyArgs: Prisma.ContactFindManyArgs = { where, }; @@ -531,14 +543,12 @@ export class ChannelStartupService { public cleanMessageData(message: any) { if (!message) return message; - const cleanedMessage = { ...message }; - const mediaUrl = cleanedMessage.message.mediaUrl; - - delete cleanedMessage.message.base64; - if (cleanedMessage.message) { + const { mediaUrl } = cleanedMessage.message; + delete cleanedMessage.message.base64; + // Limpa imageMessage if (cleanedMessage.message.imageMessage) { cleanedMessage.message.imageMessage = { @@ -580,9 +590,9 @@ export class ChannelStartupService { name: cleanedMessage.message.documentWithCaptionMessage.name, }; } - } - if (mediaUrl) cleanedMessage.message.mediaUrl = mediaUrl; + if (mediaUrl) cleanedMessage.message.mediaUrl = mediaUrl; + } return cleanedMessage; } @@ -825,7 +835,7 @@ export class ChannelStartupService { const msg = message.message; // Se só tem messageContextInfo, não é mídia válida - if (Object.keys(msg).length === 1 && 'messageContextInfo' in msg) { + if (Object.keys(msg).length === 1 && Object.prototype.hasOwnProperty.call(msg, 'messageContextInfo')) { return false; } diff --git a/src/api/services/monitor.service.ts b/src/api/services/monitor.service.ts index 90962dcb2..438530b57 100644 --- a/src/api/services/monitor.service.ts +++ b/src/api/services/monitor.service.ts @@ -29,6 +29,8 @@ export class WAMonitoringService { Object.assign(this.db, configService.get('DATABASE')); Object.assign(this.redis, configService.get('CACHE')); + + (this as any).providerSession = Object.freeze(configService.get('PROVIDER')); } private readonly db: Partial = {}; @@ -36,25 +38,37 @@ export class WAMonitoringService { private readonly logger = new Logger('WAMonitoringService'); public readonly waInstances: Record = {}; + private readonly delInstanceTimeouts: Record = {}; - private readonly providerSession = Object.freeze(this.configService.get('PROVIDER')); + private readonly providerSession: ProviderSession; public delInstanceTime(instance: string) { const time = this.configService.get('DEL_INSTANCE'); if (typeof time === 'number' && time > 0) { - setTimeout( + // Clear previous timeout if exists + if (this.delInstanceTimeouts[instance]) { + clearTimeout(this.delInstanceTimeouts[instance]); + } + + // Set new timeout and store reference + this.delInstanceTimeouts[instance] = setTimeout( async () => { - if (this.waInstances[instance]?.connectionStatus?.state !== 'open') { - if (this.waInstances[instance]?.connectionStatus?.state === 'connecting') { - if ((await this.waInstances[instance].integration) === Integration.WHATSAPP_BAILEYS) { - await this.waInstances[instance]?.client?.logout('Log out instance: ' + instance); - this.waInstances[instance]?.client?.ws?.close(); - this.waInstances[instance]?.client?.end(undefined); + try { + if (this.waInstances[instance]?.connectionStatus?.state !== 'open') { + if (this.waInstances[instance]?.connectionStatus?.state === 'connecting') { + if ((await this.waInstances[instance].integration) === Integration.WHATSAPP_BAILEYS) { + await this.waInstances[instance]?.client?.logout('Log out instance: ' + instance); + this.waInstances[instance]?.client?.ws?.close(); + this.waInstances[instance]?.client?.end(undefined); + } + this.eventEmitter.emit('remove.instance', instance, 'inner'); + } else { + this.eventEmitter.emit('remove.instance', instance, 'inner'); } - this.eventEmitter.emit('remove.instance', instance, 'inner'); - } else { - this.eventEmitter.emit('remove.instance', instance, 'inner'); } + } finally { + // Clean up timeout reference + delete this.delInstanceTimeouts[instance]; } }, 1000 * 60 * time, @@ -62,6 +76,13 @@ export class WAMonitoringService { } } + public clearDelInstanceTime(instance: string) { + if (this.delInstanceTimeouts[instance]) { + clearTimeout(this.delInstanceTimeouts[instance]); + delete this.delInstanceTimeouts[instance]; + } + } + public async instanceInfo(instanceNames?: string[]): Promise { if (instanceNames && instanceNames.length > 0) { const inexistentInstances = instanceNames ? instanceNames.filter((instance) => !this.waInstances[instance]) : []; @@ -269,9 +290,19 @@ export class WAMonitoringService { token: instanceData.token, number: instanceData.number, businessId: instanceData.businessId, + ownerJid: instanceData.ownerJid, }); - await instance.connectToWhatsapp(); + if (instanceData.connectionStatus === 'open' || instanceData.connectionStatus === 'connecting') { + this.logger.info( + `Auto-connecting instance "${instanceData.instanceName}" (status: ${instanceData.connectionStatus})`, + ); + await instance.connectToWhatsapp(); + } else { + this.logger.info( + `Skipping auto-connect for instance "${instanceData.instanceName}" (status: ${instanceData.connectionStatus || 'close'})`, + ); + } this.waInstances[instanceData.instanceName] = instance; } @@ -297,6 +328,7 @@ export class WAMonitoringService { token: instanceData.token, number: instanceData.number, businessId: instanceData.businessId, + connectionStatus: instanceData.connectionStatus as any, // Pass connection status }; this.setInstance(instance); @@ -325,6 +357,8 @@ export class WAMonitoringService { token: instance.token, number: instance.number, businessId: instance.businessId, + ownerJid: instance.ownerJid, + connectionStatus: instance.connectionStatus as any, // Pass connection status }); }), ); @@ -349,6 +383,7 @@ export class WAMonitoringService { integration: instance.integration, token: instance.token, businessId: instance.businessId, + connectionStatus: instance.connectionStatus as any, // Pass connection status }); }), ); @@ -359,6 +394,8 @@ export class WAMonitoringService { try { await this.waInstances[instanceName]?.sendDataWebhook(Events.REMOVE_INSTANCE, null); + this.clearDelInstanceTime(instanceName); + this.cleaningUp(instanceName); this.cleaningStoreData(instanceName); } finally { @@ -375,6 +412,8 @@ export class WAMonitoringService { try { await this.waInstances[instanceName]?.sendDataWebhook(Events.LOGOUT_INSTANCE, null); + this.clearDelInstanceTime(instanceName); + if (this.configService.get('CHATWOOT').ENABLED) { this.waInstances[instanceName]?.clearCacheChatwoot(); } diff --git a/src/api/services/proxy.service.ts b/src/api/services/proxy.service.ts index 69ba87b41..a1e5b2100 100644 --- a/src/api/services/proxy.service.ts +++ b/src/api/services/proxy.service.ts @@ -25,7 +25,7 @@ export class ProxyService { } return result; - } catch (error) { + } catch { return null; } } diff --git a/src/api/services/settings.service.ts b/src/api/services/settings.service.ts index 5b7ab1b83..da477c46b 100644 --- a/src/api/services/settings.service.ts +++ b/src/api/services/settings.service.ts @@ -24,7 +24,7 @@ export class SettingsService { } return result; - } catch (error) { + } catch { return null; } } diff --git a/src/api/services/template.service.ts b/src/api/services/template.service.ts index 949f71c78..5bf0ba5d6 100644 --- a/src/api/services/template.service.ts +++ b/src/api/services/template.service.ts @@ -60,6 +60,13 @@ export class TemplateService { const response = await this.requestTemplate(postData, 'POST'); if (!response || response.error) { + // If there's an error from WhatsApp API, throw it with the real error data + if (response && response.error) { + // Create an error object that includes the template field for Meta errors + const metaError = new Error(response.error.message || 'WhatsApp API Error'); + (metaError as any).template = response.error; + throw metaError; + } throw new Error('Error to create template'); } @@ -75,9 +82,81 @@ export class TemplateService { return template; } catch (error) { - this.logger.error(error); - throw new Error('Error to create template'); + this.logger.error('Error in create template: ' + error); + // Propagate the real error instead of "engolindo" it + throw error; + } + } + + public async edit( + instance: InstanceDto, + data: { templateId: string; category?: string; components?: any; allowCategoryChange?: boolean; ttl?: number }, + ) { + const getInstance = await this.waMonitor.waInstances[instance.instanceName].instance; + if (!getInstance) { + throw new Error('Instance not found'); + } + + this.businessId = getInstance.businessId; + this.token = getInstance.token; + + const payload: Record = {}; + if (typeof data.category === 'string') payload.category = data.category; + if (typeof data.allowCategoryChange === 'boolean') payload.allow_category_change = data.allowCategoryChange; + if (typeof data.ttl === 'number') payload.time_to_live = data.ttl; + if (data.components) payload.components = data.components; + + const response = await this.requestEditTemplate(data.templateId, payload); + + if (!response || response.error) { + if (response && response.error) { + const metaError = new Error(response.error.message || 'WhatsApp API Error'); + (metaError as any).template = response.error; + throw metaError; + } + throw new Error('Error to edit template'); } + + return response; + } + + public async delete(instance: InstanceDto, data: { name: string; hsmId?: string }) { + const getInstance = await this.waMonitor.waInstances[instance.instanceName].instance; + if (!getInstance) { + throw new Error('Instance not found'); + } + + this.businessId = getInstance.businessId; + this.token = getInstance.token; + + const response = await this.requestDeleteTemplate({ name: data.name, hsm_id: data.hsmId }); + + if (!response || response.error) { + if (response && response.error) { + const metaError = new Error(response.error.message || 'WhatsApp API Error'); + (metaError as any).template = response.error; + throw metaError; + } + throw new Error('Error to delete template'); + } + + try { + // Best-effort local cleanup of stored template metadata + await this.prismaRepository.template.deleteMany({ + where: { + OR: [ + { name: data.name, instanceId: getInstance.id }, + data.hsmId ? { templateId: data.hsmId, instanceId: getInstance.id } : undefined, + ].filter(Boolean) as any, + }, + }); + } catch (err) { + this.logger.warn( + `Failed to cleanup local template records after delete: ${(err as Error)?.message || String(err)}`, + ); + } + + return response; } private async requestTemplate(data: any, method: string) { @@ -86,6 +165,7 @@ export class TemplateService { const version = this.configService.get('WA_BUSINESS').VERSION; urlServer = `${urlServer}/${version}/${this.businessId}/message_templates`; const headers = { 'Content-Type': 'application/json', Authorization: `Bearer ${this.token}` }; + if (method === 'GET') { const result = await axios.get(urlServer, { headers }); return result.data; @@ -94,8 +174,51 @@ export class TemplateService { return result.data; } } catch (e) { - this.logger.error(e.response.data); - return e.response.data.error; + this.logger.error( + 'WhatsApp API request error: ' + (e.response?.data ? JSON.stringify(e.response?.data) : e.message), + ); + + // Return the complete error response from WhatsApp API + if (e.response?.data) { + return e.response.data; + } + + // If no response data, throw connection error + throw new Error(`Connection error: ${e.message}`); + } + } + + private async requestEditTemplate(templateId: string, data: any) { + try { + let urlServer = this.configService.get('WA_BUSINESS').URL; + const version = this.configService.get('WA_BUSINESS').VERSION; + urlServer = `${urlServer}/${version}/${templateId}`; + const headers = { 'Content-Type': 'application/json', Authorization: `Bearer ${this.token}` }; + const result = await axios.post(urlServer, data, { headers }); + return result.data; + } catch (e) { + this.logger.error( + 'WhatsApp API request error: ' + (e.response?.data ? JSON.stringify(e.response?.data) : e.message), + ); + if (e.response?.data) return e.response.data; + throw new Error(`Connection error: ${e.message}`); + } + } + + private async requestDeleteTemplate(params: { name: string; hsm_id?: string }) { + try { + let urlServer = this.configService.get('WA_BUSINESS').URL; + const version = this.configService.get('WA_BUSINESS').VERSION; + urlServer = `${urlServer}/${version}/${this.businessId}/message_templates`; + const headers = { Authorization: `Bearer ${this.token}` }; + const result = await axios.delete(urlServer, { headers, params }); + return result.data; + } catch (e) { + this.logger.error( + 'WhatsApp API request error: ' + (e.response?.data ? JSON.stringify(e.response?.data) : e.message), + ); + if (e.response?.data) return e.response.data; + throw new Error(`Connection error: ${e.message}`); } } } diff --git a/src/api/types/wa.types.ts b/src/api/types/wa.types.ts index 2bb3dc1e2..8f7c6a390 100644 --- a/src/api/types/wa.types.ts +++ b/src/api/types/wa.types.ts @@ -52,6 +52,7 @@ export declare namespace wa { pairingCode?: string; authState?: { state: AuthenticationState; saveCreds: () => void }; name?: string; + ownerJid?: string; wuid?: string; profileName?: string; profilePictureUrl?: string; diff --git a/src/cache/localcache.ts b/src/cache/localcache.ts index 2aa2007ea..f7769e584 100644 --- a/src/cache/localcache.ts +++ b/src/cache/localcache.ts @@ -53,7 +53,7 @@ export class LocalCache implements ICache { async hGet(key: string, field: string) { try { - const data = LocalCache.localCache.get(this.buildKey(key)) as Object; + const data = LocalCache.localCache.get(this.buildKey(key)) as object; if (data && field in data) { return JSON.parse(data[field], BufferJSON.reviver); @@ -84,7 +84,7 @@ export class LocalCache implements ICache { async hDelete(key: string, field: string) { try { - const data = LocalCache.localCache.get(this.buildKey(key)) as Object; + const data = LocalCache.localCache.get(this.buildKey(key)) as object; if (data && field in data) { delete data[field]; diff --git a/src/config/env.config.ts b/src/config/env.config.ts index c59acd382..7c4e382e7 100644 --- a/src/config/env.config.ts +++ b/src/config/env.config.ts @@ -4,6 +4,7 @@ import dotenv from 'dotenv'; dotenv.config(); export type HttpServer = { + NAME: string; TYPE: 'http' | 'https'; PORT: number; URL: string; @@ -113,15 +114,77 @@ export type Nats = { export type Sqs = { ENABLED: boolean; + GLOBAL_ENABLED: boolean; + GLOBAL_FORCE_SINGLE_QUEUE: boolean; + GLOBAL_PREFIX_NAME: string; ACCESS_KEY_ID: string; SECRET_ACCESS_KEY: string; ACCOUNT_ID: string; REGION: string; + MAX_PAYLOAD_SIZE: number; + EVENTS: { + APPLICATION_STARTUP: boolean; + CALL: boolean; + CHATS_DELETE: boolean; + CHATS_SET: boolean; + CHATS_UPDATE: boolean; + CHATS_UPSERT: boolean; + CONNECTION_UPDATE: boolean; + CONTACTS_SET: boolean; + CONTACTS_UPDATE: boolean; + CONTACTS_UPSERT: boolean; + GROUP_PARTICIPANTS_UPDATE: boolean; + GROUPS_UPDATE: boolean; + GROUPS_UPSERT: boolean; + LABELS_ASSOCIATION: boolean; + LABELS_EDIT: boolean; + LOGOUT_INSTANCE: boolean; + MESSAGES_DELETE: boolean; + MESSAGES_EDITED: boolean; + MESSAGES_SET: boolean; + MESSAGES_UPDATE: boolean; + MESSAGES_UPSERT: boolean; + PRESENCE_UPDATE: boolean; + QRCODE_UPDATED: boolean; + REMOVE_INSTANCE: boolean; + SEND_MESSAGE: boolean; + TYPEBOT_CHANGE_STATUS: boolean; + TYPEBOT_START: boolean; + }; +}; + +export type Kafka = { + ENABLED: boolean; + CLIENT_ID: string; + BROKERS: string[]; + CONNECTION_TIMEOUT: number; + REQUEST_TIMEOUT: number; + GLOBAL_ENABLED: boolean; + CONSUMER_GROUP_ID: string; + TOPIC_PREFIX: string; + NUM_PARTITIONS: number; + REPLICATION_FACTOR: number; + AUTO_CREATE_TOPICS: boolean; + EVENTS: EventsRabbitmq; + SASL?: { + ENABLED: boolean; + MECHANISM: string; + USERNAME: string; + PASSWORD: string; + }; + SSL?: { + ENABLED: boolean; + REJECT_UNAUTHORIZED: boolean; + CA?: string; + KEY?: string; + CERT?: string; + }; }; export type Websocket = { ENABLED: boolean; GLOBAL_EVENTS: boolean; + ALLOWED_HOSTS?: string; }; export type WaBusiness = { @@ -282,9 +345,50 @@ export type S3 = { USE_SSL?: boolean; REGION?: string; SKIP_POLICY?: boolean; + SAVE_VIDEO?: boolean; }; export type CacheConf = { REDIS: CacheConfRedis; LOCAL: CacheConfLocal }; +export type Metrics = { + ENABLED: boolean; + AUTH_REQUIRED: boolean; + USER?: string; + PASSWORD?: string; + ALLOWED_IPS?: string; +}; + +export type Telemetry = { + ENABLED: boolean; + URL?: string; +}; + +export type Proxy = { + HOST?: string; + PORT?: string; + PROTOCOL?: string; + USERNAME?: string; + PASSWORD?: string; +}; + +export type AudioConverter = { + API_URL?: string; + API_KEY?: string; +}; + +export type Facebook = { + APP_ID?: string; + CONFIG_ID?: string; + USER_TOKEN?: string; +}; + +export type Sentry = { + DSN?: string; +}; + +export type EventEmitter = { + MAX_LISTENERS: number; +}; + export type Production = boolean; export interface Env { @@ -296,6 +400,7 @@ export interface Env { RABBITMQ: Rabbitmq; NATS: Nats; SQS: Sqs; + KAFKA: Kafka; WEBSOCKET: Websocket; WA_BUSINESS: WaBusiness; LOG: Log; @@ -316,6 +421,13 @@ export interface Env { CACHE: CacheConf; S3?: S3; AUTHENTICATION: Auth; + METRICS: Metrics; + TELEMETRY: Telemetry; + PROXY: Proxy; + AUDIO_CONVERTER: AudioConverter; + FACEBOOK: Facebook; + SENTRY: Sentry; + EVENT_EMITTER: EventEmitter; PRODUCTION?: Production; } @@ -344,6 +456,7 @@ export class ConfigService { private envProcess(): Env { return { SERVER: { + NAME: process.env?.SERVER_NAME || 'evolution', TYPE: (process.env.SERVER_TYPE as 'http' | 'https') || 'http', PORT: Number.parseInt(process.env.SERVER_PORT) || 8080, URL: process.env.SERVER_URL, @@ -465,14 +578,110 @@ export class ConfigService { }, SQS: { ENABLED: process.env?.SQS_ENABLED === 'true', + GLOBAL_ENABLED: process.env?.SQS_GLOBAL_ENABLED === 'true', + GLOBAL_FORCE_SINGLE_QUEUE: process.env?.SQS_GLOBAL_FORCE_SINGLE_QUEUE === 'true', + GLOBAL_PREFIX_NAME: process.env?.SQS_GLOBAL_PREFIX_NAME || 'global', ACCESS_KEY_ID: process.env.SQS_ACCESS_KEY_ID || '', SECRET_ACCESS_KEY: process.env.SQS_SECRET_ACCESS_KEY || '', ACCOUNT_ID: process.env.SQS_ACCOUNT_ID || '', REGION: process.env.SQS_REGION || '', + MAX_PAYLOAD_SIZE: Number.parseInt(process.env.SQS_MAX_PAYLOAD_SIZE ?? '1048576'), + EVENTS: { + APPLICATION_STARTUP: process.env?.SQS_GLOBAL_APPLICATION_STARTUP === 'true', + CALL: process.env?.SQS_GLOBAL_CALL === 'true', + CHATS_DELETE: process.env?.SQS_GLOBAL_CHATS_DELETE === 'true', + CHATS_SET: process.env?.SQS_GLOBAL_CHATS_SET === 'true', + CHATS_UPDATE: process.env?.SQS_GLOBAL_CHATS_UPDATE === 'true', + CHATS_UPSERT: process.env?.SQS_GLOBAL_CHATS_UPSERT === 'true', + CONNECTION_UPDATE: process.env?.SQS_GLOBAL_CONNECTION_UPDATE === 'true', + CONTACTS_SET: process.env?.SQS_GLOBAL_CONTACTS_SET === 'true', + CONTACTS_UPDATE: process.env?.SQS_GLOBAL_CONTACTS_UPDATE === 'true', + CONTACTS_UPSERT: process.env?.SQS_GLOBAL_CONTACTS_UPSERT === 'true', + GROUP_PARTICIPANTS_UPDATE: process.env?.SQS_GLOBAL_GROUP_PARTICIPANTS_UPDATE === 'true', + GROUPS_UPDATE: process.env?.SQS_GLOBAL_GROUPS_UPDATE === 'true', + GROUPS_UPSERT: process.env?.SQS_GLOBAL_GROUPS_UPSERT === 'true', + LABELS_ASSOCIATION: process.env?.SQS_GLOBAL_LABELS_ASSOCIATION === 'true', + LABELS_EDIT: process.env?.SQS_GLOBAL_LABELS_EDIT === 'true', + LOGOUT_INSTANCE: process.env?.SQS_GLOBAL_LOGOUT_INSTANCE === 'true', + MESSAGES_DELETE: process.env?.SQS_GLOBAL_MESSAGES_DELETE === 'true', + MESSAGES_EDITED: process.env?.SQS_GLOBAL_MESSAGES_EDITED === 'true', + MESSAGES_SET: process.env?.SQS_GLOBAL_MESSAGES_SET === 'true', + MESSAGES_UPDATE: process.env?.SQS_GLOBAL_MESSAGES_UPDATE === 'true', + MESSAGES_UPSERT: process.env?.SQS_GLOBAL_MESSAGES_UPSERT === 'true', + PRESENCE_UPDATE: process.env?.SQS_GLOBAL_PRESENCE_UPDATE === 'true', + QRCODE_UPDATED: process.env?.SQS_GLOBAL_QRCODE_UPDATED === 'true', + REMOVE_INSTANCE: process.env?.SQS_GLOBAL_REMOVE_INSTANCE === 'true', + SEND_MESSAGE: process.env?.SQS_GLOBAL_SEND_MESSAGE === 'true', + TYPEBOT_CHANGE_STATUS: process.env?.SQS_GLOBAL_TYPEBOT_CHANGE_STATUS === 'true', + TYPEBOT_START: process.env?.SQS_GLOBAL_TYPEBOT_START === 'true', + }, + }, + KAFKA: { + ENABLED: process.env?.KAFKA_ENABLED === 'true', + CLIENT_ID: process.env?.KAFKA_CLIENT_ID || 'evolution-api', + BROKERS: process.env?.KAFKA_BROKERS?.split(',') || ['localhost:9092'], + CONNECTION_TIMEOUT: Number.parseInt(process.env?.KAFKA_CONNECTION_TIMEOUT || '3000'), + REQUEST_TIMEOUT: Number.parseInt(process.env?.KAFKA_REQUEST_TIMEOUT || '30000'), + GLOBAL_ENABLED: process.env?.KAFKA_GLOBAL_ENABLED === 'true', + CONSUMER_GROUP_ID: process.env?.KAFKA_CONSUMER_GROUP_ID || 'evolution-api-consumers', + TOPIC_PREFIX: process.env?.KAFKA_TOPIC_PREFIX || 'evolution', + NUM_PARTITIONS: Number.parseInt(process.env?.KAFKA_NUM_PARTITIONS || '1'), + REPLICATION_FACTOR: Number.parseInt(process.env?.KAFKA_REPLICATION_FACTOR || '1'), + AUTO_CREATE_TOPICS: process.env?.KAFKA_AUTO_CREATE_TOPICS === 'true', + EVENTS: { + APPLICATION_STARTUP: process.env?.KAFKA_EVENTS_APPLICATION_STARTUP === 'true', + INSTANCE_CREATE: process.env?.KAFKA_EVENTS_INSTANCE_CREATE === 'true', + INSTANCE_DELETE: process.env?.KAFKA_EVENTS_INSTANCE_DELETE === 'true', + QRCODE_UPDATED: process.env?.KAFKA_EVENTS_QRCODE_UPDATED === 'true', + MESSAGES_SET: process.env?.KAFKA_EVENTS_MESSAGES_SET === 'true', + MESSAGES_UPSERT: process.env?.KAFKA_EVENTS_MESSAGES_UPSERT === 'true', + MESSAGES_EDITED: process.env?.KAFKA_EVENTS_MESSAGES_EDITED === 'true', + MESSAGES_UPDATE: process.env?.KAFKA_EVENTS_MESSAGES_UPDATE === 'true', + MESSAGES_DELETE: process.env?.KAFKA_EVENTS_MESSAGES_DELETE === 'true', + SEND_MESSAGE: process.env?.KAFKA_EVENTS_SEND_MESSAGE === 'true', + SEND_MESSAGE_UPDATE: process.env?.KAFKA_EVENTS_SEND_MESSAGE_UPDATE === 'true', + CONTACTS_SET: process.env?.KAFKA_EVENTS_CONTACTS_SET === 'true', + CONTACTS_UPSERT: process.env?.KAFKA_EVENTS_CONTACTS_UPSERT === 'true', + CONTACTS_UPDATE: process.env?.KAFKA_EVENTS_CONTACTS_UPDATE === 'true', + PRESENCE_UPDATE: process.env?.KAFKA_EVENTS_PRESENCE_UPDATE === 'true', + CHATS_SET: process.env?.KAFKA_EVENTS_CHATS_SET === 'true', + CHATS_UPSERT: process.env?.KAFKA_EVENTS_CHATS_UPSERT === 'true', + CHATS_UPDATE: process.env?.KAFKA_EVENTS_CHATS_UPDATE === 'true', + CHATS_DELETE: process.env?.KAFKA_EVENTS_CHATS_DELETE === 'true', + CONNECTION_UPDATE: process.env?.KAFKA_EVENTS_CONNECTION_UPDATE === 'true', + LABELS_EDIT: process.env?.KAFKA_EVENTS_LABELS_EDIT === 'true', + LABELS_ASSOCIATION: process.env?.KAFKA_EVENTS_LABELS_ASSOCIATION === 'true', + GROUPS_UPSERT: process.env?.KAFKA_EVENTS_GROUPS_UPSERT === 'true', + GROUP_UPDATE: process.env?.KAFKA_EVENTS_GROUPS_UPDATE === 'true', + GROUP_PARTICIPANTS_UPDATE: process.env?.KAFKA_EVENTS_GROUP_PARTICIPANTS_UPDATE === 'true', + CALL: process.env?.KAFKA_EVENTS_CALL === 'true', + TYPEBOT_START: process.env?.KAFKA_EVENTS_TYPEBOT_START === 'true', + TYPEBOT_CHANGE_STATUS: process.env?.KAFKA_EVENTS_TYPEBOT_CHANGE_STATUS === 'true', + }, + SASL: + process.env?.KAFKA_SASL_ENABLED === 'true' + ? { + ENABLED: true, + MECHANISM: process.env?.KAFKA_SASL_MECHANISM || 'plain', + USERNAME: process.env?.KAFKA_SASL_USERNAME || '', + PASSWORD: process.env?.KAFKA_SASL_PASSWORD || '', + } + : undefined, + SSL: + process.env?.KAFKA_SSL_ENABLED === 'true' + ? { + ENABLED: true, + REJECT_UNAUTHORIZED: process.env?.KAFKA_SSL_REJECT_UNAUTHORIZED !== 'false', + CA: process.env?.KAFKA_SSL_CA, + KEY: process.env?.KAFKA_SSL_KEY, + CERT: process.env?.KAFKA_SSL_CERT, + } + : undefined, }, WEBSOCKET: { ENABLED: process.env?.WEBSOCKET_ENABLED === 'true', GLOBAL_EVENTS: process.env?.WEBSOCKET_GLOBAL_EVENTS === 'true', + ALLOWED_HOSTS: process.env?.WEBSOCKET_ALLOWED_HOSTS, }, PUSHER: { ENABLED: process.env?.PUSHER_ENABLED === 'true', @@ -653,6 +862,7 @@ export class ConfigService { USE_SSL: process.env?.S3_USE_SSL === 'true', REGION: process.env?.S3_REGION, SKIP_POLICY: process.env?.S3_SKIP_POLICY === 'true', + SAVE_VIDEO: process.env?.S3_SAVE_VIDEO === 'true', }, AUTHENTICATION: { API_KEY: { @@ -660,6 +870,39 @@ export class ConfigService { }, EXPOSE_IN_FETCH_INSTANCES: process.env?.AUTHENTICATION_EXPOSE_IN_FETCH_INSTANCES === 'true', }, + METRICS: { + ENABLED: process.env?.PROMETHEUS_METRICS === 'true', + AUTH_REQUIRED: process.env?.METRICS_AUTH_REQUIRED === 'true', + USER: process.env?.METRICS_USER, + PASSWORD: process.env?.METRICS_PASSWORD, + ALLOWED_IPS: process.env?.METRICS_ALLOWED_IPS, + }, + TELEMETRY: { + ENABLED: process.env?.TELEMETRY_ENABLED === undefined || process.env?.TELEMETRY_ENABLED === 'true', + URL: process.env?.TELEMETRY_URL, + }, + PROXY: { + HOST: process.env?.PROXY_HOST, + PORT: process.env?.PROXY_PORT, + PROTOCOL: process.env?.PROXY_PROTOCOL, + USERNAME: process.env?.PROXY_USERNAME, + PASSWORD: process.env?.PROXY_PASSWORD, + }, + AUDIO_CONVERTER: { + API_URL: process.env?.API_AUDIO_CONVERTER, + API_KEY: process.env?.API_AUDIO_CONVERTER_KEY, + }, + FACEBOOK: { + APP_ID: process.env?.FACEBOOK_APP_ID, + CONFIG_ID: process.env?.FACEBOOK_CONFIG_ID, + USER_TOKEN: process.env?.FACEBOOK_USER_TOKEN, + }, + SENTRY: { + DSN: process.env?.SENTRY_DSN, + }, + EVENT_EMITTER: { + MAX_LISTENERS: Number.parseInt(process.env?.EVENT_EMITTER_MAX_LISTENERS) || 50, + }, }; } } diff --git a/src/config/event.config.ts b/src/config/event.config.ts index 20cd1e401..ab9d05a88 100644 --- a/src/config/event.config.ts +++ b/src/config/event.config.ts @@ -1,10 +1,11 @@ +import { configService, EventEmitter as EventEmitterConfig } from '@config/env.config'; import EventEmitter2 from 'eventemitter2'; -const maxListeners = parseInt(process.env.EVENT_EMITTER_MAX_LISTENERS, 10) || 50; +const eventEmitterConfig = configService.get('EVENT_EMITTER'); export const eventEmitter = new EventEmitter2({ delimiter: '.', newListener: false, ignoreErrors: false, - maxListeners: maxListeners, + maxListeners: eventEmitterConfig.MAX_LISTENERS, }); diff --git a/src/main.ts b/src/main.ts index cf787f32d..f1f00ba9a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -6,7 +6,15 @@ import { ProviderFiles } from '@api/provider/sessions'; import { PrismaRepository } from '@api/repository/repository.service'; import { HttpStatus, router } from '@api/routes/index.router'; import { eventManager, waMonitor } from '@api/server.module'; -import { Auth, configService, Cors, HttpServer, ProviderSession, Webhook } from '@config/env.config'; +import { + Auth, + configService, + Cors, + HttpServer, + ProviderSession, + Sentry as SentryConfig, + Webhook, +} from '@config/env.config'; import { onUnexpectedError } from '@config/error.config'; import { Logger } from '@config/logger.config'; import { ROOT_DIR } from '@config/path.config'; @@ -18,8 +26,8 @@ import cors from 'cors'; import express, { json, NextFunction, Request, Response, urlencoded } from 'express'; import { join } from 'path'; -function initWA() { - waMonitor.loadInstance(); +async function initWA() { + await waMonitor.loadInstance(); } async function bootstrap() { @@ -140,7 +148,8 @@ async function bootstrap() { eventManager.init(server); - if (process.env.SENTRY_DSN) { + const sentryConfig = configService.get('SENTRY'); + if (sentryConfig.DSN) { logger.info('Sentry - ON'); // Add this after all routes, @@ -150,7 +159,9 @@ async function bootstrap() { server.listen(httpServer.PORT, () => logger.log(httpServer.TYPE.toUpperCase() + ' - ON: ' + httpServer.PORT)); - initWA(); + initWA().catch((error) => { + logger.error('Error loading instances: ' + error); + }); onUnexpectedError(); } diff --git a/src/utils/errorResponse.ts b/src/utils/errorResponse.ts new file mode 100644 index 000000000..ee36ed22c --- /dev/null +++ b/src/utils/errorResponse.ts @@ -0,0 +1,47 @@ +import { HttpStatus } from '@api/routes/index.router'; + +export interface MetaErrorResponse { + status: number; + error: string; + message: string; + details: { + whatsapp_error: string; + whatsapp_code: string | number; + error_user_title: string; + error_user_msg: string; + error_type: string; + error_subcode: number | null; + fbtrace_id: string | null; + context: string; + type: string; + }; + timestamp: string; +} + +/** + * Creates standardized error response for Meta/WhatsApp API errors + */ +export function createMetaErrorResponse(error: any, context: string): MetaErrorResponse { + // Extract Meta/WhatsApp specific error fields + const metaError = error.template || error; + const errorUserTitle = metaError.error_user_title || metaError.message || 'Unknown error'; + const errorUserMsg = metaError.error_user_msg || metaError.message || 'Unknown error'; + + return { + status: HttpStatus.BAD_REQUEST, + error: 'Bad Request', + message: errorUserTitle, + details: { + whatsapp_error: errorUserMsg, + whatsapp_code: metaError.code || 'UNKNOWN_ERROR', + error_user_title: errorUserTitle, + error_user_msg: errorUserMsg, + error_type: metaError.type || 'UNKNOWN', + error_subcode: metaError.error_subcode || null, + fbtrace_id: metaError.fbtrace_id || null, + context, + type: 'whatsapp_api_error', + }, + timestamp: new Date().toISOString(), + }; +} diff --git a/src/utils/getConversationMessage.ts b/src/utils/getConversationMessage.ts index a7650968c..eca23b454 100644 --- a/src/utils/getConversationMessage.ts +++ b/src/utils/getConversationMessage.ts @@ -3,7 +3,13 @@ import { configService, S3 } from '@config/env.config'; const getTypeMessage = (msg: any) => { let mediaId: string; - if (configService.get('S3').ENABLE) mediaId = msg.message?.mediaUrl; + if ( + configService.get('S3').ENABLE && + (configService.get('S3').SAVE_VIDEO || + (msg?.message?.videoMessage === undefined && + msg?.message?.viewOnceMessageV2?.message?.videoMessage === undefined)) + ) + mediaId = msg.message?.mediaUrl; else mediaId = msg.key?.id; const types = { diff --git a/src/utils/i18n.ts b/src/utils/i18n.ts index b26a5ef03..1e2f8a1bd 100644 --- a/src/utils/i18n.ts +++ b/src/utils/i18n.ts @@ -12,8 +12,9 @@ const resources: any = {}; languages.forEach((language) => { const languagePath = path.join(translationsPath, `${language}.json`); if (fs.existsSync(languagePath)) { + const translationContent = fs.readFileSync(languagePath, 'utf8'); resources[language] = { - translation: require(languagePath), + translation: JSON.parse(translationContent), }; } }); diff --git a/src/utils/instrumentSentry.ts b/src/utils/instrumentSentry.ts index 1a87086f6..a91eb7729 100644 --- a/src/utils/instrumentSentry.ts +++ b/src/utils/instrumentSentry.ts @@ -1,10 +1,11 @@ +import { configService, Sentry as SentryConfig } from '@config/env.config'; import * as Sentry from '@sentry/node'; -const dsn = process.env.SENTRY_DSN; +const sentryConfig = configService.get('SENTRY'); -if (dsn) { +if (sentryConfig.DSN) { Sentry.init({ - dsn: dsn, + dsn: sentryConfig.DSN, environment: process.env.NODE_ENV || 'development', tracesSampleRate: 1.0, profilesSampleRate: 1.0, diff --git a/src/utils/makeProxyAgent.ts b/src/utils/makeProxyAgent.ts index 3b1379bde..80fa4d856 100644 --- a/src/utils/makeProxyAgent.ts +++ b/src/utils/makeProxyAgent.ts @@ -1,5 +1,7 @@ +import { socksDispatcher } from 'fetch-socks'; import { HttpsProxyAgent } from 'https-proxy-agent'; import { SocksProxyAgent } from 'socks-proxy-agent'; +import { ProxyAgent } from 'undici'; type Proxy = { host: string; @@ -17,12 +19,23 @@ function selectProxyAgent(proxyUrl: string): HttpsProxyAgent | SocksProx // the end so, we add the protocol constants without the `:` to avoid confusion. const PROXY_HTTP_PROTOCOL = 'http:'; const PROXY_SOCKS_PROTOCOL = 'socks:'; + const PROXY_SOCKS5_PROTOCOL = 'socks5:'; switch (url.protocol) { case PROXY_HTTP_PROTOCOL: return new HttpsProxyAgent(url); case PROXY_SOCKS_PROTOCOL: - return new SocksProxyAgent(url); + case PROXY_SOCKS5_PROTOCOL: { + let urlSocks = ''; + + if (url.username && url.password) { + urlSocks = `socks://${url.username}:${url.password}@${url.hostname}:${url.port}`; + } else { + urlSocks = `socks://${url.hostname}:${url.port}`; + } + + return new SocksProxyAgent(urlSocks); + } default: throw new Error(`Unsupported proxy protocol: ${url.protocol}`); } @@ -42,3 +55,57 @@ export function makeProxyAgent(proxy: Proxy | string): HttpsProxyAgent | return selectProxyAgent(proxyUrl); } + +export function makeProxyAgentUndici(proxy: Proxy | string): ProxyAgent { + let proxyUrl: string; + let protocol: string; + + if (typeof proxy === 'string') { + const url = new URL(proxy); + protocol = url.protocol.replace(':', ''); + proxyUrl = proxy; + } else { + const { host, password, port, protocol: proto, username } = proxy; + protocol = (proto || 'http').replace(':', ''); + + if (protocol === 'socks') { + protocol = 'socks5'; + } + + const auth = username && password ? `${username}:${password}@` : ''; + proxyUrl = `${protocol}://${auth}${host}:${port}`; + } + + protocol = protocol.toLowerCase(); + + const PROXY_HTTP_PROTOCOL = 'http'; + const PROXY_HTTPS_PROTOCOL = 'https'; + const PROXY_SOCKS4_PROTOCOL = 'socks4'; + const PROXY_SOCKS5_PROTOCOL = 'socks5'; + + switch (protocol) { + case PROXY_HTTP_PROTOCOL: + case PROXY_HTTPS_PROTOCOL: + return new ProxyAgent(proxyUrl); + + case PROXY_SOCKS4_PROTOCOL: + case PROXY_SOCKS5_PROTOCOL: { + let type: 4 | 5 = 5; + + if (PROXY_SOCKS4_PROTOCOL === protocol) type = 4; + + const url = new URL(proxyUrl); + + return socksDispatcher({ + type: type, + host: url.hostname, + port: Number(url.port), + userId: url.username || undefined, + password: url.password || undefined, + }); + } + + default: + throw new Error(`Unsupported proxy protocol: ${protocol}`); + } +} diff --git a/src/utils/onWhatsappCache.ts b/src/utils/onWhatsappCache.ts index 68f88ba46..08de0714e 100644 --- a/src/utils/onWhatsappCache.ts +++ b/src/utils/onWhatsappCache.ts @@ -1,7 +1,10 @@ import { prismaRepository } from '@api/server.module'; import { configService, Database } from '@config/env.config'; +import { Logger } from '@config/logger.config'; import dayjs from 'dayjs'; +const logger = new Logger('OnWhatsappCache'); + function getAvailableNumbers(remoteJid: string) { const numbersAvailable: string[] = []; @@ -11,6 +14,11 @@ function getAvailableNumbers(remoteJid: string) { const [number, domain] = remoteJid.split('@'); + // TODO: Se já for @lid, retornar apenas ele mesmo SEM adicionar @domain novamente + if (domain === 'lid' || domain === 'g.us') { + return [remoteJid]; // Retorna direto para @lid e @g.us + } + // Brazilian numbers if (remoteJid.startsWith('55')) { const numberWithDigit = @@ -47,36 +55,128 @@ function getAvailableNumbers(remoteJid: string) { numbersAvailable.push(remoteJid); } + // TODO: Adiciona @domain apenas para números que não são @lid return numbersAvailable.map((number) => `${number}@${domain}`); } interface ISaveOnWhatsappCacheParams { remoteJid: string; - lid?: string; + remoteJidAlt?: string; + lid?: 'lid' | undefined; +} + +function normalizeJid(jid: string | null | undefined): string | null { + if (!jid) return null; + return jid.startsWith('+') ? jid.slice(1) : jid; } export async function saveOnWhatsappCache(data: ISaveOnWhatsappCacheParams[]) { - if (configService.get('DATABASE').SAVE_DATA.IS_ON_WHATSAPP) { - const upsertsQuery = data.map((item) => { - const remoteJid = item.remoteJid.startsWith('+') ? item.remoteJid.slice(1) : item.remoteJid; - const numbersAvailable = getAvailableNumbers(remoteJid); - - return prismaRepository.isOnWhatsapp.upsert({ - create: { - remoteJid: remoteJid, - jidOptions: numbersAvailable.join(','), - lid: item.lid, - }, - update: { - jidOptions: numbersAvailable.join(','), - lid: item.lid, + if (!configService.get('DATABASE').SAVE_DATA.IS_ON_WHATSAPP) { + return; + } + + // Processa todos os itens em paralelo para melhor performance + const processingPromises = data.map(async (item) => { + try { + const remoteJid = normalizeJid(item.remoteJid); + if (!remoteJid) { + logger.warn('[saveOnWhatsappCache] Item skipped, missing remoteJid.'); + return; + } + + const altJidNormalized = normalizeJid(item.remoteJidAlt); + const lidAltJid = altJidNormalized && altJidNormalized.includes('@lid') ? altJidNormalized : null; + + const baseJids = [remoteJid]; // Garante que o remoteJid esteja na lista inicial + if (lidAltJid) { + baseJids.push(lidAltJid); + } + + const expandedJids = baseJids.flatMap((jid) => getAvailableNumbers(jid)); + + // 1. Busca entrada por jidOptions e também remoteJid + // Às vezes acontece do remoteJid atual NÃO ESTAR no jidOptions ainda, ocasionando o erro: + // 'Unique constraint failed on the fields: (`remoteJid`)' + // Isso acontece principalmente em grupos que possuem o número do criador no ID (ex.: '559911223345-1234567890@g.us') + const existingRecord = await prismaRepository.isOnWhatsapp.findFirst({ + where: { + OR: [ + ...expandedJids.map((jid) => ({ jidOptions: { contains: jid } })), + { remoteJid: remoteJid }, // TODO: Descobrir o motivo que causa o remoteJid não estar (às vezes) incluso na lista de jidOptions + ], }, - where: { remoteJid: remoteJid }, }); - }); - await prismaRepository.$transaction(upsertsQuery); - } + logger.verbose( + `[saveOnWhatsappCache] Register exists for [${expandedJids.join(',')}]? => ${existingRecord ? existingRecord.remoteJid : 'Not found'}`, + ); + + // 2. Unifica todos os JIDs usando um Set para garantir valores únicos + const finalJidOptions = new Set(expandedJids); + + if (lidAltJid) { + finalJidOptions.add(lidAltJid); + } + + if (existingRecord?.jidOptions) { + existingRecord.jidOptions.split(',').forEach((jid) => finalJidOptions.add(jid)); + } + + // 3. Prepara o payload final + // Ordena os JIDs para garantir consistência na string final + const sortedJidOptions = [...finalJidOptions].sort(); + const newJidOptionsString = sortedJidOptions.join(','); + const newLid = item.lid === 'lid' || item.remoteJid?.includes('@lid') ? 'lid' : null; + + const dataPayload = { + remoteJid: remoteJid, + jidOptions: newJidOptionsString, + lid: newLid, + }; + + // 4. Decide entre Criar ou Atualizar + if (existingRecord) { + // Compara a string de JIDs ordenada existente com a nova + const existingJidOptionsString = existingRecord.jidOptions + ? existingRecord.jidOptions.split(',').sort().join(',') + : ''; + + const isDataSame = + existingRecord.remoteJid === dataPayload.remoteJid && + existingJidOptionsString === dataPayload.jidOptions && + existingRecord.lid === dataPayload.lid; + + if (isDataSame) { + logger.verbose(`[saveOnWhatsappCache] Data for ${remoteJid} is already up-to-date. Skipping update.`); + return; // Pula para o próximo item + } + + // Os dados são diferentes, então atualiza + logger.verbose( + `[saveOnWhatsappCache] Register exists, updating: remoteJid=${remoteJid}, jidOptions=${dataPayload.jidOptions}, lid=${dataPayload.lid}`, + ); + await prismaRepository.isOnWhatsapp.update({ + where: { id: existingRecord.id }, + data: dataPayload, + }); + } else { + // Cria nova entrada + logger.verbose( + `[saveOnWhatsappCache] Register does not exist, creating: remoteJid=${remoteJid}, jidOptions=${dataPayload.jidOptions}, lid=${dataPayload.lid}`, + ); + await prismaRepository.isOnWhatsapp.create({ + data: dataPayload, + }); + } + } catch (e) { + // Loga o erro mas não para a execução dos outros promises + logger.error(`[saveOnWhatsappCache] Error processing item for ${item.remoteJid}: `); + logger.error(e); + } + }); + + // Espera todas as operações paralelas terminarem + await Promise.allSettled(processingPromises); } export async function getOnWhatsappCache(remoteJids: string[]) { diff --git a/src/utils/sendTelemetry.ts b/src/utils/sendTelemetry.ts index 037ca55d5..b2ebe05af 100644 --- a/src/utils/sendTelemetry.ts +++ b/src/utils/sendTelemetry.ts @@ -1,3 +1,4 @@ +import { configService, Telemetry } from '@config/env.config'; import axios from 'axios'; import fs from 'fs'; @@ -10,9 +11,9 @@ export interface TelemetryData { } export const sendTelemetry = async (route: string): Promise => { - const enabled = process.env.TELEMETRY_ENABLED === undefined || process.env.TELEMETRY_ENABLED === 'true'; + const telemetryConfig = configService.get('TELEMETRY'); - if (!enabled) { + if (!telemetryConfig.ENABLED) { return; } @@ -27,9 +28,7 @@ export const sendTelemetry = async (route: string): Promise => { }; const url = - process.env.TELEMETRY_URL && process.env.TELEMETRY_URL !== '' - ? process.env.TELEMETRY_URL - : 'https://log.evolution-api.com/telemetry'; + telemetryConfig.URL && telemetryConfig.URL !== '' ? telemetryConfig.URL : 'https://log.evolution-api.com/telemetry'; axios .post(url, telemetry) diff --git a/src/utils/use-multi-file-auth-state-prisma.ts b/src/utils/use-multi-file-auth-state-prisma.ts index e16dc8b08..d09078023 100644 --- a/src/utils/use-multi-file-auth-state-prisma.ts +++ b/src/utils/use-multi-file-auth-state-prisma.ts @@ -1,5 +1,7 @@ import { prismaRepository } from '@api/server.module'; import { CacheService } from '@api/services/cache.service'; +import { CacheConf, configService } from '@config/env.config'; +import { Logger } from '@config/logger.config'; import { INSTANCE_DIR } from '@config/path.config'; import { AuthenticationState, BufferJSON, initAuthCreds, WAProto as proto } from 'baileys'; import fs from 'fs/promises'; @@ -18,7 +20,7 @@ export async function keyExists(sessionId: string): Promise { try { const key = await prismaRepository.session.findUnique({ where: { sessionId: sessionId } }); return !!key; - } catch (error) { + } catch { return false; } } @@ -37,7 +39,7 @@ export async function saveKey(sessionId: string, keyJson: any): Promise { where: { sessionId: sessionId }, data: { creds: JSON.stringify(keyJson) }, }); - } catch (error) { + } catch { return null; } } @@ -48,7 +50,7 @@ export async function getAuthKey(sessionId: string): Promise { if (!register) return null; const auth = await prismaRepository.session.findUnique({ where: { sessionId: sessionId } }); return JSON.parse(auth?.creds); - } catch (error) { + } catch { return null; } } @@ -58,7 +60,7 @@ async function deleteAuthKey(sessionId: string): Promise { const register = await keyExists(sessionId); if (!register) return; await prismaRepository.session.delete({ where: { sessionId: sessionId } }); - } catch (error) { + } catch { return; } } @@ -67,17 +69,20 @@ async function fileExists(file: string): Promise { try { const stat = await fs.stat(file); if (stat.isFile()) return true; - } catch (error) { + } catch { return; } } +const logger = new Logger('useMultiFileAuthStatePrisma'); + export default async function useMultiFileAuthStatePrisma( sessionId: string, cache: CacheService, ): Promise<{ state: AuthenticationState; saveCreds: () => Promise; + removeCreds: () => Promise; }> { const localFolder = path.join(INSTANCE_DIR, sessionId); const localFile = (key: string) => path.join(localFolder, fixFileName(key) + '.json'); @@ -85,9 +90,10 @@ export default async function useMultiFileAuthStatePrisma( async function writeData(data: any, key: string): Promise { const dataString = JSON.stringify(data, BufferJSON.replacer); + const cacheConfig = configService.get('CACHE'); if (key != 'creds') { - if (process.env.CACHE_REDIS_ENABLED === 'true') { + if (cacheConfig.REDIS.ENABLED) { return await cache.hSet(sessionId, key, data); } else { await fs.writeFile(localFile(key), dataString); @@ -101,9 +107,10 @@ export default async function useMultiFileAuthStatePrisma( async function readData(key: string): Promise { try { let rawData; + const cacheConfig = configService.get('CACHE'); if (key != 'creds') { - if (process.env.CACHE_REDIS_ENABLED === 'true') { + if (cacheConfig.REDIS.ENABLED) { return await cache.hGet(sessionId, key); } else { if (!(await fileExists(localFile(key)))) return null; @@ -116,15 +123,17 @@ export default async function useMultiFileAuthStatePrisma( const parsedData = JSON.parse(rawData, BufferJSON.reviver); return parsedData; - } catch (error) { + } catch { return null; } } async function removeData(key: string): Promise { try { + const cacheConfig = configService.get('CACHE'); + if (key != 'creds') { - if (process.env.CACHE_REDIS_ENABLED === 'true') { + if (cacheConfig.REDIS.ENABLED) { return await cache.hDelete(sessionId, key); } else { await fs.unlink(localFile(key)); @@ -132,11 +141,31 @@ export default async function useMultiFileAuthStatePrisma( } else { await deleteAuthKey(sessionId); } - } catch (error) { + } catch { return; } } + async function removeCreds(): Promise { + const cacheConfig = configService.get('CACHE'); + + // Redis + try { + if (cacheConfig.REDIS.ENABLED) { + await cache.delete(sessionId); + logger.info({ action: 'redis.delete', sessionId }); + + return; + } + } catch (err) { + logger.warn({ action: 'redis.delete', sessionId, err }); + } + + logger.info({ action: 'auth.key.delete', sessionId }); + + await deleteAuthKey(sessionId); + } + let creds = await readData('creds'); if (!creds) { creds = initAuthCreds(); @@ -153,7 +182,7 @@ export default async function useMultiFileAuthStatePrisma( ids.map(async (id) => { let value = await readData(`${type}-${id}`); if (type === 'app-state-sync-key' && value) { - value = proto.Message.AppStateSyncKeyData.fromObject(value); + value = proto.Message.AppStateSyncKeyData.create(value); } data[id] = value; @@ -178,5 +207,7 @@ export default async function useMultiFileAuthStatePrisma( saveCreds: () => { return writeData(creds, 'creds'); }, + + removeCreds, }; } diff --git a/src/utils/use-multi-file-auth-state-provider-files.ts b/src/utils/use-multi-file-auth-state-provider-files.ts index 4dfa2fb25..eecc3100e 100644 --- a/src/utils/use-multi-file-auth-state-provider-files.ts +++ b/src/utils/use-multi-file-auth-state-provider-files.ts @@ -39,7 +39,11 @@ import { Logger } from '@config/logger.config'; import { AuthenticationCreds, AuthenticationState, BufferJSON, initAuthCreds, proto, SignalDataTypeMap } from 'baileys'; import { isNotEmpty } from 'class-validator'; -export type AuthState = { state: AuthenticationState; saveCreds: () => Promise }; +export type AuthState = { + state: AuthenticationState; + saveCreds: () => Promise; + removeCreds: () => Promise; +}; export class AuthStateProvider { constructor(private readonly providerFiles: ProviderFiles) {} @@ -86,6 +90,18 @@ export class AuthStateProvider { return response; }; + const removeCreds = async () => { + const [response, error] = await this.providerFiles.removeSession(instance); + if (error) { + // this.logger.error(['removeData', error?.message, error?.stack]); + return; + } + + logger.info({ action: 'remove.session', instance, response }); + + return; + }; + const creds: AuthenticationCreds = (await readData('creds')) || initAuthCreds(); return { @@ -100,7 +116,7 @@ export class AuthStateProvider { ids.map(async (id) => { let value = await readData(`${type}-${id}`); if (type === 'app-state-sync-key' && value) { - value = proto.Message.AppStateSyncKeyData.fromObject(value); + value = proto.Message.AppStateSyncKeyData.create(value); } data[id] = value; @@ -126,6 +142,10 @@ export class AuthStateProvider { saveCreds: async () => { return await writeData(creds, 'creds'); }, + + removeCreds, }; } } + +const logger = new Logger('useMultiFileAuthStatePrisma'); diff --git a/src/utils/use-multi-file-auth-state-redis-db.ts b/src/utils/use-multi-file-auth-state-redis-db.ts index 837f80924..e0981c700 100644 --- a/src/utils/use-multi-file-auth-state-redis-db.ts +++ b/src/utils/use-multi-file-auth-state-redis-db.ts @@ -8,6 +8,7 @@ export async function useMultiFileAuthStateRedisDb( ): Promise<{ state: AuthenticationState; saveCreds: () => Promise; + removeCreds: () => Promise; }> { const logger = new Logger('useMultiFileAuthStateRedisDb'); @@ -36,6 +37,16 @@ export async function useMultiFileAuthStateRedisDb( } }; + async function removeCreds(): Promise { + try { + logger.warn({ action: 'redis.delete', instanceName }); + + return await cache.delete(instanceName); + } catch { + return; + } + } + const creds: AuthenticationCreds = (await readData('creds')) || initAuthCreds(); return { @@ -50,7 +61,7 @@ export async function useMultiFileAuthStateRedisDb( ids.map(async (id) => { let value = await readData(`${type}-${id}`); if (type === 'app-state-sync-key' && value) { - value = proto.Message.AppStateSyncKeyData.fromObject(value); + value = proto.Message.AppStateSyncKeyData.create(value); } data[id] = value; @@ -76,5 +87,7 @@ export async function useMultiFileAuthStateRedisDb( saveCreds: async () => { return await writeData(creds, 'creds'); }, + + removeCreds, }; } diff --git a/src/validate/chat.schema.ts b/src/validate/chat.schema.ts index dba279959..7dae44539 100644 --- a/src/validate/chat.schema.ts +++ b/src/validate/chat.schema.ts @@ -195,8 +195,9 @@ export const contactValidateSchema: JSONSchema7 = { _id: { type: 'string', minLength: 1 }, pushName: { type: 'string', minLength: 1 }, id: { type: 'string', minLength: 1 }, + remoteJid: { type: 'string', minLength: 1 }, }, - ...isNotEmpty('_id', 'id', 'pushName'), + ...isNotEmpty('_id', 'id', 'pushName', 'remoteJid'), }, }, }; diff --git a/src/validate/templateDelete.schema.ts b/src/validate/templateDelete.schema.ts new file mode 100644 index 000000000..70b3aefff --- /dev/null +++ b/src/validate/templateDelete.schema.ts @@ -0,0 +1,32 @@ +import { JSONSchema7 } from 'json-schema'; +import { v4 } from 'uuid'; + +const isNotEmpty = (...propertyNames: string[]): JSONSchema7 => { + const properties: Record = {}; + propertyNames.forEach( + (property) => + (properties[property] = { + minLength: 1, + description: `The "${property}" cannot be empty`, + }), + ); + return { + if: { + propertyNames: { + enum: [...propertyNames], + }, + }, + then: { properties }, + } as JSONSchema7; +}; + +export const templateDeleteSchema: JSONSchema7 = { + $id: v4(), + type: 'object', + properties: { + name: { type: 'string' }, + hsmId: { type: 'string' }, + }, + required: ['name'], + ...isNotEmpty('name'), +}; diff --git a/src/validate/templateEdit.schema.ts b/src/validate/templateEdit.schema.ts new file mode 100644 index 000000000..0b03e32d5 --- /dev/null +++ b/src/validate/templateEdit.schema.ts @@ -0,0 +1,35 @@ +import { JSONSchema7 } from 'json-schema'; +import { v4 } from 'uuid'; + +const isNotEmpty = (...propertyNames: string[]): JSONSchema7 => { + const properties: Record = {}; + propertyNames.forEach( + (property) => + (properties[property] = { + minLength: 1, + description: `The "${property}" cannot be empty`, + }), + ); + return { + if: { + propertyNames: { + enum: [...propertyNames], + }, + }, + then: { properties }, + } as JSONSchema7; +}; + +export const templateEditSchema: JSONSchema7 = { + $id: v4(), + type: 'object', + properties: { + templateId: { type: 'string' }, + category: { type: 'string', enum: ['AUTHENTICATION', 'MARKETING', 'UTILITY'] }, + allowCategoryChange: { type: 'boolean' }, + ttl: { type: 'number' }, + components: { type: 'array' }, + }, + required: ['templateId'], + ...isNotEmpty('templateId'), +}; diff --git a/src/validate/validate.schema.ts b/src/validate/validate.schema.ts index 4577eae3f..69e0090d8 100644 --- a/src/validate/validate.schema.ts +++ b/src/validate/validate.schema.ts @@ -8,5 +8,7 @@ export * from './message.schema'; export * from './proxy.schema'; export * from './settings.schema'; export * from './template.schema'; +export * from './templateDelete.schema'; +export * from './templateEdit.schema'; export * from '@api/integrations/chatbot/chatbot.schema'; export * from '@api/integrations/event/event.schema';