diff --git a/.github/workflows/check_code_quality.yml b/.github/workflows/check_code_quality.yml index b25566119a..bd8c0417ef 100644 --- a/.github/workflows/check_code_quality.yml +++ b/.github/workflows/check_code_quality.yml @@ -60,6 +60,15 @@ jobs: - name: Check archive API documentation run: npm run audit:archive-docs + - name: Check generated runtime OpenAPI contracts + run: npm run audit:runtime-openapi + + - name: Check chat and Baileys API documentation + run: npm run audit:chat-docs && npm run audit:baileys-docs + + - name: Test settings templates and review surfaces + run: npm run test:settings-templates && npm run test:review-surfaces + - name: Generate Prisma client run: npm run db:generate diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b18277ab6..f54f88b9e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +# 5.3.0 (2026-09-21) + +### Features + +* Embedded Evolution Manager 2.4.0 with visual settings-template management and instance/group/contact assignments. +* Added generated, validator-derived request fields for every runtime route in Swagger, while preserving curated operation-specific responses where available. +* Added guided query, path, header, JSON, and multipart inputs for generated Swagger operations. + +### Fixes + +* Made runtime OpenAPI generation portable across Windows and Linux and line-ending independent. +* Added CI gates for generated runtime contracts, chat/Baileys documentation, settings-template behavior, and embedded review surfaces. +* Removed fabricated success examples from generated fallback responses; operation-specific examples remain in curated domain documentation. + # 5.2.0 (2026-09-16) ### Features diff --git a/docs/runtime-routes.json b/docs/runtime-routes.json index dc02dd3c57..f6963dad0c 100644 --- a/docs/runtime-routes.json +++ b/docs/runtime-routes.json @@ -3,6 +3,8 @@ "method": "post", "path": "/archive/backfill/{instanceName}", "source": "src/api/routes/archive.router.ts", + "multipart": false, + "runtimeStatus": "CREATED", "operation": { "tags": [ "Archive" @@ -19,41 +21,296 @@ "schema": { "type": "string" } + }, + { + "name": "x-archive-key", + "in": "header", + "required": true, + "schema": { + "type": "string" + }, + "description": "Archive authorization key with the scope required by this operation." } ], "responses": { - "200": { - "description": "Successful response." + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, + "x-source": "src/api/routes/archive.router.ts", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "additionalProperties": false, + "properties": { + "limit": { + "type": "integer", + "minimum": 1, + "maximum": 100000 + } + }, + "required": [] + } } } - }, - "x-source": "src/api/routes/archive.router.ts" + } } }, { "method": "get", "path": "/archive/calls/{instanceName}", "source": "src/api/routes/archive.router.ts", + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ "Archive" @@ -70,20 +327,292 @@ "schema": { "type": "string" } + }, + { + "name": "x-archive-key", + "in": "header", + "required": true, + "schema": { + "type": "string" + }, + "description": "Archive authorization key with the scope required by this operation." + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 1000 + } + }, + { + "name": "peerJid", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "groupJid", + "in": "query", + "required": false, + "schema": { + "type": "string" + } } ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "x-source": "src/api/routes/archive.router.ts" @@ -93,6 +622,8 @@ "method": "get", "path": "/archive/chats/{instanceName}", "source": "src/api/routes/archive.router.ts", + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ "Archive" @@ -109,98 +640,326 @@ "schema": { "type": "string" } - } - ], - "responses": { - "200": { - "description": "Successful response." }, - "400": { - "description": "Invalid request." + { + "name": "x-archive-key", + "in": "header", + "required": true, + "schema": { + "type": "string" + }, + "description": "Archive authorization key with the scope required by this operation." }, - "401": { - "description": "Missing or invalid API key." + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 1000 + } }, - "404": { - "description": "Instance or resource not found." - } - }, - "x-source": "src/api/routes/archive.router.ts" - } - }, - { - "method": "get", - "path": "/archive/contacts/{instanceName}", - "source": "src/api/routes/archive.router.ts", - "operation": { - "tags": [ - "Archive" - ], - "summary": "Get contacts", - "description": "Get contacts for Archive.", - "operationId": "get_archive_contacts", - "parameters": [ { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", + "name": "entityJid", + "in": "query", + "required": false, "schema": { "type": "string" } - } - ], - "responses": { - "200": { - "description": "Successful response." }, - "400": { - "description": "Invalid request." + { + "name": "groupJid", + "in": "query", + "required": false, + "schema": { + "type": "string" + } }, - "401": { - "description": "Missing or invalid API key." + { + "name": "entityType", + "in": "query", + "required": false, + "schema": { + "type": "string" + } }, - "404": { - "description": "Instance or resource not found." - } - }, - "x-source": "src/api/routes/archive.router.ts" - } - }, - { - "method": "get", - "path": "/archive/events/{instanceName}", - "source": "src/api/routes/archive.router.ts", - "operation": { - "tags": [ - "Archive" - ], - "summary": "Get events", - "description": "Get events for Archive.", - "operationId": "get_archive_events", - "parameters": [ { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", + "name": "eventType", + "in": "query", + "required": false, "schema": { "type": "string" } + }, + { + "name": "from", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "before", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } } ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "x-source": "src/api/routes/archive.router.ts" @@ -208,15 +967,17 @@ }, { "method": "get", - "path": "/archive/groups/{instanceName}", + "path": "/archive/contacts/{instanceName}", "source": "src/api/routes/archive.router.ts", + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ "Archive" ], - "summary": "Get groups", - "description": "Get groups for Archive.", - "operationId": "get_archive_groups", + "summary": "Get contacts", + "description": "Get contacts for Archive.", + "operationId": "get_archive_contacts", "parameters": [ { "name": "instanceName", @@ -226,98 +987,326 @@ "schema": { "type": "string" } - } - ], - "responses": { - "200": { - "description": "Successful response." }, - "400": { - "description": "Invalid request." + { + "name": "x-archive-key", + "in": "header", + "required": true, + "schema": { + "type": "string" + }, + "description": "Archive authorization key with the scope required by this operation." }, - "401": { - "description": "Missing or invalid API key." + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 1000 + } }, - "404": { - "description": "Instance or resource not found." - } - }, - "x-source": "src/api/routes/archive.router.ts" - } - }, - { - "method": "get", - "path": "/archive/media/{instanceName}", - "source": "src/api/routes/archive.router.ts", - "operation": { - "tags": [ - "Archive" - ], - "summary": "Get media", - "description": "Get media for Archive.", - "operationId": "get_archive_media", - "parameters": [ { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", + "name": "entityJid", + "in": "query", + "required": false, "schema": { "type": "string" } - } - ], - "responses": { - "200": { - "description": "Successful response." }, - "400": { - "description": "Invalid request." + { + "name": "groupJid", + "in": "query", + "required": false, + "schema": { + "type": "string" + } }, - "401": { - "description": "Missing or invalid API key." + { + "name": "entityType", + "in": "query", + "required": false, + "schema": { + "type": "string" + } }, - "404": { - "description": "Instance or resource not found." - } - }, - "x-source": "src/api/routes/archive.router.ts" - } - }, - { - "method": "get", - "path": "/archive/memberships/{instanceName}", - "source": "src/api/routes/archive.router.ts", - "operation": { - "tags": [ - "Archive" - ], - "summary": "Get memberships", - "description": "Get memberships for Archive.", - "operationId": "get_archive_memberships", - "parameters": [ { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", + "name": "eventType", + "in": "query", + "required": false, "schema": { "type": "string" } + }, + { + "name": "from", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "before", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } } ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "x-source": "src/api/routes/archive.router.ts" @@ -325,15 +1314,17 @@ }, { "method": "get", - "path": "/archive/messages/{instanceName}", + "path": "/archive/events/{instanceName}", "source": "src/api/routes/archive.router.ts", + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ "Archive" ], - "summary": "Get messages", - "description": "Get messages for Archive.", - "operationId": "get_archive_messages", + "summary": "Get events", + "description": "Get events for Archive.", + "operationId": "get_archive_events", "parameters": [ { "name": "instanceName", @@ -343,20 +1334,334 @@ "schema": { "type": "string" } + }, + { + "name": "x-archive-key", + "in": "header", + "required": true, + "schema": { + "type": "string" + }, + "description": "Archive authorization key with the scope required by this operation." + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 1000 + } + }, + { + "name": "entityJid", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "groupJid", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "entityType", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "eventType", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "from", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "before", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "includePayload", + "in": "query", + "required": false, + "schema": { + "type": "boolean" + } } ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "x-source": "src/api/routes/archive.router.ts" @@ -364,15 +1669,17 @@ }, { "method": "get", - "path": "/archive/messages/{instanceName}/{messageId}/revisions", + "path": "/archive/groups/{instanceName}", "source": "src/api/routes/archive.router.ts", + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ "Archive" ], - "summary": "Get messages", - "description": "Get messages for Archive.", - "operationId": "get_archive_messages_revisions", + "summary": "Get groups", + "description": "Get groups for Archive.", + "operationId": "get_archive_groups", "parameters": [ { "name": "instanceName", @@ -384,137 +1691,323 @@ } }, { - "name": "messageId", - "in": "path", + "name": "x-archive-key", + "in": "header", "required": true, - "description": "Message Id path parameter.", "schema": { "type": "string" + }, + "description": "Archive authorization key with the scope required by this operation." + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 1000 } - } - ], - "responses": { - "200": { - "description": "Successful response." }, - "400": { - "description": "Invalid request." + { + "name": "entityJid", + "in": "query", + "required": false, + "schema": { + "type": "string" + } }, - "401": { - "description": "Missing or invalid API key." + { + "name": "groupJid", + "in": "query", + "required": false, + "schema": { + "type": "string" + } }, - "404": { - "description": "Instance or resource not found." - } - }, - "x-source": "src/api/routes/archive.router.ts" - } - }, - { - "method": "get", - "path": "/archive/policies", - "source": "src/api/routes/archive.router.ts", - "operation": { - "tags": [ - "Archive" - ], - "summary": "Get policies", - "description": "Get policies for Archive.", - "operationId": "get_archive_policies", - "parameters": [], - "responses": { - "200": { - "description": "Successful response." + { + "name": "entityType", + "in": "query", + "required": false, + "schema": { + "type": "string" + } }, - "400": { - "description": "Invalid request." + { + "name": "eventType", + "in": "query", + "required": false, + "schema": { + "type": "string" + } }, - "401": { - "description": "Missing or invalid API key." + { + "name": "from", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } }, - "404": { - "description": "Instance or resource not found." + { + "name": "before", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } } - }, - "x-source": "src/api/routes/archive.router.ts" - } - }, - { - "method": "put", - "path": "/archive/policies", - "source": "src/api/routes/archive.router.ts", - "operation": { - "tags": [ - "Archive" ], - "summary": "Update policies", - "description": "Update policies for Archive.", - "operationId": "put_archive_policies", - "parameters": [], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } } - } - }, - "x-source": "src/api/routes/archive.router.ts" - } - }, - { - "method": "post", - "path": "/archive/purges/confirm", - "source": "src/api/routes/archive.router.ts", - "operation": { - "tags": [ - "Archive" - ], - "summary": "Run purges", - "description": "Run purges for Archive.", - "operationId": "post_archive_purges_confirm", - "parameters": [], - "responses": { - "200": { - "description": "Successful response." }, - "400": { - "description": "Invalid request." + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } }, - "401": { - "description": "Missing or invalid API key." + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } }, - "404": { - "description": "Instance or resource not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } } } }, @@ -522,16 +2015,18 @@ } }, { - "method": "post", - "path": "/archive/purges/preview/{instanceName}", + "method": "get", + "path": "/archive/media/{instanceName}", "source": "src/api/routes/archive.router.ts", + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ "Archive" ], - "summary": "Run purges", - "description": "Run purges for Archive.", - "operationId": "post_archive_purges_preview", + "summary": "Get media", + "description": "Get media for Archive.", + "operationId": "get_archive_media", "parameters": [ { "name": "instanceName", @@ -541,54 +2036,54 @@ "schema": { "type": "string" } - } - ], - "responses": { - "200": { - "description": "Successful response." }, - "400": { - "description": "Invalid request." + { + "name": "x-archive-key", + "in": "header", + "required": true, + "schema": { + "type": "string" + }, + "description": "Archive authorization key with the scope required by this operation." }, - "401": { - "description": "Missing or invalid API key." + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 1000 + } }, - "404": { - "description": "Instance or resource not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} + { + "name": "entityJid", + "in": "query", + "required": false, + "schema": { + "type": "string" } - } - }, - "x-source": "src/api/routes/archive.router.ts" - } - }, - { - "method": "get", - "path": "/archive/purges/tombstones/{instanceName}", - "source": "src/api/routes/archive.router.ts", - "operation": { - "tags": [ - "Archive" - ], - "summary": "Get purges", - "description": "Get purges for Archive.", - "operationId": "get_archive_purges_tombstones", - "parameters": [ + }, { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", + "name": "groupJid", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "mediaType", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "state", + "in": "query", + "required": false, "schema": { "type": "string" } @@ -596,16 +2091,253 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "x-source": "src/api/routes/archive.router.ts" @@ -613,15 +2345,17 @@ }, { "method": "get", - "path": "/archive/reactions/{instanceName}", + "path": "/archive/memberships/{instanceName}", "source": "src/api/routes/archive.router.ts", + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ "Archive" ], - "summary": "Get reactions", - "description": "Get reactions for Archive.", - "operationId": "get_archive_reactions", + "summary": "Get memberships", + "description": "Get memberships for Archive.", + "operationId": "get_archive_memberships", "parameters": [ { "name": "instanceName", @@ -631,42 +2365,38 @@ "schema": { "type": "string" } - } - ], - "responses": { - "200": { - "description": "Successful response." }, - "400": { - "description": "Invalid request." + { + "name": "x-archive-key", + "in": "header", + "required": true, + "schema": { + "type": "string" + }, + "description": "Archive authorization key with the scope required by this operation." }, - "401": { - "description": "Missing or invalid API key." + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 1000 + } }, - "404": { - "description": "Instance or resource not found." - } - }, - "x-source": "src/api/routes/archive.router.ts" - } - }, - { - "method": "get", - "path": "/archive/receipts/{instanceName}", - "source": "src/api/routes/archive.router.ts", - "operation": { - "tags": [ - "Archive" - ], - "summary": "Get receipts", - "description": "Get receipts for Archive.", - "operationId": "get_archive_receipts", - "parameters": [ { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", + "name": "groupJid", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "participantJid", + "in": "query", + "required": false, "schema": { "type": "string" } @@ -674,45 +2404,253 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "x-source": "src/api/routes/archive.router.ts" - } - }, - { - "method": "get", - "path": "/archive/status", - "source": "src/api/routes/archive.router.ts", - "operation": { - "tags": [ - "Archive" - ], - "summary": "Get status", - "description": "Get status for Archive.", - "operationId": "get_archive_status", - "parameters": [], - "responses": { - "200": { - "description": "Successful response." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } }, - "400": { - "description": "Invalid request." + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } }, - "401": { - "description": "Missing or invalid API key." + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } }, - "404": { - "description": "Instance or resource not found." + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "x-source": "src/api/routes/archive.router.ts" @@ -720,15 +2658,17 @@ }, { "method": "get", - "path": "/archive/sync-gaps/{instanceName}", + "path": "/archive/messages/{instanceName}", "source": "src/api/routes/archive.router.ts", + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ "Archive" ], - "summary": "Get sync gaps", - "description": "Get sync gaps for Archive.", - "operationId": "get_archive_sync_gaps", + "summary": "Get messages", + "description": "Get messages for Archive.", + "operationId": "get_archive_messages", "parameters": [ { "name": "instanceName", @@ -738,36 +2678,344 @@ "schema": { "type": "string" } + }, + { + "name": "x-archive-key", + "in": "header", + "required": true, + "schema": { + "type": "string" + }, + "description": "Archive authorization key with the scope required by this operation." + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 1000 + } + }, + { + "name": "entityJid", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "groupJid", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "entityType", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "eventType", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "from", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } + }, + { + "name": "before", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + } } ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "x-source": "src/api/routes/archive.router.ts" } }, { - "method": "post", - "path": "/archive/verify/{instanceName}", + "method": "get", + "path": "/archive/messages/{instanceName}/{messageId}/revisions", "source": "src/api/routes/archive.router.ts", + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ "Archive" ], - "summary": "Run verify", - "description": "Run verify for Archive.", - "operationId": "post_archive_verify", + "summary": "Get messages", + "description": "Get messages for Archive.", + "operationId": "get_archive_messages_revisions", "parameters": [ { "name": "instanceName", @@ -777,54 +3025,29 @@ "schema": { "type": "string" } - } - ], - "responses": { - "200": { - "description": "Successful response." }, - "400": { - "description": "Invalid request." + { + "name": "messageId", + "in": "path", + "required": true, + "description": "Message Id path parameter.", + "schema": { + "type": "string" + } }, - "401": { - "description": "Missing or invalid API key." + { + "name": "x-archive-key", + "in": "header", + "required": true, + "schema": { + "type": "string" + }, + "description": "Archive authorization key with the scope required by this operation." }, - "404": { - "description": "Instance or resource not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} - } - } - }, - "x-source": "src/api/routes/archive.router.ts" - } - }, - { - "method": "post", - "path": "/business/getCatalog/{instanceName}", - "source": "src/api/routes/business.router.ts", - "operation": { - "tags": [ - "Business & catalog" - ], - "summary": "Get get Catalog", - "description": "Get get Catalog for Business & catalog.", - "operationId": "post_business_getCatalog", - "parameters": [ { - "name": "instanceName", - "in": "path", + "name": "chatJid", + "in": "query", "required": true, - "description": "Evolution API instance name.", "schema": { "type": "string" } @@ -832,236 +3055,1169 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } } } }, - "x-source": "src/api/routes/business.router.ts" + "x-source": "src/api/routes/archive.router.ts" } }, { - "method": "post", - "path": "/business/getCollections/{instanceName}", - "source": "src/api/routes/business.router.ts", + "method": "get", + "path": "/archive/policies", + "source": "src/api/routes/archive.router.ts", + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Business & catalog" + "Archive" ], - "summary": "Get get Collections", - "description": "Get get Collections for Business & catalog.", - "operationId": "post_business_getCollections", + "summary": "Get policies", + "description": "Get policies for Archive.", + "operationId": "get_archive_policies", "parameters": [ { - "name": "instanceName", - "in": "path", + "name": "x-archive-key", + "in": "header", "required": true, - "description": "Evolution API instance name.", "schema": { "type": "string" - } + }, + "description": "Archive authorization key with the scope required by this operation." } ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } } } }, - "x-source": "src/api/routes/business.router.ts" + "x-source": "src/api/routes/archive.router.ts" } }, { - "method": "post", - "path": "/call/offer/{instanceName}", - "source": "src/api/routes/call.router.ts", + "method": "put", + "path": "/archive/policies", + "source": "src/api/routes/archive.router.ts", + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Calls" + "Archive" ], - "summary": "Create offer", - "description": "Create offer for Calls.", - "operationId": "post_call_offer", + "summary": "Update policies", + "description": "Update policies for Archive.", + "operationId": "put_archive_policies", "parameters": [ { - "name": "instanceName", - "in": "path", + "name": "x-archive-key", + "in": "header", "required": true, - "description": "Evolution API instance name.", "schema": { "type": "string" - } + }, + "description": "Archive authorization key with the scope required by this operation." } ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, + "x-source": "src/api/routes/archive.router.ts", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "additionalProperties": false, + "properties": { + "id": { + "type": "string" + }, + "scope": { + "type": "string", + "enum": [ + "general", + "entity", + "account", + "jid" + ] + }, + "selector": { + "type": "object", + "additionalProperties": true + }, + "policy": { + "type": "object", + "additionalProperties": true + }, + "effectiveAt": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "scope", + "policy" + ] + } } } - }, - "x-source": "src/api/routes/call.router.ts" + } } }, { "method": "post", - "path": "/chat/archiveChat/{instanceName}", - "source": "src/api/routes/chat.router.ts", + "path": "/archive/purges/confirm", + "source": "src/api/routes/archive.router.ts", + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Chats" + "Archive" ], - "summary": "Update archive Chat", - "description": "Update archive Chat for Chats.", - "operationId": "post_chat_archiveChat", + "summary": "Run purges", + "description": "Run purges for Archive.", + "operationId": "post_archive_purges_confirm", "parameters": [ { - "name": "instanceName", - "in": "path", + "name": "x-archive-key", + "in": "header", "required": true, - "description": "Evolution API instance name.", "schema": { "type": "string" - } + }, + "description": "Archive authorization key with the scope required by this operation." } ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } } - } - }, - "x-source": "src/api/routes/chat.router.ts" - } - }, - { - "method": "delete", - "path": "/chat/deleteMessageForEveryone/{instanceName}", - "source": "src/api/routes/chat.router.ts", - "operation": { - "tags": [ - "Chats" - ], - "summary": "Delete delete Message For Everyone", - "description": "Delete delete Message For Everyone for Chats.", - "operationId": "delete_chat_deleteMessageForEveryone", - "parameters": [ - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Successful response." }, - "400": { - "description": "Invalid request." + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } }, - "401": { - "description": "Missing or invalid API key." + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } }, - "404": { - "description": "Instance or resource not found." + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, - "x-source": "src/api/routes/chat.router.ts" + "x-source": "src/api/routes/archive.router.ts", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "previewId": { + "type": "string" + }, + "confirmationToken": { + "type": "string" + } + }, + "required": [ + "previewId", + "confirmationToken" + ] + } + } + } + } } }, { "method": "post", - "path": "/chat/fetchBusinessProfile/{instanceName}", - "source": "src/api/routes/chat.router.ts", + "path": "/archive/purges/preview/{instanceName}", + "source": "src/api/routes/archive.router.ts", + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Chats" + "Archive" ], - "summary": "Get fetch Business Profile", - "description": "Get fetch Business Profile for Chats.", - "operationId": "post_chat_fetchBusinessProfile", + "summary": "Run purges", + "description": "Run purges for Archive.", + "operationId": "post_archive_purges_preview", "parameters": [ { "name": "instanceName", @@ -1071,48 +4227,317 @@ "schema": { "type": "string" } + }, + { + "name": "x-archive-key", + "in": "header", + "required": true, + "schema": { + "type": "string" + }, + "description": "Archive authorization key with the scope required by this operation." } ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, + "x-source": "src/api/routes/archive.router.ts", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "additionalProperties": false, + "properties": { + "before": { + "type": "string", + "format": "date-time" + }, + "entityJid": { + "type": "string" + }, + "groupJid": { + "type": "string" + }, + "eventTypes": { + "type": "array", + "items": { + "type": "string" + } + }, + "mediaOnly": { + "type": "boolean" + } + }, + "required": [] + } } } - }, - "x-source": "src/api/routes/chat.router.ts" + } } }, { "method": "get", - "path": "/chat/fetchPrivacySettings/{instanceName}", - "source": "src/api/routes/chat.router.ts", + "path": "/archive/purges/tombstones/{instanceName}", + "source": "src/api/routes/archive.router.ts", + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Chats" + "Archive" ], - "summary": "Get fetch Privacy Settings", - "description": "Get fetch Privacy Settings for Chats.", - "operationId": "get_chat_fetchPrivacySettings", + "summary": "Get purges", + "description": "Get purges for Archive.", + "operationId": "get_archive_purges_tombstones", "parameters": [ { "name": "instanceName", @@ -1122,36 +4547,284 @@ "schema": { "type": "string" } + }, + { + "name": "x-archive-key", + "in": "header", + "required": true, + "schema": { + "type": "string" + }, + "description": "Archive authorization key with the scope required by this operation." } ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, - "x-source": "src/api/routes/chat.router.ts" + "x-source": "src/api/routes/archive.router.ts" } }, { - "method": "post", - "path": "/chat/fetchProfile/{instanceName}", - "source": "src/api/routes/chat.router.ts", + "method": "get", + "path": "/archive/reactions/{instanceName}", + "source": "src/api/routes/archive.router.ts", + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Chats" + "Archive" ], - "summary": "Get fetch Profile", - "description": "Get fetch Profile for Chats.", - "operationId": "post_chat_fetchProfile", + "summary": "Get reactions", + "description": "Get reactions for Archive.", + "operationId": "get_archive_reactions", "parameters": [ { "name": "instanceName", @@ -1161,48 +4834,310 @@ "schema": { "type": "string" } + }, + { + "name": "x-archive-key", + "in": "header", + "required": true, + "schema": { + "type": "string" + }, + "description": "Archive authorization key with the scope required by this operation." + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 1000 + } + }, + { + "name": "messageId", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "entityJid", + "in": "query", + "required": false, + "schema": { + "type": "string" + } } ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } } } }, - "x-source": "src/api/routes/chat.router.ts" + "x-source": "src/api/routes/archive.router.ts" } }, { - "method": "post", - "path": "/chat/fetchProfilePictureUrl/{instanceName}", - "source": "src/api/routes/chat.router.ts", + "method": "get", + "path": "/archive/receipts/{instanceName}", + "source": "src/api/routes/archive.router.ts", + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Chats" + "Archive" ], - "summary": "Get fetch Profile Picture Url", - "description": "Get fetch Profile Picture Url for Chats.", - "operationId": "post_chat_fetchProfilePictureUrl", + "summary": "Get receipts", + "description": "Get receipts for Archive.", + "operationId": "get_archive_receipts", "parameters": [ { "name": "instanceName", @@ -1212,54 +5147,324 @@ "schema": { "type": "string" } + }, + { + "name": "x-archive-key", + "in": "header", + "required": true, + "schema": { + "type": "string" + }, + "description": "Archive authorization key with the scope required by this operation." + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 1000 + } + }, + { + "name": "messageId", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "entityJid", + "in": "query", + "required": false, + "schema": { + "type": "string" + } } ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } } } }, - "x-source": "src/api/routes/chat.router.ts" + "x-source": "src/api/routes/archive.router.ts" } }, { "method": "get", - "path": "/chat/findChatByRemoteJid/{instanceName}", - "source": "src/api/routes/chat.router.ts", + "path": "/archive/status", + "source": "src/api/routes/archive.router.ts", + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Chats" + "Archive" ], - "summary": "Get find Chat By Remote Jid", - "description": "Get find Chat By Remote Jid for Chats.", - "operationId": "get_chat_findChatByRemoteJid", + "summary": "Get status", + "description": "Get status for Archive.", + "operationId": "get_archive_status", "parameters": [ { - "name": "instanceName", - "in": "path", + "name": "x-archive-key", + "in": "header", "required": true, - "description": "Evolution API instance name.", + "schema": { + "type": "string" + }, + "description": "Archive authorization key with the scope required by this operation." + }, + { + "name": "instanceName", + "in": "query", + "required": false, "schema": { "type": "string" } @@ -1267,32 +5472,271 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, - "x-source": "src/api/routes/chat.router.ts" + "x-source": "src/api/routes/archive.router.ts" } }, { - "method": "post", - "path": "/chat/findChats/{instanceName}", - "source": "src/api/routes/chat.router.ts", + "method": "get", + "path": "/archive/sync-gaps/{instanceName}", + "source": "src/api/routes/archive.router.ts", + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Chats" + "Archive" ], - "summary": "Get find Chats", - "description": "Get find Chats for Chats.", - "operationId": "post_chat_findChats", + "summary": "Get sync gaps", + "description": "Get sync gaps for Archive.", + "operationId": "get_archive_sync_gaps", "parameters": [ { "name": "instanceName", @@ -1302,54 +5746,38 @@ "schema": { "type": "string" } - } - ], - "responses": { - "200": { - "description": "Successful response." }, - "400": { - "description": "Invalid request." + { + "name": "x-archive-key", + "in": "header", + "required": true, + "schema": { + "type": "string" + }, + "description": "Archive authorization key with the scope required by this operation." }, - "401": { - "description": "Missing or invalid API key." + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 1000 + } }, - "404": { - "description": "Instance or resource not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} + { + "name": "status", + "in": "query", + "required": false, + "schema": { + "type": "string" } - } - }, - "x-source": "src/api/routes/chat.router.ts" - } - }, - { - "method": "post", - "path": "/chat/findContacts/{instanceName}", - "source": "src/api/routes/chat.router.ts", - "operation": { - "tags": [ - "Chats" - ], - "summary": "Get find Contacts", - "description": "Get find Contacts for Chats.", - "operationId": "post_chat_findContacts", - "parameters": [ + }, { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", + "name": "entityJid", + "in": "query", + "required": false, "schema": { "type": "string" } @@ -1357,44 +5785,271 @@ ], "responses": { "200": { - "description": "Successful response." - }, - "400": { - "description": "Invalid request." - }, + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } } } }, - "x-source": "src/api/routes/chat.router.ts" + "x-source": "src/api/routes/archive.router.ts" } }, { "method": "post", - "path": "/chat/findMessages/{instanceName}", - "source": "src/api/routes/chat.router.ts", + "path": "/archive/verify/{instanceName}", + "source": "src/api/routes/archive.router.ts", + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Chats" + "Archive" ], - "summary": "Get find Messages", - "description": "Get find Messages for Chats.", - "operationId": "post_chat_findMessages", + "summary": "Run verify", + "description": "Run verify for Archive.", + "operationId": "post_archive_verify", "parameters": [ { "name": "instanceName", @@ -1404,48 +6059,309 @@ "schema": { "type": "string" } + }, + { + "name": "x-archive-key", + "in": "header", + "required": true, + "schema": { + "type": "string" + }, + "description": "Archive authorization key with the scope required by this operation." } ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, + "x-source": "src/api/routes/archive.router.ts", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "additionalProperties": false, + "properties": {}, + "required": [] + } } } - }, - "x-source": "src/api/routes/chat.router.ts" + } } }, { "method": "post", - "path": "/chat/findStatusMessage/{instanceName}", - "source": "src/api/routes/chat.router.ts", + "path": "/business/getCatalog/{instanceName}", + "source": "src/api/routes/business.router.ts", + "schemaName": "catalogSchema", + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string" + }, + "limit": { + "type": "number" + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Chats" + "Business & catalog" ], - "summary": "Get find Status Message", - "description": "Get find Status Message for Chats.", - "operationId": "post_chat_findStatusMessage", + "summary": "Get get Catalog", + "description": "Get get Catalog for Business & catalog.", + "operationId": "post_business_getCatalog", "parameters": [ { "name": "instanceName", @@ -1459,16 +6375,253 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -1477,26 +6630,47 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "number": { + "type": "string" + }, + "limit": { + "type": "number" + } + } + } } } }, - "x-source": "src/api/routes/chat.router.ts" + "x-validation-schema": "catalogSchema", + "x-source": "src/api/routes/business.router.ts" } }, { "method": "post", - "path": "/chat/getBase64FromMediaMessage/{instanceName}", - "source": "src/api/routes/chat.router.ts", + "path": "/business/getCollections/{instanceName}", + "source": "src/api/routes/business.router.ts", + "schemaName": "collectionsSchema", + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string" + }, + "limit": { + "type": "number" + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Chats" + "Business & catalog" ], - "summary": "Get get Base64 From Media Message", - "description": "Get get Base64 From Media Message for Chats.", - "operationId": "post_chat_getBase64FromMediaMessage", + "summary": "Get get Collections", + "description": "Get get Collections for Business & catalog.", + "operationId": "post_business_getCollections", "parameters": [ { "name": "instanceName", @@ -1510,16 +6684,253 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -1528,26 +6939,66 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} - } - } + "properties": { + "number": { + "type": "string" + }, + "limit": { + "type": "number" + } + } + } + } + } }, - "x-source": "src/api/routes/chat.router.ts" + "x-validation-schema": "collectionsSchema", + "x-source": "src/api/routes/business.router.ts" } }, { "method": "post", - "path": "/chat/markChatUnread/{instanceName}", - "source": "src/api/routes/chat.router.ts", + "path": "/call/offer/{instanceName}", + "source": "src/api/routes/call.router.ts", + "schemaName": "offerCallSchema", + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string", + "pattern": "^(?!@[^@\\s]+$).+", + "description": "Use a phone number or full WhatsApp JID. A raw @username must first be resolved to an authoritative @lid JID." + }, + "settingsTemplateId": { + "type": "string", + "minLength": 1 + }, + "isVideo": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "callDuration": { + "type": "integer", + "minimum": 1, + "maximum": 15 + } + }, + "required": [ + "number", + "callDuration" + ] + }, + "multipart": false, + "runtimeStatus": "CREATED", "operation": { "tags": [ - "Chats" + "Calls" ], - "summary": "Update mark Chat Unread", - "description": "Update mark Chat Unread for Chats.", - "operationId": "post_chat_markChatUnread", + "summary": "Create offer", + "description": "Create offer for Calls.", + "operationId": "post_call_offer", "parameters": [ { "name": "instanceName", @@ -1560,17 +7011,254 @@ } ], "responses": { - "200": { - "description": "Successful response." + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -1579,26 +7267,143 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "number": { + "type": "string", + "pattern": "^(?!@[^@\\s]+$).+", + "description": "Use a phone number or full WhatsApp JID. A raw @username must first be resolved to an authoritative @lid JID." + }, + "settingsTemplateId": { + "type": "string", + "minLength": 1 + }, + "isVideo": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "callDuration": { + "type": "integer", + "minimum": 1, + "maximum": 15 + } + }, + "required": [ + "number", + "callDuration" + ] + } } } }, - "x-source": "src/api/routes/chat.router.ts" + "x-validation-schema": "offerCallSchema", + "x-source": "src/api/routes/call.router.ts" } }, { "method": "post", - "path": "/chat/markMessageAsRead/{instanceName}", + "path": "/chat/archiveChat/{instanceName}", "source": "src/api/routes/chat.router.ts", + "schemaName": "archiveChatSchema", + "schema": { + "type": "object", + "properties": { + "chat": { + "type": "string" + }, + "lastMessage": { + "type": "object", + "properties": { + "key": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "remoteJid": { + "type": "string" + }, + "fromMe": { + "type": "boolean", + "enum": [ + true, + false + ] + } + }, + "required": [ + "id", + "fromMe", + "remoteJid" + ], + "if": { + "propertyNames": { + "enum": [ + "id", + "remoteJid" + ] + } + }, + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + }, + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + } + } + } + }, + "messageTimestamp": { + "type": "integer", + "minLength": 1 + } + }, + "required": [ + "key" + ], + "if": { + "propertyNames": { + "enum": [ + "messageTimestamp" + ] + } + }, + "then": { + "properties": { + "messageTimestamp": { + "minLength": 1, + "description": "The \"messageTimestamp\" cannot be empty" + } + } + } + }, + "archive": { + "type": "boolean", + "enum": [ + true, + false + ] + } + }, + "required": [ + "archive" + ] + }, + "multipart": false, + "runtimeStatus": "CREATED", "operation": { "tags": [ "Chats" ], - "summary": "Update mark Message As Read", - "description": "Update mark Message As Read for Chats.", - "operationId": "post_chat_markMessageAsRead", + "summary": "Update archive Chat", + "description": "Update archive Chat for Chats.", + "operationId": "post_chat_archiveChat", "parameters": [ { "name": "instanceName", @@ -1611,17 +7416,254 @@ } ], "responses": { - "200": { - "description": "Successful response." + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -1630,65 +7672,174 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "chat": { + "type": "string" + }, + "lastMessage": { + "type": "object", + "properties": { + "key": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "remoteJid": { + "type": "string" + }, + "fromMe": { + "type": "boolean", + "enum": [ + true, + false + ] + } + }, + "required": [ + "id", + "fromMe", + "remoteJid" + ], + "if": { + "propertyNames": { + "enum": [ + "id", + "remoteJid" + ] + } + }, + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + }, + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + } + } + } + }, + "messageTimestamp": { + "type": "integer", + "minLength": 1 + } + }, + "required": [ + "key" + ], + "if": { + "propertyNames": { + "enum": [ + "messageTimestamp" + ] + } + }, + "then": { + "properties": { + "messageTimestamp": { + "minLength": 1, + "description": "The \"messageTimestamp\" cannot be empty" + } + } + } + }, + "archive": { + "type": "boolean", + "enum": [ + true, + false + ] + } + }, + "required": [ + "archive" + ] + } } } }, + "x-validation-schema": "archiveChatSchema", "x-source": "src/api/routes/chat.router.ts" } }, { "method": "delete", - "path": "/chat/removeProfilePicture/{instanceName}", + "path": "/chat/deleteMessageForEveryone/{instanceName}", "source": "src/api/routes/chat.router.ts", - "operation": { - "tags": [ - "Chats" - ], - "summary": "Delete remove Profile Picture", - "description": "Delete remove Profile Picture for Chats.", - "operationId": "delete_chat_removeProfilePicture", - "parameters": [ - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" - } + "schemaName": "deleteMessageSchema", + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "fromMe": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "remoteJid": { + "type": "string", + "pattern": "^(?:\\d+@(?:s\\.whatsapp\\.net|lid)|\\d+-\\d+@g\\.us|status@broadcast|[^@\\s]+@broadcast)$", + "description": "remoteJid must be a full WhatsApp JID, not an internal database row ID." + }, + "remoteJidAlt": { + "type": "string" + }, + "participant": { + "type": "string" + }, + "participantAlt": { + "type": "string" + }, + "addressingMode": { + "type": "string", + "enum": [ + "lid", + "pn" + ] } + }, + "required": [ + "id", + "fromMe", + "remoteJid" ], - "responses": { - "200": { - "description": "Successful response." - }, - "400": { - "description": "Invalid request." - }, - "401": { - "description": "Missing or invalid API key." - }, - "404": { - "description": "Instance or resource not found." + "if": { + "propertyNames": { + "enum": [ + "id", + "remoteJid" + ] } }, - "x-source": "src/api/routes/chat.router.ts" - } - }, - { - "method": "post", - "path": "/chat/sendPresence/{instanceName}", - "source": "src/api/routes/chat.router.ts", + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + }, + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "CREATED", "operation": { "tags": [ "Chats" ], - "summary": "Create send Presence", - "description": "Create send Presence for Chats.", - "operationId": "post_chat_sendPresence", + "summary": "Delete delete Message For Everyone", + "description": "Delete delete Message For Everyone for Chats.", + "operationId": "delete_chat_deleteMessageForEveryone", "parameters": [ { "name": "instanceName", @@ -1701,45 +7852,353 @@ } ], "responses": { - "200": { - "description": "Successful response." + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "fromMe": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "remoteJid": { + "type": "string", + "pattern": "^(?:\\d+@(?:s\\.whatsapp\\.net|lid)|\\d+-\\d+@g\\.us|status@broadcast|[^@\\s]+@broadcast)$", + "description": "remoteJid must be a full WhatsApp JID, not an internal database row ID." + }, + "remoteJidAlt": { + "type": "string" + }, + "participant": { + "type": "string" + }, + "participantAlt": { + "type": "string" + }, + "addressingMode": { + "type": "string", + "enum": [ + "lid", + "pn" + ] + } + }, + "required": [ + "id", + "fromMe", + "remoteJid" + ], + "if": { + "propertyNames": { + "enum": [ + "id", + "remoteJid" + ] + } + }, + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + }, + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + } + } + } + } } } }, + "x-validation-schema": "deleteMessageSchema", "x-source": "src/api/routes/chat.router.ts" } }, { "method": "post", - "path": "/chat/updateBlockStatus/{instanceName}", + "path": "/chat/fetchBusinessProfile/{instanceName}", "source": "src/api/routes/chat.router.ts", + "schemaName": "profilePictureSchema", + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string" + }, + "picture": { + "type": "string" + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ "Chats" ], - "summary": "Update update Block Status", - "description": "Update update Block Status for Chats.", - "operationId": "post_chat_updateBlockStatus", + "summary": "Get fetch Business Profile", + "description": "Get fetch Business Profile for Chats.", + "operationId": "post_chat_fetchBusinessProfile", "parameters": [ { "name": "instanceName", @@ -1753,16 +8212,253 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -1771,26 +8467,36 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "number": { + "type": "string" + }, + "picture": { + "type": "string" + } + } + } } } }, + "x-validation-schema": "profilePictureSchema", "x-source": "src/api/routes/chat.router.ts" } }, { - "method": "post", - "path": "/chat/updateMessage/{instanceName}", + "method": "get", + "path": "/chat/fetchPrivacySettings/{instanceName}", "source": "src/api/routes/chat.router.ts", + "schemaName": "null", + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ "Chats" ], - "summary": "Update update Message", - "description": "Update update Message for Chats.", - "operationId": "post_chat_updateMessage", + "summary": "Get fetch Privacy Settings", + "description": "Get fetch Privacy Settings for Chats.", + "operationId": "get_chat_fetchPrivacySettings", "parameters": [ { "name": "instanceName", @@ -1804,44 +8510,293 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } } } }, + "x-validation-schema": "null", "x-source": "src/api/routes/chat.router.ts" } }, { "method": "post", - "path": "/chat/updatePrivacySettings/{instanceName}", + "path": "/chat/fetchProfile/{instanceName}", "source": "src/api/routes/chat.router.ts", + "schemaName": "profileSchema", + "schema": { + "type": "object", + "properties": { + "wuid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "picture": { + "type": "string" + }, + "status": { + "type": "string" + }, + "isBusiness": { + "type": "boolean" + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ "Chats" ], - "summary": "Update update Privacy Settings", - "description": "Update update Privacy Settings for Chats.", - "operationId": "post_chat_updatePrivacySettings", + "summary": "Get fetch Profile", + "description": "Get fetch Profile for Chats.", + "operationId": "post_chat_fetchProfile", "parameters": [ { "name": "instanceName", @@ -1855,16 +8810,253 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -1873,26 +9065,56 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "wuid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "picture": { + "type": "string" + }, + "status": { + "type": "string" + }, + "isBusiness": { + "type": "boolean" + } + } + } } } }, + "x-validation-schema": "profileSchema", "x-source": "src/api/routes/chat.router.ts" } }, { "method": "post", - "path": "/chat/updateProfileName/{instanceName}", + "path": "/chat/fetchProfilePictureUrl/{instanceName}", "source": "src/api/routes/chat.router.ts", + "schemaName": "profilePictureSchema", + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string" + }, + "picture": { + "type": "string" + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ "Chats" ], - "summary": "Update update Profile Name", - "description": "Update update Profile Name for Chats.", - "operationId": "post_chat_updateProfileName", + "summary": "Get fetch Profile Picture Url", + "description": "Get fetch Profile Picture Url for Chats.", + "operationId": "post_chat_fetchProfilePictureUrl", "parameters": [ { "name": "instanceName", @@ -1906,16 +9128,253 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -1924,26 +9383,35 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "number": { + "type": "string" + }, + "picture": { + "type": "string" + } + } + } } } }, + "x-validation-schema": "profilePictureSchema", "x-source": "src/api/routes/chat.router.ts" } }, { - "method": "post", - "path": "/chat/updateProfilePicture/{instanceName}", + "method": "get", + "path": "/chat/findChatByRemoteJid/{instanceName}", "source": "src/api/routes/chat.router.ts", + "multipart": false, + "runtimeStatus": "BAD_REQUEST", "operation": { "tags": [ "Chats" ], - "summary": "Update update Profile Picture", - "description": "Update update Profile Picture for Chats.", - "operationId": "post_chat_updateProfilePicture", + "summary": "Get find Chat By Remote Jid", + "description": "Get find Chat By Remote Jid for Chats.", + "operationId": "get_chat_findChatByRemoteJid", "parameters": [ { "name": "instanceName", @@ -1953,31 +9421,264 @@ "schema": { "type": "string" } + }, + { + "name": "remoteJid", + "in": "query", + "required": true, + "schema": { + "type": "string" + } } ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } } } }, @@ -1986,15 +9687,74 @@ }, { "method": "post", - "path": "/chat/updateProfileStatus/{instanceName}", + "path": "/chat/findChats/{instanceName}", "source": "src/api/routes/chat.router.ts", + "schemaName": "contactValidateSchema", + "schema": { + "type": "object", + "properties": { + "where": { + "type": "object", + "properties": { + "_id": { + "type": "string", + "minLength": 1 + }, + "pushName": { + "type": "string", + "minLength": 1 + }, + "id": { + "type": "string", + "minLength": 1 + }, + "remoteJid": { + "type": "string", + "minLength": 1 + } + }, + "if": { + "propertyNames": { + "enum": [ + "_id", + "id", + "pushName", + "remoteJid" + ] + } + }, + "then": { + "properties": { + "_id": { + "minLength": 1, + "description": "The \"_id\" cannot be empty" + }, + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + }, + "pushName": { + "minLength": 1, + "description": "The \"pushName\" cannot be empty" + }, + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + } + } + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ "Chats" ], - "summary": "Update update Profile Status", - "description": "Update update Profile Status for Chats.", - "operationId": "post_chat_updateProfileStatus", + "summary": "Get find Chats", + "description": "Get find Chats for Chats.", + "operationId": "post_chat_findChats", "parameters": [ { "name": "instanceName", @@ -2008,16 +9768,253 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -2026,26 +10023,137 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "where": { + "type": "object", + "properties": { + "_id": { + "type": "string", + "minLength": 1 + }, + "pushName": { + "type": "string", + "minLength": 1 + }, + "id": { + "type": "string", + "minLength": 1 + }, + "remoteJid": { + "type": "string", + "minLength": 1 + } + }, + "if": { + "propertyNames": { + "enum": [ + "_id", + "id", + "pushName", + "remoteJid" + ] + } + }, + "then": { + "properties": { + "_id": { + "minLength": 1, + "description": "The \"_id\" cannot be empty" + }, + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + }, + "pushName": { + "minLength": 1, + "description": "The \"pushName\" cannot be empty" + }, + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + } + } + } + } + } + } } } }, + "x-validation-schema": "contactValidateSchema", "x-source": "src/api/routes/chat.router.ts" } }, { "method": "post", - "path": "/chat/whatsappNumbers/{instanceName}", + "path": "/chat/findContacts/{instanceName}", "source": "src/api/routes/chat.router.ts", + "schemaName": "contactValidateSchema", + "schema": { + "type": "object", + "properties": { + "where": { + "type": "object", + "properties": { + "_id": { + "type": "string", + "minLength": 1 + }, + "pushName": { + "type": "string", + "minLength": 1 + }, + "id": { + "type": "string", + "minLength": 1 + }, + "remoteJid": { + "type": "string", + "minLength": 1 + } + }, + "if": { + "propertyNames": { + "enum": [ + "_id", + "id", + "pushName", + "remoteJid" + ] + } + }, + "then": { + "properties": { + "_id": { + "minLength": 1, + "description": "The \"_id\" cannot be empty" + }, + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + }, + "pushName": { + "minLength": 1, + "description": "The \"pushName\" cannot be empty" + }, + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + } + } + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ "Chats" ], - "summary": "Run whatsapp Numbers", - "description": "Run whatsapp Numbers for Chats.", - "operationId": "post_chat_whatsappNumbers", + "summary": "Get find Contacts", + "description": "Get find Contacts for Chats.", + "operationId": "post_chat_findContacts", "parameters": [ { "name": "instanceName", @@ -2059,44 +10167,404 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "where": { + "type": "object", + "properties": { + "_id": { + "type": "string", + "minLength": 1 + }, + "pushName": { + "type": "string", + "minLength": 1 + }, + "id": { + "type": "string", + "minLength": 1 + }, + "remoteJid": { + "type": "string", + "minLength": 1 + } + }, + "if": { + "propertyNames": { + "enum": [ + "_id", + "id", + "pushName", + "remoteJid" + ] + } + }, + "then": { + "properties": { + "_id": { + "minLength": 1, + "description": "The \"_id\" cannot be empty" + }, + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + }, + "pushName": { + "minLength": 1, + "description": "The \"pushName\" cannot be empty" + }, + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + } + } + } + } + } + } } } }, + "x-validation-schema": "contactValidateSchema", "x-source": "src/api/routes/chat.router.ts" } }, { - "method": "get", - "path": "/chatwoot/find/{instanceName}", - "source": "src/api/integrations/chatbot/chatwoot/routes/chatwoot.router.ts", + "method": "post", + "path": "/chat/findMessages/{instanceName}", + "source": "src/api/routes/chat.router.ts", + "schemaName": "messageValidateSchema", + "schema": { + "type": "object", + "properties": { + "where": { + "type": "object", + "properties": { + "_id": { + "type": "string", + "minLength": 1 + }, + "key": { + "type": "object", + "if": { + "propertyNames": { + "enum": [ + "fromMe", + "remoteJid", + "id" + ] + } + }, + "then": { + "properties": { + "remoteJid": { + "type": "string", + "minLength": 1, + "description": "The property cannot be empty" + }, + "id": { + "type": "string", + "minLength": 1, + "description": "The property cannot be empty" + }, + "fromMe": { + "type": "boolean", + "enum": [ + true, + false + ] + } + } + } + }, + "message": { + "type": "object" + } + }, + "if": { + "propertyNames": { + "enum": [ + "_id" + ] + } + }, + "then": { + "properties": { + "_id": { + "minLength": 1, + "description": "The \"_id\" cannot be empty" + } + } + } + }, + "limit": { + "type": "integer" + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Chatwoot" + "Chats" ], - "summary": "Get find", - "description": "Get find for Chatwoot.", - "operationId": "get_chatwoot_find", + "summary": "Get find Messages", + "description": "Get find Messages for Chats.", + "operationId": "post_chat_findMessages", "parameters": [ { "name": "instanceName", @@ -2110,32 +10578,421 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, - "x-source": "src/api/integrations/chatbot/chatwoot/routes/chatwoot.router.ts" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "where": { + "type": "object", + "properties": { + "_id": { + "type": "string", + "minLength": 1 + }, + "key": { + "type": "object", + "if": { + "propertyNames": { + "enum": [ + "fromMe", + "remoteJid", + "id" + ] + } + }, + "then": { + "properties": { + "remoteJid": { + "type": "string", + "minLength": 1, + "description": "The property cannot be empty" + }, + "id": { + "type": "string", + "minLength": 1, + "description": "The property cannot be empty" + }, + "fromMe": { + "type": "boolean", + "enum": [ + true, + false + ] + } + } + } + }, + "message": { + "type": "object" + } + }, + "if": { + "propertyNames": { + "enum": [ + "_id" + ] + } + }, + "then": { + "properties": { + "_id": { + "minLength": 1, + "description": "The \"_id\" cannot be empty" + } + } + } + }, + "limit": { + "type": "integer" + } + } + } + } + } + }, + "x-validation-schema": "messageValidateSchema", + "x-source": "src/api/routes/chat.router.ts" } }, { "method": "post", - "path": "/chatwoot/set/{instanceName}", - "source": "src/api/integrations/chatbot/chatwoot/routes/chatwoot.router.ts", + "path": "/chat/findStatusMessage/{instanceName}", + "source": "src/api/routes/chat.router.ts", + "schemaName": "messageUpSchema", + "schema": { + "type": "object", + "properties": { + "where": { + "type": "object", + "properties": { + "_id": { + "type": "string" + }, + "remoteJid": { + "type": "string" + }, + "id": { + "type": "string" + }, + "fromMe": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "participant": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "ERROR", + "PENDING", + "SERVER_ACK", + "DELIVERY_ACK", + "READ", + "PLAYED" + ] + } + }, + "if": { + "propertyNames": { + "enum": [ + "_id", + "remoteJid", + "id", + "status" + ] + } + }, + "then": { + "properties": { + "_id": { + "minLength": 1, + "description": "The \"_id\" cannot be empty" + }, + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + }, + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + }, + "status": { + "minLength": 1, + "description": "The \"status\" cannot be empty" + } + } + } + }, + "limit": { + "type": "integer" + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Chatwoot" + "Chats" ], - "summary": "Update set", - "description": "Update set for Chatwoot.", - "operationId": "post_chatwoot_set", + "summary": "Get find Status Message", + "description": "Get find Status Message for Chats.", + "operationId": "post_chat_findStatusMessage", "parameters": [ { "name": "instanceName", @@ -2149,16 +11006,253 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -2167,26 +11261,98 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "where": { + "type": "object", + "properties": { + "_id": { + "type": "string" + }, + "remoteJid": { + "type": "string" + }, + "id": { + "type": "string" + }, + "fromMe": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "participant": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "ERROR", + "PENDING", + "SERVER_ACK", + "DELIVERY_ACK", + "READ", + "PLAYED" + ] + } + }, + "if": { + "propertyNames": { + "enum": [ + "_id", + "remoteJid", + "id", + "status" + ] + } + }, + "then": { + "properties": { + "_id": { + "minLength": 1, + "description": "The \"_id\" cannot be empty" + }, + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + }, + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + }, + "status": { + "minLength": 1, + "description": "The \"status\" cannot be empty" + } + } + } + }, + "limit": { + "type": "integer" + } + } + } } } }, - "x-source": "src/api/integrations/chatbot/chatwoot/routes/chatwoot.router.ts" + "x-validation-schema": "messageUpSchema", + "x-source": "src/api/routes/chat.router.ts" } }, { "method": "post", - "path": "/chatwoot/webhook/{instanceName}", - "source": "src/api/integrations/chatbot/chatwoot/routes/chatwoot.router.ts", + "path": "/chat/getBase64FromMediaMessage/{instanceName}", + "source": "src/api/routes/chat.router.ts", + "schemaName": "null", + "multipart": false, + "runtimeStatus": "CREATED", "operation": { "tags": [ - "Chatwoot" + "Chats" ], - "summary": "Run webhook", - "description": "Run webhook for Chatwoot.", - "operationId": "post_chatwoot_webhook", + "summary": "Get get Base64 From Media Message", + "description": "Get get Base64 From Media Message for Chats.", + "operationId": "post_chat_getBase64FromMediaMessage", "parameters": [ { "name": "instanceName", @@ -2199,45 +11365,379 @@ } ], "responses": { - "200": { - "description": "Successful response." + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." - }, + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, + "x-validation-schema": "null", + "x-source": "src/api/routes/chat.router.ts", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "additionalProperties": false, + "properties": { + "message": { + "type": "object", + "additionalProperties": true, + "description": "Baileys WebMessageInfo object." + }, + "convertToMp4": { + "type": "boolean" + } + }, + "required": [ + "message" + ] + } } } - }, - "x-source": "src/api/integrations/chatbot/chatwoot/routes/chatwoot.router.ts" + } } }, { "method": "post", - "path": "/dify/changeStatus/{instanceName}", - "source": "src/api/integrations/chatbot/dify/routes/dify.router.ts", + "path": "/chat/markChatUnread/{instanceName}", + "source": "src/api/routes/chat.router.ts", + "schemaName": "markChatUnreadSchema", + "schema": { + "type": "object", + "properties": { + "chat": { + "type": "string" + }, + "lastMessage": { + "type": "object", + "properties": { + "key": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "remoteJid": { + "type": "string" + }, + "fromMe": { + "type": "boolean", + "enum": [ + true, + false + ] + } + }, + "required": [ + "id", + "fromMe", + "remoteJid" + ], + "if": { + "propertyNames": { + "enum": [ + "id", + "remoteJid" + ] + } + }, + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + }, + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + } + } + } + }, + "messageTimestamp": { + "type": "integer", + "minLength": 1 + } + }, + "required": [ + "key" + ], + "if": { + "propertyNames": { + "enum": [ + "messageTimestamp" + ] + } + }, + "then": { + "properties": { + "messageTimestamp": { + "minLength": 1, + "description": "The \"messageTimestamp\" cannot be empty" + } + } + } + } + }, + "required": [ + "lastMessage" + ] + }, + "multipart": false, + "runtimeStatus": "CREATED", "operation": { "tags": [ - "Dify" + "Chats" ], - "summary": "Update change Status", - "description": "Update change Status for Dify.", - "operationId": "post_dify_changeStatus", + "summary": "Update mark Chat Unread", + "description": "Update mark Chat Unread for Chats.", + "operationId": "post_chat_markChatUnread", "parameters": [ { "name": "instanceName", @@ -2250,17 +11750,254 @@ } ], "responses": { - "200": { - "description": "Successful response." + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -2269,26 +12006,161 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "chat": { + "type": "string" + }, + "lastMessage": { + "type": "object", + "properties": { + "key": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "remoteJid": { + "type": "string" + }, + "fromMe": { + "type": "boolean", + "enum": [ + true, + false + ] + } + }, + "required": [ + "id", + "fromMe", + "remoteJid" + ], + "if": { + "propertyNames": { + "enum": [ + "id", + "remoteJid" + ] + } + }, + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + }, + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + } + } + } + }, + "messageTimestamp": { + "type": "integer", + "minLength": 1 + } + }, + "required": [ + "key" + ], + "if": { + "propertyNames": { + "enum": [ + "messageTimestamp" + ] + } + }, + "then": { + "properties": { + "messageTimestamp": { + "minLength": 1, + "description": "The \"messageTimestamp\" cannot be empty" + } + } + } + } + }, + "required": [ + "lastMessage" + ] + } } } }, - "x-source": "src/api/integrations/chatbot/dify/routes/dify.router.ts" + "x-validation-schema": "markChatUnreadSchema", + "x-source": "src/api/routes/chat.router.ts" } }, { "method": "post", - "path": "/dify/create/{instanceName}", - "source": "src/api/integrations/chatbot/dify/routes/dify.router.ts", + "path": "/chat/markMessageAsRead/{instanceName}", + "source": "src/api/routes/chat.router.ts", + "schemaName": "readMessageSchema", + "schema": { + "type": "object", + "properties": { + "readMessages": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "properties": { + "id": { + "type": "string" + }, + "fromMe": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "remoteJid": { + "type": "string" + } + }, + "required": [ + "id", + "fromMe", + "remoteJid" + ], + "if": { + "propertyNames": { + "enum": [ + "id", + "remoteJid" + ] + } + }, + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + }, + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + } + } + } + } + } + }, + "required": [ + "readMessages" + ] + }, + "multipart": false, + "runtimeStatus": "CREATED", "operation": { "tags": [ - "Dify" + "Chats" ], - "summary": "Create create", - "description": "Create create for Dify.", - "operationId": "post_dify_create", + "summary": "Update mark Message As Read", + "description": "Update mark Message As Read for Chats.", + "operationId": "post_chat_markMessageAsRead", "parameters": [ { "name": "instanceName", @@ -2302,16 +12174,253 @@ ], "responses": { "201": { - "description": "Successful response." + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -2320,41 +12429,97 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "readMessages": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "properties": { + "id": { + "type": "string" + }, + "fromMe": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "remoteJid": { + "type": "string" + } + }, + "required": [ + "id", + "fromMe", + "remoteJid" + ], + "if": { + "propertyNames": { + "enum": [ + "id", + "remoteJid" + ] + } + }, + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + }, + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + } + } + } + } + } + }, + "required": [ + "readMessages" + ] + } } } }, - "x-source": "src/api/integrations/chatbot/dify/routes/dify.router.ts" + "x-validation-schema": "readMessageSchema", + "x-source": "src/api/routes/chat.router.ts" } }, { "method": "delete", - "path": "/dify/delete/{difyId}/{instanceName}", - "source": "src/api/integrations/chatbot/dify/routes/dify.router.ts", + "path": "/chat/removeProfilePicture/{instanceName}", + "source": "src/api/routes/chat.router.ts", + "schemaName": "profilePictureSchema", + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string" + }, + "picture": { + "type": "string" + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Dify" + "Chats" ], - "summary": "Delete delete", - "description": "Delete delete for Dify.", - "operationId": "delete_dify_delete", + "summary": "Delete remove Profile Picture", + "description": "Delete remove Profile Picture for Chats.", + "operationId": "delete_chat_removeProfilePicture", "parameters": [ { - "name": "difyId", + "name": "instanceName", "in": "path", "required": true, - "description": "Dify Id path parameter.", - "schema": { - "type": "string" - } - }, - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", + "description": "Evolution API instance name.", "schema": { "type": "string" } @@ -2362,90 +12527,319 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "x-source": "src/api/integrations/chatbot/dify/routes/dify.router.ts" - } - }, - { - "method": "get", - "path": "/dify/fetch/{difyId}/{instanceName}", - "source": "src/api/integrations/chatbot/dify/routes/dify.router.ts", - "operation": { - "tags": [ - "Dify" - ], - "summary": "Get fetch", - "description": "Get fetch for Dify.", - "operationId": "get_dify_fetch", - "parameters": [ - { - "name": "difyId", - "in": "path", - "required": true, - "description": "Dify Id path parameter.", - "schema": { - "type": "string" + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } } }, - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } } - } - ], - "responses": { - "200": { - "description": "Successful response." - }, - "400": { - "description": "Invalid request." }, - "401": { - "description": "Missing or invalid API key." + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } }, - "404": { - "description": "Instance or resource not found." + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, - "x-source": "src/api/integrations/chatbot/dify/routes/dify.router.ts" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string" + }, + "picture": { + "type": "string" + } + } + } + } + } + }, + "x-validation-schema": "profilePictureSchema", + "x-source": "src/api/routes/chat.router.ts" } }, { - "method": "get", - "path": "/dify/fetchSessions/{difyId}/{instanceName}", - "source": "src/api/integrations/chatbot/dify/routes/dify.router.ts", + "method": "post", + "path": "/chat/sendPresence/{instanceName}", + "source": "src/api/routes/chat.router.ts", + "schemaName": "presenceSchema", + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string", + "description": "Invalid format" + }, + "delay": { + "type": "number" + }, + "presence": { + "type": "string", + "enum": [ + "unavailable", + "available", + "composing", + "recording", + "paused" + ] + } + }, + "required": [ + "number", + "presence", + "delay" + ] + }, + "multipart": false, + "runtimeStatus": "CREATED", "operation": { "tags": [ - "Dify" + "Chats" ], - "summary": "Get fetch Sessions", - "description": "Get fetch Sessions for Dify.", - "operationId": "get_dify_fetchSessions", + "summary": "Create send Presence", + "description": "Create send Presence for Chats.", + "operationId": "post_chat_sendPresence", "parameters": [ - { - "name": "difyId", - "in": "path", - "required": true, - "description": "Dify Id path parameter.", - "schema": { - "type": "string" - } - }, { "name": "instanceName", "in": "path", @@ -2457,72 +12851,347 @@ } ], "responses": { - "200": { - "description": "Successful response." + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "x-source": "src/api/integrations/chatbot/dify/routes/dify.router.ts" - } - }, - { - "method": "get", - "path": "/dify/fetchSettings/{instanceName}", - "source": "src/api/integrations/chatbot/dify/routes/dify.router.ts", - "operation": { - "tags": [ - "Dify" - ], - "summary": "Get fetch Settings", - "description": "Get fetch Settings for Dify.", - "operationId": "get_dify_fetchSettings", - "parameters": [ - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } } - } - ], - "responses": { - "200": { - "description": "Successful response." }, - "400": { - "description": "Invalid request." + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } }, - "401": { - "description": "Missing or invalid API key." + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } }, - "404": { - "description": "Instance or resource not found." + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, - "x-source": "src/api/integrations/chatbot/dify/routes/dify.router.ts" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string", + "description": "Invalid format" + }, + "delay": { + "type": "number" + }, + "presence": { + "type": "string", + "enum": [ + "unavailable", + "available", + "composing", + "recording", + "paused" + ] + } + }, + "required": [ + "number", + "presence", + "delay" + ] + } + } + } + }, + "x-validation-schema": "presenceSchema", + "x-source": "src/api/routes/chat.router.ts" } }, { - "method": "get", - "path": "/dify/find/{instanceName}", - "source": "src/api/integrations/chatbot/dify/routes/dify.router.ts", + "method": "post", + "path": "/chat/updateBlockStatus/{instanceName}", + "source": "src/api/routes/chat.router.ts", + "schemaName": "blockUserSchema", + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "block", + "unblock" + ] + } + }, + "required": [ + "number", + "status" + ], + "if": { + "propertyNames": { + "enum": [ + "number", + "status" + ] + } + }, + "then": { + "properties": { + "number": { + "minLength": 1, + "description": "The \"number\" cannot be empty" + }, + "status": { + "minLength": 1, + "description": "The \"status\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "CREATED", "operation": { "tags": [ - "Dify" + "Chats" ], - "summary": "Get find", - "description": "Get find for Dify.", - "operationId": "get_dify_find", + "summary": "Update update Block Status", + "description": "Update update Block Status for Chats.", + "operationId": "post_chat_updateBlockStatus", "parameters": [ { "name": "instanceName", @@ -2535,56 +13204,254 @@ } ], "responses": { - "200": { - "description": "Successful response." + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." - }, - "401": { - "description": "Missing or invalid API key." - }, - "404": { - "description": "Instance or resource not found." - } - }, - "x-source": "src/api/integrations/chatbot/dify/routes/dify.router.ts" - } - }, - { - "method": "post", - "path": "/dify/ignoreJid/{instanceName}", - "source": "src/api/integrations/chatbot/dify/routes/dify.router.ts", - "operation": { - "tags": [ - "Dify" - ], - "summary": "Update ignore Jid", - "description": "Update ignore Jid for Dify.", - "operationId": "post_dify_ignoreJid", - "parameters": [ - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } } - } - ], - "responses": { - "200": { - "description": "Successful response." - }, - "400": { - "description": "Invalid request." }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -2593,87 +13460,144 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "number": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "block", + "unblock" + ] + } + }, + "required": [ + "number", + "status" + ], + "if": { + "propertyNames": { + "enum": [ + "number", + "status" + ] + } + }, + "then": { + "properties": { + "number": { + "minLength": 1, + "description": "The \"number\" cannot be empty" + }, + "status": { + "minLength": 1, + "description": "The \"status\" cannot be empty" + } + } + } + } } } }, - "x-source": "src/api/integrations/chatbot/dify/routes/dify.router.ts" + "x-validation-schema": "blockUserSchema", + "x-source": "src/api/routes/chat.router.ts" } }, { "method": "post", - "path": "/dify/settings/{instanceName}", - "source": "src/api/integrations/chatbot/dify/routes/dify.router.ts", - "operation": { - "tags": [ - "Dify" - ], - "summary": "Update settings", - "description": "Update settings for Dify.", - "operationId": "post_dify_settings", - "parameters": [ - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" + "path": "/chat/updateMessage/{instanceName}", + "source": "src/api/routes/chat.router.ts", + "schemaName": "updateMessageSchema", + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string" + }, + "text": { + "type": "string" + }, + "key": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "remoteJid": { + "type": "string" + }, + "fromMe": { + "type": "boolean", + "enum": [ + true, + false + ] + } + }, + "required": [ + "id", + "fromMe", + "remoteJid" + ], + "if": { + "propertyNames": { + "enum": [ + "id", + "remoteJid" + ] + } + }, + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + }, + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + } + } } } - ], - "responses": { - "200": { - "description": "Successful response." - }, - "400": { - "description": "Invalid request." - }, - "401": { - "description": "Missing or invalid API key." - }, - "404": { - "description": "Instance or resource not found." + }, + "if": { + "propertyNames": { + "enum": [ + "number", + "text", + "key" + ] } }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} + "then": { + "properties": { + "number": { + "minLength": 1, + "description": "The \"number\" cannot be empty" + }, + "text": { + "minLength": 1, + "description": "The \"text\" cannot be empty" + }, + "key": { + "minLength": 1, + "description": "The \"key\" cannot be empty" } } - }, - "x-source": "src/api/integrations/chatbot/dify/routes/dify.router.ts" - } - }, - { - "method": "put", - "path": "/dify/update/{difyId}/{instanceName}", - "source": "src/api/integrations/chatbot/dify/routes/dify.router.ts", + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Dify" + "Chats" ], - "summary": "Update update", - "description": "Update update for Dify.", - "operationId": "put_dify_update", + "summary": "Update update Message", + "description": "Update update Message for Chats.", + "operationId": "post_chat_updateMessage", "parameters": [ - { - "name": "difyId", - "in": "path", - "required": true, - "description": "Dify Id path parameter.", - "schema": { - "type": "string" - } - }, { "name": "instanceName", "in": "path", @@ -2686,16 +13610,253 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -2704,26 +13865,207 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "number": { + "type": "string" + }, + "text": { + "type": "string" + }, + "key": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "remoteJid": { + "type": "string" + }, + "fromMe": { + "type": "boolean", + "enum": [ + true, + false + ] + } + }, + "required": [ + "id", + "fromMe", + "remoteJid" + ], + "if": { + "propertyNames": { + "enum": [ + "id", + "remoteJid" + ] + } + }, + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + }, + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + } + } + } + } + }, + "if": { + "propertyNames": { + "enum": [ + "number", + "text", + "key" + ] + } + }, + "then": { + "properties": { + "number": { + "minLength": 1, + "description": "The \"number\" cannot be empty" + }, + "text": { + "minLength": 1, + "description": "The \"text\" cannot be empty" + }, + "key": { + "minLength": 1, + "description": "The \"key\" cannot be empty" + } + } + } + } } } }, - "x-source": "src/api/integrations/chatbot/dify/routes/dify.router.ts" + "x-validation-schema": "updateMessageSchema", + "x-source": "src/api/routes/chat.router.ts" } }, { "method": "post", - "path": "/evoai/changeStatus/{instanceName}", - "source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts", + "path": "/chat/updatePrivacySettings/{instanceName}", + "source": "src/api/routes/chat.router.ts", + "schemaName": "privacySettingsSchema", + "schema": { + "type": "object", + "properties": { + "readreceipts": { + "type": "string", + "enum": [ + "all", + "none" + ] + }, + "profile": { + "type": "string", + "enum": [ + "all", + "contacts", + "contact_blacklist", + "none" + ] + }, + "status": { + "type": "string", + "enum": [ + "all", + "contacts", + "contact_blacklist", + "none" + ] + }, + "online": { + "type": "string", + "enum": [ + "all", + "match_last_seen" + ] + }, + "last": { + "type": "string", + "enum": [ + "all", + "contacts", + "contact_blacklist", + "none" + ] + }, + "groupadd": { + "type": "string", + "enum": [ + "all", + "contacts", + "contact_blacklist", + "none" + ] + } + }, + "required": [ + "readreceipts", + "profile", + "status", + "online", + "last", + "groupadd" + ], + "if": { + "propertyNames": { + "enum": [ + "readreceipts", + "profile", + "status", + "online", + "last", + "groupadd" + ] + } + }, + "then": { + "properties": { + "readreceipts": { + "minLength": 1, + "description": "The \"readreceipts\" cannot be empty" + }, + "profile": { + "minLength": 1, + "description": "The \"profile\" cannot be empty" + }, + "status": { + "minLength": 1, + "description": "The \"status\" cannot be empty" + }, + "online": { + "minLength": 1, + "description": "The \"online\" cannot be empty" + }, + "last": { + "minLength": 1, + "description": "The \"last\" cannot be empty" + }, + "groupadd": { + "minLength": 1, + "description": "The \"groupadd\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "CREATED", "operation": { "tags": [ - "EvoAI" + "Chats" ], - "summary": "Update change Status", - "description": "Update change Status for EvoAI.", - "operationId": "post_evoai_changeStatus", + "summary": "Update update Privacy Settings", + "description": "Update update Privacy Settings for Chats.", + "operationId": "post_chat_updatePrivacySettings", "parameters": [ { "name": "instanceName", @@ -2736,18 +14078,255 @@ } ], "responses": { - "200": { - "description": "Successful response." + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." - }, - "401": { - "description": "Missing or invalid API key." - }, - "404": { - "description": "Instance or resource not found." - } + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } }, "requestBody": { "required": true, @@ -2755,26 +14334,151 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "readreceipts": { + "type": "string", + "enum": [ + "all", + "none" + ] + }, + "profile": { + "type": "string", + "enum": [ + "all", + "contacts", + "contact_blacklist", + "none" + ] + }, + "status": { + "type": "string", + "enum": [ + "all", + "contacts", + "contact_blacklist", + "none" + ] + }, + "online": { + "type": "string", + "enum": [ + "all", + "match_last_seen" + ] + }, + "last": { + "type": "string", + "enum": [ + "all", + "contacts", + "contact_blacklist", + "none" + ] + }, + "groupadd": { + "type": "string", + "enum": [ + "all", + "contacts", + "contact_blacklist", + "none" + ] + } + }, + "required": [ + "readreceipts", + "profile", + "status", + "online", + "last", + "groupadd" + ], + "if": { + "propertyNames": { + "enum": [ + "readreceipts", + "profile", + "status", + "online", + "last", + "groupadd" + ] + } + }, + "then": { + "properties": { + "readreceipts": { + "minLength": 1, + "description": "The \"readreceipts\" cannot be empty" + }, + "profile": { + "minLength": 1, + "description": "The \"profile\" cannot be empty" + }, + "status": { + "minLength": 1, + "description": "The \"status\" cannot be empty" + }, + "online": { + "minLength": 1, + "description": "The \"online\" cannot be empty" + }, + "last": { + "minLength": 1, + "description": "The \"last\" cannot be empty" + }, + "groupadd": { + "minLength": 1, + "description": "The \"groupadd\" cannot be empty" + } + } + } + } } } }, - "x-source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts" + "x-validation-schema": "privacySettingsSchema", + "x-source": "src/api/routes/chat.router.ts" } }, { "method": "post", - "path": "/evoai/create/{instanceName}", - "source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts", + "path": "/chat/updateProfileName/{instanceName}", + "source": "src/api/routes/chat.router.ts", + "schemaName": "profileNameSchema", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "if": { + "propertyNames": { + "enum": [ + "name" + ] + } + }, + "then": { + "properties": { + "name": { + "minLength": 1, + "description": "The \"name\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "EvoAI" + "Chats" ], - "summary": "Create create", - "description": "Create create for EvoAI.", - "operationId": "post_evoai_create", + "summary": "Update update Profile Name", + "description": "Update update Profile Name for Chats.", + "operationId": "post_chat_updateProfileName", "parameters": [ { "name": "instanceName", @@ -2787,17 +14491,254 @@ } ], "responses": { - "201": { - "description": "Successful response." + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -2806,36 +14747,60 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "name": { + "type": "string" + } + }, + "if": { + "propertyNames": { + "enum": [ + "name" + ] + } + }, + "then": { + "properties": { + "name": { + "minLength": 1, + "description": "The \"name\" cannot be empty" + } + } + } + } } } }, - "x-source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts" + "x-validation-schema": "profileNameSchema", + "x-source": "src/api/routes/chat.router.ts" } }, { - "method": "delete", - "path": "/evoai/delete/{evoaiId}/{instanceName}", - "source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts", + "method": "post", + "path": "/chat/updateProfilePicture/{instanceName}", + "source": "src/api/routes/chat.router.ts", + "schemaName": "profilePictureSchema", + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string" + }, + "picture": { + "type": "string" + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "EvoAI" + "Chats" ], - "summary": "Delete delete", - "description": "Delete delete for EvoAI.", - "operationId": "delete_evoai_delete", + "summary": "Update update Profile Picture", + "description": "Update update Profile Picture for Chats.", + "operationId": "post_chat_updateProfilePicture", "parameters": [ - { - "name": "evoaiId", - "in": "path", - "required": true, - "description": "Evoai Id path parameter.", - "schema": { - "type": "string" - } - }, { "name": "instanceName", "in": "path", @@ -2848,90 +14813,315 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "x-source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts" - } - }, - { - "method": "get", - "path": "/evoai/fetch/{evoaiId}/{instanceName}", - "source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts", - "operation": { - "tags": [ - "EvoAI" - ], - "summary": "Get fetch", - "description": "Get fetch for EvoAI.", - "operationId": "get_evoai_fetch", - "parameters": [ - { - "name": "evoaiId", - "in": "path", - "required": true, - "description": "Evoai Id path parameter.", - "schema": { - "type": "string" + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } } }, - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } } - } - ], - "responses": { - "200": { - "description": "Successful response." }, - "400": { - "description": "Invalid request." + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } }, - "401": { - "description": "Missing or invalid API key." - }, - "404": { - "description": "Instance or resource not found." + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, - "x-source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string" + }, + "picture": { + "type": "string" + } + } + } + } + } + }, + "x-validation-schema": "profilePictureSchema", + "x-source": "src/api/routes/chat.router.ts" } }, { - "method": "get", - "path": "/evoai/fetchSessions/{evoaiId}/{instanceName}", - "source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts", + "method": "post", + "path": "/chat/updateProfileStatus/{instanceName}", + "source": "src/api/routes/chat.router.ts", + "schemaName": "profileStatusSchema", + "schema": { + "type": "object", + "properties": { + "status": { + "type": "string" + } + }, + "if": { + "propertyNames": { + "enum": [ + "status" + ] + } + }, + "then": { + "properties": { + "status": { + "minLength": 1, + "description": "The \"status\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "EvoAI" + "Chats" ], - "summary": "Get fetch Sessions", - "description": "Get fetch Sessions for EvoAI.", - "operationId": "get_evoai_fetchSessions", + "summary": "Update update Profile Status", + "description": "Update update Profile Status for Chats.", + "operationId": "post_chat_updateProfileStatus", "parameters": [ - { - "name": "evoaiId", - "in": "path", - "required": true, - "description": "Evoai Id path parameter.", - "schema": { - "type": "string" - } - }, { "name": "instanceName", "in": "path", @@ -2944,32 +15134,317 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, - "x-source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "status": { + "type": "string" + } + }, + "if": { + "propertyNames": { + "enum": [ + "status" + ] + } + }, + "then": { + "properties": { + "status": { + "minLength": 1, + "description": "The \"status\" cannot be empty" + } + } + } + } + } + } + }, + "x-validation-schema": "profileStatusSchema", + "x-source": "src/api/routes/chat.router.ts" } }, { - "method": "get", - "path": "/evoai/fetchSettings/{instanceName}", - "source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts", + "method": "post", + "path": "/chat/whatsappNumbers/{instanceName}", + "source": "src/api/routes/chat.router.ts", + "schemaName": "whatsappNumberSchema", + "schema": { + "type": "object", + "properties": { + "numbers": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "description": "\"numbers\" must be an array of numeric strings" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "EvoAI" + "Chats" ], - "summary": "Get fetch Settings", - "description": "Get fetch Settings for EvoAI.", - "operationId": "get_evoai_fetchSettings", + "summary": "Run whatsapp Numbers", + "description": "Run whatsapp Numbers for Chats.", + "operationId": "post_chat_whatsappNumbers", "parameters": [ { "name": "instanceName", @@ -2983,32 +15458,568 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, - "x-source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "numbers": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "description": "\"numbers\" must be an array of numeric strings" + } + } + } + } + } + } + }, + "x-validation-schema": "whatsappNumberSchema", + "x-source": "src/api/routes/chat.router.ts" } }, { "method": "get", - "path": "/evoai/find/{instanceName}", - "source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts", + "path": "/chatwoot/find/{instanceName}", + "source": "src/api/integrations/chatbot/chatwoot/routes/chatwoot.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "EvoAI" + "Chatwoot" ], "summary": "Get find", - "description": "Get find for EvoAI.", - "operationId": "get_evoai_find", + "description": "Get find for Chatwoot.", + "operationId": "get_chatwoot_find", "parameters": [ { "name": "instanceName", @@ -3022,83 +16033,418 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "x-source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts" - } - }, - { - "method": "post", - "path": "/evoai/ignoreJid/{instanceName}", - "source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts", - "operation": { - "tags": [ - "EvoAI" - ], - "summary": "Update ignore Jid", - "description": "Update ignore Jid for EvoAI.", - "operationId": "post_evoai_ignoreJid", - "parameters": [ - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } } - } - ], - "responses": { - "200": { - "description": "Successful response." }, - "400": { - "description": "Invalid request." + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } }, - "401": { - "description": "Missing or invalid API key." + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } }, - "404": { - "description": "Instance or resource not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } } } }, - "x-source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts" + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/chatwoot/routes/chatwoot.router.ts" } }, { "method": "post", - "path": "/evoai/settings/{instanceName}", - "source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts", + "path": "/chatwoot/set/{instanceName}", + "source": "src/api/integrations/chatbot/chatwoot/routes/chatwoot.router.ts", + "schemaName": "chatwootSchema", + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "accountId": { + "type": "string" + }, + "token": { + "type": "string" + }, + "url": { + "type": "string" + }, + "signMsg": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "signDelimiter": { + "type": [ + "string", + "null" + ] + }, + "nameInbox": { + "type": [ + "string", + "null" + ] + }, + "reopenConversation": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "conversationPending": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "autoCreate": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "importContacts": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "mergeBrazilContacts": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "importMessages": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "daysLimitImportMessages": { + "type": "number" + }, + "ignoreJids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "enabled", + "accountId", + "token", + "url", + "signMsg", + "reopenConversation", + "conversationPending" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "accountId", + "token", + "url", + "signMsg", + "reopenConversation", + "conversationPending" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "accountId": { + "minLength": 1, + "description": "The \"accountId\" cannot be empty" + }, + "token": { + "minLength": 1, + "description": "The \"token\" cannot be empty" + }, + "url": { + "minLength": 1, + "description": "The \"url\" cannot be empty" + }, + "signMsg": { + "minLength": 1, + "description": "The \"signMsg\" cannot be empty" + }, + "reopenConversation": { + "minLength": 1, + "description": "The \"reopenConversation\" cannot be empty" + }, + "conversationPending": { + "minLength": 1, + "description": "The \"conversationPending\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "CREATED", "operation": { "tags": [ - "EvoAI" + "Chatwoot" ], - "summary": "Update settings", - "description": "Update settings for EvoAI.", - "operationId": "post_evoai_settings", + "summary": "Update set", + "description": "Update set for Chatwoot.", + "operationId": "post_chatwoot_set", "parameters": [ { "name": "instanceName", @@ -3111,17 +16457,254 @@ } ], "responses": { - "200": { - "description": "Successful response." + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -3130,86 +16713,444 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "accountId": { + "type": "string" + }, + "token": { + "type": "string" + }, + "url": { + "type": "string" + }, + "signMsg": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "signDelimiter": { + "type": [ + "string", + "null" + ] + }, + "nameInbox": { + "type": [ + "string", + "null" + ] + }, + "reopenConversation": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "conversationPending": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "autoCreate": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "importContacts": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "mergeBrazilContacts": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "importMessages": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "daysLimitImportMessages": { + "type": "number" + }, + "ignoreJids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "enabled", + "accountId", + "token", + "url", + "signMsg", + "reopenConversation", + "conversationPending" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "accountId", + "token", + "url", + "signMsg", + "reopenConversation", + "conversationPending" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "accountId": { + "minLength": 1, + "description": "The \"accountId\" cannot be empty" + }, + "token": { + "minLength": 1, + "description": "The \"token\" cannot be empty" + }, + "url": { + "minLength": 1, + "description": "The \"url\" cannot be empty" + }, + "signMsg": { + "minLength": 1, + "description": "The \"signMsg\" cannot be empty" + }, + "reopenConversation": { + "minLength": 1, + "description": "The \"reopenConversation\" cannot be empty" + }, + "conversationPending": { + "minLength": 1, + "description": "The \"conversationPending\" cannot be empty" + } + } + } + } } } }, - "x-source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts" + "x-validation-schema": "chatwootSchema", + "x-source": "src/api/integrations/chatbot/chatwoot/routes/chatwoot.router.ts" } }, { - "method": "put", - "path": "/evoai/update/{evoaiId}/{instanceName}", - "source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts", - "operation": { - "tags": [ - "EvoAI" - ], - "summary": "Update update", - "description": "Update update for EvoAI.", - "operationId": "put_evoai_update", - "parameters": [ - { - "name": "evoaiId", - "in": "path", - "required": true, - "description": "Evoai Id path parameter.", - "schema": { - "type": "string" + "method": "post", + "path": "/chatwoot/webhook/{instanceName}", + "source": "src/api/integrations/chatbot/chatwoot/routes/chatwoot.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] } }, - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] } - } - ], - "responses": { - "200": { - "description": "Successful response." }, - "400": { - "description": "Invalid request." + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } }, - "401": { - "description": "Missing or invalid API key." + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } }, - "404": { - "description": "Instance or resource not found." + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" } }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} - } + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] } }, - "x-source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts" - } - }, - { - "method": "post", - "path": "/evolutionBot/changeStatus/{instanceName}", - "source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts", + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Evolution Bot" + "Chatwoot" ], - "summary": "Update change Status", - "description": "Update change Status for Evolution Bot.", - "operationId": "post_evolutionBot_changeStatus", + "summary": "Run webhook", + "description": "Run webhook for Chatwoot.", + "operationId": "post_chatwoot_webhook", "parameters": [ { "name": "instanceName", @@ -3223,17 +17164,254 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." - }, - "401": { - "description": "Missing or invalid API key." - }, - "404": { - "description": "Instance or resource not found." - } + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } }, "requestBody": { "required": true, @@ -3241,26 +17419,340 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + } } } }, - "x-source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts" + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/chatwoot/routes/chatwoot.router.ts" } }, { "method": "post", - "path": "/evolutionBot/create/{instanceName}", - "source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts", + "path": "/dify/changeStatus/{instanceName}", + "source": "src/api/integrations/chatbot/dify/routes/dify.router.ts", + "schemaName": "difyStatusSchema", + "schema": { + "type": "object", + "properties": { + "remoteJid": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "opened", + "closed", + "paused", + "delete" + ] + } + }, + "required": [ + "remoteJid", + "status" + ], + "if": { + "propertyNames": { + "enum": [ + "remoteJid", + "status" + ] + } + }, + "then": { + "properties": { + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + }, + "status": { + "minLength": 1, + "description": "The \"status\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Evolution Bot" + "Dify" ], - "summary": "Create create", - "description": "Create create for Evolution Bot.", - "operationId": "post_evolutionBot_create", + "summary": "Update change Status", + "description": "Update change Status for Dify.", + "operationId": "post_dify_changeStatus", "parameters": [ { "name": "instanceName", @@ -3273,17 +17765,254 @@ } ], "responses": { - "201": { - "description": "Successful response." + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -3292,84 +18021,181 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "remoteJid": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "opened", + "closed", + "paused", + "delete" + ] + } + }, + "required": [ + "remoteJid", + "status" + ], + "if": { + "propertyNames": { + "enum": [ + "remoteJid", + "status" + ] + } + }, + "then": { + "properties": { + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + }, + "status": { + "minLength": 1, + "description": "The \"status\" cannot be empty" + } + } + } + } } } }, - "x-source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts" + "x-validation-schema": "difyStatusSchema", + "x-source": "src/api/integrations/chatbot/dify/routes/dify.router.ts" } }, { - "method": "delete", - "path": "/evolutionBot/delete/{evolutionBotId}/{instanceName}", - "source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts", - "operation": { - "tags": [ - "Evolution Bot" - ], - "summary": "Delete delete", - "description": "Delete delete for Evolution Bot.", - "operationId": "delete_evolutionBot_delete", - "parameters": [ - { - "name": "evolutionBotId", - "in": "path", - "required": true, - "description": "Evolution Bot Id path parameter.", - "schema": { + "method": "post", + "path": "/dify/create/{instanceName}", + "source": "src/api/integrations/chatbot/dify/routes/dify.router.ts", + "schemaName": "difySchema", + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "botType": { + "type": "string", + "enum": [ + "chatBot", + "textGenerator", + "agent", + "workflow" + ] + }, + "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" } }, - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" - } + "splitMessages": { + "type": "boolean" + }, + "timePerChar": { + "type": "integer" } + }, + "required": [ + "enabled", + "botType", + "triggerType" ], - "responses": { - "200": { - "description": "Successful response." - }, - "400": { - "description": "Invalid request." - }, - "401": { - "description": "Missing or invalid API key." - }, - "404": { - "description": "Instance or resource not found." + "if": { + "propertyNames": { + "enum": [ + "enabled", + "botType", + "triggerType" + ] } }, - "x-source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts" - } - }, - { - "method": "get", - "path": "/evolutionBot/fetch/{evolutionBotId}/{instanceName}", - "source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts", + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "botType": { + "minLength": 1, + "description": "The \"botType\" cannot be empty" + }, + "triggerType": { + "minLength": 1, + "description": "The \"triggerType\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "CREATED", "operation": { "tags": [ - "Evolution Bot" + "Dify" ], - "summary": "Get fetch", - "description": "Get fetch for Evolution Bot.", - "operationId": "get_evolutionBot_fetch", + "summary": "Create create", + "description": "Create create for Dify.", + "operationId": "post_dify_create", "parameters": [ - { - "name": "evolutionBotId", - "in": "path", - "required": true, - "description": "Evolution Bot Id path parameter.", - "schema": { - "type": "string" - } - }, { "name": "instanceName", "in": "path", @@ -3381,160 +18207,679 @@ } ], "responses": { - "200": { - "description": "Successful response." - }, - "400": { - "description": "Invalid request." + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "x-source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts" - } - }, - { - "method": "get", - "path": "/evolutionBot/fetchSessions/{evolutionBotId}/{instanceName}", - "source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts", - "operation": { - "tags": [ - "Evolution Bot" - ], - "summary": "Get fetch Sessions", - "description": "Get fetch Sessions for Evolution Bot.", - "operationId": "get_evolutionBot_fetchSessions", - "parameters": [ - { - "name": "evolutionBotId", - "in": "path", - "required": true, - "description": "Evolution Bot Id path parameter.", - "schema": { - "type": "string" + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } } }, - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } } - } - ], - "responses": { - "200": { - "description": "Successful response." - }, - "400": { - "description": "Invalid request." }, - "401": { - "description": "Missing or invalid API key." + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } }, - "404": { - "description": "Instance or resource not found." + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, - "x-source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "botType": { + "type": "string", + "enum": [ + "chatBot", + "textGenerator", + "agent", + "workflow" + ] + }, + "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", + "botType", + "triggerType" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "botType", + "triggerType" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "botType": { + "minLength": 1, + "description": "The \"botType\" cannot be empty" + }, + "triggerType": { + "minLength": 1, + "description": "The \"triggerType\" cannot be empty" + } + } + } + } + } + } + }, + "x-validation-schema": "difySchema", + "x-source": "src/api/integrations/chatbot/dify/routes/dify.router.ts" } }, { - "method": "get", - "path": "/evolutionBot/fetchSettings/{instanceName}", - "source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts", - "operation": { - "tags": [ - "Evolution Bot" - ], - "summary": "Get fetch Settings", - "description": "Get fetch Settings for Evolution Bot.", - "operationId": "get_evolutionBot_fetchSettings", - "parameters": [ - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" + "method": "delete", + "path": "/dify/delete/{difyId}/{instanceName}", + "source": "src/api/integrations/chatbot/dify/routes/dify.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] } - } - ], - "responses": { - "200": { - "description": "Successful response." }, - "400": { - "description": "Invalid request." + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } }, - "401": { - "description": "Missing or invalid API key." + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } }, - "404": { - "description": "Instance or resource not found." + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" } }, - "x-source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts" - } - }, - { - "method": "get", - "path": "/evolutionBot/find/{instanceName}", - "source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts", + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Evolution Bot" + "Dify" ], - "summary": "Get find", - "description": "Get find for Evolution Bot.", - "operationId": "get_evolutionBot_find", + "summary": "Delete delete", + "description": "Delete delete for Dify.", + "operationId": "delete_dify_delete", "parameters": [ { - "name": "instanceName", + "name": "difyId", "in": "path", "required": true, - "description": "Evolution API instance name.", + "description": "Dify Id path parameter.", "schema": { "type": "string" } - } - ], - "responses": { - "200": { - "description": "Successful response." - }, - "400": { - "description": "Invalid request." - }, - "401": { - "description": "Missing or invalid API key." }, - "404": { - "description": "Instance or resource not found." - } - }, - "x-source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts" - } - }, - { - "method": "post", - "path": "/evolutionBot/ignoreJid/{instanceName}", - "source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts", - "operation": { - "tags": [ - "Evolution Bot" - ], - "summary": "Update ignore Jid", - "description": "Update ignore Jid for Evolution Bot.", - "operationId": "post_evolutionBot_ignoreJid", - "parameters": [ { "name": "instanceName", "in": "path", @@ -3547,67 +18892,253 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } } - } - }, - "x-source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts" - } - }, - { - "method": "post", - "path": "/evolutionBot/settings/{instanceName}", - "source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts", - "operation": { - "tags": [ - "Evolution Bot" - ], - "summary": "Update settings", - "description": "Update settings for Evolution Bot.", - "operationId": "post_evolutionBot_settings", - "parameters": [ - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Successful response." }, - "400": { - "description": "Invalid request." + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } }, - "401": { - "description": "Missing or invalid API key." + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } }, - "404": { - "description": "Instance or resource not found." + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -3616,32 +19147,579 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + } } } }, - "x-source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts" + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/dify/routes/dify.router.ts" } }, { - "method": "put", - "path": "/evolutionBot/update/{evolutionBotId}/{instanceName}", - "source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts", + "method": "get", + "path": "/dify/fetch/{difyId}/{instanceName}", + "source": "src/api/integrations/chatbot/dify/routes/dify.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Evolution Bot" + "Dify" ], - "summary": "Update update", - "description": "Update update for Evolution Bot.", - "operationId": "put_evolutionBot_update", + "summary": "Get fetch", + "description": "Get fetch for Dify.", + "operationId": "get_dify_fetch", "parameters": [ { - "name": "evolutionBotId", + "name": "difyId", "in": "path", "required": true, - "description": "Evolution Bot Id path parameter.", + "description": "Dify Id path parameter.", "schema": { "type": "string" } @@ -3658,45 +19736,557 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } } } }, - "x-source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts" + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/dify/routes/dify.router.ts" } }, { - "method": "post", - "path": "/flowise/changeStatus/{instanceName}", - "source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts", + "method": "get", + "path": "/dify/fetchSessions/{difyId}/{instanceName}", + "source": "src/api/integrations/chatbot/dify/routes/dify.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Flowise" + "Dify" ], - "summary": "Update change Status", - "description": "Update change Status for Flowise.", - "operationId": "post_flowise_changeStatus", + "summary": "Get fetch Sessions", + "description": "Get fetch Sessions for Dify.", + "operationId": "get_dify_fetchSessions", "parameters": [ + { + "name": "difyId", + "in": "path", + "required": true, + "description": "Dify Id path parameter.", + "schema": { + "type": "string" + } + }, { "name": "instanceName", "in": "path", @@ -3709,105 +20299,548 @@ ], "responses": { "200": { - "description": "Successful response." - }, + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } } } }, - "x-source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts" + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/dify/routes/dify.router.ts" } }, { - "method": "post", - "path": "/flowise/create/{instanceName}", - "source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts", - "operation": { - "tags": [ - "Flowise" - ], - "summary": "Create create", - "description": "Create create for Flowise.", - "operationId": "post_flowise_create", - "parameters": [ - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" + "method": "get", + "path": "/dify/fetchSettings/{instanceName}", + "source": "src/api/integrations/chatbot/dify/routes/dify.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] } - } - ], - "responses": { - "201": { - "description": "Successful response." }, - "400": { - "description": "Invalid request." + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } }, - "401": { - "description": "Missing or invalid API key." + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } }, - "404": { - "description": "Instance or resource not found." + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" } }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} - } + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] } }, - "x-source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts" - } - }, - { - "method": "delete", - "path": "/flowise/delete/{flowiseId}/{instanceName}", - "source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts", + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Flowise" + "Dify" ], - "summary": "Delete delete", - "description": "Delete delete for Flowise.", - "operationId": "delete_flowise_delete", + "summary": "Get fetch Settings", + "description": "Get fetch Settings for Dify.", + "operationId": "get_dify_fetchSettings", "parameters": [ - { - "name": "flowiseId", - "in": "path", - "required": true, - "description": "Flowise Id path parameter.", - "schema": { - "type": "string" - } - }, { "name": "instanceName", "in": "path", @@ -3820,90 +20853,548 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, - "x-source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts" + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/dify/routes/dify.router.ts" } }, { "method": "get", - "path": "/flowise/fetch/{flowiseId}/{instanceName}", - "source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts", - "operation": { - "tags": [ - "Flowise" - ], - "summary": "Get fetch", - "description": "Get fetch for Flowise.", - "operationId": "get_flowise_fetch", - "parameters": [ - { - "name": "flowiseId", - "in": "path", - "required": true, - "description": "Flowise Id path parameter.", - "schema": { - "type": "string" + "path": "/dify/find/{instanceName}", + "source": "src/api/integrations/chatbot/dify/routes/dify.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] } }, - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] } - } - ], - "responses": { - "200": { - "description": "Successful response." }, - "400": { - "description": "Invalid request." + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } }, - "401": { - "description": "Missing or invalid API key." + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } }, - "404": { - "description": "Instance or resource not found." + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" } }, - "x-source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts" - } - }, - { - "method": "get", - "path": "/flowise/fetchSessions/{flowiseId}/{instanceName}", - "source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts", + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Flowise" + "Dify" ], - "summary": "Get fetch Sessions", - "description": "Get fetch Sessions for Flowise.", - "operationId": "get_flowise_fetchSessions", + "summary": "Get find", + "description": "Get find for Dify.", + "operationId": "get_dify_find", "parameters": [ - { - "name": "flowiseId", - "in": "path", - "required": true, - "description": "Flowise Id path parameter.", - "schema": { - "type": "string" - } - }, { "name": "instanceName", "in": "path", @@ -3916,110 +21407,312 @@ ], "responses": { "200": { - "description": "Successful response." - }, - "400": { - "description": "Invalid request." - }, - "401": { - "description": "Missing or invalid API key." - }, - "404": { - "description": "Instance or resource not found." - } - }, - "x-source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts" - } - }, - { - "method": "get", - "path": "/flowise/fetchSettings/{instanceName}", - "source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts", - "operation": { - "tags": [ - "Flowise" - ], - "summary": "Get fetch Settings", - "description": "Get fetch Settings for Flowise.", - "operationId": "get_flowise_fetchSettings", - "parameters": [ - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } } - } - ], - "responses": { - "200": { - "description": "Successful response." }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "x-source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts" - } - }, - { - "method": "get", - "path": "/flowise/find/{instanceName}", - "source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts", - "operation": { - "tags": [ - "Flowise" - ], - "summary": "Get find", - "description": "Get find for Flowise.", - "operationId": "get_flowise_find", - "parameters": [ - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } } - } - ], - "responses": { - "200": { - "description": "Successful response." }, - "400": { - "description": "Invalid request." + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } }, - "401": { - "description": "Missing or invalid API key." + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } }, - "404": { - "description": "Instance or resource not found." + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, - "x-source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts" + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/dify/routes/dify.router.ts" } }, { "method": "post", - "path": "/flowise/ignoreJid/{instanceName}", - "source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts", + "path": "/dify/ignoreJid/{instanceName}", + "source": "src/api/integrations/chatbot/dify/routes/dify.router.ts", + "schemaName": "difyIgnoreJidSchema", + "schema": { + "type": "object", + "properties": { + "remoteJid": { + "type": "string" + }, + "action": { + "type": "string", + "enum": [ + "add", + "remove" + ] + } + }, + "required": [ + "remoteJid", + "action" + ], + "if": { + "propertyNames": { + "enum": [ + "remoteJid", + "action" + ] + } + }, + "then": { + "properties": { + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + }, + "action": { + "minLength": 1, + "description": "The \"action\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Flowise" + "Dify" ], "summary": "Update ignore Jid", - "description": "Update ignore Jid for Flowise.", - "operationId": "post_flowise_ignoreJid", + "description": "Update ignore Jid for Dify.", + "operationId": "post_dify_ignoreJid", "parameters": [ { "name": "instanceName", @@ -4033,16 +21726,253 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -4051,87 +21981,187 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "remoteJid": { + "type": "string" + }, + "action": { + "type": "string", + "enum": [ + "add", + "remove" + ] + } + }, + "required": [ + "remoteJid", + "action" + ], + "if": { + "propertyNames": { + "enum": [ + "remoteJid", + "action" + ] + } + }, + "then": { + "properties": { + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + }, + "action": { + "minLength": 1, + "description": "The \"action\" cannot be empty" + } + } + } + } } } }, - "x-source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts" + "x-validation-schema": "difyIgnoreJidSchema", + "x-source": "src/api/integrations/chatbot/dify/routes/dify.router.ts" } }, { "method": "post", - "path": "/flowise/settings/{instanceName}", - "source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts", - "operation": { - "tags": [ - "Flowise" - ], - "summary": "Update settings", - "description": "Update settings for Flowise.", - "operationId": "post_flowise_settings", - "parameters": [ - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { + "path": "/dify/settings/{instanceName}", + "source": "src/api/integrations/chatbot/dify/routes/dify.router.ts", + "schemaName": "difySettingSchema", + "schema": { + "type": "object", + "properties": { + "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" } - } - ], - "responses": { - "200": { - "description": "Successful response." }, - "400": { - "description": "Invalid request." + "difyIdFallback": { + "type": "string" }, - "401": { - "description": "Missing or invalid API key." + "splitMessages": { + "type": "boolean" }, - "404": { - "description": "Instance or resource not found." + "timePerChar": { + "type": "integer" } }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} - } + "required": [ + "expire", + "keywordFinish", + "delayMessage", + "unknownMessage", + "listeningFromMe", + "stopBotFromMe", + "keepOpen", + "debounceTime", + "ignoreJids", + "splitMessages", + "timePerChar" + ], + "if": { + "propertyNames": { + "enum": [ + "expire", + "keywordFinish", + "delayMessage", + "unknownMessage", + "listeningFromMe", + "stopBotFromMe", + "keepOpen", + "debounceTime", + "ignoreJids", + "splitMessages", + "timePerChar" + ] } }, - "x-source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts" - } - }, - { - "method": "put", - "path": "/flowise/update/{flowiseId}/{instanceName}", - "source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts", + "then": { + "properties": { + "expire": { + "minLength": 1, + "description": "The \"expire\" cannot be empty" + }, + "keywordFinish": { + "minLength": 1, + "description": "The \"keywordFinish\" cannot be empty" + }, + "delayMessage": { + "minLength": 1, + "description": "The \"delayMessage\" cannot be empty" + }, + "unknownMessage": { + "minLength": 1, + "description": "The \"unknownMessage\" cannot be empty" + }, + "listeningFromMe": { + "minLength": 1, + "description": "The \"listeningFromMe\" cannot be empty" + }, + "stopBotFromMe": { + "minLength": 1, + "description": "The \"stopBotFromMe\" cannot be empty" + }, + "keepOpen": { + "minLength": 1, + "description": "The \"keepOpen\" cannot be empty" + }, + "debounceTime": { + "minLength": 1, + "description": "The \"debounceTime\" cannot be empty" + }, + "ignoreJids": { + "minLength": 1, + "description": "The \"ignoreJids\" cannot be empty" + }, + "splitMessages": { + "minLength": 1, + "description": "The \"splitMessages\" cannot be empty" + }, + "timePerChar": { + "minLength": 1, + "description": "The \"timePerChar\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Flowise" + "Dify" ], - "summary": "Update update", - "description": "Update update for Flowise.", - "operationId": "put_flowise_update", + "summary": "Update settings", + "description": "Update settings for Dify.", + "operationId": "post_dify_settings", "parameters": [ - { - "name": "flowiseId", - "in": "path", - "required": true, - "description": "Flowise Id path parameter.", - "schema": { - "type": "string" - } - }, { "name": "instanceName", "in": "path", @@ -4144,16 +22174,253 @@ ], "responses": { "200": { - "description": "Successful response." - }, + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -4162,66 +22429,271 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "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" + } + }, + "difyIdFallback": { + "type": "string" + }, + "splitMessages": { + "type": "boolean" + }, + "timePerChar": { + "type": "integer" + } + }, + "required": [ + "expire", + "keywordFinish", + "delayMessage", + "unknownMessage", + "listeningFromMe", + "stopBotFromMe", + "keepOpen", + "debounceTime", + "ignoreJids", + "splitMessages", + "timePerChar" + ], + "if": { + "propertyNames": { + "enum": [ + "expire", + "keywordFinish", + "delayMessage", + "unknownMessage", + "listeningFromMe", + "stopBotFromMe", + "keepOpen", + "debounceTime", + "ignoreJids", + "splitMessages", + "timePerChar" + ] + } + }, + "then": { + "properties": { + "expire": { + "minLength": 1, + "description": "The \"expire\" cannot be empty" + }, + "keywordFinish": { + "minLength": 1, + "description": "The \"keywordFinish\" cannot be empty" + }, + "delayMessage": { + "minLength": 1, + "description": "The \"delayMessage\" cannot be empty" + }, + "unknownMessage": { + "minLength": 1, + "description": "The \"unknownMessage\" cannot be empty" + }, + "listeningFromMe": { + "minLength": 1, + "description": "The \"listeningFromMe\" cannot be empty" + }, + "stopBotFromMe": { + "minLength": 1, + "description": "The \"stopBotFromMe\" cannot be empty" + }, + "keepOpen": { + "minLength": 1, + "description": "The \"keepOpen\" cannot be empty" + }, + "debounceTime": { + "minLength": 1, + "description": "The \"debounceTime\" cannot be empty" + }, + "ignoreJids": { + "minLength": 1, + "description": "The \"ignoreJids\" cannot be empty" + }, + "splitMessages": { + "minLength": 1, + "description": "The \"splitMessages\" cannot be empty" + }, + "timePerChar": { + "minLength": 1, + "description": "The \"timePerChar\" cannot be empty" + } + } + } + } } } }, - "x-source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts" + "x-validation-schema": "difySettingSchema", + "x-source": "src/api/integrations/chatbot/dify/routes/dify.router.ts" } }, { - "method": "get", - "path": "/group/acceptInviteCode/{instanceName}", - "source": "src/api/routes/group.router.ts", + "method": "put", + "path": "/dify/update/{difyId}/{instanceName}", + "source": "src/api/integrations/chatbot/dify/routes/dify.router.ts", + "schemaName": "difySchema", + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "botType": { + "type": "string", + "enum": [ + "chatBot", + "textGenerator", + "agent", + "workflow" + ] + }, + "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", + "botType", + "triggerType" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "botType", + "triggerType" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "botType": { + "minLength": 1, + "description": "The \"botType\" cannot be empty" + }, + "triggerType": { + "minLength": 1, + "description": "The \"triggerType\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Groups" + "Dify" ], - "summary": "Update accept Invite Code", - "description": "Update accept Invite Code for Groups.", - "operationId": "get_group_acceptInviteCode", + "summary": "Update update", + "description": "Update update for Dify.", + "operationId": "put_dify_update", "parameters": [ { - "name": "instanceName", + "name": "difyId", "in": "path", "required": true, - "description": "Evolution API instance name.", + "description": "Dify Id path parameter.", "schema": { "type": "string" } - } - ], - "responses": { - "200": { - "description": "Successful response." - }, - "400": { - "description": "Invalid request." }, - "401": { - "description": "Missing or invalid API key." - }, - "404": { - "description": "Instance or resource not found." - } - }, - "x-source": "src/api/routes/group.router.ts" - } - }, - { - "method": "post", - "path": "/group/create/{instanceName}", - "source": "src/api/routes/group.router.ts", - "operation": { - "tags": [ - "Groups" - ], - "summary": "Create create", - "description": "Create create for Groups.", - "operationId": "post_group_create", - "parameters": [ { "name": "instanceName", "in": "path", @@ -4233,17 +22705,254 @@ } ], "responses": { - "201": { - "description": "Successful response." + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -4252,26 +22961,180 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "enabled": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "botType": { + "type": "string", + "enum": [ + "chatBot", + "textGenerator", + "agent", + "workflow" + ] + }, + "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", + "botType", + "triggerType" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "botType", + "triggerType" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "botType": { + "minLength": 1, + "description": "The \"botType\" cannot be empty" + }, + "triggerType": { + "minLength": 1, + "description": "The \"triggerType\" cannot be empty" + } + } + } + } } } }, - "x-source": "src/api/routes/group.router.ts" + "x-validation-schema": "difySchema", + "x-source": "src/api/integrations/chatbot/dify/routes/dify.router.ts" } }, { - "method": "get", - "path": "/group/fetchAllGroups/{instanceName}", - "source": "src/api/routes/group.router.ts", + "method": "post", + "path": "/evoai/changeStatus/{instanceName}", + "source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts", + "schemaName": "evoaiStatusSchema", + "schema": { + "type": "object", + "properties": { + "remoteJid": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "opened", + "closed", + "paused", + "delete" + ] + } + }, + "required": [ + "remoteJid", + "status" + ], + "if": { + "propertyNames": { + "enum": [ + "remoteJid", + "status" + ] + } + }, + "then": { + "properties": { + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + }, + "status": { + "minLength": 1, + "description": "The \"status\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Groups" + "EvoAI" ], - "summary": "Get fetch All Groups", - "description": "Get fetch All Groups for Groups.", - "operationId": "get_group_fetchAllGroups", + "summary": "Update change Status", + "description": "Update change Status for EvoAI.", + "operationId": "post_evoai_changeStatus", "parameters": [ { "name": "instanceName", @@ -4285,32 +23148,426 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." - }, - "404": { - "description": "Instance or resource not found." - } - }, - "x-source": "src/api/routes/group.router.ts" + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "remoteJid": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "opened", + "closed", + "paused", + "delete" + ] + } + }, + "required": [ + "remoteJid", + "status" + ], + "if": { + "propertyNames": { + "enum": [ + "remoteJid", + "status" + ] + } + }, + "then": { + "properties": { + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + }, + "status": { + "minLength": 1, + "description": "The \"status\" cannot be empty" + } + } + } + } + } + } + }, + "x-validation-schema": "evoaiStatusSchema", + "x-source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts" } }, { - "method": "get", - "path": "/group/findGroupInfos/{instanceName}", - "source": "src/api/routes/group.router.ts", + "method": "post", + "path": "/evoai/create/{instanceName}", + "source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts", + "schemaName": "evoaiSchema", + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "agentUrl": { + "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", + "agentUrl", + "triggerType" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "agentUrl", + "triggerType" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "agentUrl": { + "minLength": 1, + "description": "The \"agentUrl\" cannot be empty" + }, + "triggerType": { + "minLength": 1, + "description": "The \"triggerType\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "CREATED", "operation": { "tags": [ - "Groups" + "EvoAI" ], - "summary": "Get find Group Infos", - "description": "Get find Group Infos for Groups.", - "operationId": "get_group_findGroupInfos", + "summary": "Create create", + "description": "Create create for EvoAI.", + "operationId": "post_evoai_create", "parameters": [ { "name": "instanceName", @@ -4323,73 +23580,670 @@ } ], "responses": { - "200": { - "description": "Successful response." + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, - "x-source": "src/api/routes/group.router.ts" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "agentUrl": { + "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", + "agentUrl", + "triggerType" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "agentUrl", + "triggerType" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "agentUrl": { + "minLength": 1, + "description": "The \"agentUrl\" cannot be empty" + }, + "triggerType": { + "minLength": 1, + "description": "The \"triggerType\" cannot be empty" + } + } + } + } + } + } + }, + "x-validation-schema": "evoaiSchema", + "x-source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts" } }, { - "method": "get", - "path": "/group/inviteCode/{instanceName}", - "source": "src/api/routes/group.router.ts", + "method": "delete", + "path": "/evoai/delete/{evoaiId}/{instanceName}", + "source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Groups" + "EvoAI" ], - "summary": "Get invite Code", - "description": "Get invite Code for Groups.", - "operationId": "get_group_inviteCode", + "summary": "Delete delete", + "description": "Delete delete for EvoAI.", + "operationId": "delete_evoai_delete", "parameters": [ { - "name": "instanceName", + "name": "evoaiId", "in": "path", "required": true, - "description": "Evolution API instance name.", + "description": "Evoai Id path parameter.", "schema": { "type": "string" } - } - ], - "responses": { - "200": { - "description": "Successful response." - }, - "400": { - "description": "Invalid request." }, - "401": { - "description": "Missing or invalid API key." - }, - "404": { - "description": "Instance or resource not found." - } - }, - "x-source": "src/api/routes/group.router.ts" - } - }, - { - "method": "get", - "path": "/group/inviteInfo/{instanceName}", - "source": "src/api/routes/group.router.ts", - "operation": { - "tags": [ - "Groups" - ], - "summary": "Get invite Info", - "description": "Get invite Info for Groups.", - "operationId": "get_group_inviteInfo", - "parameters": [ { "name": "instanceName", "in": "path", @@ -4402,33 +24256,838 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." - }, - "401": { - "description": "Missing or invalid API key." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, - "x-source": "src/api/routes/group.router.ts" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + } + } + } + }, + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts" } }, { - "method": "delete", - "path": "/group/leaveGroup/{instanceName}", - "source": "src/api/routes/group.router.ts", + "method": "get", + "path": "/evoai/fetch/{evoaiId}/{instanceName}", + "source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Groups" + "EvoAI" ], - "summary": "Delete leave Group", - "description": "Delete leave Group for Groups.", - "operationId": "delete_group_leaveGroup", + "summary": "Get fetch", + "description": "Get fetch for EvoAI.", + "operationId": "get_evoai_fetch", "parameters": [ + { + "name": "evoaiId", + "in": "path", + "required": true, + "description": "Evoai Id path parameter.", + "schema": { + "type": "string" + } + }, { "name": "instanceName", "in": "path", @@ -4441,33 +25100,557 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, - "x-source": "src/api/routes/group.router.ts" + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts" } }, { "method": "get", - "path": "/group/participants/{instanceName}", - "source": "src/api/routes/group.router.ts", + "path": "/evoai/fetchSessions/{evoaiId}/{instanceName}", + "source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Groups" + "EvoAI" ], - "summary": "Get participants", - "description": "Get participants for Groups.", - "operationId": "get_group_participants", + "summary": "Get fetch Sessions", + "description": "Get fetch Sessions for EvoAI.", + "operationId": "get_evoai_fetchSessions", "parameters": [ + { + "name": "evoaiId", + "in": "path", + "required": true, + "description": "Evoai Id path parameter.", + "schema": { + "type": "string" + } + }, { "name": "instanceName", "in": "path", @@ -4480,32 +25663,547 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." - }, - "401": { - "description": "Missing or invalid API key." - }, + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, - "x-source": "src/api/routes/group.router.ts" + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts" } }, { - "method": "post", - "path": "/group/revokeInviteCode/{instanceName}", - "source": "src/api/routes/group.router.ts", + "method": "get", + "path": "/evoai/fetchSettings/{instanceName}", + "source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Groups" + "EvoAI" ], - "summary": "Delete revoke Invite Code", - "description": "Delete revoke Invite Code for Groups.", - "operationId": "post_group_revokeInviteCode", + "summary": "Get fetch Settings", + "description": "Get fetch Settings for EvoAI.", + "operationId": "get_evoai_fetchSettings", "parameters": [ { "name": "instanceName", @@ -4519,44 +26217,547 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } } } }, - "x-source": "src/api/routes/group.router.ts" + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts" } }, { - "method": "post", - "path": "/group/sendInvite/{instanceName}", - "source": "src/api/routes/group.router.ts", + "method": "get", + "path": "/evoai/find/{instanceName}", + "source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Groups" + "EvoAI" ], - "summary": "Create send Invite", - "description": "Create send Invite for Groups.", - "operationId": "post_group_sendInvite", + "summary": "Get find", + "description": "Get find for EvoAI.", + "operationId": "get_evoai_find", "parameters": [ { "name": "instanceName", @@ -4570,44 +26771,312 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } } } }, - "x-source": "src/api/routes/group.router.ts" + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts" } }, { "method": "post", - "path": "/group/toggleEphemeral/{instanceName}", - "source": "src/api/routes/group.router.ts", + "path": "/evoai/ignoreJid/{instanceName}", + "source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts", + "schemaName": "evoaiIgnoreJidSchema", + "schema": { + "type": "object", + "properties": { + "remoteJid": { + "type": "string" + }, + "action": { + "type": "string", + "enum": [ + "add", + "remove" + ] + } + }, + "required": [ + "remoteJid", + "action" + ], + "if": { + "propertyNames": { + "enum": [ + "remoteJid", + "action" + ] + } + }, + "then": { + "properties": { + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + }, + "action": { + "minLength": 1, + "description": "The \"action\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Groups" + "EvoAI" ], - "summary": "Update toggle Ephemeral", - "description": "Update toggle Ephemeral for Groups.", - "operationId": "post_group_toggleEphemeral", + "summary": "Update ignore Jid", + "description": "Update ignore Jid for EvoAI.", + "operationId": "post_evoai_ignoreJid", "parameters": [ { "name": "instanceName", @@ -4621,16 +27090,253 @@ ], "responses": { "200": { - "description": "Successful response." - }, - "400": { - "description": "Invalid request." - }, - "401": { - "description": "Missing or invalid API key." - }, + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -4639,77 +27345,186 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "remoteJid": { + "type": "string" + }, + "action": { + "type": "string", + "enum": [ + "add", + "remove" + ] + } + }, + "required": [ + "remoteJid", + "action" + ], + "if": { + "propertyNames": { + "enum": [ + "remoteJid", + "action" + ] + } + }, + "then": { + "properties": { + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + }, + "action": { + "minLength": 1, + "description": "The \"action\" cannot be empty" + } + } + } + } } } }, - "x-source": "src/api/routes/group.router.ts" + "x-validation-schema": "evoaiIgnoreJidSchema", + "x-source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts" } }, { "method": "post", - "path": "/group/updateGroupDescription/{instanceName}", - "source": "src/api/routes/group.router.ts", - "operation": { - "tags": [ - "Groups" - ], - "summary": "Update update Group Description", - "description": "Update update Group Description for Groups.", - "operationId": "post_group_updateGroupDescription", - "parameters": [ - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { + "path": "/evoai/settings/{instanceName}", + "source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts", + "schemaName": "evoaiSettingSchema", + "schema": { + "type": "object", + "properties": { + "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" } - } - ], - "responses": { - "200": { - "description": "Successful response." }, - "400": { - "description": "Invalid request." + "botIdFallback": { + "type": "string" }, - "401": { - "description": "Missing or invalid API key." + "splitMessages": { + "type": "boolean" }, - "404": { - "description": "Instance or resource not found." + "timePerChar": { + "type": "integer" } }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} - } + "required": [ + "expire", + "keywordFinish", + "delayMessage", + "unknownMessage", + "listeningFromMe", + "stopBotFromMe", + "keepOpen", + "debounceTime", + "ignoreJids", + "splitMessages", + "timePerChar" + ], + "if": { + "propertyNames": { + "enum": [ + "expire", + "keywordFinish", + "delayMessage", + "unknownMessage", + "listeningFromMe", + "stopBotFromMe", + "keepOpen", + "debounceTime", + "ignoreJids", + "splitMessages", + "timePerChar" + ] } }, - "x-source": "src/api/routes/group.router.ts" - } - }, - { - "method": "post", - "path": "/group/updateGroupPicture/{instanceName}", - "source": "src/api/routes/group.router.ts", + "then": { + "properties": { + "expire": { + "minLength": 1, + "description": "The \"expire\" cannot be empty" + }, + "keywordFinish": { + "minLength": 1, + "description": "The \"keywordFinish\" cannot be empty" + }, + "delayMessage": { + "minLength": 1, + "description": "The \"delayMessage\" cannot be empty" + }, + "unknownMessage": { + "minLength": 1, + "description": "The \"unknownMessage\" cannot be empty" + }, + "listeningFromMe": { + "minLength": 1, + "description": "The \"listeningFromMe\" cannot be empty" + }, + "stopBotFromMe": { + "minLength": 1, + "description": "The \"stopBotFromMe\" cannot be empty" + }, + "keepOpen": { + "minLength": 1, + "description": "The \"keepOpen\" cannot be empty" + }, + "debounceTime": { + "minLength": 1, + "description": "The \"debounceTime\" cannot be empty" + }, + "ignoreJids": { + "minLength": 1, + "description": "The \"ignoreJids\" cannot be empty" + }, + "splitMessages": { + "minLength": 1, + "description": "The \"splitMessages\" cannot be empty" + }, + "timePerChar": { + "minLength": 1, + "description": "The \"timePerChar\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Groups" + "EvoAI" ], - "summary": "Update update Group Picture", - "description": "Update update Group Picture for Groups.", - "operationId": "post_group_updateGroupPicture", + "summary": "Update settings", + "description": "Update settings for EvoAI.", + "operationId": "post_evoai_settings", "parameters": [ { "name": "instanceName", @@ -4723,16 +27538,253 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -4741,27 +27793,262 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "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" + } + }, + "botIdFallback": { + "type": "string" + }, + "splitMessages": { + "type": "boolean" + }, + "timePerChar": { + "type": "integer" + } + }, + "required": [ + "expire", + "keywordFinish", + "delayMessage", + "unknownMessage", + "listeningFromMe", + "stopBotFromMe", + "keepOpen", + "debounceTime", + "ignoreJids", + "splitMessages", + "timePerChar" + ], + "if": { + "propertyNames": { + "enum": [ + "expire", + "keywordFinish", + "delayMessage", + "unknownMessage", + "listeningFromMe", + "stopBotFromMe", + "keepOpen", + "debounceTime", + "ignoreJids", + "splitMessages", + "timePerChar" + ] + } + }, + "then": { + "properties": { + "expire": { + "minLength": 1, + "description": "The \"expire\" cannot be empty" + }, + "keywordFinish": { + "minLength": 1, + "description": "The \"keywordFinish\" cannot be empty" + }, + "delayMessage": { + "minLength": 1, + "description": "The \"delayMessage\" cannot be empty" + }, + "unknownMessage": { + "minLength": 1, + "description": "The \"unknownMessage\" cannot be empty" + }, + "listeningFromMe": { + "minLength": 1, + "description": "The \"listeningFromMe\" cannot be empty" + }, + "stopBotFromMe": { + "minLength": 1, + "description": "The \"stopBotFromMe\" cannot be empty" + }, + "keepOpen": { + "minLength": 1, + "description": "The \"keepOpen\" cannot be empty" + }, + "debounceTime": { + "minLength": 1, + "description": "The \"debounceTime\" cannot be empty" + }, + "ignoreJids": { + "minLength": 1, + "description": "The \"ignoreJids\" cannot be empty" + }, + "splitMessages": { + "minLength": 1, + "description": "The \"splitMessages\" cannot be empty" + }, + "timePerChar": { + "minLength": 1, + "description": "The \"timePerChar\" cannot be empty" + } + } + } + } } } }, - "x-source": "src/api/routes/group.router.ts" + "x-validation-schema": "evoaiSettingSchema", + "x-source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts" } }, { - "method": "post", - "path": "/group/updateGroupSubject/{instanceName}", - "source": "src/api/routes/group.router.ts", + "method": "put", + "path": "/evoai/update/{evoaiId}/{instanceName}", + "source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts", + "schemaName": "evoaiSchema", + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "agentUrl": { + "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", + "agentUrl", + "triggerType" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "agentUrl", + "triggerType" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "agentUrl": { + "minLength": 1, + "description": "The \"agentUrl\" cannot be empty" + }, + "triggerType": { + "minLength": 1, + "description": "The \"triggerType\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Groups" + "EvoAI" ], - "summary": "Update update Group Subject", - "description": "Update update Group Subject for Groups.", - "operationId": "post_group_updateGroupSubject", + "summary": "Update update", + "description": "Update update for EvoAI.", + "operationId": "put_evoai_update", "parameters": [ + { + "name": "evoaiId", + "in": "path", + "required": true, + "description": "Evoai Id path parameter.", + "schema": { + "type": "string" + } + }, { "name": "instanceName", "in": "path", @@ -4774,67 +28061,253 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} - } - } - }, - "x-source": "src/api/routes/group.router.ts" - } - }, - { - "method": "post", - "path": "/group/updateParticipant/{instanceName}", - "source": "src/api/routes/group.router.ts", - "operation": { - "tags": [ - "Groups" - ], - "summary": "Update update Participant", - "description": "Update update Participant for Groups.", - "operationId": "post_group_updateParticipant", - "parameters": [ - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } } - } - ], - "responses": { - "200": { - "description": "Successful response." }, - "400": { - "description": "Invalid request." + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } }, - "401": { - "description": "Missing or invalid API key." + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } }, - "404": { - "description": "Instance or resource not found." + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -4843,26 +28316,171 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "enabled": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "agentUrl": { + "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", + "agentUrl", + "triggerType" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "agentUrl", + "triggerType" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "agentUrl": { + "minLength": 1, + "description": "The \"agentUrl\" cannot be empty" + }, + "triggerType": { + "minLength": 1, + "description": "The \"triggerType\" cannot be empty" + } + } + } + } } } }, - "x-source": "src/api/routes/group.router.ts" + "x-validation-schema": "evoaiSchema", + "x-source": "src/api/integrations/chatbot/evoai/routes/evoai.router.ts" } }, { "method": "post", - "path": "/group/updateSetting/{instanceName}", - "source": "src/api/routes/group.router.ts", + "path": "/evolutionBot/changeStatus/{instanceName}", + "source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts", + "schemaName": "evolutionBotStatusSchema", + "schema": { + "type": "object", + "properties": { + "remoteJid": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "opened", + "closed", + "paused", + "delete" + ] + } + }, + "required": [ + "remoteJid", + "status" + ], + "if": { + "propertyNames": { + "enum": [ + "remoteJid", + "status" + ] + } + }, + "then": { + "properties": { + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + }, + "status": { + "minLength": 1, + "description": "The \"status\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Groups" + "Evolution Bot" ], - "summary": "Update update Setting", - "description": "Update update Setting for Groups.", - "operationId": "post_group_updateSetting", + "summary": "Update change Status", + "description": "Update change Status for Evolution Bot.", + "operationId": "post_evolutionBot_changeStatus", "parameters": [ { "name": "instanceName", @@ -4876,16 +28494,253 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -4894,65 +28749,171 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "remoteJid": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "opened", + "closed", + "paused", + "delete" + ] + } + }, + "required": [ + "remoteJid", + "status" + ], + "if": { + "propertyNames": { + "enum": [ + "remoteJid", + "status" + ] + } + }, + "then": { + "properties": { + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + }, + "status": { + "minLength": 1, + "description": "The \"status\" cannot be empty" + } + } + } + } } } }, - "x-source": "src/api/routes/group.router.ts" + "x-validation-schema": "evolutionBotStatusSchema", + "x-source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts" } }, { - "method": "get", - "path": "/instance/connect/{instanceName}", - "source": "src/api/routes/instance.router.ts", - "operation": { - "tags": [ - "Instances" - ], - "summary": "Update connect", - "description": "Update connect for Instances.", - "operationId": "get_instance_connect", - "parameters": [ - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { + "method": "post", + "path": "/evolutionBot/create/{instanceName}", + "source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts", + "schemaName": "evolutionBotSchema", + "schema": { + "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" } - } - ], - "responses": { - "200": { - "description": "Successful response." }, - "400": { - "description": "Invalid request." - }, - "401": { - "description": "Missing or invalid API key." + "splitMessages": { + "type": "boolean" }, - "404": { - "description": "Instance or resource not found." + "timePerChar": { + "type": "integer" } }, - "x-source": "src/api/routes/instance.router.ts" - } - }, - { - "method": "get", - "path": "/instance/connectionState/{instanceName}", - "source": "src/api/routes/instance.router.ts", + "required": [ + "enabled", + "apiUrl", + "triggerType" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "apiUrl", + "triggerType" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "apiUrl": { + "minLength": 1, + "description": "The \"apiUrl\" cannot be empty" + }, + "triggerType": { + "minLength": 1, + "description": "The \"triggerType\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "CREATED", "operation": { "tags": [ - "Instances" + "Evolution Bot" ], - "summary": "Get connection State", - "description": "Get connection State for Instances.", - "operationId": "get_instance_connectionState", + "summary": "Create create", + "description": "Create create for Evolution Bot.", + "operationId": "post_evolutionBot_create", "parameters": [ { "name": "instanceName", @@ -4965,46 +28926,254 @@ } ], "responses": { - "200": { - "description": "Successful response." + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "x-source": "src/api/routes/instance.router.ts" - } - }, - { - "method": "post", - "path": "/instance/create", - "source": "src/api/routes/instance.router.ts", - "operation": { - "tags": [ - "Instances" - ], - "summary": "Create create", - "description": "Create create for Instances.", - "operationId": "post_instance_create", - "parameters": [], - "responses": { - "201": { - "description": "Successful response." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } }, - "400": { - "description": "Invalid request." + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } }, - "401": { - "description": "Missing or invalid API key." + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } }, - "404": { - "description": "Instance or resource not found." + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -5013,134 +29182,414 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "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" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "apiUrl", + "triggerType" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "apiUrl": { + "minLength": 1, + "description": "The \"apiUrl\" cannot be empty" + }, + "triggerType": { + "minLength": 1, + "description": "The \"triggerType\" cannot be empty" + } + } + } + } } } }, - "x-source": "src/api/routes/instance.router.ts" + "x-validation-schema": "evolutionBotSchema", + "x-source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts" } }, { "method": "delete", - "path": "/instance/delete/{instanceName}", - "source": "src/api/routes/instance.router.ts", - "operation": { - "tags": [ - "Instances" - ], - "summary": "Delete delete", - "description": "Delete delete for Instances.", - "operationId": "delete_instance_delete", - "parameters": [ - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" + "path": "/evolutionBot/delete/{evolutionBotId}/{instanceName}", + "source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] } - } - ], - "responses": { - "200": { - "description": "Successful response." }, - "400": { - "description": "Invalid request." + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } }, - "401": { - "description": "Missing or invalid API key." + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } }, - "404": { - "description": "Instance or resource not found." - } - }, - "x-source": "src/api/routes/instance.router.ts" - } - }, - { - "method": "get", - "path": "/instance/fetchInstances", - "source": "src/api/routes/instance.router.ts", - "operation": { - "tags": [ - "Instances" - ], - "summary": "Get fetch Instances", - "description": "Get fetch Instances for Instances.", - "operationId": "get_instance_fetchInstances", - "parameters": [], - "responses": { - "200": { - "description": "Successful response." + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } }, - "400": { - "description": "Invalid request." + "chatwootAccountId": { + "type": "string" }, - "401": { - "description": "Missing or invalid API key." + "chatwootToken": { + "type": "string" }, - "404": { - "description": "Instance or resource not found." + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" } }, - "x-source": "src/api/routes/instance.router.ts" - } - }, - { - "method": "delete", - "path": "/instance/logout/{instanceName}", - "source": "src/api/routes/instance.router.ts", + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Instances" + "Evolution Bot" ], - "summary": "Delete logout", - "description": "Delete logout for Instances.", - "operationId": "delete_instance_logout", + "summary": "Delete delete", + "description": "Delete delete for Evolution Bot.", + "operationId": "delete_evolutionBot_delete", "parameters": [ { - "name": "instanceName", + "name": "evolutionBotId", "in": "path", "required": true, - "description": "Evolution API instance name.", + "description": "Evolution Bot Id path parameter.", "schema": { "type": "string" } - } - ], - "responses": { - "200": { - "description": "Successful response." - }, - "400": { - "description": "Invalid request." - }, - "401": { - "description": "Missing or invalid API key." }, - "404": { - "description": "Instance or resource not found." - } - }, - "x-source": "src/api/routes/instance.router.ts" - } - }, - { - "method": "post", - "path": "/instance/restart/{instanceName}", - "source": "src/api/routes/instance.router.ts", - "operation": { - "tags": [ - "Instances" - ], - "summary": "Update restart", - "description": "Update restart for Instances.", - "operationId": "post_instance_restart", - "parameters": [ { "name": "instanceName", "in": "path", @@ -5153,16 +29602,253 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -5171,107 +29857,583 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} - } - } - }, - "x-source": "src/api/routes/instance.router.ts" - } - }, - { - "method": "post", - "path": "/instance/setPresence/{instanceName}", - "source": "src/api/routes/instance.router.ts", - "operation": { - "tags": [ - "Instances" - ], - "summary": "Update set Presence", - "description": "Update set Presence for Instances.", - "operationId": "post_instance_setPresence", - "parameters": [ - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Successful response." - }, - "400": { - "description": "Invalid request." - }, - "401": { - "description": "Missing or invalid API key." - }, - "404": { - "description": "Instance or resource not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + } } } }, - "x-source": "src/api/routes/instance.router.ts" + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts" } }, { "method": "get", - "path": "/instanceapikey", - "source": "src/api/routes/instance.router.ts", - "operation": { - "tags": [ - "Instance API key" - ], - "summary": "Get instanceapikey", - "description": "Get instanceapikey for Instance API key.", - "operationId": "get_instanceapikey", - "parameters": [], - "responses": { - "200": { - "description": "Successful response." + "path": "/evolutionBot/fetch/{evolutionBotId}/{instanceName}", + "source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } }, - "400": { - "description": "Invalid request." + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } }, - "401": { - "description": "Missing or invalid API key." + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } }, - "404": { - "description": "Instance or resource not found." + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" } }, - "x-source": "src/api/routes/instance.router.ts" - } - }, - { - "method": "get", - "path": "/kafka/find/{instanceName}", - "source": "src/api/integrations/event/kafka/kafka.router.ts", + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Kafka" + "Evolution Bot" ], - "summary": "Get find", - "description": "Get find for Kafka.", - "operationId": "get_kafka_find", + "summary": "Get fetch", + "description": "Get fetch for Evolution Bot.", + "operationId": "get_evolutionBot_fetch", "parameters": [ + { + "name": "evolutionBotId", + "in": "path", + "required": true, + "description": "Evolution Bot Id path parameter.", + "schema": { + "type": "string" + } + }, { "name": "instanceName", "in": "path", @@ -5284,33 +30446,557 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, - "x-source": "src/api/integrations/event/kafka/kafka.router.ts" + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts" } }, { - "method": "post", - "path": "/kafka/set/{instanceName}", - "source": "src/api/integrations/event/kafka/kafka.router.ts", + "method": "get", + "path": "/evolutionBot/fetchSessions/{evolutionBotId}/{instanceName}", + "source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Kafka" + "Evolution Bot" ], - "summary": "Update set", - "description": "Update set for Kafka.", - "operationId": "post_kafka_set", + "summary": "Get fetch Sessions", + "description": "Get fetch Sessions for Evolution Bot.", + "operationId": "get_evolutionBot_fetchSessions", "parameters": [ + { + "name": "evolutionBotId", + "in": "path", + "required": true, + "description": "Evolution Bot Id path parameter.", + "schema": { + "type": "string" + } + }, { "name": "instanceName", "in": "path", @@ -5323,44 +31009,547 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } } } }, - "x-source": "src/api/integrations/event/kafka/kafka.router.ts" + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts" } }, { "method": "get", - "path": "/label/findLabels/{instanceName}", - "source": "src/api/routes/label.router.ts", + "path": "/evolutionBot/fetchSettings/{instanceName}", + "source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Labels" + "Evolution Bot" ], - "summary": "Get find Labels", - "description": "Get find Labels for Labels.", - "operationId": "get_label_findLabels", + "summary": "Get fetch Settings", + "description": "Get fetch Settings for Evolution Bot.", + "operationId": "get_evolutionBot_fetchSettings", "parameters": [ { "name": "instanceName", @@ -5374,32 +31563,547 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, - "x-source": "src/api/routes/label.router.ts" + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts" } }, { - "method": "post", - "path": "/label/handleLabel/{instanceName}", - "source": "src/api/routes/label.router.ts", + "method": "get", + "path": "/evolutionBot/find/{instanceName}", + "source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Labels" + "Evolution Bot" ], - "summary": "Update handle Label", - "description": "Update handle Label for Labels.", - "operationId": "post_label_handleLabel", + "summary": "Get find", + "description": "Get find for Evolution Bot.", + "operationId": "get_evolutionBot_find", "parameters": [ { "name": "instanceName", @@ -5413,44 +32117,312 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } } } }, - "x-source": "src/api/routes/label.router.ts" + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts" } }, { "method": "post", - "path": "/message/sendButtons/{instanceName}", - "source": "src/api/routes/sendMessage.router.ts", + "path": "/evolutionBot/ignoreJid/{instanceName}", + "source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts", + "schemaName": "evolutionBotIgnoreJidSchema", + "schema": { + "type": "object", + "properties": { + "remoteJid": { + "type": "string" + }, + "action": { + "type": "string", + "enum": [ + "add", + "remove" + ] + } + }, + "required": [ + "remoteJid", + "action" + ], + "if": { + "propertyNames": { + "enum": [ + "remoteJid", + "action" + ] + } + }, + "then": { + "properties": { + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + }, + "action": { + "minLength": 1, + "description": "The \"action\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Messages" + "Evolution Bot" ], - "summary": "Create send Buttons", - "description": "Create send Buttons for Messages.", - "operationId": "post_message_sendButtons", + "summary": "Update ignore Jid", + "description": "Update ignore Jid for Evolution Bot.", + "operationId": "post_evolutionBot_ignoreJid", "parameters": [ { "name": "instanceName", @@ -5464,67 +32436,253 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} - } - } - }, - "x-source": "src/api/routes/sendMessage.router.ts" - } - }, - { - "method": "post", - "path": "/message/sendContact/{instanceName}", - "source": "src/api/routes/sendMessage.router.ts", - "operation": { - "tags": [ - "Messages" - ], - "summary": "Create send Contact", - "description": "Create send Contact for Messages.", - "operationId": "post_message_sendContact", - "parameters": [ - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } } - } - ], - "responses": { - "200": { - "description": "Successful response." }, - "400": { - "description": "Invalid request." + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } }, - "401": { - "description": "Missing or invalid API key." + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } }, - "404": { - "description": "Instance or resource not found." + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -5533,77 +32691,186 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "remoteJid": { + "type": "string" + }, + "action": { + "type": "string", + "enum": [ + "add", + "remove" + ] + } + }, + "required": [ + "remoteJid", + "action" + ], + "if": { + "propertyNames": { + "enum": [ + "remoteJid", + "action" + ] + } + }, + "then": { + "properties": { + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + }, + "action": { + "minLength": 1, + "description": "The \"action\" cannot be empty" + } + } + } + } } } }, - "x-source": "src/api/routes/sendMessage.router.ts" + "x-validation-schema": "evolutionBotIgnoreJidSchema", + "x-source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts" } }, { "method": "post", - "path": "/message/sendList/{instanceName}", - "source": "src/api/routes/sendMessage.router.ts", - "operation": { - "tags": [ - "Messages" - ], - "summary": "Create send List", - "description": "Create send List for Messages.", - "operationId": "post_message_sendList", - "parameters": [ - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { + "path": "/evolutionBot/settings/{instanceName}", + "source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts", + "schemaName": "evolutionBotSettingSchema", + "schema": { + "type": "object", + "properties": { + "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" } - } - ], - "responses": { - "200": { - "description": "Successful response." }, - "400": { - "description": "Invalid request." + "botIdFallback": { + "type": "string" }, - "401": { - "description": "Missing or invalid API key." + "splitMessages": { + "type": "boolean" }, - "404": { - "description": "Instance or resource not found." + "timePerChar": { + "type": "integer" } }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} - } + "required": [ + "expire", + "keywordFinish", + "delayMessage", + "unknownMessage", + "listeningFromMe", + "stopBotFromMe", + "keepOpen", + "debounceTime", + "ignoreJids", + "splitMessages", + "timePerChar" + ], + "if": { + "propertyNames": { + "enum": [ + "expire", + "keywordFinish", + "delayMessage", + "unknownMessage", + "listeningFromMe", + "stopBotFromMe", + "keepOpen", + "debounceTime", + "ignoreJids", + "splitMessages", + "timePerChar" + ] } }, - "x-source": "src/api/routes/sendMessage.router.ts" - } - }, - { - "method": "post", - "path": "/message/sendLocation/{instanceName}", - "source": "src/api/routes/sendMessage.router.ts", + "then": { + "properties": { + "expire": { + "minLength": 1, + "description": "The \"expire\" cannot be empty" + }, + "keywordFinish": { + "minLength": 1, + "description": "The \"keywordFinish\" cannot be empty" + }, + "delayMessage": { + "minLength": 1, + "description": "The \"delayMessage\" cannot be empty" + }, + "unknownMessage": { + "minLength": 1, + "description": "The \"unknownMessage\" cannot be empty" + }, + "listeningFromMe": { + "minLength": 1, + "description": "The \"listeningFromMe\" cannot be empty" + }, + "stopBotFromMe": { + "minLength": 1, + "description": "The \"stopBotFromMe\" cannot be empty" + }, + "keepOpen": { + "minLength": 1, + "description": "The \"keepOpen\" cannot be empty" + }, + "debounceTime": { + "minLength": 1, + "description": "The \"debounceTime\" cannot be empty" + }, + "ignoreJids": { + "minLength": 1, + "description": "The \"ignoreJids\" cannot be empty" + }, + "splitMessages": { + "minLength": 1, + "description": "The \"splitMessages\" cannot be empty" + }, + "timePerChar": { + "minLength": 1, + "description": "The \"timePerChar\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Messages" + "Evolution Bot" ], - "summary": "Create send Location", - "description": "Create send Location for Messages.", - "operationId": "post_message_sendLocation", + "summary": "Update settings", + "description": "Update settings for Evolution Bot.", + "operationId": "post_evolutionBot_settings", "parameters": [ { "name": "instanceName", @@ -5617,16 +32884,253 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -5635,27 +33139,262 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "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" + } + }, + "botIdFallback": { + "type": "string" + }, + "splitMessages": { + "type": "boolean" + }, + "timePerChar": { + "type": "integer" + } + }, + "required": [ + "expire", + "keywordFinish", + "delayMessage", + "unknownMessage", + "listeningFromMe", + "stopBotFromMe", + "keepOpen", + "debounceTime", + "ignoreJids", + "splitMessages", + "timePerChar" + ], + "if": { + "propertyNames": { + "enum": [ + "expire", + "keywordFinish", + "delayMessage", + "unknownMessage", + "listeningFromMe", + "stopBotFromMe", + "keepOpen", + "debounceTime", + "ignoreJids", + "splitMessages", + "timePerChar" + ] + } + }, + "then": { + "properties": { + "expire": { + "minLength": 1, + "description": "The \"expire\" cannot be empty" + }, + "keywordFinish": { + "minLength": 1, + "description": "The \"keywordFinish\" cannot be empty" + }, + "delayMessage": { + "minLength": 1, + "description": "The \"delayMessage\" cannot be empty" + }, + "unknownMessage": { + "minLength": 1, + "description": "The \"unknownMessage\" cannot be empty" + }, + "listeningFromMe": { + "minLength": 1, + "description": "The \"listeningFromMe\" cannot be empty" + }, + "stopBotFromMe": { + "minLength": 1, + "description": "The \"stopBotFromMe\" cannot be empty" + }, + "keepOpen": { + "minLength": 1, + "description": "The \"keepOpen\" cannot be empty" + }, + "debounceTime": { + "minLength": 1, + "description": "The \"debounceTime\" cannot be empty" + }, + "ignoreJids": { + "minLength": 1, + "description": "The \"ignoreJids\" cannot be empty" + }, + "splitMessages": { + "minLength": 1, + "description": "The \"splitMessages\" cannot be empty" + }, + "timePerChar": { + "minLength": 1, + "description": "The \"timePerChar\" cannot be empty" + } + } + } + } } } }, - "x-source": "src/api/routes/sendMessage.router.ts" + "x-validation-schema": "evolutionBotSettingSchema", + "x-source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts" } }, { - "method": "post", - "path": "/message/sendMedia/{instanceName}", - "source": "src/api/routes/sendMessage.router.ts", + "method": "put", + "path": "/evolutionBot/update/{evolutionBotId}/{instanceName}", + "source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts", + "schemaName": "evolutionBotSchema", + "schema": { + "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" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "apiUrl", + "triggerType" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "apiUrl": { + "minLength": 1, + "description": "The \"apiUrl\" cannot be empty" + }, + "triggerType": { + "minLength": 1, + "description": "The \"triggerType\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Messages" + "Evolution Bot" ], - "summary": "Create send Media", - "description": "Create send Media for Messages.", - "operationId": "post_message_sendMedia", + "summary": "Update update", + "description": "Update update for Evolution Bot.", + "operationId": "put_evolutionBot_update", "parameters": [ + { + "name": "evolutionBotId", + "in": "path", + "required": true, + "description": "Evolution Bot Id path parameter.", + "schema": { + "type": "string" + } + }, { "name": "instanceName", "in": "path", @@ -5668,16 +33407,253 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." - }, - "401": { - "description": "Missing or invalid API key." - }, - "404": { - "description": "Instance or resource not found." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -5686,26 +33662,171 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "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" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "apiUrl", + "triggerType" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "apiUrl": { + "minLength": 1, + "description": "The \"apiUrl\" cannot be empty" + }, + "triggerType": { + "minLength": 1, + "description": "The \"triggerType\" cannot be empty" + } + } + } + } } } }, - "x-source": "src/api/routes/sendMessage.router.ts" + "x-validation-schema": "evolutionBotSchema", + "x-source": "src/api/integrations/chatbot/evolutionBot/routes/evolutionBot.router.ts" } }, { "method": "post", - "path": "/message/sendPoll/{instanceName}", - "source": "src/api/routes/sendMessage.router.ts", + "path": "/flowise/changeStatus/{instanceName}", + "source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts", + "schemaName": "flowiseStatusSchema", + "schema": { + "type": "object", + "properties": { + "remoteJid": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "opened", + "closed", + "paused", + "delete" + ] + } + }, + "required": [ + "remoteJid", + "status" + ], + "if": { + "propertyNames": { + "enum": [ + "remoteJid", + "status" + ] + } + }, + "then": { + "properties": { + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + }, + "status": { + "minLength": 1, + "description": "The \"status\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Messages" + "Flowise" ], - "summary": "Create send Poll", - "description": "Create send Poll for Messages.", - "operationId": "post_message_sendPoll", + "summary": "Update change Status", + "description": "Update change Status for Flowise.", + "operationId": "post_flowise_changeStatus", "parameters": [ { "name": "instanceName", @@ -5719,16 +33840,253 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -5737,77 +34095,171 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "remoteJid": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "opened", + "closed", + "paused", + "delete" + ] + } + }, + "required": [ + "remoteJid", + "status" + ], + "if": { + "propertyNames": { + "enum": [ + "remoteJid", + "status" + ] + } + }, + "then": { + "properties": { + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + }, + "status": { + "minLength": 1, + "description": "The \"status\" cannot be empty" + } + } + } + } } } }, - "x-source": "src/api/routes/sendMessage.router.ts" + "x-validation-schema": "flowiseStatusSchema", + "x-source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts" } }, { "method": "post", - "path": "/message/sendPtv/{instanceName}", - "source": "src/api/routes/sendMessage.router.ts", - "operation": { - "tags": [ - "Messages" - ], - "summary": "Create send Ptv", - "description": "Create send Ptv for Messages.", - "operationId": "post_message_sendPtv", - "parameters": [ - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { + "path": "/flowise/create/{instanceName}", + "source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts", + "schemaName": "flowiseSchema", + "schema": { + "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" } - } - ], - "responses": { - "200": { - "description": "Successful response." - }, - "400": { - "description": "Invalid request." }, - "401": { - "description": "Missing or invalid API key." + "splitMessages": { + "type": "boolean" }, - "404": { - "description": "Instance or resource not found." + "timePerChar": { + "type": "integer" } }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} - } + "required": [ + "enabled", + "apiUrl", + "triggerType" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "apiUrl", + "triggerType" + ] } }, - "x-source": "src/api/routes/sendMessage.router.ts" - } - }, - { - "method": "post", - "path": "/message/sendReaction/{instanceName}", - "source": "src/api/routes/sendMessage.router.ts", + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "apiUrl": { + "minLength": 1, + "description": "The \"apiUrl\" cannot be empty" + }, + "triggerType": { + "minLength": 1, + "description": "The \"triggerType\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "CREATED", "operation": { "tags": [ - "Messages" + "Flowise" ], - "summary": "Create send Reaction", - "description": "Create send Reaction for Messages.", - "operationId": "post_message_sendReaction", + "summary": "Create create", + "description": "Create create for Flowise.", + "operationId": "post_flowise_create", "parameters": [ { "name": "instanceName", @@ -5820,68 +34272,254 @@ } ], "responses": { - "200": { - "description": "Successful response." + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } } - } - }, - "x-source": "src/api/routes/sendMessage.router.ts" - } - }, - { - "method": "post", - "path": "/message/sendStatus/{instanceName}", - "source": "src/api/routes/sendMessage.router.ts", - "operation": { - "tags": [ - "Messages" - ], - "summary": "Create send Status", - "description": "Create send Status for Messages.", - "operationId": "post_message_sendStatus", - "parameters": [ - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Successful response." }, - "400": { - "description": "Invalid request." + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } }, - "401": { - "description": "Missing or invalid API key." + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } }, - "404": { - "description": "Instance or resource not found." + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -5890,129 +34528,414 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "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" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "apiUrl", + "triggerType" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "apiUrl": { + "minLength": 1, + "description": "The \"apiUrl\" cannot be empty" + }, + "triggerType": { + "minLength": 1, + "description": "The \"triggerType\" cannot be empty" + } + } + } + } } } }, - "x-source": "src/api/routes/sendMessage.router.ts" + "x-validation-schema": "flowiseSchema", + "x-source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts" } }, { - "method": "post", - "path": "/message/sendSticker/{instanceName}", - "source": "src/api/routes/sendMessage.router.ts", - "operation": { - "tags": [ - "Messages" - ], - "summary": "Create send Sticker", - "description": "Create send Sticker for Messages.", - "operationId": "post_message_sendSticker", - "parameters": [ - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" + "method": "delete", + "path": "/flowise/delete/{flowiseId}/{instanceName}", + "source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] } - } - ], - "responses": { - "200": { - "description": "Successful response." }, - "400": { - "description": "Invalid request." + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } }, - "401": { - "description": "Missing or invalid API key." + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } }, - "404": { - "description": "Instance or resource not found." + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" } }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} - } + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] } }, - "x-source": "src/api/routes/sendMessage.router.ts" - } - }, - { - "method": "post", - "path": "/message/sendTemplate/{instanceName}", - "source": "src/api/routes/sendMessage.router.ts", + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Messages" + "Flowise" ], - "summary": "Create send Template", - "description": "Create send Template for Messages.", - "operationId": "post_message_sendTemplate", + "summary": "Delete delete", + "description": "Delete delete for Flowise.", + "operationId": "delete_flowise_delete", "parameters": [ { - "name": "instanceName", + "name": "flowiseId", "in": "path", "required": true, - "description": "Evolution API instance name.", + "description": "Flowise Id path parameter.", "schema": { "type": "string" } - } - ], - "responses": { - "200": { - "description": "Successful response." - }, - "400": { - "description": "Invalid request." }, - "401": { - "description": "Missing or invalid API key." - }, - "404": { - "description": "Instance or resource not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} - } - } - }, - "x-source": "src/api/routes/sendMessage.router.ts" - } - }, - { - "method": "post", - "path": "/message/sendText/{instanceName}", - "source": "src/api/routes/sendMessage.router.ts", - "operation": { - "tags": [ - "Messages" - ], - "summary": "Create send Text", - "description": "Create send Text for Messages.", - "operationId": "post_message_sendText", - "parameters": [ { "name": "instanceName", "in": "path", @@ -6025,16 +34948,253 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -6043,78 +35203,583 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} - } - } - }, - "x-source": "src/api/routes/sendMessage.router.ts" - } - }, - { - "method": "post", - "path": "/message/sendWhatsAppAudio/{instanceName}", - "source": "src/api/routes/sendMessage.router.ts", - "operation": { - "tags": [ - "Messages" - ], - "summary": "Create send Whats App Audio", - "description": "Create send Whats App Audio for Messages.", - "operationId": "post_message_sendWhatsAppAudio", - "parameters": [ - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + } } } - ], - "responses": { - "200": { - "description": "Successful response." + }, + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts" + } + }, + { + "method": "get", + "path": "/flowise/fetch/{flowiseId}/{instanceName}", + "source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } }, - "400": { - "description": "Invalid request." + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } }, - "401": { - "description": "Missing or invalid API key." + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } }, - "404": { - "description": "Instance or resource not found." + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" } }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} - } + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] } }, - "x-source": "src/api/routes/sendMessage.router.ts" - } - }, - { - "method": "post", - "path": "/n8n/changeStatus/{instanceName}", - "source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts", + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "n8n" + "Flowise" ], - "summary": "Update change Status", - "description": "Update change Status for n8n.", - "operationId": "post_n8n_changeStatus", + "summary": "Get fetch", + "description": "Get fetch for Flowise.", + "operationId": "get_flowise_fetch", "parameters": [ + { + "name": "flowiseId", + "in": "path", + "required": true, + "description": "Flowise Id path parameter.", + "schema": { + "type": "string" + } + }, { "name": "instanceName", "in": "path", @@ -6127,45 +35792,557 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } } } }, - "x-source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts" + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts" } }, { - "method": "post", - "path": "/n8n/create/{instanceName}", - "source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts", + "method": "get", + "path": "/flowise/fetchSessions/{flowiseId}/{instanceName}", + "source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "n8n" + "Flowise" ], - "summary": "Create create", - "description": "Create create for n8n.", - "operationId": "post_n8n_create", + "summary": "Get fetch Sessions", + "description": "Get fetch Sessions for Flowise.", + "operationId": "get_flowise_fetchSessions", "parameters": [ + { + "name": "flowiseId", + "in": "path", + "required": true, + "description": "Flowise Id path parameter.", + "schema": { + "type": "string" + } + }, { "name": "instanceName", "in": "path", @@ -6177,55 +36354,549 @@ } ], "responses": { - "201": { - "description": "Successful response." + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } } } }, - "x-source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts" + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts" } }, { - "method": "delete", - "path": "/n8n/delete/{n8nId}/{instanceName}", - "source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts", + "method": "get", + "path": "/flowise/fetchSettings/{instanceName}", + "source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "n8n" + "Flowise" ], - "summary": "Delete delete", - "description": "Delete delete for n8n.", - "operationId": "delete_n8n_delete", + "summary": "Get fetch Settings", + "description": "Get fetch Settings for Flowise.", + "operationId": "get_flowise_fetchSettings", "parameters": [ - { - "name": "n8nId", - "in": "path", - "required": true, - "description": "N8n Id path parameter.", - "schema": { - "type": "string" - } - }, { "name": "instanceName", "in": "path", @@ -6238,42 +36909,548 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, - "x-source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts" + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts" } }, { "method": "get", - "path": "/n8n/fetch/{n8nId}/{instanceName}", - "source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts", + "path": "/flowise/find/{instanceName}", + "source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "n8n" + "Flowise" ], - "summary": "Get fetch", - "description": "Get fetch for n8n.", - "operationId": "get_n8n_fetch", + "summary": "Get find", + "description": "Get find for Flowise.", + "operationId": "get_flowise_find", "parameters": [ - { - "name": "n8nId", - "in": "path", - "required": true, - "description": "N8n Id path parameter.", - "schema": { - "type": "string" - } - }, { "name": "instanceName", "in": "path", @@ -6286,42 +37463,313 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, - "x-source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts" + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts" } }, { - "method": "get", - "path": "/n8n/fetchSessions/{n8nId}/{instanceName}", - "source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts", + "method": "post", + "path": "/flowise/ignoreJid/{instanceName}", + "source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts", + "schemaName": "flowiseIgnoreJidSchema", + "schema": { + "type": "object", + "properties": { + "remoteJid": { + "type": "string" + }, + "action": { + "type": "string", + "enum": [ + "add", + "remove" + ] + } + }, + "required": [ + "remoteJid", + "action" + ], + "if": { + "propertyNames": { + "enum": [ + "remoteJid", + "action" + ] + } + }, + "then": { + "properties": { + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + }, + "action": { + "minLength": 1, + "description": "The \"action\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "n8n" + "Flowise" ], - "summary": "Get fetch Sessions", - "description": "Get fetch Sessions for n8n.", - "operationId": "get_n8n_fetchSessions", + "summary": "Update ignore Jid", + "description": "Update ignore Jid for Flowise.", + "operationId": "post_flowise_ignoreJid", "parameters": [ - { - "name": "n8nId", - "in": "path", - "required": true, - "description": "N8n Id path parameter.", - "schema": { - "type": "string" - } - }, { "name": "instanceName", "in": "path", @@ -6334,133 +37782,253 @@ ], "responses": { "200": { - "description": "Successful response." - }, - "400": { - "description": "Invalid request." - }, - "401": { - "description": "Missing or invalid API key." - }, - "404": { - "description": "Instance or resource not found." - } - }, - "x-source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts" - } - }, - { - "method": "get", - "path": "/n8n/fetchSettings/{instanceName}", - "source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts", - "operation": { - "tags": [ - "n8n" - ], - "summary": "Get fetch Settings", - "description": "Get fetch Settings for n8n.", - "operationId": "get_n8n_fetchSettings", - "parameters": [ - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } } - } - ], - "responses": { - "200": { - "description": "Successful response." }, "400": { - "description": "Invalid request." - }, - "401": { - "description": "Missing or invalid API key." - }, - "404": { - "description": "Instance or resource not found." - } - }, - "x-source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts" - } - }, - { - "method": "get", - "path": "/n8n/find/{instanceName}", - "source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts", - "operation": { - "tags": [ - "n8n" - ], - "summary": "Get find", - "description": "Get find for n8n.", - "operationId": "get_n8n_find", - "parameters": [ - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } } - } - ], - "responses": { - "200": { - "description": "Successful response." - }, - "400": { - "description": "Invalid request." }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "x-source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts" - } - }, - { - "method": "post", - "path": "/n8n/ignoreJid/{instanceName}", - "source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts", - "operation": { - "tags": [ - "n8n" - ], - "summary": "Update ignore Jid", - "description": "Update ignore Jid for n8n.", - "operationId": "post_n8n_ignoreJid", - "parameters": [ - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } } - } - ], - "responses": { - "200": { - "description": "Successful response." }, - "400": { - "description": "Invalid request." + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } }, - "401": { - "description": "Missing or invalid API key." + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } }, - "404": { - "description": "Instance or resource not found." + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -6469,26 +38037,174 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "remoteJid": { + "type": "string" + }, + "action": { + "type": "string", + "enum": [ + "add", + "remove" + ] + } + }, + "required": [ + "remoteJid", + "action" + ], + "if": { + "propertyNames": { + "enum": [ + "remoteJid", + "action" + ] + } + }, + "then": { + "properties": { + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + }, + "action": { + "minLength": 1, + "description": "The \"action\" cannot be empty" + } + } + } + } } } }, - "x-source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts" + "x-validation-schema": "flowiseIgnoreJidSchema", + "x-source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts" } }, { "method": "post", - "path": "/n8n/settings/{instanceName}", - "source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts", + "path": "/flowise/settings/{instanceName}", + "source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts", + "schemaName": "flowiseSettingSchema", + "schema": { + "type": "object", + "properties": { + "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" + } + }, + "flowiseIdFallback": { + "type": "string" + }, + "splitMessages": { + "type": "boolean" + }, + "timePerChar": { + "type": "integer" + } + }, + "required": [ + "expire", + "keywordFinish", + "delayMessage", + "unknownMessage", + "listeningFromMe", + "stopBotFromMe", + "keepOpen", + "debounceTime", + "ignoreJids" + ], + "if": { + "propertyNames": { + "enum": [ + "expire", + "keywordFinish", + "delayMessage", + "unknownMessage", + "listeningFromMe", + "stopBotFromMe", + "keepOpen", + "debounceTime", + "ignoreJids" + ] + } + }, + "then": { + "properties": { + "expire": { + "minLength": 1, + "description": "The \"expire\" cannot be empty" + }, + "keywordFinish": { + "minLength": 1, + "description": "The \"keywordFinish\" cannot be empty" + }, + "delayMessage": { + "minLength": 1, + "description": "The \"delayMessage\" cannot be empty" + }, + "unknownMessage": { + "minLength": 1, + "description": "The \"unknownMessage\" cannot be empty" + }, + "listeningFromMe": { + "minLength": 1, + "description": "The \"listeningFromMe\" cannot be empty" + }, + "stopBotFromMe": { + "minLength": 1, + "description": "The \"stopBotFromMe\" cannot be empty" + }, + "keepOpen": { + "minLength": 1, + "description": "The \"keepOpen\" cannot be empty" + }, + "debounceTime": { + "minLength": 1, + "description": "The \"debounceTime\" cannot be empty" + }, + "ignoreJids": { + "minLength": 1, + "description": "The \"ignoreJids\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "n8n" + "Flowise" ], "summary": "Update settings", - "description": "Update settings for n8n.", - "operationId": "post_n8n_settings", + "description": "Update settings for Flowise.", + "operationId": "post_flowise_settings", "parameters": [ { "name": "instanceName", @@ -6502,16 +38218,253 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -6520,32 +38473,246 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "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" + } + }, + "flowiseIdFallback": { + "type": "string" + }, + "splitMessages": { + "type": "boolean" + }, + "timePerChar": { + "type": "integer" + } + }, + "required": [ + "expire", + "keywordFinish", + "delayMessage", + "unknownMessage", + "listeningFromMe", + "stopBotFromMe", + "keepOpen", + "debounceTime", + "ignoreJids" + ], + "if": { + "propertyNames": { + "enum": [ + "expire", + "keywordFinish", + "delayMessage", + "unknownMessage", + "listeningFromMe", + "stopBotFromMe", + "keepOpen", + "debounceTime", + "ignoreJids" + ] + } + }, + "then": { + "properties": { + "expire": { + "minLength": 1, + "description": "The \"expire\" cannot be empty" + }, + "keywordFinish": { + "minLength": 1, + "description": "The \"keywordFinish\" cannot be empty" + }, + "delayMessage": { + "minLength": 1, + "description": "The \"delayMessage\" cannot be empty" + }, + "unknownMessage": { + "minLength": 1, + "description": "The \"unknownMessage\" cannot be empty" + }, + "listeningFromMe": { + "minLength": 1, + "description": "The \"listeningFromMe\" cannot be empty" + }, + "stopBotFromMe": { + "minLength": 1, + "description": "The \"stopBotFromMe\" cannot be empty" + }, + "keepOpen": { + "minLength": 1, + "description": "The \"keepOpen\" cannot be empty" + }, + "debounceTime": { + "minLength": 1, + "description": "The \"debounceTime\" cannot be empty" + }, + "ignoreJids": { + "minLength": 1, + "description": "The \"ignoreJids\" cannot be empty" + } + } + } + } } } }, - "x-source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts" + "x-validation-schema": "flowiseSettingSchema", + "x-source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts" } }, { "method": "put", - "path": "/n8n/update/{n8nId}/{instanceName}", - "source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts", + "path": "/flowise/update/{flowiseId}/{instanceName}", + "source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts", + "schemaName": "flowiseSchema", + "schema": { + "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" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "apiUrl", + "triggerType" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "apiUrl": { + "minLength": 1, + "description": "The \"apiUrl\" cannot be empty" + }, + "triggerType": { + "minLength": 1, + "description": "The \"triggerType\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "n8n" + "Flowise" ], "summary": "Update update", - "description": "Update update for n8n.", - "operationId": "put_n8n_update", + "description": "Update update for Flowise.", + "operationId": "put_flowise_update", "parameters": [ { - "name": "n8nId", + "name": "flowiseId", "in": "path", "required": true, - "description": "N8n Id path parameter.", + "description": "Flowise Id path parameter.", "schema": { "type": "string" } @@ -6562,16 +38729,253 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -6580,26 +38984,157 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "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" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "apiUrl", + "triggerType" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "apiUrl": { + "minLength": 1, + "description": "The \"apiUrl\" cannot be empty" + }, + "triggerType": { + "minLength": 1, + "description": "The \"triggerType\" cannot be empty" + } + } + } + } } } }, - "x-source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts" + "x-validation-schema": "flowiseSchema", + "x-source": "src/api/integrations/chatbot/flowise/routes/flowise.router.ts" } }, { "method": "get", - "path": "/nats/find/{instanceName}", - "source": "src/api/integrations/event/nats/nats.router.ts", + "path": "/group/acceptInviteCode/{instanceName}", + "source": "src/api/routes/group.router.ts", + "schemaName": "AcceptGroupInviteSchema", + "schema": { + "type": "object", + "properties": { + "inviteCode": { + "type": "string", + "pattern": "^[a-zA-Z0-9]{22}$" + } + }, + "required": [ + "inviteCode" + ], + "if": { + "propertyNames": { + "enum": [ + "inviteCode" + ] + } + }, + "then": { + "properties": { + "inviteCode": { + "minLength": 1, + "description": "The \"inviteCode\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "NATS" + "Groups" ], - "summary": "Get find", - "description": "Get find for NATS.", - "operationId": "get_nats_find", + "summary": "Update accept Invite Code", + "description": "Update accept Invite Code for Groups.", + "operationId": "get_group_acceptInviteCode", "parameters": [ { "name": "instanceName", @@ -6609,36 +39144,347 @@ "schema": { "type": "string" } + }, + { + "name": "inviteCode", + "in": "query", + "required": true, + "schema": { + "type": "string", + "pattern": "^[a-zA-Z0-9]{22}$" + } } ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, - "x-source": "src/api/integrations/event/nats/nats.router.ts" + "x-validation-schema": "AcceptGroupInviteSchema", + "x-source": "src/api/routes/group.router.ts" } }, { "method": "post", - "path": "/nats/set/{instanceName}", - "source": "src/api/integrations/event/nats/nats.router.ts", + "path": "/group/create/{instanceName}", + "source": "src/api/routes/group.router.ts", + "schemaName": "createGroupSchema", + "schema": { + "type": "object", + "properties": { + "subject": { + "type": "string" + }, + "description": { + "type": "string" + }, + "profilePicture": { + "type": "string" + }, + "promoteParticipants": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "participants": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "minLength": 10, + "pattern": "\\d+", + "description": "\"participants\" must be an array of numeric strings" + } + } + }, + "required": [ + "subject", + "participants" + ], + "if": { + "propertyNames": { + "enum": [ + "subject", + "description", + "profilePicture" + ] + } + }, + "then": { + "properties": { + "subject": { + "minLength": 1, + "description": "The \"subject\" cannot be empty" + }, + "description": { + "minLength": 1, + "description": "The \"description\" cannot be empty" + }, + "profilePicture": { + "minLength": 1, + "description": "The \"profilePicture\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "CREATED", "operation": { "tags": [ - "NATS" + "Groups" ], - "summary": "Update set", - "description": "Update set for NATS.", - "operationId": "post_nats_set", + "summary": "Create create", + "description": "Create create for Groups.", + "operationId": "post_group_create", "parameters": [ { "name": "instanceName", @@ -6651,17 +39497,254 @@ } ], "responses": { - "200": { - "description": "Successful response." + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -6670,77 +39753,116 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} - } - } - }, - "x-source": "src/api/integrations/event/nats/nats.router.ts" - } - }, - { - "method": "post", - "path": "/openai/changeStatus/{instanceName}", - "source": "src/api/integrations/chatbot/openai/routes/openai.router.ts", - "operation": { - "tags": [ - "OpenAI" - ], - "summary": "Update change Status", - "description": "Update change Status for OpenAI.", - "operationId": "post_openai_changeStatus", - "parameters": [ - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" + "properties": { + "subject": { + "type": "string" + }, + "description": { + "type": "string" + }, + "profilePicture": { + "type": "string" + }, + "promoteParticipants": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "participants": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "minLength": 10, + "pattern": "\\d+", + "description": "\"participants\" must be an array of numeric strings" + } + } + }, + "required": [ + "subject", + "participants" + ], + "if": { + "propertyNames": { + "enum": [ + "subject", + "description", + "profilePicture" + ] + } + }, + "then": { + "properties": { + "subject": { + "minLength": 1, + "description": "The \"subject\" cannot be empty" + }, + "description": { + "minLength": 1, + "description": "The \"description\" cannot be empty" + }, + "profilePicture": { + "minLength": 1, + "description": "The \"profilePicture\" cannot be empty" + } + } + } + } } } + }, + "x-validation-schema": "createGroupSchema", + "x-source": "src/api/routes/group.router.ts" + } + }, + { + "method": "get", + "path": "/group/fetchAllGroups/{instanceName}", + "source": "src/api/routes/group.router.ts", + "schemaName": "getParticipantsSchema", + "schema": { + "type": "object", + "properties": { + "getParticipants": { + "type": "string", + "enum": [ + "true", + "false" + ] + } + }, + "required": [ + "getParticipants" ], - "responses": { - "200": { - "description": "Successful response." - }, - "400": { - "description": "Invalid request." - }, - "401": { - "description": "Missing or invalid API key." - }, - "404": { - "description": "Instance or resource not found." + "if": { + "propertyNames": { + "enum": [ + "getParticipants" + ] } }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} + "then": { + "properties": { + "getParticipants": { + "minLength": 1, + "description": "The \"getParticipants\" cannot be empty" } } - }, - "x-source": "src/api/integrations/chatbot/openai/routes/openai.router.ts" - } - }, - { - "method": "post", - "path": "/openai/create/{instanceName}", - "source": "src/api/integrations/chatbot/openai/routes/openai.router.ts", + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "OpenAI" + "Groups" ], - "summary": "Create create", - "description": "Create create for OpenAI.", - "operationId": "post_openai_create", + "summary": "Get fetch All Groups", + "description": "Get fetch All Groups for Groups.", + "operationId": "get_group_fetchAllGroups", "parameters": [ { "name": "instanceName", @@ -6750,48 +39872,316 @@ "schema": { "type": "string" } + }, + { + "name": "getParticipants", + "in": "query", + "required": true, + "schema": { + "type": "string", + "enum": [ + "true", + "false" + ] + } } ], "responses": { - "201": { - "description": "Successful response." + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } } } }, - "x-source": "src/api/integrations/chatbot/openai/routes/openai.router.ts" + "x-validation-schema": "getParticipantsSchema", + "x-source": "src/api/routes/group.router.ts" } }, { "method": "get", - "path": "/openai/creds/{instanceName}", - "source": "src/api/integrations/chatbot/openai/routes/openai.router.ts", + "path": "/group/findGroupInfos/{instanceName}", + "source": "src/api/routes/group.router.ts", + "schemaName": "groupJidSchema", + "schema": { + "type": "object", + "properties": { + "groupJid": { + "type": "string", + "pattern": "^[\\d-]+@g.us$" + } + }, + "required": [ + "groupJid" + ], + "if": { + "propertyNames": { + "enum": [ + "groupJid" + ] + } + }, + "then": { + "properties": { + "groupJid": { + "minLength": 1, + "description": "The \"groupJid\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "OpenAI" + "Groups" ], - "summary": "Get creds", - "description": "Get creds for OpenAI.", - "operationId": "get_openai_creds", + "summary": "Get find Group Infos", + "description": "Get find Group Infos for Groups.", + "operationId": "get_group_findGroupInfos", "parameters": [ { "name": "instanceName", @@ -6801,36 +40191,313 @@ "schema": { "type": "string" } + }, + { + "name": "groupJid", + "in": "query", + "required": true, + "schema": { + "type": "string", + "pattern": "^[\\d-]+@g.us$" + } } ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, - "x-source": "src/api/integrations/chatbot/openai/routes/openai.router.ts" + "x-validation-schema": "groupJidSchema", + "x-source": "src/api/routes/group.router.ts" } }, { - "method": "post", - "path": "/openai/creds/{instanceName}", - "source": "src/api/integrations/chatbot/openai/routes/openai.router.ts", + "method": "get", + "path": "/group/inviteCode/{instanceName}", + "source": "src/api/routes/group.router.ts", + "schemaName": "groupJidSchema", + "schema": { + "type": "object", + "properties": { + "groupJid": { + "type": "string", + "pattern": "^[\\d-]+@g.us$" + } + }, + "required": [ + "groupJid" + ], + "if": { + "propertyNames": { + "enum": [ + "groupJid" + ] + } + }, + "then": { + "properties": { + "groupJid": { + "minLength": 1, + "description": "The \"groupJid\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "OpenAI" + "Groups" ], - "summary": "Run creds", - "description": "Run creds for OpenAI.", - "operationId": "post_openai_creds", + "summary": "Get invite Code", + "description": "Get invite Code for Groups.", + "operationId": "get_group_inviteCode", "parameters": [ { "name": "instanceName", @@ -6840,106 +40507,602 @@ "schema": { "type": "string" } + }, + { + "name": "groupJid", + "in": "query", + "required": true, + "schema": { + "type": "string", + "pattern": "^[\\d-]+@g.us$" + } } ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } } } }, - "x-source": "src/api/integrations/chatbot/openai/routes/openai.router.ts" + "x-validation-schema": "groupJidSchema", + "x-source": "src/api/routes/group.router.ts" } }, { - "method": "delete", - "path": "/openai/creds/{openaiCredsId}/{instanceName}", - "source": "src/api/integrations/chatbot/openai/routes/openai.router.ts", + "method": "get", + "path": "/group/inviteInfo/{instanceName}", + "source": "src/api/routes/group.router.ts", + "schemaName": "groupInviteSchema", + "schema": { + "type": "object", + "properties": { + "inviteCode": { + "type": "string", + "pattern": "^[a-zA-Z0-9]{22}$" + } + }, + "required": [ + "inviteCode" + ], + "if": { + "propertyNames": { + "enum": [ + "inviteCode" + ] + } + }, + "then": { + "properties": { + "inviteCode": { + "minLength": 1, + "description": "The \"inviteCode\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "OpenAI" + "Groups" ], - "summary": "Delete creds", - "description": "Delete creds for OpenAI.", - "operationId": "delete_openai_creds", + "summary": "Get invite Info", + "description": "Get invite Info for Groups.", + "operationId": "get_group_inviteInfo", "parameters": [ { - "name": "openaiCredsId", + "name": "instanceName", "in": "path", "required": true, - "description": "Openai Creds Id path parameter.", + "description": "Evolution API instance name.", "schema": { "type": "string" } }, { - "name": "instanceName", - "in": "path", + "name": "inviteCode", + "in": "query", "required": true, - "description": "Evolution API instance name.", "schema": { - "type": "string" + "type": "string", + "pattern": "^[a-zA-Z0-9]{22}$" } } ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, - "x-source": "src/api/integrations/chatbot/openai/routes/openai.router.ts" + "x-validation-schema": "groupInviteSchema", + "x-source": "src/api/routes/group.router.ts" } }, { "method": "delete", - "path": "/openai/delete/{openaiBotId}/{instanceName}", - "source": "src/api/integrations/chatbot/openai/routes/openai.router.ts", + "path": "/group/leaveGroup/{instanceName}", + "source": "src/api/routes/group.router.ts", + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "OpenAI" + "Groups" ], - "summary": "Delete delete", - "description": "Delete delete for OpenAI.", - "operationId": "delete_openai_delete", + "summary": "Delete leave Group", + "description": "Delete leave Group for Groups.", + "operationId": "delete_group_leaveGroup", "parameters": [ - { - "name": "openaiBotId", - "in": "path", - "required": true, - "description": "Openai Bot Id path parameter.", - "schema": { - "type": "string" - } - }, { "name": "instanceName", "in": "path", @@ -6952,90 +41115,616 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, - "x-source": "src/api/integrations/chatbot/openai/routes/openai.router.ts" + "x-source": "src/api/routes/group.router.ts" } }, { "method": "get", - "path": "/openai/fetch/{openaiBotId}/{instanceName}", - "source": "src/api/integrations/chatbot/openai/routes/openai.router.ts", + "path": "/group/participants/{instanceName}", + "source": "src/api/routes/group.router.ts", + "schemaName": "groupJidSchema", + "schema": { + "type": "object", + "properties": { + "groupJid": { + "type": "string", + "pattern": "^[\\d-]+@g.us$" + } + }, + "required": [ + "groupJid" + ], + "if": { + "propertyNames": { + "enum": [ + "groupJid" + ] + } + }, + "then": { + "properties": { + "groupJid": { + "minLength": 1, + "description": "The \"groupJid\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "OpenAI" + "Groups" ], - "summary": "Get fetch", - "description": "Get fetch for OpenAI.", - "operationId": "get_openai_fetch", + "summary": "Get participants", + "description": "Get participants for Groups.", + "operationId": "get_group_participants", "parameters": [ { - "name": "openaiBotId", + "name": "instanceName", "in": "path", "required": true, - "description": "Openai Bot Id path parameter.", + "description": "Evolution API instance name.", "schema": { "type": "string" } }, { - "name": "instanceName", - "in": "path", + "name": "groupJid", + "in": "query", "required": true, - "description": "Evolution API instance name.", "schema": { - "type": "string" + "type": "string", + "pattern": "^[\\d-]+@g.us$" } } ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, - "x-source": "src/api/integrations/chatbot/openai/routes/openai.router.ts" + "x-validation-schema": "groupJidSchema", + "x-source": "src/api/routes/group.router.ts" } }, { - "method": "get", - "path": "/openai/fetchSessions/{openaiBotId}/{instanceName}", - "source": "src/api/integrations/chatbot/openai/routes/openai.router.ts", + "method": "post", + "path": "/group/revokeInviteCode/{instanceName}", + "source": "src/api/routes/group.router.ts", + "schemaName": "groupJidSchema", + "schema": { + "type": "object", + "properties": { + "groupJid": { + "type": "string", + "pattern": "^[\\d-]+@g.us$" + } + }, + "required": [ + "groupJid" + ], + "if": { + "propertyNames": { + "enum": [ + "groupJid" + ] + } + }, + "then": { + "properties": { + "groupJid": { + "minLength": 1, + "description": "The \"groupJid\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "CREATED", "operation": { "tags": [ - "OpenAI" + "Groups" ], - "summary": "Get fetch Sessions", - "description": "Get fetch Sessions for OpenAI.", - "operationId": "get_openai_fetchSessions", + "summary": "Delete revoke Invite Code", + "description": "Delete revoke Invite Code for Groups.", + "operationId": "post_group_revokeInviteCode", "parameters": [ - { - "name": "openaiBotId", - "in": "path", - "required": true, - "description": "Openai Bot Id path parameter.", - "schema": { - "type": "string" - } - }, { "name": "instanceName", "in": "path", @@ -7047,72 +41736,360 @@ } ], "responses": { - "200": { - "description": "Successful response." + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, - "x-source": "src/api/integrations/chatbot/openai/routes/openai.router.ts" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "groupJid": { + "type": "string", + "pattern": "^[\\d-]+@g.us$" + } + }, + "required": [ + "groupJid" + ], + "if": { + "propertyNames": { + "enum": [ + "groupJid" + ] + } + }, + "then": { + "properties": { + "groupJid": { + "minLength": 1, + "description": "The \"groupJid\" cannot be empty" + } + } + } + } + } + } + }, + "x-validation-schema": "groupJidSchema", + "x-source": "src/api/routes/group.router.ts" } }, { - "method": "get", - "path": "/openai/fetchSettings/{instanceName}", - "source": "src/api/integrations/chatbot/openai/routes/openai.router.ts", - "operation": { - "tags": [ - "OpenAI" - ], - "summary": "Get fetch Settings", - "description": "Get fetch Settings for OpenAI.", - "operationId": "get_openai_fetchSettings", - "parameters": [ - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" + "method": "post", + "path": "/group/sendInvite/{instanceName}", + "source": "src/api/routes/group.router.ts", + "schemaName": "groupSendInviteSchema", + "schema": { + "type": "object", + "properties": { + "groupJid": { + "type": "string" + }, + "description": { + "type": "string" + }, + "numbers": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "minLength": 10, + "pattern": "\\d+", + "description": "\"numbers\" must be an array of numeric strings" } } + }, + "required": [ + "groupJid", + "description", + "numbers" ], - "responses": { - "200": { - "description": "Successful response." - }, - "400": { - "description": "Invalid request." - }, - "401": { - "description": "Missing or invalid API key." - }, - "404": { - "description": "Instance or resource not found." + "if": { + "propertyNames": { + "enum": [ + "groupJid", + "description", + "numbers" + ] } }, - "x-source": "src/api/integrations/chatbot/openai/routes/openai.router.ts" - } - }, - { - "method": "get", - "path": "/openai/find/{instanceName}", - "source": "src/api/integrations/chatbot/openai/routes/openai.router.ts", + "then": { + "properties": { + "groupJid": { + "minLength": 1, + "description": "The \"groupJid\" cannot be empty" + }, + "description": { + "minLength": 1, + "description": "The \"description\" cannot be empty" + }, + "numbers": { + "minLength": 1, + "description": "The \"numbers\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "OpenAI" + "Groups" ], - "summary": "Get find", - "description": "Get find for OpenAI.", - "operationId": "get_openai_find", + "summary": "Create send Invite", + "description": "Create send Invite for Groups.", + "operationId": "post_group_sendInvite", "parameters": [ { "name": "instanceName", @@ -7126,32 +42103,373 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, - "x-source": "src/api/integrations/chatbot/openai/routes/openai.router.ts" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "groupJid": { + "type": "string" + }, + "description": { + "type": "string" + }, + "numbers": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "minLength": 10, + "pattern": "\\d+", + "description": "\"numbers\" must be an array of numeric strings" + } + } + }, + "required": [ + "groupJid", + "description", + "numbers" + ], + "if": { + "propertyNames": { + "enum": [ + "groupJid", + "description", + "numbers" + ] + } + }, + "then": { + "properties": { + "groupJid": { + "minLength": 1, + "description": "The \"groupJid\" cannot be empty" + }, + "description": { + "minLength": 1, + "description": "The \"description\" cannot be empty" + }, + "numbers": { + "minLength": 1, + "description": "The \"numbers\" cannot be empty" + } + } + } + } + } + } + }, + "x-validation-schema": "groupSendInviteSchema", + "x-source": "src/api/routes/group.router.ts" } }, { - "method": "get", - "path": "/openai/getModels/{instanceName}", - "source": "src/api/integrations/chatbot/openai/routes/openai.router.ts", + "method": "post", + "path": "/group/toggleEphemeral/{instanceName}", + "source": "src/api/routes/group.router.ts", + "schemaName": "toggleEphemeralSchema", + "schema": { + "type": "object", + "properties": { + "groupJid": { + "type": "string" + }, + "expiration": { + "type": "number", + "enum": [ + 0, + 86400, + 604800, + 7776000 + ] + } + }, + "required": [ + "groupJid", + "expiration" + ], + "if": { + "propertyNames": { + "enum": [ + "groupJid", + "expiration" + ] + } + }, + "then": { + "properties": { + "groupJid": { + "minLength": 1, + "description": "The \"groupJid\" cannot be empty" + }, + "expiration": { + "minLength": 1, + "description": "The \"expiration\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "CREATED", "operation": { "tags": [ - "OpenAI" + "Groups" ], - "summary": "Get get Models", - "description": "Get get Models for OpenAI.", - "operationId": "get_openai_getModels", + "summary": "Update toggle Ephemeral", + "description": "Update toggle Ephemeral for Groups.", + "operationId": "post_group_toggleEphemeral", "parameters": [ { "name": "instanceName", @@ -7164,33 +42482,357 @@ } ], "responses": { - "200": { - "description": "Successful response." + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." - }, - "404": { - "description": "Instance or resource not found." - } - }, - "x-source": "src/api/integrations/chatbot/openai/routes/openai.router.ts" + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "groupJid": { + "type": "string" + }, + "expiration": { + "type": "number", + "enum": [ + 0, + 86400, + 604800, + 7776000 + ] + } + }, + "required": [ + "groupJid", + "expiration" + ], + "if": { + "propertyNames": { + "enum": [ + "groupJid", + "expiration" + ] + } + }, + "then": { + "properties": { + "groupJid": { + "minLength": 1, + "description": "The \"groupJid\" cannot be empty" + }, + "expiration": { + "minLength": 1, + "description": "The \"expiration\" cannot be empty" + } + } + } + } + } + } + }, + "x-validation-schema": "toggleEphemeralSchema", + "x-source": "src/api/routes/group.router.ts" } }, { "method": "post", - "path": "/openai/ignoreJid/{instanceName}", - "source": "src/api/integrations/chatbot/openai/routes/openai.router.ts", + "path": "/group/updateGroupDescription/{instanceName}", + "source": "src/api/routes/group.router.ts", + "schemaName": "updateGroupDescriptionSchema", + "schema": { + "type": "object", + "properties": { + "groupJid": { + "type": "string" + }, + "description": { + "type": "string" + } + }, + "required": [ + "groupJid", + "description" + ], + "if": { + "propertyNames": { + "enum": [ + "groupJid", + "description" + ] + } + }, + "then": { + "properties": { + "groupJid": { + "minLength": 1, + "description": "The \"groupJid\" cannot be empty" + }, + "description": { + "minLength": 1, + "description": "The \"description\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "CREATED", "operation": { "tags": [ - "OpenAI" + "Groups" ], - "summary": "Update ignore Jid", - "description": "Update ignore Jid for OpenAI.", - "operationId": "post_openai_ignoreJid", + "summary": "Update update Group Description", + "description": "Update update Group Description for Groups.", + "operationId": "post_group_updateGroupDescription", "parameters": [ { "name": "instanceName", @@ -7203,17 +42845,254 @@ } ], "responses": { - "200": { - "description": "Successful response." + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -7222,26 +43101,95 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "groupJid": { + "type": "string" + }, + "description": { + "type": "string" + } + }, + "required": [ + "groupJid", + "description" + ], + "if": { + "propertyNames": { + "enum": [ + "groupJid", + "description" + ] + } + }, + "then": { + "properties": { + "groupJid": { + "minLength": 1, + "description": "The \"groupJid\" cannot be empty" + }, + "description": { + "minLength": 1, + "description": "The \"description\" cannot be empty" + } + } + } + } } } }, - "x-source": "src/api/integrations/chatbot/openai/routes/openai.router.ts" + "x-validation-schema": "updateGroupDescriptionSchema", + "x-source": "src/api/routes/group.router.ts" } }, { "method": "post", - "path": "/openai/settings/{instanceName}", - "source": "src/api/integrations/chatbot/openai/routes/openai.router.ts", + "path": "/group/updateGroupPicture/{instanceName}", + "source": "src/api/routes/group.router.ts", + "schemaName": "updateGroupPictureSchema", + "schema": { + "type": "object", + "properties": { + "groupJid": { + "type": "string" + }, + "image": { + "type": "string" + } + }, + "required": [ + "groupJid", + "image" + ], + "if": { + "propertyNames": { + "enum": [ + "groupJid", + "image" + ] + } + }, + "then": { + "properties": { + "groupJid": { + "minLength": 1, + "description": "The \"groupJid\" cannot be empty" + }, + "image": { + "minLength": 1, + "description": "The \"image\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "CREATED", "operation": { "tags": [ - "OpenAI" + "Groups" ], - "summary": "Update settings", - "description": "Update settings for OpenAI.", - "operationId": "post_openai_settings", + "summary": "Update update Group Picture", + "description": "Update update Group Picture for Groups.", + "operationId": "post_group_updateGroupPicture", "parameters": [ { "name": "instanceName", @@ -7254,17 +43202,254 @@ } ], "responses": { - "200": { - "description": "Successful response." + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -7273,36 +43458,96 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "groupJid": { + "type": "string" + }, + "image": { + "type": "string" + } + }, + "required": [ + "groupJid", + "image" + ], + "if": { + "propertyNames": { + "enum": [ + "groupJid", + "image" + ] + } + }, + "then": { + "properties": { + "groupJid": { + "minLength": 1, + "description": "The \"groupJid\" cannot be empty" + }, + "image": { + "minLength": 1, + "description": "The \"image\" cannot be empty" + } + } + } + } } } }, - "x-source": "src/api/integrations/chatbot/openai/routes/openai.router.ts" + "x-validation-schema": "updateGroupPictureSchema", + "x-source": "src/api/routes/group.router.ts" } }, { - "method": "put", - "path": "/openai/update/{openaiBotId}/{instanceName}", - "source": "src/api/integrations/chatbot/openai/routes/openai.router.ts", + "method": "post", + "path": "/group/updateGroupSubject/{instanceName}", + "source": "src/api/routes/group.router.ts", + "schemaName": "updateGroupSubjectSchema", + "schema": { + "type": "object", + "properties": { + "groupJid": { + "type": "string" + }, + "subject": { + "type": "string" + } + }, + "required": [ + "groupJid", + "subject" + ], + "if": { + "propertyNames": { + "enum": [ + "groupJid", + "subject" + ] + } + }, + "then": { + "properties": { + "groupJid": { + "minLength": 1, + "description": "The \"groupJid\" cannot be empty" + }, + "subject": { + "minLength": 1, + "description": "The \"subject\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "CREATED", "operation": { "tags": [ - "OpenAI" + "Groups" ], - "summary": "Update update", - "description": "Update update for OpenAI.", - "operationId": "put_openai_update", + "summary": "Update update Group Subject", + "description": "Update update Group Subject for Groups.", + "operationId": "post_group_updateGroupSubject", "parameters": [ - { - "name": "openaiBotId", - "in": "path", - "required": true, - "description": "Openai Bot Id path parameter.", - "schema": { - "type": "string" - } - }, { "name": "instanceName", "in": "path", @@ -7314,17 +43559,254 @@ } ], "responses": { - "200": { - "description": "Successful response." + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -7333,26 +43815,113 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "groupJid": { + "type": "string" + }, + "subject": { + "type": "string" + } + }, + "required": [ + "groupJid", + "subject" + ], + "if": { + "propertyNames": { + "enum": [ + "groupJid", + "subject" + ] + } + }, + "then": { + "properties": { + "groupJid": { + "minLength": 1, + "description": "The \"groupJid\" cannot be empty" + }, + "subject": { + "minLength": 1, + "description": "The \"subject\" cannot be empty" + } + } + } + } } } }, - "x-source": "src/api/integrations/chatbot/openai/routes/openai.router.ts" + "x-validation-schema": "updateGroupSubjectSchema", + "x-source": "src/api/routes/group.router.ts" } }, { - "method": "get", - "path": "/proxy/find/{instanceName}", - "source": "src/api/routes/proxy.router.ts", + "method": "post", + "path": "/group/updateParticipant/{instanceName}", + "source": "src/api/routes/group.router.ts", + "schemaName": "updateParticipantsSchema", + "schema": { + "type": "object", + "properties": { + "groupJid": { + "type": "string" + }, + "action": { + "type": "string", + "enum": [ + "add", + "remove", + "promote", + "demote" + ] + }, + "participants": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "minLength": 10, + "pattern": "\\d+", + "description": "\"participants\" must be an array of numeric strings" + } + } + }, + "required": [ + "groupJid", + "action", + "participants" + ], + "if": { + "propertyNames": { + "enum": [ + "groupJid", + "action" + ] + } + }, + "then": { + "properties": { + "groupJid": { + "minLength": 1, + "description": "The \"groupJid\" cannot be empty" + }, + "action": { + "minLength": 1, + "description": "The \"action\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "CREATED", "operation": { "tags": [ - "Proxy" + "Groups" ], - "summary": "Get find", - "description": "Get find for Proxy.", - "operationId": "get_proxy_find", + "summary": "Update update Participant", + "description": "Update update Participant for Groups.", + "operationId": "post_group_updateParticipant", "parameters": [ { "name": "instanceName", @@ -7365,33 +43934,375 @@ } ], "responses": { - "200": { - "description": "Successful response." + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, - "x-source": "src/api/routes/proxy.router.ts" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "groupJid": { + "type": "string" + }, + "action": { + "type": "string", + "enum": [ + "add", + "remove", + "promote", + "demote" + ] + }, + "participants": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "minLength": 10, + "pattern": "\\d+", + "description": "\"participants\" must be an array of numeric strings" + } + } + }, + "required": [ + "groupJid", + "action", + "participants" + ], + "if": { + "propertyNames": { + "enum": [ + "groupJid", + "action" + ] + } + }, + "then": { + "properties": { + "groupJid": { + "minLength": 1, + "description": "The \"groupJid\" cannot be empty" + }, + "action": { + "minLength": 1, + "description": "The \"action\" cannot be empty" + } + } + } + } + } + } + }, + "x-validation-schema": "updateParticipantsSchema", + "x-source": "src/api/routes/group.router.ts" } }, { "method": "post", - "path": "/proxy/set/{instanceName}", - "source": "src/api/routes/proxy.router.ts", + "path": "/group/updateSetting/{instanceName}", + "source": "src/api/routes/group.router.ts", + "schemaName": "updateSettingsSchema", + "schema": { + "type": "object", + "properties": { + "groupJid": { + "type": "string" + }, + "action": { + "type": "string", + "enum": [ + "announcement", + "not_announcement", + "locked", + "unlocked" + ] + } + }, + "required": [ + "groupJid", + "action" + ], + "if": { + "propertyNames": { + "enum": [ + "groupJid", + "action" + ] + } + }, + "then": { + "properties": { + "groupJid": { + "minLength": 1, + "description": "The \"groupJid\" cannot be empty" + }, + "action": { + "minLength": 1, + "description": "The \"action\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "CREATED", "operation": { "tags": [ - "Proxy" + "Groups" ], - "summary": "Update set", - "description": "Update set for Proxy.", - "operationId": "post_proxy_set", + "summary": "Update update Setting", + "description": "Update update Setting for Groups.", + "operationId": "post_group_updateSetting", "parameters": [ { "name": "instanceName", @@ -7404,17 +44315,254 @@ } ], "responses": { - "200": { - "description": "Successful response." + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -7423,26 +44571,66 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "groupJid": { + "type": "string" + }, + "action": { + "type": "string", + "enum": [ + "announcement", + "not_announcement", + "locked", + "unlocked" + ] + } + }, + "required": [ + "groupJid", + "action" + ], + "if": { + "propertyNames": { + "enum": [ + "groupJid", + "action" + ] + } + }, + "then": { + "properties": { + "groupJid": { + "minLength": 1, + "description": "The \"groupJid\" cannot be empty" + }, + "action": { + "minLength": 1, + "description": "The \"action\" cannot be empty" + } + } + } + } } } }, - "x-source": "src/api/routes/proxy.router.ts" + "x-validation-schema": "updateSettingsSchema", + "x-source": "src/api/routes/group.router.ts" } }, { "method": "get", - "path": "/pusher/find/{instanceName}", - "source": "src/api/integrations/event/pusher/pusher.router.ts", + "path": "/instance/connect/{instanceName}", + "source": "src/api/routes/instance.router.ts", + "schemaName": "null", + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Pusher" + "Instances" ], - "summary": "Get find", - "description": "Get find for Pusher.", - "operationId": "get_pusher_find", + "summary": "Update connect", + "description": "Update connect for Instances.", + "operationId": "get_instance_connect", "parameters": [ { "name": "instanceName", @@ -7452,42 +44640,11 @@ "schema": { "type": "string" } - } - ], - "responses": { - "200": { - "description": "Successful response." - }, - "400": { - "description": "Invalid request." - }, - "401": { - "description": "Missing or invalid API key." }, - "404": { - "description": "Instance or resource not found." - } - }, - "x-source": "src/api/integrations/event/pusher/pusher.router.ts" - } - }, - { - "method": "post", - "path": "/pusher/set/{instanceName}", - "source": "src/api/integrations/event/pusher/pusher.router.ts", - "operation": { - "tags": [ - "Pusher" - ], - "summary": "Update set", - "description": "Update set for Pusher.", - "operationId": "post_pusher_set", - "parameters": [ { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", + "name": "number", + "in": "query", + "required": false, "schema": { "type": "string" } @@ -7495,44 +44652,273 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } } } }, - "x-source": "src/api/integrations/event/pusher/pusher.router.ts" + "x-validation-schema": "null", + "x-source": "src/api/routes/instance.router.ts" } }, { "method": "get", - "path": "/rabbitmq/find/{instanceName}", - "source": "src/api/integrations/event/rabbitmq/rabbitmq.router.ts", + "path": "/instance/connectionState/{instanceName}", + "source": "src/api/routes/instance.router.ts", + "schemaName": "null", + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "RabbitMQ" + "Instances" ], - "summary": "Get find", - "description": "Get find for RabbitMQ.", - "operationId": "get_rabbitmq_find", + "summary": "Get connection State", + "description": "Get connection State for Instances.", + "operationId": "get_instance_connectionState", "parameters": [ { "name": "instanceName", @@ -7546,208 +44932,797 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, - "x-source": "src/api/integrations/event/rabbitmq/rabbitmq.router.ts" + "x-validation-schema": "null", + "x-source": "src/api/routes/instance.router.ts" } }, { "method": "post", - "path": "/rabbitmq/set/{instanceName}", - "source": "src/api/integrations/event/rabbitmq/rabbitmq.router.ts", - "operation": { - "tags": [ - "RabbitMQ" - ], - "summary": "Update set", - "description": "Update set for RabbitMQ.", - "operationId": "post_rabbitmq_set", - "parameters": [ - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" + "path": "/instance/create", + "source": "src/api/routes/instance.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] } - } - ], - "responses": { - "200": { - "description": "Successful response." }, - "400": { - "description": "Invalid request." + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } }, - "401": { - "description": "Missing or invalid API key." + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } }, - "404": { - "description": "Instance or resource not found." + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" } }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} - } + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] } }, - "x-source": "src/api/integrations/event/rabbitmq/rabbitmq.router.ts" - } - }, - { - "method": "post", - "path": "/s3/getMedia/{instanceName}", - "source": "src/api/integrations/storage/s3/routes/s3.router.ts", - "operation": { - "tags": [ - "S3" - ], - "summary": "Get get Media", - "description": "Get get Media for S3.", - "operationId": "post_s3_getMedia", - "parameters": [ - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" } } + } + }, + "multipart": false, + "runtimeStatus": "CREATED", + "operation": { + "tags": [ + "Instances" ], + "summary": "Create create", + "description": "Create create for Instances.", + "operationId": "post_instance_create", + "parameters": [], "responses": { - "200": { - "description": "Successful response." + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} - } - } - }, - "x-source": "src/api/integrations/storage/s3/routes/s3.router.ts" - } - }, - { - "method": "post", - "path": "/s3/getMediaUrl/{instanceName}", - "source": "src/api/integrations/storage/s3/routes/s3.router.ts", - "operation": { - "tags": [ - "S3" - ], - "summary": "Get get Media Url", - "description": "Get get Media Url for S3.", - "operationId": "post_s3_getMediaUrl", - "parameters": [ - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } } - } - ], - "responses": { - "200": { - "description": "Successful response." - }, - "400": { - "description": "Invalid request." - }, - "401": { - "description": "Missing or invalid API key." }, - "404": { - "description": "Instance or resource not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} - } - } - }, - "x-source": "src/api/integrations/storage/s3/routes/s3.router.ts" - } - }, - { - "method": "post", - "path": "/settings-template/assign/{instanceName}", - "source": "src/api/routes/settingsTemplate.router.ts", - "operation": { - "tags": [ - "Settings templates" - ], - "summary": "Assign a settings template", - "description": "Run assign. Template edits propagate to every binding without copying settings.", - "operationId": "post_settings_template_assign", - "parameters": [ - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } } - } - ], - "responses": { - "200": { - "description": "Settings template operation completed." }, - "400": { - "description": "Invalid template, scope, or target." - }, - "401": { - "description": "Missing or invalid API key." + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } }, - "404": { - "description": "Instance or settings template not found." + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -7756,49 +45731,299 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": false, - "required": [ - "templateId", - "scope" - ], "properties": { - "templateId": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { "type": "string", - "minLength": 1 + "pattern": "^\\d+[\\.@\\w-]+" }, - "scope": { + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { "type": "string", "enum": [ - "instance", - "group", - "contact" + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" ] }, - "target": { - "type": "string", - "minLength": 3, - "maxLength": 255, - "description": "Omit for instance scope. Group targets end in @g.us; contact targets are full non-group WhatsApp identifiers." + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } } } } } } }, - "x-source": "src/api/routes/settingsTemplate.router.ts" + "x-validation-schema": "instanceSchema", + "x-source": "src/api/routes/instance.router.ts" } }, { - "method": "get", - "path": "/settings-template/bindings/{instanceName}", - "source": "src/api/routes/settingsTemplate.router.ts", + "method": "delete", + "path": "/instance/delete/{instanceName}", + "source": "src/api/routes/instance.router.ts", + "schemaName": "null", + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Settings templates" + "Instances" ], - "summary": "List template bindings", - "description": "List the instance default and exact group/contact bindings.", - "operationId": "get_settings_template_bindings", + "summary": "Delete delete", + "description": "Delete delete for Instances.", + "operationId": "delete_instance_delete", "parameters": [ { "name": "instanceName", @@ -7812,188 +46037,1084 @@ ], "responses": { "200": { - "description": "Template binding list." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid template, scope, or target." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or settings template not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, - "x-source": "src/api/routes/settingsTemplate.router.ts" + "x-validation-schema": "null", + "x-source": "src/api/routes/instance.router.ts" } }, { - "method": "post", - "path": "/settings-template/create", - "source": "src/api/routes/settingsTemplate.router.ts", + "method": "get", + "path": "/instance/fetchInstances", + "source": "src/api/routes/instance.router.ts", + "multipart": false, "operation": { "tags": [ - "Settings templates" + "Instances" ], - "summary": "Create a settings template", - "description": "Create create. Template edits propagate to every binding without copying settings.", - "operationId": "post_settings_template_create", + "summary": "Get fetch Instances", + "description": "Get fetch Instances for Instances.", + "operationId": "get_instance_fetchInstances", "parameters": [], "responses": { - "201": { - "description": "Settings template created." + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid template, scope, or target." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or settings template not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": false, - "required": [ - "name", - "settings" - ], - "properties": { - "name": { - "type": "string", - "minLength": 1, - "maxLength": 255 - }, - "settings": { - "type": "object", - "additionalProperties": false, - "properties": { - "localReadTtlSeconds": { - "type": [ - "integer", - "null" - ], - "minimum": 0, - "maximum": 2592000 - }, - "localReadTtlOverrides": { - "type": [ - "object", - "null" - ], - "additionalProperties": { - "type": "integer", - "minimum": 0, - "maximum": 2592000 + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } } - }, - "automationSafety": { - "type": [ - "object", - "null" - ], - "additionalProperties": true - } + ] } } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." } - }, - "example": { - "name": "Careful outreach", - "settings": { - "localReadTtlSeconds": 120, - "automationSafety": { - "enabled": true + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." } } } } }, - "x-source": "src/api/routes/settingsTemplate.router.ts" + "x-source": "src/api/routes/instance.router.ts" } }, { "method": "delete", - "path": "/settings-template/delete", - "source": "src/api/routes/settingsTemplate.router.ts", + "path": "/instance/logout/{instanceName}", + "source": "src/api/routes/instance.router.ts", + "schemaName": "null", + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Settings templates" + "Instances" + ], + "summary": "Delete logout", + "description": "Delete logout for Instances.", + "operationId": "delete_instance_logout", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } ], - "summary": "Delete a settings template", - "description": "Delete delete. Template edits propagate to every binding without copying settings.", - "operationId": "delete_settings_template_delete", - "parameters": [], "responses": { "200": { - "description": "Settings template operation completed." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid template, scope, or target." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or settings template not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": false, - "required": [ - "templateId" - ], - "properties": { - "templateId": { - "type": "string", - "minLength": 1 + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." } } } } }, - "x-source": "src/api/routes/settingsTemplate.router.ts" + "x-validation-schema": "null", + "x-source": "src/api/routes/instance.router.ts" } }, { "method": "post", - "path": "/settings-template/duplicate", - "source": "src/api/routes/settingsTemplate.router.ts", + "path": "/instance/restart/{instanceName}", + "source": "src/api/routes/instance.router.ts", + "schemaName": "null", + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Settings templates" + "Instances" + ], + "summary": "Update restart", + "description": "Update restart for Instances.", + "operationId": "post_instance_restart", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } ], - "summary": "Duplicate a settings template", - "description": "Run duplicate. Template edits propagate to every binding without copying settings.", - "operationId": "post_settings_template_duplicate", - "parameters": [], "responses": { - "201": { - "description": "Settings template created." + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid template, scope, or target." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or settings template not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, + "x-validation-schema": "null", + "x-source": "src/api/routes/instance.router.ts", "requestBody": { "required": true, "content": { @@ -8001,52 +47122,306 @@ "schema": { "type": "object", "additionalProperties": false, - "required": [ - "templateId", - "name" - ], - "properties": { - "templateId": { - "type": "string", - "minLength": 1 - }, - "name": { - "type": "string", - "minLength": 1, - "maxLength": 255 - } - } + "properties": {}, + "required": [] } } } - }, - "x-source": "src/api/routes/settingsTemplate.router.ts" + } } }, { "method": "post", - "path": "/settings-template/edit", - "source": "src/api/routes/settingsTemplate.router.ts", + "path": "/instance/setPresence/{instanceName}", + "source": "src/api/routes/instance.router.ts", + "schemaName": "presenceOnlySchema", + "schema": { + "type": "object", + "properties": { + "presence": { + "type": "string", + "enum": [ + "unavailable", + "available", + "composing", + "recording", + "paused" + ] + } + }, + "required": [ + "presence" + ] + }, + "multipart": false, + "runtimeStatus": "CREATED", "operation": { "tags": [ - "Settings templates" + "Instances" ], - "summary": "Edit a settings template", - "description": "Run edit. Template edits propagate to every binding without copying settings.", - "operationId": "post_settings_template_edit", - "parameters": [], - "responses": { - "200": { - "description": "Settings template operation completed." - }, - "400": { - "description": "Invalid template, scope, or target." + "summary": "Update set Presence", + "description": "Update set Presence for Instances.", + "operationId": "post_instance_setPresence", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or settings template not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -8055,168 +47430,586 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": false, - "required": [ - "templateId" - ], "properties": { - "templateId": { - "type": "string", - "minLength": 1 - }, - "name": { + "presence": { "type": "string", - "minLength": 1, - "maxLength": 255 - }, - "settings": { - "type": "object", - "additionalProperties": false, - "properties": { - "localReadTtlSeconds": { - "type": [ - "integer", - "null" - ], - "minimum": 0, - "maximum": 2592000 - }, - "localReadTtlOverrides": { - "type": [ - "object", - "null" - ], - "additionalProperties": { - "type": "integer", - "minimum": 0, - "maximum": 2592000 - } - }, - "automationSafety": { - "type": [ - "object", - "null" - ], - "additionalProperties": true - } - } + "enum": [ + "unavailable", + "available", + "composing", + "recording", + "paused" + ] } - } + }, + "required": [ + "presence" + ] } } } }, - "x-source": "src/api/routes/settingsTemplate.router.ts" + "x-validation-schema": "presenceOnlySchema", + "x-source": "src/api/routes/instance.router.ts" } }, { "method": "get", - "path": "/settings-template/list", - "source": "src/api/routes/settingsTemplate.router.ts", + "path": "/instanceapikey", + "source": "src/api/routes/instance.router.ts", + "schemaName": "null", + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ - "Settings templates" + "Instance API key" ], - "summary": "List settings templates", - "description": "List live shared settings templates.", - "operationId": "get_settings_template_list", + "summary": "Get instanceapikey", + "description": "Get instanceapikey for Instance API key.", + "operationId": "get_instanceapikey", "parameters": [], "responses": { "200": { - "description": "Settings template list." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid template, scope, or target." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or settings template not found." - } - }, - "x-source": "src/api/routes/settingsTemplate.router.ts" - } - }, - { - "method": "delete", - "path": "/settings-template/unassign/{instanceName}", - "source": "src/api/routes/settingsTemplate.router.ts", - "operation": { - "tags": [ - "Settings templates" - ], - "summary": "Unassign a settings template", - "description": "Delete unassign. Template edits propagate to every binding without copying settings.", - "operationId": "delete_settings_template_unassign", - "parameters": [ - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } } - } - ], - "responses": { - "200": { - "description": "Settings template operation completed." }, - "400": { - "description": "Invalid template, scope, or target." + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } }, - "401": { - "description": "Missing or invalid API key." + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } }, - "404": { - "description": "Instance or settings template not found." - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": false, - "required": [ - "scope" - ], - "properties": { - "scope": { - "type": "string", - "enum": [ - "instance", - "group", - "contact" - ] - }, - "target": { - "type": "string", - "minLength": 3, - "maxLength": 255 + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." } } } } }, - "x-source": "src/api/routes/settingsTemplate.router.ts" + "x-validation-schema": "null", + "x-source": "src/api/routes/instance.router.ts" } }, { "method": "get", - "path": "/settings/find/{instanceName}", - "source": "src/api/routes/settings.router.ts", + "path": "/kafka/find/{instanceName}", + "source": "src/api/integrations/event/kafka/kafka.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, "operation": { "tags": [ - "Instance settings" + "Kafka" ], "summary": "Get find", - "description": "Get find for Instance settings.", - "operationId": "get_settings_find", + "description": "Get find for Kafka.", + "operationId": "get_kafka_find", "parameters": [ { "name": "instanceName", @@ -8230,32 +48023,30120 @@ ], "responses": { "200": { - "description": "Successful response." - }, - "400": { - "description": "Invalid request." - }, + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/event/kafka/kafka.router.ts" + } + }, + { + "method": "post", + "path": "/kafka/set/{instanceName}", + "source": "src/api/integrations/event/kafka/kafka.router.ts", + "schemaName": "eventSchema", + "schema": { + "type": "object", + "properties": { + "websocket": { + "$ref": "#/$defs/event" + }, + "rabbitmq": { + "$ref": "#/$defs/event" + }, + "nats": { + "$ref": "#/$defs/event" + }, + "sqs": { + "$ref": "#/$defs/event" + }, + "kafka": { + "$ref": "#/$defs/event" + } + }, + "$defs": { + "event": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "events": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "CONTACTS_SET", + "CONTACTS_UPSERT", + "CONTACTS_UPDATE", + "PRESENCE_UPDATE", + "CHATS_SET", + "CHATS_UPSERT", + "CHATS_UPDATE", + "CHATS_DELETE", + "GROUPS_UPSERT", + "GROUPS_UPDATE", + "GROUP_PARTICIPANTS_UPDATE", + "CONNECTION_UPDATE", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS", + "REMOVE_INSTANCE", + "LOGOUT_INSTANCE", + "INSTANCE_CREATE", + "INSTANCE_DELETE", + "STATUS_INSTANCE", + "CREDS_UPDATE", + "MESSAGING_HISTORY_SET", + "MESSAGING_HISTORY_STATUS", + "LID_MAPPING_UPDATE", + "MESSAGES_MEDIA_UPDATE", + "MESSAGES_REACTION", + "MESSAGE_RECEIPT_UPDATE", + "GROUP_JOIN_REQUEST", + "GROUP_MEMBER_TAG_UPDATE", + "BLOCKLIST_SET", + "BLOCKLIST_UPDATE", + "NEWSLETTER_REACTION", + "NEWSLETTER_VIEW", + "NEWSLETTER_PARTICIPANTS_UPDATE", + "NEWSLETTER_SETTINGS_UPDATE", + "MESSAGE_CAPPING_UPDATE", + "CHATS_LOCK", + "SETTINGS_UPDATE" + ] + } + } + }, + "required": [ + "enabled" + ] + } + } + }, + "multipart": false, + "runtimeStatus": "CREATED", + "operation": { + "tags": [ + "Kafka" + ], + "summary": "Update set", + "description": "Update set for Kafka.", + "operationId": "post_kafka_set", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "websocket": { + "$ref": "#/$defs/event" + }, + "rabbitmq": { + "$ref": "#/$defs/event" + }, + "nats": { + "$ref": "#/$defs/event" + }, + "sqs": { + "$ref": "#/$defs/event" + }, + "kafka": { + "$ref": "#/$defs/event" + } + }, + "$defs": { + "event": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "events": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "CONTACTS_SET", + "CONTACTS_UPSERT", + "CONTACTS_UPDATE", + "PRESENCE_UPDATE", + "CHATS_SET", + "CHATS_UPSERT", + "CHATS_UPDATE", + "CHATS_DELETE", + "GROUPS_UPSERT", + "GROUPS_UPDATE", + "GROUP_PARTICIPANTS_UPDATE", + "CONNECTION_UPDATE", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS", + "REMOVE_INSTANCE", + "LOGOUT_INSTANCE", + "INSTANCE_CREATE", + "INSTANCE_DELETE", + "STATUS_INSTANCE", + "CREDS_UPDATE", + "MESSAGING_HISTORY_SET", + "MESSAGING_HISTORY_STATUS", + "LID_MAPPING_UPDATE", + "MESSAGES_MEDIA_UPDATE", + "MESSAGES_REACTION", + "MESSAGE_RECEIPT_UPDATE", + "GROUP_JOIN_REQUEST", + "GROUP_MEMBER_TAG_UPDATE", + "BLOCKLIST_SET", + "BLOCKLIST_UPDATE", + "NEWSLETTER_REACTION", + "NEWSLETTER_VIEW", + "NEWSLETTER_PARTICIPANTS_UPDATE", + "NEWSLETTER_SETTINGS_UPDATE", + "MESSAGE_CAPPING_UPDATE", + "CHATS_LOCK", + "SETTINGS_UPDATE" + ] + } + } + }, + "required": [ + "enabled" + ] + } + } + } + } + } + }, + "x-validation-schema": "eventSchema", + "x-source": "src/api/integrations/event/kafka/kafka.router.ts" + } + }, + { + "method": "get", + "path": "/label/findLabels/{instanceName}", + "source": "src/api/routes/label.router.ts", + "schemaName": "null", + "multipart": false, + "runtimeStatus": "OK", + "operation": { + "tags": [ + "Labels" + ], + "summary": "Get find Labels", + "description": "Get find Labels for Labels.", + "operationId": "get_label_findLabels", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "x-validation-schema": "null", + "x-source": "src/api/routes/label.router.ts" + } + }, + { + "method": "post", + "path": "/label/handleLabel/{instanceName}", + "source": "src/api/routes/label.router.ts", + "schemaName": "handleLabelSchema", + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string", + "description": "Invalid format" + }, + "labelId": { + "type": "string" + }, + "action": { + "type": "string", + "enum": [ + "add", + "remove" + ] + } + }, + "required": [ + "number", + "labelId", + "action" + ], + "if": { + "propertyNames": { + "enum": [ + "number", + "labelId", + "action" + ] + } + }, + "then": { + "properties": { + "number": { + "minLength": 1, + "description": "The \"number\" cannot be empty" + }, + "labelId": { + "minLength": 1, + "description": "The \"labelId\" cannot be empty" + }, + "action": { + "minLength": 1, + "description": "The \"action\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", + "operation": { + "tags": [ + "Labels" + ], + "summary": "Update handle Label", + "description": "Update handle Label for Labels.", + "operationId": "post_label_handleLabel", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string", + "description": "Invalid format" + }, + "labelId": { + "type": "string" + }, + "action": { + "type": "string", + "enum": [ + "add", + "remove" + ] + } + }, + "required": [ + "number", + "labelId", + "action" + ], + "if": { + "propertyNames": { + "enum": [ + "number", + "labelId", + "action" + ] + } + }, + "then": { + "properties": { + "number": { + "minLength": 1, + "description": "The \"number\" cannot be empty" + }, + "labelId": { + "minLength": 1, + "description": "The \"labelId\" cannot be empty" + }, + "action": { + "minLength": 1, + "description": "The \"action\" cannot be empty" + } + } + } + } + } + } + }, + "x-validation-schema": "handleLabelSchema", + "x-source": "src/api/routes/label.router.ts" + } + }, + { + "method": "post", + "path": "/message/sendButtons/{instanceName}", + "source": "src/api/routes/sendMessage.router.ts", + "schemaName": "buttonsMessageSchema", + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string", + "pattern": "^(?!@[^@\\s]+$).+", + "description": "Use a phone number or full WhatsApp JID. A raw @username must first be resolved to an authoritative @lid JID." + }, + "settingsTemplateId": { + "type": "string", + "minLength": 1 + }, + "thumbnailUrl": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "footer": { + "type": "string" + }, + "buttons": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "reply", + "copy", + "url", + "call", + "pix" + ] + }, + "displayText": { + "type": "string" + }, + "id": { + "type": "string" + }, + "url": { + "type": "string" + }, + "phoneNumber": { + "type": "string" + }, + "currency": { + "type": "string" + }, + "name": { + "type": "string" + }, + "keyType": { + "type": "string", + "enum": [ + "phone", + "email", + "cpf", + "cnpj", + "random" + ] + }, + "key": { + "type": "string" + } + }, + "required": [ + "type" + ], + "if": { + "propertyNames": { + "enum": [ + "id", + "url", + "phoneNumber" + ] + } + }, + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + }, + "url": { + "minLength": 1, + "description": "The \"url\" cannot be empty" + }, + "phoneNumber": { + "minLength": 1, + "description": "The \"phoneNumber\" cannot be empty" + } + } + } + } + }, + "delay": { + "type": "integer", + "description": "Enter a value in milliseconds" + }, + "quoted": { + "properties": { + "key": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "remoteJid": { + "type": "string" + }, + "remoteJidAlt": { + "type": "string" + }, + "participant": { + "type": "string" + }, + "participantAlt": { + "type": "string" + }, + "addressingMode": { + "type": "string", + "enum": [ + "lid", + "pn" + ] + }, + "fromMe": { + "type": "boolean", + "enum": [ + true, + false + ] + } + }, + "required": [ + "id" + ], + "if": { + "propertyNames": { + "enum": [ + "id" + ] + } + }, + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + } + } + } + }, + "message": { + "type": "object" + } + } + }, + "everyOne": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "mentioned": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\d+", + "description": "\"mentioned\" must be an array of numeric strings" + } + } + }, + "required": [ + "number" + ] + }, + "multipart": false, + "runtimeStatus": "CREATED", + "operation": { + "tags": [ + "Messages" + ], + "summary": "Create send Buttons", + "description": "Create send Buttons for Messages.", + "operationId": "post_message_sendButtons", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string", + "pattern": "^(?!@[^@\\s]+$).+", + "description": "Use a phone number or full WhatsApp JID. A raw @username must first be resolved to an authoritative @lid JID." + }, + "settingsTemplateId": { + "type": "string", + "minLength": 1 + }, + "thumbnailUrl": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "footer": { + "type": "string" + }, + "buttons": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "reply", + "copy", + "url", + "call", + "pix" + ] + }, + "displayText": { + "type": "string" + }, + "id": { + "type": "string" + }, + "url": { + "type": "string" + }, + "phoneNumber": { + "type": "string" + }, + "currency": { + "type": "string" + }, + "name": { + "type": "string" + }, + "keyType": { + "type": "string", + "enum": [ + "phone", + "email", + "cpf", + "cnpj", + "random" + ] + }, + "key": { + "type": "string" + } + }, + "required": [ + "type" + ], + "if": { + "propertyNames": { + "enum": [ + "id", + "url", + "phoneNumber" + ] + } + }, + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + }, + "url": { + "minLength": 1, + "description": "The \"url\" cannot be empty" + }, + "phoneNumber": { + "minLength": 1, + "description": "The \"phoneNumber\" cannot be empty" + } + } + } + } + }, + "delay": { + "type": "integer", + "description": "Enter a value in milliseconds" + }, + "quoted": { + "properties": { + "key": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "remoteJid": { + "type": "string" + }, + "remoteJidAlt": { + "type": "string" + }, + "participant": { + "type": "string" + }, + "participantAlt": { + "type": "string" + }, + "addressingMode": { + "type": "string", + "enum": [ + "lid", + "pn" + ] + }, + "fromMe": { + "type": "boolean", + "enum": [ + true, + false + ] + } + }, + "required": [ + "id" + ], + "if": { + "propertyNames": { + "enum": [ + "id" + ] + } + }, + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + } + } + } + }, + "message": { + "type": "object" + } + } + }, + "everyOne": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "mentioned": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\d+", + "description": "\"mentioned\" must be an array of numeric strings" + } + } + }, + "required": [ + "number" + ] + } + } + } + }, + "x-validation-schema": "buttonsMessageSchema", + "x-source": "src/api/routes/sendMessage.router.ts" + } + }, + { + "method": "post", + "path": "/message/sendContact/{instanceName}", + "source": "src/api/routes/sendMessage.router.ts", + "schemaName": "contactMessageSchema", + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string", + "pattern": "^(?!@[^@\\s]+$).+", + "description": "Use a phone number or full WhatsApp JID. A raw @username must first be resolved to an authoritative @lid JID." + }, + "settingsTemplateId": { + "type": "string", + "minLength": 1 + }, + "contact": { + "type": "array", + "items": { + "type": "object", + "properties": { + "fullName": { + "type": "string" + }, + "wuid": { + "type": "string", + "minLength": 10, + "pattern": "\\d+", + "description": "\"wuid\" must be a numeric string" + }, + "phoneNumber": { + "type": "string", + "minLength": 10 + }, + "organization": { + "type": "string" + }, + "email": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": [ + "fullName", + "phoneNumber" + ], + "if": { + "propertyNames": { + "enum": [ + "fullName" + ] + } + }, + "then": { + "properties": { + "fullName": { + "minLength": 1, + "description": "The \"fullName\" cannot be empty" + } + } + } + }, + "minItems": 1, + "uniqueItems": true + } + }, + "required": [ + "number", + "contact" + ] + }, + "multipart": false, + "runtimeStatus": "CREATED", + "operation": { + "tags": [ + "Messages" + ], + "summary": "Create send Contact", + "description": "Create send Contact for Messages.", + "operationId": "post_message_sendContact", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string", + "pattern": "^(?!@[^@\\s]+$).+", + "description": "Use a phone number or full WhatsApp JID. A raw @username must first be resolved to an authoritative @lid JID." + }, + "settingsTemplateId": { + "type": "string", + "minLength": 1 + }, + "contact": { + "type": "array", + "items": { + "type": "object", + "properties": { + "fullName": { + "type": "string" + }, + "wuid": { + "type": "string", + "minLength": 10, + "pattern": "\\d+", + "description": "\"wuid\" must be a numeric string" + }, + "phoneNumber": { + "type": "string", + "minLength": 10 + }, + "organization": { + "type": "string" + }, + "email": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": [ + "fullName", + "phoneNumber" + ], + "if": { + "propertyNames": { + "enum": [ + "fullName" + ] + } + }, + "then": { + "properties": { + "fullName": { + "minLength": 1, + "description": "The \"fullName\" cannot be empty" + } + } + } + }, + "minItems": 1, + "uniqueItems": true + } + }, + "required": [ + "number", + "contact" + ] + } + } + } + }, + "x-validation-schema": "contactMessageSchema", + "x-source": "src/api/routes/sendMessage.router.ts" + } + }, + { + "method": "post", + "path": "/message/sendList/{instanceName}", + "source": "src/api/routes/sendMessage.router.ts", + "schemaName": "listMessageSchema", + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string", + "pattern": "^(?!@[^@\\s]+$).+", + "description": "Use a phone number or full WhatsApp JID. A raw @username must first be resolved to an authoritative @lid JID." + }, + "settingsTemplateId": { + "type": "string", + "minLength": 1 + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "footerText": { + "type": "string" + }, + "buttonText": { + "type": "string" + }, + "sections": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "rows": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "rowId": { + "type": "string" + } + }, + "required": [ + "title", + "rowId" + ], + "if": { + "propertyNames": { + "enum": [ + "title", + "description", + "rowId" + ] + } + }, + "then": { + "properties": { + "title": { + "minLength": 1, + "description": "The \"title\" cannot be empty" + }, + "description": { + "minLength": 1, + "description": "The \"description\" cannot be empty" + }, + "rowId": { + "minLength": 1, + "description": "The \"rowId\" cannot be empty" + } + } + } + } + } + }, + "required": [ + "title", + "rows" + ], + "if": { + "propertyNames": { + "enum": [ + "title" + ] + } + }, + "then": { + "properties": { + "title": { + "minLength": 1, + "description": "The \"title\" cannot be empty" + } + } + } + } + }, + "delay": { + "type": "integer", + "description": "Enter a value in milliseconds" + }, + "quoted": { + "properties": { + "key": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "remoteJid": { + "type": "string" + }, + "remoteJidAlt": { + "type": "string" + }, + "participant": { + "type": "string" + }, + "participantAlt": { + "type": "string" + }, + "addressingMode": { + "type": "string", + "enum": [ + "lid", + "pn" + ] + }, + "fromMe": { + "type": "boolean", + "enum": [ + true, + false + ] + } + }, + "required": [ + "id" + ], + "if": { + "propertyNames": { + "enum": [ + "id" + ] + } + }, + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + } + } + } + }, + "message": { + "type": "object" + } + } + }, + "everyOne": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "mentioned": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\d+", + "description": "\"mentioned\" must be an array of numeric strings" + } + } + }, + "required": [ + "number", + "title", + "footerText", + "buttonText", + "sections" + ] + }, + "multipart": false, + "runtimeStatus": "CREATED", + "operation": { + "tags": [ + "Messages" + ], + "summary": "Create send List", + "description": "Create send List for Messages.", + "operationId": "post_message_sendList", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string", + "pattern": "^(?!@[^@\\s]+$).+", + "description": "Use a phone number or full WhatsApp JID. A raw @username must first be resolved to an authoritative @lid JID." + }, + "settingsTemplateId": { + "type": "string", + "minLength": 1 + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "footerText": { + "type": "string" + }, + "buttonText": { + "type": "string" + }, + "sections": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "rows": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "rowId": { + "type": "string" + } + }, + "required": [ + "title", + "rowId" + ], + "if": { + "propertyNames": { + "enum": [ + "title", + "description", + "rowId" + ] + } + }, + "then": { + "properties": { + "title": { + "minLength": 1, + "description": "The \"title\" cannot be empty" + }, + "description": { + "minLength": 1, + "description": "The \"description\" cannot be empty" + }, + "rowId": { + "minLength": 1, + "description": "The \"rowId\" cannot be empty" + } + } + } + } + } + }, + "required": [ + "title", + "rows" + ], + "if": { + "propertyNames": { + "enum": [ + "title" + ] + } + }, + "then": { + "properties": { + "title": { + "minLength": 1, + "description": "The \"title\" cannot be empty" + } + } + } + } + }, + "delay": { + "type": "integer", + "description": "Enter a value in milliseconds" + }, + "quoted": { + "properties": { + "key": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "remoteJid": { + "type": "string" + }, + "remoteJidAlt": { + "type": "string" + }, + "participant": { + "type": "string" + }, + "participantAlt": { + "type": "string" + }, + "addressingMode": { + "type": "string", + "enum": [ + "lid", + "pn" + ] + }, + "fromMe": { + "type": "boolean", + "enum": [ + true, + false + ] + } + }, + "required": [ + "id" + ], + "if": { + "propertyNames": { + "enum": [ + "id" + ] + } + }, + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + } + } + } + }, + "message": { + "type": "object" + } + } + }, + "everyOne": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "mentioned": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\d+", + "description": "\"mentioned\" must be an array of numeric strings" + } + } + }, + "required": [ + "number", + "title", + "footerText", + "buttonText", + "sections" + ] + } + } + } + }, + "x-validation-schema": "listMessageSchema", + "x-source": "src/api/routes/sendMessage.router.ts" + } + }, + { + "method": "post", + "path": "/message/sendLocation/{instanceName}", + "source": "src/api/routes/sendMessage.router.ts", + "schemaName": "locationMessageSchema", + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string", + "pattern": "^(?!@[^@\\s]+$).+", + "description": "Use a phone number or full WhatsApp JID. A raw @username must first be resolved to an authoritative @lid JID." + }, + "settingsTemplateId": { + "type": "string", + "minLength": 1 + }, + "latitude": { + "type": "number" + }, + "longitude": { + "type": "number" + }, + "name": { + "type": "string" + }, + "address": { + "type": "string" + }, + "delay": { + "type": "integer", + "description": "Enter a value in milliseconds" + }, + "quoted": { + "properties": { + "key": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "remoteJid": { + "type": "string" + }, + "remoteJidAlt": { + "type": "string" + }, + "participant": { + "type": "string" + }, + "participantAlt": { + "type": "string" + }, + "addressingMode": { + "type": "string", + "enum": [ + "lid", + "pn" + ] + }, + "fromMe": { + "type": "boolean", + "enum": [ + true, + false + ] + } + }, + "required": [ + "id" + ], + "if": { + "propertyNames": { + "enum": [ + "id" + ] + } + }, + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + } + } + } + }, + "message": { + "type": "object" + } + } + }, + "everyOne": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "mentioned": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\d+", + "description": "\"mentioned\" must be an array of numeric strings" + } + } + }, + "required": [ + "number", + "latitude", + "longitude", + "name", + "address" + ] + }, + "multipart": false, + "runtimeStatus": "CREATED", + "operation": { + "tags": [ + "Messages" + ], + "summary": "Create send Location", + "description": "Create send Location for Messages.", + "operationId": "post_message_sendLocation", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string", + "pattern": "^(?!@[^@\\s]+$).+", + "description": "Use a phone number or full WhatsApp JID. A raw @username must first be resolved to an authoritative @lid JID." + }, + "settingsTemplateId": { + "type": "string", + "minLength": 1 + }, + "latitude": { + "type": "number" + }, + "longitude": { + "type": "number" + }, + "name": { + "type": "string" + }, + "address": { + "type": "string" + }, + "delay": { + "type": "integer", + "description": "Enter a value in milliseconds" + }, + "quoted": { + "properties": { + "key": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "remoteJid": { + "type": "string" + }, + "remoteJidAlt": { + "type": "string" + }, + "participant": { + "type": "string" + }, + "participantAlt": { + "type": "string" + }, + "addressingMode": { + "type": "string", + "enum": [ + "lid", + "pn" + ] + }, + "fromMe": { + "type": "boolean", + "enum": [ + true, + false + ] + } + }, + "required": [ + "id" + ], + "if": { + "propertyNames": { + "enum": [ + "id" + ] + } + }, + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + } + } + } + }, + "message": { + "type": "object" + } + } + }, + "everyOne": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "mentioned": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\d+", + "description": "\"mentioned\" must be an array of numeric strings" + } + } + }, + "required": [ + "number", + "latitude", + "longitude", + "name", + "address" + ] + } + } + } + }, + "x-validation-schema": "locationMessageSchema", + "x-source": "src/api/routes/sendMessage.router.ts" + } + }, + { + "method": "post", + "path": "/message/sendMedia/{instanceName}", + "source": "src/api/routes/sendMessage.router.ts", + "schemaName": "mediaMessageSchema", + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string", + "pattern": "^(?!@[^@\\s]+$).+", + "description": "Use a phone number or full WhatsApp JID. A raw @username must first be resolved to an authoritative @lid JID." + }, + "settingsTemplateId": { + "type": "string", + "minLength": 1 + }, + "mediatype": { + "type": "string", + "enum": [ + "image", + "document", + "video", + "audio" + ] + }, + "mimetype": { + "type": "string" + }, + "media": { + "type": "string" + }, + "fileName": { + "type": "string" + }, + "caption": { + "type": "string" + }, + "delay": { + "type": "integer", + "description": "Enter a value in milliseconds" + }, + "quoted": { + "properties": { + "key": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "remoteJid": { + "type": "string" + }, + "remoteJidAlt": { + "type": "string" + }, + "participant": { + "type": "string" + }, + "participantAlt": { + "type": "string" + }, + "addressingMode": { + "type": "string", + "enum": [ + "lid", + "pn" + ] + }, + "fromMe": { + "type": "boolean", + "enum": [ + true, + false + ] + } + }, + "required": [ + "id" + ], + "if": { + "propertyNames": { + "enum": [ + "id" + ] + } + }, + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + } + } + } + }, + "message": { + "type": "object" + } + } + }, + "everyOne": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "mentioned": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\d+", + "description": "\"mentioned\" must be an array of numeric strings" + } + } + }, + "required": [ + "number", + "mediatype" + ] + }, + "multipart": true, + "runtimeStatus": "CREATED", + "operation": { + "tags": [ + "Messages" + ], + "summary": "Create send Media", + "description": "Create send Media for Messages.", + "operationId": "post_message_sendMedia", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string", + "pattern": "^(?!@[^@\\s]+$).+", + "description": "Use a phone number or full WhatsApp JID. A raw @username must first be resolved to an authoritative @lid JID." + }, + "settingsTemplateId": { + "type": "string", + "minLength": 1 + }, + "mediatype": { + "type": "string", + "enum": [ + "image", + "document", + "video", + "audio" + ] + }, + "mimetype": { + "type": "string" + }, + "media": { + "type": "string" + }, + "fileName": { + "type": "string" + }, + "caption": { + "type": "string" + }, + "delay": { + "type": "integer", + "description": "Enter a value in milliseconds" + }, + "quoted": { + "properties": { + "key": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "remoteJid": { + "type": "string" + }, + "remoteJidAlt": { + "type": "string" + }, + "participant": { + "type": "string" + }, + "participantAlt": { + "type": "string" + }, + "addressingMode": { + "type": "string", + "enum": [ + "lid", + "pn" + ] + }, + "fromMe": { + "type": "boolean", + "enum": [ + true, + false + ] + } + }, + "required": [ + "id" + ], + "if": { + "propertyNames": { + "enum": [ + "id" + ] + } + }, + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + } + } + } + }, + "message": { + "type": "object" + } + } + }, + "everyOne": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "mentioned": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\d+", + "description": "\"mentioned\" must be an array of numeric strings" + } + }, + "file": { + "type": "string", + "format": "binary" + } + }, + "required": [ + "number", + "mediatype" + ] + } + } + } + }, + "x-validation-schema": "mediaMessageSchema", + "x-source": "src/api/routes/sendMessage.router.ts" + } + }, + { + "method": "post", + "path": "/message/sendPoll/{instanceName}", + "source": "src/api/routes/sendMessage.router.ts", + "schemaName": "pollMessageSchema", + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string", + "pattern": "^(?!@[^@\\s]+$).+", + "description": "Use a phone number or full WhatsApp JID. A raw @username must first be resolved to an authoritative @lid JID." + }, + "settingsTemplateId": { + "type": "string", + "minLength": 1 + }, + "name": { + "type": "string" + }, + "selectableCount": { + "type": "integer", + "minimum": 0, + "maximum": 10 + }, + "values": { + "type": "array", + "minItems": 2, + "maxItems": 10, + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "delay": { + "type": "integer", + "description": "Enter a value in milliseconds" + }, + "quoted": { + "properties": { + "key": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "remoteJid": { + "type": "string" + }, + "remoteJidAlt": { + "type": "string" + }, + "participant": { + "type": "string" + }, + "participantAlt": { + "type": "string" + }, + "addressingMode": { + "type": "string", + "enum": [ + "lid", + "pn" + ] + }, + "fromMe": { + "type": "boolean", + "enum": [ + true, + false + ] + } + }, + "required": [ + "id" + ], + "if": { + "propertyNames": { + "enum": [ + "id" + ] + } + }, + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + } + } + } + }, + "message": { + "type": "object" + } + } + }, + "everyOne": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "mentioned": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\d+", + "description": "\"mentioned\" must be an array of numeric strings" + } + } + }, + "required": [ + "number", + "name", + "selectableCount", + "values" + ] + }, + "multipart": false, + "runtimeStatus": "CREATED", + "operation": { + "tags": [ + "Messages" + ], + "summary": "Create send Poll", + "description": "Create send Poll for Messages.", + "operationId": "post_message_sendPoll", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string", + "pattern": "^(?!@[^@\\s]+$).+", + "description": "Use a phone number or full WhatsApp JID. A raw @username must first be resolved to an authoritative @lid JID." + }, + "settingsTemplateId": { + "type": "string", + "minLength": 1 + }, + "name": { + "type": "string" + }, + "selectableCount": { + "type": "integer", + "minimum": 0, + "maximum": 10 + }, + "values": { + "type": "array", + "minItems": 2, + "maxItems": 10, + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "delay": { + "type": "integer", + "description": "Enter a value in milliseconds" + }, + "quoted": { + "properties": { + "key": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "remoteJid": { + "type": "string" + }, + "remoteJidAlt": { + "type": "string" + }, + "participant": { + "type": "string" + }, + "participantAlt": { + "type": "string" + }, + "addressingMode": { + "type": "string", + "enum": [ + "lid", + "pn" + ] + }, + "fromMe": { + "type": "boolean", + "enum": [ + true, + false + ] + } + }, + "required": [ + "id" + ], + "if": { + "propertyNames": { + "enum": [ + "id" + ] + } + }, + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + } + } + } + }, + "message": { + "type": "object" + } + } + }, + "everyOne": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "mentioned": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\d+", + "description": "\"mentioned\" must be an array of numeric strings" + } + } + }, + "required": [ + "number", + "name", + "selectableCount", + "values" + ] + } + } + } + }, + "x-validation-schema": "pollMessageSchema", + "x-source": "src/api/routes/sendMessage.router.ts" + } + }, + { + "method": "post", + "path": "/message/sendPtv/{instanceName}", + "source": "src/api/routes/sendMessage.router.ts", + "schemaName": "ptvMessageSchema", + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string", + "pattern": "^(?!@[^@\\s]+$).+", + "description": "Use a phone number or full WhatsApp JID. A raw @username must first be resolved to an authoritative @lid JID." + }, + "settingsTemplateId": { + "type": "string", + "minLength": 1 + }, + "video": { + "type": "string" + }, + "delay": { + "type": "integer", + "description": "Enter a value in milliseconds" + }, + "quoted": { + "properties": { + "key": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "remoteJid": { + "type": "string" + }, + "remoteJidAlt": { + "type": "string" + }, + "participant": { + "type": "string" + }, + "participantAlt": { + "type": "string" + }, + "addressingMode": { + "type": "string", + "enum": [ + "lid", + "pn" + ] + }, + "fromMe": { + "type": "boolean", + "enum": [ + true, + false + ] + } + }, + "required": [ + "id" + ], + "if": { + "propertyNames": { + "enum": [ + "id" + ] + } + }, + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + } + } + } + }, + "message": { + "type": "object" + } + } + }, + "everyOne": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "mentioned": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\d+", + "description": "\"mentioned\" must be an array of numeric strings" + } + } + }, + "required": [ + "number" + ] + }, + "multipart": true, + "runtimeStatus": "CREATED", + "operation": { + "tags": [ + "Messages" + ], + "summary": "Create send Ptv", + "description": "Create send Ptv for Messages.", + "operationId": "post_message_sendPtv", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string", + "pattern": "^(?!@[^@\\s]+$).+", + "description": "Use a phone number or full WhatsApp JID. A raw @username must first be resolved to an authoritative @lid JID." + }, + "settingsTemplateId": { + "type": "string", + "minLength": 1 + }, + "video": { + "type": "string" + }, + "delay": { + "type": "integer", + "description": "Enter a value in milliseconds" + }, + "quoted": { + "properties": { + "key": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "remoteJid": { + "type": "string" + }, + "remoteJidAlt": { + "type": "string" + }, + "participant": { + "type": "string" + }, + "participantAlt": { + "type": "string" + }, + "addressingMode": { + "type": "string", + "enum": [ + "lid", + "pn" + ] + }, + "fromMe": { + "type": "boolean", + "enum": [ + true, + false + ] + } + }, + "required": [ + "id" + ], + "if": { + "propertyNames": { + "enum": [ + "id" + ] + } + }, + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + } + } + } + }, + "message": { + "type": "object" + } + } + }, + "everyOne": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "mentioned": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\d+", + "description": "\"mentioned\" must be an array of numeric strings" + } + }, + "file": { + "type": "string", + "format": "binary" + } + }, + "required": [ + "number" + ] + } + } + } + }, + "x-validation-schema": "ptvMessageSchema", + "x-source": "src/api/routes/sendMessage.router.ts" + } + }, + { + "method": "post", + "path": "/message/sendReaction/{instanceName}", + "source": "src/api/routes/sendMessage.router.ts", + "schemaName": "reactionMessageSchema", + "schema": { + "type": "object", + "properties": { + "key": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "remoteJid": { + "type": "string" + }, + "remoteJidAlt": { + "type": "string" + }, + "participant": { + "type": "string" + }, + "participantAlt": { + "type": "string" + }, + "addressingMode": { + "type": "string", + "enum": [ + "lid", + "pn" + ] + }, + "fromMe": { + "type": "boolean", + "enum": [ + true, + false + ] + } + }, + "required": [ + "id", + "remoteJid", + "fromMe" + ], + "if": { + "propertyNames": { + "enum": [ + "id", + "remoteJid" + ] + } + }, + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + }, + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + } + } + } + }, + "reaction": { + "type": "string" + } + }, + "required": [ + "key", + "reaction" + ] + }, + "multipart": false, + "runtimeStatus": "CREATED", + "operation": { + "tags": [ + "Messages" + ], + "summary": "Create send Reaction", + "description": "Create send Reaction for Messages.", + "operationId": "post_message_sendReaction", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "remoteJid": { + "type": "string" + }, + "remoteJidAlt": { + "type": "string" + }, + "participant": { + "type": "string" + }, + "participantAlt": { + "type": "string" + }, + "addressingMode": { + "type": "string", + "enum": [ + "lid", + "pn" + ] + }, + "fromMe": { + "type": "boolean", + "enum": [ + true, + false + ] + } + }, + "required": [ + "id", + "remoteJid", + "fromMe" + ], + "if": { + "propertyNames": { + "enum": [ + "id", + "remoteJid" + ] + } + }, + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + }, + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + } + } + } + }, + "reaction": { + "type": "string" + } + }, + "required": [ + "key", + "reaction" + ] + } + } + } + }, + "x-validation-schema": "reactionMessageSchema", + "x-source": "src/api/routes/sendMessage.router.ts" + } + }, + { + "method": "post", + "path": "/message/sendStatus/{instanceName}", + "source": "src/api/routes/sendMessage.router.ts", + "schemaName": "statusMessageSchema", + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "text", + "image", + "audio", + "video" + ] + }, + "content": { + "type": "string" + }, + "caption": { + "type": "string" + }, + "backgroundColor": { + "type": "string" + }, + "font": { + "type": "integer", + "minimum": 0, + "maximum": 5 + }, + "statusJidList": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\d+", + "description": "\"statusJidList\" must be an array of numeric strings" + } + }, + "allContacts": { + "type": "boolean", + "enum": [ + true, + false + ] + } + }, + "required": [ + "type" + ] + }, + "multipart": true, + "runtimeStatus": "CREATED", + "operation": { + "tags": [ + "Messages" + ], + "summary": "Create send Status", + "description": "Create send Status for Messages.", + "operationId": "post_message_sendStatus", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "text", + "image", + "audio", + "video" + ] + }, + "content": { + "type": "string" + }, + "caption": { + "type": "string" + }, + "backgroundColor": { + "type": "string" + }, + "font": { + "type": "integer", + "minimum": 0, + "maximum": 5 + }, + "statusJidList": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\d+", + "description": "\"statusJidList\" must be an array of numeric strings" + } + }, + "allContacts": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "file": { + "type": "string", + "format": "binary" + } + }, + "required": [ + "type" + ] + } + } + } + }, + "x-validation-schema": "statusMessageSchema", + "x-source": "src/api/routes/sendMessage.router.ts" + } + }, + { + "method": "post", + "path": "/message/sendSticker/{instanceName}", + "source": "src/api/routes/sendMessage.router.ts", + "schemaName": "stickerMessageSchema", + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string", + "pattern": "^(?!@[^@\\s]+$).+", + "description": "Use a phone number or full WhatsApp JID. A raw @username must first be resolved to an authoritative @lid JID." + }, + "settingsTemplateId": { + "type": "string", + "minLength": 1 + }, + "sticker": { + "type": "string" + }, + "delay": { + "type": "integer", + "description": "Enter a value in milliseconds" + }, + "quoted": { + "properties": { + "key": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "remoteJid": { + "type": "string" + }, + "remoteJidAlt": { + "type": "string" + }, + "participant": { + "type": "string" + }, + "participantAlt": { + "type": "string" + }, + "addressingMode": { + "type": "string", + "enum": [ + "lid", + "pn" + ] + }, + "fromMe": { + "type": "boolean", + "enum": [ + true, + false + ] + } + }, + "required": [ + "id" + ], + "if": { + "propertyNames": { + "enum": [ + "id" + ] + } + }, + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + } + } + } + }, + "message": { + "type": "object" + } + } + }, + "everyOne": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "mentioned": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\d+", + "description": "\"mentioned\" must be an array of numeric strings" + } + } + }, + "required": [ + "number" + ] + }, + "multipart": true, + "runtimeStatus": "CREATED", + "operation": { + "tags": [ + "Messages" + ], + "summary": "Create send Sticker", + "description": "Create send Sticker for Messages.", + "operationId": "post_message_sendSticker", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string", + "pattern": "^(?!@[^@\\s]+$).+", + "description": "Use a phone number or full WhatsApp JID. A raw @username must first be resolved to an authoritative @lid JID." + }, + "settingsTemplateId": { + "type": "string", + "minLength": 1 + }, + "sticker": { + "type": "string" + }, + "delay": { + "type": "integer", + "description": "Enter a value in milliseconds" + }, + "quoted": { + "properties": { + "key": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "remoteJid": { + "type": "string" + }, + "remoteJidAlt": { + "type": "string" + }, + "participant": { + "type": "string" + }, + "participantAlt": { + "type": "string" + }, + "addressingMode": { + "type": "string", + "enum": [ + "lid", + "pn" + ] + }, + "fromMe": { + "type": "boolean", + "enum": [ + true, + false + ] + } + }, + "required": [ + "id" + ], + "if": { + "propertyNames": { + "enum": [ + "id" + ] + } + }, + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + } + } + } + }, + "message": { + "type": "object" + } + } + }, + "everyOne": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "mentioned": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\d+", + "description": "\"mentioned\" must be an array of numeric strings" + } + }, + "file": { + "type": "string", + "format": "binary" + } + }, + "required": [ + "number" + ] + } + } + } + }, + "x-validation-schema": "stickerMessageSchema", + "x-source": "src/api/routes/sendMessage.router.ts" + } + }, + { + "method": "post", + "path": "/message/sendTemplate/{instanceName}", + "source": "src/api/routes/sendMessage.router.ts", + "schemaName": "templateMessageSchema", + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string", + "pattern": "^(?!@[^@\\s]+$).+", + "description": "Use a phone number or full WhatsApp JID. A raw @username must first be resolved to an authoritative @lid JID." + }, + "settingsTemplateId": { + "type": "string", + "minLength": 1 + }, + "name": { + "type": "string" + }, + "language": { + "type": "string" + }, + "components": { + "type": "array" + }, + "webhookUrl": { + "type": "string" + } + }, + "required": [ + "name", + "language" + ] + }, + "multipart": false, + "runtimeStatus": "CREATED", + "operation": { + "tags": [ + "Messages" + ], + "summary": "Create send Template", + "description": "Create send Template for Messages.", + "operationId": "post_message_sendTemplate", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string", + "pattern": "^(?!@[^@\\s]+$).+", + "description": "Use a phone number or full WhatsApp JID. A raw @username must first be resolved to an authoritative @lid JID." + }, + "settingsTemplateId": { + "type": "string", + "minLength": 1 + }, + "name": { + "type": "string" + }, + "language": { + "type": "string" + }, + "components": { + "type": "array" + }, + "webhookUrl": { + "type": "string" + } + }, + "required": [ + "name", + "language" + ] + } + } + } + }, + "x-validation-schema": "templateMessageSchema", + "x-source": "src/api/routes/sendMessage.router.ts" + } + }, + { + "method": "post", + "path": "/message/sendText/{instanceName}", + "source": "src/api/routes/sendMessage.router.ts", + "schemaName": "textMessageSchema", + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string", + "pattern": "^(?!@[^@\\s]+$).+", + "description": "Use a phone number or full WhatsApp JID. A raw @username must first be resolved to an authoritative @lid JID." + }, + "settingsTemplateId": { + "type": "string", + "minLength": 1 + }, + "text": { + "type": "string" + }, + "linkPreview": { + "type": "boolean" + }, + "delay": { + "type": "integer", + "description": "Enter a value in milliseconds" + }, + "quoted": { + "properties": { + "key": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "remoteJid": { + "type": "string" + }, + "remoteJidAlt": { + "type": "string" + }, + "participant": { + "type": "string" + }, + "participantAlt": { + "type": "string" + }, + "addressingMode": { + "type": "string", + "enum": [ + "lid", + "pn" + ] + }, + "fromMe": { + "type": "boolean", + "enum": [ + true, + false + ] + } + }, + "required": [ + "id" + ], + "if": { + "propertyNames": { + "enum": [ + "id" + ] + } + }, + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + } + } + } + }, + "message": { + "type": "object" + } + } + }, + "everyOne": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "mentioned": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\d+", + "description": "\"mentioned\" must be an array of numeric strings" + } + } + }, + "required": [ + "number", + "text" + ] + }, + "multipart": false, + "runtimeStatus": "CREATED", + "operation": { + "tags": [ + "Messages" + ], + "summary": "Create send Text", + "description": "Create send Text for Messages.", + "operationId": "post_message_sendText", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string", + "pattern": "^(?!@[^@\\s]+$).+", + "description": "Use a phone number or full WhatsApp JID. A raw @username must first be resolved to an authoritative @lid JID." + }, + "settingsTemplateId": { + "type": "string", + "minLength": 1 + }, + "text": { + "type": "string" + }, + "linkPreview": { + "type": "boolean" + }, + "delay": { + "type": "integer", + "description": "Enter a value in milliseconds" + }, + "quoted": { + "properties": { + "key": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "remoteJid": { + "type": "string" + }, + "remoteJidAlt": { + "type": "string" + }, + "participant": { + "type": "string" + }, + "participantAlt": { + "type": "string" + }, + "addressingMode": { + "type": "string", + "enum": [ + "lid", + "pn" + ] + }, + "fromMe": { + "type": "boolean", + "enum": [ + true, + false + ] + } + }, + "required": [ + "id" + ], + "if": { + "propertyNames": { + "enum": [ + "id" + ] + } + }, + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + } + } + } + }, + "message": { + "type": "object" + } + } + }, + "everyOne": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "mentioned": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\d+", + "description": "\"mentioned\" must be an array of numeric strings" + } + } + }, + "required": [ + "number", + "text" + ] + } + } + } + }, + "x-validation-schema": "textMessageSchema", + "x-source": "src/api/routes/sendMessage.router.ts" + } + }, + { + "method": "post", + "path": "/message/sendWhatsAppAudio/{instanceName}", + "source": "src/api/routes/sendMessage.router.ts", + "schemaName": "audioMessageSchema", + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string", + "pattern": "^(?!@[^@\\s]+$).+", + "description": "Use a phone number or full WhatsApp JID. A raw @username must first be resolved to an authoritative @lid JID." + }, + "settingsTemplateId": { + "type": "string", + "minLength": 1 + }, + "audio": { + "type": "string" + }, + "delay": { + "type": "integer", + "description": "Enter a value in milliseconds" + }, + "quoted": { + "properties": { + "key": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "remoteJid": { + "type": "string" + }, + "remoteJidAlt": { + "type": "string" + }, + "participant": { + "type": "string" + }, + "participantAlt": { + "type": "string" + }, + "addressingMode": { + "type": "string", + "enum": [ + "lid", + "pn" + ] + }, + "fromMe": { + "type": "boolean", + "enum": [ + true, + false + ] + } + }, + "required": [ + "id" + ], + "if": { + "propertyNames": { + "enum": [ + "id" + ] + } + }, + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + } + } + } + }, + "message": { + "type": "object" + } + } + }, + "everyOne": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "mentioned": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\d+", + "description": "\"mentioned\" must be an array of numeric strings" + } + } + }, + "required": [ + "number" + ] + }, + "multipart": true, + "runtimeStatus": "CREATED", + "operation": { + "tags": [ + "Messages" + ], + "summary": "Create send Whats App Audio", + "description": "Create send Whats App Audio for Messages.", + "operationId": "post_message_sendWhatsAppAudio", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "number": { + "type": "string", + "pattern": "^(?!@[^@\\s]+$).+", + "description": "Use a phone number or full WhatsApp JID. A raw @username must first be resolved to an authoritative @lid JID." + }, + "settingsTemplateId": { + "type": "string", + "minLength": 1 + }, + "audio": { + "type": "string" + }, + "delay": { + "type": "integer", + "description": "Enter a value in milliseconds" + }, + "quoted": { + "properties": { + "key": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "remoteJid": { + "type": "string" + }, + "remoteJidAlt": { + "type": "string" + }, + "participant": { + "type": "string" + }, + "participantAlt": { + "type": "string" + }, + "addressingMode": { + "type": "string", + "enum": [ + "lid", + "pn" + ] + }, + "fromMe": { + "type": "boolean", + "enum": [ + true, + false + ] + } + }, + "required": [ + "id" + ], + "if": { + "propertyNames": { + "enum": [ + "id" + ] + } + }, + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + } + } + } + }, + "message": { + "type": "object" + } + } + }, + "everyOne": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "mentioned": { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^\\d+", + "description": "\"mentioned\" must be an array of numeric strings" + } + }, + "file": { + "type": "string", + "format": "binary" + } + }, + "required": [ + "number" + ] + } + } + } + }, + "x-validation-schema": "audioMessageSchema", + "x-source": "src/api/routes/sendMessage.router.ts" + } + }, + { + "method": "post", + "path": "/n8n/changeStatus/{instanceName}", + "source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts", + "schemaName": "n8nStatusSchema", + "schema": { + "type": "object", + "properties": { + "remoteJid": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "opened", + "closed", + "paused", + "delete" + ] + } + }, + "required": [ + "remoteJid", + "status" + ], + "if": { + "propertyNames": { + "enum": [ + "remoteJid", + "status" + ] + } + }, + "then": { + "properties": { + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + }, + "status": { + "minLength": 1, + "description": "The \"status\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", + "operation": { + "tags": [ + "n8n" + ], + "summary": "Update change Status", + "description": "Update change Status for n8n.", + "operationId": "post_n8n_changeStatus", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "remoteJid": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "opened", + "closed", + "paused", + "delete" + ] + } + }, + "required": [ + "remoteJid", + "status" + ], + "if": { + "propertyNames": { + "enum": [ + "remoteJid", + "status" + ] + } + }, + "then": { + "properties": { + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + }, + "status": { + "minLength": 1, + "description": "The \"status\" cannot be empty" + } + } + } + } + } + } + }, + "x-validation-schema": "n8nStatusSchema", + "x-source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts" + } + }, + { + "method": "post", + "path": "/n8n/create/{instanceName}", + "source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts", + "schemaName": "n8nSchema", + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "basicAuthUser": { + "type": "string" + }, + "basicAuthPassword": { + "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", + "webhookUrl", + "triggerType" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "webhookUrl", + "triggerType" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "webhookUrl": { + "minLength": 1, + "description": "The \"webhookUrl\" cannot be empty" + }, + "triggerType": { + "minLength": 1, + "description": "The \"triggerType\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "CREATED", + "operation": { + "tags": [ + "n8n" + ], + "summary": "Create create", + "description": "Create create for n8n.", + "operationId": "post_n8n_create", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "basicAuthUser": { + "type": "string" + }, + "basicAuthPassword": { + "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", + "webhookUrl", + "triggerType" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "webhookUrl", + "triggerType" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "webhookUrl": { + "minLength": 1, + "description": "The \"webhookUrl\" cannot be empty" + }, + "triggerType": { + "minLength": 1, + "description": "The \"triggerType\" cannot be empty" + } + } + } + } + } + } + }, + "x-validation-schema": "n8nSchema", + "x-source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts" + } + }, + { + "method": "delete", + "path": "/n8n/delete/{n8nId}/{instanceName}", + "source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", + "operation": { + "tags": [ + "n8n" + ], + "summary": "Delete delete", + "description": "Delete delete for n8n.", + "operationId": "delete_n8n_delete", + "parameters": [ + { + "name": "n8nId", + "in": "path", + "required": true, + "description": "N8n Id path parameter.", + "schema": { + "type": "string" + } + }, + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + } + } + } + }, + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts" + } + }, + { + "method": "get", + "path": "/n8n/fetch/{n8nId}/{instanceName}", + "source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", + "operation": { + "tags": [ + "n8n" + ], + "summary": "Get fetch", + "description": "Get fetch for n8n.", + "operationId": "get_n8n_fetch", + "parameters": [ + { + "name": "n8nId", + "in": "path", + "required": true, + "description": "N8n Id path parameter.", + "schema": { + "type": "string" + } + }, + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts" + } + }, + { + "method": "get", + "path": "/n8n/fetchSessions/{n8nId}/{instanceName}", + "source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", + "operation": { + "tags": [ + "n8n" + ], + "summary": "Get fetch Sessions", + "description": "Get fetch Sessions for n8n.", + "operationId": "get_n8n_fetchSessions", + "parameters": [ + { + "name": "n8nId", + "in": "path", + "required": true, + "description": "N8n Id path parameter.", + "schema": { + "type": "string" + } + }, + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts" + } + }, + { + "method": "get", + "path": "/n8n/fetchSettings/{instanceName}", + "source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", + "operation": { + "tags": [ + "n8n" + ], + "summary": "Get fetch Settings", + "description": "Get fetch Settings for n8n.", + "operationId": "get_n8n_fetchSettings", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts" + } + }, + { + "method": "get", + "path": "/n8n/find/{instanceName}", + "source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", + "operation": { + "tags": [ + "n8n" + ], + "summary": "Get find", + "description": "Get find for n8n.", + "operationId": "get_n8n_find", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts" + } + }, + { + "method": "post", + "path": "/n8n/ignoreJid/{instanceName}", + "source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts", + "schemaName": "n8nIgnoreJidSchema", + "schema": { + "type": "object", + "properties": { + "remoteJid": { + "type": "string" + }, + "action": { + "type": "string", + "enum": [ + "add", + "remove" + ] + } + }, + "required": [ + "remoteJid", + "action" + ], + "if": { + "propertyNames": { + "enum": [ + "remoteJid", + "action" + ] + } + }, + "then": { + "properties": { + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + }, + "action": { + "minLength": 1, + "description": "The \"action\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", + "operation": { + "tags": [ + "n8n" + ], + "summary": "Update ignore Jid", + "description": "Update ignore Jid for n8n.", + "operationId": "post_n8n_ignoreJid", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "remoteJid": { + "type": "string" + }, + "action": { + "type": "string", + "enum": [ + "add", + "remove" + ] + } + }, + "required": [ + "remoteJid", + "action" + ], + "if": { + "propertyNames": { + "enum": [ + "remoteJid", + "action" + ] + } + }, + "then": { + "properties": { + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + }, + "action": { + "minLength": 1, + "description": "The \"action\" cannot be empty" + } + } + } + } + } + } + }, + "x-validation-schema": "n8nIgnoreJidSchema", + "x-source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts" + } + }, + { + "method": "post", + "path": "/n8n/settings/{instanceName}", + "source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts", + "schemaName": "n8nSettingSchema", + "schema": { + "type": "object", + "properties": { + "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" + } + }, + "botIdFallback": { + "type": "string" + }, + "splitMessages": { + "type": "boolean" + }, + "timePerChar": { + "type": "integer" + } + }, + "required": [ + "expire", + "keywordFinish", + "delayMessage", + "unknownMessage", + "listeningFromMe", + "stopBotFromMe", + "keepOpen", + "debounceTime", + "ignoreJids", + "splitMessages", + "timePerChar" + ], + "if": { + "propertyNames": { + "enum": [ + "expire", + "keywordFinish", + "delayMessage", + "unknownMessage", + "listeningFromMe", + "stopBotFromMe", + "keepOpen", + "debounceTime", + "ignoreJids", + "splitMessages", + "timePerChar" + ] + } + }, + "then": { + "properties": { + "expire": { + "minLength": 1, + "description": "The \"expire\" cannot be empty" + }, + "keywordFinish": { + "minLength": 1, + "description": "The \"keywordFinish\" cannot be empty" + }, + "delayMessage": { + "minLength": 1, + "description": "The \"delayMessage\" cannot be empty" + }, + "unknownMessage": { + "minLength": 1, + "description": "The \"unknownMessage\" cannot be empty" + }, + "listeningFromMe": { + "minLength": 1, + "description": "The \"listeningFromMe\" cannot be empty" + }, + "stopBotFromMe": { + "minLength": 1, + "description": "The \"stopBotFromMe\" cannot be empty" + }, + "keepOpen": { + "minLength": 1, + "description": "The \"keepOpen\" cannot be empty" + }, + "debounceTime": { + "minLength": 1, + "description": "The \"debounceTime\" cannot be empty" + }, + "ignoreJids": { + "minLength": 1, + "description": "The \"ignoreJids\" cannot be empty" + }, + "splitMessages": { + "minLength": 1, + "description": "The \"splitMessages\" cannot be empty" + }, + "timePerChar": { + "minLength": 1, + "description": "The \"timePerChar\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", + "operation": { + "tags": [ + "n8n" + ], + "summary": "Update settings", + "description": "Update settings for n8n.", + "operationId": "post_n8n_settings", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "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" + } + }, + "botIdFallback": { + "type": "string" + }, + "splitMessages": { + "type": "boolean" + }, + "timePerChar": { + "type": "integer" + } + }, + "required": [ + "expire", + "keywordFinish", + "delayMessage", + "unknownMessage", + "listeningFromMe", + "stopBotFromMe", + "keepOpen", + "debounceTime", + "ignoreJids", + "splitMessages", + "timePerChar" + ], + "if": { + "propertyNames": { + "enum": [ + "expire", + "keywordFinish", + "delayMessage", + "unknownMessage", + "listeningFromMe", + "stopBotFromMe", + "keepOpen", + "debounceTime", + "ignoreJids", + "splitMessages", + "timePerChar" + ] + } + }, + "then": { + "properties": { + "expire": { + "minLength": 1, + "description": "The \"expire\" cannot be empty" + }, + "keywordFinish": { + "minLength": 1, + "description": "The \"keywordFinish\" cannot be empty" + }, + "delayMessage": { + "minLength": 1, + "description": "The \"delayMessage\" cannot be empty" + }, + "unknownMessage": { + "minLength": 1, + "description": "The \"unknownMessage\" cannot be empty" + }, + "listeningFromMe": { + "minLength": 1, + "description": "The \"listeningFromMe\" cannot be empty" + }, + "stopBotFromMe": { + "minLength": 1, + "description": "The \"stopBotFromMe\" cannot be empty" + }, + "keepOpen": { + "minLength": 1, + "description": "The \"keepOpen\" cannot be empty" + }, + "debounceTime": { + "minLength": 1, + "description": "The \"debounceTime\" cannot be empty" + }, + "ignoreJids": { + "minLength": 1, + "description": "The \"ignoreJids\" cannot be empty" + }, + "splitMessages": { + "minLength": 1, + "description": "The \"splitMessages\" cannot be empty" + }, + "timePerChar": { + "minLength": 1, + "description": "The \"timePerChar\" cannot be empty" + } + } + } + } + } + } + }, + "x-validation-schema": "n8nSettingSchema", + "x-source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts" + } + }, + { + "method": "put", + "path": "/n8n/update/{n8nId}/{instanceName}", + "source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts", + "schemaName": "n8nSchema", + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "basicAuthUser": { + "type": "string" + }, + "basicAuthPassword": { + "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", + "webhookUrl", + "triggerType" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "webhookUrl", + "triggerType" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "webhookUrl": { + "minLength": 1, + "description": "The \"webhookUrl\" cannot be empty" + }, + "triggerType": { + "minLength": 1, + "description": "The \"triggerType\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", + "operation": { + "tags": [ + "n8n" + ], + "summary": "Update update", + "description": "Update update for n8n.", + "operationId": "put_n8n_update", + "parameters": [ + { + "name": "n8nId", + "in": "path", + "required": true, + "description": "N8n Id path parameter.", + "schema": { + "type": "string" + } + }, + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "basicAuthUser": { + "type": "string" + }, + "basicAuthPassword": { + "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", + "webhookUrl", + "triggerType" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "webhookUrl", + "triggerType" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "webhookUrl": { + "minLength": 1, + "description": "The \"webhookUrl\" cannot be empty" + }, + "triggerType": { + "minLength": 1, + "description": "The \"triggerType\" cannot be empty" + } + } + } + } + } + } + }, + "x-validation-schema": "n8nSchema", + "x-source": "src/api/integrations/chatbot/n8n/routes/n8n.router.ts" + } + }, + { + "method": "get", + "path": "/nats/find/{instanceName}", + "source": "src/api/integrations/event/nats/nats.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "operation": { + "tags": [ + "NATS" + ], + "summary": "Get find", + "description": "Get find for NATS.", + "operationId": "get_nats_find", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/event/nats/nats.router.ts" + } + }, + { + "method": "post", + "path": "/nats/set/{instanceName}", + "source": "src/api/integrations/event/nats/nats.router.ts", + "schemaName": "eventSchema", + "schema": { + "type": "object", + "properties": { + "websocket": { + "$ref": "#/$defs/event" + }, + "rabbitmq": { + "$ref": "#/$defs/event" + }, + "nats": { + "$ref": "#/$defs/event" + }, + "sqs": { + "$ref": "#/$defs/event" + }, + "kafka": { + "$ref": "#/$defs/event" + } + }, + "$defs": { + "event": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "events": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "CONTACTS_SET", + "CONTACTS_UPSERT", + "CONTACTS_UPDATE", + "PRESENCE_UPDATE", + "CHATS_SET", + "CHATS_UPSERT", + "CHATS_UPDATE", + "CHATS_DELETE", + "GROUPS_UPSERT", + "GROUPS_UPDATE", + "GROUP_PARTICIPANTS_UPDATE", + "CONNECTION_UPDATE", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS", + "REMOVE_INSTANCE", + "LOGOUT_INSTANCE", + "INSTANCE_CREATE", + "INSTANCE_DELETE", + "STATUS_INSTANCE", + "CREDS_UPDATE", + "MESSAGING_HISTORY_SET", + "MESSAGING_HISTORY_STATUS", + "LID_MAPPING_UPDATE", + "MESSAGES_MEDIA_UPDATE", + "MESSAGES_REACTION", + "MESSAGE_RECEIPT_UPDATE", + "GROUP_JOIN_REQUEST", + "GROUP_MEMBER_TAG_UPDATE", + "BLOCKLIST_SET", + "BLOCKLIST_UPDATE", + "NEWSLETTER_REACTION", + "NEWSLETTER_VIEW", + "NEWSLETTER_PARTICIPANTS_UPDATE", + "NEWSLETTER_SETTINGS_UPDATE", + "MESSAGE_CAPPING_UPDATE", + "CHATS_LOCK", + "SETTINGS_UPDATE" + ] + } + } + }, + "required": [ + "enabled" + ] + } + } + }, + "multipart": false, + "runtimeStatus": "CREATED", + "operation": { + "tags": [ + "NATS" + ], + "summary": "Update set", + "description": "Update set for NATS.", + "operationId": "post_nats_set", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "websocket": { + "$ref": "#/$defs/event" + }, + "rabbitmq": { + "$ref": "#/$defs/event" + }, + "nats": { + "$ref": "#/$defs/event" + }, + "sqs": { + "$ref": "#/$defs/event" + }, + "kafka": { + "$ref": "#/$defs/event" + } + }, + "$defs": { + "event": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "events": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "CONTACTS_SET", + "CONTACTS_UPSERT", + "CONTACTS_UPDATE", + "PRESENCE_UPDATE", + "CHATS_SET", + "CHATS_UPSERT", + "CHATS_UPDATE", + "CHATS_DELETE", + "GROUPS_UPSERT", + "GROUPS_UPDATE", + "GROUP_PARTICIPANTS_UPDATE", + "CONNECTION_UPDATE", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS", + "REMOVE_INSTANCE", + "LOGOUT_INSTANCE", + "INSTANCE_CREATE", + "INSTANCE_DELETE", + "STATUS_INSTANCE", + "CREDS_UPDATE", + "MESSAGING_HISTORY_SET", + "MESSAGING_HISTORY_STATUS", + "LID_MAPPING_UPDATE", + "MESSAGES_MEDIA_UPDATE", + "MESSAGES_REACTION", + "MESSAGE_RECEIPT_UPDATE", + "GROUP_JOIN_REQUEST", + "GROUP_MEMBER_TAG_UPDATE", + "BLOCKLIST_SET", + "BLOCKLIST_UPDATE", + "NEWSLETTER_REACTION", + "NEWSLETTER_VIEW", + "NEWSLETTER_PARTICIPANTS_UPDATE", + "NEWSLETTER_SETTINGS_UPDATE", + "MESSAGE_CAPPING_UPDATE", + "CHATS_LOCK", + "SETTINGS_UPDATE" + ] + } + } + }, + "required": [ + "enabled" + ] + } + } + } + } + } + }, + "x-validation-schema": "eventSchema", + "x-source": "src/api/integrations/event/nats/nats.router.ts" + } + }, + { + "method": "post", + "path": "/openai/changeStatus/{instanceName}", + "source": "src/api/integrations/chatbot/openai/routes/openai.router.ts", + "schemaName": "openaiStatusSchema", + "schema": { + "type": "object", + "properties": { + "remoteJid": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "opened", + "closed", + "paused", + "delete" + ] + } + }, + "required": [ + "remoteJid", + "status" + ], + "if": { + "propertyNames": { + "enum": [ + "remoteJid", + "status" + ] + } + }, + "then": { + "properties": { + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + }, + "status": { + "minLength": 1, + "description": "The \"status\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", + "operation": { + "tags": [ + "OpenAI" + ], + "summary": "Update change Status", + "description": "Update change Status for OpenAI.", + "operationId": "post_openai_changeStatus", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "remoteJid": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "opened", + "closed", + "paused", + "delete" + ] + } + }, + "required": [ + "remoteJid", + "status" + ], + "if": { + "propertyNames": { + "enum": [ + "remoteJid", + "status" + ] + } + }, + "then": { + "properties": { + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + }, + "status": { + "minLength": 1, + "description": "The \"status\" cannot be empty" + } + } + } + } + } + } + }, + "x-validation-schema": "openaiStatusSchema", + "x-source": "src/api/integrations/chatbot/openai/routes/openai.router.ts" + } + }, + { + "method": "post", + "path": "/openai/create/{instanceName}", + "source": "src/api/integrations/chatbot/openai/routes/openai.router.ts", + "schemaName": "openaiSchema", + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "openaiCredsId": { + "type": "string" + }, + "botType": { + "type": "string", + "enum": [ + "assistant", + "chatCompletion" + ] + }, + "assistantId": { + "type": "string" + }, + "functionUrl": { + "type": "string" + }, + "model": { + "type": "string" + }, + "systemMessages": { + "type": "array", + "items": { + "type": "string" + } + }, + "assistantMessages": { + "type": "array", + "items": { + "type": "string" + } + }, + "userMessages": { + "type": "array", + "items": { + "type": "string" + } + }, + "maxTokens": { + "type": "integer" + }, + "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" + } + } + }, + "required": [ + "enabled", + "openaiCredsId", + "botType", + "triggerType" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "openaiCredsId", + "botType", + "triggerType" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "openaiCredsId": { + "minLength": 1, + "description": "The \"openaiCredsId\" cannot be empty" + }, + "botType": { + "minLength": 1, + "description": "The \"botType\" cannot be empty" + }, + "triggerType": { + "minLength": 1, + "description": "The \"triggerType\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "CREATED", + "operation": { + "tags": [ + "OpenAI" + ], + "summary": "Create create", + "description": "Create create for OpenAI.", + "operationId": "post_openai_create", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "openaiCredsId": { + "type": "string" + }, + "botType": { + "type": "string", + "enum": [ + "assistant", + "chatCompletion" + ] + }, + "assistantId": { + "type": "string" + }, + "functionUrl": { + "type": "string" + }, + "model": { + "type": "string" + }, + "systemMessages": { + "type": "array", + "items": { + "type": "string" + } + }, + "assistantMessages": { + "type": "array", + "items": { + "type": "string" + } + }, + "userMessages": { + "type": "array", + "items": { + "type": "string" + } + }, + "maxTokens": { + "type": "integer" + }, + "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" + } + } + }, + "required": [ + "enabled", + "openaiCredsId", + "botType", + "triggerType" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "openaiCredsId", + "botType", + "triggerType" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "openaiCredsId": { + "minLength": 1, + "description": "The \"openaiCredsId\" cannot be empty" + }, + "botType": { + "minLength": 1, + "description": "The \"botType\" cannot be empty" + }, + "triggerType": { + "minLength": 1, + "description": "The \"triggerType\" cannot be empty" + } + } + } + } + } + } + }, + "x-validation-schema": "openaiSchema", + "x-source": "src/api/integrations/chatbot/openai/routes/openai.router.ts" + } + }, + { + "method": "get", + "path": "/openai/creds/{instanceName}", + "source": "src/api/integrations/chatbot/openai/routes/openai.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", + "operation": { + "tags": [ + "OpenAI" + ], + "summary": "Get creds", + "description": "Get creds for OpenAI.", + "operationId": "get_openai_creds", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/openai/routes/openai.router.ts" + } + }, + { + "method": "post", + "path": "/openai/creds/{instanceName}", + "source": "src/api/integrations/chatbot/openai/routes/openai.router.ts", + "schemaName": "openaiCredsSchema", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "apiKey": { + "type": "string" + } + }, + "required": [ + "name", + "apiKey" + ], + "if": { + "propertyNames": { + "enum": [ + "name", + "apiKey" + ] + } + }, + "then": { + "properties": { + "name": { + "minLength": 1, + "description": "The \"name\" cannot be empty" + }, + "apiKey": { + "minLength": 1, + "description": "The \"apiKey\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "CREATED", + "operation": { + "tags": [ + "OpenAI" + ], + "summary": "Run creds", + "description": "Run creds for OpenAI.", + "operationId": "post_openai_creds", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "apiKey": { + "type": "string" + } + }, + "required": [ + "name", + "apiKey" + ], + "if": { + "propertyNames": { + "enum": [ + "name", + "apiKey" + ] + } + }, + "then": { + "properties": { + "name": { + "minLength": 1, + "description": "The \"name\" cannot be empty" + }, + "apiKey": { + "minLength": 1, + "description": "The \"apiKey\" cannot be empty" + } + } + } + } + } + } + }, + "x-validation-schema": "openaiCredsSchema", + "x-source": "src/api/integrations/chatbot/openai/routes/openai.router.ts" + } + }, + { + "method": "delete", + "path": "/openai/creds/{openaiCredsId}/{instanceName}", + "source": "src/api/integrations/chatbot/openai/routes/openai.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", + "operation": { + "tags": [ + "OpenAI" + ], + "summary": "Delete creds", + "description": "Delete creds for OpenAI.", + "operationId": "delete_openai_creds", + "parameters": [ + { + "name": "openaiCredsId", + "in": "path", + "required": true, + "description": "Openai Creds Id path parameter.", + "schema": { + "type": "string" + } + }, + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + } + } + } + }, + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/openai/routes/openai.router.ts" + } + }, + { + "method": "delete", + "path": "/openai/delete/{openaiBotId}/{instanceName}", + "source": "src/api/integrations/chatbot/openai/routes/openai.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", + "operation": { + "tags": [ + "OpenAI" + ], + "summary": "Delete delete", + "description": "Delete delete for OpenAI.", + "operationId": "delete_openai_delete", + "parameters": [ + { + "name": "openaiBotId", + "in": "path", + "required": true, + "description": "Openai Bot Id path parameter.", + "schema": { + "type": "string" + } + }, + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + } + } + } + }, + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/openai/routes/openai.router.ts" + } + }, + { + "method": "get", + "path": "/openai/fetch/{openaiBotId}/{instanceName}", + "source": "src/api/integrations/chatbot/openai/routes/openai.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", + "operation": { + "tags": [ + "OpenAI" + ], + "summary": "Get fetch", + "description": "Get fetch for OpenAI.", + "operationId": "get_openai_fetch", + "parameters": [ + { + "name": "openaiBotId", + "in": "path", + "required": true, + "description": "Openai Bot Id path parameter.", + "schema": { + "type": "string" + } + }, + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/openai/routes/openai.router.ts" + } + }, + { + "method": "get", + "path": "/openai/fetchSessions/{openaiBotId}/{instanceName}", + "source": "src/api/integrations/chatbot/openai/routes/openai.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", + "operation": { + "tags": [ + "OpenAI" + ], + "summary": "Get fetch Sessions", + "description": "Get fetch Sessions for OpenAI.", + "operationId": "get_openai_fetchSessions", + "parameters": [ + { + "name": "openaiBotId", + "in": "path", + "required": true, + "description": "Openai Bot Id path parameter.", + "schema": { + "type": "string" + } + }, + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/openai/routes/openai.router.ts" + } + }, + { + "method": "get", + "path": "/openai/fetchSettings/{instanceName}", + "source": "src/api/integrations/chatbot/openai/routes/openai.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", + "operation": { + "tags": [ + "OpenAI" + ], + "summary": "Get fetch Settings", + "description": "Get fetch Settings for OpenAI.", + "operationId": "get_openai_fetchSettings", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/openai/routes/openai.router.ts" + } + }, + { + "method": "get", + "path": "/openai/find/{instanceName}", + "source": "src/api/integrations/chatbot/openai/routes/openai.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", + "operation": { + "tags": [ + "OpenAI" + ], + "summary": "Get find", + "description": "Get find for OpenAI.", + "operationId": "get_openai_find", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/openai/routes/openai.router.ts" + } + }, + { + "method": "get", + "path": "/openai/getModels/{instanceName}", + "source": "src/api/integrations/chatbot/openai/routes/openai.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", + "operation": { + "tags": [ + "OpenAI" + ], + "summary": "Get get Models", + "description": "Get get Models for OpenAI.", + "operationId": "get_openai_getModels", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/openai/routes/openai.router.ts" + } + }, + { + "method": "post", + "path": "/openai/ignoreJid/{instanceName}", + "source": "src/api/integrations/chatbot/openai/routes/openai.router.ts", + "schemaName": "openaiIgnoreJidSchema", + "schema": { + "type": "object", + "properties": { + "remoteJid": { + "type": "string" + }, + "action": { + "type": "string", + "enum": [ + "add", + "remove" + ] + } + }, + "required": [ + "remoteJid", + "action" + ], + "if": { + "propertyNames": { + "enum": [ + "remoteJid", + "action" + ] + } + }, + "then": { + "properties": { + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + }, + "action": { + "minLength": 1, + "description": "The \"action\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", + "operation": { + "tags": [ + "OpenAI" + ], + "summary": "Update ignore Jid", + "description": "Update ignore Jid for OpenAI.", + "operationId": "post_openai_ignoreJid", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "remoteJid": { + "type": "string" + }, + "action": { + "type": "string", + "enum": [ + "add", + "remove" + ] + } + }, + "required": [ + "remoteJid", + "action" + ], + "if": { + "propertyNames": { + "enum": [ + "remoteJid", + "action" + ] + } + }, + "then": { + "properties": { + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + }, + "action": { + "minLength": 1, + "description": "The \"action\" cannot be empty" + } + } + } + } + } + } + }, + "x-validation-schema": "openaiIgnoreJidSchema", + "x-source": "src/api/integrations/chatbot/openai/routes/openai.router.ts" + } + }, + { + "method": "post", + "path": "/openai/settings/{instanceName}", + "source": "src/api/integrations/chatbot/openai/routes/openai.router.ts", + "schemaName": "openaiSettingSchema", + "schema": { + "type": "object", + "properties": { + "openaiCredsId": { + "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" + }, + "speechToText": { + "type": "boolean" + }, + "ignoreJids": { + "type": "array", + "items": { + "type": "string" + } + }, + "openaiIdFallback": { + "type": "string" + } + }, + "required": [ + "openaiCredsId", + "expire", + "keywordFinish", + "delayMessage", + "unknownMessage", + "listeningFromMe", + "stopBotFromMe", + "keepOpen", + "debounceTime", + "ignoreJids" + ], + "if": { + "propertyNames": { + "enum": [ + "openaiCredsId", + "expire", + "keywordFinish", + "delayMessage", + "unknownMessage", + "listeningFromMe", + "stopBotFromMe", + "keepOpen", + "debounceTime", + "ignoreJids" + ] + } + }, + "then": { + "properties": { + "openaiCredsId": { + "minLength": 1, + "description": "The \"openaiCredsId\" cannot be empty" + }, + "expire": { + "minLength": 1, + "description": "The \"expire\" cannot be empty" + }, + "keywordFinish": { + "minLength": 1, + "description": "The \"keywordFinish\" cannot be empty" + }, + "delayMessage": { + "minLength": 1, + "description": "The \"delayMessage\" cannot be empty" + }, + "unknownMessage": { + "minLength": 1, + "description": "The \"unknownMessage\" cannot be empty" + }, + "listeningFromMe": { + "minLength": 1, + "description": "The \"listeningFromMe\" cannot be empty" + }, + "stopBotFromMe": { + "minLength": 1, + "description": "The \"stopBotFromMe\" cannot be empty" + }, + "keepOpen": { + "minLength": 1, + "description": "The \"keepOpen\" cannot be empty" + }, + "debounceTime": { + "minLength": 1, + "description": "The \"debounceTime\" cannot be empty" + }, + "ignoreJids": { + "minLength": 1, + "description": "The \"ignoreJids\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", + "operation": { + "tags": [ + "OpenAI" + ], + "summary": "Update settings", + "description": "Update settings for OpenAI.", + "operationId": "post_openai_settings", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "openaiCredsId": { + "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" + }, + "speechToText": { + "type": "boolean" + }, + "ignoreJids": { + "type": "array", + "items": { + "type": "string" + } + }, + "openaiIdFallback": { + "type": "string" + } + }, + "required": [ + "openaiCredsId", + "expire", + "keywordFinish", + "delayMessage", + "unknownMessage", + "listeningFromMe", + "stopBotFromMe", + "keepOpen", + "debounceTime", + "ignoreJids" + ], + "if": { + "propertyNames": { + "enum": [ + "openaiCredsId", + "expire", + "keywordFinish", + "delayMessage", + "unknownMessage", + "listeningFromMe", + "stopBotFromMe", + "keepOpen", + "debounceTime", + "ignoreJids" + ] + } + }, + "then": { + "properties": { + "openaiCredsId": { + "minLength": 1, + "description": "The \"openaiCredsId\" cannot be empty" + }, + "expire": { + "minLength": 1, + "description": "The \"expire\" cannot be empty" + }, + "keywordFinish": { + "minLength": 1, + "description": "The \"keywordFinish\" cannot be empty" + }, + "delayMessage": { + "minLength": 1, + "description": "The \"delayMessage\" cannot be empty" + }, + "unknownMessage": { + "minLength": 1, + "description": "The \"unknownMessage\" cannot be empty" + }, + "listeningFromMe": { + "minLength": 1, + "description": "The \"listeningFromMe\" cannot be empty" + }, + "stopBotFromMe": { + "minLength": 1, + "description": "The \"stopBotFromMe\" cannot be empty" + }, + "keepOpen": { + "minLength": 1, + "description": "The \"keepOpen\" cannot be empty" + }, + "debounceTime": { + "minLength": 1, + "description": "The \"debounceTime\" cannot be empty" + }, + "ignoreJids": { + "minLength": 1, + "description": "The \"ignoreJids\" cannot be empty" + } + } + } + } + } + } + }, + "x-validation-schema": "openaiSettingSchema", + "x-source": "src/api/integrations/chatbot/openai/routes/openai.router.ts" + } + }, + { + "method": "put", + "path": "/openai/update/{openaiBotId}/{instanceName}", + "source": "src/api/integrations/chatbot/openai/routes/openai.router.ts", + "schemaName": "openaiSchema", + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "openaiCredsId": { + "type": "string" + }, + "botType": { + "type": "string", + "enum": [ + "assistant", + "chatCompletion" + ] + }, + "assistantId": { + "type": "string" + }, + "functionUrl": { + "type": "string" + }, + "model": { + "type": "string" + }, + "systemMessages": { + "type": "array", + "items": { + "type": "string" + } + }, + "assistantMessages": { + "type": "array", + "items": { + "type": "string" + } + }, + "userMessages": { + "type": "array", + "items": { + "type": "string" + } + }, + "maxTokens": { + "type": "integer" + }, + "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" + } + } + }, + "required": [ + "enabled", + "openaiCredsId", + "botType", + "triggerType" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "openaiCredsId", + "botType", + "triggerType" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "openaiCredsId": { + "minLength": 1, + "description": "The \"openaiCredsId\" cannot be empty" + }, + "botType": { + "minLength": 1, + "description": "The \"botType\" cannot be empty" + }, + "triggerType": { + "minLength": 1, + "description": "The \"triggerType\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", + "operation": { + "tags": [ + "OpenAI" + ], + "summary": "Update update", + "description": "Update update for OpenAI.", + "operationId": "put_openai_update", + "parameters": [ + { + "name": "openaiBotId", + "in": "path", + "required": true, + "description": "Openai Bot Id path parameter.", + "schema": { + "type": "string" + } + }, + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "openaiCredsId": { + "type": "string" + }, + "botType": { + "type": "string", + "enum": [ + "assistant", + "chatCompletion" + ] + }, + "assistantId": { + "type": "string" + }, + "functionUrl": { + "type": "string" + }, + "model": { + "type": "string" + }, + "systemMessages": { + "type": "array", + "items": { + "type": "string" + } + }, + "assistantMessages": { + "type": "array", + "items": { + "type": "string" + } + }, + "userMessages": { + "type": "array", + "items": { + "type": "string" + } + }, + "maxTokens": { + "type": "integer" + }, + "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" + } + } + }, + "required": [ + "enabled", + "openaiCredsId", + "botType", + "triggerType" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "openaiCredsId", + "botType", + "triggerType" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "openaiCredsId": { + "minLength": 1, + "description": "The \"openaiCredsId\" cannot be empty" + }, + "botType": { + "minLength": 1, + "description": "The \"botType\" cannot be empty" + }, + "triggerType": { + "minLength": 1, + "description": "The \"triggerType\" cannot be empty" + } + } + } + } + } + } + }, + "x-validation-schema": "openaiSchema", + "x-source": "src/api/integrations/chatbot/openai/routes/openai.router.ts" + } + }, + { + "method": "get", + "path": "/proxy/find/{instanceName}", + "source": "src/api/routes/proxy.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", + "operation": { + "tags": [ + "Proxy" + ], + "summary": "Get find", + "description": "Get find for Proxy.", + "operationId": "get_proxy_find", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "x-validation-schema": "instanceSchema", + "x-source": "src/api/routes/proxy.router.ts" + } + }, + { + "method": "post", + "path": "/proxy/set/{instanceName}", + "source": "src/api/routes/proxy.router.ts", + "schemaName": "proxySchema", + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "host": { + "type": "string" + }, + "port": { + "type": "string" + }, + "protocol": { + "type": "string" + }, + "username": { + "type": "string" + }, + "password": { + "type": "string" + } + }, + "required": [ + "enabled", + "host", + "port", + "protocol" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "host", + "port", + "protocol" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "host": { + "minLength": 1, + "description": "The \"host\" cannot be empty" + }, + "port": { + "minLength": 1, + "description": "The \"port\" cannot be empty" + }, + "protocol": { + "minLength": 1, + "description": "The \"protocol\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "CREATED", + "operation": { + "tags": [ + "Proxy" + ], + "summary": "Update set", + "description": "Update set for Proxy.", + "operationId": "post_proxy_set", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "host": { + "type": "string" + }, + "port": { + "type": "string" + }, + "protocol": { + "type": "string" + }, + "username": { + "type": "string" + }, + "password": { + "type": "string" + } + }, + "required": [ + "enabled", + "host", + "port", + "protocol" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "host", + "port", + "protocol" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "host": { + "minLength": 1, + "description": "The \"host\" cannot be empty" + }, + "port": { + "minLength": 1, + "description": "The \"port\" cannot be empty" + }, + "protocol": { + "minLength": 1, + "description": "The \"protocol\" cannot be empty" + } + } + } + } + } + } + }, + "x-validation-schema": "proxySchema", + "x-source": "src/api/routes/proxy.router.ts" + } + }, + { + "method": "get", + "path": "/pusher/find/{instanceName}", + "source": "src/api/integrations/event/pusher/pusher.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "operation": { + "tags": [ + "Pusher" + ], + "summary": "Get find", + "description": "Get find for Pusher.", + "operationId": "get_pusher_find", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/event/pusher/pusher.router.ts" + } + }, + { + "method": "post", + "path": "/pusher/set/{instanceName}", + "source": "src/api/integrations/event/pusher/pusher.router.ts", + "schemaName": "pusherSchema", + "schema": { + "type": "object", + "properties": { + "pusher": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "appId": { + "type": "string" + }, + "key": { + "type": "string" + }, + "secret": { + "type": "string" + }, + "cluster": { + "type": "string" + }, + "useTLS": { + "type": "boolean" + }, + "events": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "CONTACTS_SET", + "CONTACTS_UPSERT", + "CONTACTS_UPDATE", + "PRESENCE_UPDATE", + "CHATS_SET", + "CHATS_UPSERT", + "CHATS_UPDATE", + "CHATS_DELETE", + "GROUPS_UPSERT", + "GROUPS_UPDATE", + "GROUP_PARTICIPANTS_UPDATE", + "CONNECTION_UPDATE", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS", + "REMOVE_INSTANCE", + "LOGOUT_INSTANCE", + "INSTANCE_CREATE", + "INSTANCE_DELETE", + "STATUS_INSTANCE", + "CREDS_UPDATE", + "MESSAGING_HISTORY_SET", + "MESSAGING_HISTORY_STATUS", + "LID_MAPPING_UPDATE", + "MESSAGES_MEDIA_UPDATE", + "MESSAGES_REACTION", + "MESSAGE_RECEIPT_UPDATE", + "GROUP_JOIN_REQUEST", + "GROUP_MEMBER_TAG_UPDATE", + "BLOCKLIST_SET", + "BLOCKLIST_UPDATE", + "NEWSLETTER_REACTION", + "NEWSLETTER_VIEW", + "NEWSLETTER_PARTICIPANTS_UPDATE", + "NEWSLETTER_SETTINGS_UPDATE", + "MESSAGE_CAPPING_UPDATE", + "CHATS_LOCK", + "SETTINGS_UPDATE" + ] + } + } + }, + "required": [ + "enabled", + "appId", + "key", + "secret", + "cluster", + "useTLS" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "appId", + "key", + "secret", + "cluster", + "useTLS" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "appId": { + "minLength": 1, + "description": "The \"appId\" cannot be empty" + }, + "key": { + "minLength": 1, + "description": "The \"key\" cannot be empty" + }, + "secret": { + "minLength": 1, + "description": "The \"secret\" cannot be empty" + }, + "cluster": { + "minLength": 1, + "description": "The \"cluster\" cannot be empty" + }, + "useTLS": { + "minLength": 1, + "description": "The \"useTLS\" cannot be empty" + } + } + } + } + }, + "required": [ + "pusher" + ] + }, + "multipart": false, + "runtimeStatus": "CREATED", + "operation": { + "tags": [ + "Pusher" + ], + "summary": "Update set", + "description": "Update set for Pusher.", + "operationId": "post_pusher_set", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "pusher": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "appId": { + "type": "string" + }, + "key": { + "type": "string" + }, + "secret": { + "type": "string" + }, + "cluster": { + "type": "string" + }, + "useTLS": { + "type": "boolean" + }, + "events": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "CONTACTS_SET", + "CONTACTS_UPSERT", + "CONTACTS_UPDATE", + "PRESENCE_UPDATE", + "CHATS_SET", + "CHATS_UPSERT", + "CHATS_UPDATE", + "CHATS_DELETE", + "GROUPS_UPSERT", + "GROUPS_UPDATE", + "GROUP_PARTICIPANTS_UPDATE", + "CONNECTION_UPDATE", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS", + "REMOVE_INSTANCE", + "LOGOUT_INSTANCE", + "INSTANCE_CREATE", + "INSTANCE_DELETE", + "STATUS_INSTANCE", + "CREDS_UPDATE", + "MESSAGING_HISTORY_SET", + "MESSAGING_HISTORY_STATUS", + "LID_MAPPING_UPDATE", + "MESSAGES_MEDIA_UPDATE", + "MESSAGES_REACTION", + "MESSAGE_RECEIPT_UPDATE", + "GROUP_JOIN_REQUEST", + "GROUP_MEMBER_TAG_UPDATE", + "BLOCKLIST_SET", + "BLOCKLIST_UPDATE", + "NEWSLETTER_REACTION", + "NEWSLETTER_VIEW", + "NEWSLETTER_PARTICIPANTS_UPDATE", + "NEWSLETTER_SETTINGS_UPDATE", + "MESSAGE_CAPPING_UPDATE", + "CHATS_LOCK", + "SETTINGS_UPDATE" + ] + } + } + }, + "required": [ + "enabled", + "appId", + "key", + "secret", + "cluster", + "useTLS" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "appId", + "key", + "secret", + "cluster", + "useTLS" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "appId": { + "minLength": 1, + "description": "The \"appId\" cannot be empty" + }, + "key": { + "minLength": 1, + "description": "The \"key\" cannot be empty" + }, + "secret": { + "minLength": 1, + "description": "The \"secret\" cannot be empty" + }, + "cluster": { + "minLength": 1, + "description": "The \"cluster\" cannot be empty" + }, + "useTLS": { + "minLength": 1, + "description": "The \"useTLS\" cannot be empty" + } + } + } + } + }, + "required": [ + "pusher" + ] + } + } + } + }, + "x-validation-schema": "pusherSchema", + "x-source": "src/api/integrations/event/pusher/pusher.router.ts" + } + }, + { + "method": "get", + "path": "/rabbitmq/find/{instanceName}", + "source": "src/api/integrations/event/rabbitmq/rabbitmq.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "operation": { + "tags": [ + "RabbitMQ" + ], + "summary": "Get find", + "description": "Get find for RabbitMQ.", + "operationId": "get_rabbitmq_find", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/event/rabbitmq/rabbitmq.router.ts" + } + }, + { + "method": "post", + "path": "/rabbitmq/set/{instanceName}", + "source": "src/api/integrations/event/rabbitmq/rabbitmq.router.ts", + "schemaName": "eventSchema", + "schema": { + "type": "object", + "properties": { + "websocket": { + "$ref": "#/$defs/event" + }, + "rabbitmq": { + "$ref": "#/$defs/event" + }, + "nats": { + "$ref": "#/$defs/event" + }, + "sqs": { + "$ref": "#/$defs/event" + }, + "kafka": { + "$ref": "#/$defs/event" + } + }, + "$defs": { + "event": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "events": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "CONTACTS_SET", + "CONTACTS_UPSERT", + "CONTACTS_UPDATE", + "PRESENCE_UPDATE", + "CHATS_SET", + "CHATS_UPSERT", + "CHATS_UPDATE", + "CHATS_DELETE", + "GROUPS_UPSERT", + "GROUPS_UPDATE", + "GROUP_PARTICIPANTS_UPDATE", + "CONNECTION_UPDATE", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS", + "REMOVE_INSTANCE", + "LOGOUT_INSTANCE", + "INSTANCE_CREATE", + "INSTANCE_DELETE", + "STATUS_INSTANCE", + "CREDS_UPDATE", + "MESSAGING_HISTORY_SET", + "MESSAGING_HISTORY_STATUS", + "LID_MAPPING_UPDATE", + "MESSAGES_MEDIA_UPDATE", + "MESSAGES_REACTION", + "MESSAGE_RECEIPT_UPDATE", + "GROUP_JOIN_REQUEST", + "GROUP_MEMBER_TAG_UPDATE", + "BLOCKLIST_SET", + "BLOCKLIST_UPDATE", + "NEWSLETTER_REACTION", + "NEWSLETTER_VIEW", + "NEWSLETTER_PARTICIPANTS_UPDATE", + "NEWSLETTER_SETTINGS_UPDATE", + "MESSAGE_CAPPING_UPDATE", + "CHATS_LOCK", + "SETTINGS_UPDATE" + ] + } + } + }, + "required": [ + "enabled" + ] + } + } + }, + "multipart": false, + "runtimeStatus": "CREATED", + "operation": { + "tags": [ + "RabbitMQ" + ], + "summary": "Update set", + "description": "Update set for RabbitMQ.", + "operationId": "post_rabbitmq_set", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "websocket": { + "$ref": "#/$defs/event" + }, + "rabbitmq": { + "$ref": "#/$defs/event" + }, + "nats": { + "$ref": "#/$defs/event" + }, + "sqs": { + "$ref": "#/$defs/event" + }, + "kafka": { + "$ref": "#/$defs/event" + } + }, + "$defs": { + "event": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "events": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "CONTACTS_SET", + "CONTACTS_UPSERT", + "CONTACTS_UPDATE", + "PRESENCE_UPDATE", + "CHATS_SET", + "CHATS_UPSERT", + "CHATS_UPDATE", + "CHATS_DELETE", + "GROUPS_UPSERT", + "GROUPS_UPDATE", + "GROUP_PARTICIPANTS_UPDATE", + "CONNECTION_UPDATE", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS", + "REMOVE_INSTANCE", + "LOGOUT_INSTANCE", + "INSTANCE_CREATE", + "INSTANCE_DELETE", + "STATUS_INSTANCE", + "CREDS_UPDATE", + "MESSAGING_HISTORY_SET", + "MESSAGING_HISTORY_STATUS", + "LID_MAPPING_UPDATE", + "MESSAGES_MEDIA_UPDATE", + "MESSAGES_REACTION", + "MESSAGE_RECEIPT_UPDATE", + "GROUP_JOIN_REQUEST", + "GROUP_MEMBER_TAG_UPDATE", + "BLOCKLIST_SET", + "BLOCKLIST_UPDATE", + "NEWSLETTER_REACTION", + "NEWSLETTER_VIEW", + "NEWSLETTER_PARTICIPANTS_UPDATE", + "NEWSLETTER_SETTINGS_UPDATE", + "MESSAGE_CAPPING_UPDATE", + "CHATS_LOCK", + "SETTINGS_UPDATE" + ] + } + } + }, + "required": [ + "enabled" + ] + } + } + } + } + } + }, + "x-validation-schema": "eventSchema", + "x-source": "src/api/integrations/event/rabbitmq/rabbitmq.router.ts" + } + }, + { + "method": "post", + "path": "/s3/getMedia/{instanceName}", + "source": "src/api/integrations/storage/s3/routes/s3.router.ts", + "schemaName": "s3Schema", + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string" + }, + "messageId": { + "type": "integer" + } + }, + "if": { + "propertyNames": { + "enum": [ + "id", + "type", + "messageId" + ] + } + }, + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + }, + "type": { + "minLength": 1, + "description": "The \"type\" cannot be empty" + }, + "messageId": { + "minLength": 1, + "description": "The \"messageId\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "CREATED", + "operation": { + "tags": [ + "S3" + ], + "summary": "Get get Media", + "description": "Get get Media for S3.", + "operationId": "post_s3_getMedia", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string" + }, + "messageId": { + "type": "integer" + } + }, + "if": { + "propertyNames": { + "enum": [ + "id", + "type", + "messageId" + ] + } + }, + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + }, + "type": { + "minLength": 1, + "description": "The \"type\" cannot be empty" + }, + "messageId": { + "minLength": 1, + "description": "The \"messageId\" cannot be empty" + } + } + } + } + } + } + }, + "x-validation-schema": "s3Schema", + "x-source": "src/api/integrations/storage/s3/routes/s3.router.ts" + } + }, + { + "method": "post", + "path": "/s3/getMediaUrl/{instanceName}", + "source": "src/api/integrations/storage/s3/routes/s3.router.ts", + "schemaName": "s3UrlSchema", + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "pattern": "\\d+", + "minLength": 1 + }, + "expiry": { + "type": "string", + "pattern": "\\d+", + "minLength": 1 + } + }, + "if": { + "propertyNames": { + "enum": [ + "id" + ] + } + }, + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + } + } + }, + "required": [ + "id" + ] + }, + "multipart": false, + "runtimeStatus": "OK", + "operation": { + "tags": [ + "S3" + ], + "summary": "Get get Media Url", + "description": "Get get Media Url for S3.", + "operationId": "post_s3_getMediaUrl", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "pattern": "\\d+", + "minLength": 1 + }, + "expiry": { + "type": "string", + "pattern": "\\d+", + "minLength": 1 + } + }, + "if": { + "propertyNames": { + "enum": [ + "id" + ] + } + }, + "then": { + "properties": { + "id": { + "minLength": 1, + "description": "The \"id\" cannot be empty" + } + } + }, + "required": [ + "id" + ] + } + } + } + }, + "x-validation-schema": "s3UrlSchema", + "x-source": "src/api/integrations/storage/s3/routes/s3.router.ts" + } + }, + { + "method": "post", + "path": "/settings-template/assign/{instanceName}", + "source": "src/api/routes/settingsTemplate.router.ts", + "schemaName": "settingsTemplateAssignSchema", + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "templateId": { + "type": "string", + "minLength": 1 + }, + "scope": { + "type": "string", + "enum": [ + "instance", + "group", + "contact" + ] + }, + "target": { + "type": "string", + "minLength": 3, + "maxLength": 255 + } + }, + "required": [ + "templateId", + "scope" + ] + }, + "multipart": false, + "runtimeStatus": "OK", + "operation": { + "tags": [ + "Settings templates" + ], + "summary": "Assign a settings template", + "description": "Run assign. Template edits propagate to every binding without copying settings.", + "operationId": "post_settings_template_assign", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "templateId": { + "type": "string", + "minLength": 1 + }, + "scope": { + "type": "string", + "enum": [ + "instance", + "group", + "contact" + ] + }, + "target": { + "type": "string", + "minLength": 3, + "maxLength": 255 + } + }, + "required": [ + "templateId", + "scope" + ] + } + } + } + }, + "x-validation-schema": "settingsTemplateAssignSchema", + "x-source": "src/api/routes/settingsTemplate.router.ts" + } + }, + { + "method": "get", + "path": "/settings-template/bindings/{instanceName}", + "source": "src/api/routes/settingsTemplate.router.ts", + "schemaName": "null", + "multipart": false, + "runtimeStatus": "OK", + "operation": { + "tags": [ + "Settings templates" + ], + "summary": "List template bindings", + "description": "List the instance default and exact group/contact bindings.", + "operationId": "get_settings_template_bindings", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "x-validation-schema": "null", + "x-source": "src/api/routes/settingsTemplate.router.ts" + } + }, + { + "method": "post", + "path": "/settings-template/create", + "source": "src/api/routes/settingsTemplate.router.ts", + "schemaName": "settingsTemplateCreateSchema", + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "minLength": 1, + "maxLength": 255 + }, + "settings": { + "type": "object", + "additionalProperties": false, + "properties": { + "localReadTtlSeconds": { + "type": [ + "integer", + "null" + ], + "minimum": 0, + "maximum": 2592000 + }, + "localReadTtlOverrides": { + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "integer", + "minimum": 0, + "maximum": 2592000 + } + }, + "automationSafety": { + "type": [ + "object", + "null" + ], + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "typing": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "minMs": { + "type": "integer", + "minimum": 0, + "maximum": 20000 + }, + "maxMs": { + "type": "integer", + "minimum": 0, + "maximum": 20000 + }, + "charactersPerSecond": { + "type": "number", + "minimum": 1, + "maximum": 100 + }, + "jitterPercent": { + "type": "integer", + "minimum": 0, + "maximum": 25 + }, + "presence": { + "type": "string", + "enum": [ + "composing", + "recording" + ] + }, + "applyToMediaCaptions": { + "type": "boolean" + } + } + }, + "rateLimit": { + "type": "object", + "additionalProperties": false, + "properties": { + "instancePerMinute": { + "type": "integer", + "minimum": 1, + "maximum": 10000 + }, + "instancePerDay": { + "type": "integer", + "minimum": 1, + "maximum": 1000000 + }, + "recipientPerMinute": { + "type": "integer", + "minimum": 1, + "maximum": 1000 + }, + "recipientPerDay": { + "type": "integer", + "minimum": 1, + "maximum": 100000 + }, + "minimumIntervalMs": { + "type": "integer", + "minimum": 0, + "maximum": 600000 + }, + "maxConcurrentSends": { + "type": "integer", + "minimum": 1, + "maximum": 100 + } + } + }, + "outreach": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "newOrDormantRecipientsPerDay": { + "type": "integer", + "minimum": 1, + "maximum": 100000 + }, + "dormantAfterDays": { + "type": "integer", + "minimum": 1, + "maximum": 3650 + } + } + }, + "quietHours": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "start": { + "type": "string", + "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$" + }, + "end": { + "type": "string", + "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$" + }, + "timeZone": { + "type": "string", + "minLength": 1, + "maxLength": 100 + } + } + }, + "duplicate": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "windowSeconds": { + "type": "integer", + "minimum": 1, + "maximum": 86400 + }, + "similarityThresholdPercent": { + "type": "integer", + "minimum": 1, + "maximum": 100 + } + } + }, + "suppression": { + "type": "object", + "additionalProperties": false, + "properties": { + "recipients": { + "type": "array", + "maxItems": 10000, + "items": { + "type": "string", + "minLength": 3, + "maxLength": 100 + } + }, + "allowlistEnabled": { + "type": "boolean" + }, + "allowedRecipients": { + "type": "array", + "maxItems": 10000, + "items": { + "type": "string", + "minLength": 3, + "maxLength": 100 + } + } + } + }, + "failurePause": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "threshold": { + "type": "integer", + "minimum": 1, + "maximum": 100 + }, + "pauseSeconds": { + "type": "integer", + "minimum": 1, + "maximum": 86400 + } + } + }, + "audit": { + "type": "object", + "additionalProperties": false, + "properties": { + "retentionDays": { + "type": "integer", + "minimum": 1, + "maximum": 3650 + } + } + } + } + } + } + } + }, + "required": [ + "name", + "settings" + ] + }, + "multipart": false, + "runtimeStatus": "CREATED", + "operation": { + "tags": [ + "Settings templates" + ], + "summary": "Create a settings template", + "description": "Create create. Template edits propagate to every binding without copying settings.", + "operationId": "post_settings_template_create", + "parameters": [], + "responses": { + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "minLength": 1, + "maxLength": 255 + }, + "settings": { + "type": "object", + "additionalProperties": false, + "properties": { + "localReadTtlSeconds": { + "type": [ + "integer", + "null" + ], + "minimum": 0, + "maximum": 2592000 + }, + "localReadTtlOverrides": { + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "integer", + "minimum": 0, + "maximum": 2592000 + } + }, + "automationSafety": { + "type": [ + "object", + "null" + ], + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "typing": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "minMs": { + "type": "integer", + "minimum": 0, + "maximum": 20000 + }, + "maxMs": { + "type": "integer", + "minimum": 0, + "maximum": 20000 + }, + "charactersPerSecond": { + "type": "number", + "minimum": 1, + "maximum": 100 + }, + "jitterPercent": { + "type": "integer", + "minimum": 0, + "maximum": 25 + }, + "presence": { + "type": "string", + "enum": [ + "composing", + "recording" + ] + }, + "applyToMediaCaptions": { + "type": "boolean" + } + } + }, + "rateLimit": { + "type": "object", + "additionalProperties": false, + "properties": { + "instancePerMinute": { + "type": "integer", + "minimum": 1, + "maximum": 10000 + }, + "instancePerDay": { + "type": "integer", + "minimum": 1, + "maximum": 1000000 + }, + "recipientPerMinute": { + "type": "integer", + "minimum": 1, + "maximum": 1000 + }, + "recipientPerDay": { + "type": "integer", + "minimum": 1, + "maximum": 100000 + }, + "minimumIntervalMs": { + "type": "integer", + "minimum": 0, + "maximum": 600000 + }, + "maxConcurrentSends": { + "type": "integer", + "minimum": 1, + "maximum": 100 + } + } + }, + "outreach": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "newOrDormantRecipientsPerDay": { + "type": "integer", + "minimum": 1, + "maximum": 100000 + }, + "dormantAfterDays": { + "type": "integer", + "minimum": 1, + "maximum": 3650 + } + } + }, + "quietHours": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "start": { + "type": "string", + "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$" + }, + "end": { + "type": "string", + "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$" + }, + "timeZone": { + "type": "string", + "minLength": 1, + "maxLength": 100 + } + } + }, + "duplicate": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "windowSeconds": { + "type": "integer", + "minimum": 1, + "maximum": 86400 + }, + "similarityThresholdPercent": { + "type": "integer", + "minimum": 1, + "maximum": 100 + } + } + }, + "suppression": { + "type": "object", + "additionalProperties": false, + "properties": { + "recipients": { + "type": "array", + "maxItems": 10000, + "items": { + "type": "string", + "minLength": 3, + "maxLength": 100 + } + }, + "allowlistEnabled": { + "type": "boolean" + }, + "allowedRecipients": { + "type": "array", + "maxItems": 10000, + "items": { + "type": "string", + "minLength": 3, + "maxLength": 100 + } + } + } + }, + "failurePause": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "threshold": { + "type": "integer", + "minimum": 1, + "maximum": 100 + }, + "pauseSeconds": { + "type": "integer", + "minimum": 1, + "maximum": 86400 + } + } + }, + "audit": { + "type": "object", + "additionalProperties": false, + "properties": { + "retentionDays": { + "type": "integer", + "minimum": 1, + "maximum": 3650 + } + } + } + } + } + } + } + }, + "required": [ + "name", + "settings" + ] + } + } + } + }, + "x-validation-schema": "settingsTemplateCreateSchema", + "x-source": "src/api/routes/settingsTemplate.router.ts" + } + }, + { + "method": "delete", + "path": "/settings-template/delete", + "source": "src/api/routes/settingsTemplate.router.ts", + "schemaName": "settingsTemplateDeleteSchema", + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "templateId": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "templateId" + ] + }, + "multipart": false, + "operation": { + "tags": [ + "Settings templates" + ], + "summary": "Delete a settings template", + "description": "Delete delete. Template edits propagate to every binding without copying settings.", + "operationId": "delete_settings_template_delete", + "parameters": [], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "templateId": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "templateId" + ] + } + } + } + }, + "x-validation-schema": "settingsTemplateDeleteSchema", + "x-source": "src/api/routes/settingsTemplate.router.ts" + } + }, + { + "method": "post", + "path": "/settings-template/duplicate", + "source": "src/api/routes/settingsTemplate.router.ts", + "schemaName": "settingsTemplateDuplicateSchema", + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "templateId": { + "type": "string", + "minLength": 1 + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 255 + } + }, + "required": [ + "templateId", + "name" + ] + }, + "multipart": false, + "runtimeStatus": "CREATED", + "operation": { + "tags": [ + "Settings templates" + ], + "summary": "Duplicate a settings template", + "description": "Run duplicate. Template edits propagate to every binding without copying settings.", + "operationId": "post_settings_template_duplicate", + "parameters": [], + "responses": { + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "templateId": { + "type": "string", + "minLength": 1 + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 255 + } + }, + "required": [ + "templateId", + "name" + ] + } + } + } + }, + "x-validation-schema": "settingsTemplateDuplicateSchema", + "x-source": "src/api/routes/settingsTemplate.router.ts" + } + }, + { + "method": "post", + "path": "/settings-template/edit", + "source": "src/api/routes/settingsTemplate.router.ts", + "schemaName": "settingsTemplateEditSchema", + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "templateId": { + "type": "string", + "minLength": 1 + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 255 + }, + "settings": { + "type": "object", + "additionalProperties": false, + "properties": { + "localReadTtlSeconds": { + "type": [ + "integer", + "null" + ], + "minimum": 0, + "maximum": 2592000 + }, + "localReadTtlOverrides": { + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "integer", + "minimum": 0, + "maximum": 2592000 + } + }, + "automationSafety": { + "type": [ + "object", + "null" + ], + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "typing": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "minMs": { + "type": "integer", + "minimum": 0, + "maximum": 20000 + }, + "maxMs": { + "type": "integer", + "minimum": 0, + "maximum": 20000 + }, + "charactersPerSecond": { + "type": "number", + "minimum": 1, + "maximum": 100 + }, + "jitterPercent": { + "type": "integer", + "minimum": 0, + "maximum": 25 + }, + "presence": { + "type": "string", + "enum": [ + "composing", + "recording" + ] + }, + "applyToMediaCaptions": { + "type": "boolean" + } + } + }, + "rateLimit": { + "type": "object", + "additionalProperties": false, + "properties": { + "instancePerMinute": { + "type": "integer", + "minimum": 1, + "maximum": 10000 + }, + "instancePerDay": { + "type": "integer", + "minimum": 1, + "maximum": 1000000 + }, + "recipientPerMinute": { + "type": "integer", + "minimum": 1, + "maximum": 1000 + }, + "recipientPerDay": { + "type": "integer", + "minimum": 1, + "maximum": 100000 + }, + "minimumIntervalMs": { + "type": "integer", + "minimum": 0, + "maximum": 600000 + }, + "maxConcurrentSends": { + "type": "integer", + "minimum": 1, + "maximum": 100 + } + } + }, + "outreach": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "newOrDormantRecipientsPerDay": { + "type": "integer", + "minimum": 1, + "maximum": 100000 + }, + "dormantAfterDays": { + "type": "integer", + "minimum": 1, + "maximum": 3650 + } + } + }, + "quietHours": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "start": { + "type": "string", + "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$" + }, + "end": { + "type": "string", + "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$" + }, + "timeZone": { + "type": "string", + "minLength": 1, + "maxLength": 100 + } + } + }, + "duplicate": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "windowSeconds": { + "type": "integer", + "minimum": 1, + "maximum": 86400 + }, + "similarityThresholdPercent": { + "type": "integer", + "minimum": 1, + "maximum": 100 + } + } + }, + "suppression": { + "type": "object", + "additionalProperties": false, + "properties": { + "recipients": { + "type": "array", + "maxItems": 10000, + "items": { + "type": "string", + "minLength": 3, + "maxLength": 100 + } + }, + "allowlistEnabled": { + "type": "boolean" + }, + "allowedRecipients": { + "type": "array", + "maxItems": 10000, + "items": { + "type": "string", + "minLength": 3, + "maxLength": 100 + } + } + } + }, + "failurePause": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "threshold": { + "type": "integer", + "minimum": 1, + "maximum": 100 + }, + "pauseSeconds": { + "type": "integer", + "minimum": 1, + "maximum": 86400 + } + } + }, + "audit": { + "type": "object", + "additionalProperties": false, + "properties": { + "retentionDays": { + "type": "integer", + "minimum": 1, + "maximum": 3650 + } + } + } + } + } + } + } + }, + "required": [ + "templateId" + ] + }, + "multipart": false, + "runtimeStatus": "OK", + "operation": { + "tags": [ + "Settings templates" + ], + "summary": "Edit a settings template", + "description": "Run edit. Template edits propagate to every binding without copying settings.", + "operationId": "post_settings_template_edit", + "parameters": [], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "templateId": { + "type": "string", + "minLength": 1 + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 255 + }, + "settings": { + "type": "object", + "additionalProperties": false, + "properties": { + "localReadTtlSeconds": { + "type": [ + "integer", + "null" + ], + "minimum": 0, + "maximum": 2592000 + }, + "localReadTtlOverrides": { + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "integer", + "minimum": 0, + "maximum": 2592000 + } + }, + "automationSafety": { + "type": [ + "object", + "null" + ], + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "typing": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "minMs": { + "type": "integer", + "minimum": 0, + "maximum": 20000 + }, + "maxMs": { + "type": "integer", + "minimum": 0, + "maximum": 20000 + }, + "charactersPerSecond": { + "type": "number", + "minimum": 1, + "maximum": 100 + }, + "jitterPercent": { + "type": "integer", + "minimum": 0, + "maximum": 25 + }, + "presence": { + "type": "string", + "enum": [ + "composing", + "recording" + ] + }, + "applyToMediaCaptions": { + "type": "boolean" + } + } + }, + "rateLimit": { + "type": "object", + "additionalProperties": false, + "properties": { + "instancePerMinute": { + "type": "integer", + "minimum": 1, + "maximum": 10000 + }, + "instancePerDay": { + "type": "integer", + "minimum": 1, + "maximum": 1000000 + }, + "recipientPerMinute": { + "type": "integer", + "minimum": 1, + "maximum": 1000 + }, + "recipientPerDay": { + "type": "integer", + "minimum": 1, + "maximum": 100000 + }, + "minimumIntervalMs": { + "type": "integer", + "minimum": 0, + "maximum": 600000 + }, + "maxConcurrentSends": { + "type": "integer", + "minimum": 1, + "maximum": 100 + } + } + }, + "outreach": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "newOrDormantRecipientsPerDay": { + "type": "integer", + "minimum": 1, + "maximum": 100000 + }, + "dormantAfterDays": { + "type": "integer", + "minimum": 1, + "maximum": 3650 + } + } + }, + "quietHours": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "start": { + "type": "string", + "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$" + }, + "end": { + "type": "string", + "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$" + }, + "timeZone": { + "type": "string", + "minLength": 1, + "maxLength": 100 + } + } + }, + "duplicate": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "windowSeconds": { + "type": "integer", + "minimum": 1, + "maximum": 86400 + }, + "similarityThresholdPercent": { + "type": "integer", + "minimum": 1, + "maximum": 100 + } + } + }, + "suppression": { + "type": "object", + "additionalProperties": false, + "properties": { + "recipients": { + "type": "array", + "maxItems": 10000, + "items": { + "type": "string", + "minLength": 3, + "maxLength": 100 + } + }, + "allowlistEnabled": { + "type": "boolean" + }, + "allowedRecipients": { + "type": "array", + "maxItems": 10000, + "items": { + "type": "string", + "minLength": 3, + "maxLength": 100 + } + } + } + }, + "failurePause": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "threshold": { + "type": "integer", + "minimum": 1, + "maximum": 100 + }, + "pauseSeconds": { + "type": "integer", + "minimum": 1, + "maximum": 86400 + } + } + }, + "audit": { + "type": "object", + "additionalProperties": false, + "properties": { + "retentionDays": { + "type": "integer", + "minimum": 1, + "maximum": 3650 + } + } + } + } + } + } + } + }, + "required": [ + "templateId" + ] + } + } + } + }, + "x-validation-schema": "settingsTemplateEditSchema", + "x-source": "src/api/routes/settingsTemplate.router.ts" + } + }, + { + "method": "get", + "path": "/settings-template/list", + "source": "src/api/routes/settingsTemplate.router.ts", + "multipart": false, + "runtimeStatus": "OK", + "operation": { + "tags": [ + "Settings templates" + ], + "summary": "List settings templates", + "description": "List live shared settings templates.", + "operationId": "get_settings_template_list", + "parameters": [], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "x-source": "src/api/routes/settingsTemplate.router.ts" + } + }, + { + "method": "delete", + "path": "/settings-template/unassign/{instanceName}", + "source": "src/api/routes/settingsTemplate.router.ts", + "schemaName": "settingsTemplateUnassignSchema", + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "enum": [ + "instance", + "group", + "contact" + ] + }, + "target": { + "type": "string", + "minLength": 3, + "maxLength": 255 + } + }, + "required": [ + "scope" + ] + }, + "multipart": false, + "runtimeStatus": "OK", + "operation": { + "tags": [ + "Settings templates" + ], + "summary": "Unassign a settings template", + "description": "Delete unassign. Template edits propagate to every binding without copying settings.", + "operationId": "delete_settings_template_unassign", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "scope": { + "type": "string", + "enum": [ + "instance", + "group", + "contact" + ] + }, + "target": { + "type": "string", + "minLength": 3, + "maxLength": 255 + } + }, + "required": [ + "scope" + ] + } + } + } + }, + "x-validation-schema": "settingsTemplateUnassignSchema", + "x-source": "src/api/routes/settingsTemplate.router.ts" + } + }, + { + "method": "get", + "path": "/settings/find/{instanceName}", + "source": "src/api/routes/settings.router.ts", + "schemaName": "null", + "multipart": false, + "runtimeStatus": "OK", + "operation": { + "tags": [ + "Instance settings" + ], + "summary": "Get find", + "description": "Get find for Instance settings.", + "operationId": "get_settings_find", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "x-validation-schema": "null", + "x-source": "src/api/routes/settings.router.ts" + } + }, + { + "method": "get", + "path": "/settings/outbound-audit/{instanceName}", + "source": "src/api/routes/settings.router.ts", + "schemaName": "null", + "multipart": false, + "runtimeStatus": "OK", + "operation": { + "tags": [ + "Instance settings" + ], + "summary": "Get outbound audit", + "description": "Get outbound audit for Instance settings.", + "operationId": "get_settings_outbound_audit", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "minimum": 1 + } + }, + { + "name": "recipient", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "status", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, + "x-validation-schema": "null", "x-source": "src/api/routes/settings.router.ts" } }, { - "method": "get", - "path": "/settings/outbound-audit/{instanceName}", + "method": "post", + "path": "/settings/set/{instanceName}", "source": "src/api/routes/settings.router.ts", + "schemaName": "settingsSchema", + "schema": { + "type": "object", + "properties": { + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "localReadTtlSeconds": { + "type": [ + "integer", + "null" + ], + "minimum": 0, + "maximum": 2592000 + }, + "localReadTtlOverrides": { + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "integer", + "minimum": 0, + "maximum": 2592000 + } + }, + "automationSafety": { + "type": [ + "object", + "null" + ], + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "typing": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "minMs": { + "type": "integer", + "minimum": 0, + "maximum": 20000 + }, + "maxMs": { + "type": "integer", + "minimum": 0, + "maximum": 20000 + }, + "charactersPerSecond": { + "type": "number", + "minimum": 1, + "maximum": 100 + }, + "jitterPercent": { + "type": "integer", + "minimum": 0, + "maximum": 25 + }, + "presence": { + "type": "string", + "enum": [ + "composing", + "recording" + ] + }, + "applyToMediaCaptions": { + "type": "boolean" + } + } + }, + "rateLimit": { + "type": "object", + "additionalProperties": false, + "properties": { + "instancePerMinute": { + "type": "integer", + "minimum": 1, + "maximum": 10000 + }, + "instancePerDay": { + "type": "integer", + "minimum": 1, + "maximum": 1000000 + }, + "recipientPerMinute": { + "type": "integer", + "minimum": 1, + "maximum": 1000 + }, + "recipientPerDay": { + "type": "integer", + "minimum": 1, + "maximum": 100000 + }, + "minimumIntervalMs": { + "type": "integer", + "minimum": 0, + "maximum": 600000 + }, + "maxConcurrentSends": { + "type": "integer", + "minimum": 1, + "maximum": 100 + } + } + }, + "outreach": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "newOrDormantRecipientsPerDay": { + "type": "integer", + "minimum": 1, + "maximum": 100000 + }, + "dormantAfterDays": { + "type": "integer", + "minimum": 1, + "maximum": 3650 + } + } + }, + "quietHours": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "start": { + "type": "string", + "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$" + }, + "end": { + "type": "string", + "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$" + }, + "timeZone": { + "type": "string", + "minLength": 1, + "maxLength": 100 + } + } + }, + "duplicate": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "windowSeconds": { + "type": "integer", + "minimum": 1, + "maximum": 86400 + }, + "similarityThresholdPercent": { + "type": "integer", + "minimum": 1, + "maximum": 100 + } + } + }, + "suppression": { + "type": "object", + "additionalProperties": false, + "properties": { + "recipients": { + "type": "array", + "maxItems": 10000, + "items": { + "type": "string", + "minLength": 3, + "maxLength": 100 + } + }, + "allowlistEnabled": { + "type": "boolean" + }, + "allowedRecipients": { + "type": "array", + "maxItems": 10000, + "items": { + "type": "string", + "minLength": 3, + "maxLength": 100 + } + } + } + }, + "failurePause": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "threshold": { + "type": "integer", + "minimum": 1, + "maximum": 100 + }, + "pauseSeconds": { + "type": "integer", + "minimum": 1, + "maximum": 86400 + } + } + }, + "audit": { + "type": "object", + "additionalProperties": false, + "properties": { + "retentionDays": { + "type": "integer", + "minimum": 1, + "maximum": 3650 + } + } + } + } + } + }, + "required": [ + "rejectCall", + "groupsIgnore", + "alwaysOnline", + "readMessages", + "readStatus", + "syncFullHistory" + ], + "if": { + "propertyNames": { + "enum": [ + "rejectCall", + "groupsIgnore", + "alwaysOnline", + "readMessages", + "readStatus", + "syncFullHistory" + ] + } + }, + "then": { + "properties": { + "rejectCall": { + "minLength": 1, + "description": "The \"rejectCall\" cannot be empty" + }, + "groupsIgnore": { + "minLength": 1, + "description": "The \"groupsIgnore\" cannot be empty" + }, + "alwaysOnline": { + "minLength": 1, + "description": "The \"alwaysOnline\" cannot be empty" + }, + "readMessages": { + "minLength": 1, + "description": "The \"readMessages\" cannot be empty" + }, + "readStatus": { + "minLength": 1, + "description": "The \"readStatus\" cannot be empty" + }, + "syncFullHistory": { + "minLength": 1, + "description": "The \"syncFullHistory\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "CREATED", "operation": { "tags": [ "Instance settings" ], - "summary": "Get outbound audit", - "description": "Get outbound audit for Instance settings.", - "operationId": "get_settings_outbound_audit", + "summary": "Update set", + "description": "Update set for Instance settings.", + "operationId": "post_settings_set", "parameters": [ { "name": "instanceName", @@ -8268,77 +78149,847 @@ } ], "responses": { - "200": { - "description": "Successful response." + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "localReadTtlSeconds": { + "type": [ + "integer", + "null" + ], + "minimum": 0, + "maximum": 2592000 + }, + "localReadTtlOverrides": { + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "integer", + "minimum": 0, + "maximum": 2592000 + } + }, + "automationSafety": { + "type": [ + "object", + "null" + ], + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "typing": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "minMs": { + "type": "integer", + "minimum": 0, + "maximum": 20000 + }, + "maxMs": { + "type": "integer", + "minimum": 0, + "maximum": 20000 + }, + "charactersPerSecond": { + "type": "number", + "minimum": 1, + "maximum": 100 + }, + "jitterPercent": { + "type": "integer", + "minimum": 0, + "maximum": 25 + }, + "presence": { + "type": "string", + "enum": [ + "composing", + "recording" + ] + }, + "applyToMediaCaptions": { + "type": "boolean" + } + } + }, + "rateLimit": { + "type": "object", + "additionalProperties": false, + "properties": { + "instancePerMinute": { + "type": "integer", + "minimum": 1, + "maximum": 10000 + }, + "instancePerDay": { + "type": "integer", + "minimum": 1, + "maximum": 1000000 + }, + "recipientPerMinute": { + "type": "integer", + "minimum": 1, + "maximum": 1000 + }, + "recipientPerDay": { + "type": "integer", + "minimum": 1, + "maximum": 100000 + }, + "minimumIntervalMs": { + "type": "integer", + "minimum": 0, + "maximum": 600000 + }, + "maxConcurrentSends": { + "type": "integer", + "minimum": 1, + "maximum": 100 + } + } + }, + "outreach": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "newOrDormantRecipientsPerDay": { + "type": "integer", + "minimum": 1, + "maximum": 100000 + }, + "dormantAfterDays": { + "type": "integer", + "minimum": 1, + "maximum": 3650 + } + } + }, + "quietHours": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "start": { + "type": "string", + "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$" + }, + "end": { + "type": "string", + "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$" + }, + "timeZone": { + "type": "string", + "minLength": 1, + "maxLength": 100 + } + } + }, + "duplicate": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "windowSeconds": { + "type": "integer", + "minimum": 1, + "maximum": 86400 + }, + "similarityThresholdPercent": { + "type": "integer", + "minimum": 1, + "maximum": 100 + } + } + }, + "suppression": { + "type": "object", + "additionalProperties": false, + "properties": { + "recipients": { + "type": "array", + "maxItems": 10000, + "items": { + "type": "string", + "minLength": 3, + "maxLength": 100 + } + }, + "allowlistEnabled": { + "type": "boolean" + }, + "allowedRecipients": { + "type": "array", + "maxItems": 10000, + "items": { + "type": "string", + "minLength": 3, + "maxLength": 100 + } + } + } + }, + "failurePause": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "threshold": { + "type": "integer", + "minimum": 1, + "maximum": 100 + }, + "pauseSeconds": { + "type": "integer", + "minimum": 1, + "maximum": 86400 + } + } + }, + "audit": { + "type": "object", + "additionalProperties": false, + "properties": { + "retentionDays": { + "type": "integer", + "minimum": 1, + "maximum": 3650 + } + } + } + } + } + }, + "required": [ + "rejectCall", + "groupsIgnore", + "alwaysOnline", + "readMessages", + "readStatus", + "syncFullHistory" + ], + "if": { + "propertyNames": { + "enum": [ + "rejectCall", + "groupsIgnore", + "alwaysOnline", + "readMessages", + "readStatus", + "syncFullHistory" + ] + } + }, + "then": { + "properties": { + "rejectCall": { + "minLength": 1, + "description": "The \"rejectCall\" cannot be empty" + }, + "groupsIgnore": { + "minLength": 1, + "description": "The \"groupsIgnore\" cannot be empty" + }, + "alwaysOnline": { + "minLength": 1, + "description": "The \"alwaysOnline\" cannot be empty" + }, + "readMessages": { + "minLength": 1, + "description": "The \"readMessages\" cannot be empty" + }, + "readStatus": { + "minLength": 1, + "description": "The \"readStatus\" cannot be empty" + }, + "syncFullHistory": { + "minLength": 1, + "description": "The \"syncFullHistory\" cannot be empty" + } + } + } + } + } } }, + "x-validation-schema": "settingsSchema", "x-source": "src/api/routes/settings.router.ts" } }, { - "method": "post", - "path": "/settings/set/{instanceName}", - "source": "src/api/routes/settings.router.ts", - "operation": { - "tags": [ - "Instance settings" - ], - "summary": "Update set", - "description": "Update set for Instance settings.", - "operationId": "post_settings_set", - "parameters": [ - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" + "method": "get", + "path": "/sqs/find/{instanceName}", + "source": "src/api/integrations/event/sqs/sqs.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] } - } - ], - "responses": { - "200": { - "description": "Successful response." }, - "400": { - "description": "Invalid request." + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } }, - "401": { - "description": "Missing or invalid API key." + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } }, - "404": { - "description": "Instance or resource not found." + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" } }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": true - }, - "example": {} - } + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] } }, - "x-source": "src/api/routes/settings.router.ts" - } - }, - { - "method": "get", - "path": "/sqs/find/{instanceName}", - "source": "src/api/integrations/event/sqs/sqs.router.ts", + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, "operation": { "tags": [ "SQS" @@ -8359,18 +79010,256 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, + "x-validation-schema": "instanceSchema", "x-source": "src/api/integrations/event/sqs/sqs.router.ts" } }, @@ -8378,6 +79267,104 @@ "method": "post", "path": "/sqs/set/{instanceName}", "source": "src/api/integrations/event/sqs/sqs.router.ts", + "schemaName": "eventSchema", + "schema": { + "type": "object", + "properties": { + "websocket": { + "$ref": "#/$defs/event" + }, + "rabbitmq": { + "$ref": "#/$defs/event" + }, + "nats": { + "$ref": "#/$defs/event" + }, + "sqs": { + "$ref": "#/$defs/event" + }, + "kafka": { + "$ref": "#/$defs/event" + } + }, + "$defs": { + "event": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "events": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "CONTACTS_SET", + "CONTACTS_UPSERT", + "CONTACTS_UPDATE", + "PRESENCE_UPDATE", + "CHATS_SET", + "CHATS_UPSERT", + "CHATS_UPDATE", + "CHATS_DELETE", + "GROUPS_UPSERT", + "GROUPS_UPDATE", + "GROUP_PARTICIPANTS_UPDATE", + "CONNECTION_UPDATE", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS", + "REMOVE_INSTANCE", + "LOGOUT_INSTANCE", + "INSTANCE_CREATE", + "INSTANCE_DELETE", + "STATUS_INSTANCE", + "CREDS_UPDATE", + "MESSAGING_HISTORY_SET", + "MESSAGING_HISTORY_STATUS", + "LID_MAPPING_UPDATE", + "MESSAGES_MEDIA_UPDATE", + "MESSAGES_REACTION", + "MESSAGE_RECEIPT_UPDATE", + "GROUP_JOIN_REQUEST", + "GROUP_MEMBER_TAG_UPDATE", + "BLOCKLIST_SET", + "BLOCKLIST_UPDATE", + "NEWSLETTER_REACTION", + "NEWSLETTER_VIEW", + "NEWSLETTER_PARTICIPANTS_UPDATE", + "NEWSLETTER_SETTINGS_UPDATE", + "MESSAGE_CAPPING_UPDATE", + "CHATS_LOCK", + "SETTINGS_UPDATE" + ] + } + } + }, + "required": [ + "enabled" + ] + } + } + }, + "multipart": false, + "runtimeStatus": "CREATED", "operation": { "tags": [ "SQS" @@ -8397,17 +79384,254 @@ } ], "responses": { - "200": { - "description": "Successful response." + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -8416,12 +79640,103 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "websocket": { + "$ref": "#/$defs/event" + }, + "rabbitmq": { + "$ref": "#/$defs/event" + }, + "nats": { + "$ref": "#/$defs/event" + }, + "sqs": { + "$ref": "#/$defs/event" + }, + "kafka": { + "$ref": "#/$defs/event" + } + }, + "$defs": { + "event": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "events": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "CONTACTS_SET", + "CONTACTS_UPSERT", + "CONTACTS_UPDATE", + "PRESENCE_UPDATE", + "CHATS_SET", + "CHATS_UPSERT", + "CHATS_UPDATE", + "CHATS_DELETE", + "GROUPS_UPSERT", + "GROUPS_UPDATE", + "GROUP_PARTICIPANTS_UPDATE", + "CONNECTION_UPDATE", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS", + "REMOVE_INSTANCE", + "LOGOUT_INSTANCE", + "INSTANCE_CREATE", + "INSTANCE_DELETE", + "STATUS_INSTANCE", + "CREDS_UPDATE", + "MESSAGING_HISTORY_SET", + "MESSAGING_HISTORY_STATUS", + "LID_MAPPING_UPDATE", + "MESSAGES_MEDIA_UPDATE", + "MESSAGES_REACTION", + "MESSAGE_RECEIPT_UPDATE", + "GROUP_JOIN_REQUEST", + "GROUP_MEMBER_TAG_UPDATE", + "BLOCKLIST_SET", + "BLOCKLIST_UPDATE", + "NEWSLETTER_REACTION", + "NEWSLETTER_VIEW", + "NEWSLETTER_PARTICIPANTS_UPDATE", + "NEWSLETTER_SETTINGS_UPDATE", + "MESSAGE_CAPPING_UPDATE", + "CHATS_LOCK", + "SETTINGS_UPDATE" + ] + } + } + }, + "required": [ + "enabled" + ] + } + } + } } } }, + "x-validation-schema": "eventSchema", "x-source": "src/api/integrations/event/sqs/sqs.router.ts" } }, @@ -8429,6 +79744,73 @@ "method": "post", "path": "/template/create/{instanceName}", "source": "src/api/routes/template.router.ts", + "schemaName": "templateSchema", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "category": { + "type": "string", + "enum": [ + "AUTHENTICATION", + "MARKETING", + "UTILITY" + ] + }, + "allowCategoryChange": { + "type": "boolean" + }, + "language": { + "type": "string" + }, + "components": { + "type": "array" + }, + "webhookUrl": { + "type": "string" + } + }, + "required": [ + "name", + "category", + "language", + "components" + ], + "if": { + "propertyNames": { + "enum": [ + "name", + "category", + "language", + "components" + ] + } + }, + "then": { + "properties": { + "name": { + "minLength": 1, + "description": "The \"name\" cannot be empty" + }, + "category": { + "minLength": 1, + "description": "The \"category\" cannot be empty" + }, + "language": { + "minLength": 1, + "description": "The \"language\" cannot be empty" + }, + "components": { + "minLength": 1, + "description": "The \"components\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "CREATED", "operation": { "tags": [ "WhatsApp templates" @@ -8449,16 +79831,253 @@ ], "responses": { "201": { - "description": "Successful response." + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -8467,12 +80086,72 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "name": { + "type": "string" + }, + "category": { + "type": "string", + "enum": [ + "AUTHENTICATION", + "MARKETING", + "UTILITY" + ] + }, + "allowCategoryChange": { + "type": "boolean" + }, + "language": { + "type": "string" + }, + "components": { + "type": "array" + }, + "webhookUrl": { + "type": "string" + } + }, + "required": [ + "name", + "category", + "language", + "components" + ], + "if": { + "propertyNames": { + "enum": [ + "name", + "category", + "language", + "components" + ] + } + }, + "then": { + "properties": { + "name": { + "minLength": 1, + "description": "The \"name\" cannot be empty" + }, + "category": { + "minLength": 1, + "description": "The \"category\" cannot be empty" + }, + "language": { + "minLength": 1, + "description": "The \"language\" cannot be empty" + }, + "components": { + "minLength": 1, + "description": "The \"components\" cannot be empty" + } + } + } + } } } }, + "x-validation-schema": "templateSchema", "x-source": "src/api/routes/template.router.ts" } }, @@ -8480,6 +80159,38 @@ "method": "delete", "path": "/template/delete/{instanceName}", "source": "src/api/routes/template.router.ts", + "schemaName": "templateDeleteSchema", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "hsmId": { + "type": "string" + } + }, + "required": [ + "name" + ], + "if": { + "propertyNames": { + "enum": [ + "name" + ] + } + }, + "then": { + "properties": { + "name": { + "minLength": 1, + "description": "The \"name\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ "WhatsApp templates" @@ -8500,18 +80211,292 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "hsmId": { + "type": "string" + } + }, + "required": [ + "name" + ], + "if": { + "propertyNames": { + "enum": [ + "name" + ] + } + }, + "then": { + "properties": { + "name": { + "minLength": 1, + "description": "The \"name\" cannot be empty" + } + } + } + } + } } }, + "x-validation-schema": "templateDeleteSchema", "x-source": "src/api/routes/template.router.ts" } }, @@ -8519,6 +80504,52 @@ "method": "post", "path": "/template/edit/{instanceName}", "source": "src/api/routes/template.router.ts", + "schemaName": "templateEditSchema", + "schema": { + "type": "object", + "properties": { + "templateId": { + "type": "string" + }, + "category": { + "type": "string", + "enum": [ + "AUTHENTICATION", + "MARKETING", + "UTILITY" + ] + }, + "allowCategoryChange": { + "type": "boolean" + }, + "ttl": { + "type": "number" + }, + "components": { + "type": "array" + } + }, + "required": [ + "templateId" + ], + "if": { + "propertyNames": { + "enum": [ + "templateId" + ] + } + }, + "then": { + "properties": { + "templateId": { + "minLength": 1, + "description": "The \"templateId\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ "WhatsApp templates" @@ -8539,16 +80570,253 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -8557,12 +80825,51 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "templateId": { + "type": "string" + }, + "category": { + "type": "string", + "enum": [ + "AUTHENTICATION", + "MARKETING", + "UTILITY" + ] + }, + "allowCategoryChange": { + "type": "boolean" + }, + "ttl": { + "type": "number" + }, + "components": { + "type": "array" + } + }, + "required": [ + "templateId" + ], + "if": { + "propertyNames": { + "enum": [ + "templateId" + ] + } + }, + "then": { + "properties": { + "templateId": { + "minLength": 1, + "description": "The \"templateId\" cannot be empty" + } + } + } + } } } }, + "x-validation-schema": "templateEditSchema", "x-source": "src/api/routes/template.router.ts" } }, @@ -8570,6 +80877,283 @@ "method": "get", "path": "/template/find/{instanceName}", "source": "src/api/routes/template.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ "WhatsApp templates" @@ -8590,18 +81174,256 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, + "x-validation-schema": "instanceSchema", "x-source": "src/api/routes/template.router.ts" } }, @@ -8609,6 +81431,50 @@ "method": "post", "path": "/typebot/changeStatus/{instanceName}", "source": "src/api/integrations/chatbot/typebot/routes/typebot.router.ts", + "schemaName": "typebotStatusSchema", + "schema": { + "type": "object", + "properties": { + "remoteJid": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "opened", + "closed", + "paused", + "delete" + ] + } + }, + "required": [ + "remoteJid", + "status" + ], + "if": { + "propertyNames": { + "enum": [ + "remoteJid", + "status" + ] + } + }, + "then": { + "properties": { + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + }, + "status": { + "minLength": 1, + "description": "The \"status\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ "Typebot" @@ -8629,16 +81495,253 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } }, - "401": { - "description": "Missing or invalid API key." + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } }, - "404": { - "description": "Instance or resource not found." + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -8647,12 +81750,49 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "remoteJid": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "opened", + "closed", + "paused", + "delete" + ] + } + }, + "required": [ + "remoteJid", + "status" + ], + "if": { + "propertyNames": { + "enum": [ + "remoteJid", + "status" + ] + } + }, + "then": { + "properties": { + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + }, + "status": { + "minLength": 1, + "description": "The \"status\" cannot be empty" + } + } + } + } } } }, + "x-validation-schema": "typebotStatusSchema", "x-source": "src/api/integrations/chatbot/typebot/routes/typebot.router.ts" } }, @@ -8660,6 +81800,108 @@ "method": "post", "path": "/typebot/create/{instanceName}", "source": "src/api/integrations/chatbot/typebot/routes/typebot.router.ts", + "schemaName": "typebotSchema", + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "url": { + "type": "string" + }, + "typebot": { + "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" + }, + "ignoreJids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "enabled", + "url", + "typebot", + "triggerType" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "url", + "typebot", + "triggerType" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "url": { + "minLength": 1, + "description": "The \"url\" cannot be empty" + }, + "typebot": { + "minLength": 1, + "description": "The \"typebot\" cannot be empty" + }, + "triggerType": { + "minLength": 1, + "description": "The \"triggerType\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "CREATED", "operation": { "tags": [ "Typebot" @@ -8680,16 +81922,253 @@ ], "responses": { "201": { - "description": "Successful response." + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -8698,12 +82177,107 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "enabled": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "url": { + "type": "string" + }, + "typebot": { + "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" + }, + "ignoreJids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "enabled", + "url", + "typebot", + "triggerType" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "url", + "typebot", + "triggerType" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "url": { + "minLength": 1, + "description": "The \"url\" cannot be empty" + }, + "typebot": { + "minLength": 1, + "description": "The \"typebot\" cannot be empty" + }, + "triggerType": { + "minLength": 1, + "description": "The \"triggerType\" cannot be empty" + } + } + } + } } } }, + "x-validation-schema": "typebotSchema", "x-source": "src/api/integrations/chatbot/typebot/routes/typebot.router.ts" } }, @@ -8711,6 +82285,283 @@ "method": "delete", "path": "/typebot/delete/{typebotId}/{instanceName}", "source": "src/api/integrations/chatbot/typebot/routes/typebot.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ "Typebot" @@ -8737,21 +82588,540 @@ "type": "string" } } - ], - "responses": { - "200": { - "description": "Successful response." - }, - "400": { - "description": "Invalid request." - }, - "401": { - "description": "Missing or invalid API key." - }, - "404": { - "description": "Instance or resource not found." - } + ], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + } + } + } }, + "x-validation-schema": "instanceSchema", "x-source": "src/api/integrations/chatbot/typebot/routes/typebot.router.ts" } }, @@ -8759,6 +83129,283 @@ "method": "get", "path": "/typebot/fetch/{typebotId}/{instanceName}", "source": "src/api/integrations/chatbot/typebot/routes/typebot.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ "Typebot" @@ -8788,18 +83435,256 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, + "x-validation-schema": "instanceSchema", "x-source": "src/api/integrations/chatbot/typebot/routes/typebot.router.ts" } }, @@ -8807,6 +83692,283 @@ "method": "get", "path": "/typebot/fetchSessions/{typebotId}/{instanceName}", "source": "src/api/integrations/chatbot/typebot/routes/typebot.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ "Typebot" @@ -8836,18 +83998,256 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, + "x-validation-schema": "instanceSchema", "x-source": "src/api/integrations/chatbot/typebot/routes/typebot.router.ts" } }, @@ -8855,6 +84255,283 @@ "method": "get", "path": "/typebot/fetchSettings/{instanceName}", "source": "src/api/integrations/chatbot/typebot/routes/typebot.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ "Typebot" @@ -8875,25 +84552,540 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } + } + }, + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/chatbot/typebot/routes/typebot.router.ts" + } + }, + { + "method": "get", + "path": "/typebot/find/{instanceName}", + "source": "src/api/integrations/chatbot/typebot/routes/typebot.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] } }, - "x-source": "src/api/integrations/chatbot/typebot/routes/typebot.router.ts" - } - }, - { - "method": "get", - "path": "/typebot/find/{instanceName}", - "source": "src/api/integrations/chatbot/typebot/routes/typebot.router.ts", + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ "Typebot" @@ -8914,18 +85106,256 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, + "x-validation-schema": "instanceSchema", "x-source": "src/api/integrations/chatbot/typebot/routes/typebot.router.ts" } }, @@ -8933,6 +85363,48 @@ "method": "post", "path": "/typebot/ignoreJid/{instanceName}", "source": "src/api/integrations/chatbot/typebot/routes/typebot.router.ts", + "schemaName": "typebotIgnoreJidSchema", + "schema": { + "type": "object", + "properties": { + "remoteJid": { + "type": "string" + }, + "action": { + "type": "string", + "enum": [ + "add", + "remove" + ] + } + }, + "required": [ + "remoteJid", + "action" + ], + "if": { + "propertyNames": { + "enum": [ + "remoteJid", + "action" + ] + } + }, + "then": { + "properties": { + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + }, + "action": { + "minLength": 1, + "description": "The \"action\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ "Typebot" @@ -8953,16 +85425,253 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -8971,12 +85680,47 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "remoteJid": { + "type": "string" + }, + "action": { + "type": "string", + "enum": [ + "add", + "remove" + ] + } + }, + "required": [ + "remoteJid", + "action" + ], + "if": { + "propertyNames": { + "enum": [ + "remoteJid", + "action" + ] + } + }, + "then": { + "properties": { + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + }, + "action": { + "minLength": 1, + "description": "The \"action\" cannot be empty" + } + } + } + } } } }, + "x-validation-schema": "typebotIgnoreJidSchema", "x-source": "src/api/integrations/chatbot/typebot/routes/typebot.router.ts" } }, @@ -8984,6 +85728,95 @@ "method": "post", "path": "/typebot/settings/{instanceName}", "source": "src/api/integrations/chatbot/typebot/routes/typebot.router.ts", + "schemaName": "typebotSettingSchema", + "schema": { + "type": "object", + "properties": { + "expire": { + "type": "integer" + }, + "keywordFinish": { + "type": "string" + }, + "delayMessage": { + "type": "integer" + }, + "unknownMessage": { + "type": "string" + }, + "listeningFromMe": { + "type": "boolean" + }, + "stopBotFromMe": { + "type": "boolean" + }, + "keepOpen": { + "type": "boolean" + }, + "debounceTime": { + "type": "integer" + }, + "typebotIdFallback": { + "type": "string" + }, + "ignoreJids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "expire", + "keywordFinish", + "delayMessage", + "unknownMessage", + "listeningFromMe", + "stopBotFromMe" + ], + "if": { + "propertyNames": { + "enum": [ + "expire", + "keywordFinish", + "delayMessage", + "unknownMessage", + "listeningFromMe", + "stopBotFromMe" + ] + } + }, + "then": { + "properties": { + "expire": { + "minLength": 1, + "description": "The \"expire\" cannot be empty" + }, + "keywordFinish": { + "minLength": 1, + "description": "The \"keywordFinish\" cannot be empty" + }, + "delayMessage": { + "minLength": 1, + "description": "The \"delayMessage\" cannot be empty" + }, + "unknownMessage": { + "minLength": 1, + "description": "The \"unknownMessage\" cannot be empty" + }, + "listeningFromMe": { + "minLength": 1, + "description": "The \"listeningFromMe\" cannot be empty" + }, + "stopBotFromMe": { + "minLength": 1, + "description": "The \"stopBotFromMe\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ "Typebot" @@ -9004,16 +85837,253 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -9022,12 +86092,94 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "expire": { + "type": "integer" + }, + "keywordFinish": { + "type": "string" + }, + "delayMessage": { + "type": "integer" + }, + "unknownMessage": { + "type": "string" + }, + "listeningFromMe": { + "type": "boolean" + }, + "stopBotFromMe": { + "type": "boolean" + }, + "keepOpen": { + "type": "boolean" + }, + "debounceTime": { + "type": "integer" + }, + "typebotIdFallback": { + "type": "string" + }, + "ignoreJids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "expire", + "keywordFinish", + "delayMessage", + "unknownMessage", + "listeningFromMe", + "stopBotFromMe" + ], + "if": { + "propertyNames": { + "enum": [ + "expire", + "keywordFinish", + "delayMessage", + "unknownMessage", + "listeningFromMe", + "stopBotFromMe" + ] + } + }, + "then": { + "properties": { + "expire": { + "minLength": 1, + "description": "The \"expire\" cannot be empty" + }, + "keywordFinish": { + "minLength": 1, + "description": "The \"keywordFinish\" cannot be empty" + }, + "delayMessage": { + "minLength": 1, + "description": "The \"delayMessage\" cannot be empty" + }, + "unknownMessage": { + "minLength": 1, + "description": "The \"unknownMessage\" cannot be empty" + }, + "listeningFromMe": { + "minLength": 1, + "description": "The \"listeningFromMe\" cannot be empty" + }, + "stopBotFromMe": { + "minLength": 1, + "description": "The \"stopBotFromMe\" cannot be empty" + } + } + } + } } } }, + "x-validation-schema": "typebotSettingSchema", "x-source": "src/api/integrations/chatbot/typebot/routes/typebot.router.ts" } }, @@ -9035,6 +86187,53 @@ "method": "post", "path": "/typebot/start/{instanceName}", "source": "src/api/integrations/chatbot/typebot/routes/typebot.router.ts", + "schemaName": "typebotStartSchema", + "schema": { + "type": "object", + "properties": { + "remoteJid": { + "type": "string" + }, + "url": { + "type": "string" + }, + "typebot": { + "type": "string" + } + }, + "required": [ + "remoteJid", + "url", + "typebot" + ], + "if": { + "propertyNames": { + "enum": [ + "remoteJid", + "url", + "typebot" + ] + } + }, + "then": { + "properties": { + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + }, + "url": { + "minLength": 1, + "description": "The \"url\" cannot be empty" + }, + "typebot": { + "minLength": 1, + "description": "The \"typebot\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ "Typebot" @@ -9055,16 +86254,253 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } }, - "404": { - "description": "Instance or resource not found." + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -9073,12 +86509,52 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "remoteJid": { + "type": "string" + }, + "url": { + "type": "string" + }, + "typebot": { + "type": "string" + } + }, + "required": [ + "remoteJid", + "url", + "typebot" + ], + "if": { + "propertyNames": { + "enum": [ + "remoteJid", + "url", + "typebot" + ] + } + }, + "then": { + "properties": { + "remoteJid": { + "minLength": 1, + "description": "The \"remoteJid\" cannot be empty" + }, + "url": { + "minLength": 1, + "description": "The \"url\" cannot be empty" + }, + "typebot": { + "minLength": 1, + "description": "The \"typebot\" cannot be empty" + } + } + } + } } } }, + "x-validation-schema": "typebotStartSchema", "x-source": "src/api/integrations/chatbot/typebot/routes/typebot.router.ts" } }, @@ -9086,6 +86562,108 @@ "method": "put", "path": "/typebot/update/{typebotId}/{instanceName}", "source": "src/api/integrations/chatbot/typebot/routes/typebot.router.ts", + "schemaName": "typebotSchema", + "schema": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "url": { + "type": "string" + }, + "typebot": { + "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" + }, + "ignoreJids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "enabled", + "url", + "typebot", + "triggerType" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "url", + "typebot", + "triggerType" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "url": { + "minLength": 1, + "description": "The \"url\" cannot be empty" + }, + "typebot": { + "minLength": 1, + "description": "The \"typebot\" cannot be empty" + }, + "triggerType": { + "minLength": 1, + "description": "The \"triggerType\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", "operation": { "tags": [ "Typebot" @@ -9115,16 +86693,253 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -9133,12 +86948,107 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "enabled": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "url": { + "type": "string" + }, + "typebot": { + "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" + }, + "ignoreJids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "enabled", + "url", + "typebot", + "triggerType" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "url", + "typebot", + "triggerType" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "url": { + "minLength": 1, + "description": "The \"url\" cannot be empty" + }, + "typebot": { + "minLength": 1, + "description": "The \"typebot\" cannot be empty" + }, + "triggerType": { + "minLength": 1, + "description": "The \"triggerType\" cannot be empty" + } + } + } + } } } }, + "x-validation-schema": "typebotSchema", "x-source": "src/api/integrations/chatbot/typebot/routes/typebot.router.ts" } }, @@ -9146,6 +87056,8 @@ "method": "post", "path": "/webhook/evolution", "source": "src/api/integrations/channel/evolution/evolution.router.ts", + "multipart": false, + "runtimeStatus": "200", "operation": { "tags": [ "Webhooks" @@ -9156,16 +87068,253 @@ "parameters": [], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -9174,58 +87323,861 @@ "application/json": { "schema": { "type": "object", + "required": [ + "numberId" + ], + "properties": { + "numberId": { + "type": "string" + } + }, "additionalProperties": true }, - "example": {} + "example": { + "numberId": "15551234567", + "event": "messages.upsert", + "data": {} + } + } + } + }, + "x-source": "src/api/integrations/channel/evolution/evolution.router.ts" + } + }, + { + "method": "get", + "path": "/webhook/find-all/{instanceName}", + "source": "src/api/integrations/event/webhook/webhook.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, + "runtimeStatus": "OK", + "operation": { + "tags": [ + "Webhooks" + ], + "summary": "Get find all", + "description": "Get find all for Webhooks.", + "operationId": "get_webhook_find_all", + "parameters": [ + { + "name": "instanceName", + "in": "path", + "required": true, + "description": "Evolution API instance name.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } + }, + "400": { + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } } } }, - "x-source": "src/api/integrations/channel/evolution/evolution.router.ts" + "x-validation-schema": "instanceSchema", + "x-source": "src/api/integrations/event/webhook/webhook.router.ts" } }, { "method": "get", - "path": "/webhook/find-all/{instanceName}", + "path": "/webhook/find/{instanceName}", "source": "src/api/integrations/event/webhook/webhook.router.ts", - "operation": { - "tags": [ - "Webhooks" - ], - "summary": "Get find all", - "description": "Get find all for Webhooks.", - "operationId": "get_webhook_find_all", - "parameters": [ - { - "name": "instanceName", - "in": "path", - "required": true, - "description": "Evolution API instance name.", - "schema": { - "type": "string" + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] } - } - ], - "responses": { - "200": { - "description": "Successful response." }, - "400": { - "description": "Invalid request." + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } }, - "401": { - "description": "Missing or invalid API key." + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } }, - "404": { - "description": "Instance or resource not found." + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" } }, - "x-source": "src/api/integrations/event/webhook/webhook.router.ts" - } - }, - { - "method": "get", - "path": "/webhook/find/{instanceName}", - "source": "src/api/integrations/event/webhook/webhook.router.ts", + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, "operation": { "tags": [ "Webhooks" @@ -9246,18 +88198,256 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, + "x-validation-schema": "instanceSchema", "x-source": "src/api/integrations/event/webhook/webhook.router.ts" } }, @@ -9265,6 +88455,7 @@ "method": "get", "path": "/webhook/meta", "source": "src/api/integrations/channel/meta/meta.router.ts", + "multipart": false, "operation": { "tags": [ "Webhooks" @@ -9275,16 +88466,253 @@ "parameters": [], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "x-source": "src/api/integrations/channel/meta/meta.router.ts" @@ -9294,6 +88722,8 @@ "method": "post", "path": "/webhook/meta", "source": "src/api/integrations/channel/meta/meta.router.ts", + "multipart": false, + "runtimeStatus": "200", "operation": { "tags": [ "Webhooks" @@ -9304,16 +88734,253 @@ "parameters": [], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -9322,9 +88989,31 @@ "application/json": { "schema": { "type": "object", + "required": [ + "object", + "entry" + ], + "properties": { + "object": { + "type": "string", + "enum": [ + "whatsapp_business_account" + ] + }, + "entry": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + } + }, "additionalProperties": true }, - "example": {} + "example": { + "object": "whatsapp_business_account", + "entry": [] + } } } }, @@ -9335,6 +89024,128 @@ "method": "post", "path": "/webhook/set-many/{instanceName}", "source": "src/api/integrations/event/webhook/webhook.router.ts", + "schemaName": "webhooksSchema", + "schema": { + "type": "object", + "properties": { + "webhooks": { + "type": "array", + "minItems": 1, + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "minLength": 1, + "maxLength": 100 + }, + "enabled": { + "type": "boolean" + }, + "url": { + "type": "string" + }, + "headers": { + "type": "object" + }, + "byEvents": { + "type": "boolean" + }, + "base64": { + "type": "boolean" + }, + "events": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "CONTACTS_SET", + "CONTACTS_UPSERT", + "CONTACTS_UPDATE", + "PRESENCE_UPDATE", + "CHATS_SET", + "CHATS_UPSERT", + "CHATS_UPDATE", + "CHATS_DELETE", + "GROUPS_UPSERT", + "GROUPS_UPDATE", + "GROUP_PARTICIPANTS_UPDATE", + "CONNECTION_UPDATE", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS", + "REMOVE_INSTANCE", + "LOGOUT_INSTANCE", + "INSTANCE_CREATE", + "INSTANCE_DELETE", + "STATUS_INSTANCE", + "CREDS_UPDATE", + "MESSAGING_HISTORY_SET", + "MESSAGING_HISTORY_STATUS", + "LID_MAPPING_UPDATE", + "MESSAGES_MEDIA_UPDATE", + "MESSAGES_REACTION", + "MESSAGE_RECEIPT_UPDATE", + "GROUP_JOIN_REQUEST", + "GROUP_MEMBER_TAG_UPDATE", + "BLOCKLIST_SET", + "BLOCKLIST_UPDATE", + "NEWSLETTER_REACTION", + "NEWSLETTER_VIEW", + "NEWSLETTER_PARTICIPANTS_UPDATE", + "NEWSLETTER_SETTINGS_UPDATE", + "MESSAGE_CAPPING_UPDATE", + "CHATS_LOCK", + "SETTINGS_UPDATE" + ] + } + } + }, + "required": [ + "enabled", + "url" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "url" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "url": { + "minLength": 1, + "description": "The \"url\" cannot be empty" + } + } + } + } + } + }, + "required": [ + "webhooks" + ] + }, + "multipart": false, + "runtimeStatus": "CREATED", "operation": { "tags": [ "Webhooks" @@ -9354,17 +89165,254 @@ } ], "responses": { - "200": { - "description": "Successful response." + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } + }, + "401": { + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } + }, + "404": { + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } }, - "401": { - "description": "Missing or invalid API key." + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } }, - "404": { - "description": "Instance or resource not found." + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -9373,12 +89421,127 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "webhooks": { + "type": "array", + "minItems": 1, + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "minLength": 1, + "maxLength": 100 + }, + "enabled": { + "type": "boolean" + }, + "url": { + "type": "string" + }, + "headers": { + "type": "object" + }, + "byEvents": { + "type": "boolean" + }, + "base64": { + "type": "boolean" + }, + "events": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "CONTACTS_SET", + "CONTACTS_UPSERT", + "CONTACTS_UPDATE", + "PRESENCE_UPDATE", + "CHATS_SET", + "CHATS_UPSERT", + "CHATS_UPDATE", + "CHATS_DELETE", + "GROUPS_UPSERT", + "GROUPS_UPDATE", + "GROUP_PARTICIPANTS_UPDATE", + "CONNECTION_UPDATE", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS", + "REMOVE_INSTANCE", + "LOGOUT_INSTANCE", + "INSTANCE_CREATE", + "INSTANCE_DELETE", + "STATUS_INSTANCE", + "CREDS_UPDATE", + "MESSAGING_HISTORY_SET", + "MESSAGING_HISTORY_STATUS", + "LID_MAPPING_UPDATE", + "MESSAGES_MEDIA_UPDATE", + "MESSAGES_REACTION", + "MESSAGE_RECEIPT_UPDATE", + "GROUP_JOIN_REQUEST", + "GROUP_MEMBER_TAG_UPDATE", + "BLOCKLIST_SET", + "BLOCKLIST_UPDATE", + "NEWSLETTER_REACTION", + "NEWSLETTER_VIEW", + "NEWSLETTER_PARTICIPANTS_UPDATE", + "NEWSLETTER_SETTINGS_UPDATE", + "MESSAGE_CAPPING_UPDATE", + "CHATS_LOCK", + "SETTINGS_UPDATE" + ] + } + } + }, + "required": [ + "enabled", + "url" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "url" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "url": { + "minLength": 1, + "description": "The \"url\" cannot be empty" + } + } + } + } + } + }, + "required": [ + "webhooks" + ] + } } } }, + "x-validation-schema": "webhooksSchema", "x-source": "src/api/integrations/event/webhook/webhook.router.ts" } }, @@ -9386,6 +89549,124 @@ "method": "post", "path": "/webhook/set/{instanceName}", "source": "src/api/integrations/event/webhook/webhook.router.ts", + "schemaName": "webhookSchema", + "schema": { + "type": "object", + "properties": { + "webhook": { + "type": "object", + "properties": { + "name": { + "type": "string", + "minLength": 1, + "maxLength": 100 + }, + "enabled": { + "type": "boolean" + }, + "url": { + "type": "string" + }, + "headers": { + "type": "object" + }, + "byEvents": { + "type": "boolean" + }, + "base64": { + "type": "boolean" + }, + "events": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "CONTACTS_SET", + "CONTACTS_UPSERT", + "CONTACTS_UPDATE", + "PRESENCE_UPDATE", + "CHATS_SET", + "CHATS_UPSERT", + "CHATS_UPDATE", + "CHATS_DELETE", + "GROUPS_UPSERT", + "GROUPS_UPDATE", + "GROUP_PARTICIPANTS_UPDATE", + "CONNECTION_UPDATE", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS", + "REMOVE_INSTANCE", + "LOGOUT_INSTANCE", + "INSTANCE_CREATE", + "INSTANCE_DELETE", + "STATUS_INSTANCE", + "CREDS_UPDATE", + "MESSAGING_HISTORY_SET", + "MESSAGING_HISTORY_STATUS", + "LID_MAPPING_UPDATE", + "MESSAGES_MEDIA_UPDATE", + "MESSAGES_REACTION", + "MESSAGE_RECEIPT_UPDATE", + "GROUP_JOIN_REQUEST", + "GROUP_MEMBER_TAG_UPDATE", + "BLOCKLIST_SET", + "BLOCKLIST_UPDATE", + "NEWSLETTER_REACTION", + "NEWSLETTER_VIEW", + "NEWSLETTER_PARTICIPANTS_UPDATE", + "NEWSLETTER_SETTINGS_UPDATE", + "MESSAGE_CAPPING_UPDATE", + "CHATS_LOCK", + "SETTINGS_UPDATE" + ] + } + } + }, + "required": [ + "enabled", + "url" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "url" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "url": { + "minLength": 1, + "description": "The \"url\" cannot be empty" + } + } + } + } + }, + "required": [ + "webhook" + ] + }, + "multipart": false, + "runtimeStatus": "CREATED", "operation": { "tags": [ "Webhooks" @@ -9405,17 +89686,254 @@ } ], "responses": { - "200": { - "description": "Successful response." + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -9424,12 +89942,123 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "webhook": { + "type": "object", + "properties": { + "name": { + "type": "string", + "minLength": 1, + "maxLength": 100 + }, + "enabled": { + "type": "boolean" + }, + "url": { + "type": "string" + }, + "headers": { + "type": "object" + }, + "byEvents": { + "type": "boolean" + }, + "base64": { + "type": "boolean" + }, + "events": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "CONTACTS_SET", + "CONTACTS_UPSERT", + "CONTACTS_UPDATE", + "PRESENCE_UPDATE", + "CHATS_SET", + "CHATS_UPSERT", + "CHATS_UPDATE", + "CHATS_DELETE", + "GROUPS_UPSERT", + "GROUPS_UPDATE", + "GROUP_PARTICIPANTS_UPDATE", + "CONNECTION_UPDATE", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS", + "REMOVE_INSTANCE", + "LOGOUT_INSTANCE", + "INSTANCE_CREATE", + "INSTANCE_DELETE", + "STATUS_INSTANCE", + "CREDS_UPDATE", + "MESSAGING_HISTORY_SET", + "MESSAGING_HISTORY_STATUS", + "LID_MAPPING_UPDATE", + "MESSAGES_MEDIA_UPDATE", + "MESSAGES_REACTION", + "MESSAGE_RECEIPT_UPDATE", + "GROUP_JOIN_REQUEST", + "GROUP_MEMBER_TAG_UPDATE", + "BLOCKLIST_SET", + "BLOCKLIST_UPDATE", + "NEWSLETTER_REACTION", + "NEWSLETTER_VIEW", + "NEWSLETTER_PARTICIPANTS_UPDATE", + "NEWSLETTER_SETTINGS_UPDATE", + "MESSAGE_CAPPING_UPDATE", + "CHATS_LOCK", + "SETTINGS_UPDATE" + ] + } + } + }, + "required": [ + "enabled", + "url" + ], + "if": { + "propertyNames": { + "enum": [ + "enabled", + "url" + ] + } + }, + "then": { + "properties": { + "enabled": { + "minLength": 1, + "description": "The \"enabled\" cannot be empty" + }, + "url": { + "minLength": 1, + "description": "The \"url\" cannot be empty" + } + } + } + } + }, + "required": [ + "webhook" + ] + } } } }, + "x-validation-schema": "webhookSchema", "x-source": "src/api/integrations/event/webhook/webhook.router.ts" } }, @@ -9437,6 +90066,282 @@ "method": "get", "path": "/websocket/find/{instanceName}", "source": "src/api/integrations/event/websocket/websocket.router.ts", + "schemaName": "instanceSchema", + "schema": { + "type": "object", + "properties": { + "instanceName": { + "type": "string" + }, + "token": { + "type": "string" + }, + "number": { + "type": "string", + "pattern": "^\\d+[\\.@\\w-]+" + }, + "businessId": { + "type": "string" + }, + "qrcode": { + "type": "boolean" + }, + "Integration": { + "type": "string", + "enum": [ + "WHATSAPP-BUSINESS", + "WHATSAPP-BAILEYS", + "EVOLUTION" + ] + }, + "rejectCall": { + "type": "boolean" + }, + "msgCall": { + "type": "string" + }, + "groupsIgnore": { + "type": "boolean" + }, + "alwaysOnline": { + "type": "boolean" + }, + "readMessages": { + "type": "boolean" + }, + "readStatus": { + "type": "boolean" + }, + "syncFullHistory": { + "type": "boolean" + }, + "wavoipToken": { + "type": "string" + }, + "proxyHost": { + "type": "string" + }, + "proxyPort": { + "type": "string" + }, + "proxyProtocol": { + "type": "string" + }, + "proxyUsername": { + "type": "string" + }, + "proxyPassword": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "webhookByEvents": { + "type": "boolean" + }, + "webhookBase64": { + "type": "boolean" + }, + "webhookEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "rabbitmqEnabled": { + "type": "boolean" + }, + "rabbitmqEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "natsEnabled": { + "type": "boolean" + }, + "natsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "sqsEnabled": { + "type": "boolean" + }, + "sqsEvents": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "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", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS" + ] + } + }, + "chatwootAccountId": { + "type": "string" + }, + "chatwootToken": { + "type": "string" + }, + "chatwootUrl": { + "type": "string" + }, + "chatwootSignMsg": { + "type": "boolean" + }, + "chatwootReopenConversation": { + "type": "boolean" + }, + "chatwootConversationPending": { + "type": "boolean" + }, + "chatwootImportContacts": { + "type": "boolean" + }, + "chatwootNameInbox": { + "type": "string" + }, + "chatwootMergeBrazilContacts": { + "type": "boolean" + }, + "chatwootImportMessages": { + "type": "boolean" + }, + "chatwootDaysLimitImportMessages": { + "type": "number" + } + }, + "if": { + "propertyNames": { + "enum": [ + "instanceName" + ] + } + }, + "then": { + "properties": { + "instanceName": { + "minLength": 1, + "description": "The \"instanceName\" cannot be empty" + } + } + } + }, + "multipart": false, "operation": { "tags": [ "WebSocket" @@ -9457,18 +90362,256 @@ ], "responses": { "200": { - "description": "Successful response." + "description": "Successful response. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, + "x-validation-schema": "instanceSchema", "x-source": "src/api/integrations/event/websocket/websocket.router.ts" } }, @@ -9476,6 +90619,104 @@ "method": "post", "path": "/websocket/set/{instanceName}", "source": "src/api/integrations/event/websocket/websocket.router.ts", + "schemaName": "eventSchema", + "schema": { + "type": "object", + "properties": { + "websocket": { + "$ref": "#/$defs/event" + }, + "rabbitmq": { + "$ref": "#/$defs/event" + }, + "nats": { + "$ref": "#/$defs/event" + }, + "sqs": { + "$ref": "#/$defs/event" + }, + "kafka": { + "$ref": "#/$defs/event" + } + }, + "$defs": { + "event": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "events": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "CONTACTS_SET", + "CONTACTS_UPSERT", + "CONTACTS_UPDATE", + "PRESENCE_UPDATE", + "CHATS_SET", + "CHATS_UPSERT", + "CHATS_UPDATE", + "CHATS_DELETE", + "GROUPS_UPSERT", + "GROUPS_UPDATE", + "GROUP_PARTICIPANTS_UPDATE", + "CONNECTION_UPDATE", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS", + "REMOVE_INSTANCE", + "LOGOUT_INSTANCE", + "INSTANCE_CREATE", + "INSTANCE_DELETE", + "STATUS_INSTANCE", + "CREDS_UPDATE", + "MESSAGING_HISTORY_SET", + "MESSAGING_HISTORY_STATUS", + "LID_MAPPING_UPDATE", + "MESSAGES_MEDIA_UPDATE", + "MESSAGES_REACTION", + "MESSAGE_RECEIPT_UPDATE", + "GROUP_JOIN_REQUEST", + "GROUP_MEMBER_TAG_UPDATE", + "BLOCKLIST_SET", + "BLOCKLIST_UPDATE", + "NEWSLETTER_REACTION", + "NEWSLETTER_VIEW", + "NEWSLETTER_PARTICIPANTS_UPDATE", + "NEWSLETTER_SETTINGS_UPDATE", + "MESSAGE_CAPPING_UPDATE", + "CHATS_LOCK", + "SETTINGS_UPDATE" + ] + } + } + }, + "required": [ + "enabled" + ] + } + } + }, + "multipart": false, + "runtimeStatus": "CREATED", "operation": { "tags": [ "WebSocket" @@ -9495,17 +90736,254 @@ } ], "responses": { - "200": { - "description": "Successful response." + "201": { + "description": "Resource created. See the domain documentation for the operation-specific response fields.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + { + "type": "string" + } + ] + } + } + } }, "400": { - "description": "Invalid request." + "description": "Invalid request.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 400, + "error": "Bad Request", + "message": "Invalid request." + } + } + } }, "401": { - "description": "Missing or invalid API key." + "description": "Missing or invalid API key.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 401, + "error": "Unauthorized", + "message": "Missing or invalid API key." + } + } + } }, "404": { - "description": "Instance or resource not found." + "description": "Instance or resource not found.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 404, + "error": "Not Found", + "message": "Resource not found." + } + } + } + }, + "422": { + "description": "Request validation failed.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 422, + "error": "Unprocessable Entity", + "message": [ + "A required field is missing." + ] + } + } + } + }, + "429": { + "description": "Request rate limit exceeded.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 429, + "error": "Too Many Requests", + "message": "Request rate limit exceeded." + } + } + } + }, + "500": { + "description": "Unexpected server error.", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "status": { + "type": "integer" + }, + "error": { + "type": "string" + }, + "message": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + } + }, + "example": { + "status": 500, + "error": "Internal Server Error", + "message": "Unexpected server error." + } + } + } } }, "requestBody": { @@ -9514,12 +90992,103 @@ "application/json": { "schema": { "type": "object", - "additionalProperties": true - }, - "example": {} + "properties": { + "websocket": { + "$ref": "#/$defs/event" + }, + "rabbitmq": { + "$ref": "#/$defs/event" + }, + "nats": { + "$ref": "#/$defs/event" + }, + "sqs": { + "$ref": "#/$defs/event" + }, + "kafka": { + "$ref": "#/$defs/event" + } + }, + "$defs": { + "event": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "enum": [ + true, + false + ] + }, + "events": { + "type": "array", + "minItems": 0, + "items": { + "type": "string", + "enum": [ + "APPLICATION_STARTUP", + "QRCODE_UPDATED", + "MESSAGES_SET", + "MESSAGES_UPSERT", + "MESSAGES_EDITED", + "MESSAGES_UPDATE", + "MESSAGES_DELETE", + "SEND_MESSAGE", + "SEND_MESSAGE_UPDATE", + "CONTACTS_SET", + "CONTACTS_UPSERT", + "CONTACTS_UPDATE", + "PRESENCE_UPDATE", + "CHATS_SET", + "CHATS_UPSERT", + "CHATS_UPDATE", + "CHATS_DELETE", + "GROUPS_UPSERT", + "GROUPS_UPDATE", + "GROUP_PARTICIPANTS_UPDATE", + "CONNECTION_UPDATE", + "LABELS_EDIT", + "LABELS_ASSOCIATION", + "CALL", + "TYPEBOT_START", + "TYPEBOT_CHANGE_STATUS", + "REMOVE_INSTANCE", + "LOGOUT_INSTANCE", + "INSTANCE_CREATE", + "INSTANCE_DELETE", + "STATUS_INSTANCE", + "CREDS_UPDATE", + "MESSAGING_HISTORY_SET", + "MESSAGING_HISTORY_STATUS", + "LID_MAPPING_UPDATE", + "MESSAGES_MEDIA_UPDATE", + "MESSAGES_REACTION", + "MESSAGE_RECEIPT_UPDATE", + "GROUP_JOIN_REQUEST", + "GROUP_MEMBER_TAG_UPDATE", + "BLOCKLIST_SET", + "BLOCKLIST_UPDATE", + "NEWSLETTER_REACTION", + "NEWSLETTER_VIEW", + "NEWSLETTER_PARTICIPANTS_UPDATE", + "NEWSLETTER_SETTINGS_UPDATE", + "MESSAGE_CAPPING_UPDATE", + "CHATS_LOCK", + "SETTINGS_UPDATE" + ] + } + } + }, + "required": [ + "enabled" + ] + } + } + } } } }, + "x-validation-schema": "eventSchema", "x-source": "src/api/integrations/event/websocket/websocket.router.ts" } } diff --git a/evolution-manager-v2 b/evolution-manager-v2 index 0866ddd6b8..eb130b4f30 160000 --- a/evolution-manager-v2 +++ b/evolution-manager-v2 @@ -1 +1 @@ -Subproject commit 0866ddd6b8c0e443647615f33053a47605aa2070 +Subproject commit eb130b4f304777cd32104c04510d2d81f260e5e1 diff --git a/manager/dist/assets/index-CEmTSE8_.js b/manager/dist/assets/index-CEmTSE8_.js deleted file mode 100644 index dfd7933a4d..0000000000 --- a/manager/dist/assets/index-CEmTSE8_.js +++ /dev/null @@ -1,593 +0,0 @@ -var rD=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var bce=rD((La,$a)=>{function LE(e,t){for(var n=0;nr[a]})}}}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 a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const o of a)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(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(a){if(a.ep)return;a.ep=!0;const o=n(a);fetch(a.href,o)}})();function md(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var mv={exports:{}},wu={},gv={exports:{}},$t={};/** - * @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 uC;function sD(){if(uC)return $t;uC=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=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"),m=Symbol.for("react.lazy"),h=Symbol.iterator;function g(A){return A===null||typeof A!="object"?null:(A=h&&A[h]||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,K,re){this.props=A,this.context=K,this.refs=w,this.updater=re||x}C.prototype.isReactComponent={},C.prototype.setState=function(A,K){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,K,"setState")},C.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function k(){}k.prototype=C.prototype;function N(A,K,re){this.props=A,this.context=K,this.refs=w,this.updater=re||x}var T=N.prototype=new k;T.constructor=N,b(T,C.prototype),T.isPureReactComponent=!0;var _=Array.isArray,P=Object.prototype.hasOwnProperty,M={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};function D(A,K,re){var ee,ie={},de=null,j=null;if(K!=null)for(ee in K.ref!==void 0&&(j=K.ref),K.key!==void 0&&(de=""+K.key),K)P.call(K,ee)&&!O.hasOwnProperty(ee)&&(ie[ee]=K[ee]);var I=arguments.length-2;if(I===1)ie.children=re;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 Ns(){}function iD(e,t){return typeof e=="function"?e(t):e}function Hy(e){return typeof e=="number"&&e>=0&&e!==1/0}function $E(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Jl(e,t){return typeof e=="function"?e(t):e}function Ks(e,t){return typeof e=="function"?e(t):e}function hC(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:o,queryKey:l,stale:u}=e;if(l){if(r){if(t.queryHash!==ox(l,t.options))return!1}else if(!Xu(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||a&&a!==t.state.fetchStatus||o&&!o(t))}function mC(e,t){const{exact:n,status:r,predicate:a,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if($i(t.options.mutationKey)!==$i(o))return!1}else if(!Xu(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function ox(e,t){return(t?.queryKeyHashFn||$i)(e)}function $i(e){return JSON.stringify(e,(t,n)=>Wy(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function Xu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Xu(e[n],t[n])):!1}function BE(e,t){if(e===t)return e;const n=gC(e)&&gC(t);if(n||Wy(e)&&Wy(t)){const r=n?e:Object.keys(e),a=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 Ky(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?BE(e,t):t}function cD(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function uD(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var zE=Symbol();function UE(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===zE?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var dD=class extends yc{#e;#t;#r;constructor(){super(),this.#r=e=>{if(!rc&&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"}},ix=new dD,fD=class extends yc{#e=!0;#t;#r;constructor(){super(),this.#r=e=>{if(!rc&&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}},Lp=new fD;function pD(e){return Math.min(1e3*2**e,3e4)}function VE(e){return(e??"online")==="online"?Lp.isOnline():!0}var qE=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function vv(e){return e instanceof qE}function HE(e){let t=!1,n=0,r=!1,a,o,l;const u=new Promise((k,N)=>{o=k,l=N}),d=k=>{r||(b(new qE(k)),e.abort?.())},f=()=>{t=!0},m=()=>{t=!1},h=()=>ix.isFocused()&&(e.networkMode==="always"||Lp.isOnline())&&e.canRun(),g=()=>VE(e.networkMode)&&e.canRun(),x=k=>{r||(r=!0,e.onSuccess?.(k),a?.(),o(k))},b=k=>{r||(r=!0,e.onError?.(k),a?.(),l(k))},w=()=>new Promise(k=>{a=N=>{(r||h())&&k(N)},e.onPause?.()}).then(()=>{a=void 0,r||e.onContinue?.()}),C=()=>{if(r)return;let k;const N=n===0?e.initialPromise:void 0;try{k=N??e.fn()}catch(T){k=Promise.reject(T)}Promise.resolve(k).then(x).catch(T=>{if(r)return;const _=e.retry??(rc?0:3),P=e.retryDelay??pD,M=typeof P=="function"?P(n,T):P,O=_===!0||typeof _=="number"&&n<_||typeof _=="function"&&_(n,T);if(t||!O){b(T);return}n++,e.onFail?.(n,T),lD(M).then(()=>h()?void 0:w()).then(()=>{t?b(T):C()})})};return{promise:u,cancel:d,continue:()=>(a?.(),u),cancelRetry:f,continueRetry:m,canStart:g,start:()=>(g()?C():w().then(C),u)}}function hD(){let e=[],t=0,n=g=>{g()},r=g=>{g()},a=g=>setTimeout(g,0);const o=g=>{a=g},l=g=>{let x;t++;try{x=g()}finally{t--,t||f()}return x},u=g=>{t?e.push(g):a(()=>{n(g)})},d=g=>(...x)=>{u(()=>{g(...x)})},f=()=>{const g=e;e=[],g.length&&a(()=>{r(()=>{g.forEach(x=>{n(x)})})})};return{batch:l,batchCalls:d,schedule:u,setNotifyFunction:g=>{n=g},setBatchNotifyFunction:g=>{r=g},setScheduler:o}}var ar=hD(),WE=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Hy(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(rc?1/0:300*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}},mD=class extends WE{#e;#t;#r;#n;#o;#a;constructor(e){super(),this.#a=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.cache,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=gD(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.#o,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const n=Ky(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(Ns).catch(Ns):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Ks(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||!$E(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.#a?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.#a=!0,n.signal)})},a=()=>{const u=UE(this.options,t),d={queryKey:this.queryKey,meta:this.meta};return r(d),this.#a=!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:a};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=>{vv(u)&&u.silent||this.#s({type:"error",error:u}),vv(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=HE({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,...KE(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 vv(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),ar.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function KE(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:VE(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function gD(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 vD=class extends yc{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,a=t.queryHash??ox(r,t);let o=this.get(a);return o||(o=new mD({cache:this,queryKey:r,queryHash:a,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(){ar.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=>hC(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>hC(e,n)):t}notify(e){ar.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ar.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ar.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},yD=class extends WE{#e;#t;#r;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||GE(),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=HE({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(r,a)=>{this.#n({type:"failed",failureCount:r,error:a})},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 a=await this.options.onMutate?.(e);a!==this.state.context&&this.#n({type:"pending",context:a,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),ar.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function GE(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var bD=class extends yc{constructor(e={}){super(),this.config=e,this.#e=new Map,this.#t=Date.now()}#e;#t;build(e,t,n){const r=new yD({mutationCache:this,mutationId:++this.#t,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){const t=Af(e),n=this.#e.get(t)??[];n.push(e),this.#e.set(t,n),this.notify({type:"added",mutation:e})}remove(e){const t=Af(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(Af(e))?.find(n=>n.state.status==="pending");return!t||t===e}runNext(e){return this.#e.get(Af(e))?.find(n=>n!==e&&n.state.isPaused)?.continue()??Promise.resolve()}clear(){ar.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=>mC(t,n))}findAll(e={}){return this.getAll().filter(t=>mC(e,t))}notify(e){ar.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return ar.batch(()=>Promise.all(e.map(t=>t.continue().catch(Ns))))}};function Af(e){return e.options.scope?.id??String(e.mutationId)}function xD(e){return{onFetch:(t,n)=>{const r=async()=>{const a=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 m=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(t.signal.aborted?f=!0:t.signal.addEventListener("abort",()=>{f=!0}),t.signal)})},h=UE(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};m(k);const N=await h(k),{maxPages:T}=t.options,_=C?uD:cD;return{pages:_(b.pages,N,T),pageParams:_(b.pageParams,w,T)}};let x;if(o&&l.length){const b=o==="backward",w=b?wD:yC,C={pages:l,pageParams:u},k=w(a,C);x=await g(C,k,b)}else{x=await g(d,u[0]??a.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 yC(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 wD(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var SD=class{#e;#t;#r;#n;#o;#a;#s;#i;constructor(e={}){this.#e=e.queryCache||new vD,this.#t=e.mutationCache||new bD,this.#r=e.defaultOptions||{},this.#n=new Map,this.#o=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#s=ix.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=Lp.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===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(Jl(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=iD(t,o);if(l!==void 0)return this.#e.build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return ar.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;ar.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e,r={type:"active",...e};return ar.batch(()=>(n.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=ar.batch(()=>this.#e.findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(Ns).catch(Ns)}invalidateQueries(e={},t={}){return ar.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=ar.batch(()=>this.#e.findAll(e).filter(a=>!a.isDisabled()).map(a=>{let o=a.fetch(void 0,n);return n.throwOnError||(o=o.catch(Ns)),a.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Ns)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(Jl(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ns).catch(Ns)}fetchInfiniteQuery(e){return e.behavior=xD(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ns).catch(Ns)}resumePausedMutations(){return Lp.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($i(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#n.values()];let n={};return t.forEach(r=>{Xu(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){this.#o.set($i(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#o.values()];let n={};return t.forEach(r=>{Xu(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=ox(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===zE&&(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()}},CD=class extends yc{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;#o;#a;#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),bC(this.#t,this.options)?this.#d():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Gy(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Gy(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 Ks(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&&!Fp(this.options,n)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const a=this.hasListeners();a&&xC(this.#t,r,this.options,n)&&this.#d(),this.updateResult(t),a&&(this.#t!==r||Ks(this.options.enabled,this.#t)!==Ks(n.enabled,this.#t)||Jl(this.options.staleTime,this.#t)!==Jl(n.staleTime,this.#t))&&this.#m();const o=this.#g();a&&(this.#t!==r||Ks(this.options.enabled,this.#t)!==Ks(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 kD(this,n)&&(this.#n=n,this.#a=this.options,this.#o=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(Ns)),t}#m(){this.#b();const e=Jl(this.options.staleTime,this.#t);if(rc||this.#n.isStale||!Hy(e))return;const n=$E(this.#n.dataUpdatedAt,e)+1;this.#c=setTimeout(()=>{this.#n.isStale||this.updateResult()},n)}#g(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#l=e,!(rc||Ks(this.options.enabled,this.#t)===!1||!Hy(this.#l)||this.#l===0)&&(this.#u=setInterval(()=>{(this.options.refetchIntervalInBackground||ix.isFocused())&&this.#d()},this.#l))}#y(){this.#m(),this.#v(this.#g())}#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,a=this.#n,o=this.#o,l=this.#a,d=e!==n?e.state:this.#r,{state:f}=e;let m={...f},h=!1,g;if(t._optimisticResults){const M=this.hasListeners(),O=!M&&bC(e,t),D=M&&xC(e,n,t,r);(O||D)&&(m={...m,...KE(f.data,e.options)}),t._optimisticResults==="isRestoring"&&(m.fetchStatus="idle")}let{error:x,errorUpdatedAt:b,status:w}=m;if(t.select&&m.data!==void 0)if(a&&m.data===o?.data&&t.select===this.#i)g=this.#f;else try{this.#i=t.select,g=t.select(m.data),g=Ky(a?.data,g,t),this.#f=g,this.#s=null}catch(M){this.#s=M}else g=m.data;if(t.placeholderData!==void 0&&g===void 0&&w==="pending"){let M;if(a?.isPlaceholderData&&t.placeholderData===l?.placeholderData)M=a.data;else if(M=typeof t.placeholderData=="function"?t.placeholderData(this.#p?.state.data,this.#p):t.placeholderData,t.select&&M!==void 0)try{M=t.select(M),this.#s=null}catch(O){this.#s=O}M!==void 0&&(w="success",g=Ky(a?.data,M,t),h=!0)}this.#s&&(x=this.#s,g=this.#f,b=Date.now(),w="error");const C=m.fetchStatus==="fetching",k=w==="pending",N=w==="error",T=k&&C,_=g!==void 0;return{status:w,fetchStatus:m.fetchStatus,isPending:k,isSuccess:w==="success",isError:N,isInitialLoading:T,isLoading:T,data:g,dataUpdatedAt:m.dataUpdatedAt,error:x,errorUpdatedAt:b,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>d.dataUpdateCount||m.errorUpdateCount>d.errorUpdateCount,isFetching:C,isRefetching:C&&!k,isLoadingError:N&&!_,isPaused:m.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:N&&_,isStale:lx(e,t),refetch:this.refetch}}updateResult(e){const t=this.#n,n=this.createResult(this.#t,this.options);if(this.#o=this.#t.state,this.#a=this.options,this.#o.data!==void 0&&(this.#p=this.#t),Fp(n,t))return;this.#n=n;const r={},a=()=>{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&&a()&&(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){ar.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#n)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function jD(e,t){return Ks(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function bC(e,t){return jD(e,t)||e.state.data!==void 0&&Gy(e,t,t.refetchOnMount)}function Gy(e,t,n){if(Ks(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&lx(e,t)}return!1}function xC(e,t,n,r){return(e!==t||Ks(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&lx(e,n)}function lx(e,t){return Ks(t.enabled,e)!==!1&&e.isStaleByTime(Jl(t.staleTime,e))}function kD(e,t){return!Fp(e.getCurrentResult(),t)}var ED=class extends yc{#e;#t=void 0;#r;#n;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#o()}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),Fp(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),n?.mutationKey&&this.options.mutationKey&&$i(n.mutationKey)!==$i(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.#o(),this.#a(t)}getCurrentResult(){return this.#t}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#o(),this.#a()}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)}#o(){const t=this.#r?.state??GE();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}}#a(t){ar.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=vc();const ke=md(y),Ho=LE({__proto__:null,default:ke},[y]);var JE=y.createContext(void 0),Wa=e=>{const t=y.useContext(JE);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},QE=({client:e,children:t})=>(y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(JE.Provider,{value:e,children:t})),YE=y.createContext(!1),ND=()=>y.useContext(YE);YE.Provider;function TD(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var MD=y.createContext(TD()),_D=()=>y.useContext(MD);function ZE(e,t){return typeof e=="function"?e(...t):!!e}function PD(){}var RD=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},ID=e=>{y.useEffect(()=>{e.clearReset()},[e])},OD=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&ZE(n,[e.error,r]),AD=e=>{e.suspense&&(typeof e.staleTime!="number"&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},DD=(e,t)=>e?.suspense&&t.isPending,FD=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function LD(e,t,n){const r=Wa(),a=ND(),o=_D(),l=r.defaultQueryOptions(e);r.getDefaultOptions().queries?._experimental_beforeQuery?.(l),l._optimisticResults=a?"isRestoring":"optimistic",AD(l),RD(l,o),ID(o);const[u]=y.useState(()=>new t(r,l)),d=u.getOptimisticResult(l);if(y.useSyncExternalStore(y.useCallback(f=>{const m=a?()=>{}:u.subscribe(ar.batchCalls(f));return u.updateResult(),m},[u,a]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),y.useEffect(()=>{u.setOptions(l,{listeners:!1})},[l,u]),DD(l,d))throw FD(l,u,o);if(OD({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 gt(e,t){return LD(e,CD)}function $D(e,t){const n=Wa(),[r]=y.useState(()=>new ED(n,e));y.useEffect(()=>{r.setOptions(e)},[r,e]);const a=y.useSyncExternalStore(y.useCallback(l=>r.subscribe(ar.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=y.useCallback((l,u)=>{r.mutate(l,u).catch(PD)},[r]);if(a.error&&ZE(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:o,mutateAsync:a.mutate}}var Df={},yv={exports:{}},Kr={},bv={exports:{}},xv={};/** - * @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 wC;function BD(){return wC||(wC=1,(function(e){function t(H,W){var U=H.length;H.push(W);e:for(;0>>1,K=H[A];if(0>>1;Aa(ie,U))dea(j,ie)?(H[A]=j,H[de]=U,A=de):(H[A]=ie,H[ee]=U,A=ee);else if(dea(j,U))H[A]=j,H[de]=U,A=de;else break e}}return W}function a(H,W){var U=H.sortIndex-W.sortIndex;return U!==0?U:H.id-W.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=[],m=1,h=null,g=3,x=!1,b=!1,w=!1,C=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T(H){for(var W=n(f);W!==null;){if(W.callback===null)r(f);else if(W.startTime<=H)r(f),W.sortIndex=W.expirationTime,t(d,W);else break;W=n(f)}}function _(H){if(w=!1,T(H),!b)if(n(d)!==null)b=!0,Y(P);else{var W=n(f);W!==null&&se(_,W.startTime-H)}}function P(H,W){b=!1,w&&(w=!1,k(D),D=-1),x=!0;var U=g;try{for(T(W),h=n(d);h!==null&&(!(h.expirationTime>W)||H&&!te());){var A=h.callback;if(typeof A=="function"){h.callback=null,g=h.priorityLevel;var K=A(h.expirationTime<=W);W=e.unstable_now(),typeof K=="function"?h.callback=K:h===n(d)&&r(d),T(W)}else r(d);h=n(d)}if(h!==null)var re=!0;else{var ee=n(f);ee!==null&&se(_,ee.startTime-W),re=!1}return re}finally{h=null,g=U,x=!1}}var M=!1,O=null,D=-1,F=5,$=-1;function te(){return!(e.unstable_now()-$H||125A?(H.sortIndex=U,t(f,H),n(d)===null&&H===n(f)&&(w?(k(D),D=-1):w=!0,se(_,U-A))):(H.sortIndex=K,t(d,H),b||x||(b=!0,Y(P))),H},e.unstable_shouldYield=te,e.unstable_wrapCallback=function(H){var W=g;return function(){var U=g;g=W;try{return H.apply(this,arguments)}finally{g=U}}}})(xv)),xv}var SC;function zD(){return SC||(SC=1,bv.exports=BD()),bv.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 CC;function UD(){if(CC)return Kr;CC=1;var e=vc(),t=zD();function n(i){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+i,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]*$/,m={},h={};function g(i){return d.call(h,i)?!0:d.call(m,i)?!1:f.test(i)?h[i]=!0:(m[i]=!0,!1)}function x(i,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:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function b(i,c,p,v){if(c===null||typeof c>"u"||x(i,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(i,c,p,v,S,E,R){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=v,this.attributeNamespace=S,this.mustUseProperty=p,this.propertyName=i,this.type=c,this.sanitizeURL=E,this.removeEmptyString=R}var C={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){C[i]=new w(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var c=i[0];C[c]=new w(c,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){C[i]=new w(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){C[i]=new w(i,2,!1,i,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(i){C[i]=new w(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){C[i]=new w(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){C[i]=new w(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){C[i]=new w(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){C[i]=new w(i,5,!1,i.toLowerCase(),null,!1,!1)});var k=/[\-:]([a-z])/g;function N(i){return i[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(i){var c=i.replace(k,N);C[c]=new w(c,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var c=i.replace(k,N);C[c]=new w(c,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var c=i.replace(k,N);C[c]=new w(c,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){C[i]=new w(i,1,!1,i.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(i){C[i]=new w(i,1,!1,i.toLowerCase(),null,!0,!0)});function T(i,c,p,v){var S=C.hasOwnProperty(c)?C[c]:null;(S!==null?S.type!==0:v||!(2L||S[R]!==E[L]){var J=` -`+S[R].replace(" at new "," at ");return i.displayName&&J.includes("")&&(J=J.replace("",i.displayName)),J}while(1<=R&&0<=L);break}}}finally{re=!1,Error.prepareStackTrace=p}return(i=i?i.displayName||i.name:"")?K(i):""}function ie(i){switch(i.tag){case 5:return K(i.type);case 16:return K("Lazy");case 13:return K("Suspense");case 19:return K("SuspenseList");case 0:case 2:case 15:return i=ee(i.type,!1),i;case 11:return i=ee(i.type.render,!1),i;case 1:return i=ee(i.type,!0),i;default:return""}}function de(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case O:return"Fragment";case M:return"Portal";case F:return"Profiler";case D:return"StrictMode";case ue:return"Suspense";case V:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case te:return(i.displayName||"Context")+".Consumer";case $:return(i._context.displayName||"Context")+".Provider";case z:var c=i.render;return i=i.displayName,i||(i=c.displayName||c.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case ne:return c=i.displayName||null,c!==null?c:de(i.type)||"Memo";case Y:c=i._payload,i=i._init;try{return de(i(c))}catch{}}return null}function j(i){var c=i.type;switch(i.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 i=c.render,i=i.displayName||i.name||"",c.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return de(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 I(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function me(i){var c=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function xe(i){var c=me(i)?"checked":"value",p=Object.getOwnPropertyDescriptor(i.constructor.prototype,c),v=""+i[c];if(!i.hasOwnProperty(c)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var S=p.get,E=p.set;return Object.defineProperty(i,c,{configurable:!0,get:function(){return S.call(this)},set:function(R){v=""+R,E.call(this,R)}}),Object.defineProperty(i,c,{enumerable:p.enumerable}),{getValue:function(){return v},setValue:function(R){v=""+R},stopTracking:function(){i._valueTracker=null,delete i[c]}}}}function rt(i){i._valueTracker||(i._valueTracker=xe(i))}function Je(i){if(!i)return!1;var c=i._valueTracker;if(!c)return!0;var p=c.getValue(),v="";return i&&(v=me(i)?i.checked?"true":"false":i.value),i=v,i!==p?(c.setValue(i),!0):!1}function nt(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function qt(i,c){var p=c.checked;return U({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:p??i._wrapperState.initialChecked})}function Wn(i,c){var p=c.defaultValue==null?"":c.defaultValue,v=c.checked!=null?c.checked:c.defaultChecked;p=I(c.value!=null?c.value:p),i._wrapperState={initialChecked:v,initialValue:p,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function Pn(i,c){c=c.checked,c!=null&&T(i,"checked",c,!1)}function tr(i,c){Pn(i,c);var p=I(c.value),v=c.type;if(p!=null)v==="number"?(p===0&&i.value===""||i.value!=p)&&(i.value=""+p):i.value!==""+p&&(i.value=""+p);else if(v==="submit"||v==="reset"){i.removeAttribute("value");return}c.hasOwnProperty("value")?$r(i,c.type,p):c.hasOwnProperty("defaultValue")&&$r(i,c.type,I(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(i.defaultChecked=!!c.defaultChecked)}function wn(i,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=""+i._wrapperState.initialValue,p||c===i.value||(i.value=c),i.defaultValue=c}p=i.name,p!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,p!==""&&(i.name=p)}function $r(i,c,p){(c!=="number"||nt(i.ownerDocument)!==i)&&(p==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+p&&(i.defaultValue=""+p))}var Br=Array.isArray;function or(i,c,p,v){if(i=i.options,c){c={};for(var S=0;S"+c.valueOf().toString()+"",c=Te.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;c.firstChild;)i.appendChild(c.firstChild)}});function pt(i,c){if(c){var p=i.firstChild;if(p&&p===i.lastChild&&p.nodeType===3){p.nodeValue=c;return}}i.textContent=c}var Nt={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},Rn=["Webkit","ms","Moz","O"];Object.keys(Nt).forEach(function(i){Rn.forEach(function(c){c=c+i.charAt(0).toUpperCase()+i.substring(1),Nt[c]=Nt[i]})});function vn(i,c,p){return c==null||typeof c=="boolean"||c===""?"":p||typeof c!="number"||c===0||Nt.hasOwnProperty(i)&&Nt[i]?(""+c).trim():c+"px"}function Ee(i,c){i=i.style;for(var p in c)if(c.hasOwnProperty(p)){var v=p.indexOf("--")===0,S=vn(p,c[p],v);p==="float"&&(p="cssFloat"),v?i.setProperty(p,S):i[p]=S}}var bt=U({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 zt(i,c){if(c){if(bt[i]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(n(137,i));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(i,c){if(i.indexOf("-")===-1)return typeof c.is=="string";switch(i){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 vr=null;function ur(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var zr=null,_r=null,ts=null;function ns(i){if(i=ou(i)){if(typeof zr!="function")throw Error(n(280));var c=i.stateNode;c&&(c=Jd(c),zr(i.stateNode,i.type,c))}}function eo(i){_r?ts?ts.push(i):ts=[i]:_r=i}function $c(){if(_r){var i=_r,c=ts;if(ts=_r=null,ns(i),c)for(i=0;i>>=0,i===0?32:31-(Ds(i)/_d|0)|0}var Pd=64,Rd=4194304;function Uc(i){switch(i&-i){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 i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function Id(i,c){var p=i.pendingLanes;if(p===0)return 0;var v=0,S=i.suspendedLanes,E=i.pingedLanes,R=p&268435455;if(R!==0){var L=R&~S;L!==0?v=Uc(L):(E&=R,E!==0&&(v=Uc(E)))}else R=p&~S,R!==0?v=Uc(R):E!==0&&(v=Uc(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=i.entangledLanes,c!==0)for(i=i.entanglements,c&=v;0p;p++)c.push(i);return c}function Vc(i,c,p){i.pendingLanes|=c,c!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,c=31-Vt(c),i[c]=p}function jO(i,c){var p=i.pendingLanes&~c;i.pendingLanes=c,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=c,i.mutableReadLanes&=c,i.entangledLanes&=c,c=i.entanglements;var v=i.eventTimes;for(i=i.expirationTimes;0=Yc),rS=" ",sS=!1;function aS(i,c){switch(i){case"keyup":return ZO.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function oS(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var pl=!1;function eA(i,c){switch(i){case"compositionend":return oS(c);case"keypress":return c.which!==32?null:(sS=!0,rS);case"textInput":return i=c.data,i===rS&&sS?null:i;default:return null}}function tA(i,c){if(pl)return i==="compositionend"||!Jm&&aS(i,c)?(i=Yw(),Ld=Vm=oo=null,pl=!1,i):null;switch(i){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-i};i=v}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=pS(p)}}function mS(i,c){return i&&c?i===c?!0:i&&i.nodeType===3?!1:c&&c.nodeType===3?mS(i,c.parentNode):"contains"in i?i.contains(c):i.compareDocumentPosition?!!(i.compareDocumentPosition(c)&16):!1:!1}function gS(){for(var i=window,c=nt();c instanceof i.HTMLIFrameElement;){try{var p=typeof c.contentWindow.location.href=="string"}catch{p=!1}if(p)i=c.contentWindow;else break;c=nt(i.document)}return c}function Zm(i){var c=i&&i.nodeName&&i.nodeName.toLowerCase();return c&&(c==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||c==="textarea"||i.contentEditable==="true")}function uA(i){var c=gS(),p=i.focusedElem,v=i.selectionRange;if(c!==p&&p&&p.ownerDocument&&mS(p.ownerDocument.documentElement,p)){if(v!==null&&Zm(p)){if(c=v.start,i=v.end,i===void 0&&(i=c),"selectionStart"in p)p.selectionStart=c,p.selectionEnd=Math.min(i,p.value.length);else if(i=(c=p.ownerDocument||document)&&c.defaultView||window,i.getSelection){i=i.getSelection();var S=p.textContent.length,E=Math.min(v.start,S);v=v.end===void 0?E:Math.min(v.end,S),!i.extend&&E>v&&(S=v,v=E,E=S),S=hS(p,E);var R=hS(p,v);S&&R&&(i.rangeCount!==1||i.anchorNode!==S.node||i.anchorOffset!==S.offset||i.focusNode!==R.node||i.focusOffset!==R.offset)&&(c=c.createRange(),c.setStart(S.node,S.offset),i.removeAllRanges(),E>v?(i.addRange(c),i.extend(R.node,R.offset)):(c.setEnd(R.node,R.offset),i.addRange(c)))}}for(c=[],i=p;i=i.parentNode;)i.nodeType===1&&c.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p=document.documentMode,hl=null,Xm=null,tu=null,eg=!1;function vS(i,c,p){var v=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;eg||hl==null||hl!==nt(v)||(v=hl,"selectionStart"in v&&Zm(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}),tu&&eu(tu,v)||(tu=v,v=Wd(Xm,"onSelect"),0bl||(i.current=fg[bl],fg[bl]=null,bl--)}function yn(i,c){bl++,fg[bl]=i.current,i.current=c}var uo={},yr=co(uo),Ur=co(!1),hi=uo;function xl(i,c){var p=i.type.contextTypes;if(!p)return uo;var v=i.stateNode;if(v&&v.__reactInternalMemoizedUnmaskedChildContext===c)return v.__reactInternalMemoizedMaskedChildContext;var S={},E;for(E in p)S[E]=c[E];return v&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=c,i.__reactInternalMemoizedMaskedChildContext=S),S}function Vr(i){return i=i.childContextTypes,i!=null}function Qd(){Cn(Ur),Cn(yr)}function RS(i,c,p){if(yr.current!==uo)throw Error(n(168));yn(yr,c),yn(Ur,p)}function IS(i,c,p){var v=i.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,j(i)||"Unknown",S));return U({},p,v)}function Yd(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||uo,hi=yr.current,yn(yr,i),yn(Ur,Ur.current),!0}function OS(i,c,p){var v=i.stateNode;if(!v)throw Error(n(169));p?(i=IS(i,c,hi),v.__reactInternalMemoizedMergedChildContext=i,Cn(Ur),Cn(yr),yn(yr,i)):Cn(Ur),yn(Ur,p)}var Ea=null,Zd=!1,pg=!1;function AS(i){Ea===null?Ea=[i]:Ea.push(i)}function SA(i){Zd=!0,AS(i)}function fo(){if(!pg&&Ea!==null){pg=!0;var i=0,c=ln;try{var p=Ea;for(ln=1;i>=R,S-=R,Na=1<<32-Vt(c)+S|p<vt?(cr=lt,lt=null):cr=lt.sibling;var Zt=Se(ce,lt,fe[vt],_e);if(Zt===null){lt===null&&(lt=cr);break}i&<&&Zt.alternate===null&&c(ce,lt),Z=E(Zt,Z,vt),it===null?et=Zt:it.sibling=Zt,it=Zt,lt=cr}if(vt===fe.length)return p(ce,lt),Mn&&gi(ce,vt),et;if(lt===null){for(;vtvt?(cr=lt,lt=null):cr=lt.sibling;var wo=Se(ce,lt,Zt.value,_e);if(wo===null){lt===null&&(lt=cr);break}i&<&&wo.alternate===null&&c(ce,lt),Z=E(wo,Z,vt),it===null?et=wo:it.sibling=wo,it=wo,lt=cr}if(Zt.done)return p(ce,lt),Mn&&gi(ce,vt),et;if(lt===null){for(;!Zt.done;vt++,Zt=fe.next())Zt=Ne(ce,Zt.value,_e),Zt!==null&&(Z=E(Zt,Z,vt),it===null?et=Zt:it.sibling=Zt,it=Zt);return Mn&&gi(ce,vt),et}for(lt=v(ce,lt);!Zt.done;vt++,Zt=fe.next())Zt=ze(lt,ce,vt,Zt.value,_e),Zt!==null&&(i&&Zt.alternate!==null&<.delete(Zt.key===null?vt:Zt.key),Z=E(Zt,Z,vt),it===null?et=Zt:it.sibling=Zt,it=Zt);return i&<.forEach(function(nD){return c(ce,nD)}),Mn&&gi(ce,vt),et}function Bn(ce,Z,fe,_e){if(typeof fe=="object"&&fe!==null&&fe.type===O&&fe.key===null&&(fe=fe.props.children),typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case P:e:{for(var et=fe.key,it=Z;it!==null;){if(it.key===et){if(et=fe.type,et===O){if(it.tag===7){p(ce,it.sibling),Z=S(it,fe.props.children),Z.return=ce,ce=Z;break e}}else if(it.elementType===et||typeof et=="object"&&et!==null&&et.$$typeof===Y&&zS(et)===it.type){p(ce,it.sibling),Z=S(it,fe.props),Z.ref=iu(ce,it,fe),Z.return=ce,ce=Z;break e}p(ce,it);break}else c(ce,it);it=it.sibling}fe.type===O?(Z=ji(fe.props.children,ce.mode,_e,fe.key),Z.return=ce,ce=Z):(_e=Nf(fe.type,fe.key,fe.props,null,ce.mode,_e),_e.ref=iu(ce,Z,fe),_e.return=ce,ce=_e)}return R(ce);case M:e:{for(it=fe.key;Z!==null;){if(Z.key===it)if(Z.tag===4&&Z.stateNode.containerInfo===fe.containerInfo&&Z.stateNode.implementation===fe.implementation){p(ce,Z.sibling),Z=S(Z,fe.children||[]),Z.return=ce,ce=Z;break e}else{p(ce,Z);break}else c(ce,Z);Z=Z.sibling}Z=uv(fe,ce.mode,_e),Z.return=ce,ce=Z}return R(ce);case Y:return it=fe._init,Bn(ce,Z,it(fe._payload),_e)}if(Br(fe))return He(ce,Z,fe,_e);if(W(fe))return Qe(ce,Z,fe,_e);nf(ce,fe)}return typeof fe=="string"&&fe!==""||typeof fe=="number"?(fe=""+fe,Z!==null&&Z.tag===6?(p(ce,Z.sibling),Z=S(Z,fe),Z.return=ce,ce=Z):(p(ce,Z),Z=cv(fe,ce.mode,_e),Z.return=ce,ce=Z),R(ce)):p(ce,Z)}return Bn}var jl=US(!0),VS=US(!1),rf=co(null),sf=null,kl=null,bg=null;function xg(){bg=kl=sf=null}function wg(i){var c=rf.current;Cn(rf),i._currentValue=c}function Sg(i,c,p){for(;i!==null;){var v=i.alternate;if((i.childLanes&c)!==c?(i.childLanes|=c,v!==null&&(v.childLanes|=c)):v!==null&&(v.childLanes&c)!==c&&(v.childLanes|=c),i===p)break;i=i.return}}function El(i,c){sf=i,bg=kl=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&c)!==0&&(qr=!0),i.firstContext=null)}function ws(i){var c=i._currentValue;if(bg!==i)if(i={context:i,memoizedValue:c,next:null},kl===null){if(sf===null)throw Error(n(308));kl=i,sf.dependencies={lanes:0,firstContext:i}}else kl=kl.next=i;return c}var vi=null;function Cg(i){vi===null?vi=[i]:vi.push(i)}function qS(i,c,p,v){var S=c.interleaved;return S===null?(p.next=p,Cg(c)):(p.next=S.next,S.next=p),c.interleaved=p,Ma(i,v)}function Ma(i,c){i.lanes|=c;var p=i.alternate;for(p!==null&&(p.lanes|=c),p=i,i=i.return;i!==null;)i.childLanes|=c,p=i.alternate,p!==null&&(p.childLanes|=c),p=i,i=i.return;return p.tag===3?p.stateNode:null}var po=!1;function jg(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function HS(i,c){i=i.updateQueue,c.updateQueue===i&&(c.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function _a(i,c){return{eventTime:i,lane:c,tag:0,payload:null,callback:null,next:null}}function ho(i,c,p){var v=i.updateQueue;if(v===null)return null;if(v=v.shared,(Jt&2)!==0){var S=v.pending;return S===null?c.next=c:(c.next=S.next,S.next=c),v.pending=c,Ma(i,p)}return S=v.interleaved,S===null?(c.next=c,Cg(v)):(c.next=S.next,S.next=c),v.interleaved=c,Ma(i,p)}function af(i,c,p){if(c=c.updateQueue,c!==null&&(c=c.shared,(p&4194240)!==0)){var v=c.lanes;v&=i.pendingLanes,p|=v,c.lanes=p,Lm(i,p)}}function WS(i,c){var p=i.updateQueue,v=i.alternate;if(v!==null&&(v=v.updateQueue,p===v)){var S=null,E=null;if(p=p.firstBaseUpdate,p!==null){do{var R={eventTime:p.eventTime,lane:p.lane,tag:p.tag,payload:p.payload,callback:p.callback,next:null};E===null?S=E=R:E=E.next=R,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},i.updateQueue=p;return}i=p.lastBaseUpdate,i===null?p.firstBaseUpdate=c:i.next=c,p.lastBaseUpdate=c}function of(i,c,p,v){var S=i.updateQueue;po=!1;var E=S.firstBaseUpdate,R=S.lastBaseUpdate,L=S.shared.pending;if(L!==null){S.shared.pending=null;var J=L,ve=J.next;J.next=null,R===null?E=ve:R.next=ve,R=J;var je=i.alternate;je!==null&&(je=je.updateQueue,L=je.lastBaseUpdate,L!==R&&(L===null?je.firstBaseUpdate=ve:L.next=ve,je.lastBaseUpdate=J))}if(E!==null){var Ne=S.baseState;R=0,je=ve=J=null,L=E;do{var Se=L.lane,ze=L.eventTime;if((v&Se)===Se){je!==null&&(je=je.next={eventTime:ze,lane:0,tag:L.tag,payload:L.payload,callback:L.callback,next:null});e:{var He=i,Qe=L;switch(Se=c,ze=p,Qe.tag){case 1:if(He=Qe.payload,typeof He=="function"){Ne=He.call(ze,Ne,Se);break e}Ne=He;break e;case 3:He.flags=He.flags&-65537|128;case 0:if(He=Qe.payload,Se=typeof He=="function"?He.call(ze,Ne,Se):He,Se==null)break e;Ne=U({},Ne,Se);break e;case 2:po=!0}}L.callback!==null&&L.lane!==0&&(i.flags|=64,Se=S.effects,Se===null?S.effects=[L]:Se.push(L))}else ze={eventTime:ze,lane:Se,tag:L.tag,payload:L.payload,callback:L.callback,next:null},je===null?(ve=je=ze,J=Ne):je=je.next=ze,R|=Se;if(L=L.next,L===null){if(L=S.shared.pending,L===null)break;Se=L,L=Se.next,Se.next=null,S.lastBaseUpdate=Se,S.shared.pending=null}}while(!0);if(je===null&&(J=Ne),S.baseState=J,S.firstBaseUpdate=ve,S.lastBaseUpdate=je,c=S.shared.interleaved,c!==null){S=c;do R|=S.lane,S=S.next;while(S!==c)}else E===null&&(S.shared.lanes=0);xi|=R,i.lanes=R,i.memoizedState=Ne}}function KS(i,c,p){if(i=c.effects,c.effects=null,i!==null)for(c=0;cp?p:4,i(!0);var v=Mg.transition;Mg.transition={};try{i(!1),c()}finally{ln=p,Mg.transition=v}}function f0(){return Ss().memoizedState}function EA(i,c,p){var v=yo(i);if(p={lane:v,action:p,hasEagerState:!1,eagerState:null,next:null},p0(i))h0(c,p);else if(p=qS(i,c,p,v),p!==null){var S=Ir();Us(p,i,v,S),m0(p,c,v)}}function NA(i,c,p){var v=yo(i),S={lane:v,action:p,hasEagerState:!1,eagerState:null,next:null};if(p0(i))h0(c,S);else{var E=i.alternate;if(i.lanes===0&&(E===null||E.lanes===0)&&(E=c.lastRenderedReducer,E!==null))try{var R=c.lastRenderedState,L=E(R,p);if(S.hasEagerState=!0,S.eagerState=L,Fs(L,R)){var J=c.interleaved;J===null?(S.next=S,Cg(c)):(S.next=J.next,J.next=S),c.interleaved=S;return}}catch{}finally{}p=qS(i,c,S,v),p!==null&&(S=Ir(),Us(p,i,v,S),m0(p,c,v))}}function p0(i){var c=i.alternate;return i===An||c!==null&&c===An}function h0(i,c){du=uf=!0;var p=i.pending;p===null?c.next=c:(c.next=p.next,p.next=c),i.pending=c}function m0(i,c,p){if((p&4194240)!==0){var v=c.lanes;v&=i.pendingLanes,p|=v,c.lanes=p,Lm(i,p)}}var pf={readContext:ws,useCallback:br,useContext:br,useEffect:br,useImperativeHandle:br,useInsertionEffect:br,useLayoutEffect:br,useMemo:br,useReducer:br,useRef:br,useState:br,useDebugValue:br,useDeferredValue:br,useTransition:br,useMutableSource:br,useSyncExternalStore:br,useId:br,unstable_isNewReconciler:!1},TA={readContext:ws,useCallback:function(i,c){return da().memoizedState=[i,c===void 0?null:c],i},useContext:ws,useEffect:s0,useImperativeHandle:function(i,c,p){return p=p!=null?p.concat([i]):null,df(4194308,4,i0.bind(null,c,i),p)},useLayoutEffect:function(i,c){return df(4194308,4,i,c)},useInsertionEffect:function(i,c){return df(4,2,i,c)},useMemo:function(i,c){var p=da();return c=c===void 0?null:c,i=i(),p.memoizedState=[i,c],i},useReducer:function(i,c,p){var v=da();return c=p!==void 0?p(c):c,v.memoizedState=v.baseState=c,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:c},v.queue=i,i=i.dispatch=EA.bind(null,An,i),[v.memoizedState,i]},useRef:function(i){var c=da();return i={current:i},c.memoizedState=i},useState:n0,useDebugValue:Dg,useDeferredValue:function(i){return da().memoizedState=i},useTransition:function(){var i=n0(!1),c=i[0];return i=kA.bind(null,i[1]),da().memoizedState=i,[c,i]},useMutableSource:function(){},useSyncExternalStore:function(i,c,p){var v=An,S=da();if(Mn){if(p===void 0)throw Error(n(407));p=p()}else{if(p=c(),lr===null)throw Error(n(349));(bi&30)!==0||YS(v,c,p)}S.memoizedState=p;var E={value:p,getSnapshot:c};return S.queue=E,s0(XS.bind(null,v,E,i),[i]),v.flags|=2048,hu(9,ZS.bind(null,v,E,p,c),void 0,null),p},useId:function(){var i=da(),c=lr.identifierPrefix;if(Mn){var p=Ta,v=Na;p=(v&~(1<<32-Vt(v)-1)).toString(32)+p,c=":"+c+"R"+p,p=fu++,0<\/script>",i=i.removeChild(i.firstChild)):typeof v.is=="string"?i=R.createElement(p,{is:v.is}):(i=R.createElement(p),p==="select"&&(R=i,v.multiple?R.multiple=!0:v.size&&(R.size=v.size))):i=R.createElementNS(i,p),i[ca]=c,i[au]=v,A0(i,c,!1,!1),c.stateNode=i;e:{switch(R=Tn(p,v),p){case"dialog":Sn("cancel",i),Sn("close",i),S=v;break;case"iframe":case"object":case"embed":Sn("load",i),S=v;break;case"video":case"audio":for(S=0;SPl&&(c.flags|=128,v=!0,mu(E,!1),c.lanes=4194304)}else{if(!v)if(i=lf(R),i!==null){if(c.flags|=128,v=!0,p=i.updateQueue,p!==null&&(c.updateQueue=p,c.flags|=4),mu(E,!0),E.tail===null&&E.tailMode==="hidden"&&!R.alternate&&!Mn)return xr(c),null}else 2*dn()-E.renderingStartTime>Pl&&p!==1073741824&&(c.flags|=128,v=!0,mu(E,!1),c.lanes=4194304);E.isBackwards?(R.sibling=c.child,c.child=R):(p=E.last,p!==null?p.sibling=R:c.child=R,E.last=R)}return E.tail!==null?(c=E.tail,E.rendering=c,E.tail=c.sibling,E.renderingStartTime=dn(),c.sibling=null,p=On.current,yn(On,v?p&1|2:p&1),c):(xr(c),null);case 22:case 23:return ov(),v=c.memoizedState!==null,i!==null&&i.memoizedState!==null!==v&&(c.flags|=8192),v&&(c.mode&1)!==0?(is&1073741824)!==0&&(xr(c),c.subtreeFlags&6&&(c.flags|=8192)):xr(c),null;case 24:return null;case 25:return null}throw Error(n(156,c.tag))}function DA(i,c){switch(mg(c),c.tag){case 1:return Vr(c.type)&&Qd(),i=c.flags,i&65536?(c.flags=i&-65537|128,c):null;case 3:return Nl(),Cn(Ur),Cn(yr),Tg(),i=c.flags,(i&65536)!==0&&(i&128)===0?(c.flags=i&-65537|128,c):null;case 5:return Eg(c),null;case 13:if(Cn(On),i=c.memoizedState,i!==null&&i.dehydrated!==null){if(c.alternate===null)throw Error(n(340));Cl()}return i=c.flags,i&65536?(c.flags=i&-65537|128,c):null;case 19:return Cn(On),null;case 4:return Nl(),null;case 10:return wg(c.type._context),null;case 22:case 23:return ov(),null;case 24:return null;default:return null}}var vf=!1,wr=!1,FA=typeof WeakSet=="function"?WeakSet:Set,qe=null;function Ml(i,c){var p=i.ref;if(p!==null)if(typeof p=="function")try{p(null)}catch(v){Ln(i,c,v)}else p.current=null}function Gg(i,c,p){try{p()}catch(v){Ln(i,c,v)}}var L0=!1;function LA(i,c){if(og=Dd,i=gS(),Zm(i)){if("selectionStart"in i)var p={start:i.selectionStart,end:i.selectionEnd};else e:{p=(p=i.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 R=0,L=-1,J=-1,ve=0,je=0,Ne=i,Se=null;t:for(;;){for(var ze;Ne!==p||S!==0&&Ne.nodeType!==3||(L=R+S),Ne!==E||v!==0&&Ne.nodeType!==3||(J=R+v),Ne.nodeType===3&&(R+=Ne.nodeValue.length),(ze=Ne.firstChild)!==null;)Se=Ne,Ne=ze;for(;;){if(Ne===i)break t;if(Se===p&&++ve===S&&(L=R),Se===E&&++je===v&&(J=R),(ze=Ne.nextSibling)!==null)break;Ne=Se,Se=Ne.parentNode}Ne=ze}p=L===-1||J===-1?null:{start:L,end:J}}else p=null}p=p||{start:0,end:0}}else p=null;for(ig={focusedElem:i,selectionRange:p},Dd=!1,qe=c;qe!==null;)if(c=qe,i=c.child,(c.subtreeFlags&1028)!==0&&i!==null)i.return=c,qe=i;else for(;qe!==null;){c=qe;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 Qe=He.memoizedProps,Bn=He.memoizedState,ce=c.stateNode,Z=ce.getSnapshotBeforeUpdate(c.elementType===c.type?Qe:$s(c.type,Qe),Bn);ce.__reactInternalSnapshotBeforeUpdate=Z}break;case 3:var fe=c.stateNode.containerInfo;fe.nodeType===1?fe.textContent="":fe.nodeType===9&&fe.documentElement&&fe.removeChild(fe.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(_e){Ln(c,c.return,_e)}if(i=c.sibling,i!==null){i.return=c.return,qe=i;break}qe=c.return}return He=L0,L0=!1,He}function gu(i,c,p){var v=c.updateQueue;if(v=v!==null?v.lastEffect:null,v!==null){var S=v=v.next;do{if((S.tag&i)===i){var E=S.destroy;S.destroy=void 0,E!==void 0&&Gg(c,p,E)}S=S.next}while(S!==v)}}function yf(i,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var p=c=c.next;do{if((p.tag&i)===i){var v=p.create;p.destroy=v()}p=p.next}while(p!==c)}}function Jg(i){var c=i.ref;if(c!==null){var p=i.stateNode;switch(i.tag){case 5:i=p;break;default:i=p}typeof c=="function"?c(i):c.current=i}}function $0(i){var c=i.alternate;c!==null&&(i.alternate=null,$0(c)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(c=i.stateNode,c!==null&&(delete c[ca],delete c[au],delete c[dg],delete c[xA],delete c[wA])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function B0(i){return i.tag===5||i.tag===3||i.tag===4}function z0(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||B0(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Qg(i,c,p){var v=i.tag;if(v===5||v===6)i=i.stateNode,c?p.nodeType===8?p.parentNode.insertBefore(i,c):p.insertBefore(i,c):(p.nodeType===8?(c=p.parentNode,c.insertBefore(i,p)):(c=p,c.appendChild(i)),p=p._reactRootContainer,p!=null||c.onclick!==null||(c.onclick=Gd));else if(v!==4&&(i=i.child,i!==null))for(Qg(i,c,p),i=i.sibling;i!==null;)Qg(i,c,p),i=i.sibling}function Yg(i,c,p){var v=i.tag;if(v===5||v===6)i=i.stateNode,c?p.insertBefore(i,c):p.appendChild(i);else if(v!==4&&(i=i.child,i!==null))for(Yg(i,c,p),i=i.sibling;i!==null;)Yg(i,c,p),i=i.sibling}var dr=null,Bs=!1;function mo(i,c,p){for(p=p.child;p!==null;)U0(i,c,p),p=p.sibling}function U0(i,c,p){if(Gt&&typeof Gt.onCommitFiberUnmount=="function")try{Gt.onCommitFiberUnmount(St,p)}catch{}switch(p.tag){case 5:wr||Ml(p,c);case 6:var v=dr,S=Bs;dr=null,mo(i,c,p),dr=v,Bs=S,dr!==null&&(Bs?(i=dr,p=p.stateNode,i.nodeType===8?i.parentNode.removeChild(p):i.removeChild(p)):dr.removeChild(p.stateNode));break;case 18:dr!==null&&(Bs?(i=dr,p=p.stateNode,i.nodeType===8?ug(i.parentNode,p):i.nodeType===1&&ug(i,p),Gc(i)):ug(dr,p.stateNode));break;case 4:v=dr,S=Bs,dr=p.stateNode.containerInfo,Bs=!0,mo(i,c,p),dr=v,Bs=S;break;case 0:case 11:case 14:case 15:if(!wr&&(v=p.updateQueue,v!==null&&(v=v.lastEffect,v!==null))){S=v=v.next;do{var E=S,R=E.destroy;E=E.tag,R!==void 0&&((E&2)!==0||(E&4)!==0)&&Gg(p,c,R),S=S.next}while(S!==v)}mo(i,c,p);break;case 1:if(!wr&&(Ml(p,c),v=p.stateNode,typeof v.componentWillUnmount=="function"))try{v.props=p.memoizedProps,v.state=p.memoizedState,v.componentWillUnmount()}catch(L){Ln(p,c,L)}mo(i,c,p);break;case 21:mo(i,c,p);break;case 22:p.mode&1?(wr=(v=wr)||p.memoizedState!==null,mo(i,c,p),wr=v):mo(i,c,p);break;default:mo(i,c,p)}}function V0(i){var c=i.updateQueue;if(c!==null){i.updateQueue=null;var p=i.stateNode;p===null&&(p=i.stateNode=new FA),c.forEach(function(v){var S=KA.bind(null,i,v);p.has(v)||(p.add(v),v.then(S,S))})}}function zs(i,c){var p=c.deletions;if(p!==null)for(var v=0;vS&&(S=R),v&=~E}if(v=S,v=dn()-v,v=(120>v?120:480>v?480:1080>v?1080:1920>v?1920:3e3>v?3e3:4320>v?4320:1960*BA(v/1960))-v,10i?16:i,vo===null)var v=!1;else{if(i=vo,vo=null,Cf=0,(Jt&6)!==0)throw Error(n(331));var S=Jt;for(Jt|=4,qe=i.current;qe!==null;){var E=qe,R=E.child;if((qe.flags&16)!==0){var L=E.deletions;if(L!==null){for(var J=0;Jdn()-ev?Si(i,0):Xg|=p),Wr(i,c)}function nC(i,c){c===0&&((i.mode&1)===0?c=1:(c=Rd,Rd<<=1,(Rd&130023424)===0&&(Rd=4194304)));var p=Ir();i=Ma(i,c),i!==null&&(Vc(i,c,p),Wr(i,p))}function WA(i){var c=i.memoizedState,p=0;c!==null&&(p=c.retryLane),nC(i,p)}function KA(i,c){var p=0;switch(i.tag){case 13:var v=i.stateNode,S=i.memoizedState;S!==null&&(p=S.retryLane);break;case 19:v=i.stateNode;break;default:throw Error(n(314))}v!==null&&v.delete(c),nC(i,p)}var rC;rC=function(i,c,p){if(i!==null)if(i.memoizedProps!==c.pendingProps||Ur.current)qr=!0;else{if((i.lanes&p)===0&&(c.flags&128)===0)return qr=!1,OA(i,c,p);qr=(i.flags&131072)!==0}else qr=!1,Mn&&(c.flags&1048576)!==0&&DS(c,ef,c.index);switch(c.lanes=0,c.tag){case 2:var v=c.type;gf(i,c),i=c.pendingProps;var S=xl(c,yr.current);El(c,p),S=Pg(null,c,v,i,S,p);var E=Rg();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,Vr(v)?(E=!0,Yd(c)):E=!1,c.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,jg(c),S.updater=hf,c.stateNode=S,S._reactInternals=c,Lg(c,v,i,p),c=Ug(null,c,v,!0,E,p)):(c.tag=0,Mn&&E&&hg(c),Rr(null,c,S,p),c=c.child),c;case 16:v=c.elementType;e:{switch(gf(i,c),i=c.pendingProps,S=v._init,v=S(v._payload),c.type=v,S=c.tag=JA(v),i=$s(v,i),S){case 0:c=zg(null,c,v,i,p);break e;case 1:c=M0(null,c,v,i,p);break e;case 11:c=j0(null,c,v,i,p);break e;case 14:c=k0(null,c,v,$s(v.type,i),p);break e}throw Error(n(306,v,""))}return c;case 0:return v=c.type,S=c.pendingProps,S=c.elementType===v?S:$s(v,S),zg(i,c,v,S,p);case 1:return v=c.type,S=c.pendingProps,S=c.elementType===v?S:$s(v,S),M0(i,c,v,S,p);case 3:e:{if(_0(c),i===null)throw Error(n(387));v=c.pendingProps,E=c.memoizedState,S=E.element,HS(i,c),of(c,v,null,p);var R=c.memoizedState;if(v=R.element,E.isDehydrated)if(E={element:v,isDehydrated:!1,cache:R.cache,pendingSuspenseBoundaries:R.pendingSuspenseBoundaries,transitions:R.transitions},c.updateQueue.baseState=E,c.memoizedState=E,c.flags&256){S=Tl(Error(n(423)),c),c=P0(i,c,v,p,S);break e}else if(v!==S){S=Tl(Error(n(424)),c),c=P0(i,c,v,p,S);break e}else for(os=lo(c.stateNode.containerInfo.firstChild),as=c,Mn=!0,Ls=null,p=VS(c,null,v,p),c.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling;else{if(Cl(),v===S){c=Pa(i,c,p);break e}Rr(i,c,v,p)}c=c.child}return c;case 5:return GS(c),i===null&&vg(c),v=c.type,S=c.pendingProps,E=i!==null?i.memoizedProps:null,R=S.children,lg(v,S)?R=null:E!==null&&lg(v,E)&&(c.flags|=32),T0(i,c),Rr(i,c,R,p),c.child;case 6:return i===null&&vg(c),null;case 13:return R0(i,c,p);case 4:return kg(c,c.stateNode.containerInfo),v=c.pendingProps,i===null?c.child=jl(c,null,v,p):Rr(i,c,v,p),c.child;case 11:return v=c.type,S=c.pendingProps,S=c.elementType===v?S:$s(v,S),j0(i,c,v,S,p);case 7:return Rr(i,c,c.pendingProps,p),c.child;case 8:return Rr(i,c,c.pendingProps.children,p),c.child;case 12:return Rr(i,c,c.pendingProps.children,p),c.child;case 10:e:{if(v=c.type._context,S=c.pendingProps,E=c.memoizedProps,R=S.value,yn(rf,v._currentValue),v._currentValue=R,E!==null)if(Fs(E.value,R)){if(E.children===S.children&&!Ur.current){c=Pa(i,c,p);break e}}else for(E=c.child,E!==null&&(E.return=c);E!==null;){var L=E.dependencies;if(L!==null){R=E.child;for(var J=L.firstContext;J!==null;){if(J.context===v){if(E.tag===1){J=_a(-1,p&-p),J.tag=2;var ve=E.updateQueue;if(ve!==null){ve=ve.shared;var je=ve.pending;je===null?J.next=J:(J.next=je.next,je.next=J),ve.pending=J}}E.lanes|=p,J=E.alternate,J!==null&&(J.lanes|=p),Sg(E.return,p,c),L.lanes|=p;break}J=J.next}}else if(E.tag===10)R=E.type===c.type?null:E.child;else if(E.tag===18){if(R=E.return,R===null)throw Error(n(341));R.lanes|=p,L=R.alternate,L!==null&&(L.lanes|=p),Sg(R,p,c),R=E.sibling}else R=E.child;if(R!==null)R.return=E;else for(R=E;R!==null;){if(R===c){R=null;break}if(E=R.sibling,E!==null){E.return=R.return,R=E;break}R=R.return}E=R}Rr(i,c,S.children,p),c=c.child}return c;case 9:return S=c.type,v=c.pendingProps.children,El(c,p),S=ws(S),v=v(S),c.flags|=1,Rr(i,c,v,p),c.child;case 14:return v=c.type,S=$s(v,c.pendingProps),S=$s(v.type,S),k0(i,c,v,S,p);case 15:return E0(i,c,c.type,c.pendingProps,p);case 17:return v=c.type,S=c.pendingProps,S=c.elementType===v?S:$s(v,S),gf(i,c),c.tag=1,Vr(v)?(i=!0,Yd(c)):i=!1,El(c,p),v0(c,v,S),Lg(c,v,S,p),Ug(null,c,v,!0,i,p);case 19:return O0(i,c,p);case 22:return N0(i,c,p)}throw Error(n(156,c.tag))};function sC(i,c){return Kn(i,c)}function GA(i,c,p,v){this.tag=i,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 js(i,c,p,v){return new GA(i,c,p,v)}function lv(i){return i=i.prototype,!(!i||!i.isReactComponent)}function JA(i){if(typeof i=="function")return lv(i)?1:0;if(i!=null){if(i=i.$$typeof,i===z)return 11;if(i===ne)return 14}return 2}function xo(i,c){var p=i.alternate;return p===null?(p=js(i.tag,c,i.key,i.mode),p.elementType=i.elementType,p.type=i.type,p.stateNode=i.stateNode,p.alternate=i,i.alternate=p):(p.pendingProps=c,p.type=i.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=i.flags&14680064,p.childLanes=i.childLanes,p.lanes=i.lanes,p.child=i.child,p.memoizedProps=i.memoizedProps,p.memoizedState=i.memoizedState,p.updateQueue=i.updateQueue,c=i.dependencies,p.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},p.sibling=i.sibling,p.index=i.index,p.ref=i.ref,p}function Nf(i,c,p,v,S,E){var R=2;if(v=i,typeof i=="function")lv(i)&&(R=1);else if(typeof i=="string")R=5;else e:switch(i){case O:return ji(p.children,S,E,c);case D:R=8,S|=8;break;case F:return i=js(12,p,c,S|2),i.elementType=F,i.lanes=E,i;case ue:return i=js(13,p,c,S),i.elementType=ue,i.lanes=E,i;case V:return i=js(19,p,c,S),i.elementType=V,i.lanes=E,i;case se:return Tf(p,S,E,c);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case $:R=10;break e;case te:R=9;break e;case z:R=11;break e;case ne:R=14;break e;case Y:R=16,v=null;break e}throw Error(n(130,i==null?i:typeof i,""))}return c=js(R,p,c,S),c.elementType=i,c.type=v,c.lanes=E,c}function ji(i,c,p,v){return i=js(7,i,v,c),i.lanes=p,i}function Tf(i,c,p,v){return i=js(22,i,v,c),i.elementType=se,i.lanes=p,i.stateNode={isHidden:!1},i}function cv(i,c,p){return i=js(6,i,null,c),i.lanes=p,i}function uv(i,c,p){return c=js(4,i.children!==null?i.children:[],i.key,c),c.lanes=p,c.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},c}function QA(i,c,p,v,S){this.tag=c,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Fm(0),this.expirationTimes=Fm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fm(0),this.identifierPrefix=v,this.onRecoverableError=S,this.mutableSourceEagerHydrationData=null}function dv(i,c,p,v,S,E,R,L,J){return i=new QA(i,c,p,L,J),c===1?(c=1,E===!0&&(c|=8)):c=0,E=js(3,null,null,c),i.current=E,E.stateNode=i,E.memoizedState={element:v,isDehydrated:p,cache:null,transitions:null,pendingSuspenseBoundaries:null},jg(E),i}function YA(i,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(),yv.exports=UD(),yv.exports}var kC;function VD(){if(kC)return Df;kC=1;var e=XE();return Df.createRoot=e.createRoot,Df.hydrateRoot=e.hydrateRoot,Df}var qD=VD();const HD=md(qD),WD=(...e)=>{console?.warn&&(Ai(e[0])&&(e[0]=`react-i18next:: ${e[0]}`),console.warn(...e))},EC={},Jy=(...e)=>{Ai(e[0])&&EC[e[0]]||(Ai(e[0])&&(EC[e[0]]=new Date),WD(...e))},eN=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},NC=(e,t,n)=>{e.loadNamespaces(t,eN(e,n))},TC=(e,t,n,r)=>{Ai(n)&&(n=[n]),n.forEach(a=>{e.options.ns.indexOf(a)<0&&e.options.ns.push(a)}),e.loadLanguages(t,eN(e,r))},KD=(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,a)=>{if(n.bindI18n?.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!a(r.isLanguageChangingTo,e))return!1}}),Ai=e=>typeof e=="string",GD=e=>typeof e=="object"&&e!==null,JD=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,QD={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},YD=e=>QD[e],ZD=e=>e.replace(JD,YD);let Qy={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:ZD};const XD=(e={})=>{Qy={...Qy,...e}},e2=()=>Qy;let tN;const t2=e=>{tN=e},n2=()=>tN,r2={type:"3rdParty",init(e){XD(e.options.react),t2(e)}},nN=y.createContext();class s2{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]??=!0})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const a2=(e,t)=>{const n=y.useRef();return y.useEffect(()=>{n.current=e},[e,t]),n.current},rN=(e,t,n,r)=>e.getFixedT(t,n,r),o2=(e,t,n,r)=>y.useCallback(rN(e,t,n,r),[e,t,n,r]),Le=(e,t={})=>{const{i18n:n}=t,{i18n:r,defaultNS:a}=y.useContext(nN)||{},o=n||r||n2();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new s2),!o){Jy("You will need to pass in an i18next instance by using initReactI18next");const _=(M,O)=>Ai(O)?O:GD(O)&&Ai(O.defaultValue)?O.defaultValue:Array.isArray(M)?M[M.length-1]:M,P=[_,{},!1];return P.t=_,P.i18n={},P.ready=!1,P}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={...e2(),...o.options.react,...t},{useSuspense:u,keyPrefix:d}=l;let f=a||o.options?.defaultNS;f=Ai(f)?[f]:f||["translation"],o.reportNamespaces.addUsedNamespaces?.(f);const m=(o.isInitialized||o.initializedStoreOnce)&&f.every(_=>KD(_,o,l)),h=o2(o,t.lng||null,l.nsMode==="fallback"?f:f[0],d),g=()=>h,x=()=>rN(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=a2(C),N=y.useRef(!0);y.useEffect(()=>{const{bindI18n:_,bindI18nStore:P}=l;N.current=!0,!m&&!u&&(t.lng?TC(o,t.lng,f,()=>{N.current&&w(x)}):NC(o,f,()=>{N.current&&w(x)})),m&&k&&k!==C&&N.current&&w(x);const M=()=>{N.current&&w(x)};return _&&o?.on(_,M),P&&o?.store.on(P,M),()=>{N.current=!1,o&&_?.split(" ").forEach(O=>o.off(O,M)),P&&o&&P.split(" ").forEach(O=>o.store.off(O,M))}},[o,C]),y.useEffect(()=>{N.current&&m&&w(g)},[o,d,m]);const T=[b,o,m];if(T.t=b,T.i18n=o,T.ready=m,m||!m&&!u)return T;throw new Promise(_=>{t.lng?TC(o,t.lng,f,()=>_()):NC(o,f,()=>_())})};function i2({i18n:e,defaultNS:t,children:n}){const r=y.useMemo(()=>({i18n:e,defaultNS:t}),[e,t]);return y.createElement(nN.Provider,{value:r},n)}var bc=XE();const sN=md(bc),l2=LE({__proto__:null,default:sN},[bc]);/** - * @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 Dn(){return Dn=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function sc(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function u2(){return Math.random().toString(36).substr(2,8)}function _C(e,t){return{usr:e.state,key:e.key,idx:t}}function ed(e,t,n,r){return n===void 0&&(n=null),Dn({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Wo(t):t,{state:n,key:t&&t.key||r||u2()})}function Bi(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 Wo(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 d2(e,t,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:o=!1}=r,l=a.history,u=Jn.Pop,d=null,f=m();f==null&&(f=0,l.replaceState(Dn({},l.state,{idx:f}),""));function m(){return(l.state||{idx:null}).idx}function h(){u=Jn.Pop;let C=m(),k=C==null?null:C-f;f=C,d&&d({action:u,location:w.location,delta:k})}function g(C,k){u=Jn.Push;let N=ed(w.location,C,k);f=m()+1;let T=_C(N,f),_=w.createHref(N);try{l.pushState(T,"",_)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;a.location.assign(_)}o&&d&&d({action:u,location:w.location,delta:1})}function x(C,k){u=Jn.Replace;let N=ed(w.location,C,k);f=m();let T=_C(N,f),_=w.createHref(N);l.replaceState(T,"",_),o&&d&&d({action:u,location:w.location,delta:0})}function b(C){let k=a.location.origin!=="null"?a.location.origin:a.location.href,N=typeof C=="string"?C:Bi(C);return N=N.replace(/ $/,"%20"),Dt(k,"No window.location.(origin|href) available to create URL for href: "+N),new URL(N,k)}let w={get action(){return u},get location(){return e(a,l)},listen(C){if(d)throw new Error("A history only accepts one active listener");return a.addEventListener(MC,h),d=C,()=>{a.removeEventListener(MC,h),d=null}},createHref(C){return t(a,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 xn;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(xn||(xn={}));const f2=new Set(["lazy","caseSensitive","path","id","index","children"]);function p2(e){return e.index===!0}function td(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((a,o)=>{let l=[...n,String(o)],u=typeof a.id=="string"?a.id:l.join("-");if(Dt(a.index!==!0||!a.children,"Cannot specify children on an index route"),Dt(!r[u],'Found a route id collision on id "'+u+`". Route id's must be globally unique within Data Router usages`),p2(a)){let d=Dn({},a,t(a),{id:u});return r[u]=d,d}else{let d=Dn({},a,t(a),{id:u,children:void 0});return r[u]=d,a.children&&(d.children=td(a.children,t,l,r)),d}})}function Ti(e,t,n){return n===void 0&&(n="/"),vp(e,t,n,!1)}function vp(e,t,n,r){let a=typeof t=="string"?Wo(t):t,o=za(a.pathname||"/",n);if(o==null)return null;let l=aN(e);m2(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("/")&&(Dt(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=Ba([r,d.relativePath]),m=n.concat(d);o.children&&o.children.length>0&&(Dt(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),aN(o.children,t,m,f)),!(o.path==null&&!o.index)&&t.push({path:f,score:S2(f,o.index),routesMeta:m})};return e.forEach((o,l)=>{var u;if(o.path===""||!((u=o.path)!=null&&u.includes("?")))a(o,l);else for(let d of oN(o.path))a(o,l,d)}),t}function oN(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return a?[o,""]:[o];let l=oN(r.join("/")),u=[];return u.push(...l.map(d=>d===""?o:[o,d].join("/"))),a&&u.push(...l),u.map(d=>e.startsWith("/")&&d===""?"/":d)}function m2(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:C2(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const g2=/^:[\w-]+$/,v2=3,y2=2,b2=1,x2=10,w2=-2,PC=e=>e==="*";function S2(e,t){let n=e.split("/"),r=n.length;return n.some(PC)&&(r+=w2),t&&(r+=y2),n.filter(a=>!PC(a)).reduce((a,o)=>a+(g2.test(o)?v2:o===""?b2:x2),r)}function C2(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function j2(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,a={},o="/",l=[];for(let u=0;u{let{paramName:g,isOptional:x}=m;if(g==="*"){let w=u[h]||"";l=o.slice(0,o.length-w.length).replace(/(.)\/+$/,"$1")}const b=u[h];return x&&!b?f[g]=void 0:f[g]=(b||"").replace(/%2F/g,"/"),f},{}),pathname:o,pathnameBase:l,pattern:e}}function k2(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),sc(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=[],a="^"+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:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function E2(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return sc(!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 za(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 N2(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?Wo(e):e;return{pathname:n?n.startsWith("/")?n:T2(n,t):t,search:_2(r),hash:P2(a)}}function T2(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function wv(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 iN(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Sh(e,t){let n=iN(e);return t?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Ch(e,t,n,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=Wo(e):(a=Dn({},e),Dt(!a.pathname||!a.pathname.includes("?"),wv("?","pathname","search",a)),Dt(!a.pathname||!a.pathname.includes("#"),wv("#","pathname","hash",a)),Dt(!a.search||!a.search.includes("#"),wv("#","search","hash",a)));let o=e===""||a.pathname==="",l=o?"/":a.pathname,u;if(l==null)u=n;else{let h=t.length-1;if(!r&&l.startsWith("..")){let g=l.split("/");for(;g[0]==="..";)g.shift(),h-=1;a.pathname=g.join("/")}u=h>=0?t[h]:"/"}let d=N2(a,u),f=l&&l!=="/"&&l.endsWith("/"),m=(o||l===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(f||m)&&(d.pathname+="/"),d}const Ba=e=>e.join("/").replace(/\/\/+/g,"/"),M2=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),_2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,P2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class cx{constructor(t,n,r,a){a===void 0&&(a=!1),this.status=t,this.statusText=n||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function jh(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const lN=["post","put","patch","delete"],R2=new Set(lN),I2=["get",...lN],O2=new Set(I2),A2=new Set([301,302,303,307,308]),D2=new Set([307,308]),Sv={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},F2={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Su={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},ux=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,L2=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),cN="remix-router-transitions";function $2(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;Dt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a;if(e.mapRouteProperties)a=e.mapRouteProperties;else if(e.detectErrorBoundary){let Q=e.detectErrorBoundary;a=ae=>({hasErrorBoundary:Q(ae)})}else a=L2;let o={},l=td(e.routes,a,void 0,o),u,d=e.basename||"/",f=e.unstable_dataStrategy||q2,m=e.unstable_patchRoutesOnMiss,h=Dn({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,N=Ti(l,e.history.location,d),T=null;if(N==null&&!m){let Q=Or(404,{pathname:e.history.location.pathname}),{matches:ae,route:ge}=zC(l);N=ae,T={[ge.id]:Q}}N&&m&&!e.hydrationData&&li(N,l,e.history.location.pathname).active&&(N=null);let _;if(!N)_=!1,N=[];else if(N.some(Q=>Q.route.lazy))_=!1;else if(!N.some(Q=>Q.route.loader))_=!0;else if(h.v7_partialHydration){let Q=e.hydrationData?e.hydrationData.loaderData:null,ae=e.hydrationData?e.hydrationData.errors:null,ge=be=>be.route.loader?typeof be.route.loader=="function"&&be.route.loader.hydrate===!0?!1:Q&&Q[be.route.id]!==void 0||ae&&ae[be.route.id]!==void 0:!0;if(ae){let be=N.findIndex($e=>ae[$e.route.id]!==void 0);_=N.slice(0,be+1).every(ge)}else _=N.every(ge)}else _=e.hydrationData!=null;let P,M={historyAction:e.history.action,location:e.history.location,matches:N,initialized:_,navigation:Sv,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||T,fetchers:new Map,blockers:new Map},O=Jn.Pop,D=!1,F,$=!1,te=new Map,z=null,ue=!1,V=!1,ne=[],Y=[],se=new Map,H=0,W=-1,U=new Map,A=new Set,K=new Map,re=new Map,ee=new Set,ie=new Map,de=new Map,j=new Map,I=!1;function me(){if(g=e.history.listen(Q=>{let{action:ae,location:ge,delta:be}=Q;if(I){I=!1;return}sc(de.size===0||be!=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 $e=zr({currentLocation:M.location,nextLocation:ge,historyAction:ae});if($e&&be!=null){I=!0,e.history.go(be*-1),ur($e,{state:"blocked",location:ge,proceed(){ur($e,{state:"proceeding",proceed:void 0,reset:void 0,location:ge}),e.history.go(be)},reset(){let Ze=new Map(M.blockers);Ze.set($e,Su),Je({blockers:Ze})}});return}return Pn(ae,ge)}),n){rF(t,te);let Q=()=>sF(t,te);t.addEventListener("pagehide",Q),z=()=>t.removeEventListener("pagehide",Q)}return M.initialized||Pn(Jn.Pop,M.location,{initialHydration:!0}),P}function xe(){g&&g(),z&&z(),x.clear(),F&&F.abort(),M.fetchers.forEach((Q,ae)=>Nt(ae)),M.blockers.forEach((Q,ae)=>vr(ae))}function rt(Q){return x.add(Q),()=>x.delete(Q)}function Je(Q,ae){ae===void 0&&(ae={}),M=Dn({},M,Q);let ge=[],be=[];h.v7_fetcherPersist&&M.fetchers.forEach(($e,Ze)=>{$e.state==="idle"&&(ee.has(Ze)?be.push(Ze):ge.push(Ze))}),[...x].forEach($e=>$e(M,{deletedFetchers:be,unstable_viewTransitionOpts:ae.viewTransitionOpts,unstable_flushSync:ae.flushSync===!0})),h.v7_fetcherPersist&&(ge.forEach($e=>M.fetchers.delete($e)),be.forEach($e=>Nt($e)))}function nt(Q,ae,ge){var be,$e;let{flushSync:Ze}=ge===void 0?{}:ge,ct=M.actionData!=null&&M.navigation.formMethod!=null&&Hs(M.navigation.formMethod)&&M.navigation.state==="loading"&&((be=Q.state)==null?void 0:be._isRedirect)!==!0,Fe;ae.actionData?Object.keys(ae.actionData).length>0?Fe=ae.actionData:Fe=null:ct?Fe=M.actionData:Fe=null;let Tt=ae.loaderData?$C(M.loaderData,ae.loaderData,ae.matches||[],ae.errors):M.loaderData,Xe=M.blockers;Xe.size>0&&(Xe=new Map(Xe),Xe.forEach((rn,an)=>Xe.set(an,Su)));let st=D===!0||M.navigation.formMethod!=null&&Hs(M.navigation.formMethod)&&(($e=Q.state)==null?void 0:$e._isRedirect)!==!0;u&&(l=u,u=void 0),ue||O===Jn.Pop||(O===Jn.Push?e.history.push(Q,Q.state):O===Jn.Replace&&e.history.replace(Q,Q.state));let nn;if(O===Jn.Pop){let rn=te.get(M.location.pathname);rn&&rn.has(Q.pathname)?nn={currentLocation:M.location,nextLocation:Q}:te.has(Q.pathname)&&(nn={currentLocation:Q,nextLocation:M.location})}else if($){let rn=te.get(M.location.pathname);rn?rn.add(Q.pathname):(rn=new Set([Q.pathname]),te.set(M.location.pathname,rn)),nn={currentLocation:M.location,nextLocation:Q}}Je(Dn({},ae,{actionData:Fe,loaderData:Tt,historyAction:O,location:Q,initialized:!0,navigation:Sv,revalidation:"idle",restoreScrollPosition:Bc(Q,ae.matches||M.matches),preventScrollReset:st,blockers:Xe}),{viewTransitionOpts:nn,flushSync:Ze===!0}),O=Jn.Pop,D=!1,$=!1,ue=!1,V=!1,ne=[],Y=[]}async function qt(Q,ae){if(typeof Q=="number"){e.history.go(Q);return}let ge=Yy(M.location,M.matches,d,h.v7_prependBasename,Q,h.v7_relativeSplatPath,ae?.fromRouteId,ae?.relative),{path:be,submission:$e,error:Ze}=RC(h.v7_normalizeFormMethod,!1,ge,ae),ct=M.location,Fe=ed(M.location,be,ae&&ae.state);Fe=Dn({},Fe,e.history.encodeLocation(Fe));let Tt=ae&&ae.replace!=null?ae.replace:void 0,Xe=Jn.Push;Tt===!0?Xe=Jn.Replace:Tt===!1||$e!=null&&Hs($e.formMethod)&&$e.formAction===M.location.pathname+M.location.search&&(Xe=Jn.Replace);let st=ae&&"preventScrollReset"in ae?ae.preventScrollReset===!0:void 0,nn=(ae&&ae.unstable_flushSync)===!0,rn=zr({currentLocation:ct,nextLocation:Fe,historyAction:Xe});if(rn){ur(rn,{state:"blocked",location:Fe,proceed(){ur(rn,{state:"proceeding",proceed:void 0,reset:void 0,location:Fe}),qt(Q,ae)},reset(){let an=new Map(M.blockers);an.set(rn,Su),Je({blockers:an})}});return}return await Pn(Xe,Fe,{submission:$e,pendingError:Ze,preventScrollReset:st,replace:ae&&ae.replace,enableViewTransition:ae&&ae.unstable_viewTransition,flushSync:nn})}function Wn(){if(Ie(),Je({revalidation:"loading"}),M.navigation.state!=="submitting"){if(M.navigation.state==="idle"){Pn(M.historyAction,M.location,{startUninterruptedRevalidation:!0});return}Pn(O||M.historyAction,M.navigation.location,{overrideNavigation:M.navigation})}}async function Pn(Q,ae,ge){F&&F.abort(),F=null,O=Q,ue=(ge&&ge.startUninterruptedRevalidation)===!0,Md(M.location,M.matches),D=(ge&&ge.preventScrollReset)===!0,$=(ge&&ge.enableViewTransition)===!0;let be=u||l,$e=ge&&ge.overrideNavigation,Ze=Ti(be,ae,d),ct=(ge&&ge.flushSync)===!0,Fe=li(Ze,be,ae.pathname);if(Fe.active&&Fe.matches&&(Ze=Fe.matches),!Ze){let{error:Kt,notFoundMatches:Kn,route:In}=_r(ae.pathname);nt(ae,{matches:Kn,loaderData:{},errors:{[In.id]:Kt}},{flushSync:ct});return}if(M.initialized&&!V&&Q2(M.location,ae)&&!(ge&&ge.submission&&Hs(ge.submission.formMethod))){nt(ae,{matches:Ze},{flushSync:ct});return}F=new AbortController;let Tt=Il(e.history,ae,F.signal,ge&&ge.submission),Xe;if(ge&&ge.pendingError)Xe=[Wl(Ze).route.id,{type:xn.error,error:ge.pendingError}];else if(ge&&ge.submission&&Hs(ge.submission.formMethod)){let Kt=await tr(Tt,ae,ge.submission,Ze,Fe.active,{replace:ge.replace,flushSync:ct});if(Kt.shortCircuited)return;if(Kt.pendingActionResult){let[Kn,In]=Kt.pendingActionResult;if(cs(In)&&jh(In.error)&&In.error.status===404){F=null,nt(ae,{matches:Kt.matches,loaderData:{},errors:{[Kn]:In.error}});return}}Ze=Kt.matches||Ze,Xe=Kt.pendingActionResult,$e=Cv(ae,ge.submission),ct=!1,Fe.active=!1,Tt=Il(e.history,Tt.url,Tt.signal)}let{shortCircuited:st,matches:nn,loaderData:rn,errors:an}=await wn(Tt,ae,Ze,Fe.active,$e,ge&&ge.submission,ge&&ge.fetcherSubmission,ge&&ge.replace,ge&&ge.initialHydration===!0,ct,Xe);st||(F=null,nt(ae,Dn({matches:nn||Ze},BC(Xe),{loaderData:rn,errors:an})))}async function tr(Q,ae,ge,be,$e,Ze){Ze===void 0&&(Ze={}),Ie();let ct=tF(ae,ge);if(Je({navigation:ct},{flushSync:Ze.flushSync===!0}),$e){let Xe=await ci(be,ae.pathname,Q.signal);if(Xe.type==="aborted")return{shortCircuited:!0};if(Xe.type==="error"){let{boundaryId:st,error:nn}=ts(ae.pathname,Xe);return{matches:Xe.partialMatches,pendingActionResult:[st,{type:xn.error,error:nn}]}}else if(Xe.matches)be=Xe.matches;else{let{notFoundMatches:st,error:nn,route:rn}=_r(ae.pathname);return{matches:st,pendingActionResult:[rn.id,{type:xn.error,error:nn}]}}}let Fe,Tt=Bu(be,ae);if(!Tt.route.action&&!Tt.route.lazy)Fe={type:xn.error,error:Or(405,{method:Q.method,pathname:ae.pathname,routeId:Tt.route.id})};else if(Fe=(await pe("action",Q,[Tt],be))[0],Q.signal.aborted)return{shortCircuited:!0};if(_i(Fe)){let Xe;return Ze&&Ze.replace!=null?Xe=Ze.replace:Xe=DC(Fe.response.headers.get("Location"),new URL(Q.url),d)===M.location.pathname+M.location.search,await oe(Q,Fe,{submission:ge,replace:Xe}),{shortCircuited:!0}}if(Mi(Fe))throw Or(400,{type:"defer-action"});if(cs(Fe)){let Xe=Wl(be,Tt.route.id);return(Ze&&Ze.replace)!==!0&&(O=Jn.Push),{matches:be,pendingActionResult:[Xe.route.id,Fe]}}return{matches:be,pendingActionResult:[Tt.route.id,Fe]}}async function wn(Q,ae,ge,be,$e,Ze,ct,Fe,Tt,Xe,st){let nn=$e||Cv(ae,Ze),rn=Ze||ct||qC(nn),an=!ue&&(!h.v7_partialHydration||!Tt);if(be){if(an){let Gt=$r(st);Je(Dn({navigation:nn},Gt!==void 0?{actionData:Gt}:{}),{flushSync:Xe})}let St=await ci(ge,ae.pathname,Q.signal);if(St.type==="aborted")return{shortCircuited:!0};if(St.type==="error"){let{boundaryId:Gt,error:Pr}=ts(ae.pathname,St);return{matches:St.partialMatches,loaderData:{},errors:{[Gt]:Pr}}}else if(St.matches)ge=St.matches;else{let{error:Gt,notFoundMatches:Pr,route:Vt}=_r(ae.pathname);return{matches:Pr,loaderData:{},errors:{[Vt.id]:Gt}}}}let Kt=u||l,[Kn,In]=IC(e.history,M,ge,rn,ae,h.v7_partialHydration&&Tt===!0,h.v7_skipActionErrorRevalidation,V,ne,Y,ee,K,A,Kt,d,st);if(ns(St=>!(ge&&ge.some(Gt=>Gt.route.id===St))||Kn&&Kn.some(Gt=>Gt.route.id===St)),W=++H,Kn.length===0&&In.length===0){let St=bt();return nt(ae,Dn({matches:ge,loaderData:{},errors:st&&cs(st[1])?{[st[0]]:st[1].error}:null},BC(st),St?{fetchers:new Map(M.fetchers)}:{}),{flushSync:Xe}),{shortCircuited:!0}}if(an){let St={};if(!be){St.navigation=nn;let Gt=$r(st);Gt!==void 0&&(St.actionData=Gt)}In.length>0&&(St.fetchers=Br(In)),Je(St,{flushSync:Xe})}In.forEach(St=>{se.has(St.key)&&vn(St.key),St.controller&&se.set(St.key,St.controller)});let di=()=>In.forEach(St=>vn(St.key));F&&F.signal.addEventListener("abort",di);let{loaderResults:ia,fetcherResults:dn}=await Ae(M.matches,ge,Kn,In,Q);if(Q.signal.aborted)return{shortCircuited:!0};F&&F.signal.removeEventListener("abort",di),In.forEach(St=>se.delete(St.key));let to=UC([...ia,...dn]);if(to){if(to.idx>=Kn.length){let St=In[to.idx-Kn.length].key;A.add(St)}return await oe(Q,to.result,{replace:Fe}),{shortCircuited:!0}}let{loaderData:la,errors:rs}=LC(M,ge,Kn,ia,st,In,dn,ie);ie.forEach((St,Gt)=>{St.subscribe(Pr=>{(Pr||St.done)&&ie.delete(Gt)})}),h.v7_partialHydration&&Tt&&M.errors&&Object.entries(M.errors).filter(St=>{let[Gt]=St;return!Kn.some(Pr=>Pr.route.id===Gt)}).forEach(St=>{let[Gt,Pr]=St;rs=Object.assign(rs||{},{[Gt]:Pr})});let ja=bt(),ul=zt(W),fi=ja||ul||In.length>0;return Dn({matches:ge,loaderData:la,errors:rs},fi?{fetchers:new Map(M.fetchers)}:{})}function $r(Q){if(Q&&!cs(Q[1]))return{[Q[0]]:Q[1].data};if(M.actionData)return Object.keys(M.actionData).length===0?null:M.actionData}function Br(Q){return Q.forEach(ae=>{let ge=M.fetchers.get(ae.key),be=Cu(void 0,ge?ge.data:void 0);M.fetchers.set(ae.key,be)}),new Map(M.fetchers)}function or(Q,ae,ge,be){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.");se.has(Q)&&vn(Q);let $e=(be&&be.unstable_flushSync)===!0,Ze=u||l,ct=Yy(M.location,M.matches,d,h.v7_prependBasename,ge,h.v7_relativeSplatPath,ae,be?.relative),Fe=Ti(Ze,ct,d),Tt=li(Fe,Ze,ct);if(Tt.active&&Tt.matches&&(Fe=Tt.matches),!Fe){De(Q,ae,Or(404,{pathname:ct}),{flushSync:$e});return}let{path:Xe,submission:st,error:nn}=RC(h.v7_normalizeFormMethod,!0,ct,be);if(nn){De(Q,ae,nn,{flushSync:$e});return}let rn=Bu(Fe,Xe);if(D=(be&&be.preventScrollReset)===!0,st&&Hs(st.formMethod)){Mr(Q,ae,Xe,rn,Fe,Tt.active,$e,st);return}K.set(Q,{routeId:ae,path:Xe}),B(Q,ae,Xe,rn,Fe,Tt.active,$e,st)}async function Mr(Q,ae,ge,be,$e,Ze,ct,Fe){Ie(),K.delete(Q);function Tt(Vt){if(!Vt.route.action&&!Vt.route.lazy){let Ds=Or(405,{method:Fe.formMethod,pathname:ge,routeId:ae});return De(Q,ae,Ds,{flushSync:ct}),!0}return!1}if(!Ze&&Tt(be))return;let Xe=M.fetchers.get(Q);Te(Q,nF(Fe,Xe),{flushSync:ct});let st=new AbortController,nn=Il(e.history,ge,st.signal,Fe);if(Ze){let Vt=await ci($e,ge,nn.signal);if(Vt.type==="aborted")return;if(Vt.type==="error"){let{error:Ds}=ts(ge,Vt);De(Q,ae,Ds,{flushSync:ct});return}else if(Vt.matches){if($e=Vt.matches,be=Bu($e,ge),Tt(be))return}else{De(Q,ae,Or(404,{pathname:ge}),{flushSync:ct});return}}se.set(Q,st);let rn=H,Kt=(await pe("action",nn,[be],$e))[0];if(nn.signal.aborted){se.get(Q)===st&&se.delete(Q);return}if(h.v7_fetcherPersist&&ee.has(Q)){if(_i(Kt)||cs(Kt)){Te(Q,No(void 0));return}}else{if(_i(Kt))if(se.delete(Q),W>rn){Te(Q,No(void 0));return}else return A.add(Q),Te(Q,Cu(Fe)),oe(nn,Kt,{fetcherSubmission:Fe});if(cs(Kt)){De(Q,ae,Kt.error);return}}if(Mi(Kt))throw Or(400,{type:"defer-action"});let Kn=M.navigation.location||M.location,In=Il(e.history,Kn,st.signal),di=u||l,ia=M.navigation.state!=="idle"?Ti(di,M.navigation.location,d):M.matches;Dt(ia,"Didn't find any matches after fetcher action");let dn=++H;U.set(Q,dn);let to=Cu(Fe,Kt.data);M.fetchers.set(Q,to);let[la,rs]=IC(e.history,M,ia,Fe,Kn,!1,h.v7_skipActionErrorRevalidation,V,ne,Y,ee,K,A,di,d,[be.route.id,Kt]);rs.filter(Vt=>Vt.key!==Q).forEach(Vt=>{let Ds=Vt.key,_d=M.fetchers.get(Ds),Am=Cu(void 0,_d?_d.data:void 0);M.fetchers.set(Ds,Am),se.has(Ds)&&vn(Ds),Vt.controller&&se.set(Ds,Vt.controller)}),Je({fetchers:new Map(M.fetchers)});let ja=()=>rs.forEach(Vt=>vn(Vt.key));st.signal.addEventListener("abort",ja);let{loaderResults:ul,fetcherResults:fi}=await Ae(M.matches,ia,la,rs,In);if(st.signal.aborted)return;st.signal.removeEventListener("abort",ja),U.delete(Q),se.delete(Q),rs.forEach(Vt=>se.delete(Vt.key));let St=UC([...ul,...fi]);if(St){if(St.idx>=la.length){let Vt=rs[St.idx-la.length].key;A.add(Vt)}return oe(In,St.result)}let{loaderData:Gt,errors:Pr}=LC(M,M.matches,la,ul,void 0,rs,fi,ie);if(M.fetchers.has(Q)){let Vt=No(Kt.data);M.fetchers.set(Q,Vt)}zt(dn),M.navigation.state==="loading"&&dn>W?(Dt(O,"Expected pending action"),F&&F.abort(),nt(M.navigation.location,{matches:ia,loaderData:Gt,errors:Pr,fetchers:new Map(M.fetchers)})):(Je({errors:Pr,loaderData:$C(M.loaderData,Gt,ia,Pr),fetchers:new Map(M.fetchers)}),V=!1)}async function B(Q,ae,ge,be,$e,Ze,ct,Fe){let Tt=M.fetchers.get(Q);Te(Q,Cu(Fe,Tt?Tt.data:void 0),{flushSync:ct});let Xe=new AbortController,st=Il(e.history,ge,Xe.signal);if(Ze){let Kt=await ci($e,ge,st.signal);if(Kt.type==="aborted")return;if(Kt.type==="error"){let{error:Kn}=ts(ge,Kt);De(Q,ae,Kn,{flushSync:ct});return}else if(Kt.matches)$e=Kt.matches,be=Bu($e,ge);else{De(Q,ae,Or(404,{pathname:ge}),{flushSync:ct});return}}se.set(Q,Xe);let nn=H,an=(await pe("loader",st,[be],$e))[0];if(Mi(an)&&(an=await hN(an,st.signal,!0)||an),se.get(Q)===Xe&&se.delete(Q),!st.signal.aborted){if(ee.has(Q)){Te(Q,No(void 0));return}if(_i(an))if(W>nn){Te(Q,No(void 0));return}else{A.add(Q),await oe(st,an);return}if(cs(an)){De(Q,ae,an.error);return}Dt(!Mi(an),"Unhandled fetcher deferred data"),Te(Q,No(an.data))}}async function oe(Q,ae,ge){let{submission:be,fetcherSubmission:$e,replace:Ze}=ge===void 0?{}:ge;ae.response.headers.has("X-Remix-Revalidate")&&(V=!0);let ct=ae.response.headers.get("Location");Dt(ct,"Expected a Location header on the redirect Response"),ct=DC(ct,new URL(Q.url),d);let Fe=ed(M.location,ct,{_isRedirect:!0});if(n){let an=!1;if(ae.response.headers.has("X-Remix-Reload-Document"))an=!0;else if(ux.test(ct)){const Kt=e.history.createURL(ct);an=Kt.origin!==t.location.origin||za(Kt.pathname,d)==null}if(an){Ze?t.location.replace(ct):t.location.assign(ct);return}}F=null;let Tt=Ze===!0?Jn.Replace:Jn.Push,{formMethod:Xe,formAction:st,formEncType:nn}=M.navigation;!be&&!$e&&Xe&&st&&nn&&(be=qC(M.navigation));let rn=be||$e;if(D2.has(ae.response.status)&&rn&&Hs(rn.formMethod))await Pn(Tt,Fe,{submission:Dn({},rn,{formAction:ct}),preventScrollReset:D});else{let an=Cv(Fe,be);await Pn(Tt,Fe,{overrideNavigation:an,fetcherSubmission:$e,preventScrollReset:D})}}async function pe(Q,ae,ge,be){try{let $e=await H2(f,Q,ae,ge,be,o,a);return await Promise.all($e.map((Ze,ct)=>{if(Z2(Ze)){let Fe=Ze.result;return{type:xn.redirect,response:G2(Fe,ae,ge[ct].route.id,be,d,h.v7_relativeSplatPath)}}return K2(Ze)}))}catch($e){return ge.map(()=>({type:xn.error,error:$e}))}}async function Ae(Q,ae,ge,be,$e){let[Ze,...ct]=await Promise.all([ge.length?pe("loader",$e,ge,ae):[],...be.map(Fe=>{if(Fe.matches&&Fe.match&&Fe.controller){let Tt=Il(e.history,Fe.path,Fe.controller.signal);return pe("loader",Tt,[Fe.match],Fe.matches).then(Xe=>Xe[0])}else return Promise.resolve({type:xn.error,error:Or(404,{pathname:Fe.path})})})]);return await Promise.all([VC(Q,ge,Ze,Ze.map(()=>$e.signal),!1,M.loaderData),VC(Q,be.map(Fe=>Fe.match),ct,be.map(Fe=>Fe.controller?Fe.controller.signal:null),!0)]),{loaderResults:Ze,fetcherResults:ct}}function Ie(){V=!0,ne.push(...ns()),K.forEach((Q,ae)=>{se.has(ae)&&(Y.push(ae),vn(ae))})}function Te(Q,ae,ge){ge===void 0&&(ge={}),M.fetchers.set(Q,ae),Je({fetchers:new Map(M.fetchers)},{flushSync:(ge&&ge.flushSync)===!0})}function De(Q,ae,ge,be){be===void 0&&(be={});let $e=Wl(M.matches,ae);Nt(Q),Je({errors:{[$e.route.id]:ge},fetchers:new Map(M.fetchers)},{flushSync:(be&&be.flushSync)===!0})}function pt(Q){return h.v7_fetcherPersist&&(re.set(Q,(re.get(Q)||0)+1),ee.has(Q)&&ee.delete(Q)),M.fetchers.get(Q)||F2}function Nt(Q){let ae=M.fetchers.get(Q);se.has(Q)&&!(ae&&ae.state==="loading"&&U.has(Q))&&vn(Q),K.delete(Q),U.delete(Q),A.delete(Q),ee.delete(Q),M.fetchers.delete(Q)}function Rn(Q){if(h.v7_fetcherPersist){let ae=(re.get(Q)||0)-1;ae<=0?(re.delete(Q),ee.add(Q)):re.set(Q,ae)}else Nt(Q);Je({fetchers:new Map(M.fetchers)})}function vn(Q){let ae=se.get(Q);Dt(ae,"Expected fetch controller: "+Q),ae.abort(),se.delete(Q)}function Ee(Q){for(let ae of Q){let ge=pt(ae),be=No(ge.data);M.fetchers.set(ae,be)}}function bt(){let Q=[],ae=!1;for(let ge of A){let be=M.fetchers.get(ge);Dt(be,"Expected fetcher: "+ge),be.state==="loading"&&(A.delete(ge),Q.push(ge),ae=!0)}return Ee(Q),ae}function zt(Q){let ae=[];for(let[ge,be]of U)if(be0}function Tn(Q,ae){let ge=M.blockers.get(Q)||Su;return de.get(Q)!==ae&&de.set(Q,ae),ge}function vr(Q){M.blockers.delete(Q),de.delete(Q)}function ur(Q,ae){let ge=M.blockers.get(Q)||Su;Dt(ge.state==="unblocked"&&ae.state==="blocked"||ge.state==="blocked"&&ae.state==="blocked"||ge.state==="blocked"&&ae.state==="proceeding"||ge.state==="blocked"&&ae.state==="unblocked"||ge.state==="proceeding"&&ae.state==="unblocked","Invalid blocker state transition: "+ge.state+" -> "+ae.state);let be=new Map(M.blockers);be.set(Q,ae),Je({blockers:be})}function zr(Q){let{currentLocation:ae,nextLocation:ge,historyAction:be}=Q;if(de.size===0)return;de.size>1&&sc(!1,"A router only supports one blocker at a time");let $e=Array.from(de.entries()),[Ze,ct]=$e[$e.length-1],Fe=M.blockers.get(Ze);if(!(Fe&&Fe.state==="proceeding")&&ct({currentLocation:ae,nextLocation:ge,historyAction:be}))return Ze}function _r(Q){let ae=Or(404,{pathname:Q}),ge=u||l,{matches:be,route:$e}=zC(ge);return ns(),{notFoundMatches:be,route:$e,error:ae}}function ts(Q,ae){return{boundaryId:Wl(ae.partialMatches).route.id,error:Or(400,{type:"route-discovery",pathname:Q,message:ae.error!=null&&"message"in ae.error?ae.error:String(ae.error)})}}function ns(Q){let ae=[];return ie.forEach((ge,be)=>{(!Q||Q(be))&&(ge.cancel(),ae.push(be),ie.delete(be))}),ae}function eo(Q,ae,ge){if(b=Q,C=ae,w=ge||null,!k&&M.navigation===Sv){k=!0;let be=Bc(M.location,M.matches);be!=null&&Je({restoreScrollPosition:be})}return()=>{b=null,C=null,w=null}}function $c(Q,ae){return w&&w(Q,ae.map(be=>h2(be,M.loaderData)))||Q.key}function Md(Q,ae){if(b&&C){let ge=$c(Q,ae);b[ge]=C()}}function Bc(Q,ae){if(b){let ge=$c(Q,ae),be=b[ge];if(typeof be=="number")return be}return null}function li(Q,ae,ge){if(m)if(Q){let be=Q[Q.length-1].route;if(be.path&&(be.path==="*"||be.path.endsWith("/*")))return{active:!0,matches:vp(ae,ge,d,!0)}}else return{active:!0,matches:vp(ae,ge,d,!0)||[]};return{active:!1,matches:null}}async function ci(Q,ae,ge){let be=Q,$e=be.length>0?be[be.length-1].route:null;for(;;){let Ze=u==null,ct=u||l;try{await V2(m,ae,be,ct,o,a,j,ge)}catch(st){return{type:"error",error:st,partialMatches:be}}finally{Ze&&(l=[...l])}if(ge.aborted)return{type:"aborted"};let Fe=Ti(ct,ae,d),Tt=!1;if(Fe){let st=Fe[Fe.length-1].route;if(st.index)return{type:"success",matches:Fe};if(st.path&&st.path.length>0)if(st.path==="*")Tt=!0;else return{type:"success",matches:Fe}}let Xe=vp(ct,ae,d,!0);if(!Xe||be.map(st=>st.route.id).join("-")===Xe.map(st=>st.route.id).join("-"))return{type:"success",matches:Tt?Fe:null};if(be=Xe,$e=be[be.length-1].route,$e.path==="*")return{type:"success",matches:be}}}function ui(Q){o={},u=td(Q,a,void 0,o)}function zc(Q,ae){let ge=u==null;dN(Q,ae,u||l,o,a),ge&&(l=[...l],Je({}))}return P={get basename(){return d},get future(){return h},get state(){return M},get routes(){return l},get window(){return t},initialize:me,subscribe:rt,enableScrollRestoration:eo,navigate:qt,fetch:or,revalidate:Wn,createHref:Q=>e.history.createHref(Q),encodeLocation:Q=>e.history.encodeLocation(Q),getFetcher:pt,deleteFetcher:Rn,dispose:xe,getBlocker:Tn,deleteBlocker:vr,patchRoutes:zc,_internalFetchControllers:se,_internalActiveDeferreds:ie,_internalSetRoutes:ui},P}function B2(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Yy(e,t,n,r,a,o,l,u){let d,f;if(l){d=[];for(let h of t)if(d.push(h),h.route.id===l){f=h;break}}else d=t,f=t[t.length-1];let m=Ch(a||".",Sh(d,o),za(e.pathname,n)||e.pathname,u==="path");return a==null&&(m.search=e.search,m.hash=e.hash),(a==null||a===""||a===".")&&f&&f.route.index&&!dx(m.search)&&(m.search=m.search?m.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(m.pathname=m.pathname==="/"?n:Ba([n,m.pathname])),Bi(m)}function RC(e,t,n,r){if(!r||!B2(r))return{path:n};if(r.formMethod&&!eF(r.formMethod))return{path:n,error:Or(405,{method:r.formMethod})};let a=()=>({path:n,error:Or(400,{type:"invalid-body"})}),o=r.formMethod||"get",l=e?o.toUpperCase():o.toLowerCase(),u=fN(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Hs(l))return a();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(!Hs(l))return a();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 a()}}}Dt(typeof FormData=="function","FormData is not available in this environment");let d,f;if(r.formData)d=Zy(r.formData),f=r.formData;else if(r.body instanceof FormData)d=Zy(r.body),f=r.body;else if(r.body instanceof URLSearchParams)d=r.body,f=FC(d);else if(r.body==null)d=new URLSearchParams,f=new FormData;else try{d=new URLSearchParams(r.body),f=FC(d)}catch{return a()}let m={formMethod:l,formAction:u,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(Hs(m.formMethod))return{path:n,submission:m};let h=Wo(n);return t&&h.search&&dx(h.search)&&d.append("index",""),h.search="?"+d,{path:Bi(h),submission:m}}function z2(e,t){let n=e;if(t){let r=e.findIndex(a=>a.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function IC(e,t,n,r,a,o,l,u,d,f,m,h,g,x,b,w){let C=w?cs(w[1])?w[1].error:w[1].data:void 0,k=e.createURL(t.location),N=e.createURL(a),T=w&&cs(w[1])?w[0]:void 0,_=T?z2(n,T):n,P=w?w[1].statusCode:void 0,M=l&&P&&P>=400,O=_.filter((F,$)=>{let{route:te}=F;if(te.lazy)return!0;if(te.loader==null)return!1;if(o)return typeof te.loader!="function"||te.loader.hydrate?!0:t.loaderData[te.id]===void 0&&(!t.errors||t.errors[te.id]===void 0);if(U2(t.loaderData,t.matches[$],F)||d.some(V=>V===F.route.id))return!0;let z=t.matches[$],ue=F;return OC(F,Dn({currentUrl:k,currentParams:z.params,nextUrl:N,nextParams:ue.params},r,{actionResult:C,actionStatus:P,defaultShouldRevalidate:M?!1:u||k.pathname+k.search===N.pathname+N.search||k.search!==N.search||uN(z,ue)}))}),D=[];return h.forEach((F,$)=>{if(o||!n.some(ne=>ne.route.id===F.routeId)||m.has($))return;let te=Ti(x,F.path,b);if(!te){D.push({key:$,routeId:F.routeId,path:F.path,matches:null,match:null,controller:null});return}let z=t.fetchers.get($),ue=Bu(te,F.path),V=!1;g.has($)?V=!1:f.includes($)?V=!0:z&&z.state!=="idle"&&z.data===void 0?V=u:V=OC(ue,Dn({currentUrl:k,currentParams:t.matches[t.matches.length-1].params,nextUrl:N,nextParams:n[n.length-1].params},r,{actionResult:C,actionStatus:P,defaultShouldRevalidate:M?!1:u})),V&&D.push({key:$,routeId:F.routeId,path:F.path,matches:te,match:ue,controller:new AbortController})}),[O,D]}function U2(e,t,n){let r=!t||n.route.id!==t.route.id,a=e[n.route.id]===void 0;return r||a}function uN(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function OC(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function V2(e,t,n,r,a,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:(m,h)=>{u.aborted||dN(m,h,r,a,o)}}),l.set(d,f)),f&&Y2(f)&&await f}finally{l.delete(d)}}function dN(e,t,n,r,a){if(e){var o;let l=r[e];Dt(l,"No route found to patch children into: routeId = "+e);let u=td(t,a,[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=td(t,a,["patch",String(n.length||"0")],r);n.push(...l)}}async function AC(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let a=n[e.id];Dt(a,"No route found in manifest");let o={};for(let l in r){let d=a[l]!==void 0&&l!=="hasErrorBoundary";sc(!d,'Route "'+a.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&&!f2.has(l)&&(o[l]=r[l])}Object.assign(a,o),Object.assign(a,Dn({},t(a),{lazy:void 0}))}function q2(e){return Promise.all(e.matches.map(t=>t.resolve()))}async function H2(e,t,n,r,a,o,l,u){let d=r.reduce((h,g)=>h.add(g.route.id),new Set),f=new Set,m=await e({matches:a.map(h=>{let g=d.has(h.route.id);return Dn({},h,{shouldLoad:g,resolve:b=>(f.add(h.route.id),g?W2(t,n,h,o,l,b,u):Promise.resolve({type:xn.data,result:void 0}))})}),request:n,params:a[0].params,context:u});return a.forEach(h=>Dt(f.has(h.route.id),'`match.resolve()` was not called for route id "'+h.route.id+'". You must call `match.resolve()` on every match passed to `dataStrategy` to ensure all routes are properly loaded.')),m.filter((h,g)=>d.has(a[g].route.id))}async function W2(e,t,n,r,a,o,l){let u,d,f=m=>{let h,g=new Promise((w,C)=>h=C);d=()=>h(),t.signal.addEventListener("abort",d);let x=w=>typeof m!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):m({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 m=n.route[e];if(n.route.lazy)if(m){let h,[g]=await Promise.all([f(m).catch(x=>{h=x}),AC(n.route,a,r)]);if(h!==void 0)throw h;u=g}else if(await AC(n.route,a,r),m=n.route[e],m)u=await f(m);else if(e==="action"){let h=new URL(t.url),g=h.pathname+h.search;throw Or(405,{method:t.method,pathname:g,routeId:n.route.id})}else return{type:xn.data,result:void 0};else if(m)u=await f(m);else{let h=new URL(t.url),g=h.pathname+h.search;throw Or(404,{pathname:g})}Dt(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(m){return{type:xn.error,result:m}}finally{d&&t.signal.removeEventListener("abort",d)}return u}async function K2(e){let{result:t,type:n,status:r}=e;if(pN(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:xn.error,error:u}}return n===xn.error?{type:xn.error,error:new cx(t.status,t.statusText,l),statusCode:t.status,headers:t.headers}:{type:xn.data,data:l,statusCode:t.status,headers:t.headers}}if(n===xn.error)return{type:xn.error,error:t,statusCode:jh(t)?t.status:r};if(X2(t)){var a,o;return{type:xn.deferred,deferredData:t,statusCode:(a=t.init)==null?void 0:a.status,headers:((o=t.init)==null?void 0:o.headers)&&new Headers(t.init.headers)}}return{type:xn.data,data:t,statusCode:r}}function G2(e,t,n,r,a,o){let l=e.headers.get("Location");if(Dt(l,"Redirects returned/thrown from loaders/actions must have a Location header"),!ux.test(l)){let u=r.slice(0,r.findIndex(d=>d.route.id===n)+1);l=Yy(new URL(t.url),u,a,!0,l,o),e.headers.set("Location",l)}return e}function DC(e,t,n){if(ux.test(e)){let r=e,a=r.startsWith("//")?new URL(t.protocol+r):new URL(r),o=za(a.pathname,n)!=null;if(a.origin===t.origin&&o)return a.pathname+a.search+a.hash}return e}function Il(e,t,n,r){let a=e.createURL(fN(t)).toString(),o={signal:n};if(r&&Hs(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=Zy(r.formData):o.body=r.formData}return new Request(a,o)}function Zy(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function FC(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function J2(e,t,n,r,a,o){let l={},u=null,d,f=!1,m={},h=r&&cs(r[1])?r[1].error:void 0;return n.forEach((g,x)=>{let b=t[x].route.id;if(Dt(!_i(g),"Cannot handle redirect results in processLoaderData"),cs(g)){let w=g.error;h!==void 0&&(w=h,h=void 0),u=u||{};{let C=Wl(e,b);u[C.route.id]==null&&(u[C.route.id]=w)}l[b]=void 0,f||(f=!0,d=jh(g.error)?g.error.status:500),g.headers&&(m[b]=g.headers)}else Mi(g)?(a.set(b,g.deferredData),l[b]=g.deferredData.data,g.statusCode!=null&&g.statusCode!==200&&!f&&(d=g.statusCode),g.headers&&(m[b]=g.headers)):(l[b]=g.data,g.statusCode&&g.statusCode!==200&&!f&&(d=g.statusCode),g.headers&&(m[b]=g.headers))}),h!==void 0&&r&&(u={[r[0]]:h},l[r[0]]=void 0),{loaderData:l,errors:u,statusCode:d||200,loaderHeaders:m}}function LC(e,t,n,r,a,o,l,u){let{loaderData:d,errors:f}=J2(t,n,r,a,u);for(let m=0;mr.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function zC(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 Or(e,t){let{pathname:n,routeId:r,method:a,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):a&&n&&r?d="You made a "+a+' 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",a&&n&&r?d="You made a "+a.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":a&&(d='Invalid request method "'+a.toUpperCase()+'"')),new cx(e||500,u,new Error(d),!0)}function UC(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(_i(n))return{result:n,idx:t}}}function fN(e){let t=typeof e=="string"?Wo(e):e;return Bi(Dn({},t,{hash:""}))}function Q2(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Y2(e){return typeof e=="object"&&e!=null&&"then"in e}function Z2(e){return pN(e.result)&&A2.has(e.result.status)}function Mi(e){return e.type===xn.deferred}function cs(e){return e.type===xn.error}function _i(e){return(e&&e.type)===xn.redirect}function X2(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 pN(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function eF(e){return O2.has(e.toLowerCase())}function Hs(e){return R2.has(e.toLowerCase())}async function VC(e,t,n,r,a,o){for(let l=0;lh.route.id===d.route.id),m=f!=null&&!uN(f,d)&&(o&&o[d.route.id])!==void 0;if(Mi(u)&&(a||m)){let h=r[l];Dt(h,"Expected an AbortSignal for revalidating fetcher deferred result"),await hN(u,h,a).then(g=>{g&&(n[l]=g||n[l])})}}}async function hN(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:xn.data,data:e.deferredData.unwrappedData}}catch(a){return{type:xn.error,error:a}}return{type:xn.data,data:e.deferredData.data}}}function dx(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Bu(e,t){let n=typeof t=="string"?Wo(t).search:t.search;if(e[e.length-1].route.index&&dx(n||""))return e[e.length-1];let r=iN(e);return r[r.length-1]}function qC(e){let{formMethod:t,formAction:n,formEncType:r,text:a,formData:o,json:l}=e;if(!(!t||!n||!r)){if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:a};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 Cv(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 tF(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 Cu(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 nF(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 No(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 rF(e,t){try{let n=e.sessionStorage.getItem(cN);if(n){let r=JSON.parse(n);for(let[a,o]of Object.entries(r||{}))o&&Array.isArray(o)&&t.set(a,new Set(o||[]))}}catch{}}function sF(e,t){if(t.size>0){let n={};for(let[r,a]of t)n[r]=[...a];try{e.sessionStorage.setItem(cN,JSON.stringify(n))}catch(r){sc(!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 Bp(){return Bp=Object.assign?Object.assign.bind():function(e){for(var t=1;t{u.current=!0}),y.useCallback(function(f,m){if(m===void 0&&(m={}),!u.current)return;if(typeof f=="number"){r.go(f);return}let h=Ch(f,JSON.parse(l),o,m.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:Ba([t,h.pathname])),(m.replace?r.replace:r.push)(h,m.state,m)},[t,r,l,o,e])}function Is(){let{matches:e}=y.useContext(Ga),t=e[e.length-1];return t?t.params:{}}function kh(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=y.useContext(Ka),{matches:a}=y.useContext(Ga),{pathname:o}=Ko(),l=JSON.stringify(Sh(a,r.v7_relativeSplatPath));return y.useMemo(()=>Ch(e,JSON.parse(l),o,n==="path"),[e,l,o,n])}function iF(e,t,n,r){xc()||Dt(!1);let{navigator:a}=y.useContext(Ka),{matches:o}=y.useContext(Ga),l=o[o.length-1],u=l?l.params:{};l&&l.pathname;let d=l?l.pathnameBase:"/";l&&l.route;let f=Ko(),m;m=f;let h=m.pathname||"/",g=h;if(d!=="/"){let w=d.replace(/^\//,"").split("/");g="/"+h.replace(/^\//,"").split("/").slice(w.length).join("/")}let x=Ti(e,{pathname:g});return fF(x&&x.map(w=>Object.assign({},w,{params:Object.assign({},u,w.params),pathname:Ba([d,a.encodeLocation?a.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?d:Ba([d,a.encodeLocation?a.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),o,n,r)}function lF(){let e=gF(),t=jh(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a={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:a},n):null,null)}const cF=y.createElement(lF,null);class uF 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(Ga.Provider,{value:this.props.routeContext},y.createElement(mN.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function dF(e){let{routeContext:t,match:n,children:r}=e,a=y.useContext(gd);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),y.createElement(Ga.Provider,{value:t},r)}function fF(e,t,n,r){var a;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=(a=n)==null?void 0:a.errors;if(u!=null){let m=l.findIndex(h=>h.route.id&&u?.[h.route.id]!==void 0);m>=0||Dt(!1),l=l.slice(0,Math.min(l.length,m+1))}let d=!1,f=-1;if(n&&r&&r.v7_partialHydration)for(let m=0;m=0?l=l.slice(0,f+1):l=[l[0]];break}}}return l.reduceRight((m,h,g)=>{let x,b=!1,w=null,C=null;n&&(x=u&&h.route.id?u[h.route.id]:void 0,w=h.route.errorElement||cF,d&&(f<0&&g===0?(yF("route-fallback"),b=!0,C=null):f===g&&(b=!0,C=h.route.hydrateFallbackElement||null)));let k=t.concat(l.slice(0,g+1)),N=()=>{let T;return x?T=w:b?T=C:h.route.Component?T=y.createElement(h.route.Component,null):h.route.element?T=h.route.element:T=m,y.createElement(dF,{match:h,routeContext:{outlet:m,matches:k,isDataRoute:n!=null},children:T})};return n&&(h.route.ErrorBoundary||h.route.errorElement||g===0)?y.createElement(uF,{location:n.location,revalidation:n.revalidation,component:w,error:x,children:N(),routeContext:{outlet:null,matches:k,isDataRoute:!0}}):N()},null)}var vN=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(vN||{}),yN=(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})(yN||{});function pF(e){let t=y.useContext(gd);return t||Dt(!1),t}function hF(e){let t=y.useContext(fx);return t||Dt(!1),t}function mF(e){let t=y.useContext(Ga);return t||Dt(!1),t}function bN(e){let t=mF(),n=t.matches[t.matches.length-1];return n.route.id||Dt(!1),n.route.id}function gF(){var e;let t=y.useContext(mN),n=hF(yN.UseRouteError),r=bN();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function vF(){let{router:e}=pF(vN.UseNavigateStable),t=bN(),n=y.useRef(!1);return gN(()=>{n.current=!0}),y.useCallback(function(a,o){o===void 0&&(o={}),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,Bp({fromRouteId:t},o)))},[e,t])}const HC={};function yF(e,t,n){HC[e]||(HC[e]=!0)}function Xy(e){let{to:t,replace:n,state:r,relative:a}=e;xc()||Dt(!1);let{future:o,static:l}=y.useContext(Ka),{matches:u}=y.useContext(Ga),{pathname:d}=Ko(),f=Nn(),m=Ch(t,Sh(u,o.v7_relativeSplatPath),d,a==="path"),h=JSON.stringify(m);return y.useEffect(()=>f(JSON.parse(h),{replace:n,state:r,relative:a}),[f,h,a,n,r]),null}function bF(e){let{basename:t="/",children:n=null,location:r,navigationType:a=Jn.Pop,navigator:o,static:l=!1,future:u}=e;xc()&&Dt(!1);let d=t.replace(/^\/*/,"/"),f=y.useMemo(()=>({basename:d,navigator:o,static:l,future:Bp({v7_relativeSplatPath:!1},u)}),[d,u,o,l]);typeof r=="string"&&(r=Wo(r));let{pathname:m="/",search:h="",hash:g="",state:x=null,key:b="default"}=r,w=y.useMemo(()=>{let C=za(m,d);return C==null?null:{location:{pathname:C,search:h,hash:g,state:x,key:b},navigationType:a}},[d,m,h,g,x,b,a]);return w==null?null:y.createElement(Ka.Provider,{value:f},y.createElement(px.Provider,{children:n,value:w}))}new Promise(()=>{});function xF(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 ac(){return ac=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[a]=e[a]);return n}function wF(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function SF(e,t){return e.button===0&&(!t||t==="_self")&&!wF(e)}function eb(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(a=>[n,a]):[[n,r]])},[]))}function CF(e,t){let n=eb(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(o=>{n.append(a,o)})}),n}const jF=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],kF=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],EF="6";try{window.__reactRouterVersion=EF}catch{}function NF(e,t){return $2({basename:void 0,future:ac({},void 0,{v7_prependBasename:!0}),history:c2({window:void 0}),hydrationData:TF(),routes:e,mapRouteProperties:xF,unstable_dataStrategy:void 0,unstable_patchRoutesOnMiss:void 0,window:void 0}).initialize()}function TF(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=ac({},t,{errors:MF(t.errors)})),t}function MF(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,a]of t)if(a&&a.__type==="RouteErrorResponse")n[r]=new cx(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let o=window[a.__subType];if(typeof o=="function")try{let l=new o(a.message);l.stack="",n[r]=l}catch{}}if(n[r]==null){let o=new Error(a.message);o.stack="",n[r]=o}}else n[r]=a;return n}const wN=y.createContext({isTransitioning:!1}),_F=y.createContext(new Map),PF="startTransition",WC=Ho[PF],RF="flushSync",KC=l2[RF];function IF(e){WC?WC(e):e()}function ju(e){KC?KC(e):e()}class OF{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 AF(e){let{fallbackElement:t,router:n,future:r}=e,[a,o]=y.useState(n.state),[l,u]=y.useState(),[d,f]=y.useState({isTransitioning:!1}),[m,h]=y.useState(),[g,x]=y.useState(),[b,w]=y.useState(),C=y.useRef(new Map),{v7_startTransition:k}=r||{},N=y.useCallback(D=>{k?IF(D):D()},[k]),T=y.useCallback((D,F)=>{let{deletedFetchers:$,unstable_flushSync:te,unstable_viewTransitionOpts:z}=F;$.forEach(V=>C.current.delete(V)),D.fetchers.forEach((V,ne)=>{V.data!==void 0&&C.current.set(ne,V.data)});let ue=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!z||ue){te?ju(()=>o(D)):N(()=>o(D));return}if(te){ju(()=>{g&&(m&&m.resolve(),g.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:z.currentLocation,nextLocation:z.nextLocation})});let V=n.window.document.startViewTransition(()=>{ju(()=>o(D))});V.finished.finally(()=>{ju(()=>{h(void 0),x(void 0),u(void 0),f({isTransitioning:!1})})}),ju(()=>x(V));return}g?(m&&m.resolve(),g.skipTransition(),w({state:D,currentLocation:z.currentLocation,nextLocation:z.nextLocation})):(u(D),f({isTransitioning:!0,flushSync:!1,currentLocation:z.currentLocation,nextLocation:z.nextLocation}))},[n.window,g,m,C,N]);y.useLayoutEffect(()=>n.subscribe(T),[n,T]),y.useEffect(()=>{d.isTransitioning&&!d.flushSync&&h(new OF)},[d]),y.useEffect(()=>{if(m&&l&&n.window){let D=l,F=m.promise,$=n.window.document.startViewTransition(async()=>{N(()=>o(D)),await F});$.finished.finally(()=>{h(void 0),x(void 0),u(void 0),f({isTransitioning:!1})}),x($)}},[N,l,m,n.window]),y.useEffect(()=>{m&&l&&a.location.key===l.location.key&&m.resolve()},[m,g,a.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,F,$)=>n.navigate(D,{state:F,preventScrollReset:$?.preventScrollReset}),replace:(D,F,$)=>n.navigate(D,{replace:!0,state:F,preventScrollReset:$?.preventScrollReset})}),[n]),P=n.basename||"/",M=y.useMemo(()=>({router:n,navigator:_,static:!1,basename:P}),[n,_,P]),O=y.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return y.createElement(y.Fragment,null,y.createElement(gd.Provider,{value:M},y.createElement(fx.Provider,{value:a},y.createElement(_F.Provider,{value:C.current},y.createElement(wN.Provider,{value:d},y.createElement(bF,{basename:P,location:a.location,navigationType:a.historyAction,navigator:_,future:O},a.initialized||n.future.v7_partialHydration?y.createElement(DF,{routes:n.routes,future:n.future,state:a}):t))))),null)}const DF=y.memo(FF);function FF(e){let{routes:t,future:n,state:r}=e;return iF(t,void 0,r,n)}const LF=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",$F=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,BF=y.forwardRef(function(t,n){let{onClick:r,relative:a,reloadDocument:o,replace:l,state:u,target:d,to:f,preventScrollReset:m,unstable_viewTransition:h}=t,g=xN(t,jF),{basename:x}=y.useContext(Ka),b,w=!1;if(typeof f=="string"&&$F.test(f)&&(b=f,LF))try{let T=new URL(window.location.href),_=f.startsWith("//")?new URL(T.protocol+f):new URL(f),P=za(_.pathname,x);_.origin===T.origin&&P!=null?f=P+_.search+_.hash:w=!0}catch{}let C=aF(f,{relative:a}),k=UF(f,{replace:l,state:u,target:d,preventScrollReset:m,relative:a,unstable_viewTransition:h});function N(T){r&&r(T),T.defaultPrevented||k(T)}return y.createElement("a",ac({},g,{href:b||C,onClick:w||o?r:N,ref:n,target:d}))}),SN=y.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:a=!1,className:o="",end:l=!1,style:u,to:d,unstable_viewTransition:f,children:m}=t,h=xN(t,kF),g=kh(d,{relative:h.relative}),x=Ko(),b=y.useContext(fx),{navigator:w,basename:C}=y.useContext(Ka),k=b!=null&&VF(g)&&f===!0,N=w.encodeLocation?w.encodeLocation(g).pathname:g.pathname,T=x.pathname,_=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;a||(T=T.toLowerCase(),_=_?_.toLowerCase():null,N=N.toLowerCase()),_&&C&&(_=za(_,C)||_);const P=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let M=T===N||!l&&T.startsWith(N)&&T.charAt(P)==="/",O=_!=null&&(_===N||!l&&_.startsWith(N)&&_.charAt(N.length)==="/"),D={isActive:M,isPending:O,isTransitioning:k},F=M?r:void 0,$;typeof o=="function"?$=o(D):$=[o,M?"active":null,O?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let te=typeof u=="function"?u(D):u;return y.createElement(BF,ac({},h,{"aria-current":F,className:$,ref:n,style:te,to:d,unstable_viewTransition:f}),typeof m=="function"?m(D):m)});var tb;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(tb||(tb={}));var GC;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(GC||(GC={}));function zF(e){let t=y.useContext(gd);return t||Dt(!1),t}function UF(e,t){let{target:n,replace:r,state:a,preventScrollReset:o,relative:l,unstable_viewTransition:u}=t===void 0?{}:t,d=Nn(),f=Ko(),m=kh(e,{relative:l});return y.useCallback(h=>{if(SF(h,n)){h.preventDefault();let g=r!==void 0?r:Bi(f)===Bi(m);d(e,{replace:g,state:a,preventScrollReset:o,relative:l,unstable_viewTransition:u})}},[f,d,m,r,a,n,e,o,l,u])}function wc(e){let t=y.useRef(eb(e)),n=y.useRef(!1),r=Ko(),a=y.useMemo(()=>CF(r.search,n.current?null:t.current),[r.search]),o=Nn(),l=y.useCallback((u,d)=>{const f=eb(typeof u=="function"?u(a):u);n.current=!0,o("?"+f,d)},[o,a]);return[a,l]}function VF(e,t){t===void 0&&(t={});let n=y.useContext(wN);n==null&&Dt(!1);let{basename:r}=zF(tb.useViewTransitionState),a=kh(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=za(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=za(n.nextLocation.pathname,r)||n.nextLocation.pathname;return $p(a.pathname,l)!=null||$p(a.pathname,o)!=null}function CN(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;ttypeof e=="number"&&!isNaN(e),Di=e=>typeof e=="string",fs=e=>typeof e=="function",yp=e=>Di(e)||fs(e)?e:null,nb=e=>y.isValidElement(e)||Di(e)||fs(e)||nd(e);function qF(e,t,n){n===void 0&&(n=300);const{scrollHeight:r,style:a}=e;requestAnimationFrame(()=>{a.minHeight="initial",a.height=r+"px",a.transition=`all ${n}ms`,requestAnimationFrame(()=>{a.height="0",a.padding="0",a.margin="0",setTimeout(t,n)})})}function Eh(e){let{enter:t,exit:n,appendPosition:r=!1,collapse:a=!0,collapseDuration:o=300}=e;return function(l){let{children:u,position:d,preventExitTransition:f,done:m,nodeRef:h,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=h.current,N=b.split(" "),T=_=>{_.target===h.current&&(x(),k.removeEventListener("animationend",T),k.removeEventListener("animationcancel",T),C.current===0&&_.type!=="animationcancel"&&k.classList.remove(...N))};k.classList.add(...N),k.addEventListener("animationend",T),k.addEventListener("animationcancel",T)},[]),y.useEffect(()=>{const k=h.current,N=()=>{k.removeEventListener("animationend",N),a?qF(k,m,o):m()};g||(f?N():(C.current=1,k.className+=` ${w}`,k.addEventListener("animationend",N)))},[g]),ke.createElement(ke.Fragment,null,u)}}function JC(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 Ar=new Map;let rd=[];const rb=new Set,HF=e=>rb.forEach(t=>t(e)),jN=()=>Ar.size>0;function kN(e,t){var n;if(t)return!((n=Ar.get(t))==null||!n.isToastActive(e));let r=!1;return Ar.forEach(a=>{a.isToastActive(e)&&(r=!0)}),r}function EN(e,t){nb(e)&&(jN()||rd.push({content:e,options:t}),Ar.forEach(n=>{n.buildToast(e,t)}))}function QC(e,t){Ar.forEach(n=>{t!=null&&t!=null&&t.containerId?t?.containerId===n.id&&n.toggle(e,t?.id):n.toggle(e,t?.id)})}function WF(e){const{subscribe:t,getSnapshot:n,setProps:r}=y.useRef((function(o){const l=o.containerId||1;return{subscribe(u){const d=(function(m,h,g){let x=1,b=0,w=[],C=[],k=[],N=h;const T=new Map,_=new Set,P=()=>{k=Array.from(T.values()),_.forEach(D=>D())},M=D=>{C=D==null?[]:C.filter(F=>F!==D),P()},O=D=>{const{toastId:F,onOpen:$,updateId:te,children:z}=D.props,ue=te==null;D.staleId&&T.delete(D.staleId),T.set(F,D),C=[...C,D.props.toastId].filter(V=>V!==D.staleId),P(),g(JC(D,ue?"added":"updated")),ue&&fs($)&&$(y.isValidElement(z)&&z.props)};return{id:m,props:N,observe:D=>(_.add(D),()=>_.delete(D)),toggle:(D,F)=>{T.forEach($=>{F!=null&&F!==$.props.toastId||fs($.toggle)&&$.toggle(D)})},removeToast:M,toasts:T,clearQueue:()=>{b-=w.length,w=[]},buildToast:(D,F)=>{if((K=>{let{containerId:re,toastId:ee,updateId:ie}=K;const de=re?re!==m:m!==1,j=T.has(ee)&&ie==null;return de||j})(F))return;const{toastId:$,updateId:te,data:z,staleId:ue,delay:V}=F,ne=()=>{M($)},Y=te==null;Y&&b++;const se={...N,style:N.toastStyle,key:x++,...Object.fromEntries(Object.entries(F).filter(K=>{let[re,ee]=K;return ee!=null})),toastId:$,updateId:te,data:z,closeToast:ne,isIn:!1,className:yp(F.className||N.toastClassName),bodyClassName:yp(F.bodyClassName||N.bodyClassName),progressClassName:yp(F.progressClassName||N.progressClassName),autoClose:!F.isLoading&&(H=F.autoClose,W=N.autoClose,H===!1||nd(H)&&H>0?H:W),deleteToast(){const K=T.get($),{onClose:re,children:ee}=K.props;fs(re)&&re(y.isValidElement(ee)&&ee.props),g(JC(K,"removed")),T.delete($),b--,b<0&&(b=0),w.length>0?O(w.shift()):P()}};var H,W;se.closeButton=N.closeButton,F.closeButton===!1||nb(F.closeButton)?se.closeButton=F.closeButton:F.closeButton===!0&&(se.closeButton=!nb(N.closeButton)||N.closeButton);let U=D;y.isValidElement(D)&&!Di(D.type)?U=y.cloneElement(D,{closeToast:ne,toastProps:se,data:z}):fs(D)&&(U=D({closeToast:ne,toastProps:se,data:z}));const A={content:U,props:se,staleId:ue};N.limit&&N.limit>0&&b>N.limit&&Y?w.push(A):nd(V)?setTimeout(()=>{O(A)},V):O(A)},setProps(D){N=D},setToggle:(D,F)=>{T.get(D).toggle=F},isToastActive:D=>C.some(F=>F===D),getSnapshot:()=>N.newestOnTop?k.reverse():k}})(l,o,HF);Ar.set(l,d);const f=d.observe(u);return rd.forEach(m=>EN(m.content,m.options)),rd=[],()=>{f(),Ar.delete(l)}},setProps(u){var d;(d=Ar.get(l))==null||d.setProps(u)},getSnapshot(){var u;return(u=Ar.get(l))==null?void 0:u.getSnapshot()}}})(e)).current;r(e);const a=y.useSyncExternalStore(t,n,n);return{getToastToRender:function(o){if(!a)return[];const l=new Map;return a.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:kN,count:a?.length}}function KF(e){const[t,n]=y.useState(!1),[r,a]=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:m,closeOnClick:h}=e;var g,x;function b(){n(!0)}function w(){n(!1)}function C(T){const _=o.current;l.canDrag&&_&&(l.didMove=!0,t&&w(),l.delta=e.draggableDirection==="x"?T.clientX-l.start:T.clientY-l.start,l.start!==T.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 T=o.current;if(l.canDrag&&l.didMove&&T){if(l.canDrag=!1,Math.abs(l.delta)>l.removalDistance)return a(!0),e.closeToast(),void e.collapseAll();T.style.transition="transform 0.2s, opacity 0.2s",T.style.removeProperty("transform"),T.style.removeProperty("opacity")}}(x=Ar.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 N={onPointerDown:function(T){if(e.draggable===!0||e.draggable===T.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=T.clientX,l.removalDistance=_.offsetWidth*(e.draggablePercent/100)):(l.start=T.clientY,l.removalDistance=_.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent)/100)}},onPointerUp:function(T){const{top:_,bottom:P,left:M,right:O}=o.current.getBoundingClientRect();T.nativeEvent.type!=="touchend"&&e.pauseOnHover&&T.clientX>=M&&T.clientX<=O&&T.clientY>=_&&T.clientY<=P?w():b()}};return u&&d&&(N.onMouseEnter=w,e.stacked||(N.onMouseLeave=b)),h&&(N.onClick=T=>{m&&m(T),l.canCloseOnClick&&f()}),{playToast:b,pauseToast:w,isRunning:t,preventExitTransition:r,toastRef:o,eventHandlers:N}}function GF(e){let{delay:t,isRunning:n,closeToast:r,type:a="default",hide:o,className:l,style:u,controlledProgress:d,progress:f,rtl:m,isIn:h,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=Js("Toastify__progress-bar",d?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${g}`,`Toastify__progress-bar--${a}`,{"Toastify__progress-bar--rtl":m}),C=fs(l)?l({rtl:m,type:a,defaultClassName:w}):Js(w,l),k={[d&&f>=1?"onTransitionEnd":"onAnimationEnd"]:d&&f<1?null:()=>{h&&r()}};return ke.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":x},ke.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${g} Toastify__progress-bar--${a}`}),ke.createElement("div",{role:"progressbar","aria-hidden":x?"true":"false","aria-label":"notification timer",className:C,style:b,...k}))}let JF=1;const NN=()=>""+JF++;function QF(e){return e&&(Di(e.toastId)||nd(e.toastId))?e.toastId:NN()}function Gu(e,t){return EN(e,t),t.toastId}function zp(e,t){return{...t,type:t&&t.type||e,toastId:QF(t)}}function Ff(e){return(t,n)=>Gu(t,zp(e,n))}function X(e,t){return Gu(e,zp("default",t))}X.loading=(e,t)=>Gu(e,zp("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),X.promise=function(e,t,n){let r,{pending:a,error:o,success:l}=t;a&&(r=Di(a)?X.loading(a,n):X.loading(a.render,{...n,...a}));const u={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},d=(m,h,g)=>{if(h==null)return void X.dismiss(r);const x={type:m,...u,...n,data:g},b=Di(h)?{render:h}:h;return r?X.update(r,{...x,...b}):X(b.render,{...x,...b}),g},f=fs(e)?e():e;return f.then(m=>d("success",l,m)).catch(m=>d("error",o,m)),f},X.success=Ff("success"),X.info=Ff("info"),X.error=Ff("error"),X.warning=Ff("warning"),X.warn=X.warning,X.dark=(e,t)=>Gu(e,zp("default",{theme:"dark",...t})),X.dismiss=function(e){(function(t){var n;if(jN()){if(t==null||Di(n=t)||nd(n))Ar.forEach(r=>{r.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){const r=Ar.get(t.containerId);r?r.removeToast(t.id):Ar.forEach(a=>{a.removeToast(t.id)})}}else rd=rd.filter(r=>t!=null&&r.options.toastId!==t)})(e)},X.clearWaitingQueue=function(e){e===void 0&&(e={}),Ar.forEach(t=>{!t.props.limit||e.containerId&&t.id!==e.containerId||t.clearQueue()})},X.isActive=kN,X.update=function(e,t){t===void 0&&(t={});const n=((r,a)=>{var o;let{containerId:l}=a;return(o=Ar.get(l||1))==null?void 0:o.toasts.get(r)})(e,t);if(n){const{props:r,content:a}=n,o={delay:100,...r,...t,toastId:t.toastId||e,updateId:NN()};o.toastId!==e&&(o.staleId=e);const l=o.render||a;delete o.render,Gu(l,o)}},X.done=e=>{X.update(e,{progress:1})},X.onChange=function(e){return rb.add(e),()=>{rb.delete(e)}},X.play=e=>QC(!0,e),X.pause=e=>QC(!1,e);const YF=typeof window<"u"?y.useLayoutEffect:y.useEffect,Lf=e=>{let{theme:t,type:n,isLoading:r,...a}=e;return ke.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...a})},jv={info:function(e){return ke.createElement(Lf,{...e},ke.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 ke.createElement(Lf,{...e},ke.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 ke.createElement(Lf,{...e},ke.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 ke.createElement(Lf,{...e},ke.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 ke.createElement("div",{className:"Toastify__spinner"})}},ZF=e=>{const{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:a,playToast:o}=KF(e),{closeButton:l,children:u,autoClose:d,onClick:f,type:m,hideProgressBar:h,closeToast:g,transition:x,position:b,className:w,style:C,bodyClassName:k,bodyStyle:N,progressClassName:T,progressStyle:_,updateId:P,role:M,progress:O,rtl:D,toastId:F,deleteToast:$,isIn:te,isLoading:z,closeOnClick:ue,theme:V}=e,ne=Js("Toastify__toast",`Toastify__toast-theme--${V}`,`Toastify__toast--${m}`,{"Toastify__toast--rtl":D},{"Toastify__toast--close-on-click":ue}),Y=fs(w)?w({rtl:D,position:b,type:m,defaultClassName:ne}):Js(ne,w),se=(function(A){let{theme:K,type:re,isLoading:ee,icon:ie}=A,de=null;const j={theme:K,type:re};return ie===!1||(fs(ie)?de=ie({...j,isLoading:ee}):y.isValidElement(ie)?de=y.cloneElement(ie,j):ee?de=jv.spinner():(I=>I in jv)(re)&&(de=jv[re](j))),de})(e),H=!!O||!d,W={closeToast:g,type:m,theme:V};let U=null;return l===!1||(U=fs(l)?l(W):y.isValidElement(l)?y.cloneElement(l,W):(function(A){let{closeToast:K,theme:re,ariaLabel:ee="close"}=A;return ke.createElement("button",{className:`Toastify__close-button Toastify__close-button--${re}`,type:"button",onClick:ie=>{ie.stopPropagation(),K(ie)},"aria-label":ee},ke.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},ke.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"})))})(W)),ke.createElement(x,{isIn:te,done:$,position:b,preventExitTransition:n,nodeRef:r,playToast:o},ke.createElement("div",{id:F,onClick:f,"data-in":te,className:Y,...a,style:C,ref:r},ke.createElement("div",{...te&&{role:M},className:fs(k)?k({type:m}):Js("Toastify__toast-body",k),style:N},se!=null&&ke.createElement("div",{className:Js("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!z})},se),ke.createElement("div",null,u)),U,ke.createElement(GF,{...P&&!H?{key:`pb-${P}`}:{},rtl:D,theme:V,delay:d,isRunning:t,isIn:te,closeToast:g,hide:h,type:m,style:_,className:T,controlledProgress:H,progress:O||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}},XF=Eh(Nh("bounce",!0));Eh(Nh("slide",!0));Eh(Nh("zoom"));Eh(Nh("flip"));const e4={position:"top-right",transition:XF,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function t4(e){let t={...e4,...e};const n=e.stacked,[r,a]=y.useState(!0),o=y.useRef(null),{getToastToRender:l,isToastActive:u,count:d}=WF(t),{className:f,style:m,rtl:h,containerId:g}=t;function x(w){const C=Js("Toastify__toast-container",`Toastify__toast-container--${w}`,{"Toastify__toast-container--rtl":h});return fs(f)?f({position:w,rtl:h,defaultClassName:C}):Js(C,yp(f))}function b(){n&&(a(!0),X.play())}return YF(()=>{if(n){var w;const C=o.current.querySelectorAll('[data-in="true"]'),k=12,N=(w=t.position)==null?void 0:w.includes("top");let T=0,_=0;Array.from(C).reverse().forEach((P,M)=>{const O=P;O.classList.add("Toastify__toast--stacked"),M>0&&(O.dataset.collapsed=`${r}`),O.dataset.pos||(O.dataset.pos=N?"top":"bot");const D=T*(r?.2:1)+(r?0:k*M);O.style.setProperty("--y",`${N?D:-1*D}px`),O.style.setProperty("--g",`${k}`),O.style.setProperty("--s",""+(1-(r?_:0))),T+=O.offsetHeight,_+=.025})}},[r,d,n]),ke.createElement("div",{ref:o,className:"Toastify",id:g,onMouseEnter:()=>{n&&(a(!1),X.pause())},onMouseLeave:b},l((w,C)=>{const k=C.length?{...m}:{...m,pointerEvents:"none"};return ke.createElement("div",{className:x(w),style:k,key:`container-${w}`},C.map(N=>{let{content:T,props:_}=N;return ke.createElement(ZF,{..._,stacked:n,collapseAll:b,isIn:u(_.toastId,_.containerId),style:_.style,key:`toast-${_.key}`},T)}))}))}const n4={theme:"system",setTheme:()=>null},TN=y.createContext(n4);function r4({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[a,o]=y.useState(()=>localStorage.getItem(n)||t);y.useEffect(()=>{const u=window.document.documentElement;if(u.classList.remove("light","dark"),a==="system"){const d=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";u.classList.add(d);return}u.classList.add(a)},[a]);const l={theme:a,setTheme:u=>{localStorage.setItem(n,u),o(u)}};return s.jsx(TN.Provider,{...r,value:l,children:e})}const Yi=()=>{const e=y.useContext(TN);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};function MN(e,t){return function(){return e.apply(t,arguments)}}const{toString:s4}=Object.prototype,{getPrototypeOf:hx}=Object,{iterator:Th,toStringTag:_N}=Symbol,Mh=(e=>t=>{const n=s4.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),na=e=>(e=e.toLowerCase(),t=>Mh(t)===e),_h=e=>t=>typeof t===e,{isArray:Sc}=Array,oc=_h("undefined");function vd(e){return e!==null&&!oc(e)&&e.constructor!==null&&!oc(e.constructor)&&Qr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const PN=na("ArrayBuffer");function a4(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&PN(e.buffer),t}const o4=_h("string"),Qr=_h("function"),RN=_h("number"),yd=e=>e!==null&&typeof e=="object",i4=e=>e===!0||e===!1,bp=e=>{if(Mh(e)!=="object")return!1;const t=hx(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(_N in e)&&!(Th in e)},l4=e=>{if(!yd(e)||vd(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},c4=na("Date"),u4=na("File"),d4=na("Blob"),f4=na("FileList"),p4=e=>yd(e)&&Qr(e.pipe),h4=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Qr(e.append)&&((t=Mh(e))==="formdata"||t==="object"&&Qr(e.toString)&&e.toString()==="[object FormData]"))},m4=na("URLSearchParams"),[g4,v4,y4,b4]=["ReadableStream","Request","Response","Headers"].map(na),x4=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function bd(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,a;if(typeof e!="object"&&(e=[e]),Sc(e))for(r=0,a=e.length;r0;)if(a=n[r],t===a.toLowerCase())return a;return null}const Pi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ON=e=>!oc(e)&&e!==Pi;function sb(){const{caseless:e,skipUndefined:t}=ON(this)&&this||{},n={},r=(a,o)=>{const l=e&&IN(n,o)||o;bp(n[l])&&bp(a)?n[l]=sb(n[l],a):bp(a)?n[l]=sb({},a):Sc(a)?n[l]=a.slice():(!t||!oc(a))&&(n[l]=a)};for(let a=0,o=arguments.length;a(bd(t,(a,o)=>{n&&Qr(a)?e[o]=MN(a,n):e[o]=a},{allOwnKeys:r}),e),S4=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),C4=(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)},j4=(e,t,n,r)=>{let a,o,l;const u={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),o=a.length;o-- >0;)l=a[o],(!r||r(l,e,t))&&!u[l]&&(t[l]=e[l],u[l]=!0);e=n!==!1&&hx(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},k4=(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},E4=e=>{if(!e)return null;if(Sc(e))return e;let t=e.length;if(!RN(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},N4=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&hx(Uint8Array)),T4=(e,t)=>{const r=(e&&e[Th]).call(e);let a;for(;(a=r.next())&&!a.done;){const o=a.value;t.call(e,o[0],o[1])}},M4=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},_4=na("HTMLFormElement"),P4=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,a){return r.toUpperCase()+a}),YC=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),R4=na("RegExp"),AN=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};bd(n,(a,o)=>{let l;(l=t(a,o,e))!==!1&&(r[o]=l||a)}),Object.defineProperties(e,r)},I4=e=>{AN(e,(t,n)=>{if(Qr(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Qr(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+"'")})}})},O4=(e,t)=>{const n={},r=a=>{a.forEach(o=>{n[o]=!0})};return Sc(e)?r(e):r(String(e).split(t)),n},A4=()=>{},D4=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function F4(e){return!!(e&&Qr(e.append)&&e[_N]==="FormData"&&e[Th])}const L4=e=>{const t=new Array(10),n=(r,a)=>{if(yd(r)){if(t.indexOf(r)>=0)return;if(vd(r))return r;if(!("toJSON"in r)){t[a]=r;const o=Sc(r)?[]:{};return bd(r,(l,u)=>{const d=n(l,a+1);!oc(d)&&(o[u]=d)}),t[a]=void 0,o}}return r};return n(e,0)},$4=na("AsyncFunction"),B4=e=>e&&(yd(e)||Qr(e))&&Qr(e.then)&&Qr(e.catch),DN=((e,t)=>e?setImmediate:t?((n,r)=>(Pi.addEventListener("message",({source:a,data:o})=>{a===Pi&&o===n&&r.length&&r.shift()()},!1),a=>{r.push(a),Pi.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Qr(Pi.postMessage)),z4=typeof queueMicrotask<"u"?queueMicrotask.bind(Pi):typeof process<"u"&&process.nextTick||DN,U4=e=>e!=null&&Qr(e[Th]),ye={isArray:Sc,isArrayBuffer:PN,isBuffer:vd,isFormData:h4,isArrayBufferView:a4,isString:o4,isNumber:RN,isBoolean:i4,isObject:yd,isPlainObject:bp,isEmptyObject:l4,isReadableStream:g4,isRequest:v4,isResponse:y4,isHeaders:b4,isUndefined:oc,isDate:c4,isFile:u4,isBlob:d4,isRegExp:R4,isFunction:Qr,isStream:p4,isURLSearchParams:m4,isTypedArray:N4,isFileList:f4,forEach:bd,merge:sb,extend:w4,trim:x4,stripBOM:S4,inherits:C4,toFlatObject:j4,kindOf:Mh,kindOfTest:na,endsWith:k4,toArray:E4,forEachEntry:T4,matchAll:M4,isHTMLForm:_4,hasOwnProperty:YC,hasOwnProp:YC,reduceDescriptors:AN,freezeMethods:I4,toObjectSet:O4,toCamelCase:P4,noop:A4,toFiniteNumber:D4,findKey:IN,global:Pi,isContextDefined:ON,isSpecCompliantForm:F4,toJSONObject:L4,isAsyncFn:$4,isThenable:B4,setImmediate:DN,asap:z4,isIterable:U4};function Ot(e,t,n,r,a){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),a&&(this.response=a,this.status=a.status?a.status:null)}ye.inherits(Ot,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:ye.toJSONObject(this.config),code:this.code,status:this.status}}});const FN=Ot.prototype,LN={};["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=>{LN[e]={value:e}});Object.defineProperties(Ot,LN);Object.defineProperty(FN,"isAxiosError",{value:!0});Ot.from=(e,t,n,r,a,o)=>{const l=Object.create(FN);ye.toFlatObject(e,l,function(m){return m!==Error.prototype},f=>f!=="isAxiosError");const u=e&&e.message?e.message:"Error",d=t==null&&e?e.code:t;return Ot.call(l,u,d,n,r,a),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 V4=null;function ab(e){return ye.isPlainObject(e)||ye.isArray(e)}function $N(e){return ye.endsWith(e,"[]")?e.slice(0,-2):e}function ZC(e,t,n){return e?e.concat(t).map(function(a,o){return a=$N(a),!n&&o?"["+a+"]":a}).join(n?".":""):t}function q4(e){return ye.isArray(e)&&!e.some(ab)}const H4=ye.toFlatObject(ye,{},null,function(t){return/^is[A-Z]/.test(t)});function Ph(e,t,n){if(!ye.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=ye.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,C){return!ye.isUndefined(C[w])});const r=n.metaTokens,a=n.visitor||m,o=n.dots,l=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&ye.isSpecCompliantForm(t);if(!ye.isFunction(a))throw new TypeError("visitor must be a function");function f(b){if(b===null)return"";if(ye.isDate(b))return b.toISOString();if(ye.isBoolean(b))return b.toString();if(!d&&ye.isBlob(b))throw new Ot("Blob is not supported. Use a Buffer instead.");return ye.isArrayBuffer(b)||ye.isTypedArray(b)?d&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function m(b,w,C){let k=b;if(b&&!C&&typeof b=="object"){if(ye.endsWith(w,"{}"))w=r?w:w.slice(0,-2),b=JSON.stringify(b);else if(ye.isArray(b)&&q4(b)||(ye.isFileList(b)||ye.endsWith(w,"[]"))&&(k=ye.toArray(b)))return w=$N(w),k.forEach(function(T,_){!(ye.isUndefined(T)||T===null)&&t.append(l===!0?ZC([w],_,o):l===null?w:w+"[]",f(T))}),!1}return ab(b)?!0:(t.append(ZC(C,w,o),f(b)),!1)}const h=[],g=Object.assign(H4,{defaultVisitor:m,convertValue:f,isVisitable:ab});function x(b,w){if(!ye.isUndefined(b)){if(h.indexOf(b)!==-1)throw Error("Circular reference detected in "+w.join("."));h.push(b),ye.forEach(b,function(k,N){(!(ye.isUndefined(k)||k===null)&&a.call(t,k,ye.isString(N)?N.trim():N,w,g))===!0&&x(k,w?w.concat(N):[N])}),h.pop()}}if(!ye.isObject(e))throw new TypeError("data must be an object");return x(e),t}function XC(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function mx(e,t){this._pairs=[],e&&Ph(e,this,t)}const BN=mx.prototype;BN.append=function(t,n){this._pairs.push([t,n])};BN.toString=function(t){const n=t?function(r){return t.call(this,r,XC)}:XC;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};function W4(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function zN(e,t,n){if(!t)return e;const r=n&&n.encode||W4;ye.isFunction(n)&&(n={serialize:n});const a=n&&n.serialize;let o;if(a?o=a(t,n):o=ye.isURLSearchParams(t)?t.toString():new mx(t,n).toString(r),o){const l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class e1{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){ye.forEach(this.handlers,function(r){r!==null&&t(r)})}}const UN={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},K4=typeof URLSearchParams<"u"?URLSearchParams:mx,G4=typeof FormData<"u"?FormData:null,J4=typeof Blob<"u"?Blob:null,Q4={isBrowser:!0,classes:{URLSearchParams:K4,FormData:G4,Blob:J4},protocols:["http","https","file","blob","url","data"]},gx=typeof window<"u"&&typeof document<"u",ob=typeof navigator=="object"&&navigator||void 0,Y4=gx&&(!ob||["ReactNative","NativeScript","NS"].indexOf(ob.product)<0),Z4=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",X4=gx&&window.location.href||"http://localhost",eL=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:gx,hasStandardBrowserEnv:Y4,hasStandardBrowserWebWorkerEnv:Z4,navigator:ob,origin:X4},Symbol.toStringTag,{value:"Module"})),kr={...eL,...Q4};function tL(e,t){return Ph(e,new kr.classes.URLSearchParams,{visitor:function(n,r,a,o){return kr.isNode&&ye.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function nL(e){return ye.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function rL(e){const t={},n=Object.keys(e);let r;const a=n.length;let o;for(r=0;r=n.length;return l=!l&&ye.isArray(a)?a.length:l,d?(ye.hasOwnProp(a,l)?a[l]=[a[l],r]:a[l]=r,!u):((!a[l]||!ye.isObject(a[l]))&&(a[l]=[]),t(n,r,a[l],o)&&ye.isArray(a[l])&&(a[l]=rL(a[l])),!u)}if(ye.isFormData(e)&&ye.isFunction(e.entries)){const n={};return ye.forEachEntry(e,(r,a)=>{t(nL(r),a,n,0)}),n}return null}function sL(e,t,n){if(ye.isString(e))try{return(t||JSON.parse)(e),ye.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const xd={transitional:UN,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",a=r.indexOf("application/json")>-1,o=ye.isObject(t);if(o&&ye.isHTMLForm(t)&&(t=new FormData(t)),ye.isFormData(t))return a?JSON.stringify(VN(t)):t;if(ye.isArrayBuffer(t)||ye.isBuffer(t)||ye.isStream(t)||ye.isFile(t)||ye.isBlob(t)||ye.isReadableStream(t))return t;if(ye.isArrayBufferView(t))return t.buffer;if(ye.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 tL(t,this.formSerializer).toString();if((u=ye.isFileList(t))||r.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return Ph(u?{"files[]":t}:t,d&&new d,this.formSerializer)}}return o||a?(n.setContentType("application/json",!1),sL(t)):t}],transformResponse:[function(t){const n=this.transitional||xd.transitional,r=n&&n.forcedJSONParsing,a=this.responseType==="json";if(ye.isResponse(t)||ye.isReadableStream(t))return t;if(t&&ye.isString(t)&&(r&&!this.responseType||a)){const l=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(t,this.parseReviver)}catch(u){if(l)throw u.name==="SyntaxError"?Ot.from(u,Ot.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:kr.classes.FormData,Blob:kr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ye.forEach(["delete","get","head","post","put","patch"],e=>{xd.headers[e]={}});const aL=ye.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"]),oL=e=>{const t={};let n,r,a;return e&&e.split(` -`).forEach(function(l){a=l.indexOf(":"),n=l.substring(0,a).trim().toLowerCase(),r=l.substring(a+1).trim(),!(!n||t[n]&&aL[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},t1=Symbol("internals");function ku(e){return e&&String(e).trim().toLowerCase()}function xp(e){return e===!1||e==null?e:ye.isArray(e)?e.map(xp):String(e)}function iL(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 lL=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function kv(e,t,n,r,a){if(ye.isFunction(r))return r.call(this,t,n);if(a&&(t=n),!!ye.isString(t)){if(ye.isString(r))return t.indexOf(r)!==-1;if(ye.isRegExp(r))return r.test(t)}}function cL(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function uL(e,t){const n=ye.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(a,o,l){return this[r].call(this,t,a,o,l)},configurable:!0})})}let Yr=class{constructor(t){t&&this.set(t)}set(t,n,r){const a=this;function o(u,d,f){const m=ku(d);if(!m)throw new Error("header name must be a non-empty string");const h=ye.findKey(a,m);(!h||a[h]===void 0||f===!0||f===void 0&&a[h]!==!1)&&(a[h||d]=xp(u))}const l=(u,d)=>ye.forEach(u,(f,m)=>o(f,m,d));if(ye.isPlainObject(t)||t instanceof this.constructor)l(t,n);else if(ye.isString(t)&&(t=t.trim())&&!lL(t))l(oL(t),n);else if(ye.isObject(t)&&ye.isIterable(t)){let u={},d,f;for(const m of t){if(!ye.isArray(m))throw TypeError("Object iterator must return a key-value pair");u[f=m[0]]=(d=u[f])?ye.isArray(d)?[...d,m[1]]:[d,m[1]]:m[1]}l(u,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=ku(t),t){const r=ye.findKey(this,t);if(r){const a=this[r];if(!n)return a;if(n===!0)return iL(a);if(ye.isFunction(n))return n.call(this,a,r);if(ye.isRegExp(n))return n.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=ku(t),t){const r=ye.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||kv(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let a=!1;function o(l){if(l=ku(l),l){const u=ye.findKey(r,l);u&&(!n||kv(r,r[u],u,n))&&(delete r[u],a=!0)}}return ye.isArray(t)?t.forEach(o):o(t),a}clear(t){const n=Object.keys(this);let r=n.length,a=!1;for(;r--;){const o=n[r];(!t||kv(this,this[o],o,t,!0))&&(delete this[o],a=!0)}return a}normalize(t){const n=this,r={};return ye.forEach(this,(a,o)=>{const l=ye.findKey(r,o);if(l){n[l]=xp(a),delete n[o];return}const u=t?cL(o):String(o).trim();u!==o&&delete n[o],n[u]=xp(a),r[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return ye.forEach(this,(r,a)=>{r!=null&&r!==!1&&(n[a]=t&&ye.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(a=>r.set(a)),r}static accessor(t){const r=(this[t1]=this[t1]={accessors:{}}).accessors,a=this.prototype;function o(l){const u=ku(l);r[u]||(uL(a,l),r[u]=!0)}return ye.isArray(t)?t.forEach(o):o(t),this}};Yr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ye.reduceDescriptors(Yr.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});ye.freezeMethods(Yr);function Ev(e,t){const n=this||xd,r=t||n,a=Yr.from(r.headers);let o=r.data;return ye.forEach(e,function(u){o=u.call(n,o,a.normalize(),t?t.status:void 0)}),a.normalize(),o}function qN(e){return!!(e&&e.__CANCEL__)}function Cc(e,t,n){Ot.call(this,e??"canceled",Ot.ERR_CANCELED,t,n),this.name="CanceledError"}ye.inherits(Cc,Ot,{__CANCEL__:!0});function HN(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Ot("Request failed with status code "+n.status,[Ot.ERR_BAD_REQUEST,Ot.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function dL(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function fL(e,t){e=e||10;const n=new Array(e),r=new Array(e);let a=0,o=0,l;return t=t!==void 0?t:1e3,function(d){const f=Date.now(),m=r[o];l||(l=f),n[a]=d,r[a]=f;let h=o,g=0;for(;h!==a;)g+=n[h++],h=h%e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),f-l{n=m,a=null,o&&(clearTimeout(o),o=null),e(...f)};return[(...f)=>{const m=Date.now(),h=m-n;h>=r?l(f,m):(a=f,o||(o=setTimeout(()=>{o=null,l(a)},r-h)))},()=>a&&l(a)]}const Up=(e,t,n=3)=>{let r=0;const a=fL(50,250);return pL(o=>{const l=o.loaded,u=o.lengthComputable?o.total:void 0,d=l-r,f=a(d),m=l<=u;r=l;const h={loaded:l,total:u,progress:u?l/u:void 0,bytes:d,rate:f||void 0,estimated:f&&u&&m?(u-l)/f:void 0,event:o,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(h)},n)},n1=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},r1=e=>(...t)=>ye.asap(()=>e(...t)),hL=kr.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,kr.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(kr.origin),kr.navigator&&/(msie|trident)/i.test(kr.navigator.userAgent)):()=>!0,mL=kr.hasStandardBrowserEnv?{write(e,t,n,r,a,o){const l=[e+"="+encodeURIComponent(t)];ye.isNumber(n)&&l.push("expires="+new Date(n).toGMTString()),ye.isString(r)&&l.push("path="+r),ye.isString(a)&&l.push("domain="+a),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 gL(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function vL(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function WN(e,t,n){let r=!gL(t);return e&&(r||n==!1)?vL(e,t):t}const s1=e=>e instanceof Yr?{...e}:e;function zi(e,t){t=t||{};const n={};function r(f,m,h,g){return ye.isPlainObject(f)&&ye.isPlainObject(m)?ye.merge.call({caseless:g},f,m):ye.isPlainObject(m)?ye.merge({},m):ye.isArray(m)?m.slice():m}function a(f,m,h,g){if(ye.isUndefined(m)){if(!ye.isUndefined(f))return r(void 0,f,h,g)}else return r(f,m,h,g)}function o(f,m){if(!ye.isUndefined(m))return r(void 0,m)}function l(f,m){if(ye.isUndefined(m)){if(!ye.isUndefined(f))return r(void 0,f)}else return r(void 0,m)}function u(f,m,h){if(h in t)return r(f,m);if(h 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,m,h)=>a(s1(f),s1(m),h,!0)};return ye.forEach(Object.keys({...e,...t}),function(m){const h=d[m]||a,g=h(e[m],t[m],m);ye.isUndefined(g)&&h!==u||(n[m]=g)}),n}const KN=e=>{const t=zi({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:o,headers:l,auth:u}=t;if(t.headers=l=Yr.from(l),t.url=zN(WN(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),u&&l.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):""))),ye.isFormData(n)){if(kr.hasStandardBrowserEnv||kr.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if(ye.isFunction(n.getHeaders)){const d=n.getHeaders(),f=["content-type","content-length"];Object.entries(d).forEach(([m,h])=>{f.includes(m.toLowerCase())&&l.set(m,h)})}}if(kr.hasStandardBrowserEnv&&(r&&ye.isFunction(r)&&(r=r(t)),r||r!==!1&&hL(t.url))){const d=a&&o&&mL.read(o);d&&l.set(a,d)}return t},yL=typeof XMLHttpRequest<"u",bL=yL&&function(e){return new Promise(function(n,r){const a=KN(e);let o=a.data;const l=Yr.from(a.headers).normalize();let{responseType:u,onUploadProgress:d,onDownloadProgress:f}=a,m,h,g,x,b;function w(){x&&x(),b&&b(),a.cancelToken&&a.cancelToken.unsubscribe(m),a.signal&&a.signal.removeEventListener("abort",m)}let C=new XMLHttpRequest;C.open(a.method.toUpperCase(),a.url,!0),C.timeout=a.timeout;function k(){if(!C)return;const T=Yr.from("getAllResponseHeaders"in C&&C.getAllResponseHeaders()),P={data:!u||u==="text"||u==="json"?C.responseText:C.response,status:C.status,statusText:C.statusText,headers:T,config:e,request:C};HN(function(O){n(O),w()},function(O){r(O),w()},P),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 Ot("Request aborted",Ot.ECONNABORTED,e,C)),C=null)},C.onerror=function(_){const P=_&&_.message?_.message:"Network Error",M=new Ot(P,Ot.ERR_NETWORK,e,C);M.event=_||null,r(M),C=null},C.ontimeout=function(){let _=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const P=a.transitional||UN;a.timeoutErrorMessage&&(_=a.timeoutErrorMessage),r(new Ot(_,P.clarifyTimeoutError?Ot.ETIMEDOUT:Ot.ECONNABORTED,e,C)),C=null},o===void 0&&l.setContentType(null),"setRequestHeader"in C&&ye.forEach(l.toJSON(),function(_,P){C.setRequestHeader(P,_)}),ye.isUndefined(a.withCredentials)||(C.withCredentials=!!a.withCredentials),u&&u!=="json"&&(C.responseType=a.responseType),f&&([g,b]=Up(f,!0),C.addEventListener("progress",g)),d&&C.upload&&([h,x]=Up(d),C.upload.addEventListener("progress",h),C.upload.addEventListener("loadend",x)),(a.cancelToken||a.signal)&&(m=T=>{C&&(r(!T||T.type?new Cc(null,e,C):T),C.abort(),C=null)},a.cancelToken&&a.cancelToken.subscribe(m),a.signal&&(a.signal.aborted?m():a.signal.addEventListener("abort",m)));const N=dL(a.url);if(N&&kr.protocols.indexOf(N)===-1){r(new Ot("Unsupported protocol "+N+":",Ot.ERR_BAD_REQUEST,e));return}C.send(o||null)})},xL=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,a;const o=function(f){if(!a){a=!0,u();const m=f instanceof Error?f:this.reason;r.abort(m instanceof Ot?m:new Cc(m instanceof Error?m.message:m))}};let l=t&&setTimeout(()=>{l=null,o(new Ot(`timeout ${t} of ms exceeded`,Ot.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=()=>ye.asap(u),d}},wL=function*(e,t){let n=e.byteLength;if(n{const a=SL(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:m}=await a.next();if(f){u(),d.close();return}let h=m.byteLength;if(n){let g=o+=h;n(g)}d.enqueue(new Uint8Array(m))}catch(f){throw u(f),f}},cancel(d){return u(d),a.return()}},{highWaterMark:2})},o1=64*1024,{isFunction:$f}=ye,jL=(({Request:e,Response:t})=>({Request:e,Response:t}))(ye.global),{ReadableStream:i1,TextEncoder:l1}=ye.global,c1=(e,...t)=>{try{return!!e(...t)}catch{return!1}},kL=e=>{e=ye.merge.call({skipUndefined:!0},jL,e);const{fetch:t,Request:n,Response:r}=e,a=t?$f(t):typeof fetch=="function",o=$f(n),l=$f(r);if(!a)return!1;const u=a&&$f(i1),d=a&&(typeof l1=="function"?(b=>w=>b.encode(w))(new l1):async b=>new Uint8Array(await new n(b).arrayBuffer())),f=o&&u&&c1(()=>{let b=!1;const w=new n(kr.origin,{body:new i1,method:"POST",get duplex(){return b=!0,"half"}}).headers.has("Content-Type");return b&&!w}),m=l&&u&&c1(()=>ye.isReadableStream(new r("").body)),h={stream:m&&(b=>b.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(b=>{!h[b]&&(h[b]=(w,C)=>{let k=w&&w[b];if(k)return k.call(w);throw new Ot(`Response type '${b}' is not supported`,Ot.ERR_NOT_SUPPORT,C)})});const g=async b=>{if(b==null)return 0;if(ye.isBlob(b))return b.size;if(ye.isSpecCompliantForm(b))return(await new n(kr.origin,{method:"POST",body:b}).arrayBuffer()).byteLength;if(ye.isArrayBufferView(b)||ye.isArrayBuffer(b))return b.byteLength;if(ye.isURLSearchParams(b)&&(b=b+""),ye.isString(b))return(await d(b)).byteLength},x=async(b,w)=>{const C=ye.toFiniteNumber(b.getContentLength());return C??g(w)};return async b=>{let{url:w,method:C,data:k,signal:N,cancelToken:T,timeout:_,onDownloadProgress:P,onUploadProgress:M,responseType:O,headers:D,withCredentials:F="same-origin",fetchOptions:$}=KN(b),te=t||fetch;O=O?(O+"").toLowerCase():"text";let z=xL([N,T&&T.toAbortSignal()],_),ue=null;const V=z&&z.unsubscribe&&(()=>{z.unsubscribe()});let ne;try{if(M&&f&&C!=="get"&&C!=="head"&&(ne=await x(D,k))!==0){let A=new n(w,{method:"POST",body:k,duplex:"half"}),K;if(ye.isFormData(k)&&(K=A.headers.get("content-type"))&&D.setContentType(K),A.body){const[re,ee]=n1(ne,Up(r1(M)));k=a1(A.body,o1,re,ee)}}ye.isString(F)||(F=F?"include":"omit");const Y=o&&"credentials"in n.prototype,se={...$,signal:z,method:C.toUpperCase(),headers:D.normalize().toJSON(),body:k,duplex:"half",credentials:Y?F:void 0};ue=o&&new n(w,se);let H=await(o?te(ue,$):te(w,se));const W=m&&(O==="stream"||O==="response");if(m&&(P||W&&V)){const A={};["status","statusText","headers"].forEach(ie=>{A[ie]=H[ie]});const K=ye.toFiniteNumber(H.headers.get("content-length")),[re,ee]=P&&n1(K,Up(r1(P),!0))||[];H=new r(a1(H.body,o1,re,()=>{ee&&ee(),V&&V()}),A)}O=O||"text";let U=await h[ye.findKey(h,O)||"text"](H,b);return!W&&V&&V(),await new Promise((A,K)=>{HN(A,K,{data:U,headers:Yr.from(H.headers),status:H.status,statusText:H.statusText,config:b,request:ue})})}catch(Y){throw V&&V(),Y&&Y.name==="TypeError"&&/Load failed|fetch/i.test(Y.message)?Object.assign(new Ot("Network Error",Ot.ERR_NETWORK,b,ue),{cause:Y.cause||Y}):Ot.from(Y,Y&&Y.code,b,ue)}}},EL=new Map,GN=e=>{let t=e?e.env:{};const{fetch:n,Request:r,Response:a}=t,o=[r,a,n];let l=o.length,u=l,d,f,m=EL;for(;u--;)d=o[u],f=m.get(d),f===void 0&&m.set(d,f=u?new Map:kL(t)),m=f;return f};GN();const ib={http:V4,xhr:bL,fetch:{get:GN}};ye.forEach(ib,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const u1=e=>`- ${e}`,NL=e=>ye.isFunction(e)||e===null||e===!1,JN={getAdapter:(e,t)=>{e=ye.isArray(e)?e:[e];const{length:n}=e;let r,a;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(u1).join(` -`):" "+u1(l[0]):"as no adapter specified";throw new Ot("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return a},adapters:ib};function Nv(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Cc(null,e)}function d1(e){return Nv(e),e.headers=Yr.from(e.headers),e.data=Ev.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),JN.getAdapter(e.adapter||xd.adapter,e)(e).then(function(r){return Nv(e),r.data=Ev.call(e,e.transformResponse,r),r.headers=Yr.from(r.headers),r},function(r){return qN(r)||(Nv(e),r&&r.response&&(r.response.data=Ev.call(e,e.transformResponse,r.response),r.response.headers=Yr.from(r.response.headers))),Promise.reject(r)})}const QN="1.12.2",Rh={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Rh[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const f1={};Rh.transitional=function(t,n,r){function a(o,l){return"[Axios v"+QN+"] Transitional option '"+o+"'"+l+(r?". "+r:"")}return(o,l,u)=>{if(t===!1)throw new Ot(a(l," has been removed"+(n?" in "+n:"")),Ot.ERR_DEPRECATED);return n&&!f1[l]&&(f1[l]=!0,console.warn(a(l," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,l,u):!0}};Rh.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function TL(e,t,n){if(typeof e!="object")throw new Ot("options must be an object",Ot.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let a=r.length;for(;a-- >0;){const o=r[a],l=t[o];if(l){const u=e[o],d=u===void 0||l(u,o,e);if(d!==!0)throw new Ot("option "+o+" must be "+d,Ot.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Ot("Unknown option "+o,Ot.ERR_BAD_OPTION)}}const wp={assertOptions:TL,validators:Rh},pa=wp.validators;let Fi=class{constructor(t){this.defaults=t||{},this.interceptors={request:new e1,response:new e1}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const o=a.stack?a.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=zi(this.defaults,n);const{transitional:r,paramsSerializer:a,headers:o}=n;r!==void 0&&wp.assertOptions(r,{silentJSONParsing:pa.transitional(pa.boolean),forcedJSONParsing:pa.transitional(pa.boolean),clarifyTimeoutError:pa.transitional(pa.boolean)},!1),a!=null&&(ye.isFunction(a)?n.paramsSerializer={serialize:a}:wp.assertOptions(a,{encode:pa.function,serialize:pa.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),wp.assertOptions(n,{baseUrl:pa.spelling("baseURL"),withXsrfToken:pa.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=o&&ye.merge(o.common,o[n.method]);o&&ye.forEach(["delete","get","head","post","put","patch","common"],b=>{delete o[b]}),n.headers=Yr.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 m,h=0,g;if(!d){const b=[d1.bind(this),void 0];for(b.unshift(...u),b.push(...f),g=b.length,m=Promise.resolve(n);h{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](a);r._listeners=null}),this.promise.then=a=>{let o;const l=new Promise(u=>{r.subscribe(u),o=u}).then(a);return l.cancel=function(){r.unsubscribe(o)},l},t(function(o,l,u){r.reason||(r.reason=new Cc(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 YN(function(a){t=a}),cancel:t}}};function _L(e){return function(n){return e.apply(null,n)}}function PL(e){return ye.isObject(e)&&e.isAxiosError===!0}const lb={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(lb).forEach(([e,t])=>{lb[t]=e});function ZN(e){const t=new Fi(e),n=MN(Fi.prototype.request,t);return ye.extend(n,Fi.prototype,t,{allOwnKeys:!0}),ye.extend(n,t,null,{allOwnKeys:!0}),n.create=function(a){return ZN(zi(e,a))},n}const un=ZN(xd);un.Axios=Fi;un.CanceledError=Cc;un.CancelToken=ML;un.isCancel=qN;un.VERSION=QN;un.toFormData=Ph;un.AxiosError=Ot;un.Cancel=un.CanceledError;un.all=function(t){return Promise.all(t)};un.spread=_L;un.isAxiosError=PL;un.mergeConfig=zi;un.AxiosHeaders=Yr;un.formToJSON=e=>VN(ye.isHTMLForm(e)?new FormData(e):e);un.getAdapter=JN.getAdapter;un.HttpStatusCode=lb;un.default=un;const{Axios:jce,AxiosError:RL,CanceledError:kce,isCancel:Ece,CancelToken:Nce,VERSION:Tce,all:Mce,Cancel:_ce,isAxiosError:XN,spread:Pce,toFormData:Rce,AxiosHeaders:Ice,HttpStatusCode:Oce,formToJSON:Ace,getAdapter:Dce,mergeConfig:Fce}=un;let Tv=!1;const eT=new SD({defaultOptions:{queries:{staleTime:1e3*60*5,retry(e,t){if(t instanceof RL){const n=t.response?.status;if(n&&n>=400&&n<500)return!1}return e>=3?(Tv===!1&&(Tv=!0,X.error("The application is taking longer than expected to load, please try again in a few minutes.",{onClose:()=>{Tv=!1}})),!1):!0}}}}),vx="api";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.PROVIDER="provider",e))(Fn||{});const Sp=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),e.provider&&localStorage.setItem("provider",e.provider)},cb=()=>{localStorage.removeItem("apiUrl"),localStorage.removeItem("token"),localStorage.removeItem("version"),localStorage.removeItem("facebookAppId"),localStorage.removeItem("facebookConfigId"),localStorage.removeItem("facebookUserToken"),localStorage.removeItem("clientName"),localStorage.removeItem("provider")},hr=e=>localStorage.getItem(e),Tr=()=>localStorage.getItem("provider")==="go"?"go":vx,tT={dashboard:{api:!0,go:!0},chat:{api:!0,go:!1},settings:{api:!0,go:!0},proxy:{api:!0,go:!0},webhook:{api:!0,go:!0},websocket:{api:!0,go:!1},rabbitmq:{api:!0,go:!1},sqs:{api:!0,go:!1},evoai:{api:!0,go:!1},n8n:{api:!0,go:!1},evolutionBot:{api:!0,go:!1},chatwoot:{api:!0,go:!1},typebot:{api:!0,go:!1},openai:{api:!0,go:!1},dify:{api:!0,go:!1},flowise:{api:!0,go:!1}},nT=(e,t)=>{const n=Tr();return tT[e][n]},jn=({children:e,feature:t})=>{const n=hr(Fn.API_URL),r=hr(Fn.TOKEN),a=hr(Fn.VERSION);return(Tr()==="go"?!!n&&!!r:!!n&&!!r&&!!a)?t&&!nT(t)?s.jsx(Xy,{to:"/manager/"}):e:s.jsx(Xy,{to:"/manager/login"})},IL=({children:e})=>{const t=hr(Fn.API_URL),n=hr(Fn.TOKEN),r=hr(Fn.VERSION);return(Tr()==="go"?!!t&&!!n:!!t&&!!n&&!!r)?s.jsx(Xy,{to:"/"}):e},OL=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r({classGroupId:e,validator:t}),rT=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Vp="-",p1=[],DL="arbitrary..",FL=e=>{const t=$L(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return LL(l);const u=l.split(Vp),d=u[0]===""&&u.length>1?1:0;return sT(u,d,t)},getConflictingClassGroupIds:(l,u)=>{if(u){const d=r[l],f=n[l];return d?f?OL(f,d):d:f||p1}return n[l]||p1}}},sT=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const a=e[t],o=n.nextPart.get(a);if(o){const f=sT(e,t+1,o);if(f)return f}const l=n.validators;if(l===null)return;const u=t===0?e.join(Vp):e.slice(t).join(Vp),d=l.length;for(let f=0;fe.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?DL+r:void 0})(),$L=e=>{const{theme:t,classGroups:n}=e;return BL(n,t)},BL=(e,t)=>{const n=rT();for(const r in e){const a=e[r];yx(a,n,r,t)}return n},yx=(e,t,n,r)=>{const a=e.length;for(let o=0;o{if(typeof e=="string"){UL(e,t,n);return}if(typeof e=="function"){VL(e,t,n,r);return}qL(e,t,n,r)},UL=(e,t,n)=>{const r=e===""?t:aT(t,e);r.classGroupId=n},VL=(e,t,n,r)=>{if(HL(e)){yx(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(AL(n,e))},qL=(e,t,n,r)=>{const a=Object.entries(e),o=a.length;for(let l=0;l{let n=e;const r=t.split(Vp),a=r.length;for(let o=0;o"isThemeGetter"in e&&e.isThemeGetter===!0,WL=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const a=(o,l)=>{n[o]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(o){let l=n[o];if(l!==void 0)return l;if((l=r[o])!==void 0)return a(o,l),l},set(o,l){o in n?n[o]=l:a(o,l)}}},ub="!",h1=":",KL=[],m1=(e,t,n,r,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:a}),GL=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=a=>{const o=[];let l=0,u=0,d=0,f;const m=a.length;for(let w=0;wd?f-d:void 0;return m1(o,x,g,b)};if(t){const a=t+h1,o=r;r=l=>l.startsWith(a)?o(l.slice(a.length)):m1(KL,!1,l,void 0,!0)}if(n){const a=r;r=o=>n({className:o,parseClassName:a})}return r},JL=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let a=[];for(let o=0;o0&&(a.sort(),r.push(...a),a=[]),r.push(l)):a.push(l)}return a.length>0&&(a.sort(),r.push(...a)),r}},QL=e=>({cache:WL(e.cacheSize),parseClassName:GL(e),sortModifiers:JL(e),...FL(e)}),YL=/\s+/,ZL=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:o}=t,l=[],u=e.trim().split(YL);let d="";for(let f=u.length-1;f>=0;f-=1){const m=u[f],{isExternal:h,modifiers:g,hasImportantModifier:x,baseClassName:b,maybePostfixModifierPosition:w}=n(m);if(h){d=m+(d.length>0?" "+d:d);continue}let C=!!w,k=r(C?b.substring(0,w):b);if(!k){if(!C){d=m+(d.length>0?" "+d:d);continue}if(k=r(b),!k){d=m+(d.length>0?" "+d:d);continue}C=!1}const N=g.length===0?"":g.length===1?g[0]:o(g).join(":"),T=x?N+ub:N,_=T+k;if(l.indexOf(_)>-1)continue;l.push(_);const P=a(k,C);for(let M=0;M0?" "+d:d)}return d},XL=(...e)=>{let t=0,n,r,a="";for(;t{if(typeof e=="string")return e;let t,n="";for(let r=0;r{let n,r,a,o;const l=d=>{const f=t.reduce((m,h)=>h(m),e());return n=QL(f),r=n.cache.get,a=n.cache.set,o=u,u(d)},u=d=>{const f=r(d);if(f)return f;const m=ZL(d,n);return a(d,m),m};return o=l,(...d)=>o(XL(...d))},t$=[],sr=e=>{const t=n=>n[e]||t$;return t.isThemeGetter=!0,t},iT=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,lT=/^\((?:(\w[\w-]*):)?(.+)\)$/i,n$=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,r$=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,s$=/\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$/,a$=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,o$=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,i$=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,So=e=>n$.test(e),Lt=e=>!!e&&!Number.isNaN(Number(e)),Co=e=>!!e&&Number.isInteger(Number(e)),Mv=e=>e.endsWith("%")&&Lt(e.slice(0,-1)),Ia=e=>r$.test(e),cT=()=>!0,l$=e=>s$.test(e)&&!a$.test(e),bx=()=>!1,c$=e=>o$.test(e),u$=e=>i$.test(e),d$=e=>!We(e)&&!Ke(e),f$=e=>Go(e,fT,bx),We=e=>iT.test(e),ki=e=>Go(e,pT,l$),g1=e=>Go(e,x$,Lt),p$=e=>Go(e,mT,cT),h$=e=>Go(e,hT,bx),v1=e=>Go(e,uT,bx),m$=e=>Go(e,dT,u$),Bf=e=>Go(e,gT,c$),Ke=e=>lT.test(e),Eu=e=>Zi(e,pT),g$=e=>Zi(e,hT),y1=e=>Zi(e,uT),v$=e=>Zi(e,fT),y$=e=>Zi(e,dT),zf=e=>Zi(e,gT,!0),b$=e=>Zi(e,mT,!0),Go=(e,t,n)=>{const r=iT.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Zi=(e,t,n=!1)=>{const r=lT.exec(e);return r?r[1]?t(r[1]):n:!1},uT=e=>e==="position"||e==="percentage",dT=e=>e==="image"||e==="url",fT=e=>e==="length"||e==="size"||e==="bg-size",pT=e=>e==="length",x$=e=>e==="number",hT=e=>e==="family-name",mT=e=>e==="number"||e==="weight",gT=e=>e==="shadow",w$=()=>{const e=sr("color"),t=sr("font"),n=sr("text"),r=sr("font-weight"),a=sr("tracking"),o=sr("leading"),l=sr("breakpoint"),u=sr("container"),d=sr("spacing"),f=sr("radius"),m=sr("shadow"),h=sr("inset-shadow"),g=sr("text-shadow"),x=sr("drop-shadow"),b=sr("blur"),w=sr("perspective"),C=sr("aspect"),k=sr("ease"),N=sr("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],P=()=>[..._(),Ke,We],M=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto","contain","none"],D=()=>[Ke,We,d],F=()=>[So,"full","auto",...D()],$=()=>[Co,"none","subgrid",Ke,We],te=()=>["auto",{span:["full",Co,Ke,We]},Co,Ke,We],z=()=>[Co,"auto",Ke,We],ue=()=>["auto","min","max","fr",Ke,We],V=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ne=()=>["start","end","center","stretch","center-safe","end-safe"],Y=()=>["auto",...D()],se=()=>[So,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],H=()=>[So,"screen","full","dvw","lvw","svw","min","max","fit",...D()],W=()=>[So,"screen","full","lh","dvh","lvh","svh","min","max","fit",...D()],U=()=>[e,Ke,We],A=()=>[..._(),y1,v1,{position:[Ke,We]}],K=()=>["no-repeat",{repeat:["","x","y","space","round"]}],re=()=>["auto","cover","contain",v$,f$,{size:[Ke,We]}],ee=()=>[Mv,Eu,ki],ie=()=>["","none","full",f,Ke,We],de=()=>["",Lt,Eu,ki],j=()=>["solid","dashed","dotted","double"],I=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],me=()=>[Lt,Mv,y1,v1],xe=()=>["","none",b,Ke,We],rt=()=>["none",Lt,Ke,We],Je=()=>["none",Lt,Ke,We],nt=()=>[Lt,Ke,We],qt=()=>[So,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ia],breakpoint:[Ia],color:[cT],container:[Ia],"drop-shadow":[Ia],ease:["in","out","in-out"],font:[d$],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ia],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ia],shadow:[Ia],spacing:["px",Lt],text:[Ia],"text-shadow":[Ia],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",So,We,Ke,C]}],container:["container"],columns:[{columns:[Lt,We,Ke,u]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:P()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:F()}],"inset-x":[{"inset-x":F()}],"inset-y":[{"inset-y":F()}],start:[{"inset-s":F(),start:F()}],end:[{"inset-e":F(),end:F()}],"inset-bs":[{"inset-bs":F()}],"inset-be":[{"inset-be":F()}],top:[{top:F()}],right:[{right:F()}],bottom:[{bottom:F()}],left:[{left:F()}],visibility:["visible","invisible","collapse"],z:[{z:[Co,"auto",Ke,We]}],basis:[{basis:[So,"full","auto",u,...D()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Lt,So,"auto","initial","none",We]}],grow:[{grow:["",Lt,Ke,We]}],shrink:[{shrink:["",Lt,Ke,We]}],order:[{order:[Co,"first","last","none",Ke,We]}],"grid-cols":[{"grid-cols":$()}],"col-start-end":[{col:te()}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":$()}],"row-start-end":[{row:te()}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ue()}],"auto-rows":[{"auto-rows":ue()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...V(),"normal"]}],"justify-items":[{"justify-items":[...ne(),"normal"]}],"justify-self":[{"justify-self":["auto",...ne()]}],"align-content":[{content:["normal",...V()]}],"align-items":[{items:[...ne(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ne(),{baseline:["","last"]}]}],"place-content":[{"place-content":V()}],"place-items":[{"place-items":[...ne(),"baseline"]}],"place-self":[{"place-self":["auto",...ne()]}],p:[{p:D()}],px:[{px:D()}],py:[{py:D()}],ps:[{ps:D()}],pe:[{pe:D()}],pbs:[{pbs:D()}],pbe:[{pbe:D()}],pt:[{pt:D()}],pr:[{pr:D()}],pb:[{pb:D()}],pl:[{pl:D()}],m:[{m:Y()}],mx:[{mx:Y()}],my:[{my:Y()}],ms:[{ms:Y()}],me:[{me:Y()}],mbs:[{mbs:Y()}],mbe:[{mbe:Y()}],mt:[{mt:Y()}],mr:[{mr:Y()}],mb:[{mb:Y()}],ml:[{ml:Y()}],"space-x":[{"space-x":D()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":D()}],"space-y-reverse":["space-y-reverse"],size:[{size:se()}],"inline-size":[{inline:["auto",...H()]}],"min-inline-size":[{"min-inline":["auto",...H()]}],"max-inline-size":[{"max-inline":["none",...H()]}],"block-size":[{block:["auto",...W()]}],"min-block-size":[{"min-block":["auto",...W()]}],"max-block-size":[{"max-block":["none",...W()]}],w:[{w:[u,"screen",...se()]}],"min-w":[{"min-w":[u,"screen","none",...se()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...se()]}],h:[{h:["screen","lh",...se()]}],"min-h":[{"min-h":["screen","lh","none",...se()]}],"max-h":[{"max-h":["screen","lh",...se()]}],"font-size":[{text:["base",n,Eu,ki]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,b$,p$]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Mv,We]}],"font-family":[{font:[g$,h$,t]}],"font-features":[{"font-features":[We]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,Ke,We]}],"line-clamp":[{"line-clamp":[Lt,"none",Ke,g1]}],leading:[{leading:[o,...D()]}],"list-image":[{"list-image":["none",Ke,We]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ke,We]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:U()}],"text-color":[{text:U()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...j(),"wavy"]}],"text-decoration-thickness":[{decoration:[Lt,"from-font","auto",Ke,ki]}],"text-decoration-color":[{decoration:U()}],"underline-offset":[{"underline-offset":[Lt,"auto",Ke,We]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ke,We]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ke,We]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:A()}],"bg-repeat":[{bg:K()}],"bg-size":[{bg:re()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Co,Ke,We],radial:["",Ke,We],conic:[Co,Ke,We]},y$,m$]}],"bg-color":[{bg:U()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:U()}],"gradient-via":[{via:U()}],"gradient-to":[{to:U()}],rounded:[{rounded:ie()}],"rounded-s":[{"rounded-s":ie()}],"rounded-e":[{"rounded-e":ie()}],"rounded-t":[{"rounded-t":ie()}],"rounded-r":[{"rounded-r":ie()}],"rounded-b":[{"rounded-b":ie()}],"rounded-l":[{"rounded-l":ie()}],"rounded-ss":[{"rounded-ss":ie()}],"rounded-se":[{"rounded-se":ie()}],"rounded-ee":[{"rounded-ee":ie()}],"rounded-es":[{"rounded-es":ie()}],"rounded-tl":[{"rounded-tl":ie()}],"rounded-tr":[{"rounded-tr":ie()}],"rounded-br":[{"rounded-br":ie()}],"rounded-bl":[{"rounded-bl":ie()}],"border-w":[{border:de()}],"border-w-x":[{"border-x":de()}],"border-w-y":[{"border-y":de()}],"border-w-s":[{"border-s":de()}],"border-w-e":[{"border-e":de()}],"border-w-bs":[{"border-bs":de()}],"border-w-be":[{"border-be":de()}],"border-w-t":[{"border-t":de()}],"border-w-r":[{"border-r":de()}],"border-w-b":[{"border-b":de()}],"border-w-l":[{"border-l":de()}],"divide-x":[{"divide-x":de()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":de()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...j(),"hidden","none"]}],"divide-style":[{divide:[...j(),"hidden","none"]}],"border-color":[{border:U()}],"border-color-x":[{"border-x":U()}],"border-color-y":[{"border-y":U()}],"border-color-s":[{"border-s":U()}],"border-color-e":[{"border-e":U()}],"border-color-bs":[{"border-bs":U()}],"border-color-be":[{"border-be":U()}],"border-color-t":[{"border-t":U()}],"border-color-r":[{"border-r":U()}],"border-color-b":[{"border-b":U()}],"border-color-l":[{"border-l":U()}],"divide-color":[{divide:U()}],"outline-style":[{outline:[...j(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Lt,Ke,We]}],"outline-w":[{outline:["",Lt,Eu,ki]}],"outline-color":[{outline:U()}],shadow:[{shadow:["","none",m,zf,Bf]}],"shadow-color":[{shadow:U()}],"inset-shadow":[{"inset-shadow":["none",h,zf,Bf]}],"inset-shadow-color":[{"inset-shadow":U()}],"ring-w":[{ring:de()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:U()}],"ring-offset-w":[{"ring-offset":[Lt,ki]}],"ring-offset-color":[{"ring-offset":U()}],"inset-ring-w":[{"inset-ring":de()}],"inset-ring-color":[{"inset-ring":U()}],"text-shadow":[{"text-shadow":["none",g,zf,Bf]}],"text-shadow-color":[{"text-shadow":U()}],opacity:[{opacity:[Lt,Ke,We]}],"mix-blend":[{"mix-blend":[...I(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":I()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Lt]}],"mask-image-linear-from-pos":[{"mask-linear-from":me()}],"mask-image-linear-to-pos":[{"mask-linear-to":me()}],"mask-image-linear-from-color":[{"mask-linear-from":U()}],"mask-image-linear-to-color":[{"mask-linear-to":U()}],"mask-image-t-from-pos":[{"mask-t-from":me()}],"mask-image-t-to-pos":[{"mask-t-to":me()}],"mask-image-t-from-color":[{"mask-t-from":U()}],"mask-image-t-to-color":[{"mask-t-to":U()}],"mask-image-r-from-pos":[{"mask-r-from":me()}],"mask-image-r-to-pos":[{"mask-r-to":me()}],"mask-image-r-from-color":[{"mask-r-from":U()}],"mask-image-r-to-color":[{"mask-r-to":U()}],"mask-image-b-from-pos":[{"mask-b-from":me()}],"mask-image-b-to-pos":[{"mask-b-to":me()}],"mask-image-b-from-color":[{"mask-b-from":U()}],"mask-image-b-to-color":[{"mask-b-to":U()}],"mask-image-l-from-pos":[{"mask-l-from":me()}],"mask-image-l-to-pos":[{"mask-l-to":me()}],"mask-image-l-from-color":[{"mask-l-from":U()}],"mask-image-l-to-color":[{"mask-l-to":U()}],"mask-image-x-from-pos":[{"mask-x-from":me()}],"mask-image-x-to-pos":[{"mask-x-to":me()}],"mask-image-x-from-color":[{"mask-x-from":U()}],"mask-image-x-to-color":[{"mask-x-to":U()}],"mask-image-y-from-pos":[{"mask-y-from":me()}],"mask-image-y-to-pos":[{"mask-y-to":me()}],"mask-image-y-from-color":[{"mask-y-from":U()}],"mask-image-y-to-color":[{"mask-y-to":U()}],"mask-image-radial":[{"mask-radial":[Ke,We]}],"mask-image-radial-from-pos":[{"mask-radial-from":me()}],"mask-image-radial-to-pos":[{"mask-radial-to":me()}],"mask-image-radial-from-color":[{"mask-radial-from":U()}],"mask-image-radial-to-color":[{"mask-radial-to":U()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":_()}],"mask-image-conic-pos":[{"mask-conic":[Lt]}],"mask-image-conic-from-pos":[{"mask-conic-from":me()}],"mask-image-conic-to-pos":[{"mask-conic-to":me()}],"mask-image-conic-from-color":[{"mask-conic-from":U()}],"mask-image-conic-to-color":[{"mask-conic-to":U()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:A()}],"mask-repeat":[{mask:K()}],"mask-size":[{mask:re()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ke,We]}],filter:[{filter:["","none",Ke,We]}],blur:[{blur:xe()}],brightness:[{brightness:[Lt,Ke,We]}],contrast:[{contrast:[Lt,Ke,We]}],"drop-shadow":[{"drop-shadow":["","none",x,zf,Bf]}],"drop-shadow-color":[{"drop-shadow":U()}],grayscale:[{grayscale:["",Lt,Ke,We]}],"hue-rotate":[{"hue-rotate":[Lt,Ke,We]}],invert:[{invert:["",Lt,Ke,We]}],saturate:[{saturate:[Lt,Ke,We]}],sepia:[{sepia:["",Lt,Ke,We]}],"backdrop-filter":[{"backdrop-filter":["","none",Ke,We]}],"backdrop-blur":[{"backdrop-blur":xe()}],"backdrop-brightness":[{"backdrop-brightness":[Lt,Ke,We]}],"backdrop-contrast":[{"backdrop-contrast":[Lt,Ke,We]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Lt,Ke,We]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Lt,Ke,We]}],"backdrop-invert":[{"backdrop-invert":["",Lt,Ke,We]}],"backdrop-opacity":[{"backdrop-opacity":[Lt,Ke,We]}],"backdrop-saturate":[{"backdrop-saturate":[Lt,Ke,We]}],"backdrop-sepia":[{"backdrop-sepia":["",Lt,Ke,We]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":D()}],"border-spacing-x":[{"border-spacing-x":D()}],"border-spacing-y":[{"border-spacing-y":D()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ke,We]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Lt,"initial",Ke,We]}],ease:[{ease:["linear","initial",k,Ke,We]}],delay:[{delay:[Lt,Ke,We]}],animate:[{animate:["none",N,Ke,We]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Ke,We]}],"perspective-origin":[{"perspective-origin":P()}],rotate:[{rotate:rt()}],"rotate-x":[{"rotate-x":rt()}],"rotate-y":[{"rotate-y":rt()}],"rotate-z":[{"rotate-z":rt()}],scale:[{scale:Je()}],"scale-x":[{"scale-x":Je()}],"scale-y":[{"scale-y":Je()}],"scale-z":[{"scale-z":Je()}],"scale-3d":["scale-3d"],skew:[{skew:nt()}],"skew-x":[{"skew-x":nt()}],"skew-y":[{"skew-y":nt()}],transform:[{transform:[Ke,We,"","none","gpu","cpu"]}],"transform-origin":[{origin:P()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:qt()}],"translate-x":[{"translate-x":qt()}],"translate-y":[{"translate-y":qt()}],"translate-z":[{"translate-z":qt()}],"translate-none":["translate-none"],accent:[{accent:U()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:U()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ke,We]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mbs":[{"scroll-mbs":D()}],"scroll-mbe":[{"scroll-mbe":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pbs":[{"scroll-pbs":D()}],"scroll-pbe":[{"scroll-pbe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"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",Ke,We]}],fill:[{fill:["none",...U()]}],"stroke-w":[{stroke:[Lt,Eu,ki,g1]}],stroke:[{stroke:["none",...U()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},S$=e$(w$);function Et(...e){return S$(Js(e))}function C$(e,t=[]){let n=[];function r(o,l){const u=y.createContext(l);u.displayName=o+"Context";const d=n.length;n=[...n,l];const f=h=>{const{scope:g,children:x,...b}=h,w=g?.[e]?.[d]||u,C=y.useMemo(()=>b,Object.values(b));return s.jsx(w.Provider,{value:C,children:x})};f.displayName=o+"Provider";function m(h,g){const x=g?.[e]?.[d]||u,b=y.useContext(x);if(b)return b;if(l!==void 0)return l;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[f,m]}const a=()=>{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 a.scopeName=e,[r,j$(a,...t)]}function j$(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(o){const l=r.reduce((u,{useScope:d,scopeName:f})=>{const h=d(o)[`__scope${f}`];return{...u,...h}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function Xs(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>t.current?.(...n),[])}var er=globalThis?.document?y.useLayoutEffect:()=>{};function b1(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Jo(...e){return t=>{let n=!1;const r=e.map(a=>{const o=b1(a,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let a=0;a{let{children:o,...l}=r;vT(o)&&typeof qp=="function"&&(o=qp(o._payload));const u=y.Children.toArray(o),d=u.find(_$);if(d){const f=d.props.children,m=u.map(h=>h===d?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:h);return s.jsx(t,{...l,ref:a,children:y.isValidElement(f)?y.cloneElement(f,void 0,m):null})}return s.jsx(t,{...l,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function T$(e){const t=y.forwardRef((n,r)=>{let{children:a,...o}=n;if(vT(a)&&typeof qp=="function"&&(a=qp(a._payload)),y.isValidElement(a)){const l=R$(a),u=P$(o,a.props);return a.type!==y.Fragment&&(u.ref=r?Jo(r,l):l),y.cloneElement(a,u)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var M$=Symbol("radix.slottable");function _$(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===M$}function P$(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...u)=>{const d=o(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function R$(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 I$=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],xx=I$.reduce((e,t)=>{const n=N$(`Primitive.${t}`),r=y.forwardRef((a,o)=>{const{asChild:l,...u}=a,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...u,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),_v={exports:{}},Pv={};/** - * @license React - * use-sync-external-store-shim.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var x1;function O$(){if(x1)return Pv;x1=1;var e=vc();function t(h,g){return h===g&&(h!==0||1/h===1/g)||h!==h&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,a=e.useEffect,o=e.useLayoutEffect,l=e.useDebugValue;function u(h,g){var x=g(),b=r({inst:{value:x,getSnapshot:g}}),w=b[0].inst,C=b[1];return o(function(){w.value=x,w.getSnapshot=g,d(w)&&C({inst:w})},[h,x,g]),a(function(){return d(w)&&C({inst:w}),h(function(){d(w)&&C({inst:w})})},[h]),l(x),x}function d(h){var g=h.getSnapshot;h=h.value;try{var x=g();return!n(h,x)}catch{return!0}}function f(h,g){return g()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:u;return Pv.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,Pv}var w1;function A$(){return w1||(w1=1,_v.exports=O$()),_v.exports}var D$=A$();function F$(){return D$.useSyncExternalStore(L$,()=>!0,()=>!1)}function L$(){return()=>{}}var wx="Avatar",[$$]=C$(wx),[B$,yT]=$$(wx),bT=y.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[a,o]=y.useState("idle");return s.jsx(B$,{scope:n,imageLoadingStatus:a,onImageLoadingStatusChange:o,children:s.jsx(xx.span,{...r,ref:t})})});bT.displayName=wx;var xT="AvatarImage",wT=y.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:a=()=>{},...o}=e,l=yT(xT,n),u=z$(r,o),d=Xs(f=>{a(f),l.onImageLoadingStatusChange(f)});return er(()=>{u!=="idle"&&d(u)},[u,d]),u==="loaded"?s.jsx(xx.img,{...o,ref:t,src:r}):null});wT.displayName=xT;var ST="AvatarFallback",CT=y.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...a}=e,o=yT(ST,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"?s.jsx(xx.span,{...a,ref:t}):null});CT.displayName=ST;function S1(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function z$(e,{referrerPolicy:t,crossOrigin:n}){const r=F$(),a=y.useRef(null),o=r?(a.current||(a.current=new window.Image),a.current):null,[l,u]=y.useState(()=>S1(o,e));return er(()=>{u(S1(o,e))},[o,e]),er(()=>{const d=h=>()=>{u(h)};if(!o)return;const f=d("loaded"),m=d("error");return o.addEventListener("load",f),o.addEventListener("error",m),t&&(o.referrerPolicy=t),typeof n=="string"&&(o.crossOrigin=n),()=>{o.removeEventListener("load",f),o.removeEventListener("error",m)}},[o,n,t]),l}var U$=bT,V$=wT,q$=CT;function Ih({className:e,...t}){return s.jsx(U$,{"data-slot":"avatar",className:Et("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),...t})}function Oh({className:e,...t}){return s.jsx(V$,{"data-slot":"avatar-image",className:Et("aspect-square size-full",e),...t})}function jT({className:e,...t}){return s.jsx(q$,{"data-slot":"avatar-fallback",className:Et("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}var H$=Symbol.for("react.lazy"),Hp=Ho[" use ".trim().toString()];function W$(e){return typeof e=="object"&&e!==null&&"then"in e}function kT(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===H$&&"_payload"in e&&W$(e._payload)}function K$(e){const t=G$(e),n=y.forwardRef((r,a)=>{let{children:o,...l}=r;kT(o)&&typeof Hp=="function"&&(o=Hp(o._payload));const u=y.Children.toArray(o),d=u.find(Q$);if(d){const f=d.props.children,m=u.map(h=>h===d?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:h);return s.jsx(t,{...l,ref:a,children:y.isValidElement(f)?y.cloneElement(f,void 0,m):null})}return s.jsx(t,{...l,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}var ET=K$("Slot");function G$(e){const t=y.forwardRef((n,r)=>{let{children:a,...o}=n;if(kT(a)&&typeof Hp=="function"&&(a=Hp(a._payload)),y.isValidElement(a)){const l=Z$(a),u=Y$(o,a.props);return a.type!==y.Fragment&&(u.ref=r?Jo(r,l):l),y.cloneElement(a,u)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var J$=Symbol("radix.slottable");function Q$(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===J$}function Y$(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...u)=>{const d=o(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function Z$(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)}const C1=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,j1=Js,Sx=(e,t)=>n=>{var r;if(t?.variants==null)return j1(e,n?.class,n?.className);const{variants:a,defaultVariants:o}=t,l=Object.keys(a).map(f=>{const m=n?.[f],h=o?.[f];if(m===null)return null;const g=C1(m)||C1(h);return a[f][g]}),u=n&&Object.entries(n).reduce((f,m)=>{let[h,g]=m;return g===void 0||(f[h]=g),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,m)=>{let{class:h,className:g,...x}=m;return Object.entries(x).every(b=>{let[w,C]=b;return Array.isArray(C)?C.includes({...o,...u}[w]):{...o,...u}[w]===C})?[...f,h,g]:f},[]);return j1(e,l,d,n?.class,n?.className)};var X$=Sx("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}}),q=y.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},o)=>{const l=r?ET:"button";return s.jsx(l,{className:Et(X$({variant:t,size:n,className:e})),ref:o,...a})});q.displayName="Button";function Ge(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e?.(a),n===!1||!a.defaultPrevented)return t?.(a)}}function e3(e,t){const n=y.createContext(t),r=o=>{const{children:l,...u}=o,d=y.useMemo(()=>u,Object.values(u));return s.jsx(n.Provider,{value:d,children:l})};r.displayName=e+"Provider";function a(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,a]}function ra(e,t=[]){let n=[];function r(o,l){const u=y.createContext(l),d=n.length;n=[...n,l];const f=h=>{const{scope:g,children:x,...b}=h,w=g?.[e]?.[d]||u,C=y.useMemo(()=>b,Object.values(b));return s.jsx(w.Provider,{value:C,children:x})};f.displayName=o+"Provider";function m(h,g){const x=g?.[e]?.[d]||u,b=y.useContext(x);if(b)return b;if(l!==void 0)return l;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[f,m]}const a=()=>{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 a.scopeName=e,[r,t3(a,...t)]}function t3(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(o){const l=r.reduce((u,{useScope:d,scopeName:f})=>{const h=d(o)[`__scope${f}`];return{...u,...h}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var n3=Ho[" useId ".trim().toString()]||(()=>{}),r3=0;function Qs(e){const[t,n]=y.useState(n3());return er(()=>{n(r=>r??String(r3++))},[e]),e||(t?`radix-${t}`:"")}var s3=Ho[" useInsertionEffect ".trim().toString()]||er;function Ua({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,o,l]=a3({defaultProp:t,onChange:n}),u=e!==void 0,d=u?e:a;{const m=y.useRef(e!==void 0);y.useEffect(()=>{const h=m.current;h!==u&&console.warn(`${r} is changing from ${h?"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.`),m.current=u},[u,r])}const f=y.useCallback(m=>{if(u){const h=o3(m)?m(e):m;h!==e&&l.current?.(h)}else o(m)},[u,e,o,l]);return[d,f]}function a3({defaultProp:e,onChange:t}){const[n,r]=y.useState(e),a=y.useRef(n),o=y.useRef(t);return s3(()=>{o.current=t},[t]),y.useEffect(()=>{a.current!==n&&(o.current?.(n),a.current=n)},[n,a]),[n,r,o]}function o3(e){return typeof e=="function"}function ic(e){const t=i3(e),n=y.forwardRef((r,a)=>{const{children:o,...l}=r,u=y.Children.toArray(o),d=u.find(c3);if(d){const f=d.props.children,m=u.map(h=>h===d?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:h);return s.jsx(t,{...l,ref:a,children:y.isValidElement(f)?y.cloneElement(f,void 0,m):null})}return s.jsx(t,{...l,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function i3(e){const t=y.forwardRef((n,r)=>{const{children:a,...o}=n;if(y.isValidElement(a)){const l=d3(a),u=u3(o,a.props);return a.type!==y.Fragment&&(u.ref=r?Jo(r,l):l),y.cloneElement(a,u)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var l3=Symbol("radix.slottable");function c3(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===l3}function u3(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...u)=>{const d=o(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function d3(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 f3=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],wt=f3.reduce((e,t)=>{const n=ic(`Primitive.${t}`),r=y.forwardRef((a,o)=>{const{asChild:l,...u}=a,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...u,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function NT(e,t){e&&bc.flushSync(()=>e.dispatchEvent(t))}function p3(e,t=globalThis?.document){const n=Xs(e);y.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var h3="DismissableLayer",db="dismissableLayer.update",m3="dismissableLayer.pointerDownOutside",g3="dismissableLayer.focusOutside",k1,TT=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ah=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:l,onDismiss:u,...d}=e,f=y.useContext(TT),[m,h]=y.useState(null),g=m?.ownerDocument??globalThis?.document,[,x]=y.useState({}),b=tn(t,O=>h(O)),w=Array.from(f.layers),[C]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),k=w.indexOf(C),N=m?w.indexOf(m):-1,T=f.layersWithOutsidePointerEventsDisabled.size>0,_=N>=k,P=b3(O=>{const D=O.target,F=[...f.branches].some($=>$.contains(D));!_||F||(a?.(O),l?.(O),O.defaultPrevented||u?.())},g),M=x3(O=>{const D=O.target;[...f.branches].some($=>$.contains(D))||(o?.(O),l?.(O),O.defaultPrevented||u?.())},g);return p3(O=>{N===f.layers.size-1&&(r?.(O),!O.defaultPrevented&&u&&(O.preventDefault(),u()))},g),y.useEffect(()=>{if(m)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(k1=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(m)),f.layers.add(m),E1(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=k1)}},[m,g,n,f]),y.useEffect(()=>()=>{m&&(f.layers.delete(m),f.layersWithOutsidePointerEventsDisabled.delete(m),E1())},[m,f]),y.useEffect(()=>{const O=()=>x({});return document.addEventListener(db,O),()=>document.removeEventListener(db,O)},[]),s.jsx(wt.div,{...d,ref:b,style:{pointerEvents:T?_?"auto":"none":void 0,...e.style},onFocusCapture:Ge(e.onFocusCapture,M.onFocusCapture),onBlurCapture:Ge(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:Ge(e.onPointerDownCapture,P.onPointerDownCapture)})});Ah.displayName=h3;var v3="DismissableLayerBranch",y3=y.forwardRef((e,t)=>{const n=y.useContext(TT),r=y.useRef(null),a=tn(t,r);return y.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),s.jsx(wt.div,{...e,ref:a})});y3.displayName=v3;function b3(e,t=globalThis?.document){const n=Xs(e),r=y.useRef(!1),a=y.useRef(()=>{});return y.useEffect(()=>{const o=u=>{if(u.target&&!r.current){let d=function(){MT(m3,n,f,{discrete:!0})};const f={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=d,t.addEventListener("click",a.current,{once:!0})):d()}else t.removeEventListener("click",a.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",o),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function x3(e,t=globalThis?.document){const n=Xs(e),r=y.useRef(!1);return y.useEffect(()=>{const a=o=>{o.target&&!r.current&&MT(g3,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function E1(){const e=new CustomEvent(db);document.dispatchEvent(e)}function MT(e,t,n,{discrete:r}){const a=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?NT(a,o):a.dispatchEvent(o)}var Rv="focusScope.autoFocusOnMount",Iv="focusScope.autoFocusOnUnmount",N1={bubbles:!1,cancelable:!0},w3="FocusScope",Dh=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...l}=e,[u,d]=y.useState(null),f=Xs(a),m=Xs(o),h=y.useRef(null),g=tn(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(T){if(x.paused||!u)return;const _=T.target;u.contains(_)?h.current=_:To(h.current,{select:!0})},C=function(T){if(x.paused||!u)return;const _=T.relatedTarget;_!==null&&(u.contains(_)||To(h.current,{select:!0}))},k=function(T){if(document.activeElement===document.body)for(const P of T)P.removedNodes.length>0&&To(u)};document.addEventListener("focusin",w),document.addEventListener("focusout",C);const N=new MutationObserver(k);return u&&N.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",C),N.disconnect()}}},[r,u,x.paused]),y.useEffect(()=>{if(u){M1.add(x);const w=document.activeElement;if(!u.contains(w)){const k=new CustomEvent(Rv,N1);u.addEventListener(Rv,f),u.dispatchEvent(k),k.defaultPrevented||(S3(N3(_T(u)),{select:!0}),document.activeElement===w&&To(u))}return()=>{u.removeEventListener(Rv,f),setTimeout(()=>{const k=new CustomEvent(Iv,N1);u.addEventListener(Iv,m),u.dispatchEvent(k),k.defaultPrevented||To(w??document.body,{select:!0}),u.removeEventListener(Iv,m),M1.remove(x)},0)}}},[u,f,m,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 N=w.currentTarget,[T,_]=C3(N);T&&_?!w.shiftKey&&k===_?(w.preventDefault(),n&&To(T,{select:!0})):w.shiftKey&&k===T&&(w.preventDefault(),n&&To(_,{select:!0})):k===N&&w.preventDefault()}},[n,r,x.paused]);return s.jsx(wt.div,{tabIndex:-1,...l,ref:g,onKeyDown:b})});Dh.displayName=w3;function S3(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(To(r,{select:t}),document.activeElement!==n)return}function C3(e){const t=_T(e),n=T1(t,e),r=T1(t.reverse(),e);return[n,r]}function _T(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function T1(e,t){for(const n of e)if(!j3(n,{upTo:t}))return n}function j3(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 k3(e){return e instanceof HTMLInputElement&&"select"in e}function To(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&k3(e)&&t&&e.select()}}var M1=E3();function E3(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=_1(e,t),e.unshift(t)},remove(t){e=_1(e,t),e[0]?.resume()}}}function _1(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function N3(e){return e.filter(t=>t.tagName!=="A")}var T3="Portal",Fh=y.forwardRef((e,t)=>{const{container:n,...r}=e,[a,o]=y.useState(!1);er(()=>o(!0),[]);const l=n||a&&globalThis?.document?.body;return l?sN.createPortal(s.jsx(wt.div,{...r,ref:t}),l):null});Fh.displayName=T3;function M3(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var sa=e=>{const{present:t,children:n}=e,r=_3(t),a=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),o=tn(r.ref,P3(a));return typeof n=="function"||r.isPresent?y.cloneElement(a,{ref:o}):null};sa.displayName="Presence";function _3(e){const[t,n]=y.useState(),r=y.useRef(null),a=y.useRef(e),o=y.useRef("none"),l=e?"mounted":"unmounted",[u,d]=M3(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const f=Uf(r.current);o.current=u==="mounted"?f:"none"},[u]),er(()=>{const f=r.current,m=a.current;if(m!==e){const g=o.current,x=Uf(f);e?d("MOUNT"):x==="none"||f?.display==="none"?d("UNMOUNT"):d(m&&g!==x?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,d]),er(()=>{if(t){let f;const m=t.ownerDocument.defaultView??window,h=x=>{const w=Uf(r.current).includes(CSS.escape(x.animationName));if(x.target===t&&w&&(d("ANIMATION_END"),!a.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",f=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},g=x=>{x.target===t&&(o.current=Uf(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{m.clearTimeout(f),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:y.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function Uf(e){return e?.animationName||"none"}function P3(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 Ov=0;function Cx(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??P1()),document.body.insertAdjacentElement("beforeend",e[1]??P1()),Ov++,()=>{Ov===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ov--}},[])}function P1(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ma=function(){return ma=Object.assign||function(t){for(var n,r=1,a=arguments.length;r"u")return G3;var t=J3(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])}},Y3=OT(),Ql="data-scroll-locked",Z3=function(e,t,n,r){var a=e.left,o=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),` - .`.concat(I3,` { - overflow: hidden `).concat(r,`; - padding-right: `).concat(u,"px ").concat(r,`; - } - body[`).concat(Ql,`] { - overflow: hidden `).concat(r,`; - overscroll-behavior: contain; - `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` - padding-left: `.concat(a,`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(Cp,` { - right: `).concat(u,"px ").concat(r,`; - } - - .`).concat(jp,` { - margin-right: `).concat(u,"px ").concat(r,`; - } - - .`).concat(Cp," .").concat(Cp,` { - right: 0 `).concat(r,`; - } - - .`).concat(jp," .").concat(jp,` { - margin-right: 0 `).concat(r,`; - } - - body[`).concat(Ql,`] { - `).concat(O3,": ").concat(u,`px; - } -`)},I1=function(){var e=parseInt(document.body.getAttribute(Ql)||"0",10);return isFinite(e)?e:0},X3=function(){y.useEffect(function(){return document.body.setAttribute(Ql,(I1()+1).toString()),function(){var e=I1()-1;e<=0?document.body.removeAttribute(Ql):document.body.setAttribute(Ql,e.toString())}},[])},eB=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;X3();var o=y.useMemo(function(){return Q3(a)},[a]);return y.createElement(Y3,{styles:Z3(o,!t,a,n?"":"!important")})},fb=!1;if(typeof window<"u")try{var Vf=Object.defineProperty({},"passive",{get:function(){return fb=!0,!0}});window.addEventListener("test",Vf,Vf),window.removeEventListener("test",Vf,Vf)}catch{fb=!1}var Ol=fb?{passive:!1}:!1,tB=function(e){return e.tagName==="TEXTAREA"},AT=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!tB(e)&&n[t]==="visible")},nB=function(e){return AT(e,"overflowY")},rB=function(e){return AT(e,"overflowX")},O1=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=DT(e,r);if(a){var o=FT(e,r),l=o[1],u=o[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},sB=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},aB=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},DT=function(e,t){return e==="v"?nB(t):rB(t)},FT=function(e,t){return e==="v"?sB(t):aB(t)},oB=function(e,t){return e==="h"&&t==="rtl"?-1:1},iB=function(e,t,n,r,a){var o=oB(e,window.getComputedStyle(t).direction),l=o*r,u=n.target,d=t.contains(u),f=!1,m=l>0,h=0,g=0;do{if(!u)break;var x=FT(e,u),b=x[0],w=x[1],C=x[2],k=w-C-o*b;(b||k)&&DT(e,u)&&(h+=k,g+=b);var N=u.parentNode;u=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!d&&u!==document.body||d&&(t.contains(u)||t===u));return(m&&Math.abs(h)<1||!m&&Math.abs(g)<1)&&(f=!0),f},qf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},A1=function(e){return[e.deltaX,e.deltaY]},D1=function(e){return e&&"current"in e?e.current:e},lB=function(e,t){return e[0]===t[0]&&e[1]===t[1]},cB=function(e){return` - .block-interactivity-`.concat(e,` {pointer-events: none;} - .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},uB=0,Al=[];function dB(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),a=y.useState(uB++)[0],o=y.useState(OT)[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(a));var w=R3([e.lockRef.current],(e.shards||[]).map(D1),!0).filter(Boolean);return w.forEach(function(C){return C.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),w.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var u=y.useCallback(function(w,C){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!l.current.allowPinchZoom;var k=qf(w),N=n.current,T="deltaX"in w?w.deltaX:N[0]-k[0],_="deltaY"in w?w.deltaY:N[1]-k[1],P,M=w.target,O=Math.abs(T)>Math.abs(_)?"h":"v";if("touches"in w&&O==="h"&&M.type==="range")return!1;var D=window.getSelection(),F=D&&D.anchorNode,$=F?F===M||F.contains(M):!1;if($)return!1;var te=O1(O,M);if(!te)return!0;if(te?P=O:(P=O==="v"?"h":"v",te=O1(O,M)),!te)return!1;if(!r.current&&"changedTouches"in w&&(T||_)&&(r.current=P),!P)return!0;var z=r.current||P;return iB(z,C,w,z==="h"?T:_)},[]),d=y.useCallback(function(w){var C=w;if(!(!Al.length||Al[Al.length-1]!==o)){var k="deltaY"in C?A1(C):qf(C),N=t.current.filter(function(P){return P.name===C.type&&(P.target===C.target||C.target===P.shadowParent)&&lB(P.delta,k)})[0];if(N&&N.should){C.cancelable&&C.preventDefault();return}if(!N){var T=(l.current.shards||[]).map(D1).filter(Boolean).filter(function(P){return P.contains(C.target)}),_=T.length>0?u(C,T[0]):!l.current.noIsolation;_&&C.cancelable&&C.preventDefault()}}},[]),f=y.useCallback(function(w,C,k,N){var T={name:w,delta:C,target:k,should:N,shadowParent:fB(k)};t.current.push(T),setTimeout(function(){t.current=t.current.filter(function(_){return _!==T})},1)},[]),m=y.useCallback(function(w){n.current=qf(w),r.current=void 0},[]),h=y.useCallback(function(w){f(w.type,A1(w),w.target,u(w,e.lockRef.current))},[]),g=y.useCallback(function(w){f(w.type,qf(w),w.target,u(w,e.lockRef.current))},[]);y.useEffect(function(){return Al.push(o),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:g}),document.addEventListener("wheel",d,Ol),document.addEventListener("touchmove",d,Ol),document.addEventListener("touchstart",m,Ol),function(){Al=Al.filter(function(w){return w!==o}),document.removeEventListener("wheel",d,Ol),document.removeEventListener("touchmove",d,Ol),document.removeEventListener("touchstart",m,Ol)}},[]);var x=e.removeScrollBar,b=e.inert;return y.createElement(y.Fragment,null,b?y.createElement(o,{styles:cB(a)}):null,x?y.createElement(eB,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function fB(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const pB=z3(IT,dB);var $h=y.forwardRef(function(e,t){return y.createElement(Lh,ma({},e,{ref:t,sideCar:pB}))});$h.classNames=Lh.classNames;var hB=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Dl=new WeakMap,Hf=new WeakMap,Wf={},Lv=0,LT=function(e){return e&&(e.host||LT(e.parentNode))},mB=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=LT(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})},gB=function(e,t,n,r){var a=mB(t,Array.isArray(e)?e:[e]);Wf[n]||(Wf[n]=new WeakMap);var o=Wf[n],l=[],u=new Set,d=new Set(a),f=function(h){!h||u.has(h)||(u.add(h),f(h.parentNode))};a.forEach(f);var m=function(h){!h||d.has(h)||Array.prototype.forEach.call(h.children,function(g){if(u.has(g))m(g);else try{var x=g.getAttribute(r),b=x!==null&&x!=="false",w=(Dl.get(g)||0)+1,C=(o.get(g)||0)+1;Dl.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 m(t),u.clear(),Lv++,function(){l.forEach(function(h){var g=Dl.get(h)-1,x=o.get(h)-1;Dl.set(h,g),o.set(h,x),g||(Hf.has(h)||h.removeAttribute(r),Hf.delete(h)),x||h.removeAttribute(n)}),Lv--,Lv||(Dl=new WeakMap,Dl=new WeakMap,Hf=new WeakMap,Wf={})}},jx=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=hB(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live]"))),gB(r,a,n,"aria-hidden")):function(){return null}},Bh="Dialog",[$T]=ra(Bh),[vB,aa]=$T(Bh),BT=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:l=!0}=e,u=y.useRef(null),d=y.useRef(null),[f,m]=Ua({prop:r,defaultProp:a??!1,onChange:o,caller:Bh});return s.jsx(vB,{scope:t,triggerRef:u,contentRef:d,contentId:Qs(),titleId:Qs(),descriptionId:Qs(),open:f,onOpenChange:m,onOpenToggle:y.useCallback(()=>m(h=>!h),[m]),modal:l,children:n})};BT.displayName=Bh;var zT="DialogTrigger",UT=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=aa(zT,n),o=tn(t,a.triggerRef);return s.jsx(wt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Nx(a.open),...r,ref:o,onClick:Ge(e.onClick,a.onOpenToggle)})});UT.displayName=zT;var kx="DialogPortal",[yB,VT]=$T(kx,{forceMount:void 0}),qT=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,o=aa(kx,t);return s.jsx(yB,{scope:t,forceMount:n,children:y.Children.map(r,l=>s.jsx(sa,{present:n||o.open,children:s.jsx(Fh,{asChild:!0,container:a,children:l})}))})};qT.displayName=kx;var Wp="DialogOverlay",HT=y.forwardRef((e,t)=>{const n=VT(Wp,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,o=aa(Wp,e.__scopeDialog);return o.modal?s.jsx(sa,{present:r||o.open,children:s.jsx(xB,{...a,ref:t})}):null});HT.displayName=Wp;var bB=ic("DialogOverlay.RemoveScroll"),xB=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=aa(Wp,n);return s.jsx($h,{as:bB,allowPinchZoom:!0,shards:[a.contentRef],children:s.jsx(wt.div,{"data-state":Nx(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ui="DialogContent",WT=y.forwardRef((e,t)=>{const n=VT(Ui,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,o=aa(Ui,e.__scopeDialog);return s.jsx(sa,{present:r||o.open,children:o.modal?s.jsx(wB,{...a,ref:t}):s.jsx(SB,{...a,ref:t})})});WT.displayName=Ui;var wB=y.forwardRef((e,t)=>{const n=aa(Ui,e.__scopeDialog),r=y.useRef(null),a=tn(t,n.contentRef,r);return y.useEffect(()=>{const o=r.current;if(o)return jx(o)},[]),s.jsx(KT,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ge(e.onCloseAutoFocus,o=>{o.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Ge(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&o.preventDefault()}),onFocusOutside:Ge(e.onFocusOutside,o=>o.preventDefault())})}),SB=y.forwardRef((e,t)=>{const n=aa(Ui,e.__scopeDialog),r=y.useRef(!1),a=y.useRef(!1);return s.jsx(KT,{...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,a.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=o.target;n.triggerRef.current?.contains(l)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&a.current&&o.preventDefault()}})}),KT=y.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:o,...l}=e,u=aa(Ui,n),d=y.useRef(null),f=tn(t,d);return Cx(),s.jsxs(s.Fragment,{children:[s.jsx(Dh,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:o,children:s.jsx(Ah,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":Nx(u.open),...l,ref:f,onDismiss:()=>u.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(CB,{titleId:u.titleId}),s.jsx(kB,{contentRef:d,descriptionId:u.descriptionId})]})]})}),Ex="DialogTitle",GT=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=aa(Ex,n);return s.jsx(wt.h2,{id:a.titleId,...r,ref:t})});GT.displayName=Ex;var JT="DialogDescription",QT=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=aa(JT,n);return s.jsx(wt.p,{id:a.descriptionId,...r,ref:t})});QT.displayName=JT;var YT="DialogClose",ZT=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=aa(YT,n);return s.jsx(wt.button,{type:"button",...r,ref:t,onClick:Ge(e.onClick,()=>a.onOpenChange(!1))})});ZT.displayName=YT;function Nx(e){return e?"open":"closed"}var XT="DialogTitleWarning",[Lce,eM]=e3(XT,{contentName:Ui,titleName:Ex,docsSlug:"dialog"}),CB=({titleId:e})=>{const t=eM(XT),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},jB="DialogDescriptionWarning",kB=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${eM(jB).contentName}}.`;return y.useEffect(()=>{const a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},EB=BT,NB=UT,TB=qT,MB=HT,_B=WT,PB=GT,RB=QT,IB=ZT;/** - * @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=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),tM=(...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 AB={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 DB=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:o,iconNode:l,...u},d)=>y.createElement("svg",{ref:d,...AB,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:tM("lucide",a),...u},[...l.map(([f,m])=>y.createElement(f,m)),...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 Be=(e,t)=>{const n=y.forwardRef(({className:r,...a},o)=>y.createElement(DB,{ref:o,iconNode:t,className:tM(`lucide-${OB(e)}`,r),...a}));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 F1=Be("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 FB=Be("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** - * @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 Tx=Be("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 LB=Be("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 $B=Be("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 Mx=Be("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 BB=Be("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 zB=Be("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 nM=Be("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** - * @license lucide-react v0.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=Be("CircleCheckBig",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** - * @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 L1=Be("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** - * @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=Be("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 Xi=Be("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 qB=Be("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 HB=Be("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** - * @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=Be("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 Qo=Be("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 KB=Be("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 el=Be("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 Yo=Be("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=Be("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=Be("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=Be("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 YB=Be("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 _x=Be("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 ZB=Be("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 XB=Be("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/** - * @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 ez=Be("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 tz=Be("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 nz=Be("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 rz=Be("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 sz=Be("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 az=Be("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/** - * @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 oz=Be("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 iz=Be("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** - * @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=Be("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 lz=Be("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 tl=Be("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 zh=Be("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** - * @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 cz=Be("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 rM=Be("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** - * @license lucide-react v0.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 uz=Be("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 dz=Be("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 lc=Be("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 nl=Be("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** - * @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 sM=Be("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 fz=Be("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 rl=Be("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 sl=Be("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 Zr=Be("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 pz=Be("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);/** - * @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 Kp=Be("QrCode",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]);/** - * @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 hz=Be("RadioTower",[["path",{d:"M4.9 16.1C1 12.2 1 5.8 4.9 1.9",key:"s0qx1y"}],["path",{d:"M7.8 4.7a6.14 6.14 0 0 0-.8 7.5",key:"1idnkw"}],["circle",{cx:"12",cy:"9",r:"2",key:"1092wv"}],["path",{d:"M16.2 4.8c2 2 2.26 5.11.8 7.47",key:"ojru2q"}],["path",{d:"M19.1 1.9a9.96 9.96 0 0 1 0 14.1",key:"rhi7fg"}],["path",{d:"M9.5 18h5",key:"mfy3pd"}],["path",{d:"m8 22 4-11 4 11",key:"25yftu"}]]);/** - * @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 cc=Be("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 al=Be("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 aM=Be("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** - * @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 Gp=Be("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/** - * @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 mz=Be("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** - * @license lucide-react v0.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 gz=Be("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 oM=Be("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 vz=Be("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 yz=Be("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 bz=Be("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 iM=Be("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** - * @license lucide-react v0.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 xz=Be("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 Jp=Be("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 wz=Be("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 $1=Be("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** - * @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 Sz=Be("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 Uh=Be("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 Cz=Be("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"}]]),Px="-";function jz(e){const t=Ez(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function a(l){const u=l.split(Px);return u[0]===""&&u.length!==1&&u.shift(),lM(u,t)||kz(l)}function o(l,u){const d=n[l]||[];return u&&r[l]?[...d,...r[l]]:d}return{getClassGroupId:a,getConflictingClassGroupIds:o}}function lM(e,t){if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?lM(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const o=e.join(Px);return t.validators.find(({validator:l})=>l(o))?.classGroupId}const B1=/^\[(.+)\]$/;function kz(e){if(B1.test(e)){const t=B1.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function Ez(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Tz(Object.entries(e.classGroups),n).forEach(([o,l])=>{hb(l,r,o,t)}),r}function hb(e,t,n,r){e.forEach(a=>{if(typeof a=="string"){const o=a===""?t:z1(t,a);o.classGroupId=n;return}if(typeof a=="function"){if(Nz(a)){hb(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([o,l])=>{hb(l,z1(t,o),n,r)})})}function z1(e,t){let n=e;return t.split(Px).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function Nz(e){return e.isThemeGetter}function Tz(e,t){return t?e.map(([n,r])=>{const a=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,a]}):e}function Mz(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function a(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 a(o,l),l},set(o,l){n.has(o)?n.set(o,l):a(o,l)}}}const cM="!";function _z(e){const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,a=t[0],o=t.length;function l(u){const d=[];let f=0,m=0,h;for(let C=0;Cm?h-m:void 0;return{modifiers:d,hasImportantModifier:x,baseClassName:b,maybePostfixModifierPosition:w}}return n?function(d){return n({className:d,parseClassName:l})}:l}function Pz(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 Rz(e){return{cache:Mz(e.cacheSize),parseClassName:_z(e),...jz(e)}}const Iz=/\s+/;function Oz(e,t){const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,o=new Set;return e.trim().split(Iz).map(l=>{const{modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:m}=n(l);let h=!!m,g=r(h?f.substring(0,m):f);if(!g){if(!h)return{isTailwindClass:!1,originalClassName:l};if(g=r(f),!g)return{isTailwindClass:!1,originalClassName:l};h=!1}const x=Pz(u).join(":");return{isTailwindClass:!0,modifierId:d?x+cM:x,classGroupId:g,originalClassName:l,hasPostfixModifier:h}}).reverse().filter(l=>{if(!l.isTailwindClass)return!0;const{modifierId:u,classGroupId:d,hasPostfixModifier:f}=l,m=u+d;return o.has(m)?!1:(o.add(m),a(d,f).forEach(h=>o.add(u+h)),!0)}).reverse().map(l=>l.originalClassName).join(" ")}function Az(){let e=0,t,n,r="";for(;eh(m),e());return n=Rz(f),r=n.cache.get,a=n.cache.set,o=u,u(d)}function u(d){const f=r(d);if(f)return f;const m=Oz(d,n);return a(d,m),m}return function(){return o(Az.apply(null,arguments))}}function kn(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const dM=/^\[(?:([a-z-]+):)?(.+)\]$/i,Fz=/^\d+\/\d+$/,Lz=new Set(["px","full","screen"]),$z=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Bz=/\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$/,zz=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Uz=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Vz=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Oa(e){return Ri(e)||Lz.has(e)||Fz.test(e)}function jo(e){return jc(e,"length",Yz)}function Ri(e){return!!e&&!Number.isNaN(Number(e))}function Kf(e){return jc(e,"number",Ri)}function Nu(e){return!!e&&Number.isInteger(Number(e))}function qz(e){return e.endsWith("%")&&Ri(e.slice(0,-1))}function At(e){return dM.test(e)}function ko(e){return $z.test(e)}const Hz=new Set(["length","size","percentage"]);function Wz(e){return jc(e,Hz,fM)}function Kz(e){return jc(e,"position",fM)}const Gz=new Set(["image","url"]);function Jz(e){return jc(e,Gz,Xz)}function Qz(e){return jc(e,"",Zz)}function Tu(){return!0}function jc(e,t,n){const r=dM.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function Yz(e){return Bz.test(e)&&!zz.test(e)}function fM(){return!1}function Zz(e){return Uz.test(e)}function Xz(e){return Vz.test(e)}function e5(){const e=kn("colors"),t=kn("spacing"),n=kn("blur"),r=kn("brightness"),a=kn("borderColor"),o=kn("borderRadius"),l=kn("borderSpacing"),u=kn("borderWidth"),d=kn("contrast"),f=kn("grayscale"),m=kn("hueRotate"),h=kn("invert"),g=kn("gap"),x=kn("gradientColorStops"),b=kn("gradientColorStopPositions"),w=kn("inset"),C=kn("margin"),k=kn("opacity"),N=kn("padding"),T=kn("saturate"),_=kn("scale"),P=kn("sepia"),M=kn("skew"),O=kn("space"),D=kn("translate"),F=()=>["auto","contain","none"],$=()=>["auto","hidden","clip","visible","scroll"],te=()=>["auto",At,t],z=()=>[At,t],ue=()=>["",Oa,jo],V=()=>["auto",Ri,At],ne=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Y=()=>["solid","dashed","dotted","double","none"],se=()=>["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"],W=()=>["","0",At],U=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>[Ri,Kf],K=()=>[Ri,At];return{cacheSize:500,separator:":",theme:{colors:[Tu],spacing:[Oa,jo],blur:["none","",ko,At],brightness:A(),borderColor:[e],borderRadius:["none","","full",ko,At],borderSpacing:z(),borderWidth:ue(),contrast:A(),grayscale:W(),hueRotate:K(),invert:W(),gap:z(),gradientColorStops:[e],gradientColorStopPositions:[qz,jo],inset:te(),margin:te(),opacity:A(),padding:z(),saturate:A(),scale:A(),sepia:W(),skew:K(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",At]}],container:["container"],columns:[{columns:[ko]}],"break-after":[{"break-after":U()}],"break-before":[{"break-before":U()}],"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:[...ne(),At]}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-y":[{"overscroll-y":F()}],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",Nu,At]}],basis:[{basis:te()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",At]}],grow:[{grow:W()}],shrink:[{shrink:W()}],order:[{order:["first","last","none",Nu,At]}],"grid-cols":[{"grid-cols":[Tu]}],"col-start-end":[{col:["auto",{span:["full",Nu,At]},At]}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":[Tu]}],"row-start-end":[{row:["auto",{span:[Nu,At]},At]}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",At]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",At]}],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:[N]}],px:[{px:[N]}],py:[{py:[N]}],ps:[{ps:[N]}],pe:[{pe:[N]}],pt:[{pt:[N]}],pr:[{pr:[N]}],pb:[{pb:[N]}],pl:[{pl:[N]}],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",At,t]}],"min-w":[{"min-w":[At,t,"min","max","fit"]}],"max-w":[{"max-w":[At,t,"none","full","min","max","fit","prose",{screen:[ko]},ko]}],h:[{h:[At,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[At,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[At,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[At,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ko,jo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Kf]}],"font-family":[{font:[Tu]}],"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",At]}],"line-clamp":[{"line-clamp":["none",Ri,Kf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Oa,At]}],"list-image":[{"list-image":["none",At]}],"list-style-type":[{list:["none","disc","decimal",At]}],"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:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Oa,jo]}],"underline-offset":[{"underline-offset":["auto",Oa,At]}],"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:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",At]}],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",At]}],"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:[...ne(),Kz]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Wz]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Jz]}],"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:[...Y(),"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:Y()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...Y()]}],"outline-offset":[{"outline-offset":[Oa,At]}],"outline-w":[{outline:[Oa,jo]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[k]}],"ring-offset-w":[{"ring-offset":[Oa,jo]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ko,Qz]}],"shadow-color":[{shadow:[Tu]}],opacity:[{opacity:[k]}],"mix-blend":[{"mix-blend":[...se(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":se()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",ko,At]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[m]}],invert:[{invert:[h]}],saturate:[{saturate:[T]}],sepia:[{sepia:[P]}],"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":[m]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[k]}],"backdrop-saturate":[{"backdrop-saturate":[T]}],"backdrop-sepia":[{"backdrop-sepia":[P]}],"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",At]}],duration:[{duration:K()}],ease:[{ease:["linear","in","out","in-out",At]}],delay:[{delay:K()}],animate:[{animate:["none","spin","ping","pulse","bounce",At]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[_]}],"scale-x":[{"scale-x":[_]}],"scale-y":[{"scale-y":[_]}],rotate:[{rotate:[Nu,At]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[M]}],"skew-y":[{"skew-y":[M]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",At]}],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",At]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"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",At]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Oa,jo,Kf]}],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 t5=Dz(e5);function on(...e){return t5(Js(e))}const yt=EB,sn=NB,n5=TB,pM=y.forwardRef(({className:e,...t},n)=>s.jsx(MB,{ref:n,"data-slot":"dialog-overlay",className:on("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t}));pM.displayName="DialogOverlay";const ht=y.forwardRef(({className:e,children:t,showCloseButton:n=!0,...r},a)=>s.jsxs(n5,{children:[s.jsx(pM,{}),s.jsxs(_B,{ref:a,"data-slot":"dialog-content",className:on("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...r,children:[t,n&&s.jsxs(IB,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[s.jsx(Uh,{}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));ht.displayName="DialogContent";const mt=({className:e,...t})=>s.jsx("div",{"data-slot":"dialog-header",className:on("flex flex-col gap-2 text-center sm:text-left",e),...t});mt.displayName="DialogHeader";const Wt=({className:e,...t})=>s.jsx("div",{"data-slot":"dialog-footer",className:on("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t});Wt.displayName="DialogFooter";const xt=y.forwardRef(({className:e,...t},n)=>s.jsx(PB,{ref:n,"data-slot":"dialog-title",className:on("text-lg leading-none font-semibold",e),...t}));xt.displayName="DialogTitle";const Er=y.forwardRef(({className:e,...t},n)=>s.jsx(RB,{ref:n,"data-slot":"dialog-description",className:on("text-muted-foreground text-sm",e),...t}));Er.displayName="DialogDescription";const Ce=un.create({timeout:3e4});Ce.interceptors.request.use(async e=>{const t=hr(Fn.API_URL);if(t&&(e.baseURL=t.toString()),!e.headers.has("apikey")){const n=hr(Fn.INSTANCE_TOKEN);n&&e.headers.set("apikey",n)}return e},e=>Promise.reject(e));const pn=un.create({timeout:3e4});pn.interceptors.request.use(async e=>{const t=hr(Fn.API_URL);if(t&&(e.baseURL=t.toString()),!e.headers.has("apikey")){const n=hr(Fn.TOKEN);n&&e.headers.set("apikey",n)}return e},e=>Promise.reject(e));const hM=e=>({id:e.id,name:e.name,connectionStatus:e.connected?"open":"close",ownerJid:e.jid,profileName:"",profilePicUrl:"",integration:"EVOLUTION_GO",number:e.jid?e.jid.split("@")[0].split(":")[0]:"",businessId:"",token:e.token,clientName:e.client_name,createdAt:e.createdAt,updatedAt:e.createdAt,Setting:{rejectCall:e.rejectCall,msgCall:e.msgRejectCall,groupsIgnore:e.ignoreGroups,alwaysOnline:e.alwaysOnline,readMessages:e.readMessages,readStatus:!e.ignoreStatus,syncFullHistory:!1},_count:{Contact:0,Chat:0,Message:0}}),r5=e=>["instance","fetchInstance","go",JSON.stringify(e)],s5=async({instanceId:e})=>{const t=await pn.get(`/instance/info/${e}`);return hM(t.data.data)},a5=e=>{const{instanceId:t,enabled:n,...r}=e;return gt({...r,queryKey:r5({instanceId:t}),queryFn:()=>s5({instanceId:t}),enabled:!!t&&(n??!0)})},o5=e=>["instance","fetchInstance",JSON.stringify(e)],i5=async({instanceId:e})=>{const t=await pn.get("/instance/fetchInstances",{params:{instanceId:e}});return Array.isArray(t.data)?t.data[0]:t.data},l5=e=>{const{instanceId:t,enabled:n,...r}=e;return gt({...r,queryKey:o5({instanceId:t}),queryFn:()=>i5({instanceId:t}),enabled:!!t&&(n??!0)})},mM=e=>{const t=Tr(),n=l5({...e,enabled:(e.enabled??!0)&&t==="api"}),r=a5({...e,enabled:(e.enabled??!0)&&t==="go"});return t==="go"?r:n};function Rx(e){const t=e+"CollectionProvider",[n,r]=ra(t),[a,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=w=>{const{scope:C,children:k}=w,N=ke.useRef(null),T=ke.useRef(new Map).current;return s.jsx(a,{scope:C,itemMap:T,collectionRef:N,children:k})};l.displayName=t;const u=e+"CollectionSlot",d=ic(u),f=ke.forwardRef((w,C)=>{const{scope:k,children:N}=w,T=o(u,k),_=tn(C,T.collectionRef);return s.jsx(d,{ref:_,children:N})});f.displayName=u;const m=e+"CollectionItemSlot",h="data-radix-collection-item",g=ic(m),x=ke.forwardRef((w,C)=>{const{scope:k,children:N,...T}=w,_=ke.useRef(null),P=tn(C,_),M=o(m,k);return ke.useEffect(()=>(M.itemMap.set(_,{ref:_,...T}),()=>void M.itemMap.delete(_))),s.jsx(g,{[h]:"",ref:P,children:N})});x.displayName=m;function b(w){const C=o(e+"CollectionConsumer",w);return ke.useCallback(()=>{const N=C.collectionRef.current;if(!N)return[];const T=Array.from(N.querySelectorAll(`[${h}]`));return Array.from(C.itemMap.values()).sort((M,O)=>T.indexOf(M.ref.current)-T.indexOf(O.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:l,Slot:f,ItemSlot:x},b,r]}var c5=y.createContext(void 0);function Vh(e){const t=y.useContext(c5);return e||t||"ltr"}const u5=["top","right","bottom","left"],va=Math.min,ds=Math.max,Qp=Math.round,Gf=Math.floor,Lo=e=>({x:e,y:e}),d5={left:"right",right:"left",bottom:"top",top:"bottom"},f5={start:"end",end:"start"};function mb(e,t,n){return ds(e,va(t,n))}function Va(e,t){return typeof e=="function"?e(t):e}function qa(e){return e.split("-")[0]}function kc(e){return e.split("-")[1]}function Ix(e){return e==="x"?"y":"x"}function Ox(e){return e==="y"?"height":"width"}function $o(e){return["top","bottom"].includes(qa(e))?"y":"x"}function Ax(e){return Ix($o(e))}function p5(e,t,n){n===void 0&&(n=!1);const r=kc(e),a=Ax(e),o=Ox(a);let l=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=Yp(l)),[l,Yp(l)]}function h5(e){const t=Yp(e);return[gb(e),t,gb(t)]}function gb(e){return e.replace(/start|end/g,t=>f5[t])}function m5(e,t,n){const r=["left","right"],a=["right","left"],o=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?a:r:t?r:a;case"left":case"right":return t?o:l;default:return[]}}function g5(e,t,n,r){const a=kc(e);let o=m5(qa(e),n==="start",r);return a&&(o=o.map(l=>l+"-"+a),t&&(o=o.concat(o.map(gb)))),o}function Yp(e){return e.replace(/left|right|bottom|top/g,t=>d5[t])}function v5(e){return{top:0,right:0,bottom:0,left:0,...e}}function gM(e){return typeof e!="number"?v5(e):{top:e,right:e,bottom:e,left:e}}function Zp(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function U1(e,t,n){let{reference:r,floating:a}=e;const o=$o(t),l=Ax(t),u=Ox(l),d=qa(t),f=o==="y",m=r.x+r.width/2-a.width/2,h=r.y+r.height/2-a.height/2,g=r[u]/2-a[u]/2;let x;switch(d){case"top":x={x:m,y:r.y-a.height};break;case"bottom":x={x:m,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:h};break;case"left":x={x:r.x-a.width,y:h};break;default:x={x:r.x,y:r.y}}switch(kc(t)){case"start":x[l]-=g*(n&&f?-1:1);break;case"end":x[l]+=g*(n&&f?-1:1);break}return x}const y5=async(e,t,n)=>{const{placement:r="bottom",strategy:a="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:a}),{x:m,y:h}=U1(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:a,rects:o,platform:l,elements:u,middlewareData:d}=t,{element:f,padding:m=0}=Va(e,t)||{};if(f==null)return{};const h=gM(m),g={x:n,y:r},x=Ax(a),b=Ox(x),w=await l.getDimensions(f),C=x==="y",k=C?"top":"left",N=C?"bottom":"right",T=C?"clientHeight":"clientWidth",_=o.reference[b]+o.reference[x]-g[x]-o.floating[b],P=g[x]-o.reference[x],M=await(l.getOffsetParent==null?void 0:l.getOffsetParent(f));let O=M?M[T]:0;(!O||!await(l.isElement==null?void 0:l.isElement(M)))&&(O=u.floating[T]||o.floating[b]);const D=_/2-P/2,F=O/2-w[b]/2-1,$=va(h[k],F),te=va(h[N],F),z=$,ue=O-w[b]-te,V=O/2-w[b]/2+D,ne=mb(z,V,ue),Y=!d.arrow&&kc(a)!=null&&V!==ne&&o.reference[b]/2-(VV<=0)){var te,z;const V=(((te=o.flip)==null?void 0:te.index)||0)+1,ne=O[V];if(ne)return{data:{index:V,overflows:$},reset:{placement:ne}};let Y=(z=$.filter(se=>se.overflows[0]<=0).sort((se,H)=>se.overflows[1]-H.overflows[1])[0])==null?void 0:z.placement;if(!Y)switch(x){case"bestFit":{var ue;const se=(ue=$.filter(H=>{if(M){const W=$o(H.placement);return W===N||W==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(W=>W>0).reduce((W,U)=>W+U,0)]).sort((H,W)=>H[1]-W[1])[0])==null?void 0:ue[0];se&&(Y=se);break}case"initialPlacement":Y=u;break}if(a!==Y)return{reset:{placement:Y}}}return{}}}};function V1(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function q1(e){return u5.some(t=>e[t]>=0)}const w5=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...a}=Va(e,t);switch(r){case"referenceHidden":{const o=await sd(t,{...a,elementContext:"reference"}),l=V1(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:q1(l)}}}case"escaped":{const o=await sd(t,{...a,altBoundary:!0}),l=V1(o,n.floating);return{data:{escapedOffsets:l,escaped:q1(l)}}}default:return{}}}}};async function S5(e,t){const{placement:n,platform:r,elements:a}=e,o=await(r.isRTL==null?void 0:r.isRTL(a.floating)),l=qa(n),u=kc(n),d=$o(n)==="y",f=["left","top"].includes(l)?-1:1,m=o&&d?-1:1,h=Va(t,e);let{mainAxis:g,crossAxis:x,alignmentAxis:b}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...h};return u&&typeof b=="number"&&(x=u==="end"?b*-1:b),d?{x:x*m,y:g*f}:{x:g*f,y:x*m}}const C5=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:o,placement:l,middlewareData:u}=t,d=await S5(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:a+d.x,y:o+d.y,data:{...d,placement:l}}}}},j5=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:u={fn:C=>{let{x:k,y:N}=C;return{x:k,y:N}}},...d}=Va(e,t),f={x:n,y:r},m=await sd(t,d),h=$o(qa(a)),g=Ix(h);let x=f[g],b=f[h];if(o){const C=g==="y"?"top":"left",k=g==="y"?"bottom":"right",N=x+m[C],T=x-m[k];x=mb(N,x,T)}if(l){const C=h==="y"?"top":"left",k=h==="y"?"bottom":"right",N=b+m[C],T=b-m[k];b=mb(N,b,T)}const w=u.fn({...t,[g]:x,[h]:b});return{...w,data:{x:w.x-n,y:w.y-r}}}}},k5=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:o,middlewareData:l}=t,{offset:u=0,mainAxis:d=!0,crossAxis:f=!0}=Va(e,t),m={x:n,y:r},h=$o(a),g=Ix(h);let x=m[g],b=m[h];const w=Va(u,t),C=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(d){const T=g==="y"?"height":"width",_=o.reference[g]-o.floating[T]+C.mainAxis,P=o.reference[g]+o.reference[T]-C.mainAxis;x<_?x=_:x>P&&(x=P)}if(f){var k,N;const T=g==="y"?"width":"height",_=["top","left"].includes(qa(a)),P=o.reference[h]-o.floating[T]+(_&&((k=l.offset)==null?void 0:k[h])||0)+(_?0:C.crossAxis),M=o.reference[h]+o.reference[T]+(_?0:((N=l.offset)==null?void 0:N[h])||0)-(_?C.crossAxis:0);bM&&(b=M)}return{[g]:x,[h]:b}}}},E5=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:a,elements:o}=t,{apply:l=()=>{},...u}=Va(e,t),d=await sd(t,u),f=qa(n),m=kc(n),h=$o(n)==="y",{width:g,height:x}=r.floating;let b,w;f==="top"||f==="bottom"?(b=f,w=m===(await(a.isRTL==null?void 0:a.isRTL(o.floating))?"start":"end")?"left":"right"):(w=f,b=m==="end"?"top":"bottom");const C=x-d.top-d.bottom,k=g-d.left-d.right,N=va(x-d[b],C),T=va(g-d[w],k),_=!t.middlewareData.shift;let P=N,M=T;if(h?M=m||_?va(T,k):k:P=m||_?va(N,C):C,_&&!m){const D=ds(d.left,0),F=ds(d.right,0),$=ds(d.top,0),te=ds(d.bottom,0);h?M=g-2*(D!==0||F!==0?D+F:ds(d.left,d.right)):P=x-2*($!==0||te!==0?$+te:ds(d.top,d.bottom))}await l({...t,availableWidth:M,availableHeight:P});const O=await a.getDimensions(o.floating);return g!==O.width||x!==O.height?{reset:{rects:!0}}:{}}}};function Ec(e){return vM(e)?(e.nodeName||"").toLowerCase():"#document"}function ps(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ja(e){var t;return(t=(vM(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function vM(e){return e instanceof Node||e instanceof ps(e).Node}function xa(e){return e instanceof Element||e instanceof ps(e).Element}function wa(e){return e instanceof HTMLElement||e instanceof ps(e).HTMLElement}function H1(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ps(e).ShadowRoot}function wd(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=ea(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(a)}function N5(e){return["table","td","th"].includes(Ec(e))}function qh(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Dx(e){const t=Fx(),n=ea(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 T5(e){let t=Bo(e);for(;wa(t)&&!uc(t);){if(qh(t))return null;if(Dx(t))return t;t=Bo(t)}return null}function Fx(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function uc(e){return["html","body","#document"].includes(Ec(e))}function ea(e){return ps(e).getComputedStyle(e)}function Hh(e){return xa(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Bo(e){if(Ec(e)==="html")return e;const t=e.assignedSlot||e.parentNode||H1(e)&&e.host||Ja(e);return H1(t)?t.host:t}function yM(e){const t=Bo(e);return uc(t)?e.ownerDocument?e.ownerDocument.body:e.body:wa(t)&&wd(t)?t:yM(t)}function ad(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=yM(e),o=a===((r=e.ownerDocument)==null?void 0:r.body),l=ps(a);return o?t.concat(l,l.visualViewport||[],wd(a)?a:[],l.frameElement&&n?ad(l.frameElement):[]):t.concat(a,ad(a,[],n))}function bM(e){const t=ea(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=wa(e),o=a?e.offsetWidth:n,l=a?e.offsetHeight:r,u=Qp(n)!==o||Qp(r)!==l;return u&&(n=o,r=l),{width:n,height:r,$:u}}function Lx(e){return xa(e)?e:e.contextElement}function Yl(e){const t=Lx(e);if(!wa(t))return Lo(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:o}=bM(t);let l=(o?Qp(n.width):n.width)/r,u=(o?Qp(n.height):n.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const M5=Lo(0);function xM(e){const t=ps(e);return!Fx()||!t.visualViewport?M5:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _5(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ps(e)?!1:t}function Vi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),o=Lx(e);let l=Lo(1);t&&(r?xa(r)&&(l=Yl(r)):l=Yl(e));const u=_5(o,n,r)?xM(o):Lo(0);let d=(a.left+u.x)/l.x,f=(a.top+u.y)/l.y,m=a.width/l.x,h=a.height/l.y;if(o){const g=ps(o),x=r&&xa(r)?ps(r):r;let b=g,w=b.frameElement;for(;w&&r&&x!==b;){const C=Yl(w),k=w.getBoundingClientRect(),N=ea(w),T=k.left+(w.clientLeft+parseFloat(N.paddingLeft))*C.x,_=k.top+(w.clientTop+parseFloat(N.paddingTop))*C.y;d*=C.x,f*=C.y,m*=C.x,h*=C.y,d+=T,f+=_,b=ps(w),w=b.frameElement}}return Zp({width:m,height:h,x:d,y:f})}function P5(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const o=a==="fixed",l=Ja(r),u=t?qh(t.floating):!1;if(r===l||u&&o)return n;let d={scrollLeft:0,scrollTop:0},f=Lo(1);const m=Lo(0),h=wa(r);if((h||!h&&!o)&&((Ec(r)!=="body"||wd(l))&&(d=Hh(r)),wa(r))){const g=Vi(r);f=Yl(r),m.x=g.x+r.clientLeft,m.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+m.x,y:n.y*f.y-d.scrollTop*f.y+m.y}}function R5(e){return Array.from(e.getClientRects())}function wM(e){return Vi(Ja(e)).left+Hh(e).scrollLeft}function I5(e){const t=Ja(e),n=Hh(e),r=e.ownerDocument.body,a=ds(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=ds(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+wM(e);const u=-n.scrollTop;return ea(r).direction==="rtl"&&(l+=ds(t.clientWidth,r.clientWidth)-a),{width:a,height:o,x:l,y:u}}function O5(e,t){const n=ps(e),r=Ja(e),a=n.visualViewport;let o=r.clientWidth,l=r.clientHeight,u=0,d=0;if(a){o=a.width,l=a.height;const f=Fx();(!f||f&&t==="fixed")&&(u=a.offsetLeft,d=a.offsetTop)}return{width:o,height:l,x:u,y:d}}function A5(e,t){const n=Vi(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,o=wa(e)?Yl(e):Lo(1),l=e.clientWidth*o.x,u=e.clientHeight*o.y,d=a*o.x,f=r*o.y;return{width:l,height:u,x:d,y:f}}function W1(e,t,n){let r;if(t==="viewport")r=O5(e,n);else if(t==="document")r=I5(Ja(e));else if(xa(t))r=A5(t,n);else{const a=xM(e);r={...t,x:t.x-a.x,y:t.y-a.y}}return Zp(r)}function SM(e,t){const n=Bo(e);return n===t||!xa(n)||uc(n)?!1:ea(n).position==="fixed"||SM(n,t)}function D5(e,t){const n=t.get(e);if(n)return n;let r=ad(e,[],!1).filter(u=>xa(u)&&Ec(u)!=="body"),a=null;const o=ea(e).position==="fixed";let l=o?Bo(e):e;for(;xa(l)&&!uc(l);){const u=ea(l),d=Dx(l);!d&&u.position==="fixed"&&(a=null),(o?!d&&!a:!d&&u.position==="static"&&!!a&&["absolute","fixed"].includes(a.position)||wd(l)&&!d&&SM(e,l))?r=r.filter(m=>m!==l):a=u,l=Bo(l)}return t.set(e,r),r}function F5(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const l=[...n==="clippingAncestors"?qh(t)?[]:D5(t,this._c):[].concat(n),r],u=l[0],d=l.reduce((f,m)=>{const h=W1(t,m,a);return f.top=ds(h.top,f.top),f.right=va(h.right,f.right),f.bottom=va(h.bottom,f.bottom),f.left=ds(h.left,f.left),f},W1(t,u,a));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function L5(e){const{width:t,height:n}=bM(e);return{width:t,height:n}}function $5(e,t,n){const r=wa(t),a=Ja(t),o=n==="fixed",l=Vi(e,!0,o,t);let u={scrollLeft:0,scrollTop:0};const d=Lo(0);if(r||!r&&!o)if((Ec(t)!=="body"||wd(a))&&(u=Hh(t)),r){const h=Vi(t,!0,o,t);d.x=h.x+t.clientLeft,d.y=h.y+t.clientTop}else a&&(d.x=wM(a));const f=l.left+u.scrollLeft-d.x,m=l.top+u.scrollTop-d.y;return{x:f,y:m,width:l.width,height:l.height}}function $v(e){return ea(e).position==="static"}function K1(e,t){return!wa(e)||ea(e).position==="fixed"?null:t?t(e):e.offsetParent}function CM(e,t){const n=ps(e);if(qh(e))return n;if(!wa(e)){let a=Bo(e);for(;a&&!uc(a);){if(xa(a)&&!$v(a))return a;a=Bo(a)}return n}let r=K1(e,t);for(;r&&N5(r)&&$v(r);)r=K1(r,t);return r&&uc(r)&&$v(r)&&!Dx(r)?n:r||T5(e)||n}const B5=async function(e){const t=this.getOffsetParent||CM,n=this.getDimensions,r=await n(e.floating);return{reference:$5(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function z5(e){return ea(e).direction==="rtl"}const U5={convertOffsetParentRelativeRectToViewportRelativeRect:P5,getDocumentElement:Ja,getClippingRect:F5,getOffsetParent:CM,getElementRects:B5,getClientRects:R5,getDimensions:L5,getScale:Yl,isElement:xa,isRTL:z5};function V5(e,t){let n=null,r;const a=Ja(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:m,width:h,height:g}=e.getBoundingClientRect();if(u||t(),!h||!g)return;const x=Gf(m),b=Gf(a.clientWidth-(f+h)),w=Gf(a.clientHeight-(m+g)),C=Gf(f),N={rootMargin:-x+"px "+-b+"px "+-w+"px "+-C+"px",threshold:ds(0,va(1,d))||1};let T=!0;function _(P){const M=P[0].intersectionRatio;if(M!==d){if(!T)return l();M?l(!1,M):r=setTimeout(()=>{l(!1,1e-7)},1e3)}T=!1}try{n=new IntersectionObserver(_,{...N,root:a.ownerDocument})}catch{n=new IntersectionObserver(_,N)}n.observe(e)}return l(!0),o}function q5(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=Lx(e),m=a||o?[...f?ad(f):[],...ad(t)]:[];m.forEach(k=>{a&&k.addEventListener("scroll",n,{passive:!0}),o&&k.addEventListener("resize",n)});const h=f&&u?V5(f,n):null;let g=-1,x=null;l&&(x=new ResizeObserver(k=>{let[N]=k;N&&N.target===f&&x&&(x.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var T;(T=x)==null||T.observe(t)})),n()}),f&&!d&&x.observe(f),x.observe(t));let b,w=d?Vi(e):null;d&&C();function C(){const k=Vi(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;m.forEach(N=>{a&&N.removeEventListener("scroll",n),o&&N.removeEventListener("resize",n)}),h?.(),(k=x)==null||k.disconnect(),x=null,d&&cancelAnimationFrame(b)}}const H5=C5,W5=j5,K5=x5,G5=E5,J5=w5,G1=b5,Q5=k5,Y5=(e,t,n)=>{const r=new Map,a={platform:U5,...n},o={...a.platform,_c:r};return y5(e,t,{...a,platform:o})};var kp=typeof document<"u"?y.useLayoutEffect:y.useEffect;function Xp(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,a;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(!Xp(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const o=a[r];if(!(o==="_owner"&&e.$$typeof)&&!Xp(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function jM(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function J1(e,t){const n=jM(e);return Math.round(t*n)/n}function Q1(e){const t=y.useRef(e);return kp(()=>{t.current=e}),t}function Z5(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:o,floating:l}={},transform:u=!0,whileElementsMounted:d,open:f}=e,[m,h]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,x]=y.useState(r);Xp(g,r)||x(r);const[b,w]=y.useState(null),[C,k]=y.useState(null),N=y.useCallback(se=>{se!==M.current&&(M.current=se,w(se))},[]),T=y.useCallback(se=>{se!==O.current&&(O.current=se,k(se))},[]),_=o||b,P=l||C,M=y.useRef(null),O=y.useRef(null),D=y.useRef(m),F=d!=null,$=Q1(d),te=Q1(a),z=y.useCallback(()=>{if(!M.current||!O.current)return;const se={placement:t,strategy:n,middleware:g};te.current&&(se.platform=te.current),Y5(M.current,O.current,se).then(H=>{const W={...H,isPositioned:!0};ue.current&&!Xp(D.current,W)&&(D.current=W,bc.flushSync(()=>{h(W)}))})},[g,t,n,te]);kp(()=>{f===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,h(se=>({...se,isPositioned:!1})))},[f]);const ue=y.useRef(!1);kp(()=>(ue.current=!0,()=>{ue.current=!1}),[]),kp(()=>{if(_&&(M.current=_),P&&(O.current=P),_&&P){if($.current)return $.current(_,P,z);z()}},[_,P,z,$,F]);const V=y.useMemo(()=>({reference:M,floating:O,setReference:N,setFloating:T}),[N,T]),ne=y.useMemo(()=>({reference:_,floating:P}),[_,P]),Y=y.useMemo(()=>{const se={position:n,left:0,top:0};if(!ne.floating)return se;const H=J1(ne.floating,m.x),W=J1(ne.floating,m.y);return u?{...se,transform:"translate("+H+"px, "+W+"px)",...jM(ne.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:W}},[n,u,ne.floating,m.x,m.y]);return y.useMemo(()=>({...m,update:z,refs:V,elements:ne,floatingStyles:Y}),[m,z,V,ne,Y])}const X5=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?G1({element:r.current,padding:a}).fn(n):{}:r?G1({element:r,padding:a}).fn(n):{}}}},eU=(e,t)=>({...H5(e),options:[e,t]}),tU=(e,t)=>({...W5(e),options:[e,t]}),nU=(e,t)=>({...Q5(e),options:[e,t]}),rU=(e,t)=>({...K5(e),options:[e,t]}),sU=(e,t)=>({...G5(e),options:[e,t]}),aU=(e,t)=>({...J5(e),options:[e,t]}),oU=(e,t)=>({...X5(e),options:[e,t]});var iU="Arrow",kM=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...o}=e;return s.jsx(wt.svg,{...o,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});kM.displayName=iU;var lU=kM;function $x(e){const[t,n]=y.useState(void 0);return er(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const o=a[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 Bx="Popper",[EM,Wh]=ra(Bx),[cU,NM]=EM(Bx),TM=e=>{const{__scopePopper:t,children:n}=e,[r,a]=y.useState(null);return s.jsx(cU,{scope:t,anchor:r,onAnchorChange:a,children:n})};TM.displayName=Bx;var MM="PopperAnchor",_M=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,o=NM(MM,n),l=y.useRef(null),u=tn(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:s.jsx(wt.div,{...a,ref:u})});_M.displayName=MM;var zx="PopperContent",[uU,dU]=EM(zx),PM=y.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:o="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:h="partial",hideWhenDetached:g=!1,updatePositionStrategy:x="optimized",onPlaced:b,...w}=e,C=NM(zx,n),[k,N]=y.useState(null),T=tn(t,j=>N(j)),[_,P]=y.useState(null),M=$x(_),O=M?.width??0,D=M?.height??0,F=r+(o!=="center"?"-"+o:""),$=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},te=Array.isArray(f)?f:[f],z=te.length>0,ue={padding:$,boundary:te.filter(pU),altBoundary:z},{refs:V,floatingStyles:ne,placement:Y,isPositioned:se,middlewareData:H}=Z5({strategy:"fixed",placement:F,whileElementsMounted:(...j)=>q5(...j,{animationFrame:x==="always"}),elements:{reference:C.anchor},middleware:[eU({mainAxis:a+D,alignmentAxis:l}),d&&tU({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?nU():void 0,...ue}),d&&rU({...ue}),sU({...ue,apply:({elements:j,rects:I,availableWidth:me,availableHeight:xe})=>{const{width:rt,height:Je}=I.reference,nt=j.floating.style;nt.setProperty("--radix-popper-available-width",`${me}px`),nt.setProperty("--radix-popper-available-height",`${xe}px`),nt.setProperty("--radix-popper-anchor-width",`${rt}px`),nt.setProperty("--radix-popper-anchor-height",`${Je}px`)}}),_&&oU({element:_,padding:u}),hU({arrowWidth:O,arrowHeight:D}),g&&aU({strategy:"referenceHidden",...ue})]}),[W,U]=OM(Y),A=Xs(b);er(()=>{se&&A?.()},[se,A]);const K=H.arrow?.x,re=H.arrow?.y,ee=H.arrow?.centerOffset!==0,[ie,de]=y.useState();return er(()=>{k&&de(window.getComputedStyle(k).zIndex)},[k]),s.jsx("div",{ref:V.setFloating,"data-radix-popper-content-wrapper":"",style:{...ne,transform:se?ne.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ie,"--radix-popper-transform-origin":[H.transformOrigin?.x,H.transformOrigin?.y].join(" "),...H.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(uU,{scope:n,placedSide:W,onArrowChange:P,arrowX:K,arrowY:re,shouldHideArrow:ee,children:s.jsx(wt.div,{"data-side":W,"data-align":U,...w,ref:T,style:{...w.style,animation:se?void 0:"none"}})})})});PM.displayName=zx;var RM="PopperArrow",fU={top:"bottom",right:"left",bottom:"top",left:"right"},IM=y.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,o=dU(RM,r),l=fU[o.placedSide];return s.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:s.jsx(lU,{...a,ref:n,style:{...a.style,display:"block"}})})});IM.displayName=RM;function pU(e){return e!==null}var hU=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:a}=t,l=a.arrow?.centerOffset!==0,u=l?0:e.arrowWidth,d=l?0:e.arrowHeight,[f,m]=OM(n),h={start:"0%",center:"50%",end:"100%"}[m],g=(a.arrow?.x??0)+u/2,x=(a.arrow?.y??0)+d/2;let b="",w="";return f==="bottom"?(b=l?h:`${g}px`,w=`${-d}px`):f==="top"?(b=l?h:`${g}px`,w=`${r.floating.height+d}px`):f==="right"?(b=`${-d}px`,w=l?h:`${x}px`):f==="left"&&(b=`${r.floating.width+d}px`,w=l?h:`${x}px`),{data:{x:b,y:w}}}});function OM(e){const[t,n="center"]=e.split("-");return[t,n]}var AM=TM,DM=_M,FM=PM,LM=IM,Bv="rovingFocusGroup.onEntryFocus",mU={bubbles:!1,cancelable:!0},Sd="RovingFocusGroup",[vb,$M,gU]=Rx(Sd),[vU,Kh]=ra(Sd,[gU]),[yU,bU]=vU(Sd),BM=y.forwardRef((e,t)=>s.jsx(vb.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(vb.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(xU,{...e,ref:t})})}));BM.displayName=Sd;var xU=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:m=!1,...h}=e,g=y.useRef(null),x=tn(t,g),b=Vh(o),[w,C]=Ua({prop:l,defaultProp:u??null,onChange:d,caller:Sd}),[k,N]=y.useState(!1),T=Xs(f),_=$M(n),P=y.useRef(!1),[M,O]=y.useState(0);return y.useEffect(()=>{const D=g.current;if(D)return D.addEventListener(Bv,T),()=>D.removeEventListener(Bv,T)},[T]),s.jsx(yU,{scope:n,orientation:r,dir:b,loop:a,currentTabStopId:w,onItemFocus:y.useCallback(D=>C(D),[C]),onItemShiftTab:y.useCallback(()=>N(!0),[]),onFocusableItemAdd:y.useCallback(()=>O(D=>D+1),[]),onFocusableItemRemove:y.useCallback(()=>O(D=>D-1),[]),children:s.jsx(wt.div,{tabIndex:k||M===0?-1:0,"data-orientation":r,...h,ref:x,style:{outline:"none",...e.style},onMouseDown:Ge(e.onMouseDown,()=>{P.current=!0}),onFocus:Ge(e.onFocus,D=>{const F=!P.current;if(D.target===D.currentTarget&&F&&!k){const $=new CustomEvent(Bv,mU);if(D.currentTarget.dispatchEvent($),!$.defaultPrevented){const te=_().filter(Y=>Y.focusable),z=te.find(Y=>Y.active),ue=te.find(Y=>Y.id===w),ne=[z,ue,...te].filter(Boolean).map(Y=>Y.ref.current);VM(ne,m)}}P.current=!1}),onBlur:Ge(e.onBlur,()=>N(!1))})})}),zM="RovingFocusGroupItem",UM=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:o,children:l,...u}=e,d=Qs(),f=o||d,m=bU(zM,n),h=m.currentTabStopId===f,g=$M(n),{onFocusableItemAdd:x,onFocusableItemRemove:b,currentTabStopId:w}=m;return y.useEffect(()=>{if(r)return x(),()=>b()},[r,x,b]),s.jsx(vb.ItemSlot,{scope:n,id:f,focusable:r,active:a,children:s.jsx(wt.span,{tabIndex:h?0:-1,"data-orientation":m.orientation,...u,ref:t,onMouseDown:Ge(e.onMouseDown,C=>{r?m.onItemFocus(f):C.preventDefault()}),onFocus:Ge(e.onFocus,()=>m.onItemFocus(f)),onKeyDown:Ge(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){m.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const k=CU(C,m.orientation,m.dir);if(k!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let T=g().filter(_=>_.focusable).map(_=>_.ref.current);if(k==="last")T.reverse();else if(k==="prev"||k==="next"){k==="prev"&&T.reverse();const _=T.indexOf(C.currentTarget);T=m.loop?jU(T,_+1):T.slice(_+1)}setTimeout(()=>VM(T))}}),children:typeof l=="function"?l({isCurrentTabStop:h,hasTabStop:w!=null}):l})})});UM.displayName=zM;var wU={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function SU(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function CU(e,t,n){const r=SU(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return wU[r]}function VM(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function jU(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var qM=BM,HM=UM,yb=["Enter"," "],kU=["ArrowDown","PageUp","Home"],WM=["ArrowUp","PageDown","End"],EU=[...kU,...WM],NU={ltr:[...yb,"ArrowRight"],rtl:[...yb,"ArrowLeft"]},TU={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Cd="Menu",[od,MU,_U]=Rx(Cd),[ol,KM]=ra(Cd,[_U,Wh,Kh]),Gh=Wh(),GM=Kh(),[PU,il]=ol(Cd),[RU,jd]=ol(Cd),JM=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:o,modal:l=!0}=e,u=Gh(t),[d,f]=y.useState(null),m=y.useRef(!1),h=Xs(o),g=Vh(a);return y.useEffect(()=>{const x=()=>{m.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>m.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})}},[]),s.jsx(AM,{...u,children:s.jsx(PU,{scope:t,open:n,onOpenChange:h,content:d,onContentChange:f,children:s.jsx(RU,{scope:t,onClose:y.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:m,dir:g,modal:l,children:r})})})};JM.displayName=Cd;var IU="MenuAnchor",Ux=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=Gh(n);return s.jsx(DM,{...a,...r,ref:t})});Ux.displayName=IU;var Vx="MenuPortal",[OU,QM]=ol(Vx,{forceMount:void 0}),YM=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:a}=e,o=il(Vx,t);return s.jsx(OU,{scope:t,forceMount:n,children:s.jsx(sa,{present:n||o.open,children:s.jsx(Fh,{asChild:!0,container:a,children:r})})})};YM.displayName=Vx;var Rs="MenuContent",[AU,qx]=ol(Rs),ZM=y.forwardRef((e,t)=>{const n=QM(Rs,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,o=il(Rs,e.__scopeMenu),l=jd(Rs,e.__scopeMenu);return s.jsx(od.Provider,{scope:e.__scopeMenu,children:s.jsx(sa,{present:r||o.open,children:s.jsx(od.Slot,{scope:e.__scopeMenu,children:l.modal?s.jsx(DU,{...a,ref:t}):s.jsx(FU,{...a,ref:t})})})})}),DU=y.forwardRef((e,t)=>{const n=il(Rs,e.__scopeMenu),r=y.useRef(null),a=tn(t,r);return y.useEffect(()=>{const o=r.current;if(o)return jx(o)},[]),s.jsx(Hx,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ge(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),FU=y.forwardRef((e,t)=>{const n=il(Rs,e.__scopeMenu);return s.jsx(Hx,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),LU=ic("MenuContent.ScrollLock"),Hx=y.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:u,onEntryFocus:d,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:h,onInteractOutside:g,onDismiss:x,disableOutsideScroll:b,...w}=e,C=il(Rs,n),k=jd(Rs,n),N=Gh(n),T=GM(n),_=MU(n),[P,M]=y.useState(null),O=y.useRef(null),D=tn(t,O,C.onContentChange),F=y.useRef(0),$=y.useRef(""),te=y.useRef(0),z=y.useRef(null),ue=y.useRef("right"),V=y.useRef(0),ne=b?$h:y.Fragment,Y=b?{as:LU,allowPinchZoom:!0}:void 0,se=W=>{const U=$.current+W,A=_().filter(j=>!j.disabled),K=document.activeElement,re=A.find(j=>j.ref.current===K)?.textValue,ee=A.map(j=>j.textValue),ie=QU(ee,U,re),de=A.find(j=>j.textValue===ie)?.ref.current;(function j(I){$.current=I,window.clearTimeout(F.current),I!==""&&(F.current=window.setTimeout(()=>j(""),1e3))})(U),de&&setTimeout(()=>de.focus())};y.useEffect(()=>()=>window.clearTimeout(F.current),[]),Cx();const H=y.useCallback(W=>ue.current===z.current?.side&&ZU(W,z.current?.area),[]);return s.jsx(AU,{scope:n,searchRef:$,onItemEnter:y.useCallback(W=>{H(W)&&W.preventDefault()},[H]),onItemLeave:y.useCallback(W=>{H(W)||(O.current?.focus(),M(null))},[H]),onTriggerLeave:y.useCallback(W=>{H(W)&&W.preventDefault()},[H]),pointerGraceTimerRef:te,onPointerGraceIntentChange:y.useCallback(W=>{z.current=W},[]),children:s.jsx(ne,{...Y,children:s.jsx(Dh,{asChild:!0,trapped:a,onMountAutoFocus:Ge(o,W=>{W.preventDefault(),O.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:s.jsx(Ah,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:h,onInteractOutside:g,onDismiss:x,children:s.jsx(qM,{asChild:!0,...T,dir:k.dir,orientation:"vertical",loop:r,currentTabStopId:P,onCurrentTabStopIdChange:M,onEntryFocus:Ge(d,W=>{k.isUsingKeyboardRef.current||W.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(FM,{role:"menu","aria-orientation":"vertical","data-state":h_(C.open),"data-radix-menu-content":"",dir:k.dir,...N,...w,ref:D,style:{outline:"none",...w.style},onKeyDown:Ge(w.onKeyDown,W=>{const A=W.target.closest("[data-radix-menu-content]")===W.currentTarget,K=W.ctrlKey||W.altKey||W.metaKey,re=W.key.length===1;A&&(W.key==="Tab"&&W.preventDefault(),!K&&re&&se(W.key));const ee=O.current;if(W.target!==ee||!EU.includes(W.key))return;W.preventDefault();const de=_().filter(j=>!j.disabled).map(j=>j.ref.current);WM.includes(W.key)&&de.reverse(),GU(de)}),onBlur:Ge(e.onBlur,W=>{W.currentTarget.contains(W.target)||(window.clearTimeout(F.current),$.current="")}),onPointerMove:Ge(e.onPointerMove,id(W=>{const U=W.target,A=V.current!==W.clientX;if(W.currentTarget.contains(U)&&A){const K=W.clientX>V.current?"right":"left";ue.current=K,V.current=W.clientX}}))})})})})})})});ZM.displayName=Rs;var $U="MenuGroup",Wx=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(wt.div,{role:"group",...r,ref:t})});Wx.displayName=$U;var BU="MenuLabel",XM=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(wt.div,{...r,ref:t})});XM.displayName=BU;var eh="MenuItem",Y1="menu.itemSelect",Jh=y.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...a}=e,o=y.useRef(null),l=jd(eh,e.__scopeMenu),u=qx(eh,e.__scopeMenu),d=tn(t,o),f=y.useRef(!1),m=()=>{const h=o.current;if(!n&&h){const g=new CustomEvent(Y1,{bubbles:!0,cancelable:!0});h.addEventListener(Y1,x=>r?.(x),{once:!0}),NT(h,g),g.defaultPrevented?f.current=!1:l.onClose()}};return s.jsx(e_,{...a,ref:d,disabled:n,onClick:Ge(e.onClick,m),onPointerDown:h=>{e.onPointerDown?.(h),f.current=!0},onPointerUp:Ge(e.onPointerUp,h=>{f.current||h.currentTarget?.click()}),onKeyDown:Ge(e.onKeyDown,h=>{const g=u.searchRef.current!=="";n||g&&h.key===" "||yb.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});Jh.displayName=eh;var e_=y.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:a,...o}=e,l=qx(eh,n),u=GM(n),d=y.useRef(null),f=tn(t,d),[m,h]=y.useState(!1),[g,x]=y.useState("");return y.useEffect(()=>{const b=d.current;b&&x((b.textContent??"").trim())},[o.children]),s.jsx(od.ItemSlot,{scope:n,disabled:r,textValue:a??g,children:s.jsx(HM,{asChild:!0,...u,focusable:!r,children:s.jsx(wt.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:f,onPointerMove:Ge(e.onPointerMove,id(b=>{r?l.onItemLeave(b):(l.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ge(e.onPointerLeave,id(b=>l.onItemLeave(b))),onFocus:Ge(e.onFocus,()=>h(!0)),onBlur:Ge(e.onBlur,()=>h(!1))})})})}),zU="MenuCheckboxItem",t_=y.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...a}=e;return s.jsx(o_,{scope:e.__scopeMenu,checked:n,children:s.jsx(Jh,{role:"menuitemcheckbox","aria-checked":th(n)?"mixed":n,...a,ref:t,"data-state":Gx(n),onSelect:Ge(a.onSelect,()=>r?.(th(n)?!0:!n),{checkForDefaultPrevented:!1})})})});t_.displayName=zU;var n_="MenuRadioGroup",[UU,VU]=ol(n_,{value:void 0,onValueChange:()=>{}}),r_=y.forwardRef((e,t)=>{const{value:n,onValueChange:r,...a}=e,o=Xs(r);return s.jsx(UU,{scope:e.__scopeMenu,value:n,onValueChange:o,children:s.jsx(Wx,{...a,ref:t})})});r_.displayName=n_;var s_="MenuRadioItem",a_=y.forwardRef((e,t)=>{const{value:n,...r}=e,a=VU(s_,e.__scopeMenu),o=n===a.value;return s.jsx(o_,{scope:e.__scopeMenu,checked:o,children:s.jsx(Jh,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":Gx(o),onSelect:Ge(r.onSelect,()=>a.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});a_.displayName=s_;var Kx="MenuItemIndicator",[o_,qU]=ol(Kx,{checked:!1}),i_=y.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...a}=e,o=qU(Kx,n);return s.jsx(sa,{present:r||th(o.checked)||o.checked===!0,children:s.jsx(wt.span,{...a,ref:t,"data-state":Gx(o.checked)})})});i_.displayName=Kx;var HU="MenuSeparator",l_=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(wt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});l_.displayName=HU;var WU="MenuArrow",c_=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=Gh(n);return s.jsx(LM,{...a,...r,ref:t})});c_.displayName=WU;var KU="MenuSub",[$ce,u_]=ol(KU),zu="MenuSubTrigger",d_=y.forwardRef((e,t)=>{const n=il(zu,e.__scopeMenu),r=jd(zu,e.__scopeMenu),a=u_(zu,e.__scopeMenu),o=qx(zu,e.__scopeMenu),l=y.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:d}=o,f={__scopeMenu:e.__scopeMenu},m=y.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return y.useEffect(()=>m,[m]),y.useEffect(()=>{const h=u.current;return()=>{window.clearTimeout(h),d(null)}},[u,d]),s.jsx(Ux,{asChild:!0,...f,children:s.jsx(e_,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":h_(n.open),...e,ref:Jo(t,a.onTriggerChange),onClick:h=>{e.onClick?.(h),!(e.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ge(e.onPointerMove,id(h=>{o.onItemEnter(h),!h.defaultPrevented&&!e.disabled&&!n.open&&!l.current&&(o.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),m()},100))})),onPointerLeave:Ge(e.onPointerLeave,id(h=>{m();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:h.clientX+w,y:h.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(h),h.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Ge(e.onKeyDown,h=>{const g=o.searchRef.current!=="";e.disabled||g&&h.key===" "||NU[r.dir].includes(h.key)&&(n.onOpenChange(!0),n.content?.focus(),h.preventDefault())})})})});d_.displayName=zu;var f_="MenuSubContent",p_=y.forwardRef((e,t)=>{const n=QM(Rs,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,o=il(Rs,e.__scopeMenu),l=jd(Rs,e.__scopeMenu),u=u_(f_,e.__scopeMenu),d=y.useRef(null),f=tn(t,d);return s.jsx(od.Provider,{scope:e.__scopeMenu,children:s.jsx(sa,{present:r||o.open,children:s.jsx(od.Slot,{scope:e.__scopeMenu,children:s.jsx(Hx,{id:u.contentId,"aria-labelledby":u.triggerId,...a,ref:f,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{l.isUsingKeyboardRef.current&&d.current?.focus(),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:Ge(e.onFocusOutside,m=>{m.target!==u.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Ge(e.onEscapeKeyDown,m=>{l.onClose(),m.preventDefault()}),onKeyDown:Ge(e.onKeyDown,m=>{const h=m.currentTarget.contains(m.target),g=TU[l.dir].includes(m.key);h&&g&&(o.onOpenChange(!1),u.trigger?.focus(),m.preventDefault())})})})})})});p_.displayName=f_;function h_(e){return e?"open":"closed"}function th(e){return e==="indeterminate"}function Gx(e){return th(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 JU(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function QU(e,t,n){const a=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=JU(e,Math.max(o,0));a.length===1&&(l=l.filter(f=>f!==n));const d=l.find(f=>f.toLowerCase().startsWith(a.toLowerCase()));return d!==n?d:void 0}function YU(e,t){const{x:n,y:r}=e;let a=!1;for(let o=0,l=t.length-1;or!=g>r&&n<(h-f)*(r-m)/(g-m)+f&&(a=!a)}return a}function ZU(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return YU(n,t)}function id(e){return t=>t.pointerType==="mouse"?e(t):void 0}var XU=JM,e6=Ux,t6=YM,n6=ZM,r6=Wx,s6=XM,a6=Jh,o6=t_,i6=r_,l6=a_,c6=i_,u6=l_,d6=c_,f6=d_,p6=p_,Qh="DropdownMenu",[h6]=ra(Qh,[KM]),Lr=KM(),[m6,m_]=h6(Qh),g_=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:a,defaultOpen:o,onOpenChange:l,modal:u=!0}=e,d=Lr(t),f=y.useRef(null),[m,h]=Ua({prop:a,defaultProp:o??!1,onChange:l,caller:Qh});return s.jsx(m6,{scope:t,triggerId:Qs(),triggerRef:f,contentId:Qs(),open:m,onOpenChange:h,onOpenToggle:y.useCallback(()=>h(g=>!g),[h]),modal:u,children:s.jsx(XU,{...d,open:m,onOpenChange:h,dir:r,modal:u,children:n})})};g_.displayName=Qh;var v_="DropdownMenuTrigger",y_=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...a}=e,o=m_(v_,n),l=Lr(n);return s.jsx(e6,{asChild:!0,...l,children:s.jsx(wt.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,...a,ref:Jo(t,o.triggerRef),onPointerDown:Ge(e.onPointerDown,u=>{!r&&u.button===0&&u.ctrlKey===!1&&(o.onOpenToggle(),o.open||u.preventDefault())}),onKeyDown:Ge(e.onKeyDown,u=>{r||(["Enter"," "].includes(u.key)&&o.onOpenToggle(),u.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})});y_.displayName=v_;var g6="DropdownMenuPortal",b_=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Lr(t);return s.jsx(t6,{...r,...n})};b_.displayName=g6;var x_="DropdownMenuContent",w_=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=m_(x_,n),o=Lr(n),l=y.useRef(!1);return s.jsx(n6,{id:a.contentId,"aria-labelledby":a.triggerId,...o,...r,ref:t,onCloseAutoFocus:Ge(e.onCloseAutoFocus,u=>{l.current||a.triggerRef.current?.focus(),l.current=!1,u.preventDefault()}),onInteractOutside:Ge(e.onInteractOutside,u=>{const d=u.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0,m=d.button===2||f;(!a.modal||m)&&(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)"}})});w_.displayName=x_;var v6="DropdownMenuGroup",y6=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Lr(n);return s.jsx(r6,{...a,...r,ref:t})});y6.displayName=v6;var b6="DropdownMenuLabel",S_=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Lr(n);return s.jsx(s6,{...a,...r,ref:t})});S_.displayName=b6;var x6="DropdownMenuItem",C_=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Lr(n);return s.jsx(a6,{...a,...r,ref:t})});C_.displayName=x6;var w6="DropdownMenuCheckboxItem",j_=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Lr(n);return s.jsx(o6,{...a,...r,ref:t})});j_.displayName=w6;var S6="DropdownMenuRadioGroup",C6=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Lr(n);return s.jsx(i6,{...a,...r,ref:t})});C6.displayName=S6;var j6="DropdownMenuRadioItem",k6=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Lr(n);return s.jsx(l6,{...a,...r,ref:t})});k6.displayName=j6;var E6="DropdownMenuItemIndicator",k_=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Lr(n);return s.jsx(c6,{...a,...r,ref:t})});k_.displayName=E6;var N6="DropdownMenuSeparator",E_=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Lr(n);return s.jsx(u6,{...a,...r,ref:t})});E_.displayName=N6;var T6="DropdownMenuArrow",M6=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Lr(n);return s.jsx(d6,{...a,...r,ref:t})});M6.displayName=T6;var _6="DropdownMenuSubTrigger",P6=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Lr(n);return s.jsx(f6,{...a,...r,ref:t})});P6.displayName=_6;var R6="DropdownMenuSubContent",I6=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Lr(n);return s.jsx(p6,{...a,...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)"}})});I6.displayName=R6;var O6=g_,A6=y_,D6=b_,F6=w_,L6=S_,$6=C_,B6=j_,z6=k_,ll=E_;/** - * @license lucide-react v0.522.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const U6=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),V6=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Z1=e=>{const t=V6(e);return t.charAt(0).toUpperCase()+t.slice(1)},N_=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),q6=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/** - * @license lucide-react v0.522.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var H6={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.522.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const W6=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:o,iconNode:l,...u},d)=>y.createElement("svg",{ref:d,...H6,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:N_("lucide",a),...!o&&!q6(u)&&{"aria-hidden":"true"},...u},[...l.map(([f,m])=>y.createElement(f,m)),...Array.isArray(o)?o:[o]]));/** - * @license lucide-react v0.522.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Yh=(e,t)=>{const n=y.forwardRef(({className:r,...a},o)=>y.createElement(W6,{ref:o,iconNode:t,className:N_(`lucide-${U6(Z1(e))}`,`lucide-${e}`,r),...a}));return n.displayName=Z1(e),n};/** - * @license lucide-react v0.522.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const K6=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Jx=Yh("check",K6);/** - * @license lucide-react v0.522.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const G6=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],T_=Yh("chevron-down",G6);/** - * @license lucide-react v0.522.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const J6=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Q6=Yh("chevron-up",J6);/** - * @license lucide-react v0.522.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Y6=[["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"}]],Z6=Yh("grip-vertical",Y6);function gs({...e}){return s.jsx(O6,{"data-slot":"dropdown-menu",...e})}function vs({...e}){return s.jsx(A6,{"data-slot":"dropdown-menu-trigger",...e})}function ys({className:e,sideOffset:t=4,...n}){return s.jsx(D6,{children:s.jsx(F6,{"data-slot":"dropdown-menu-content",sideOffset:t,className:Et("bg-popover text-popover-foreground 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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function Ct({className:e,inset:t,variant:n="default",...r}){return s.jsx($6,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:Et("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function X6({className:e,children:t,checked:n,...r}){return s.jsxs(B6,{"data-slot":"dropdown-menu-checkbox-item",className:Et("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:n,...r,children:[s.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:s.jsx(z6,{children:s.jsx(Jx,{className:"size-4"})})}),t]})}function Zo({className:e,inset:t,...n}){return s.jsx(L6,{"data-slot":"dropdown-menu-label","data-inset":t,className:Et("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...n})}function Xo({className:e,...t}){return s.jsx(ll,{"data-slot":"dropdown-menu-separator",className:Et("bg-border -mx-1 my-1 h-px",e),...t})}function M_(){const{t:e,i18n:t}=Le(),n=r=>{t.changeLanguage(r),localStorage.setItem("i18nextLng",r),window.location.reload()};return s.jsxs(gs,{children:[s.jsx(vs,{asChild:!0,children:s.jsxs(q,{variant:"outline",size:"icon",children:[s.jsx(oz,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all"}),s.jsx("span",{className:"sr-only",children:e("header.theme.label")})]})}),s.jsxs(ys,{align:"end",children:[s.jsx(Ct,{className:t.language==="pt-BR"?"font-bold":"",onClick:()=>n("pt-BR"),children:e("header.language.portuguese")}),s.jsx(Ct,{className:t.language==="en-US"?"font-bold":"",onClick:()=>n("en-US"),children:e("header.language.english")}),s.jsx(Ct,{className:t.language==="es-ES"?"font-bold":"",onClick:()=>n("es-ES"),children:e("header.language.spanish")}),s.jsx(Ct,{className:t.language==="fr-FR"?"font-bold":"",onClick:()=>n("fr-FR"),children:e("header.language.french")})]})]})}function __(){const{t:e}=Le(),{setTheme:t}=Yi();return s.jsxs(gs,{children:[s.jsx(vs,{asChild:!0,children:s.jsxs(q,{variant:"outline",size:"icon",children:[s.jsx(bz,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),s.jsx(fz,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),s.jsx("span",{className:"sr-only",children:e("header.theme.label")})]})}),s.jsxs(ys,{align:"end",children:[s.jsx(Ct,{onClick:()=>t("light"),children:e("header.theme.light")}),s.jsx(Ct,{onClick:()=>t("dark"),children:e("header.theme.dark")}),s.jsx(Ct,{onClick:()=>t("system"),children:e("header.theme.system")})]})]})}function P_({instanceId:e}){const{t}=Le(),[n,r]=y.useState(!1),a=Nn(),o=()=>{cb(),a("/manager/login")},{data:l}=mM({instanceId:e});return s.jsxs("header",{className:"flex h-16 items-center justify-end border-b border-sidebar-border bg-sidebar px-4 shadow-sm",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[e&&l&&s.jsxs("div",{className:"mr-2 flex items-center gap-2 rounded-md bg-sidebar-accent/50 px-3 py-1.5",children:[s.jsx(Ih,{className:"h-6 w-6",children:s.jsx(Oh,{src:l.profilePicUrl||"/assets/images/evolution-logo.png",alt:l.name})}),s.jsx("span",{className:"text-sm font-medium text-sidebar-foreground",children:l.profileName||l.name})]}),s.jsx(M_,{}),s.jsx(__,{}),s.jsxs(q,{onClick:()=>r(!0),variant:"ghost",size:"sm",className:"gap-2 text-sidebar-foreground hover:bg-sidebar-accent",children:[s.jsx(rM,{className:"h-4 w-4"}),t("header.logout.action")]})]}),s.jsx(yt,{onOpenChange:r,open:n,children:s.jsxs(ht,{children:[s.jsxs(mt,{children:[s.jsx(xt,{children:t("header.logout.title")}),s.jsx(Er,{children:t("header.logout.description")})]}),s.jsx(Wt,{children:s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx(q,{onClick:()=>r(!1),size:"sm",variant:"outline",children:t("button.cancel")}),s.jsx(q,{onClick:o,variant:"destructive",children:t("header.logout.action")})]})})]})})]})}var Zh="Collapsible",[eV]=ra(Zh),[tV,Qx]=eV(Zh),R_=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:a,disabled:o,onOpenChange:l,...u}=e,[d,f]=Ua({prop:r,defaultProp:a??!1,onChange:l,caller:Zh});return s.jsx(tV,{scope:n,disabled:o,contentId:Qs(),open:d,onOpenToggle:y.useCallback(()=>f(m=>!m),[f]),children:s.jsx(wt.div,{"data-state":Zx(d),"data-disabled":o?"":void 0,...u,ref:t})})});R_.displayName=Zh;var I_="CollapsibleTrigger",O_=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,a=Qx(I_,n);return s.jsx(wt.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":Zx(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...r,ref:t,onClick:Ge(e.onClick,a.onOpenToggle)})});O_.displayName=I_;var Yx="CollapsibleContent",A_=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Qx(Yx,e.__scopeCollapsible);return s.jsx(sa,{present:n||a.open,children:({present:o})=>s.jsx(nV,{...r,ref:t,present:o})})});A_.displayName=Yx;var nV=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:a,...o}=e,l=Qx(Yx,n),[u,d]=y.useState(r),f=y.useRef(null),m=tn(t,f),h=y.useRef(0),g=h.current,x=y.useRef(0),b=x.current,w=l.open||u,C=y.useRef(w),k=y.useRef(void 0);return y.useEffect(()=>{const N=requestAnimationFrame(()=>C.current=!1);return()=>cancelAnimationFrame(N)},[]),er(()=>{const N=f.current;if(N){k.current=k.current||{transitionDuration:N.style.transitionDuration,animationName:N.style.animationName},N.style.transitionDuration="0s",N.style.animationName="none";const T=N.getBoundingClientRect();h.current=T.height,x.current=T.width,C.current||(N.style.transitionDuration=k.current.transitionDuration,N.style.animationName=k.current.animationName),d(r)}},[l.open,r]),s.jsx(wt.div,{"data-state":Zx(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!w,...o,ref:m,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:w&&a})});function Zx(e){return e?"open":"closed"}var rV=R_;function Xx({...e}){return s.jsx(rV,{"data-slot":"collapsible",...e})}function ew({...e}){return s.jsx(O_,{"data-slot":"collapsible-trigger",...e})}function tw({...e}){return s.jsx(A_,{"data-slot":"collapsible-content",...e})}const D_=y.createContext(null),ft=()=>{const e=y.useContext(D_);if(!e)throw new Error("useInstance must be used within an InstanceProvider");return e},F_=({children:e})=>{const t=Is(),[n,r]=y.useState(null),{data:a,refetch:o}=mM({instanceId:n});return y.useEffect(()=>{t.instanceId?r(t.instanceId):r(null)},[t]),s.jsx(D_.Provider,{value:{instance:a??null,reloadInstance:async()=>{const l=await o();if(l.error)throw l.error}},children:e})},sV=new Set(Object.keys(tT)),aV=e=>sV.has(e),X1=e=>!e||!aV(e)||nT(e);function L_({children:e,footer:t}){const n=new Date().getFullYear(),{theme:r}=Yi(),a=r==="dark"?"https://evolution-api.com/files/evo/evolution-logo-white.svg":"https://evolution-api.com/files/evo/evolution-logo.svg";return s.jsxs("aside",{className:"hidden md:flex bg-sidebar text-sidebar-foreground flex-col w-56 border-r border-sidebar-border",children:[s.jsx("div",{className:"h-16 flex items-center px-4 border-b border-sidebar-border",children:s.jsx("img",{src:a,alt:"Evolution API",className:"h-7"})}),s.jsx("nav",{className:"flex-1 overflow-y-auto px-2 py-4 space-y-1",children:e}),t&&s.jsx("div",{className:"border-t border-sidebar-border px-2 py-3 space-y-1",children:t}),s.jsxs("div",{className:"p-4 border-t border-sidebar-border",children:[s.jsx("div",{className:"text-sm font-medium text-primary",children:"Evolution Manager"}),s.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:["© ",n," All rights reserved"]})]})]})}function Ii({to:e,icon:t,label:n,isExternal:r}){return r?s.jsxs("a",{href:e,target:"_blank",rel:"noreferrer",className:"flex items-center gap-3 rounded-md px-3 py-2.5 text-sm font-medium text-muted-foreground transition-all hover:bg-accent hover:text-foreground",children:[t&&s.jsx(t,{className:"h-5 w-5 flex-shrink-0"}),s.jsx("span",{children:n})]}):s.jsx(SN,{to:e,className:({isActive:a})=>on("flex items-center gap-3 rounded-md px-3 py-2.5 text-sm font-medium transition-all",a?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-accent hover:text-foreground"),children:({isActive:a})=>s.jsxs(s.Fragment,{children:[t&&s.jsx(t,{className:on("h-5 w-5 flex-shrink-0",a&&"text-primary")}),s.jsx("span",{children:n})]})})}function $_(){const{t:e}=Le(),t=hr(Fn.API_URL)?.replace(/\/$/,"")??"";return s.jsxs(s.Fragment,{children:[s.jsx(Ii,{to:"https://github.com/Neup123/evolution-api/tree/main/docs",icon:YB,label:e("sidebar.documentation"),isExternal:!0}),s.jsx(Ii,{to:`${t}/docs`,icon:VB,label:"Swagger",isExternal:!0}),s.jsx(Ii,{to:`${t}/webhooks/docs`,icon:hz,label:"Webhook Events",isExternal:!0}),s.jsx(Ii,{to:"https://evolution-api.com/discord",icon:lc,label:e("sidebar.discord"),isExternal:!0})]})}function oV(){const{t:e}=Le();return s.jsx(L_,{footer:s.jsx($_,{}),children:s.jsx(Ii,{to:"/manager",icon:pb,label:e("sidebar.dashboard")})})}function iV(){const{t:e}=Le(),{instance:t}=ft(),{pathname:n}=Ko(),r=t?`/manager/instance/${t.id}`:"",a=y.useMemo(()=>[{id:"dashboard",title:e("sidebar.dashboard"),icon:pb,path:"dashboard"},{id:"chat",title:e("sidebar.chat"),icon:lc,path:"chat"},{title:e("sidebar.configurations"),icon:Qo,children:[{id:"settings",title:e("sidebar.settings"),path:"settings"},{id:"proxy",title:e("sidebar.proxy"),path:"proxy"}]},{title:e("sidebar.events"),icon:sz,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:Cz,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"}]}],[e]),o=y.useMemo(()=>a.map(l=>"children"in l?{...l,children:l.children.filter(u=>X1(u.id))}:l).filter(l=>"children"in l?l.children.length>0:X1(l.id)),[a]);return s.jsxs(L_,{footer:s.jsx($_,{}),children:[s.jsx(Ii,{to:"/manager",icon:pb,label:`← ${e("dashboard.title")}`}),s.jsx("div",{className:"my-2 border-t border-sidebar-border"}),o.map(l=>{if("children"in l){const u=l.children.some(d=>d.path&&n.includes(d.path));return s.jsxs(Xx,{defaultOpen:u,children:[s.jsxs(ew,{className:on("flex w-full items-center gap-3 rounded-md px-3 py-2.5 text-sm font-medium transition-all",u?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-accent hover:text-foreground"),children:[s.jsx(l.icon,{className:on("h-5 w-5 flex-shrink-0",u&&"text-primary")}),s.jsx("span",{children:l.title}),s.jsx(Mx,{className:"ml-auto h-4 w-4 transition-transform data-[state=open]:rotate-180"})]}),s.jsx(tw,{className:"ml-7 mt-1 flex flex-col gap-1 border-l border-sidebar-border pl-3",children:l.children.map(d=>s.jsx(SN,{to:`${r}/${d.path}`,className:({isActive:f})=>on("rounded-md px-3 py-1.5 text-sm transition-all",f?"text-primary font-medium":"text-muted-foreground hover:text-foreground"),children:d.title},d.id))})]},l.title)}return s.jsx(Ii,{to:`${r}/${l.path}`,icon:l.icon,label:l.title},l.id)})]})}function _n({children:e}){const{instanceId:t}=Is();return s.jsx(F_,{children:s.jsxs("div",{className:"flex h-screen bg-background",children:[s.jsx(iV,{}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:[s.jsx(P_,{instanceId:t}),s.jsx("main",{className:"min-h-0 flex-1 overflow-y-auto p-6",children:e})]})]})})}function lV({children:e}){return s.jsxs("div",{className:"flex h-screen bg-background",children:[s.jsx(oV,{}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:[s.jsx(P_,{}),s.jsx("main",{className:"min-h-0 flex-1 overflow-y-auto p-6",children:e})]})]})}const cV="file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",G=y.forwardRef(({className:e,type:t,...n},r)=>s.jsx("input",{ref:r,type:t,"data-slot":"input",className:on(cV,e),...n}));G.displayName="Input";function uV({className:e,...t}){return s.jsx("div",{"data-slot":"skeleton",className:Et("bg-accent animate-pulse rounded-md",e),...t})}function B_({title:e,subtitle:t,searchValue:n,onSearchChange:r,searchPlaceholder:a,primaryAction:o,secondaryActions:l=[],className:u,children:d}){const{t:f}=Le(),m=a??f("common.search");return s.jsxs("div",{className:on("mb-6 space-y-6",u),children:[s.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-start md:justify-between",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx("h1",{className:"mb-1 text-2xl font-bold tracking-tight text-foreground",children:e}),t&&s.jsx("p",{className:"text-sm text-muted-foreground",children:t})]}),o&&s.jsx("div",{className:"flex-shrink-0",children:s.jsxs(q,{disabled:o.disabled,onClick:o.onClick,variant:o.variant||"default",className:o.className,children:[o.icon&&s.jsx("span",{className:"mr-2 inline-flex",children:o.icon}),o.label]})})]}),(r||l.length>0)&&s.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[r&&s.jsxs("div",{className:"relative max-w-md flex-1",children:[s.jsx(aM,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),s.jsx(G,{type:"search",placeholder:m,value:n??"",onChange:h=>r(h.target.value),className:"pl-9"})]}),l.length>0&&s.jsx("div",{className:"flex items-center gap-2",children:l.map((h,g)=>s.jsxs(q,{disabled:h.disabled,variant:h.variant||"outline",size:"sm",onClick:h.onClick,className:h.className,children:[h.icon&&s.jsx("span",{className:"mr-2 inline-flex",children:h.icon}),h.label]},g))})]}),d]})}var dV=Sx("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function Io({className:e,variant:t,asChild:n=!1,...r}){const a=n?ET:"span";return s.jsx(a,{"data-slot":"badge",className:Et(dV({variant:t}),e),...r})}function Un({className:e,...t}){return s.jsx("div",{"data-slot":"card",className:Et("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function Yn({className:e,...t}){return s.jsx("div",{"data-slot":"card-header",className:Et("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function Zn({className:e,...t}){return s.jsx("div",{"data-slot":"card-title",className:Et("leading-none font-semibold",e),...t})}function ej({className:e,...t}){return s.jsx("div",{"data-slot":"card-description",className:Et("text-muted-foreground text-sm",e),...t})}function Vn({className:e,...t}){return s.jsx("div",{"data-slot":"card-content",className:Et("px-6",e),...t})}function fV({className:e,...t}){return s.jsx("div",{"data-slot":"card-footer",className:Et("flex items-center px-6 [.border-t]:pt-6",e),...t})}var pV=Symbol.for("react.lazy"),nh=Ho[" use ".trim().toString()];function hV(e){return typeof e=="object"&&e!==null&&"then"in e}function z_(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===pV&&"_payload"in e&&hV(e._payload)}function mV(e){const t=gV(e),n=y.forwardRef((r,a)=>{let{children:o,...l}=r;z_(o)&&typeof nh=="function"&&(o=nh(o._payload));const u=y.Children.toArray(o),d=u.find(yV);if(d){const f=d.props.children,m=u.map(h=>h===d?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:h);return s.jsx(t,{...l,ref:a,children:y.isValidElement(f)?y.cloneElement(f,void 0,m):null})}return s.jsx(t,{...l,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function gV(e){const t=y.forwardRef((n,r)=>{let{children:a,...o}=n;if(z_(a)&&typeof nh=="function"&&(a=nh(a._payload)),y.isValidElement(a)){const l=xV(a),u=bV(o,a.props);return a.type!==y.Fragment&&(u.ref=r?Jo(r,l):l),y.cloneElement(a,u)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var vV=Symbol("radix.slottable");function yV(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===vV}function bV(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...u)=>{const d=o(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function xV(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 wV=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],SV=wV.reduce((e,t)=>{const n=mV(`Primitive.${t}`),r=y.forwardRef((a,o)=>{const{asChild:l,...u}=a,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...u,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),CV="Label",U_=y.forwardRef((e,t)=>s.jsx(SV.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));U_.displayName=CV;var jV=U_;function Ve({className:e,...t}){return s.jsx(jV,{"data-slot":"label",className:Et("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}var Xh="Tabs",[kV]=ra(Xh,[Kh]),V_=Kh(),[EV,nw]=kV(Xh),q_=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:o,orientation:l="horizontal",dir:u,activationMode:d="automatic",...f}=e,m=Vh(u),[h,g]=Ua({prop:r,onChange:a,defaultProp:o??"",caller:Xh});return s.jsx(EV,{scope:n,baseId:Qs(),value:h,onValueChange:g,orientation:l,dir:m,activationMode:d,children:s.jsx(wt.div,{dir:m,"data-orientation":l,...f,ref:t})})});q_.displayName=Xh;var H_="TabsList",W_=y.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,o=nw(H_,n),l=V_(n);return s.jsx(qM,{asChild:!0,...l,orientation:o.orientation,dir:o.dir,loop:r,children:s.jsx(wt.div,{role:"tablist","aria-orientation":o.orientation,...a,ref:t})})});W_.displayName=H_;var K_="TabsTrigger",G_=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...o}=e,l=nw(K_,n),u=V_(n),d=Y_(l.baseId,r),f=Z_(l.baseId,r),m=r===l.value;return s.jsx(HM,{asChild:!0,...u,focusable:!a,active:m,children:s.jsx(wt.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":f,"data-state":m?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:d,...o,ref:t,onMouseDown:Ge(e.onMouseDown,h=>{!a&&h.button===0&&h.ctrlKey===!1?l.onValueChange(r):h.preventDefault()}),onKeyDown:Ge(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&l.onValueChange(r)}),onFocus:Ge(e.onFocus,()=>{const h=l.activationMode!=="manual";!m&&!a&&h&&l.onValueChange(r)})})})});G_.displayName=K_;var J_="TabsContent",Q_=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:o,...l}=e,u=nw(J_,n),d=Y_(u.baseId,r),f=Z_(u.baseId,r),m=r===u.value,h=y.useRef(m);return y.useEffect(()=>{const g=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(g)},[]),s.jsx(sa,{present:a||m,children:({present:g})=>s.jsx(wt.div,{"data-state":m?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":d,hidden:!g,id:f,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:g&&o})})});Q_.displayName=J_;function Y_(e,t){return`${e}-trigger-${t}`}function Z_(e,t){return`${e}-content-${t}`}var NV=q_,TV=W_,MV=G_,_V=Q_;function rw({className:e,...t}){return s.jsx(NV,{"data-slot":"tabs",className:Et("flex flex-col gap-2",e),...t})}function sw({className:e,...t}){return s.jsx(TV,{"data-slot":"tabs-list",className:Et("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function rh({className:e,...t}){return s.jsx(MV,{"data-slot":"tabs-trigger",className:Et("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function sh({className:e,...t}){return s.jsx(_V,{"data-slot":"tabs-content",className:Et("flex-1 outline-none",e),...t})}function ei({className:e,...t}){return s.jsx("textarea",{"data-slot":"textarea",className:Et("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}const PV={reply:"sendButtons",cta:"sendButtons",pix:"sendButtons",list:"sendList",carousel:"sendCarousel"},Mu={reply:{title:"Resposta Rápida",description:"Escolha uma das opções abaixo:",footer:"Evolution API",buttons:[{type:"reply",displayText:"✅ Confirmar",id:"opt_confirm"},{type:"reply",displayText:"❌ Cancelar",id:"opt_cancel"},{type:"reply",displayText:"🤔 Talvez",id:"opt_maybe"}]},cta:{title:"Botões CTA",description:"Botões de URL e copia-código (cta_url + cta_copy):",footer:"Máx. 2 botões CTA por mensagem",buttons:[{type:"url",displayText:"🌐 Abrir site",url:"https://example.com"},{type:"copy",displayText:"📋 Copiar PIX",copyCode:"00020126580014BR.GOV.BCB.PIX0136abc12345-6789-0000-aaaa-bbbbccccdddd5204000053039865802BR5913FULANO DE TAL6009SAO PAULO62070503***6304ABCD"}]},pix:{title:"Pagamento via PIX",description:"Toque para pagar via PIX (payment_info)",footer:"WhatsApp Pay",buttons:[{type:"pix",currency:"BRL",name:"Empresa Exemplo",keyType:"random",key:"abc12345-6789-0000-aaaa-bbbbccccdddd"}]},list:{title:"Cardápio de Teste",description:"Escolha um item abaixo",footerText:"Validade hoje",buttonText:"Ver opções",sections:[{title:"Bebidas",rows:[{title:"Coca-Cola",description:"Lata 350ml",rowId:"coca"},{title:"Suco de Laranja",description:"300ml natural",rowId:"suco"}]},{title:"Lanches",rows:[{title:"X-Burger",description:"Pão, carne 150g, queijo",rowId:"xburger"}]}]},carousel:{body:"Catálogo da semana",cards:[{body:"Produto A",footer:"R$ 99,90",imageUrl:"https://picsum.photos/seed/a/600/400",buttons:[{type:"url",displayText:"Comprar",url:"https://exemplo.com/a"}]},{body:"Produto B",footer:"R$ 149,90",imageUrl:"https://picsum.photos/seed/b/600/400",buttons:[{type:"url",displayText:"Comprar",url:"https://exemplo.com/b"}]},{body:"Produto C",footer:"R$ 199,90",imageUrl:"https://picsum.photos/seed/c/600/400",buttons:[{type:"reply",displayText:"Quero!",id:"prod_c"}]}]}};function RV({instance:e,open:t,onOpenChange:n}){const{t:r}=Le(),[a,o]=y.useState("reply"),[l,u]=y.useState(""),[d,f]=y.useState(()=>({reply:JSON.stringify(Mu.reply,null,2),cta:JSON.stringify(Mu.cta,null,2),pix:JSON.stringify(Mu.pix,null,2),list:JSON.stringify(Mu.list,null,2),carousel:JSON.stringify(Mu.carousel,null,2)})),[m,h]=y.useState(!1);y.useEffect(()=>{t||h(!1)},[t]);const g=y.useMemo(()=>`/message/${PV[a]}/${e.name}`,[a,e.name]),x=async()=>{const w=l.replace(/\D/g,"");if(!w){X.error(r("testInteractive.errors.missingNumber"));return}let C;try{C=JSON.parse(d[a])}catch(k){X.error(r("testInteractive.errors.invalidJson",{message:k.message}));return}C.number=w;try{h(!0);const k=await Ce.post(g,C,{headers:{apikey:e.token}}),N=k.data?.key?.id||k.data?.messageId||"ok";X.success(r("testInteractive.success",{id:N})),n(!1)}catch(k){const N=k?.response?.data?.response?.message||k?.response?.data?.message||k?.message||r("testInteractive.errors.unknown");X.error(Array.isArray(N)?N.join("; "):N)}finally{h(!1)}},b=[{key:"reply",label:r("testInteractive.tabs.reply")},{key:"cta",label:r("testInteractive.tabs.cta")},{key:"pix",label:r("testInteractive.tabs.pix")},{key:"list",label:r("testInteractive.tabs.list")},{key:"carousel",label:r("testInteractive.tabs.carousel")}];return s.jsx(yt,{open:t,onOpenChange:w=>!m&&n(w),children:s.jsxs(ht,{className:"max-w-2xl",children:[s.jsx(mt,{children:s.jsx(xt,{children:r("testInteractive.title")})}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("p",{className:"text-xs text-muted-foreground",children:[r("testInteractive.subtitle",{instance:e.name})," ",s.jsxs("code",{className:"rounded bg-muted px-1 py-0.5 text-[11px]",children:["POST ",g]})]}),s.jsxs(rw,{value:a,onValueChange:w=>o(w),children:[s.jsx(sw,{className:"grid w-full grid-cols-5",children:b.map(w=>s.jsx(rh,{value:w.key,children:w.label},w.key))}),b.map(w=>s.jsxs(sh,{value:w.key,className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{htmlFor:"ti-number",children:r("testInteractive.number")}),s.jsx(G,{id:"ti-number",placeholder:"5511999999999",value:l,onChange:C=>u(C.target.value)}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:r("testInteractive.numberHint")})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{htmlFor:"ti-payload",children:r("testInteractive.payload")}),s.jsx(ei,{id:"ti-payload",rows:12,className:"font-mono text-xs",value:d[w.key],onChange:C=>f(k=>({...k,[w.key]:C.target.value}))})]})]},w.key))]}),s.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[s.jsx(q,{variant:"outline",onClick:()=>n(!1),disabled:m,children:r("button.cancel")}),s.jsx(q,{onClick:x,disabled:m,children:r(m?"testInteractive.sending":"testInteractive.send")})]})]})]})})}const IV=({status:e})=>{const{t}=Le();return e==="open"?s.jsx(Io,{className:"bg-green-500/10 text-green-500 hover:bg-green-500/20",children:t("status.open")}):e==="connecting"?s.jsx(Io,{className:"bg-yellow-500/10 text-yellow-500 hover:bg-yellow-500/20",children:t("status.connecting")}):s.jsx(Io,{className:"bg-red-500/10 text-red-500 hover:bg-red-500/20",children:t("status.closed")})};function OV({instance:e,isDeleting:t,onDelete:n}){const{t:r,i18n:a}=Le(),o=Nn(),[l,u]=y.useState(!1),d=new Intl.NumberFormat(a.language),f=e.profileName||e.name,m=()=>o(`/manager/instance/${e.id}/dashboard`),h=e.connectionStatus==="open";return s.jsxs(Un,{className:"group relative overflow-hidden border-sidebar-border bg-sidebar transition-all duration-300 hover:bg-sidebar-accent/30 hover:shadow-lg hover:shadow-black/10",children:[s.jsxs(Vn,{className:"p-0",children:[s.jsxs("button",{type:"button",onClick:m,className:"flex w-full items-center gap-3 border-b border-sidebar-border p-4 text-left",children:[e.profilePicUrl?s.jsx("div",{className:"flex-shrink-0",children:s.jsx("div",{className:"flex h-14 w-14 items-center justify-center overflow-hidden rounded-lg bg-muted",children:s.jsx("img",{src:e.profilePicUrl,alt:f,className:"h-12 w-12 rounded-lg object-cover",onError:g=>{g.target.style.display="none"}})})}):s.jsx("div",{className:"flex h-14 w-14 flex-shrink-0 items-center justify-center rounded-lg bg-muted text-lg font-semibold text-muted-foreground",children:f.slice(0,2).toUpperCase()}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("h3",{className:"truncate text-base font-semibold text-sidebar-foreground",children:f}),s.jsx("p",{className:"truncate text-xs text-sidebar-foreground/60",children:e.name})]}),s.jsx("div",{className:"flex-shrink-0",children:s.jsx(IV,{status:e.connectionStatus})})]}),s.jsxs("div",{className:"space-y-1 px-4 py-3 text-xs text-sidebar-foreground/70",children:[e.ownerJid&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{children:r("dashboard.card.phone",{defaultValue:"Número"})}),s.jsx("span",{className:"ml-2 truncate font-mono",children:e.ownerJid.split("@")[0]})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{children:r("instance.dashboard.contacts")}),s.jsx("span",{className:"font-mono",children:d.format(e._count?.Contact||0)})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{children:r("instance.dashboard.messages")}),s.jsx("span",{className:"font-mono",children:d.format(e._count?.Message||0)})]})]}),s.jsxs("div",{className:"flex border-t border-sidebar-border opacity-0 transition-opacity duration-200 group-hover:opacity-100",children:[s.jsxs(q,{variant:"ghost",className:"h-12 flex-1 rounded-none text-muted-foreground hover:bg-accent hover:text-foreground",onClick:m,children:[s.jsx(mz,{className:"mr-2 h-4 w-4"}),r("dashboard.settings")]}),s.jsx("div",{className:"w-px bg-sidebar-border"}),s.jsx(q,{variant:"ghost",className:"h-12 rounded-none px-4 text-muted-foreground hover:bg-accent hover:text-foreground disabled:opacity-40",disabled:!h,title:r(h?"testInteractive.title":"testInteractive.requiresOpen"),onClick:()=>u(!0),children:s.jsx(XB,{className:"h-4 w-4"})}),s.jsx("div",{className:"w-px bg-sidebar-border"}),s.jsx(q,{variant:"ghost",className:"h-12 rounded-none px-4 text-red-500 hover:bg-red-500/10 hover:text-red-400",disabled:t,onClick:()=>n(e),children:s.jsx(iM,{className:"h-4 w-4"})})]})]}),s.jsx(RV,{instance:e,open:l,onOpenChange:u})]})}const AV=["instance","fetchInstances","go"],DV=async()=>((await pn.get("/instance/all")).data?.data??[]).map(hM),FV=e=>gt({refetchInterval:5e3,...e,queryKey:AV,queryFn:()=>DV()}),LV=["instance","fetchInstances"],$V=async()=>(await pn.get("/instance/fetchInstances")).data,BV=e=>gt({...e,queryKey:LV,queryFn:()=>$V()}),zV=e=>{const t=Tr(),n=BV({...e,enabled:t==="api"}),r=FV({...e,enabled:t==="go"});return t==="go"?r:n},UV=e=>({rejectCall:e.rejectCall,msgCall:e.msgRejectCall,groupsIgnore:e.ignoreGroups,alwaysOnline:e.alwaysOnline,readMessages:e.readMessages,readStatus:!e.ignoreStatus,syncFullHistory:!1}),VV=e=>({alwaysOnline:e.alwaysOnline,rejectCall:e.rejectCall,msgRejectCall:e.msgCall??"",readMessages:e.readMessages,ignoreGroups:e.groupsIgnore,ignoreStatus:!e.readStatus}),qV=e=>["instance","fetchSettings","go",JSON.stringify(e)],HV=(e,t)=>{const r=e.getQueryData(["instance","fetchInstances","go"])?.find(o=>o.name===t);if(r)return r.id;const a=e.getQueriesData({queryKey:["instance","fetchInstance","go"]});for(const[,o]of a)if(o?.name===t)return o.id},WV=e=>{const t=Wa(),{instanceName:n,token:r,enabled:a,...o}=e;return gt({...o,queryKey:qV({instanceName:n,token:r}),queryFn:async()=>{const l=HV(t,n);if(!l)throw new Error(`Instance "${n}" not found in cache`);const u=await pn.get(`/instance/${l}/advanced-settings`,{headers:{apikey:r}}),d=u.data?.data??u.data;return UV(d)},enabled:!!n&&(a??!0),retry:!1})},_u=(e,t)=>{const r=e.getQueryData(["instance","fetchInstances","go"])?.find(o=>o.name===t);if(r)return r;const a=e.getQueriesData({queryKey:["instance","fetchInstance","go"]});for(const[,o]of a)if(o?.name===t)return o},KV=e=>({createInstance:async u=>{const d={name:u.instanceName,token:u.token??void 0};return u.proxy?.host&&u.proxy?.port&&(d.proxy={host:u.proxy.host,port:u.proxy.port,username:u.proxy.username??"",password:u.proxy.password??""}),(await pn.post("/instance/create",d)).data},restart:async u=>{const d=_u(e,u);if(!d)throw new Error(`Instance "${u}" not found in cache`);return(await pn.post("/instance/reconnect",{},{headers:{apikey:d.token}})).data},logout:async u=>{const d=_u(e,u);if(!d)throw new Error(`Instance "${u}" not found in cache`);return(await pn.delete("/instance/logout",{headers:{apikey:d.token}})).data},deleteInstance:async u=>{const d=_u(e,u);if(!d)throw new Error(`Instance "${u}" not found in cache`);return(await pn.delete(`/instance/delete/${d.id}`)).data},connect:async({instanceName:u,token:d,number:f})=>{const h=_u(e,u)?.token??d;if(!h)throw new Error(`Instance "${u}" not found in cache`);const g={webhookUrl:"",subscribe:[],rabbitmqEnable:"",websocketEnable:"",natsEnable:""};try{await pn.post("/instance/connect",g,{headers:{apikey:h}})}catch{}await new Promise(C=>setTimeout(C,1e3));const x=C=>C?C.startsWith("data:")?C:`data:image/png;base64,${C}`:"",b=async()=>{try{const C=await pn.get("/instance/qr",{headers:{apikey:h}}),k=C.data?.data??C.data;return{code:k?.Code??k?.code??"",base64:x(k?.Qrcode??k?.qrcode??"")}}catch{return{code:"",base64:""}}};if(f){let C=f.trim();C.startsWith("+")||(C=`+${C}`);const k=await pn.post("/instance/pair",{subscribe:[],phone:C},{headers:{apikey:h}}),N=k.data?.data??k.data,T=N?.PairingCode??N?.pairingCode??"";return{...await b(),pairingCode:T}}return{...await b(),pairingCode:""}},updateSettings:async({instanceName:u,token:d,data:f})=>{const m=_u(e,u);if(!m)throw new Error(`Instance "${u}" not found in cache`);return(await pn.put(`/instance/${m.id}/advanced-settings`,VV(f),{headers:{apikey:d}})).data}});function ot(e,t){const n=Wa(),r=$D({mutationFn:e});return(a,o)=>r.mutateAsync(a,{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 GV=async e=>(await pn.post("/instance/create",e)).data,JV=async e=>(await Ce.post(`/instance/restart/${e}`)).data,QV=async e=>(await Ce.delete(`/instance/logout/${e}`)).data,YV=async e=>(await pn.delete(`/instance/delete/${e}`)).data,ZV=async({instanceName:e,token:t,number:n})=>(await Ce.get(`/instance/connect/${e}`,{headers:{apikey:t},params:{number:n}})).data,XV=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/settings/set/${e}`,n,{headers:{apikey:t}})).data;function Nc(){const e=Wa(),n=Tr()==="go"?KV(e):null,r=ot(n?n.connect:ZV,{invalidateKeys:[["instance","fetchInstance"],["instance","fetchInstances"]]}),a=ot(n?n.updateSettings:XV,{invalidateKeys:[["instance","fetchSettings"]]}),o=ot(n?n.deleteInstance:YV,{invalidateKeys:[["instance","fetchInstance"],["instance","fetchInstances"]]}),l=ot(n?n.logout:QV,{invalidateKeys:[["instance","fetchInstance"],["instance","fetchInstances"]]}),u=ot(n?n.restart:JV,{invalidateKeys:[["instance","fetchInstance"],["instance","fetchInstances"]]}),d=ot(n?n.createInstance:GV,{invalidateKeys:[["instance","fetchInstances"]]});return{connect:r,updateSettings:a,deleteInstance:o,logout:l,restart:u,createInstance:d}}var kd=e=>e.type==="checkbox",Oi=e=>e instanceof Date,Gr=e=>e==null;const X_=e=>typeof e=="object";var qn=e=>!Gr(e)&&!Array.isArray(e)&&X_(e)&&!Oi(e),eP=e=>qn(e)&&e.target?kd(e.target)?e.target.checked:e.target.value:e,tP=(e,t)=>t.split(".").some((n,r,a)=>!isNaN(Number(n))&&e.has(a.slice(0,r).join("."))),e8=e=>{const t=e.constructor&&e.constructor.prototype;return qn(t)&&t.hasOwnProperty("isPrototypeOf")},aw=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function bn(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(aw&&(e instanceof Blob||t))return e;const n=Array.isArray(e);if(!n&&!(qn(e)&&e8(e)))return e;const r=n?[]:Object.create(Object.getPrototypeOf(e));for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&(r[a]=bn(e[a]));return r}var em=e=>/^\w*$/.test(e),fn=e=>e===void 0,tm=e=>Array.isArray(e)?e.filter(Boolean):[],ow=e=>tm(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Oe=(e,t,n)=>{if(!t||!qn(e))return n;const r=(em(t)?[t]:ow(t)).reduce((a,o)=>Gr(a)?a:a[o],e);return fn(r)||r===e?fn(e[t])?n:e[t]:r},us=e=>typeof e=="boolean",Dr=e=>typeof e=="function",Xt=(e,t,n)=>{let r=-1;const a=em(t)?[t]:ow(t),o=a.length,l=o-1;for(;++rke.useContext(iw);var rP=(e,t,n,r=!0)=>{const a={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(a,o,{get:()=>{const l=o;return t._proxyFormState[l]!==_s.all&&(t._proxyFormState[l]=!r||_s.all),n&&(n[l]=!0),e[l]}});return a};const rm=typeof window<"u"?ke.useLayoutEffect:ke.useEffect;function t8(e){const t=nm(),{control:n=t,disabled:r,name:a,exact:o}=e||{},[l,u]=ke.useState(n._formState),d=ke.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return rm(()=>n._subscribe({name:a,formState:d.current,exact:o,callback:f=>{!r&&u({...n._formState,...f})}}),[a,r,o]),ke.useEffect(()=>{d.current.isValid&&n._setValid(!0)},[n]),ke.useMemo(()=>rP(l,n,d.current,!1),[l,n])}var Fr=e=>typeof e=="string",bb=(e,t,n,r,a)=>Fr(e)?(r&&t.watch.add(e),Oe(n,e,a)):Array.isArray(e)?e.map(o=>(r&&t.watch.add(o),Oe(n,o))):(r&&(t.watchAll=!0),n),xb=e=>Gr(e)||!X_(e);function Gs(e,t,n=new WeakSet){if(xb(e)||xb(t))return Object.is(e,t);if(Oi(e)&&Oi(t))return Object.is(e.getTime(),t.getTime());const r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const o of r){const l=e[o];if(!a.includes(o))return!1;if(o!=="ref"){const u=t[o];if(Oi(l)&&Oi(u)||(qn(l)||Array.isArray(l))&&(qn(u)||Array.isArray(u))?!Gs(l,u,n):!Object.is(l,u))return!1}}return!0}function n8(e){const t=nm(),{control:n=t,name:r,defaultValue:a,disabled:o,exact:l,compute:u}=e||{},d=ke.useRef(a),f=ke.useRef(u),m=ke.useRef(void 0),h=ke.useRef(n),g=ke.useRef(r);f.current=u;const[x,b]=ke.useState(()=>{const _=n._getWatch(r,d.current);return f.current?f.current(_):_}),w=ke.useCallback(_=>{const P=bb(r,n._names,_||n._formValues,!1,d.current);return f.current?f.current(P):P},[n._formValues,n._names,r]),C=ke.useCallback(_=>{if(!o){const P=bb(r,n._names,_||n._formValues,!1,d.current);if(f.current){const M=f.current(P);Gs(M,m.current)||(b(M),m.current=M)}else b(P)}},[n._formValues,n._names,o,r]);rm(()=>((h.current!==n||!Gs(g.current,r))&&(h.current=n,g.current=r,C()),n._subscribe({name:r,formState:{values:!0},exact:l,callback:_=>{C(_.values)}})),[n,l,r,C]),ke.useEffect(()=>n._removeUnmounted());const k=h.current!==n,N=g.current,T=ke.useMemo(()=>{if(o)return null;const _=!k&&!Gs(N,r);return k||_?w():null},[o,k,r,N,w]);return T!==null?T:x}function r8(e){const t=nm(),{name:n,disabled:r,control:a=t,shouldUnregister:o,defaultValue:l,exact:u=!0}=e,d=tP(a._names.array,n),f=ke.useMemo(()=>Oe(a._formValues,n,Oe(a._defaultValues,n,l)),[a,n,l]),m=n8({control:a,name:n,defaultValue:f,exact:u}),h=t8({control:a,name:n,exact:u}),g=ke.useRef(e),x=ke.useRef(void 0),b=ke.useRef(a.register(n,{...e.rules,value:m,...us(e.disabled)?{disabled:e.disabled}:{}}));g.current=e;const w=ke.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Oe(h.errors,n)},isDirty:{enumerable:!0,get:()=>!!Oe(h.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Oe(h.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Oe(h.validatingFields,n)},error:{enumerable:!0,get:()=>Oe(h.errors,n)}}),[h,n]),C=ke.useCallback(_=>b.current.onChange({target:{value:eP(_),name:n},type:Mo.CHANGE}),[n]),k=ke.useCallback(()=>b.current.onBlur({target:{value:Oe(a._formValues,n),name:n},type:Mo.BLUR}),[n,a._formValues]),N=ke.useCallback(_=>{const P=Oe(a._fields,n);P&&P._f&&_&&(P._f.ref={focus:()=>Dr(_.focus)&&_.focus(),select:()=>Dr(_.select)&&_.select(),setCustomValidity:M=>Dr(_.setCustomValidity)&&_.setCustomValidity(M),reportValidity:()=>Dr(_.reportValidity)&&_.reportValidity()})},[a._fields,n]),T=ke.useMemo(()=>({name:n,value:m,...us(r)||h.disabled?{disabled:h.disabled||r}:{},onChange:C,onBlur:k,ref:N}),[n,r,h.disabled,C,k,N,m]);return ke.useEffect(()=>{const _=a._options.shouldUnregister||o,P=x.current;P&&P!==n&&!d&&a.unregister(P),a.register(n,{...g.current.rules,...us(g.current.disabled)?{disabled:g.current.disabled}:{}});const M=(O,D)=>{const F=Oe(a._fields,O);F&&F._f&&(F._f.mount=D)};if(M(n,!0),_){const O=bn(Oe(a._options.defaultValues,n,g.current.defaultValue));Xt(a._defaultValues,n,O),fn(Oe(a._formValues,n))&&Xt(a._formValues,n,O)}return!d&&a.register(n),x.current=n,()=>{(d?_&&!a._state.action:_)?a.unregister(n):M(n,!1)}},[n,a,d,o]),ke.useEffect(()=>{a._setDisabledField({disabled:r,name:n})},[r,n,a]),ke.useMemo(()=>({field:T,formState:h,fieldState:w}),[T,h,w])}const s8=e=>e.render(r8(e)),lw=ke.createContext(null);lw.displayName="HookFormContext";const a8=()=>ke.useContext(lw),mr=e=>{const{children:t,watch:n,getValues:r,getFieldState:a,setError:o,clearErrors:l,setValue:u,trigger:d,formState:f,resetField:m,reset:h,handleSubmit:g,unregister:x,control:b,register:w,setFocus:C,subscribe:k}=e,N=ke.useMemo(()=>({watch:n,getValues:r,getFieldState:a,setError:o,clearErrors:l,setValue:u,trigger:d,formState:f,resetField:m,reset:h,handleSubmit:g,unregister:x,control:b,register:w,setFocus:C,subscribe:k}),[l,b,f,a,r,g,w,h,m,o,C,u,k,d,x,n]);return ke.createElement(lw.Provider,{value:N},ke.createElement(iw.Provider,{value:N.control},t))};var sP=(e,t,n,r,a)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:a||!0}}:{},Jr=e=>Array.isArray(e)?e:[e],tj=()=>{let e=[];return{get observers(){return e},next:a=>{for(const o of e)o.next&&o.next(a)},subscribe:a=>(e.push(a),{unsubscribe:()=>{e=e.filter(o=>o!==a)}}),unsubscribe:()=>{e=[]}}};function aP(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const a=e[r],o=t[r];if(a&&qn(a)&&o){const l=aP(a,o);qn(l)&&(n[r]=l)}else e[r]&&(n[r]=o)}return n}var jr=e=>qn(e)&&!Object.keys(e).length,cw=e=>e.type==="file",ah=e=>{if(!aw)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},oP=e=>e.type==="select-multiple",uw=e=>e.type==="radio",o8=e=>uw(e)||kd(e),Uv=e=>ah(e)&&e.isConnected;function i8(e,t){const n=t.slice(0,-1).length;let r=0;for(;r{for(const t in e)if(Dr(e[t]))return!0;return!1};function iP(e){return Array.isArray(e)||qn(e)&&!c8(e)}function wb(e,t={}){for(const n in e){const r=e[n];iP(r)?(t[n]=Array.isArray(r)?[]:{},wb(r,t[n])):fn(r)||(t[n]=!0)}return t}function Uu(e,t,n){n||(n=wb(t));for(const r in e){const a=e[r];if(iP(a))fn(t)||xb(n[r])?n[r]=wb(a,Array.isArray(a)?[]:{}):Uu(a,Gr(t)?{}:t[r],n[r]);else{const o=t[r];n[r]=!Gs(a,o)}}return n}const nj={value:!1,isValid:!1},rj={value:!0,isValid:!0};var lP=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&&!fn(e[0].attributes.value)?fn(e[0].value)||e[0].value===""?rj:{value:e[0].value,isValid:!0}:rj:nj}return nj},cP=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>fn(e)?e:t?e===""?NaN:e&&+e:n&&Fr(e)?new Date(e):r?r(e):e;const sj={isValid:!1,value:null};var uP=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,sj):sj;function aj(e){const t=e.ref;return cw(t)?t.files:uw(t)?uP(e.refs).value:oP(t)?[...t.selectedOptions].map(({value:n})=>n):kd(t)?lP(e.refs).value:cP(fn(t.value)?e.ref.value:t.value,e)}var u8=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,d8=(e,t,n,r)=>{const a={};for(const o of e){const l=Oe(t,o);l&&Xt(a,o,l._f)}return{criteriaMode:n,names:[...e],fields:a,shouldUseNativeValidation:r}},oh=e=>e instanceof RegExp,Pu=e=>fn(e)?e:oh(e)?e.source:qn(e)?oh(e.value)?e.value.source:e.value:e,Kl=e=>({isOnSubmit:!e||e===_s.onSubmit,isOnBlur:e===_s.onBlur,isOnChange:e===_s.onChange,isOnAll:e===_s.all,isOnTouch:e===_s.onTouched});const oj="AsyncFunction";var f8=e=>!!e&&!!e.validate&&!!(Dr(e.validate)&&e.validate.constructor.name===oj||qn(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===oj)),p8=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Sb=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Zl=(e,t,n,r)=>{for(const a of n||Object.keys(e)){const o=Oe(e,a);if(o){const{_f:l,...u}=o;if(l){if(l.refs&&l.refs[0]&&t(l.refs[0],a)&&!r)return!0;if(l.ref&&t(l.ref,l.name)&&!r)return!0;if(Zl(u,t))break}else if(qn(u)&&Zl(u,t))break}}};function ij(e,t,n){const r=Oe(e,n);if(r||em(n))return{error:r,name:n};const a=n.split(".");for(;a.length;){const o=a.join("."),l=Oe(t,o),u=Oe(e,o);if(l&&!Array.isArray(l)&&n!==o)return{name:n};if(u&&u.type)return{name:o,error:u};if(u&&u.root&&u.root.type)return{name:`${o}.root`,error:u.root};a.pop()}return{name:n}}var h8=(e,t,n,r)=>{n(e);const{name:a,...o}=e;return jr(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(l=>t[l]===(!r||_s.all))},m8=(e,t,n)=>!e||!t||e===t||Jr(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),g8=(e,t,n,r,a)=>a.isOnAll?!1:!n&&a.isOnTouch?!(t||e):(n?r.isOnBlur:a.isOnBlur)?!e:(n?r.isOnChange:a.isOnChange)?e:!0,v8=(e,t)=>!tm(Oe(e,t)).length&&zn(e,t),dP=(e,t,n)=>{const r=Jr(Oe(e,n));return Xt(r,nP,t[n]),Xt(e,n,r),e};function lj(e,t,n="validate"){if(Fr(e)||Array.isArray(e)&&e.every(Fr)||us(e)&&!e)return{type:n,message:Fr(e)?e:"",ref:t}}var Fl=e=>qn(e)&&!oh(e)?e:{value:e,message:""},Cb=async(e,t,n,r,a,o)=>{const{ref:l,refs:u,required:d,maxLength:f,minLength:m,min:h,max:g,pattern:x,validate:b,name:w,valueAsNumber:C,mount:k}=e._f,N=Oe(n,w);if(!k||t.has(w))return{};const T=u?u[0]:l,_=z=>{a&&T.reportValidity&&(T.setCustomValidity(us(z)?"":z||""),T.reportValidity())},P={},M=uw(l),O=kd(l),D=M||O,F=(C||cw(l))&&fn(l.value)&&fn(N)||ah(l)&&l.value===""||N===""||Array.isArray(N)&&!N.length,$=sP.bind(null,w,r,P),te=(z,ue,V,ne=Vs.maxLength,Y=Vs.minLength)=>{const se=z?ue:V;P[w]={type:z?ne:Y,message:se,ref:l,...$(z?ne:Y,se)}};if(o?!Array.isArray(N)||!N.length:d&&(!D&&(F||Gr(N))||us(N)&&!N||O&&!lP(u).isValid||M&&!uP(u).isValid)){const{value:z,message:ue}=Fr(d)?{value:!!d,message:d}:Fl(d);if(z&&(P[w]={type:Vs.required,message:ue,ref:T,...$(Vs.required,ue)},!r))return _(ue),P}if(!F&&(!Gr(h)||!Gr(g))){let z,ue;const V=Fl(g),ne=Fl(h);if(!Gr(N)&&!isNaN(N)){const Y=l.valueAsNumber||N&&+N;Gr(V.value)||(z=Y>V.value),Gr(ne.value)||(ue=Ynew Date(new Date().toDateString()+" "+U),H=l.type=="time",W=l.type=="week";Fr(V.value)&&N&&(z=H?se(N)>se(V.value):W?N>V.value:Y>new Date(V.value)),Fr(ne.value)&&N&&(ue=H?se(N)+z.value,ne=!Gr(ue.value)&&N.length<+ue.value;if((V||ne)&&(te(V,z.message,ue.message),!r))return _(P[w].message),P}if(x&&!F&&Fr(N)){const{value:z,message:ue}=Fl(x);if(oh(z)&&!N.match(z)&&(P[w]={type:Vs.pattern,message:ue,ref:l,...$(Vs.pattern,ue)},!r))return _(ue),P}if(b){if(Dr(b)){const z=await b(N,n),ue=lj(z,T);if(ue&&(P[w]={...ue,...$(Vs.validate,ue.message)},!r))return _(ue.message),P}else if(qn(b)){let z={};for(const ue in b){if(!jr(z)&&!r)break;const V=lj(await b[ue](N,n),T,ue);V&&(z={...V,...$(ue,V.message)},_(V.message),r&&(P[w]=z))}if(!jr(z)&&(P[w]={ref:T,...z},!r))return P}}return _(!0),P};const y8={mode:_s.onSubmit,reValidateMode:_s.onChange,shouldFocusError:!0};function b8(e={}){let t={...y8,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Dr(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},a=qn(t.defaultValues)||qn(t.values)?bn(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:bn(a),l={action:!1,mount:!1,watch:!1,keepIsValid:!1},u={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},d,f=0;const m={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},h={...m};let g={...h};const x={array:tj(),state:tj()},b=t.criteriaMode===_s.all,w=B=>oe=>{clearTimeout(f),f=setTimeout(B,oe)},C=async B=>{if(!l.keepIsValid&&!t.disabled&&(h.isValid||g.isValid||B)){let oe;t.resolver?(oe=jr((await F()).errors),k()):oe=await z({fields:r,onlyCheckValid:!0,eventType:Mo.VALID}),oe!==n.isValid&&x.state.next({isValid:oe})}},k=(B,oe)=>{!t.disabled&&(h.isValidating||h.validatingFields||g.isValidating||g.validatingFields)&&((B||Array.from(u.mount)).forEach(pe=>{pe&&(oe?Xt(n.validatingFields,pe,oe):zn(n.validatingFields,pe))}),x.state.next({validatingFields:n.validatingFields,isValidating:!jr(n.validatingFields)}))},N=B=>{const oe=Uu(a,o),pe=u8(B);Xt(n.dirtyFields,pe,Oe(oe,pe))},T=(B,oe=[],pe,Ae,Ie=!0,Te=!0)=>{if(Ae&&pe&&!t.disabled){if(l.action=!0,Te&&Array.isArray(Oe(r,B))){const De=pe(Oe(r,B),Ae.argA,Ae.argB);Ie&&Xt(r,B,De)}if(Te&&Array.isArray(Oe(n.errors,B))){const De=pe(Oe(n.errors,B),Ae.argA,Ae.argB);Ie&&Xt(n.errors,B,De),v8(n.errors,B)}if((h.touchedFields||g.touchedFields)&&Te&&Array.isArray(Oe(n.touchedFields,B))){const De=pe(Oe(n.touchedFields,B),Ae.argA,Ae.argB);Ie&&Xt(n.touchedFields,B,De)}(h.dirtyFields||g.dirtyFields)&&N(B),x.state.next({name:B,isDirty:V(B,oe),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Xt(o,B,oe)},_=(B,oe)=>{Xt(n.errors,B,oe),x.state.next({errors:n.errors})},P=B=>{n.errors=B,x.state.next({errors:n.errors,isValid:!1})},M=(B,oe,pe,Ae)=>{const Ie=Oe(r,B);if(Ie){const Te=Oe(o,B,fn(pe)?Oe(a,B):pe);fn(Te)||Ae&&Ae.defaultChecked||oe?Xt(o,B,oe?Te:aj(Ie._f)):se(B,Te),l.mount&&!l.action&&C()}},O=(B,oe,pe,Ae,Ie)=>{let Te=!1,De=!1;const pt={name:B};if(!t.disabled){if(!pe||Ae){(h.isDirty||g.isDirty)&&(De=n.isDirty,n.isDirty=pt.isDirty=V(),Te=De!==pt.isDirty);const Nt=Gs(Oe(a,B),oe);De=!!Oe(n.dirtyFields,B),Nt?zn(n.dirtyFields,B):Xt(n.dirtyFields,B,!0),pt.dirtyFields=n.dirtyFields,Te=Te||(h.dirtyFields||g.dirtyFields)&&De!==!Nt}if(pe){const Nt=Oe(n.touchedFields,B);Nt||(Xt(n.touchedFields,B,pe),pt.touchedFields=n.touchedFields,Te=Te||(h.touchedFields||g.touchedFields)&&Nt!==pe)}Te&&Ie&&x.state.next(pt)}return Te?pt:{}},D=(B,oe,pe,Ae)=>{const Ie=Oe(n.errors,B),Te=(h.isValid||g.isValid)&&us(oe)&&n.isValid!==oe;if(t.delayError&&pe?(d=w(()=>_(B,pe)),d(t.delayError)):(clearTimeout(f),d=null,pe?Xt(n.errors,B,pe):zn(n.errors,B)),(pe?!Gs(Ie,pe):Ie)||!jr(Ae)||Te){const De={...Ae,...Te&&us(oe)?{isValid:oe}:{},errors:n.errors,name:B};n={...n,...De},x.state.next(De)}},F=async B=>(k(B,!0),await t.resolver(o,t.context,d8(B||u.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),$=async B=>{const{errors:oe}=await F(B);if(k(B),B)for(const pe of B){const Ae=Oe(oe,pe);Ae?Xt(n.errors,pe,Ae):zn(n.errors,pe)}else n.errors=oe;return oe},te=async({name:B,eventType:oe})=>{if(e.validate){const pe=await e.validate({formValues:o,formState:n,name:B,eventType:oe});if(qn(pe))for(const Ae in pe)pe[Ae]&&de(`${zv}.${Ae}`,{message:Fr(pe.message)?pe.message:"",type:Vs.validate});else Fr(pe)||!pe?de(zv,{message:pe||"",type:Vs.validate}):ie(zv);return pe}return!0},z=async({fields:B,onlyCheckValid:oe,name:pe,eventType:Ae,context:Ie={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(Ie.runRootValidation=!0,!await te({name:pe,eventType:Ae})&&(Ie.valid=!1,oe)))return Ie.valid;for(const Te in B){const De=B[Te];if(De){const{_f:pt,...Nt}=De;if(pt){const Rn=u.array.has(pt.name),vn=De._f&&f8(De._f);vn&&h.validatingFields&&k([pt.name],!0);const Ee=await Cb(De,u.disabled,o,b,t.shouldUseNativeValidation&&!oe,Rn);if(vn&&h.validatingFields&&k([pt.name]),Ee[pt.name]&&(Ie.valid=!1,oe)||(!oe&&(Oe(Ee,pt.name)?Rn?dP(n.errors,Ee,pt.name):Xt(n.errors,pt.name,Ee[pt.name]):zn(n.errors,pt.name)),e.shouldUseNativeValidation&&Ee[pt.name]))break}!jr(Nt)&&await z({context:Ie,onlyCheckValid:oe,fields:Nt,name:Te,eventType:Ae})}}return Ie.valid},ue=()=>{for(const B of u.unMount){const oe=Oe(r,B);oe&&(oe._f.refs?oe._f.refs.every(pe=>!Uv(pe)):!Uv(oe._f.ref))&&xe(B)}u.unMount=new Set},V=(B,oe)=>!t.disabled&&(B&&oe&&Xt(o,B,oe),!Gs(re(),a)),ne=(B,oe,pe)=>bb(B,u,{...l.mount?o:fn(oe)?a:Fr(B)?{[B]:oe}:oe},pe,oe),Y=B=>tm(Oe(l.mount?o:a,B,t.shouldUnregister?Oe(a,B,[]):[])),se=(B,oe,pe={})=>{const Ae=Oe(r,B);let Ie=oe;if(Ae){const Te=Ae._f;Te&&(!Te.disabled&&Xt(o,B,cP(oe,Te)),Ie=ah(Te.ref)&&Gr(oe)?"":oe,oP(Te.ref)?[...Te.ref.options].forEach(De=>De.selected=Ie.includes(De.value)):Te.refs?kd(Te.ref)?Te.refs.forEach(De=>{(!De.defaultChecked||!De.disabled)&&(Array.isArray(Ie)?De.checked=!!Ie.find(pt=>pt===De.value):De.checked=Ie===De.value||!!Ie)}):Te.refs.forEach(De=>De.checked=De.value===Ie):cw(Te.ref)?Te.ref.value="":(Te.ref.value=Ie,Te.ref.type||x.state.next({name:B,values:bn(o)})))}(pe.shouldDirty||pe.shouldTouch)&&O(B,Ie,pe.shouldTouch,pe.shouldDirty,!0),pe.shouldValidate&&K(B)},H=(B,oe,pe)=>{for(const Ae in oe){if(!oe.hasOwnProperty(Ae))return;const Ie=oe[Ae],Te=B+"."+Ae,De=Oe(r,Te);(u.array.has(B)||qn(Ie)||De&&!De._f)&&!Oi(Ie)?H(Te,Ie,pe):se(Te,Ie,pe)}},W=(B,oe,pe={})=>{const Ae=Oe(r,B),Ie=u.array.has(B),Te=bn(oe);Xt(o,B,Te),Ie?(x.array.next({name:B,values:bn(o)}),(h.isDirty||h.dirtyFields||g.isDirty||g.dirtyFields)&&pe.shouldDirty&&(N(B),x.state.next({name:B,dirtyFields:n.dirtyFields,isDirty:V(B,Te)}))):Ae&&!Ae._f&&!Gr(Te)?H(B,Te,pe):se(B,Te,pe),Sb(B,u)?x.state.next({...n,name:B,values:bn(o)}):x.state.next({name:l.mount?B:void 0,values:bn(o)})},U=async B=>{l.mount=!0;const oe=B.target;let pe=oe.name,Ae=!0;const Ie=Oe(r,pe),Te=Nt=>{Ae=Number.isNaN(Nt)||Oi(Nt)&&isNaN(Nt.getTime())||Gs(Nt,Oe(o,pe,Nt))},De=Kl(t.mode),pt=Kl(t.reValidateMode);if(Ie){let Nt,Rn;const vn=oe.type?aj(Ie._f):eP(B),Ee=B.type===Mo.BLUR||B.type===Mo.FOCUS_OUT,bt=!p8(Ie._f)&&!e.validate&&!t.resolver&&!Oe(n.errors,pe)&&!Ie._f.deps||g8(Ee,Oe(n.touchedFields,pe),n.isSubmitted,pt,De),zt=Sb(pe,u,Ee);Xt(o,pe,vn),Ee?(!oe||!oe.readOnly)&&(Ie._f.onBlur&&Ie._f.onBlur(B),d&&d(0)):Ie._f.onChange&&Ie._f.onChange(B);const Tn=O(pe,vn,Ee),vr=!jr(Tn)||zt;if(!Ee&&x.state.next({name:pe,type:B.type,values:bn(o)}),bt)return(h.isValid||g.isValid)&&(t.mode==="onBlur"?Ee&&C():Ee||C()),vr&&x.state.next({name:pe,...zt?{}:Tn});if(!t.resolver&&e.validate&&await te({name:pe,eventType:B.type}),!Ee&&zt&&x.state.next({...n}),t.resolver){const{errors:ur}=await F([pe]);if(k([pe]),Te(vn),Ae){const zr=ij(n.errors,r,pe),_r=ij(ur,r,zr.name||pe);Nt=_r.error,pe=_r.name,Rn=jr(ur)}}else k([pe],!0),Nt=(await Cb(Ie,u.disabled,o,b,t.shouldUseNativeValidation))[pe],k([pe]),Te(vn),Ae&&(Nt?Rn=!1:(h.isValid||g.isValid)&&(Rn=await z({fields:r,onlyCheckValid:!0,name:pe,eventType:B.type})));Ae&&(Ie._f.deps&&(!Array.isArray(Ie._f.deps)||Ie._f.deps.length>0)&&K(Ie._f.deps),D(pe,Rn,Nt,Tn))}},A=(B,oe)=>{if(Oe(n.errors,oe)&&B.focus)return B.focus(),1},K=async(B,oe={})=>{let pe,Ae;const Ie=Jr(B);if(t.resolver){const Te=await $(fn(B)?B:Ie);pe=jr(Te),Ae=B?!Ie.some(De=>Oe(Te,De)):pe}else B?(Ae=(await Promise.all(Ie.map(async Te=>{const De=Oe(r,Te);return await z({fields:De&&De._f?{[Te]:De}:De,eventType:Mo.TRIGGER})}))).every(Boolean),!(!Ae&&!n.isValid)&&C()):Ae=pe=await z({fields:r,name:B,eventType:Mo.TRIGGER});return x.state.next({...!Fr(B)||(h.isValid||g.isValid)&&pe!==n.isValid?{}:{name:B},...t.resolver||!B?{isValid:pe}:{},errors:n.errors}),oe.shouldFocus&&!Ae&&Zl(r,A,B?Ie:u.mount),Ae},re=(B,oe)=>{let pe={...l.mount?o:a};return oe&&(pe=aP(oe.dirtyFields?n.dirtyFields:n.touchedFields,pe)),fn(B)?pe:Fr(B)?Oe(pe,B):B.map(Ae=>Oe(pe,Ae))},ee=(B,oe)=>({invalid:!!Oe((oe||n).errors,B),isDirty:!!Oe((oe||n).dirtyFields,B),error:Oe((oe||n).errors,B),isValidating:!!Oe(n.validatingFields,B),isTouched:!!Oe((oe||n).touchedFields,B)}),ie=B=>{const oe=B?Jr(B):void 0;oe?.forEach(pe=>zn(n.errors,pe)),oe?oe.forEach(pe=>{x.state.next({name:pe,errors:n.errors})}):x.state.next({errors:{}})},de=(B,oe,pe)=>{const Ae=(Oe(r,B,{_f:{}})._f||{}).ref,Ie=Oe(n.errors,B)||{},{ref:Te,message:De,type:pt,...Nt}=Ie;Xt(n.errors,B,{...Nt,...oe,ref:Ae}),x.state.next({name:B,errors:n.errors,isValid:!1}),pe&&pe.shouldFocus&&Ae&&Ae.focus&&Ae.focus()},j=(B,oe)=>Dr(B)?x.state.subscribe({next:pe=>"values"in pe&&B(ne(void 0,oe),pe)}):ne(B,oe,!0),I=B=>x.state.subscribe({next:oe=>{m8(B.name,oe.name,B.exact)&&h8(oe,B.formState||h,Br,B.reRenderRoot)&&B.callback({values:{...o},...n,...oe,defaultValues:a})}}).unsubscribe,me=B=>(l.mount=!0,g={...g,...B.formState},I({...B,formState:{...m,...B.formState}})),xe=(B,oe={})=>{for(const pe of B?Jr(B):u.mount)u.mount.delete(pe),u.array.delete(pe),oe.keepValue||(zn(r,pe),zn(o,pe)),!oe.keepError&&zn(n.errors,pe),!oe.keepDirty&&zn(n.dirtyFields,pe),!oe.keepTouched&&zn(n.touchedFields,pe),!oe.keepIsValidating&&zn(n.validatingFields,pe),!t.shouldUnregister&&!oe.keepDefaultValue&&zn(a,pe);x.state.next({values:bn(o)}),x.state.next({...n,...oe.keepDirty?{isDirty:V()}:{}}),!oe.keepIsValid&&C()},rt=({disabled:B,name:oe})=>{if(us(B)&&l.mount||B||u.disabled.has(oe)){const Ie=u.disabled.has(oe)!==!!B;B?u.disabled.add(oe):u.disabled.delete(oe),Ie&&l.mount&&!l.action&&C()}},Je=(B,oe={})=>{let pe=Oe(r,B);const Ae=us(oe.disabled)||us(t.disabled),Ie=!u.registerName.has(B)&&pe&&!pe._f.mount;return Xt(r,B,{...pe||{},_f:{...pe&&pe._f?pe._f:{ref:{name:B}},name:B,mount:!0,...oe}}),u.mount.add(B),pe&&!Ie?rt({disabled:us(oe.disabled)?oe.disabled:t.disabled,name:B}):M(B,!0,oe.value),{...Ae?{disabled:oe.disabled||t.disabled}:{},...t.progressive?{required:!!oe.required,min:Pu(oe.min),max:Pu(oe.max),minLength:Pu(oe.minLength),maxLength:Pu(oe.maxLength),pattern:Pu(oe.pattern)}:{},name:B,onChange:U,onBlur:U,ref:Te=>{if(Te){u.registerName.add(B),Je(B,oe),u.registerName.delete(B),pe=Oe(r,B);const De=fn(Te.value)&&Te.querySelectorAll&&Te.querySelectorAll("input,select,textarea")[0]||Te,pt=o8(De),Nt=pe._f.refs||[];if(pt?Nt.find(Rn=>Rn===De):De===pe._f.ref)return;Xt(r,B,{_f:{...pe._f,...pt?{refs:[...Nt.filter(Uv),De,...Array.isArray(Oe(a,B))?[{}]:[]],ref:{type:De.type,name:B}}:{ref:De}}}),M(B,!1,void 0,De)}else pe=Oe(r,B,{}),pe._f&&(pe._f.mount=!1),(t.shouldUnregister||oe.shouldUnregister)&&!(tP(u.array,B)&&l.action)&&u.unMount.add(B)}}},nt=()=>t.shouldFocusError&&Zl(r,A,u.mount),qt=B=>{us(B)&&(x.state.next({disabled:B}),Zl(r,(oe,pe)=>{const Ae=Oe(r,pe);Ae&&(oe.disabled=Ae._f.disabled||B,Array.isArray(Ae._f.refs)&&Ae._f.refs.forEach(Ie=>{Ie.disabled=Ae._f.disabled||B}))},0,!1))},Wn=(B,oe)=>async pe=>{let Ae;pe&&(pe.preventDefault&&pe.preventDefault(),pe.persist&&pe.persist());let Ie=bn(o);if(x.state.next({isSubmitting:!0}),t.resolver){const{errors:Te,values:De}=await F();k(),n.errors=Te,Ie=bn(De)}else await z({fields:r,eventType:Mo.SUBMIT});if(u.disabled.size)for(const Te of u.disabled)zn(Ie,Te);if(zn(n.errors,nP),jr(n.errors)){x.state.next({errors:{}});try{await B(Ie,pe)}catch(Te){Ae=Te}}else oe&&await oe({...n.errors},pe),nt(),setTimeout(nt);if(x.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:jr(n.errors)&&!Ae,submitCount:n.submitCount+1,errors:n.errors}),Ae)throw Ae},Pn=(B,oe={})=>{Oe(r,B)&&(fn(oe.defaultValue)?W(B,bn(Oe(a,B))):(W(B,oe.defaultValue),Xt(a,B,bn(oe.defaultValue))),oe.keepTouched||zn(n.touchedFields,B),oe.keepDirty||(zn(n.dirtyFields,B),n.isDirty=oe.defaultValue?V(B,bn(Oe(a,B))):V()),oe.keepError||(zn(n.errors,B),h.isValid&&C()),x.state.next({...n}))},tr=(B,oe={})=>{const pe=B?bn(B):a,Ae=bn(pe),Ie=jr(B),Te=Ie?a:Ae;if(oe.keepDefaultValues||(a=pe),!oe.keepValues){if(oe.keepDirtyValues){const De=new Set([...u.mount,...Object.keys(Uu(a,o))]);for(const pt of Array.from(De)){const Nt=Oe(n.dirtyFields,pt),Rn=Oe(o,pt),vn=Oe(Te,pt);Nt&&!fn(Rn)?Xt(Te,pt,Rn):!Nt&&!fn(vn)&&W(pt,vn)}}else{if(aw&&fn(B))for(const De of u.mount){const pt=Oe(r,De);if(pt&&pt._f){const Nt=Array.isArray(pt._f.refs)?pt._f.refs[0]:pt._f.ref;if(ah(Nt)){const Rn=Nt.closest("form");if(Rn){Rn.reset();break}}}}if(oe.keepFieldsRef)for(const De of u.mount)W(De,Oe(Te,De));else r={}}o=t.shouldUnregister?oe.keepDefaultValues?bn(a):{}:bn(Te),x.array.next({values:{...Te}}),x.state.next({values:{...Te}})}u={mount:oe.keepDirtyValues?u.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},l.mount=!h.isValid||!!oe.keepIsValid||!!oe.keepDirtyValues||!t.shouldUnregister&&!jr(Te),l.watch=!!t.shouldUnregister,l.keepIsValid=!!oe.keepIsValid,l.action=!1,oe.keepErrors||(n.errors={}),x.state.next({submitCount:oe.keepSubmitCount?n.submitCount:0,isDirty:Ie?!1:oe.keepDirty?n.isDirty:!!(oe.keepDefaultValues&&!Gs(B,a)),isSubmitted:oe.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Ie?{}:oe.keepDirtyValues?oe.keepDefaultValues&&o?Uu(a,o):n.dirtyFields:oe.keepDefaultValues&&B?Uu(a,B):oe.keepDirty?n.dirtyFields:{},touchedFields:oe.keepTouched?n.touchedFields:{},errors:oe.keepErrors?n.errors:{},isSubmitSuccessful:oe.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:a})},wn=(B,oe)=>tr(Dr(B)?B(o):B,{...t.resetOptions,...oe}),$r=(B,oe={})=>{const pe=Oe(r,B),Ae=pe&&pe._f;if(Ae){const Ie=Ae.refs?Ae.refs[0]:Ae.ref;Ie.focus&&setTimeout(()=>{Ie.focus(),oe.shouldSelect&&Dr(Ie.select)&&Ie.select()})}},Br=B=>{n={...n,...B}},Mr={control:{register:Je,unregister:xe,getFieldState:ee,handleSubmit:Wn,setError:de,_subscribe:I,_runSchema:F,_updateIsValidating:k,_focusError:nt,_getWatch:ne,_getDirty:V,_setValid:C,_setFieldArray:T,_setDisabledField:rt,_setErrors:P,_getFieldArray:Y,_reset:tr,_resetDefaultValues:()=>Dr(t.defaultValues)&&t.defaultValues().then(B=>{wn(B,t.resetOptions),x.state.next({isLoading:!1})}),_removeUnmounted:ue,_disableForm:qt,_subjects:x,_proxyFormState:h,get _fields(){return r},get _formValues(){return o},get _state(){return l},set _state(B){l=B},get _defaultValues(){return a},get _names(){return u},set _names(B){u=B},get _formState(){return n},get _options(){return t},set _options(B){t={...t,...B}}},subscribe:me,trigger:K,register:Je,handleSubmit:Wn,watch:j,setValue:W,getValues:re,reset:wn,resetField:Pn,clearErrors:ie,unregister:xe,setError:de,setFocus:$r,getFieldState:ee};return{...Mr,formControl:Mr}}var Eo=()=>{if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(Math.random()*16+e)%16|0;return(t=="x"?n:n&3|8).toString(16)})},Vv=(e,t,n={})=>n.shouldFocus||fn(n.shouldFocus)?n.focusName||`${e}.${fn(n.focusIndex)?t:n.focusIndex}.`:"",qv=(e,t)=>[...e,...Jr(t)],Hv=e=>Array.isArray(e)?e.map(()=>{}):void 0;function Wv(e,t,n){return[...e.slice(0,t),...Jr(n),...e.slice(t)]}var Kv=(e,t,n)=>Array.isArray(e)?(fn(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],Gv=(e,t)=>[...Jr(t),...Jr(e)];function x8(e,t){let n=0;const r=[...e];for(const a of t)r.splice(a-n,1),n++;return tm(r).length?r:[]}var Jv=(e,t)=>fn(t)?[]:x8(e,Jr(t).sort((n,r)=>n-r)),Qv=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]},cj=(e,t,n)=>(e[t]=n,e);function w8(e){const t=nm(),{control:n=t,name:r,keyName:a="id",shouldUnregister:o,rules:l}=e,[u,d]=ke.useState(n._getFieldArray(r)),f=ke.useRef(n._getFieldArray(r).map(Eo)),m=ke.useRef(!1);n._names.array.add(r),ke.useMemo(()=>l&&u.length>=0&&n.register(r,l),[n,r,u.length,l]),rm(()=>n._subjects.array.subscribe({next:({values:_,name:P})=>{if(P===r||!P){const M=Oe(_,r);Array.isArray(M)&&(d(M),f.current=M.map(Eo))}}}).unsubscribe,[n,r]);const h=ke.useCallback(_=>{m.current=!0,n._setFieldArray(r,_)},[n,r]),g=(_,P)=>{const M=Jr(bn(_)),O=qv(n._getFieldArray(r),M);n._names.focus=Vv(r,O.length-1,P),f.current=qv(f.current,M.map(Eo)),h(O),d(O),n._setFieldArray(r,O,qv,{argA:Hv(_)})},x=(_,P)=>{const M=Jr(bn(_)),O=Gv(n._getFieldArray(r),M);n._names.focus=Vv(r,0,P),f.current=Gv(f.current,M.map(Eo)),h(O),d(O),n._setFieldArray(r,O,Gv,{argA:Hv(_)})},b=_=>{const P=Jv(n._getFieldArray(r),_);f.current=Jv(f.current,_),h(P),d(P),!Array.isArray(Oe(n._fields,r))&&Xt(n._fields,r,void 0),n._setFieldArray(r,P,Jv,{argA:_})},w=(_,P,M)=>{const O=Jr(bn(P)),D=Wv(n._getFieldArray(r),_,O);n._names.focus=Vv(r,_,M),f.current=Wv(f.current,_,O.map(Eo)),h(D),d(D),n._setFieldArray(r,D,Wv,{argA:_,argB:Hv(P)})},C=(_,P)=>{const M=n._getFieldArray(r);Qv(M,_,P),Qv(f.current,_,P),h(M),d(M),n._setFieldArray(r,M,Qv,{argA:_,argB:P},!1)},k=(_,P)=>{const M=n._getFieldArray(r);Kv(M,_,P),Kv(f.current,_,P),h(M),d(M),n._setFieldArray(r,M,Kv,{argA:_,argB:P},!1)},N=(_,P)=>{const M=bn(P),O=cj(n._getFieldArray(r),_,M);f.current=[...O].map((D,F)=>!D||F===_?Eo():f.current[F]),h(O),d([...O]),n._setFieldArray(r,O,cj,{argA:_,argB:M},!0,!1)},T=_=>{const P=Jr(bn(_));f.current=P.map(Eo),h([...P]),d([...P]),n._setFieldArray(r,[...P],M=>M,{},!0,!1)};return ke.useEffect(()=>{if(n._state.action=!1,Sb(r,n._names)&&n._subjects.state.next({...n._formState}),m.current&&(!Kl(n._options.mode).isOnSubmit||n._formState.isSubmitted)&&!Kl(n._options.reValidateMode).isOnSubmit)if(n._options.resolver)n._runSchema([r]).then(_=>{n._updateIsValidating([r]);const P=Oe(_.errors,r),M=Oe(n._formState.errors,r);(M?!P&&M.type||P&&(M.type!==P.type||M.message!==P.message):P&&P.type)&&(P?Xt(n._formState.errors,r,P):zn(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const _=Oe(n._fields,r);_&&_._f&&!(Kl(n._options.reValidateMode).isOnSubmit&&Kl(n._options.mode).isOnSubmit)&&Cb(_,n._names.disabled,n._formValues,n._options.criteriaMode===_s.all,n._options.shouldUseNativeValidation,!0).then(P=>!jr(P)&&n._subjects.state.next({errors:dP(n._formState.errors,P,r)}))}n._subjects.state.next({name:r,values:bn(n._formValues)}),n._names.focus&&Zl(n._fields,(_,P)=>{if(n._names.focus&&P.startsWith(n._names.focus)&&_.focus)return _.focus(),1}),n._names.focus="",n._setValid(),m.current=!1},[u,r,n]),ke.useEffect(()=>(!Oe(n._formValues,r)&&n._setFieldArray(r),()=>{const _=(P,M)=>{const O=Oe(n._fields,P);O&&O._f&&(O._f.mount=M)};n._options.shouldUnregister||o?n.unregister(r):_(r,!1)}),[r,n,a,o]),{swap:ke.useCallback(C,[h,r,n]),move:ke.useCallback(k,[h,r,n]),prepend:ke.useCallback(x,[h,r,n]),append:ke.useCallback(g,[h,r,n]),remove:ke.useCallback(b,[h,r,n]),insert:ke.useCallback(w,[h,r,n]),update:ke.useCallback(N,[h,r,n]),replace:ke.useCallback(T,[h,r,n]),fields:ke.useMemo(()=>u.map((_,P)=>({..._,[a]:f.current[P]||Eo()})),[u,a])}}function mn(e={}){const t=ke.useRef(void 0),n=ke.useRef(void 0),[r,a]=ke.useState({isDirty:!1,isValidating:!1,isLoading:Dr(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Dr(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!Dr(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:l,...u}=b8(e);t.current={...u,formState:r}}const o=t.current.control;return o._options=e,rm(()=>{const l=o._subscribe({formState:o._proxyFormState,callback:()=>a({...o._formState}),reRenderRoot:!0});return a(u=>({...u,isReady:!0})),o._formState.isReady=!0,l},[o]),ke.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),ke.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),ke.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),ke.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),ke.useEffect(()=>{if(o._proxyFormState.isDirty){const l=o._getDirty();l!==r.isDirty&&o._subjects.state.next({isDirty:l})}},[o,r.isDirty]),ke.useEffect(()=>{var l;e.values&&!Gs(e.values,n.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),!((l=o._options.resetOptions)===null||l===void 0)&&l.keepIsValid||o._setValid(),n.current=e.values,a(u=>({...u}))):o._resetDefaultValues()},[o,e.values]),ke.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=ke.useMemo(()=>rP(r,o),[o,r]),t.current}const uj=(e,t,n)=>{if(e&&"reportValidity"in e){const r=Oe(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},fP=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?uj(r.ref,n,e):r.refs&&r.refs.forEach(a=>uj(a,n,e))}},S8=(e,t)=>{t.shouldUseNativeValidation&&fP(e,t);const n={};for(const r in e){const a=Oe(t.fields,r),o=Object.assign(e[r]||{},{ref:a&&a.ref});if(C8(t.names||Object.keys(e),r)){const l=Object.assign({},Oe(n,r));Xt(l,"root",o),Xt(n,r,l)}else Xt(n,r,o)}return n},C8=(e,t)=>e.some(n=>n.startsWith(t+"."));var j8=function(e,t){for(var n={};e.length;){var r=e[0],a=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:a};if("unionErrors"in r&&r.unionErrors.forEach(function(m){return m.errors.forEach(function(h){return e.push(h)})}),t){var d=n[l].types,f=d&&d[r.code];n[l]=sP(l,t,n,a,f?[].concat(f,r.message):r.message)}e.shift()}return n},gn=function(e,t,n){return n===void 0&&(n={}),function(r,a,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&&fP({},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:S8(j8(l.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw l}))}catch(l){return Promise.reject(l)}}},pr=[];for(var Yv=0;Yv<256;++Yv)pr.push((Yv+256).toString(16).slice(1));function k8(e,t=0){return(pr[e[t+0]]+pr[e[t+1]]+pr[e[t+2]]+pr[e[t+3]]+"-"+pr[e[t+4]]+pr[e[t+5]]+"-"+pr[e[t+6]]+pr[e[t+7]]+"-"+pr[e[t+8]]+pr[e[t+9]]+"-"+pr[e[t+10]]+pr[e[t+11]]+pr[e[t+12]]+pr[e[t+13]]+pr[e[t+14]]+pr[e[t+15]]).toLowerCase()}var Jf,E8=new Uint8Array(16);function N8(){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(E8)}var T8=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const dj={randomUUID:T8};function jb(e,t,n){if(dj.randomUUID&&!e)return dj.randomUUID();e=e||{};var r=e.random||(e.rng||N8)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,k8(r)}var en;(function(e){e.assertEqual=a=>{};function t(a){}e.assertIs=t;function n(a){throw new Error}e.assertNever=n,e.arrayToEnum=a=>{const o={};for(const l of a)o[l]=l;return o},e.getValidEnumValues=a=>{const o=e.objectKeys(a).filter(u=>typeof a[a[u]]!="number"),l={};for(const u of o)l[u]=a[u];return e.objectValues(l)},e.objectValues=a=>e.objectKeys(a).map(function(o){return a[o]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const o=[];for(const l in a)Object.prototype.hasOwnProperty.call(a,l)&&o.push(l);return o},e.find=(a,o)=>{for(const l of a)if(o(l))return l},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function r(a,o=" | "){return a.map(l=>typeof l=="string"?`'${l}'`:l).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(a,o)=>typeof o=="bigint"?o.toString():o})(en||(en={}));var fj;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(fj||(fj={}));const Ye=en.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_o=e=>{switch(typeof e){case"undefined":return Ye.undefined;case"string":return Ye.string;case"number":return Number.isNaN(e)?Ye.nan:Ye.number;case"boolean":return Ye.boolean;case"function":return Ye.function;case"bigint":return Ye.bigint;case"symbol":return Ye.symbol;case"object":return Array.isArray(e)?Ye.array:e===null?Ye.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Ye.promise:typeof Map<"u"&&e instanceof Map?Ye.map:typeof Set<"u"&&e instanceof Set?Ye.set:typeof Date<"u"&&e instanceof Date?Ye.date:Ye.object;default:return Ye.unknown}},Pe=en.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"]);class Ha extends Error{get errors(){return this.issues}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}format(t){const n=t||function(o){return o.message},r={_errors:[]},a=o=>{for(const l of o.issues)if(l.code==="invalid_union")l.unionErrors.map(a);else if(l.code==="invalid_return_type")a(l.returnTypeError);else if(l.code==="invalid_arguments")a(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 a of this.issues)if(a.path.length>0){const o=a.path[0];n[o]=n[o]||[],n[o].push(t(a))}else r.push(t(a));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Ha.create=e=>new Ha(e);const kb=(e,t)=>{let n;switch(e.code){case Pe.invalid_type:e.received===Ye.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Pe.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,en.jsonStringifyReplacer)}`;break;case Pe.unrecognized_keys:n=`Unrecognized key(s) in object: ${en.joinValues(e.keys,", ")}`;break;case Pe.invalid_union:n="Invalid input";break;case Pe.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${en.joinValues(e.options)}`;break;case Pe.invalid_enum_value:n=`Invalid enum value. Expected ${en.joinValues(e.options)}, received '${e.received}'`;break;case Pe.invalid_arguments:n="Invalid function arguments";break;case Pe.invalid_return_type:n="Invalid function return type";break;case Pe.invalid_date:n="Invalid date";break;case Pe.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}"`:en.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Pe.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==="bigint"?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 Pe.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 Pe.custom:n="Invalid input";break;case Pe.invalid_intersection_types:n="Intersection results could not be merged";break;case Pe.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Pe.not_finite:n="Number must be finite";break;default:n=t.defaultError,en.assertNever(e)}return{message:n}};let M8=kb;function _8(){return M8}const P8=e=>{const{data:t,path:n,errorMaps:r,issueData:a}=e,o=[...n,...a.path||[]],l={...a,path:o};if(a.message!==void 0)return{...a,path:o,message:a.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{...a,path:o,message:u}};function Ue(e,t){const n=_8(),r=P8({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===kb?void 0:kb].filter(a=>!!a)});e.common.issues.push(r)}class hs{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 a of n){if(a.status==="aborted")return jt;a.status==="dirty"&&t.dirty(),r.push(a.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const a of n){const o=await a.key,l=await a.value;r.push({key:o,value:l})}return hs.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const a of n){const{key:o,value:l}=a;if(o.status==="aborted"||l.status==="aborted")return jt;o.status==="dirty"&&t.dirty(),l.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof l.value<"u"||a.alwaysSet)&&(r[o.value]=l.value)}return{status:t.value,value:r}}}const jt=Object.freeze({status:"aborted"}),Vu=e=>({status:"dirty",value:e}),Os=e=>({status:"valid",value:e}),pj=e=>e.status==="aborted",hj=e=>e.status==="dirty",dc=e=>e.status==="valid",ih=e=>typeof Promise<"u"&&e instanceof Promise;var tt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(tt||(tt={}));class zo{constructor(t,n,r,a){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const mj=(e,t)=>{if(dc(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 Ha(e.common.issues);return this._error=n,this._error}}};function Bt(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:a}=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:a}:{errorMap:(l,u)=>{const{message:d}=e;return l.code==="invalid_enum_value"?{message:d??u.defaultError}:typeof u.data>"u"?{message:d??r??u.defaultError}:l.code!=="invalid_type"?{message:u.defaultError}:{message:d??n??u.defaultError}},description:a}}class Yt{get description(){return this._def.description}_getType(t){return _o(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:_o(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new hs,ctx:{common:t.parent.common,data:t.data,parsedType:_o(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(ih(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){const r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_o(t)},a=this._parseSync({data:t,path:r.path,parent:r});return mj(r,a)}"~validate"(t){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_o(t)};if(!this["~standard"].async)try{const r=this._parseSync({data:t,path:[],parent:n});return dc(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(r=>dc(r)?{value:r.value}:{issues:n.common.issues})}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:_o(t)},a=this._parse({data:t,path:r.path,parent:r}),o=await(ih(a)?a:Promise.resolve(a));return mj(r,o)}refine(t,n){const r=a=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(a):n;return this._refinement((a,o)=>{const l=t(a),u=()=>o.addIssue({code:Pe.custom,...r(a)});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,a)=>t(r)?!0:(a.addIssue(typeof n=="function"?n(r,a):n),!1))}_refinement(t){return new hc({schema:this,typeName:kt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}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),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Ao.create(this,this._def)}nullable(){return mc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ba.create(this)}promise(){return dh.create(this,this._def)}or(t){return ch.create([this,t],this._def)}and(t){return uh.create(this,t,this._def)}transform(t){return new hc({...Bt(this._def),schema:this,typeName:kt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Tb({...Bt(this._def),innerType:this,defaultValue:n,typeName:kt.ZodDefault})}brand(){return new eq({typeName:kt.ZodBranded,type:this,...Bt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Mb({...Bt(this._def),innerType:this,catchValue:n,typeName:kt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return dw.create(this,t)}readonly(){return _b.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const R8=/^c[^\s-]{8,}$/i,I8=/^[0-9a-z]+$/,O8=/^[0-9A-HJKMNP-TV-Z]{26}$/i,A8=/^[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,D8=/^[a-z0-9_-]{21}$/i,F8=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,L8=/^[-+]?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)?)??$/,$8=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,B8="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Zv;const z8=/^(?:(?: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])$/,U8=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,V8=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,q8=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,H8=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,W8=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,pP="((\\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])))",K8=new RegExp(`^${pP}$`);function hP(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function G8(e){return new RegExp(`^${hP(e)}$`)}function J8(e){let t=`${pP}T${hP(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 Q8(e,t){return!!((t==="v4"||!t)&&z8.test(e)||(t==="v6"||!t)&&V8.test(e))}function Y8(e,t){if(!F8.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),a=JSON.parse(atob(r));return!(typeof a!="object"||a===null||"typ"in a&&a?.typ!=="JWT"||!a.alg||t&&a.alg!==t)}catch{return!1}}function Z8(e,t){return!!((t==="v4"||!t)&&U8.test(e)||(t==="v6"||!t)&&q8.test(e))}class Fa extends Yt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Ye.string){const o=this._getOrReturnCtx(t);return Ue(o,{code:Pe.invalid_type,expected:Ye.string,received:o.parsedType}),jt}const r=new hs;let a;for(const o of this._def.checks)if(o.kind==="min")t.data.lengtho.value&&(a=this._getOrReturnCtx(t,a),Ue(a,{code:Pe.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(a),{validation:n,code:Pe.invalid_string,...tt.errToObj(r)})}_addCheck(t){return new Fa({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...tt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...tt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...tt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...tt.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...tt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...tt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...tt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...tt.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...tt.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...tt.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...tt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...tt.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...tt.errToObj(t)})}datetime(t){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:t?.offset??!1,local:t?.local??!1,...tt.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,...tt.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...tt.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...tt.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...tt.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...tt.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...tt.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...tt.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...tt.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...tt.errToObj(n)})}nonempty(t){return this.min(1,tt.errToObj(t))}trim(){return new Fa({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Fa({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Fa({...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 isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}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.valuenew Fa({checks:[],typeName:kt.ZodString,coerce:e?.coerce??!1,...Bt(e)});function X8(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,a=n>r?n:r,o=Number.parseInt(e.toFixed(a).replace(".","")),l=Number.parseInt(t.toFixed(a).replace(".",""));return o%l/10**a}class qi extends Yt{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)!==Ye.number){const o=this._getOrReturnCtx(t);return Ue(o,{code:Pe.invalid_type,expected:Ye.number,received:o.parsedType}),jt}let r;const a=new hs;for(const o of this._def.checks)o.kind==="int"?en.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Ue(r,{code:Pe.invalid_type,expected:"integer",received:"float",message:o.message}),a.dirty()):o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),Ue(r,{code:Pe.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),a.dirty()):o.kind==="multipleOf"?X8(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),Ue(r,{code:Pe.not_multiple_of,multipleOf:o.value,message:o.message}),a.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Ue(r,{code:Pe.not_finite,message:o.message}),a.dirty()):en.assertNever(o);return{status:a.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,tt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,tt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,tt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,tt.toString(n))}setLimit(t,n,r,a){return new qi({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:tt.toString(a)}]})}_addCheck(t){return new qi({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:tt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:tt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:tt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:tt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:tt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:tt.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:tt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:tt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:tt.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"&&en.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 qi({checks:[],typeName:kt.ZodNumber,coerce:e?.coerce||!1,...Bt(e)});class Hi extends Yt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Ye.bigint)return this._getInvalidInput(t);let r;const a=new hs;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),Ue(r,{code:Pe.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),a.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Ue(r,{code:Pe.not_multiple_of,multipleOf:o.value,message:o.message}),a.dirty()):en.assertNever(o);return{status:a.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return Ue(n,{code:Pe.invalid_type,expected:Ye.bigint,received:n.parsedType}),jt}gte(t,n){return this.setLimit("min",t,!0,tt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,tt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,tt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,tt.toString(n))}setLimit(t,n,r,a){return new Hi({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:tt.toString(a)}]})}_addCheck(t){return new Hi({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:tt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:tt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:tt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:tt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:tt.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.valuenew Hi({checks:[],typeName:kt.ZodBigInt,coerce:e?.coerce??!1,...Bt(e)});class lh extends Yt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Ye.boolean){const r=this._getOrReturnCtx(t);return Ue(r,{code:Pe.invalid_type,expected:Ye.boolean,received:r.parsedType}),jt}return Os(t.data)}}lh.create=e=>new lh({typeName:kt.ZodBoolean,coerce:e?.coerce||!1,...Bt(e)});class fc extends Yt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Ye.date){const o=this._getOrReturnCtx(t);return Ue(o,{code:Pe.invalid_type,expected:Ye.date,received:o.parsedType}),jt}if(Number.isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return Ue(o,{code:Pe.invalid_date}),jt}const r=new hs;let a;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()o.value&&(a=this._getOrReturnCtx(t,a),Ue(a,{code:Pe.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):en.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new fc({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:tt.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:tt.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 fc({checks:[],coerce:e?.coerce||!1,typeName:kt.ZodDate,...Bt(e)});class gj extends Yt{_parse(t){if(this._getType(t)!==Ye.symbol){const r=this._getOrReturnCtx(t);return Ue(r,{code:Pe.invalid_type,expected:Ye.symbol,received:r.parsedType}),jt}return Os(t.data)}}gj.create=e=>new gj({typeName:kt.ZodSymbol,...Bt(e)});class vj extends Yt{_parse(t){if(this._getType(t)!==Ye.undefined){const r=this._getOrReturnCtx(t);return Ue(r,{code:Pe.invalid_type,expected:Ye.undefined,received:r.parsedType}),jt}return Os(t.data)}}vj.create=e=>new vj({typeName:kt.ZodUndefined,...Bt(e)});class Eb extends Yt{_parse(t){if(this._getType(t)!==Ye.null){const r=this._getOrReturnCtx(t);return Ue(r,{code:Pe.invalid_type,expected:Ye.null,received:r.parsedType}),jt}return Os(t.data)}}Eb.create=e=>new Eb({typeName:kt.ZodNull,...Bt(e)});class yj extends Yt{constructor(){super(...arguments),this._any=!0}_parse(t){return Os(t.data)}}yj.create=e=>new yj({typeName:kt.ZodAny,...Bt(e)});class bj extends Yt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Os(t.data)}}bj.create=e=>new bj({typeName:kt.ZodUnknown,...Bt(e)});class Uo extends Yt{_parse(t){const n=this._getOrReturnCtx(t);return Ue(n,{code:Pe.invalid_type,expected:Ye.never,received:n.parsedType}),jt}}Uo.create=e=>new Uo({typeName:kt.ZodNever,...Bt(e)});class xj extends Yt{_parse(t){if(this._getType(t)!==Ye.undefined){const r=this._getOrReturnCtx(t);return Ue(r,{code:Pe.invalid_type,expected:Ye.void,received:r.parsedType}),jt}return Os(t.data)}}xj.create=e=>new xj({typeName:kt.ZodVoid,...Bt(e)});class ba extends Yt{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),a=this._def;if(n.parsedType!==Ye.array)return Ue(n,{code:Pe.invalid_type,expected:Ye.array,received:n.parsedType}),jt;if(a.exactLength!==null){const l=n.data.length>a.exactLength.value,u=n.data.lengtha.maxLength.value&&(Ue(n,{code:Pe.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((l,u)=>a.type._parseAsync(new zo(n,l,n.path,u)))).then(l=>hs.mergeArray(r,l));const o=[...n.data].map((l,u)=>a.type._parseSync(new zo(n,l,n.path,u)));return hs.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new ba({...this._def,minLength:{value:t,message:tt.toString(n)}})}max(t,n){return new ba({...this._def,maxLength:{value:t,message:tt.toString(n)}})}length(t,n){return new ba({...this._def,exactLength:{value:t,message:tt.toString(n)}})}nonempty(t){return this.min(1,t)}}ba.create=(e,t)=>new ba({type:e,minLength:null,maxLength:null,exactLength:null,typeName:kt.ZodArray,...Bt(t)});function ql(e){if(e instanceof Qn){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Ao.create(ql(r))}return new Qn({...e._def,shape:()=>t})}else return e instanceof ba?new ba({...e._def,type:ql(e.element)}):e instanceof Ao?Ao.create(ql(e.unwrap())):e instanceof mc?mc.create(ql(e.unwrap())):e instanceof Wi?Wi.create(e.items.map(t=>ql(t))):e}class Qn extends Yt{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=en.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==Ye.object){const f=this._getOrReturnCtx(t);return Ue(f,{code:Pe.invalid_type,expected:Ye.object,received:f.parsedType}),jt}const{status:r,ctx:a}=this._processInputParams(t),{shape:o,keys:l}=this._getCached(),u=[];if(!(this._def.catchall instanceof Uo&&this._def.unknownKeys==="strip"))for(const f in a.data)l.includes(f)||u.push(f);const d=[];for(const f of l){const m=o[f],h=a.data[f];d.push({key:{status:"valid",value:f},value:m._parse(new zo(a,h,a.path,f)),alwaysSet:f in a.data})}if(this._def.catchall instanceof Uo){const f=this._def.unknownKeys;if(f==="passthrough")for(const m of u)d.push({key:{status:"valid",value:m},value:{status:"valid",value:a.data[m]}});else if(f==="strict")u.length>0&&(Ue(a,{code:Pe.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 m of u){const h=a.data[m];d.push({key:{status:"valid",value:m},value:f._parse(new zo(a,h,a.path,m)),alwaysSet:m in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const f=[];for(const m of d){const h=await m.key,g=await m.value;f.push({key:h,value:g,alwaysSet:m.alwaysSet})}return f}).then(f=>hs.mergeObjectSync(r,f)):hs.mergeObjectSync(r,d)}get shape(){return this._def.shape()}strict(t){return tt.errToObj,new Qn({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{const a=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:tt.errToObj(t).message??a}:{message:a}}}:{}})}strip(){return new Qn({...this._def,unknownKeys:"strip"})}passthrough(){return new Qn({...this._def,unknownKeys:"passthrough"})}extend(t){return new Qn({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Qn({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:kt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Qn({...this._def,catchall:t})}pick(t){const n={};for(const r of en.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Qn({...this._def,shape:()=>n})}omit(t){const n={};for(const r of en.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new Qn({...this._def,shape:()=>n})}deepPartial(){return ql(this)}partial(t){const n={};for(const r of en.objectKeys(this.shape)){const a=this.shape[r];t&&!t[r]?n[r]=a:n[r]=a.optional()}return new Qn({...this._def,shape:()=>n})}required(t){const n={};for(const r of en.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Ao;)o=o._def.innerType;n[r]=o}return new Qn({...this._def,shape:()=>n})}keyof(){return mP(en.objectKeys(this.shape))}}Qn.create=(e,t)=>new Qn({shape:()=>e,unknownKeys:"strip",catchall:Uo.create(),typeName:kt.ZodObject,...Bt(t)});Qn.strictCreate=(e,t)=>new Qn({shape:()=>e,unknownKeys:"strict",catchall:Uo.create(),typeName:kt.ZodObject,...Bt(t)});Qn.lazycreate=(e,t)=>new Qn({shape:e,unknownKeys:"strip",catchall:Uo.create(),typeName:kt.ZodObject,...Bt(t)});class ch extends Yt{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function a(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 Ha(u.ctx.common.issues));return Ue(n,{code:Pe.invalid_union,unionErrors:l}),jt}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(a);{let o;const l=[];for(const d of r){const f={...n,common:{...n.common,issues:[]},parent:null},m=d._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!o&&(o={result:m,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 Ha(d));return Ue(n,{code:Pe.invalid_union,unionErrors:u}),jt}}get options(){return this._def.options}}ch.create=(e,t)=>new ch({options:e,typeName:kt.ZodUnion,...Bt(t)});function Nb(e,t){const n=_o(e),r=_o(t);if(e===t)return{valid:!0,data:e};if(n===Ye.object&&r===Ye.object){const a=en.objectKeys(t),o=en.objectKeys(e).filter(u=>a.indexOf(u)!==-1),l={...e,...t};for(const u of o){const d=Nb(e[u],t[u]);if(!d.valid)return{valid:!1};l[u]=d.data}return{valid:!0,data:l}}else if(n===Ye.array&&r===Ye.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let o=0;o{if(pj(o)||pj(l))return jt;const u=Nb(o.value,l.value);return u.valid?((hj(o)||hj(l))&&n.dirty(),{status:n.value,value:u.data}):(Ue(r,{code:Pe.invalid_intersection_types}),jt)};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])=>a(o,l)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}uh.create=(e,t,n)=>new uh({left:e,right:t,typeName:kt.ZodIntersection,...Bt(n)});class Wi extends Yt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ye.array)return Ue(r,{code:Pe.invalid_type,expected:Ye.array,received:r.parsedType}),jt;if(r.data.lengththis._def.items.length&&(Ue(r,{code:Pe.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 zo(r,l,r.path,u)):null}).filter(l=>!!l);return r.common.async?Promise.all(o).then(l=>hs.mergeArray(n,l)):hs.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new Wi({...this._def,rest:t})}}Wi.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Wi({items:e,typeName:kt.ZodTuple,rest:null,...Bt(t)})};class wj extends Yt{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!==Ye.map)return Ue(r,{code:Pe.invalid_type,expected:Ye.map,received:r.parsedType}),jt;const a=this._def.keyType,o=this._def.valueType,l=[...r.data.entries()].map(([u,d],f)=>({key:a._parse(new zo(r,u,r.path,[f,"key"])),value:o._parse(new zo(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,m=await d.value;if(f.status==="aborted"||m.status==="aborted")return jt;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const d of l){const f=d.key,m=d.value;if(f.status==="aborted"||m.status==="aborted")return jt;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}}}}wj.create=(e,t,n)=>new wj({valueType:t,keyType:e,typeName:kt.ZodMap,...Bt(n)});class ld extends Yt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ye.set)return Ue(r,{code:Pe.invalid_type,expected:Ye.set,received:r.parsedType}),jt;const a=this._def;a.minSize!==null&&r.data.sizea.maxSize.value&&(Ue(r,{code:Pe.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),n.dirty());const o=this._def.valueType;function l(d){const f=new Set;for(const m of d){if(m.status==="aborted")return jt;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const u=[...r.data.values()].map((d,f)=>o._parse(new zo(r,d,r.path,f)));return r.common.async?Promise.all(u).then(d=>l(d)):l(u)}min(t,n){return new ld({...this._def,minSize:{value:t,message:tt.toString(n)}})}max(t,n){return new ld({...this._def,maxSize:{value:t,message:tt.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}ld.create=(e,t)=>new ld({valueType:e,minSize:null,maxSize:null,typeName:kt.ZodSet,...Bt(t)});class Sj extends Yt{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})}}Sj.create=(e,t)=>new Sj({getter:e,typeName:kt.ZodLazy,...Bt(t)});class Cj extends Yt{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Ue(n,{received:n.data,code:Pe.invalid_literal,expected:this._def.value}),jt}return{status:"valid",value:t.data}}get value(){return this._def.value}}Cj.create=(e,t)=>new Cj({value:e,typeName:kt.ZodLiteral,...Bt(t)});function mP(e,t){return new pc({values:e,typeName:kt.ZodEnum,...Bt(t)})}class pc extends Yt{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Ue(n,{expected:en.joinValues(r),received:n.parsedType,code:Pe.invalid_type}),jt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return Ue(n,{received:n.data,code:Pe.invalid_enum_value,options:r}),jt}return Os(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 pc.create(t,{...this._def,...n})}exclude(t,n=this._def){return pc.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}pc.create=mP;class jj extends Yt{_parse(t){const n=en.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Ye.string&&r.parsedType!==Ye.number){const a=en.objectValues(n);return Ue(r,{expected:en.joinValues(a),received:r.parsedType,code:Pe.invalid_type}),jt}if(this._cache||(this._cache=new Set(en.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const a=en.objectValues(n);return Ue(r,{received:r.data,code:Pe.invalid_enum_value,options:a}),jt}return Os(t.data)}get enum(){return this._def.values}}jj.create=(e,t)=>new jj({values:e,typeName:kt.ZodNativeEnum,...Bt(t)});class dh extends Yt{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Ye.promise&&n.common.async===!1)return Ue(n,{code:Pe.invalid_type,expected:Ye.promise,received:n.parsedType}),jt;const r=n.parsedType===Ye.promise?n.data:Promise.resolve(n.data);return Os(r.then(a=>this._def.type.parseAsync(a,{path:n.path,errorMap:n.common.contextualErrorMap})))}}dh.create=(e,t)=>new dh({type:e,typeName:kt.ZodPromise,...Bt(t)});class hc extends Yt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===kt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=this._def.effect||null,o={addIssue:l=>{Ue(r,l),l.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),a.type==="preprocess"){const l=a.transform(r.data,o);if(r.common.async)return Promise.resolve(l).then(async u=>{if(n.value==="aborted")return jt;const d=await this._def.schema._parseAsync({data:u,path:r.path,parent:r});return d.status==="aborted"?jt:d.status==="dirty"||n.value==="dirty"?Vu(d.value):d});{if(n.value==="aborted")return jt;const u=this._def.schema._parseSync({data:l,path:r.path,parent:r});return u.status==="aborted"?jt:u.status==="dirty"||n.value==="dirty"?Vu(u.value):u}}if(a.type==="refinement"){const l=u=>{const d=a.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"?jt:(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"?jt:(u.status==="dirty"&&n.dirty(),l(u.value).then(()=>({status:n.value,value:u.value}))))}if(a.type==="transform")if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!dc(l))return jt;const u=a.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=>dc(l)?Promise.resolve(a.transform(l.value,o)).then(u=>({status:n.value,value:u})):jt);en.assertNever(a)}}hc.create=(e,t,n)=>new hc({schema:e,typeName:kt.ZodEffects,effect:t,...Bt(n)});hc.createWithPreprocess=(e,t,n)=>new hc({schema:t,effect:{type:"preprocess",transform:e},typeName:kt.ZodEffects,...Bt(n)});class Ao extends Yt{_parse(t){return this._getType(t)===Ye.undefined?Os(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Ao.create=(e,t)=>new Ao({innerType:e,typeName:kt.ZodOptional,...Bt(t)});class mc extends Yt{_parse(t){return this._getType(t)===Ye.null?Os(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}mc.create=(e,t)=>new mc({innerType:e,typeName:kt.ZodNullable,...Bt(t)});class Tb extends Yt{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Ye.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Tb.create=(e,t)=>new Tb({innerType:e,typeName:kt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Bt(t)});class Mb extends Yt{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return ih(a)?a.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ha(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Ha(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Mb.create=(e,t)=>new Mb({innerType:e,typeName:kt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Bt(t)});class kj extends Yt{_parse(t){if(this._getType(t)!==Ye.nan){const r=this._getOrReturnCtx(t);return Ue(r,{code:Pe.invalid_type,expected:Ye.nan,received:r.parsedType}),jt}return{status:"valid",value:t.data}}}kj.create=e=>new kj({typeName:kt.ZodNaN,...Bt(e)});class eq extends Yt{_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 dw extends Yt{_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"?jt:o.status==="dirty"?(n.dirty(),Vu(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?jt:a.status==="dirty"?(n.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(t,n){return new dw({in:t,out:n,typeName:kt.ZodPipeline})}}class _b extends Yt{_parse(t){const n=this._def.innerType._parse(t),r=a=>(dc(a)&&(a.value=Object.freeze(a.value)),a);return ih(n)?n.then(a=>r(a)):r(n)}unwrap(){return this._def.innerType}}_b.create=(e,t)=>new _b({innerType:e,typeName:kt.ZodReadonly,...Bt(t)});var kt;(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"})(kt||(kt={}));const he=Fa.create;qi.create;Hi.create;const Me=lh.create;fc.create;const Tc=Eb.create;Uo.create;const As=ba.create,hn=Qn.create,Mc=ch.create;uh.create;Wi.create;const fw=pc.create;dh.create;Ao.create;mc.create;const at={string:(e=>Fa.create({...e,coerce:!0})),number:(e=>qi.create({...e,coerce:!0})),boolean:(e=>lh.create({...e,coerce:!0})),bigint:(e=>Hi.create({...e,coerce:!0})),date:(e=>fc.create({...e,coerce:!0}))};function Ej(e,[t,n]){return Math.min(n,Math.max(t,e))}function pw(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 gP=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"}),tq="VisuallyHidden",nq=y.forwardRef((e,t)=>s.jsx(wt.span,{...e,ref:t,style:{...gP,...e.style}}));nq.displayName=tq;var rq=[" ","Enter","ArrowUp","ArrowDown"],sq=[" ","Enter"],Ki="Select",[sm,am,aq]=Rx(Ki),[_c]=ra(Ki,[aq,Wh]),om=Wh(),[oq,ti]=_c(Ki),[iq,lq]=_c(Ki),vP=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:o,value:l,defaultValue:u,onValueChange:d,dir:f,name:m,autoComplete:h,disabled:g,required:x,form:b}=e,w=om(t),[C,k]=y.useState(null),[N,T]=y.useState(null),[_,P]=y.useState(!1),M=Vh(f),[O,D]=Ua({prop:r,defaultProp:a??!1,onChange:o,caller:Ki}),[F,$]=Ua({prop:l,defaultProp:u,onChange:d,caller:Ki}),te=y.useRef(null),z=C?b||!!C.closest("form"):!0,[ue,V]=y.useState(new Set),ne=Array.from(ue).map(Y=>Y.props.value).join(";");return s.jsx(AM,{...w,children:s.jsxs(oq,{required:x,scope:t,trigger:C,onTriggerChange:k,valueNode:N,onValueNodeChange:T,valueNodeHasChildren:_,onValueNodeHasChildrenChange:P,contentId:Qs(),value:F,onValueChange:$,open:O,onOpenChange:D,dir:M,triggerPointerDownPosRef:te,disabled:g,children:[s.jsx(sm.Provider,{scope:t,children:s.jsx(iq,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(Y=>{V(se=>new Set(se).add(Y))},[]),onNativeOptionRemove:y.useCallback(Y=>{V(se=>{const H=new Set(se);return H.delete(Y),H})},[]),children:n})}),z?s.jsxs($P,{"aria-hidden":!0,required:x,tabIndex:-1,name:m,autoComplete:h,value:F,onChange:Y=>$(Y.target.value),disabled:g,form:b,children:[F===void 0?s.jsx("option",{value:""}):null,Array.from(ue)]},ne):null]})})};vP.displayName=Ki;var yP="SelectTrigger",bP=y.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,o=om(n),l=ti(yP,n),u=l.disabled||r,d=tn(t,l.onTriggerChange),f=am(n),m=y.useRef("touch"),[h,g,x]=zP(w=>{const C=f().filter(T=>!T.disabled),k=C.find(T=>T.value===l.value),N=UP(C,w,k);N!==void 0&&l.onValueChange(N.value)}),b=w=>{u||(l.onOpenChange(!0),x()),w&&(l.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return s.jsx(DM,{asChild:!0,...o,children:s.jsx(wt.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":BP(l.value)?"":void 0,...a,ref:d,onClick:Ge(a.onClick,w=>{w.currentTarget.focus(),m.current!=="mouse"&&b(w)}),onPointerDown:Ge(a.onPointerDown,w=>{m.current=w.pointerType;const C=w.target;C.hasPointerCapture(w.pointerId)&&C.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(b(w),w.preventDefault())}),onKeyDown:Ge(a.onKeyDown,w=>{const C=h.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&g(w.key),!(C&&w.key===" ")&&rq.includes(w.key)&&(b(),w.preventDefault())})})})});bP.displayName=yP;var xP="SelectValue",wP=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:o,placeholder:l="",...u}=e,d=ti(xP,n),{onValueNodeHasChildrenChange:f}=d,m=o!==void 0,h=tn(t,d.onValueNodeChange);return er(()=>{f(m)},[f,m]),s.jsx(wt.span,{...u,ref:h,style:{pointerEvents:"none"},children:BP(d.value)?s.jsx(s.Fragment,{children:l}):o})});wP.displayName=xP;var cq="SelectIcon",SP=y.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return s.jsx(wt.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});SP.displayName=cq;var uq="SelectPortal",CP=e=>s.jsx(Fh,{asChild:!0,...e});CP.displayName=uq;var Gi="SelectContent",jP=y.forwardRef((e,t)=>{const n=ti(Gi,e.__scopeSelect),[r,a]=y.useState();if(er(()=>{a(new DocumentFragment)},[]),!n.open){const o=r;return o?bc.createPortal(s.jsx(kP,{scope:e.__scopeSelect,children:s.jsx(sm.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),o):null}return s.jsx(EP,{...e,ref:t})});jP.displayName=Gi;var qs=10,[kP,ni]=_c(Gi),dq="SelectContentImpl",fq=ic("SelectContent.RemoveScroll"),EP=y.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:o,onPointerDownOutside:l,side:u,sideOffset:d,align:f,alignOffset:m,arrowPadding:h,collisionBoundary:g,collisionPadding:x,sticky:b,hideWhenDetached:w,avoidCollisions:C,...k}=e,N=ti(Gi,n),[T,_]=y.useState(null),[P,M]=y.useState(null),O=tn(t,j=>_(j)),[D,F]=y.useState(null),[$,te]=y.useState(null),z=am(n),[ue,V]=y.useState(!1),ne=y.useRef(!1);y.useEffect(()=>{if(T)return jx(T)},[T]),Cx();const Y=y.useCallback(j=>{const[I,...me]=z().map(Je=>Je.ref.current),[xe]=me.slice(-1),rt=document.activeElement;for(const Je of j)if(Je===rt||(Je?.scrollIntoView({block:"nearest"}),Je===I&&P&&(P.scrollTop=0),Je===xe&&P&&(P.scrollTop=P.scrollHeight),Je?.focus(),document.activeElement!==rt))return},[z,P]),se=y.useCallback(()=>Y([D,T]),[Y,D,T]);y.useEffect(()=>{ue&&se()},[ue,se]);const{onOpenChange:H,triggerPointerDownPosRef:W}=N;y.useEffect(()=>{if(T){let j={x:0,y:0};const I=xe=>{j={x:Math.abs(Math.round(xe.pageX)-(W.current?.x??0)),y:Math.abs(Math.round(xe.pageY)-(W.current?.y??0))}},me=xe=>{j.x<=10&&j.y<=10?xe.preventDefault():T.contains(xe.target)||H(!1),document.removeEventListener("pointermove",I),W.current=null};return W.current!==null&&(document.addEventListener("pointermove",I),document.addEventListener("pointerup",me,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",I),document.removeEventListener("pointerup",me,{capture:!0})}}},[T,H,W]),y.useEffect(()=>{const j=()=>H(!1);return window.addEventListener("blur",j),window.addEventListener("resize",j),()=>{window.removeEventListener("blur",j),window.removeEventListener("resize",j)}},[H]);const[U,A]=zP(j=>{const I=z().filter(rt=>!rt.disabled),me=I.find(rt=>rt.ref.current===document.activeElement),xe=UP(I,j,me);xe&&setTimeout(()=>xe.ref.current.focus())}),K=y.useCallback((j,I,me)=>{const xe=!ne.current&&!me;(N.value!==void 0&&N.value===I||xe)&&(F(j),xe&&(ne.current=!0))},[N.value]),re=y.useCallback(()=>T?.focus(),[T]),ee=y.useCallback((j,I,me)=>{const xe=!ne.current&&!me;(N.value!==void 0&&N.value===I||xe)&&te(j)},[N.value]),ie=r==="popper"?Pb:NP,de=ie===Pb?{side:u,sideOffset:d,align:f,alignOffset:m,arrowPadding:h,collisionBoundary:g,collisionPadding:x,sticky:b,hideWhenDetached:w,avoidCollisions:C}:{};return s.jsx(kP,{scope:n,content:T,viewport:P,onViewportChange:M,itemRefCallback:K,selectedItem:D,onItemLeave:re,itemTextRefCallback:ee,focusSelectedItem:se,selectedItemText:$,position:r,isPositioned:ue,searchRef:U,children:s.jsx($h,{as:fq,allowPinchZoom:!0,children:s.jsx(Dh,{asChild:!0,trapped:N.open,onMountAutoFocus:j=>{j.preventDefault()},onUnmountAutoFocus:Ge(a,j=>{N.trigger?.focus({preventScroll:!0}),j.preventDefault()}),children:s.jsx(Ah,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:j=>j.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:s.jsx(ie,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:j=>j.preventDefault(),...k,...de,onPlaced:()=>V(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...k.style},onKeyDown:Ge(k.onKeyDown,j=>{const I=j.ctrlKey||j.altKey||j.metaKey;if(j.key==="Tab"&&j.preventDefault(),!I&&j.key.length===1&&A(j.key),["ArrowUp","ArrowDown","Home","End"].includes(j.key)){let xe=z().filter(rt=>!rt.disabled).map(rt=>rt.ref.current);if(["ArrowUp","End"].includes(j.key)&&(xe=xe.slice().reverse()),["ArrowUp","ArrowDown"].includes(j.key)){const rt=j.target,Je=xe.indexOf(rt);xe=xe.slice(Je+1)}setTimeout(()=>Y(xe)),j.preventDefault()}})})})})})})});EP.displayName=dq;var pq="SelectItemAlignedPosition",NP=y.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,o=ti(Gi,n),l=ni(Gi,n),[u,d]=y.useState(null),[f,m]=y.useState(null),h=tn(t,O=>m(O)),g=am(n),x=y.useRef(!1),b=y.useRef(!0),{viewport:w,selectedItem:C,selectedItemText:k,focusSelectedItem:N}=l,T=y.useCallback(()=>{if(o.trigger&&o.valueNode&&u&&f&&w&&C&&k){const O=o.trigger.getBoundingClientRect(),D=f.getBoundingClientRect(),F=o.valueNode.getBoundingClientRect(),$=k.getBoundingClientRect();if(o.dir!=="rtl"){const rt=$.left-D.left,Je=F.left-rt,nt=O.left-Je,qt=O.width+nt,Wn=Math.max(qt,D.width),Pn=window.innerWidth-qs,tr=Ej(Je,[qs,Math.max(qs,Pn-Wn)]);u.style.minWidth=qt+"px",u.style.left=tr+"px"}else{const rt=D.right-$.right,Je=window.innerWidth-F.right-rt,nt=window.innerWidth-O.right-Je,qt=O.width+nt,Wn=Math.max(qt,D.width),Pn=window.innerWidth-qs,tr=Ej(Je,[qs,Math.max(qs,Pn-Wn)]);u.style.minWidth=qt+"px",u.style.right=tr+"px"}const te=g(),z=window.innerHeight-qs*2,ue=w.scrollHeight,V=window.getComputedStyle(f),ne=parseInt(V.borderTopWidth,10),Y=parseInt(V.paddingTop,10),se=parseInt(V.borderBottomWidth,10),H=parseInt(V.paddingBottom,10),W=ne+Y+ue+H+se,U=Math.min(C.offsetHeight*5,W),A=window.getComputedStyle(w),K=parseInt(A.paddingTop,10),re=parseInt(A.paddingBottom,10),ee=O.top+O.height/2-qs,ie=z-ee,de=C.offsetHeight/2,j=C.offsetTop+de,I=ne+Y+j,me=W-I;if(I<=ee){const rt=te.length>0&&C===te[te.length-1].ref.current;u.style.bottom="0px";const Je=f.clientHeight-w.offsetTop-w.offsetHeight,nt=Math.max(ie,de+(rt?re:0)+Je+se),qt=I+nt;u.style.height=qt+"px"}else{const rt=te.length>0&&C===te[0].ref.current;u.style.top="0px";const nt=Math.max(ee,ne+w.offsetTop+(rt?K:0)+de)+me;u.style.height=nt+"px",w.scrollTop=I-ee+w.offsetTop}u.style.margin=`${qs}px 0`,u.style.minHeight=U+"px",u.style.maxHeight=z+"px",r?.(),requestAnimationFrame(()=>x.current=!0)}},[g,o.trigger,o.valueNode,u,f,w,C,k,o.dir,r]);er(()=>T(),[T]);const[_,P]=y.useState();er(()=>{f&&P(window.getComputedStyle(f).zIndex)},[f]);const M=y.useCallback(O=>{O&&b.current===!0&&(T(),N?.(),b.current=!1)},[T,N]);return s.jsx(mq,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:x,onScrollButtonChange:M,children:s.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:s.jsx(wt.div,{...a,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});NP.displayName=pq;var hq="SelectPopperPosition",Pb=y.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=qs,...o}=e,l=om(n);return s.jsx(FM,{...l,...o,ref:t,align:r,collisionPadding:a,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)"}})});Pb.displayName=hq;var[mq,hw]=_c(Gi,{}),Rb="SelectViewport",TP=y.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,o=ni(Rb,n),l=hw(Rb,n),u=tn(t,o.onViewportChange),d=y.useRef(0);return s.jsxs(s.Fragment,{children:[s.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}),s.jsx(sm.Slot,{scope:n,children:s.jsx(wt.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Ge(a.onScroll,f=>{const m=f.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:g}=l;if(g?.current&&h){const x=Math.abs(d.current-m.scrollTop);if(x>0){const b=window.innerHeight-qs*2,w=parseFloat(h.style.minHeight),C=parseFloat(h.style.height),k=Math.max(w,C);if(k0?_:0,h.style.justifyContent="flex-end")}}}d.current=m.scrollTop})})})]})});TP.displayName=Rb;var MP="SelectGroup",[gq,vq]=_c(MP),yq=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Qs();return s.jsx(gq,{scope:n,id:a,children:s.jsx(wt.div,{role:"group","aria-labelledby":a,...r,ref:t})})});yq.displayName=MP;var _P="SelectLabel",bq=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=vq(_P,n);return s.jsx(wt.div,{id:a.id,...r,ref:t})});bq.displayName=_P;var fh="SelectItem",[xq,PP]=_c(fh),RP=y.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:o,...l}=e,u=ti(fh,n),d=ni(fh,n),f=u.value===r,[m,h]=y.useState(o??""),[g,x]=y.useState(!1),b=tn(t,N=>d.itemRefCallback?.(N,r,a)),w=Qs(),C=y.useRef("touch"),k=()=>{a||(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 s.jsx(xq,{scope:n,value:r,disabled:a,textId:w,isSelected:f,onItemTextChange:y.useCallback(N=>{h(T=>T||(N?.textContent??"").trim())},[]),children:s.jsx(sm.ItemSlot,{scope:n,value:r,disabled:a,textValue:m,children:s.jsx(wt.div,{role:"option","aria-labelledby":w,"data-highlighted":g?"":void 0,"aria-selected":f&&g,"data-state":f?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...l,ref:b,onFocus:Ge(l.onFocus,()=>x(!0)),onBlur:Ge(l.onBlur,()=>x(!1)),onClick:Ge(l.onClick,()=>{C.current!=="mouse"&&k()}),onPointerUp:Ge(l.onPointerUp,()=>{C.current==="mouse"&&k()}),onPointerDown:Ge(l.onPointerDown,N=>{C.current=N.pointerType}),onPointerMove:Ge(l.onPointerMove,N=>{C.current=N.pointerType,a?d.onItemLeave?.():C.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ge(l.onPointerLeave,N=>{N.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:Ge(l.onKeyDown,N=>{d.searchRef?.current!==""&&N.key===" "||(sq.includes(N.key)&&k(),N.key===" "&&N.preventDefault())})})})})});RP.displayName=fh;var qu="SelectItemText",IP=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...o}=e,l=ti(qu,n),u=ni(qu,n),d=PP(qu,n),f=lq(qu,n),[m,h]=y.useState(null),g=tn(t,k=>h(k),d.onItemTextChange,k=>u.itemTextRefCallback?.(k,d.value,d.disabled)),x=m?.textContent,b=y.useMemo(()=>s.jsx("option",{value:d.value,disabled:d.disabled,children:x},d.value),[d.disabled,d.value,x]),{onNativeOptionAdd:w,onNativeOptionRemove:C}=f;return er(()=>(w(b),()=>C(b)),[w,C,b]),s.jsxs(s.Fragment,{children:[s.jsx(wt.span,{id:d.textId,...o,ref:g}),d.isSelected&&l.valueNode&&!l.valueNodeHasChildren?bc.createPortal(o.children,l.valueNode):null]})});IP.displayName=qu;var OP="SelectItemIndicator",AP=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return PP(OP,n).isSelected?s.jsx(wt.span,{"aria-hidden":!0,...r,ref:t}):null});AP.displayName=OP;var Ib="SelectScrollUpButton",DP=y.forwardRef((e,t)=>{const n=ni(Ib,e.__scopeSelect),r=hw(Ib,e.__scopeSelect),[a,o]=y.useState(!1),l=tn(t,r.onScrollButtonChange);return er(()=>{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]),a?s.jsx(LP,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=n;u&&d&&(u.scrollTop=u.scrollTop-d.offsetHeight)}}):null});DP.displayName=Ib;var Ob="SelectScrollDownButton",FP=y.forwardRef((e,t)=>{const n=ni(Ob,e.__scopeSelect),r=hw(Ob,e.__scopeSelect),[a,o]=y.useState(!1),l=tn(t,r.onScrollButtonChange);return er(()=>{if(n.viewport&&n.isPositioned){let u=function(){const f=d.scrollHeight-d.clientHeight,m=Math.ceil(d.scrollTop)d.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),a?s.jsx(LP,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=n;u&&d&&(u.scrollTop=u.scrollTop+d.offsetHeight)}}):null});FP.displayName=Ob;var LP=y.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,o=ni("SelectScrollButton",n),l=y.useRef(null),u=am(n),d=y.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return y.useEffect(()=>()=>d(),[d]),er(()=>{u().find(m=>m.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[u]),s.jsx(wt.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:Ge(a.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:Ge(a.onPointerMove,()=>{o.onItemLeave?.(),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:Ge(a.onPointerLeave,()=>{d()})})}),wq="SelectSeparator",Sq=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return s.jsx(wt.div,{"aria-hidden":!0,...r,ref:t})});Sq.displayName=wq;var Ab="SelectArrow",Cq=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=om(n),o=ti(Ab,n),l=ni(Ab,n);return o.open&&l.position==="popper"?s.jsx(LM,{...a,...r,ref:t}):null});Cq.displayName=Ab;var jq="SelectBubbleInput",$P=y.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=y.useRef(null),o=tn(r,a),l=pw(t);return y.useEffect(()=>{const u=a.current;if(!u)return;const d=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(d,"value").set;if(l!==t&&m){const h=new Event("change",{bubbles:!0});m.call(u,t),u.dispatchEvent(h)}},[l,t]),s.jsx(wt.select,{...n,style:{...gP,...n.style},ref:o,defaultValue:t})});$P.displayName=jq;function BP(e){return e===""||e===void 0}function zP(e){const t=Xs(e),n=y.useRef(""),r=y.useRef(0),a=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,a,o]}function UP(e,t,n){const a=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=kq(e,Math.max(o,0));a.length===1&&(l=l.filter(f=>f!==n));const d=l.find(f=>f.textValue.toLowerCase().startsWith(a.toLowerCase()));return d!==n?d:void 0}function kq(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Eq=vP,Nq=bP,Tq=wP,Mq=SP,_q=CP,Pq=jP,Rq=TP,Iq=RP,Oq=IP,Aq=AP,Dq=DP,Fq=FP;function _t({...e}){return s.jsx(Eq,{"data-slot":"select",...e})}function Pt({...e}){return s.jsx(Tq,{"data-slot":"select-value",...e})}function Rt({className:e,size:t="default",children:n,...r}){return s.jsxs(Nq,{"data-slot":"select-trigger","data-size":t,className:Et("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,s.jsx(Mq,{asChild:!0,children:s.jsx(T_,{className:"size-4 opacity-50"})})]})}function It({className:e,children:t,position:n="popper",...r}){return s.jsx(_q,{children:s.jsxs(Pq,{"data-slot":"select-content",className:Et("bg-popover text-popover-foreground 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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",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:[s.jsx(Lq,{}),s.jsx(Rq,{className:Et("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),s.jsx($q,{})]})})}function we({className:e,children:t,...n}){return s.jsxs(Iq,{"data-slot":"select-item",className:Et("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[s.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:s.jsx(Aq,{children:s.jsx(Jx,{className:"size-4"})})}),s.jsx(Oq,{children:t})]})}function Lq({className:e,...t}){return s.jsx(Dq,{"data-slot":"select-scroll-up-button",className:Et("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(Q6,{className:"size-4"})})}function $q({className:e,...t}){return s.jsx(Fq,{"data-slot":"select-scroll-down-button",className:Et("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(T_,{className:"size-4"})})}var im="Switch",[Bq]=ra(im),[zq,Uq]=Bq(im),VP=y.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:a,defaultChecked:o,required:l,disabled:u,value:d="on",onCheckedChange:f,form:m,...h}=e,[g,x]=y.useState(null),b=tn(t,T=>x(T)),w=y.useRef(!1),C=g?m||!!g.closest("form"):!0,[k,N]=Ua({prop:a,defaultProp:o??!1,onChange:f,caller:im});return s.jsxs(zq,{scope:n,checked:k,disabled:u,children:[s.jsx(wt.button,{type:"button",role:"switch","aria-checked":k,"aria-required":l,"data-state":KP(k),"data-disabled":u?"":void 0,disabled:u,value:d,...h,ref:b,onClick:Ge(e.onClick,T=>{N(_=>!_),C&&(w.current=T.isPropagationStopped(),w.current||T.stopPropagation())})}),C&&s.jsx(WP,{control:g,bubbles:!w.current,name:r,value:d,checked:k,required:l,disabled:u,form:m,style:{transform:"translateX(-100%)"}})]})});VP.displayName=im;var qP="SwitchThumb",HP=y.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,a=Uq(qP,n);return s.jsx(wt.span,{"data-state":KP(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})});HP.displayName=qP;var Vq="SwitchBubbleInput",WP=y.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...a},o)=>{const l=y.useRef(null),u=tn(l,o),d=pw(n),f=$x(t);return y.useEffect(()=>{const m=l.current;if(!m)return;const h=window.HTMLInputElement.prototype,x=Object.getOwnPropertyDescriptor(h,"checked").set;if(d!==n&&x){const b=new Event("click",{bubbles:r});x.call(m,n),m.dispatchEvent(b)}},[d,n,r]),s.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:u,style:{...a.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});WP.displayName=Vq;function KP(e){return e?"checked":"unchecked"}var qq=VP,Hq=HP;function Ed({className:e,...t}){return s.jsx(qq,{"data-slot":"switch",className:Et("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:s.jsx(Hq,{"data-slot":"switch-thumb",className:Et("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}var GP=y.createContext({dragDropManager:void 0}),Ts;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Ts||(Ts={}));function Mt(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),a=2;a-1})}var Qq={type:mw,payload:{clientOffset:null,sourceClientOffset:null}};function Yq(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},a=r.publishSource,o=a===void 0?!0:a,l=r.clientOffset,u=r.getSourceClientOffset,d=e.getMonitor(),f=e.getRegistry();e.dispatch(Nj(l)),Zq(n,d,f);var m=tH(n,d);if(m===null){e.dispatch(Qq);return}var h=null;if(l){if(!u)throw new Error("getSourceClientOffset must be defined");Xq(u),h=u(m)}e.dispatch(Nj(l,h));var g=f.getSource(m),x=g.beginDrag(d,m);if(x!=null){eH(x),f.pinSource(m);var b=f.getSourceType(m);return{type:lm,payload:{itemType:b,item:x,sourceId:m,clientOffset:l||null,sourceClientOffset:h||null,isSourcePublic:!!o}}}}}function Zq(e,t,n){Mt(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(r){Mt(n.getSource(r),"Expected sourceIds to be registered.")})}function Xq(e){Mt(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function eH(e){Mt(JP(e),"Item must be an object.")}function tH(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 nH(e){return function(){var n=e.getMonitor();if(n.isDragging())return{type:gw}}}function Db(e,t){return t===null?e===null:Array.isArray(e)?e.some(function(n){return n===t}):e===t}function rH(e){return function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=r.clientOffset;sH(n);var o=n.slice(0),l=e.getMonitor(),u=e.getRegistry();aH(o,l,u);var d=l.getItemType();return oH(o,u,d),iH(o,l,u),{type:cm,payload:{targetIds:o,clientOffset:a||null}}}}function sH(e){Mt(Array.isArray(e),"Expected targetIds to be an array.")}function aH(e,t,n){Mt(t.isDragging(),"Cannot call hover while not dragging."),Mt(!t.didDrop(),"Cannot call hover after drop.");for(var r=0;r=0;r--){var a=e[r],o=t.getTargetType(a);Db(o,n)||e.splice(r,1)}}function iH(e,t,n){e.forEach(function(r){var a=n.getTarget(r);a.hover(t,r)})}function Tj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Mj(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{},r=e.getMonitor(),a=e.getRegistry();uH(r);var o=pH(r);o.forEach(function(l,u){var d=dH(l,u,a,r),f={type:um,payload:{dropResult:Mj(Mj({},n),d)}};e.dispatch(f)})}}function uH(e){Mt(e.isDragging(),"Cannot call drop while not dragging."),Mt(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function dH(e,t,n,r){var a=n.getTarget(e),o=a?a.drop(r,e):void 0;return fH(o),typeof o>"u"&&(o=t===0?{}:r.getDropResult()),o}function fH(e){Mt(typeof e>"u"||JP(e),"Drop result must either be an object or undefined.")}function pH(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function hH(e){return function(){var n=e.getMonitor(),r=e.getRegistry();mH(n);var a=n.getSourceId();if(a!=null){var o=r.getSource(a,!0);o.endDrag(n,a),r.unpinSource()}return{type:dm}}}function mH(e){Mt(e.isDragging(),"Cannot call endDrag while not dragging.")}function gH(e){return{beginDrag:Yq(e),publishDragSource:nH(e),hover:rH(e),drop:cH(e),endDrag:hH(e)}}function vH(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yH(e,t){for(var n=0;n0;r.backend&&(a&&!r.isSetUp?(r.backend.setup(),r.isSetUp=!0):!a&&r.isSetUp&&(r.backend.teardown(),r.isSetUp=!1))}),this.store=t,this.monitor=n,t.subscribe(this.handleRefCountChange)}return bH(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 a(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(ks(1));return n(QP)(e,t)}if(typeof e!="function")throw new Error(ks(2));var a=e,o=t,l=[],u=l,d=!1;function f(){u===l&&(u=l.slice())}function m(){if(d)throw new Error(ks(3));return o}function h(w){if(typeof w!="function")throw new Error(ks(4));if(d)throw new Error(ks(5));var C=!0;return f(),u.push(w),function(){if(C){if(d)throw new Error(ks(6));C=!1,f();var N=u.indexOf(w);u.splice(N,1),l=null}}}function g(w){if(!wH(w))throw new Error(ks(7));if(typeof w.type>"u")throw new Error(ks(8));if(d)throw new Error(ks(9));try{d=!0,o=a(o,w)}finally{d=!1}for(var C=l=u,k=0;k2&&arguments[2]!==void 0?arguments[2]:SH;if(e.length!==t.length)return!1;for(var r=0;r0&&arguments[0]!==void 0?arguments[0]:Aj,t=arguments.length>1?arguments[1]:void 0,n=t.payload;switch(t.type){case mw:case lm:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case cm:return CH(e.clientOffset,n.clientOffset)?e:Oj(Oj({},e),{},{clientOffset:n.clientOffset});case dm:case um:return Aj;default:return e}}var vw="dnd-core/ADD_SOURCE",yw="dnd-core/ADD_TARGET",bw="dnd-core/REMOVE_SOURCE",fm="dnd-core/REMOVE_TARGET";function NH(e){return{type:vw,payload:{sourceId:e}}}function TH(e){return{type:yw,payload:{targetId:e}}}function MH(e){return{type:bw,payload:{sourceId:e}}}function _H(e){return{type:fm,payload:{targetId:e}}}function Dj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Es(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 lm:return Es(Es({},e),{},{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case gw:return Es(Es({},e),{},{isSourcePublic:!0});case cm:return Es(Es({},e),{},{targetIds:n.targetIds});case fm:return e.targetIds.indexOf(n.targetId)===-1?e:Es(Es({},e),{},{targetIds:Kq(e.targetIds,n.targetId)});case um:return Es(Es({},e),{},{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case dm:return Es(Es({},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 vw:case yw:return e+1;case bw:case fm:return e-1;default:return e}}var ph=[],xw=[];ph.__IS_NONE__=!0;xw.__IS_ALL__=!0;function AH(e,t){if(e===ph)return!1;if(e===xw||typeof t>"u")return!0;var n=Jq(t,e);return n.length>0}function DH(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case cm:break;case vw:case yw:case fm:case bw:return ph;case lm:case gw:case dm:case um:default:return xw}var t=e.payload,n=t.targetIds,r=n===void 0?[]:n,a=t.prevTargetIds,o=a===void 0?[]:a,l=Gq(r,o),u=l.length>0||!jH(r,o);if(!u)return ph;var d=o[o.length-1],f=r[r.length-1];return d!==f&&(d&&l.push(d),f&&l.push(f)),l}function FH(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e+1}function Fj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Lj(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:DH(e.dirtyHandlerIds,{type:t.type,payload:Lj(Lj({},t.payload),{},{prevTargetIds:Wq(e,"dragOperation.targetIds",[])})}),dragOffset:EH(e.dragOffset,t),refCount:OH(e.refCount,t),dragOperation:IH(e.dragOperation,t),stateId:FH(e.stateId)}}function BH(e,t){return{x:e.x+t.x,y:e.y+t.y}}function YP(e,t){return{x:e.x-t.x,y:e.y-t.y}}function zH(e){var t=e.clientOffset,n=e.initialClientOffset,r=e.initialSourceClientOffset;return!t||!n||!r?null:YP(BH(t,r),n)}function UH(e){var t=e.clientOffset,n=e.initialClientOffset;return!t||!n?null:YP(t,n)}function VH(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qH(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0},o=a.handlerIds;Mt(typeof n=="function","listener must be a function."),Mt(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(),m=f.stateId;try{var h=m===l||m===l+1&&!AH(f.dirtyHandlerIds,o);h||n()}finally{l=m}};return this.store.subscribe(u)}},{key:"subscribeToOffsetChange",value:function(n){var r=this;Mt(typeof n=="function","listener must be a function.");var a=this.store.getState().dragOffset,o=function(){var u=r.store.getState().dragOffset;u!==a&&(a=u,n())};return this.store.subscribe(o)}},{key:"canDragSource",value:function(n){if(!n)return!1;var r=this.registry.getSource(n);return Mt(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(Mt(r,"Expected to find a valid target. targetId=".concat(n)),!this.isDragging()||this.didDrop())return!1;var a=this.registry.getTargetType(n),o=this.getItemType();return Db(a,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(Mt(r,"Expected to find a valid source. sourceId=".concat(n)),!this.isDragging()||!this.isSourcePublic())return!1;var a=this.registry.getSourceType(n),o=this.getItemType();return a!==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 a=r.shallow;if(!this.isDragging())return!1;var o=this.registry.getTargetType(n),l=this.getItemType();if(l&&!Db(o,l))return!1;var u=this.getTargetIds();if(!u.length)return!1;var d=u.indexOf(n);return a?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 zH(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return UH(this.store.getState().dragOffset)}}]),e})(),KH=0;function GH(){return KH++}function Np(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Np=function(n){return typeof n}:Np=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Np(e)}function JH(e){Mt(typeof e.canDrag=="function","Expected canDrag to be a function."),Mt(typeof e.beginDrag=="function","Expected beginDrag to be a function."),Mt(typeof e.endDrag=="function","Expected endDrag to be a function.")}function QH(e){Mt(typeof e.canDrop=="function","Expected canDrop to be a function."),Mt(typeof e.hover=="function","Expected hover to be a function."),Mt(typeof e.drop=="function","Expected beginDrag to be a function.")}function Fb(e,t){if(t&&Array.isArray(e)){e.forEach(function(n){return Fb(n,!1)});return}Mt(typeof e=="string"||Np(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 Bj=typeof global<"u"?global:self,ZP=Bj.MutationObserver||Bj.WebKitMutationObserver;function XP(e){return function(){const n=setTimeout(a,0),r=setInterval(a,50);function a(){clearTimeout(n),clearInterval(r),e()}}}function YH(e){let t=1;const n=new ZP(e),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}const ZH=typeof ZP=="function"?YH:XP;class XH{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,a=t.length-this.index;r{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=ZH(this.flush),this.requestErrorThrow=XP(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class e9{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 t9{create(t){const n=this.freeTasks,r=n.length?n.pop():new e9(this.onError,a=>n[n.length]=a);return r.task=t,r}constructor(t){this.onError=t,this.freeTasks=[]}}const eR=new XH,n9=new t9(eR.registerPendingError);function r9(e){eR.enqueueTask(n9.create(e))}function s9(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a9(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;Mt(this.isSourceId(n),"Expected a valid source ID.");var a=r&&n===this.pinnedSourceId,o=a?this.pinnedSource:this.dragSources.get(n);return o}},{key:"getTarget",value:function(n){return Mt(this.isTargetId(n),"Expected a valid target ID."),this.dropTargets.get(n)}},{key:"getSourceType",value:function(n){return Mt(this.isSourceId(n),"Expected a valid source ID."),this.types.get(n)}},{key:"getTargetType",value:function(n){return Mt(this.isTargetId(n),"Expected a valid target ID."),this.types.get(n)}},{key:"isSourceId",value:function(n){var r=Uj(n);return r===Ts.SOURCE}},{key:"isTargetId",value:function(n){var r=Uj(n);return r===Ts.TARGET}},{key:"removeSource",value:function(n){var r=this;Mt(this.getSource(n),"Expected an existing source."),this.store.dispatch(MH(n)),r9(function(){r.dragSources.delete(n),r.types.delete(n)})}},{key:"removeTarget",value:function(n){Mt(this.getTarget(n),"Expected an existing target."),this.store.dispatch(_H(n)),this.dropTargets.delete(n),this.types.delete(n)}},{key:"pinSource",value:function(n){var r=this.getSource(n);Mt(r,"Expected an existing source."),this.pinnedSourceId=n,this.pinnedSource=r}},{key:"unpinSource",value:function(){Mt(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(n,r,a){var o=f9(n);return this.types.set(o,r),n===Ts.SOURCE?this.dragSources.set(o,a):n===Ts.TARGET&&this.dropTargets.set(o,a),o}}]),e})();function h9(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,a=m9(r),o=new WH(a,new p9(a)),l=new xH(a,o),u=e(l,t,n);return l.receiveBackend(u),l}function m9(e){var t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return QP($H,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}var g9=["children"];function v9(e,t){return w9(e)||x9(e,t)||b9(e,t)||y9()}function y9(){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 b9(e,t){if(e){if(typeof e=="string")return qj(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 qj(e,t)}}function qj(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 C9(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,o;for(o=0;o=0)&&(n[a]=e[a]);return n}var Hj=0,Tp=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),j9=y.memo(function(t){var n=t.children,r=S9(t,g9),a=k9(r),o=v9(a,2),l=o[0],u=o[1];return y.useEffect(function(){if(u){var d=tR();return++Hj,function(){--Hj===0&&(d[Tp]=null)}}},[]),s.jsx(GP.Provider,Object.assign({value:l},{children:n}),void 0)});function k9(e){if("manager"in e){var t={dragDropManager:e.manager};return[t,!1]}var n=E9(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[n,r]}function E9(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:tR(),n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,a=t;return a[Tp]||(a[Tp]={dragDropManager:h9(e,t,n,r)}),a[Tp]}function tR(){return typeof global<"u"?global:window}function N9(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function T9(e,t){for(var n=0;n, or turn it into a ")+"drag source or a drop target itself.")}}function D9(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 a=t;A9(a);var o=n?function(l){return e(l,n)}:e;return F9(a,o)}}function nR(e){var t={};return Object.keys(e).forEach(function(n){var r=e[n];if(n.endsWith("Ref"))t[n]=e[n];else{var a=D9(r);t[n]=function(){return a}}}),t}function Gj(e,t){typeof e=="function"?e(t):e.current=t}function F9(e,t){var n=e.ref;return Mt(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(a){Gj(n,a),Gj(t,a)}}):y.cloneElement(e,{ref:t})}function Mp(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Mp=function(n){return typeof n}:Mp=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Mp(e)}function Lb(e){return e!==null&&Mp(e)==="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function $b(e,t,n,r){var a=void 0;if(a!==void 0)return!!a;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=K7(this.entered.filter(this.isNodeInDocument),n),r>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),e})(),X7=aR(function(){return/firefox/i.test(navigator.userAgent)}),oR=aR(function(){return!!window.safari});function eW(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tW(e,t){for(var n=0;nn)m=h-1;else return a[h]}d=Math.max(0,m);var x=n-r[d],b=x*x;return a[d]+o[d]*x+l[d]*b+u[d]*x*b}}]),e})(),rW=1;function iR(e){var t=e.nodeType===rW?e:e.parentElement;if(!t)return null;var n=t.getBoundingClientRect(),r=n.top,a=n.left;return{x:a,y:r}}function Qf(e){return{x:e.clientX,y:e.clientY}}function sW(e){var t;return e.nodeName==="IMG"&&(X7()||!((t=document.documentElement)!==null&&t!==void 0&&t.contains(e)))}function aW(e,t,n,r){var a=e?t.width:n,o=e?t.height:r;return oR()&&e&&(o/=window.devicePixelRatio,a/=window.devicePixelRatio),{dragPreviewWidth:a,dragPreviewHeight:o}}function oW(e,t,n,r,a){var o=sW(t),l=o?e:t,u=iR(l),d={x:n.x-u.x,y:n.y-u.y},f=e.offsetWidth,m=e.offsetHeight,h=r.anchorX,g=r.anchorY,x=aW(o,t,f,m),b=x.dragPreviewWidth,w=x.dragPreviewHeight,C=function(){var O=new nk([0,.5,1],[d.y,d.y/m*w,d.y+w-m]),D=O.interpolate(g);return oR()&&o&&(D+=(window.devicePixelRatio-1)*w),D},k=function(){var O=new nk([0,.5,1],[d.x,d.x/f*b,d.x+b-f]);return O.interpolate(h)},N=a.offsetX,T=a.offsetY,_=N===0||N,P=T===0||T;return{x:_?N:k(),y:P?T:C()}}var lR="__NATIVE_FILE__",cR="__NATIVE_URL__",uR="__NATIVE_TEXT__",dR="__NATIVE_HTML__";const rk=Object.freeze(Object.defineProperty({__proto__:null,FILE:lR,HTML:dR,TEXT:uR,URL:cR},Symbol.toStringTag,{value:"Module"}));function sy(e,t,n){var r=t.reduce(function(a,o){return a||e.getData(o)},"");return r??n}var $l;function Yf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var zb=($l={},Yf($l,lR,{exposeProperties:{files:function(t){return Array.prototype.slice.call(t.files)},items:function(t){return t.items},dataTransfer:function(t){return t}},matchesTypes:["Files"]}),Yf($l,dR,{exposeProperties:{html:function(t,n){return sy(t,n,"")},dataTransfer:function(t){return t}},matchesTypes:["Html","text/html"]}),Yf($l,cR,{exposeProperties:{urls:function(t,n){return sy(t,n,"").split(` -`)},dataTransfer:function(t){return t}},matchesTypes:["Url","text/uri-list"]}),Yf($l,uR,{exposeProperties:{text:function(t,n){return sy(t,n,"")},dataTransfer:function(t){return t}},matchesTypes:["Text","text/plain"]}),$l);function iW(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lW(e,t){for(var n=0;n-1})})[0]||null}function fW(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pW(e,t){for(var n=0;n0&&a.actions.hover(l,{clientOffset:Qf(o)});var u=l.some(function(d){return a.monitor.canDropOnTarget(d)});u&&(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=a.getCurrentDropEffect()))}}),Ut(this,"handleTopDragOverCapture",function(){a.dragOverTargetIds=[]}),Ut(this,"handleTopDragOver",function(o){var l=a.dragOverTargetIds;if(a.dragOverTargetIds=[],!a.monitor.isDragging()){o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none");return}a.altKeyPressed=o.altKey,a.lastClientOffset=Qf(o),a.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(a.hoverRafId=requestAnimationFrame(function(){a.monitor.isDragging()&&a.actions.hover(l||[],{clientOffset:a.lastClientOffset}),a.hoverRafId=null}));var u=(l||[]).some(function(d){return a.monitor.canDropOnTarget(d)});u?(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=a.getCurrentDropEffect())):a.isDraggingNativeItem()?o.preventDefault():(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none"))}),Ut(this,"handleTopDragLeaveCapture",function(o){a.isDraggingNativeItem()&&o.preventDefault();var l=a.enterLeaveCounter.leave(o.target);l&&a.isDraggingNativeItem()&&setTimeout(function(){return a.endDragNativeItem()},0)}),Ut(this,"handleTopDropCapture",function(o){if(a.dropTargetIds=[],a.isDraggingNativeItem()){var l;o.preventDefault(),(l=a.currentNativeSource)===null||l===void 0||l.loadDataTransfer(o.dataTransfer)}else ay(o.dataTransfer)&&o.preventDefault();a.enterLeaveCounter.reset()}),Ut(this,"handleTopDrop",function(o){var l=a.dropTargetIds;a.dropTargetIds=[],a.actions.hover(l,{clientOffset:Qf(o)}),a.actions.drop({dropEffect:a.getCurrentDropEffect()}),a.isDraggingNativeItem()?a.endDragNativeItem():a.monitor.isDragging()&&a.actions.endDrag()}),Ut(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 mW(n,r),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new Z7(this.isNodeInDocument)}return yW(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,a){var o=this;return this.sourcePreviewNodeOptions.set(n,a),this.sourcePreviewNodes.set(n,r),function(){o.sourcePreviewNodes.delete(n),o.sourcePreviewNodeOptions.delete(n)}}},{key:"connectDragSource",value:function(n,r,a){var o=this;this.sourceNodes.set(n,r),this.sourceNodeOptions.set(n,a);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 a=this,o=function(f){return a.handleDragEnter(f,n)},l=function(f){return a.handleDragOver(f,n)},u=function(f){return a.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 ok({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 ok({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}},{key:"isDraggingNativeItem",value:function(){var n=this.monitor.getItemType();return Object.keys(rk).some(function(r){return rk[r]===n})}},{key:"beginDragNativeItem",value:function(n,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=dW(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 a=1e3;this.mouseMoveTimeoutTimer=setTimeout(function(){var o;return(o=r.rootElement)===null||o===void 0?void 0:o.addEventListener("mousemove",r.endDragIfSourceWasRemovedFromDOM,!0)},a)}},{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})(),xW=function(t,n,r){return new bW(t,n,r)},wW=Object.create,fR=Object.defineProperty,SW=Object.getOwnPropertyDescriptor,pR=Object.getOwnPropertyNames,CW=Object.getPrototypeOf,jW=Object.prototype.hasOwnProperty,kW=(e,t)=>function(){return t||(0,e[pR(e)[0]])((t={exports:{}}).exports,t),t.exports},EW=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of pR(t))!jW.call(e,a)&&a!==n&&fR(e,a,{get:()=>t[a],enumerable:!(r=SW(t,a))||r.enumerable});return e},hR=(e,t,n)=>(n=e!=null?wW(CW(e)):{},EW(fR(n,"default",{value:e,enumerable:!0}),e)),mR=kW({"node_modules/classnames/index.js"(e,t){(function(){var n={}.hasOwnProperty;function r(){for(var a=[],o=0;o-1}var OK=IK,AK=9007199254740991,DK=/^(?:0|[1-9]\d*)$/;function FK(e,t){var n=typeof e;return t=t??AK,!!t&&(n=="number"||n!="symbol"&&DK.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=BK}var SR=zK;function UK(e){return e!=null&&SR(e.length)&&!xR(e)}var VK=UK,qK=Object.prototype;function HK(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||qK;return e===n}var WK=HK;function KK(e,t){for(var n=-1,r=Array(e);++n-1}var jJ=CJ;function kJ(e,t){var n=this.__data__,r=pm(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var EJ=kJ;function Ac(e){var t=-1,n=e==null?0:e.length;for(this.clear();++tu))return!1;var f=o.get(e),m=o.get(t);if(f&&m)return f==t&&m==e;var h=-1,g=!0,x=n&IQ?new MR:void 0;for(o.set(e,t),o.set(t,e);++h":">",'"':""","'":"'"},fY=HJ(dY),pY=fY,IR=/[&<>"']/g,hY=RegExp(IR.source);function mY(e){return e=TR(e),e&&hY.test(e)?e.replace(IR,pY):e}var gY=mY,OR=/[\\^$.*+?()[\]{}|]/g,vY=RegExp(OR.source);function yY(e){return e=TR(e),e&&vY.test(e)?e.replace(OR,"\\$&"):e}var bY=yY;function xY(e,t){return lY(e,t)}var wY=xY,SY=1/0,CY=ec&&1/ww(new ec([,-0]))[1]==SY?function(e){return new ec(e)}:jK,jY=CY,kY=200;function EY(e,t,n){var r=-1,a=OK,o=e.length,l=!0,u=[],d=u;if(n)l=!1,a=uY;else if(o>=kY){var f=t?null:jY(e);if(f)return ww(f);l=!1,a=_R,d=new MR}else d=t?[]:u;e:for(;++rs.jsx("button",{className:e.classNames.clearAll,onClick:e.onClick,children:"Clear all"}),PY=_Y,RY=(e,t)=>{const n=t.offsetHeight,r=e.offsetHeight,a=e.offsetTop-t.scrollTop;a+r>=n?t.scrollTop+=a-n+r:a<0&&(t.scrollTop+=a)},Wb=(e,t,n,r)=>typeof r=="function"?r(e):e.length>=t&&n,IY=e=>{const t=y.createRef(),{labelField:n,minQueryLength:r,isFocused:a,classNames:o,selectedIndex:l,query:u}=e;y.useEffect(()=>{if(!t.current)return;const h=t.current.querySelector(`.${o.activeSuggestion}`);h&&RY(h,t.current)},[l]);const d=(h,g)=>{const x=g.trim().replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&"),{[n]:b}=h;return{__html:b.replace(RegExp(x,"gi"),w=>`${gY(w)}`)}},f=(h,g)=>typeof e.renderSuggestion=="function"?e.renderSuggestion(h,g):s.jsx("span",{dangerouslySetInnerHTML:d(h,g)}),m=e.suggestions.map((h,g)=>s.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(h,e.query)},g));return m.length===0||!Wb(u,r||2,a,e.shouldRenderSuggestions)?null:s.jsx("div",{ref:t,className:o.suggestions,"data-testid":"suggestions",children:s.jsxs("ul",{children:[" ",m," "]})})},OY=(e,t)=>{const{query:n,minQueryLength:r=2,isFocused:a,suggestions:o}=t;return!!(e.isFocused===a&&wY(e.suggestions,o)&&Wb(n,r,a,t.shouldRenderSuggestions)===Wb(e.query,e.minQueryLength??2,e.isFocused,e.shouldRenderSuggestions)&&e.selectedIndex===t.selectedIndex)},AY=y.memo(IY,OY),DY=AY,FY=hR(mR()),LY=hR(mR());function $Y(e){const t=e.map(r=>{const a=r-48*Math.floor(r/48);return String.fromCharCode(96<=r?a:r)}).join(""),n=bY(t);return new RegExp(`[${n}]+`)}function BY(e){switch(e){case ga.ENTER:return[10,13];case ga.TAB:return 9;case ga.COMMA:return 188;case ga.SPACE:return 32;case ga.SEMICOLON:return 186;default:return 0}}function Rk(e){const{moveTag:t,readOnly:n,allowDragDrop:r}=e;return t!==void 0&&!n&&r}function zY(e){const{readOnly:t,allowDragDrop:n}=e;return!t&&n}var UY=e=>{const{readOnly:t,removeComponent:n,onRemove:r,className:a,tag:o,index:l}=e,u=f=>{if(Xl.ENTER.includes(f.keyCode)||f.keyCode===Xl.SPACE){f.preventDefault(),f.stopPropagation();return}f.keyCode===Xl.BACKSPACE&&r(f)};if(t)return s.jsx("span",{});const d=`Tag at index ${l} with value ${o.id} focussed. Press backspace to remove`;if(n){const f=n;return s.jsx(f,{"data-testid":"remove",onRemove:r,onKeyDown:u,className:a,"aria-label":d,tag:o,index:l})}return s.jsx("button",{"data-testid":"remove",onClick:r,onKeyDown:u,className:a,type:"button","aria-label":d,children:s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",height:"12",width:"12",fill:"#fff",children:s.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"})})})},VY=UY,Ik={TAG:"tag"},qY=e=>{const t=y.useRef(null),{readOnly:n=!1,tag:r,classNames:a,index:o,moveTag:l,allowDragDrop:u=!0,labelField:d="text",tags:f}=e,[{isDragging:m},h]=_7(()=>({type:Ik.TAG,collect:C=>({isDragging:!!C.isDragging()}),item:e,canDrag:()=>Rk({moveTag:l,readOnly:n,allowDragDrop:u})}),[f]),[,g]=W7(()=>({accept:Ik.TAG,drop:C=>{const k=C.index,N=o;k!==N&&e?.moveTag?.(k,N)},canDrop:C=>zY(C)}),[f]);h(g(t));const x=e.tag[d],{className:b=""}=r,w=m?0:1;return s.jsxs("span",{ref:t,className:(0,LY.default)("tag-wrapper",a.tag,b),style:{opacity:w,cursor:Rk({moveTag:l,readOnly:n,allowDragDrop:u})?"move":"auto"},"data-testid":"tag",onClick:e.onTagClicked,onTouchStart:e.onTagClicked,children:[x,s.jsx(VY,{tag:e.tag,className:a.remove,removeComponent:e.removeComponent,onRemove:e.onDelete,readOnly:n,index:o})]})},HY=e=>{const{autofocus:t,autoFocus:n,readOnly:r,labelField:a,allowDeleteFromEmptyInput:o,allowAdditionFromPaste:l,allowDragDrop:u,minQueryLength:d,shouldRenderSuggestions:f,removeComponent:m,autocomplete:h,inline:g,maxTags:x,allowUnique:b,editable:w,placeholder:C,delimiters:k,separators:N,tags:T,inputFieldPosition:_,inputProps:P,classNames:M,maxLength:O,inputValue:D,clearAll:F}=e,[$,te]=y.useState(e.suggestions),[z,ue]=y.useState(""),[V,ne]=y.useState(!1),[Y,se]=y.useState(-1),[H,W]=y.useState(!1),[U,A]=y.useState(""),[K,re]=y.useState(-1),[ee,ie]=y.useState(""),de=y.createRef(),j=y.useRef(null),I=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&&rt()},[n,n,r]),y.useEffect(()=>{Pn()},[z,e.suggestions]);const me=Ee=>{let bt=e.suggestions.slice();if(b){const vr=T.map(ur=>ur.id.trim().toLowerCase());bt=bt.filter(ur=>!vr.includes(ur.id.toLowerCase()))}if(e.handleFilterSuggestions)return e.handleFilterSuggestions(Ee,bt);const zt=bt.filter(vr=>xe(Ee,vr)===0),Tn=bt.filter(vr=>xe(Ee,vr)>0);return zt.concat(Tn)},xe=(Ee,bt)=>bt[a].toLowerCase().indexOf(Ee.toLowerCase()),rt=()=>{ue(""),j.current&&(j.current.value="",j.current.focus())},Je=(Ee,bt)=>{bt.preventDefault(),bt.stopPropagation();const zt=T.slice();zt.length!==0&&(ie(""),e?.handleDelete?.(Ee,bt),nt(Ee,zt))},nt=(Ee,bt)=>{if(!de?.current)return;const zt=de.current.querySelectorAll(".ReactTags__remove");let Tn="";Ee===0&&bt.length>1?(Tn=`Tag at index ${Ee} with value ${bt[Ee].id} deleted. Tag at index 0 with value ${bt[1].id} focussed. Press backspace to remove`,zt[0].focus()):Ee>0?(Tn=`Tag at index ${Ee} with value ${bt[Ee].id} deleted. Tag at index ${Ee-1} with value ${bt[Ee-1].id} focussed. Press backspace to remove`,zt[Ee-1].focus()):(Tn=`Tag at index ${Ee} with value ${bt[Ee].id} deleted. Input focussed. Press enter to add a new tag`,j.current?.focus()),A(Tn)},qt=(Ee,bt,zt)=>{r||(w&&(re(Ee),ue(bt[a]),I.current?.focus()),e.handleTagClick?.(Ee,zt))},Wn=Ee=>{e.handleInputChange&&e.handleInputChange(Ee.target.value,Ee);const bt=Ee.target.value.trim();ue(bt)},Pn=()=>{const Ee=me(z);te(Ee),se(Y>=Ee.length?Ee.length-1:Y)},tr=Ee=>{const bt=Ee.target.value;e.handleInputFocus&&e.handleInputFocus(bt,Ee),ne(!0)},wn=Ee=>{const bt=Ee.target.value;e.handleInputBlur&&(e.handleInputBlur(bt,Ee),j.current&&(j.current.value="")),ne(!1),re(-1)},$r=Ee=>{if(Ee.key==="Escape"&&(Ee.preventDefault(),Ee.stopPropagation(),se(-1),W(!1),te([]),re(-1)),(N.indexOf(Ee.key)!==-1||k.indexOf(Ee.keyCode)!==-1)&&!Ee.shiftKey){(Ee.keyCode!==Xl.TAB||z!=="")&&Ee.preventDefault();const bt=H&&Y!==-1?$[Y]:{id:z.trim(),[a]:z.trim(),className:""};Object.keys(bt)&&Mr(bt)}Ee.key==="Backspace"&&z===""&&(o||_===Ou.INLINE)&&Je(T.length-1,Ee),Ee.keyCode===Xl.UP_ARROW&&(Ee.preventDefault(),se(Y<=0?$.length-1:Y-1),W(!0)),Ee.keyCode===Xl.DOWN_ARROW&&(Ee.preventDefault(),W(!0),$.length===0?se(-1):se((Y+1)%$.length))},Br=()=>x&&T.length>=x,or=Ee=>{if(!l)return;if(Br()){ie(lk.TAG_LIMIT),rt();return}ie(""),Ee.preventDefault();const bt=Ee.clipboardData||window.clipboardData,zt=bt.getData("text"),{maxLength:Tn=zt.length}=e,vr=Math.min(Tn,zt.length),ur=bt.getData("text").substr(0,vr);let zr=k;N.length&&(zr=[],N.forEach(ns=>{const eo=BY(ns);Array.isArray(eo)?zr=[...zr,...eo]:zr.push(eo)}));const _r=$Y(zr),ts=ur.split(_r).map(ns=>ns.trim());MY(ts).forEach(ns=>Mr({id:ns.trim(),[a]:ns.trim(),className:""}))},Mr=Ee=>{if(!Ee.id||!Ee[a])return;if(K===-1){if(Br()){ie(lk.TAG_LIMIT),rt();return}ie("")}const bt=T.map(zt=>zt.id.toLowerCase());if(!(b&&bt.indexOf(Ee.id.trim().toLowerCase())>=0)){if(h){const zt=me(Ee[a]);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"),(h===1&&zt.length===1||h===!0&&zt.length)&&(Ee=zt[0])}K!==-1&&e.onTagUpdate?e.onTagUpdate(K,Ee):e?.handleAddition?.(Ee),ue(""),W(!1),se(-1),re(-1),rt()}},B=Ee=>{Mr($[Ee])},oe=()=>{e.onClearAll&&e.onClearAll(),ie(""),rt()},pe=Ee=>{se(Ee),W(!0)},Ae=(Ee,bt)=>{const zt=T[Ee];e?.handleDrag?.(zt,Ee,bt)},Te=(()=>{const Ee={...ik,...e.classNames};return T.map((bt,zt)=>s.jsx(y.Fragment,{children:K===zt?s.jsx("div",{className:Ee.editTagInput,children:s.jsx("input",{ref:Tn=>{I.current=Tn},onFocus:tr,value:z,onChange:Wn,onKeyDown:$r,onBlur:wn,className:Ee.editTagInputField,onPaste:or,"data-testid":"tag-edit"})}):s.jsx(qY,{index:zt,tag:bt,tags:T,labelField:a,onDelete:Tn=>Je(zt,Tn),moveTag:u?Ae:void 0,removeComponent:m,onTagClicked:Tn=>qt(zt,bt,Tn),readOnly:r,classNames:Ee,allowDragDrop:u})},zt))})(),De={...ik,...M},{name:pt,id:Nt}=e,Rn=g===!1?Ou.BOTTOM:_,vn=r?null:s.jsxs("div",{className:De.tagInput,children:[s.jsx("input",{...P,ref:Ee=>{j.current=Ee},className:De.tagInputField,type:"text",placeholder:C,"aria-label":C,onFocus:tr,onBlur:wn,onChange:Wn,onKeyDown:$r,onPaste:or,name:pt,id:Nt,maxLength:O,value:D,"data-automation":"input","data-testid":"input"}),s.jsx(DY,{query:z.trim(),suggestions:$,labelField:a,selectedIndex:Y,handleClick:B,handleHover:pe,minQueryLength:d,shouldRenderSuggestions:f,isFocused:V,classNames:De,renderSuggestion:e.renderSuggestion}),F&&T.length>0&&s.jsx(PY,{classNames:De,onClick:oe}),ee&&s.jsxs("div",{"data-testid":"error",className:"ReactTags__error",children:[s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",height:"24",width:"24",fill:"#e03131",children:s.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"})}),ee]})]});return s.jsxs("div",{className:(0,FY.default)(De.tags,"react-tags-wrapper"),ref:de,children:[s.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:U}),Rn===Ou.TOP&&vn,s.jsxs("div",{className:De.selected,children:[Te,Rn===Ou.INLINE&&vn]}),Rn===Ou.BOTTOM&&vn]})},WY=HY,KY=e=>{const{placeholder:t=NW,labelField:n=TW,suggestions:r=[],delimiters:a=[],separators:o=e.delimiters?.length?[]:[ga.ENTER,ga.TAB],autofocus:l,autoFocus:u=!0,inline:d,inputFieldPosition:f="inline",allowDeleteFromEmptyInput:m=!1,allowAdditionFromPaste:h=!0,autocomplete:g=!1,readOnly:x=!1,allowUnique:b=!0,allowDragDrop:w=!0,tags:C=[],inputProps:k={},editable:N=!1,clearAll:T=!1,handleDelete:_,handleAddition:P,onTagUpdate:M,handleDrag:O,handleFilterSuggestions:D,handleTagClick:F,handleInputChange:$,handleInputFocus:te,handleInputBlur:z,minQueryLength:ue,shouldRenderSuggestions:V,removeComponent:ne,onClearAll:Y,classNames:se,name:H,id:W,maxLength:U,inputValue:A,maxTags:K,renderSuggestion:re}=e;return s.jsx(WY,{placeholder:t,labelField:n,suggestions:r,delimiters:a,separators:o,autofocus:l,autoFocus:u,inline:d,inputFieldPosition:f,allowDeleteFromEmptyInput:m,allowAdditionFromPaste:h,autocomplete:g,readOnly:x,allowUnique:b,allowDragDrop:w,tags:C,inputProps:k,editable:N,clearAll:T,handleDelete:_,handleAddition:P,onTagUpdate:M,handleDrag:O,handleFilterSuggestions:D,handleTagClick:F,handleInputChange:$,handleInputFocus:te,handleInputBlur:z,minQueryLength:ue,shouldRenderSuggestions:V,removeComponent:ne,onClearAll:Y,classNames:se,name:H,id:W,maxLength:U,inputValue:A,maxTags:K,renderSuggestion:re})},GY=({...e})=>s.jsx(j9,{backend:xW,children:s.jsx(KY,{...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 - *) -*/const JY="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",Ya=mr,AR=y.createContext({}),Za=({...e})=>s.jsx(AR.Provider,{value:{name:e.name},children:s.jsx(s8,{...e})}),gm=()=>{const e=y.useContext(AR),t=y.useContext(DR),{getFieldState:n,formState:r}=a8(),a=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`,...a}},DR=y.createContext({}),Ca=y.forwardRef(({className:e,...t},n)=>{const r=y.useId();return s.jsx(DR.Provider,{value:{id:r},children:s.jsx("div",{ref:n,className:on("space-y-2",e),...t})})});Ca.displayName="FormItem";const Xr=y.forwardRef(({className:e,...t},n)=>{const{error:r,formItemId:a}=gm();return s.jsx(Ve,{ref:n,className:on(r&&"text-rose-600",e),htmlFor:a,...t})});Xr.displayName="FormLabel";const ta=({children:e})=>{const{error:t,formItemId:n,formDescriptionId:r,formMessageId:a}=gm();return y.isValidElement(e)?y.cloneElement(e,{id:n,"aria-describedby":t?`${r} ${a}`:`${r}`,"aria-invalid":!!t}):null};ta.displayName="FormControl";const vm=y.forwardRef(({className:e,...t},n)=>{const{formDescriptionId:r}=gm();return s.jsx("p",{ref:n,id:r,className:on("text-sm text-muted-foreground",e),...t})});vm.displayName="FormDescription";const Nd=y.forwardRef(({className:e,children:t,...n},r)=>{const{error:a,formMessageId:o}=gm(),l=a?String(a?.message):t;return l?s.jsx("p",{ref:r,id:o,className:on("text-sm font-medium text-rose-600",e),...n,children:l}):null});Nd.displayName="FormMessage";const le=({name:e,label:t,children:n,required:r,readOnly:a,className:o,...l})=>s.jsx(Za,{...l,name:e,render:({field:u})=>s.jsxs(Ca,{className:o,children:[t&&s.jsxs(Xr,{children:[t,r&&s.jsx("span",{className:"ml-2 text-rose-600",children:"*"})]}),s.jsx(ta,{children:y.isValidElement(n)&&y.cloneElement(n,{name:u.name,value:u.value??"",onChange:u.onChange,onBlur:u.onBlur,required:r,readOnly:a})}),s.jsx(Nd,{})]})}),Re=({name:e,label:t,required:n,className:r,helper:a,reverse:o,...l})=>s.jsx(Za,{...l,name:e,render:({field:u})=>s.jsxs(Ca,{className:on("flex items-center gap-3",o&&"flex-row-reverse justify-end",r),children:[s.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[t&&s.jsxs(Xr,{className:"break-all",children:[t,n&&s.jsx("span",{className:"ml-2 text-rose-600",children:"*"})]}),a&&s.jsx(vm,{className:"text-xs",children:a})]}),s.jsx(ta,{children:s.jsx(Ed,{checked:u.value,onCheckedChange:u.onChange,required:n})}),s.jsx(Nd,{})]})}),cn=({name:e,label:t,helper:n,required:r,options:a,placeholder:o,disabled:l,...u})=>s.jsx(Za,{...u,name:e,render:({field:d})=>s.jsxs(Ca,{children:[t&&s.jsxs(Xr,{children:[t,r&&s.jsx("span",{className:"ml-2 text-rose-600",children:"*"})]}),s.jsx(ta,{children:s.jsxs(_t,{onValueChange:d.onChange,defaultValue:d.value,disabled:l,children:[s.jsx(ta,{children:s.jsx(Rt,{children:s.jsx(Pt,{placeholder:o})})}),s.jsx(It,{children:a.map(f=>s.jsx(we,{value:f.value,children:f.label},f.value))})]})}),n&&s.jsx(vm,{children:n}),s.jsx(Nd,{})]})}),ri=({name:e,label:t,helper:n,required:r,placeholder:a,...o})=>s.jsx(Za,{...o,name:e,render:({field:l})=>{let u=[];return Array.isArray(l.value)&&(u=l.value),s.jsxs(Ca,{children:[t&&s.jsxs(Xr,{children:[t,r&&s.jsx("span",{className:"ml-2 text-rose-600",children:"*"})]}),s.jsx(ta,{children:s.jsx(GY,{tags:u.map(d=>({id:d,text:d,className:""})),handleDelete:d=>l.onChange(u.filter((f,m)=>m!==d)),handleAddition:d=>l.onChange([...u,d.id]),inputFieldPosition:"bottom",placeholder:a,autoFocus:!1,allowDragDrop:!1,separators:[ga.ENTER,ga.TAB,ga.COMMA],classNames:{tags:"tagsClass",tagInput:"tagInputClass",tagInputField:JY,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&&s.jsx(vm,{children:n}),s.jsx(Nd,{})]})}});function QY({resetTable:e,open:t,onOpenChange:n}){const{t:r}=Le(),{createInstance:a}=Nc(),o=n,[l,u]=y.useState(!1),[d,f]=y.useState(!1),m=hn({instanceName:he().min(3,r("newInstance.validation.nameMin")).max(50,r("newInstance.validation.nameMax")).regex(/^[a-zA-Z0-9-_]+$/,r("newInstance.validation.nameFormat")),token:he().optional(),proxyHost:he().optional(),proxyPort:he().optional(),proxyUsername:he().optional(),proxyPassword:he().optional()}),{register:h,handleSubmit:g,reset:x,formState:{errors:b}}=mn({resolver:gn(m),defaultValues:{instanceName:"",token:"",proxyHost:"",proxyPort:"",proxyUsername:"",proxyPassword:""}}),w=async k=>{f(!0);try{const N={instanceName:k.instanceName,integration:"EVOLUTION_GO",token:k.token&&k.token.trim()!==""?k.token:jb(),number:null,businessId:null,...k.proxyHost&&k.proxyPort?{proxy:{host:k.proxyHost,port:k.proxyPort,username:k.proxyUsername,password:k.proxyPassword}}:{}};await a(N),X.success(r("toast.instance.created")),o(!1),x(),u(!1),e()}catch(N){console.error("Error:",N);const T=N instanceof Error?N.message:r("toast.instance.error");X.error(T)}finally{f(!1)}},C=k=>{d||(o(k),k||(x(),u(!1)))};return s.jsx(yt,{open:t,onOpenChange:C,children:s.jsxs(ht,{className:"sm:max-w-md",children:[s.jsxs(mt,{children:[s.jsxs(xt,{className:"flex items-center gap-2",children:[s.jsx(Zr,{className:"h-5 w-5 text-primary"}),r("newInstance.title")]}),s.jsx(Er,{children:r("newInstance.description")})]}),s.jsxs("form",{onSubmit:g(w),className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs(Ve,{htmlFor:"instanceName",children:[r("newInstance.form.name.label")," ",s.jsx("span",{className:"text-rose-600",children:"*"})]}),s.jsx(G,{id:"instanceName",type:"text",placeholder:r("newInstance.form.name.placeholder"),disabled:d,...h("instanceName")}),b.instanceName&&s.jsx("p",{className:"text-sm text-rose-600",children:b.instanceName.message}),s.jsx("p",{className:"text-xs text-muted-foreground",children:r("newInstance.form.name.hint")})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{htmlFor:"token",children:r("newInstance.form.token.label")}),s.jsx(G,{id:"token",type:"text",placeholder:r("newInstance.form.token.placeholder"),disabled:d,...h("token")}),b.token&&s.jsx("p",{className:"text-sm text-rose-600",children:b.token.message}),s.jsx("p",{className:"text-xs text-muted-foreground",children:r("newInstance.form.token.hint")})]}),s.jsxs(Xx,{open:l,onOpenChange:u,className:"space-y-2",children:[s.jsx(ew,{asChild:!0,children:s.jsxs(q,{type:"button",variant:"outline",disabled:d,className:"w-full justify-between",children:[s.jsx("span",{children:r("newInstance.proxy.title")}),l?s.jsx(BB,{className:"h-4 w-4"}):s.jsx(Mx,{className:"h-4 w-4"})]})}),s.jsxs(tw,{className:"space-y-4 border-t border-border pt-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{htmlFor:"proxyHost",children:r("newInstance.proxy.host.label")}),s.jsx(G,{id:"proxyHost",type:"text",placeholder:r("newInstance.proxy.host.placeholder"),disabled:d,...h("proxyHost")})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{htmlFor:"proxyPort",children:r("newInstance.proxy.port.label")}),s.jsx(G,{id:"proxyPort",type:"text",placeholder:"8080",disabled:d,...h("proxyPort")})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{htmlFor:"proxyUsername",children:r("newInstance.proxy.username.label")}),s.jsx(G,{id:"proxyUsername",type:"text",placeholder:r("newInstance.proxy.username.placeholder"),disabled:d,...h("proxyUsername")})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{htmlFor:"proxyPassword",children:r("newInstance.proxy.password.label")}),s.jsx(G,{id:"proxyPassword",type:"password",placeholder:r("newInstance.proxy.password.placeholder"),disabled:d,...h("proxyPassword")})]})]})]}),s.jsxs(Wt,{className:"flex gap-2 sm:gap-0",children:[s.jsx(q,{type:"button",variant:"outline",onClick:()=>C(!1),disabled:d,children:r("button.cancel")}),s.jsx(q,{type:"submit",disabled:d,children:d?s.jsxs(s.Fragment,{children:[s.jsx(zh,{className:"mr-2 h-4 w-4 animate-spin"}),r("newInstance.button.creating")]}):s.jsxs(s.Fragment,{children:[s.jsx(Zr,{className:"mr-2 h-4 w-4"}),r("newInstance.button.create")]})})]})]})]})})}const dy=he().optional().transform(e=>e===""?void 0:e),YY=hn({name:he(),token:dy,number:dy,businessId:dy,integration:fw(["WHATSAPP-BUSINESS","WHATSAPP-BAILEYS","EVOLUTION"])});function ZY({resetTable:e,open:t,onOpenChange:n}){const{t:r}=Le(),{createInstance:a}=Nc(),o=n,l=[{value:"WHATSAPP-BAILEYS",label:r("instance.form.integration.baileys")},{value:"WHATSAPP-BUSINESS",label:r("instance.form.integration.whatsapp")},{value:"EVOLUTION",label:r("instance.form.integration.evolution")}],u=mn({resolver:gn(YY),defaultValues:{name:"",integration:"WHATSAPP-BAILEYS",token:jb().replace("-","").toUpperCase(),number:"",businessId:""}}),d=u.watch("integration"),f=async h=>{try{const g={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 a(g),X.success(r("toast.instance.created")),o(!1),m(),e()}catch(g){console.error("Error:",g),X.error(`Error : ${g?.response?.data?.response?.message}`)}},m=()=>{u.reset({name:"",integration:"WHATSAPP-BAILEYS",token:jb().replace("-","").toLocaleUpperCase(),number:"",businessId:""})};return Tr()==="go"?s.jsx(QY,{resetTable:e,open:t,onOpenChange:n}):s.jsx(yt,{open:t,onOpenChange:o,children:s.jsxs(ht,{className:"sm:max-w-[650px]",onCloseAutoFocus:m,children:[s.jsx(mt,{children:s.jsx(xt,{children:r("instance.modal.title")})}),s.jsx(mr,{...u,children:s.jsxs("form",{onSubmit:u.handleSubmit(f),className:"grid gap-4 py-4",children:[s.jsx(le,{required:!0,name:"name",label:r("instance.form.name"),children:s.jsx(G,{})}),s.jsx(cn,{name:"integration",label:r("instance.form.integration.label"),options:l}),s.jsx(le,{required:!0,name:"token",label:r("instance.form.token"),children:s.jsx(G,{})}),s.jsx(le,{name:"number",label:r("instance.form.number"),children:s.jsx(G,{type:"tel"})}),d==="WHATSAPP-BUSINESS"&&s.jsx(le,{required:!0,name:"businessId",label:r("instance.form.businessId"),children:s.jsx(G,{})}),s.jsx(Wt,{children:s.jsx(q,{type:"submit",children:r("instance.button.save")})})]})})]})})}function XY(){const{t:e}=Le(),[t,n]=y.useState(!1),[r,a]=y.useState(null),[o,l]=y.useState(""),[u,d]=y.useState(null),[f,m]=y.useState(""),[h,g]=y.useState("all"),{deleteInstance:x,logout:b}=Nc(),{data:w,isLoading:C,refetch:k}=zV(),N=async()=>{await k()},T=()=>{a(null),l("")},_=async()=>{if(!r)return;const F=r.name;d(F);try{try{await b(F)}catch($){console.error("Error logout:",$)}await x(F),await new Promise($=>setTimeout($,1e3)),await N(),X.success(e("toast.instance.deleted",{defaultValue:"Instância removida com sucesso!"})),T()}catch($){console.error("Error instance delete:",$);const te=$ instanceof Error?$.message:"Erro ao remover instância";X.error(te)}finally{d(null)}},P=y.useMemo(()=>{let F=w??[];h!=="all"&&(F=F.filter(te=>te.connectionStatus===h));const $=f.trim().toLowerCase();return $?F.filter(te=>te.name.toLowerCase().includes($)||te.profileName&&te.profileName.toLowerCase().includes($)):F},[w,f,h]),M=[{value:"all",label:e("status.all")},{value:"close",label:e("status.closed")},{value:"connecting",label:e("status.connecting")},{value:"open",label:e("status.open")}],O=P.length,D=o===r?.name;return s.jsxs("div",{className:"flex h-full flex-col",children:[s.jsx(B_,{title:e("dashboard.title"),subtitle:e("dashboard.subtitle",{defaultValue:"Gerencie suas instâncias WhatsApp"}),searchValue:f,onSearchChange:m,searchPlaceholder:e("dashboard.search"),primaryAction:{label:e("instance.button.create"),icon:s.jsx(Zr,{className:"h-4 w-4"}),onClick:()=>n(!0)},secondaryActions:[{label:e("button.refresh",{defaultValue:"Atualizar"}),icon:s.jsx(cc,{className:"h-4 w-4"}),onClick:N}],children:s.jsx("div",{className:"flex items-center justify-end",children:s.jsxs(gs,{children:[s.jsx(vs,{asChild:!0,children:s.jsxs(q,{variant:"secondary",size:"sm",children:[e("dashboard.status"),s.jsx(zB,{className:"ml-2 h-4 w-4"})]})}),s.jsx(ys,{align:"end",children:M.map(F=>s.jsx(X6,{checked:h===F.value,onCheckedChange:$=>{$&&g(F.value)},children:F.label},F.value))})]})})}),s.jsx("div",{className:"flex-1",children:C?s.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:Array.from({length:6}).map((F,$)=>s.jsx(uV,{className:"h-56 rounded-lg"},$))}):O===0?s.jsxs("div",{className:"flex min-h-[40vh] flex-col items-center justify-center gap-3 rounded-lg border border-dashed border-sidebar-border p-8 text-center",children:[s.jsx(iz,{className:"h-10 w-10 text-muted-foreground"}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold",children:e("dashboard.empty.title",{defaultValue:"Nenhuma instância encontrada"})}),s.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:e("dashboard.empty.description",{defaultValue:"Crie sua primeira instância para começar"})})]}),s.jsxs(q,{onClick:()=>n(!0),className:"mt-2",children:[s.jsx(Zr,{className:"mr-2 h-4 w-4"}),e("instance.button.create")]})]}):s.jsx("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:P.map(F=>s.jsx(OV,{instance:F,isDeleting:u===F.name,onDelete:$=>a($)},F.id))})}),s.jsx(ZY,{resetTable:N,open:t,onOpenChange:n}),s.jsx(yt,{open:!!r,onOpenChange:F=>!F&&T(),children:s.jsxs(ht,{className:"sm:max-w-md",children:[s.jsxs(mt,{children:[s.jsxs(xt,{className:"flex items-center gap-2 text-red-500",children:[s.jsx(iM,{className:"h-5 w-5"}),e("modal.delete.title")]}),s.jsx(Er,{children:e("modal.delete.message",{instanceName:r?.name??""})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium",children:e("modal.delete.confirm",{defaultValue:"Digite o nome da instância para confirmar:"})}),s.jsx(G,{placeholder:r?.name,value:o,onChange:F=>l(F.target.value)})]}),s.jsxs(Wt,{className:"flex gap-2",children:[s.jsx(q,{variant:"outline",onClick:T,children:e("button.cancel")}),s.jsx(q,{variant:"destructive",onClick:_,disabled:!D||u===r?.name,children:u===r?.name?e("button.deleting"):e("button.delete")})]})]})})]})}const eZ=e=>["chats","findChats",JSON.stringify(e)],tZ=async({instanceName:e})=>(await Ce.post(`/chat/findChats/${e}`,{where:{}})).data,nZ=e=>{const{instanceName:t,...n}=e;return gt({...n,queryKey:eZ({instanceName:t}),queryFn:()=>tZ({instanceName:t}),enabled:!!t})},Sa=Object.create(null);Sa.open="0";Sa.close="1";Sa.ping="2";Sa.pong="3";Sa.message="4";Sa.upgrade="5";Sa.noop="6";const Pp=Object.create(null);Object.keys(Sa).forEach(e=>{Pp[Sa[e]]=e});const Kb={type:"error",data:"parser error"},FR=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",LR=typeof ArrayBuffer=="function",$R=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Sw=({type:e,data:t},n,r)=>FR&&t instanceof Blob?n?r(t):Ok(t,r):LR&&(t instanceof ArrayBuffer||$R(t))?n?r(t):Ok(new Blob([t]),r):r(Sa[e]+(t||"")),Ok=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function Ak(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let fy;function rZ(e,t){if(FR&&e.data instanceof Blob)return e.data.arrayBuffer().then(Ak).then(t);if(LR&&(e.data instanceof ArrayBuffer||$R(e.data)))return t(Ak(e.data));Sw(e,!1,n=>{fy||(fy=new TextEncoder),t(fy.encode(n))})}const Dk="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Hu=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e{let t=e.length*.75,n=e.length,r,a=0,o,l,u,d;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const f=new ArrayBuffer(t),m=new Uint8Array(f);for(r=0;r>4,m[a++]=(l&15)<<4|u>>2,m[a++]=(u&3)<<6|d&63;return f},aZ=typeof ArrayBuffer=="function",Cw=(e,t)=>{if(typeof e!="string")return{type:"message",data:BR(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:oZ(e.substring(1),t)}:Pp[n]?e.length>1?{type:Pp[n],data:e.substring(1)}:{type:Pp[n]}:Kb},oZ=(e,t)=>{if(aZ){const n=sZ(e);return BR(n,t)}else return{base64:!0,data:e}},BR=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},zR="",iZ=(e,t)=>{const n=e.length,r=new Array(n);let a=0;e.forEach((o,l)=>{Sw(o,!1,u=>{r[l]=u,++a===n&&t(r.join(zR))})})},lZ=(e,t)=>{const n=e.split(zR),r=[];for(let a=0;a{const r=n.length;let a;if(r<126)a=new Uint8Array(1),new DataView(a.buffer).setUint8(0,r);else if(r<65536){a=new Uint8Array(3);const o=new DataView(a.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{a=new Uint8Array(9);const o=new DataView(a.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(a[0]|=128),t.enqueue(a),t.enqueue(n)})}})}let py;function Xf(e){return e.reduce((t,n)=>t+n.length,0)}function ep(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let a=0;aMath.pow(2,21)-1){u.enqueue(Kb);break}a=m*Math.pow(2,32)+f.getUint32(4),r=3}else{if(Xf(n)e){u.enqueue(Kb);break}}}})}const UR=4;function Xn(e){if(e)return dZ(e)}function dZ(e){for(var t in Xn.prototype)e[t]=Xn.prototype[t];return e}Xn.prototype.on=Xn.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Xn.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Xn.prototype.off=Xn.prototype.removeListener=Xn.prototype.removeAllListeners=Xn.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,a=0;aPromise.resolve().then(t):(t,n)=>n(t,0),Ms=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),fZ="arraybuffer";function VR(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const pZ=Ms.setTimeout,hZ=Ms.clearTimeout;function bm(e,t){t.useNativeTimers?(e.setTimeoutFn=pZ.bind(Ms),e.clearTimeoutFn=hZ.bind(Ms)):(e.setTimeoutFn=Ms.setTimeout.bind(Ms),e.clearTimeoutFn=Ms.clearTimeout.bind(Ms))}const mZ=1.33;function gZ(e){return typeof e=="string"?vZ(e):Math.ceil((e.byteLength||e.size)*mZ)}function vZ(e){let t=0,n=0;for(let r=0,a=e.length;r=57344?n+=3:(r++,n+=4);return n}function qR(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function yZ(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function bZ(e){let t={},n=e.split("&");for(let r=0,a=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)};lZ(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,iZ(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]=qR()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let HR=!1;try{HR=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const SZ=HR;function CZ(){}class jZ extends wZ{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",(a,o)=>{this.onError("xhr post error",a,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 tc=class Rp extends Xn{constructor(t,n,r){super(),this.createRequest=t,bm(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=VR(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 a in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(a)&&r.setRequestHeader(a,this._opts.extraHeaders[a])}}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 a;r.readyState===3&&((a=this._opts.cookieJar)===null||a===void 0||a.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(a){this.setTimeoutFn(()=>{this._onError(a)},0);return}typeof document<"u"&&(this._index=Rp.requestsCount++,Rp.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=CZ,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Rp.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()}};tc.requestsCount=0;tc.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Fk);else if(typeof addEventListener=="function"){const e="onpagehide"in Ms?"pagehide":"unload";addEventListener(e,Fk,!1)}}function Fk(){for(let e in tc.requests)tc.requests.hasOwnProperty(e)&&tc.requests[e].abort()}const kZ=(function(){const e=WR({xdomain:!1});return e&&e.responseType!==null})();class EZ extends jZ{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=kZ&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new tc(WR,this.uri(),t)}}function WR(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||SZ))return new XMLHttpRequest}catch{}if(!t)try{return new Ms[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const KR=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class NZ extends jw{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=KR?{}:VR(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(a){return this.emitReserved("error",a)}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{}a&&ym(()=>{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]=qR()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const hy=Ms.WebSocket||Ms.MozWebSocket;class TZ extends NZ{createSocket(t,n,r){return KR?new hy(t,n,r):n?new hy(t,n):new hy(t)}doWrite(t,n){this.ws.send(n)}}class MZ extends jw{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=uZ(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),a=cZ();a.readable.pipeTo(t.writable),this._writer=a.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{a&&ym(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const _Z={websocket:TZ,webtransport:MZ,polling:EZ},PZ=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,RZ=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Gb(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 a=PZ.exec(e||""),o={},l=14;for(;l--;)o[RZ[l]]=a[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=IZ(o,o.path),o.queryKey=OZ(o,o.query),o}function IZ(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 OZ(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,a,o){a&&(n[a]=o)}),n}const Jb=typeof addEventListener=="function"&&typeof removeEventListener=="function",Ip=[];Jb&&addEventListener("offline",()=>{Ip.forEach(e=>e())},!1);class Do extends Xn{constructor(t,n){if(super(),this.binaryType=fZ,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=Gb(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=Gb(n.host).host);bm(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 a=r.prototype.name;this.transports.push(a),this._transportsByName[a]=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=bZ(this.opts.query)),Jb&&(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"})},Ip.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=UR,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&&Do.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",Do.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,ym(()=>{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,a){if(typeof n=="function"&&(a=n,n=void 0),typeof r=="function"&&(a=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),a&&this.once("flush",a),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(Do.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(),Jb&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Ip.indexOf(this._offlineEventListener);r!==-1&&Ip.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Do.protocol=UR;class AZ extends Do{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",h=>{if(!r)if(h.type==="pong"&&h.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Do.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(m(),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,m(),n.close(),n=null)}const l=h=>{const g=new Error("probe error: "+h);g.transport=n.name,o(),this.emitReserved("upgradeError",g)};function u(){l("transport closed")}function d(){l("socket closed")}function f(h){n&&h.name!==n.name&&o()}const m=()=>{n.removeListener("open",a),n.removeListener("error",l),n.removeListener("close",u),this.off("close",d),this.off("upgrading",f)};n.once("open",a),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;r_Z[a]).filter(a=>!!a)),super(t,r)}};function FZ(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=Gb(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 LZ=typeof ArrayBuffer=="function",$Z=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,GR=Object.prototype.toString,BZ=typeof Blob=="function"||typeof Blob<"u"&&GR.call(Blob)==="[object BlobConstructor]",zZ=typeof File=="function"||typeof File<"u"&&GR.call(File)==="[object FileConstructor]";function kw(e){return LZ&&(e instanceof ArrayBuffer||$Z(e))||BZ&&e instanceof Blob||zZ&&e instanceof File}function Op(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,a)=>{const o=(l,u)=>l?a(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((a,...o)=>r!==this._queue[0]?void 0:(a!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(a)):(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:Ht.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 Ht.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 Ht.EVENT:case Ht.BINARY_EVENT:this.onevent(t);break;case Ht.ACK:case Ht.BINARY_ACK:this.onack(t);break;case Ht.DISCONNECT:this.ondisconnect();break;case Ht.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(...a){r||(r=!0,n.packet({type:Ht.ACK,id:t,data:a}))}}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:Ht.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}Lc.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};Lc.prototype.reset=function(){this.attempts=0};Lc.prototype.setMin=function(e){this.ms=e};Lc.prototype.setMax=function(e){this.max=e};Lc.prototype.setJitter=function(e){this.jitter=e};class Zb extends Xn{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,bm(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 Lc({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const a=n.parser||GZ;this.encoder=new a.Encoder,this.decoder=new a.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 DZ(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const a=Ws(n,"open",function(){r.onopen(),t&&t()}),o=u=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",u),t?t(u):this.maybeReconnectOnOpen()},l=Ws(n,"error",o);if(this._timeout!==!1){const u=this._timeout,d=this.setTimeoutFn(()=>{a(),o(new Error("timeout")),n.close()},u);this.opts.autoUnref&&d.unref(),this.subs.push(()=>{this.clearTimeoutFn(d)})}return this.subs.push(a),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(Ws(t,"ping",this.onping.bind(this)),Ws(t,"data",this.ondata.bind(this)),Ws(t,"error",this.onerror.bind(this)),Ws(t,"close",this.onclose.bind(this)),Ws(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){ym(()=>{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 JR(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(a=>{a?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",a)):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 Du={};function Ap(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=FZ(e,t.path||"/socket.io"),r=n.source,a=n.id,o=n.path,l=Du[a]&&o in Du[a].nsps,u=t.forceNew||t["force new connection"]||t.multiplex===!1||l;let d;return u?d=new Zb(r,t):(Du[a]||(Du[a]=new Zb(r,t)),d=Du[a]),n.query&&!t.query&&(t.query=n.queryKey),d.socket(n.path,t)}Object.assign(Ap,{Manager:Zb,Socket:JR,io:Ap,connect:Ap});const Qu=new Map,Nw=e=>{if(Qu.has(e)){const n=Qu.get(e);return $k(n)}const t=Ap(e,{transports:["websocket","polling"],autoConnect:!1,reconnection:!0,reconnectionAttempts:5,reconnectionDelay:1e3,timeout:2e4});return Qu.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)}),$k(t)},Tw=e=>{for(const[t,n]of Qu.entries())if(n===e||e._socket===n){console.log(`🔌 Disconnecting socket for ${t}`),n.disconnect(),Qu.delete(t);break}},$k=e=>({on:(t,n)=>{e.on(t,n)},off:t=>{e.off(t)},connect:()=>{e.connected||e.connect()},disconnect:()=>{e.disconnect()}});function Xa(e){const t=o=>typeof window<"u"?window.matchMedia(o).matches:!1,[n,r]=y.useState(t(e));function a(){r(t(e))}return y.useEffect(()=>{const o=window.matchMedia(e);return a(),o.addListener?o.addListener(a):o.addEventListener("change",a),()=>{o.removeListener?o.removeListener(a):o.removeEventListener("change",a)}},[e]),n}const QZ="border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",Ps=y.forwardRef(({className:e,...t},n)=>s.jsx("textarea",{ref:n,"data-slot":"textarea",className:on(QZ,e),...t}));Ps.displayName="Textarea";const YZ=e=>["chats","findChats",JSON.stringify(e)],ZZ=async({instanceName:e,remoteJid:t})=>{const n=await Ce.post(`/chat/findChats/${e}`,{where:{remoteJid:t}});return Array.isArray(n.data)?n.data[0]:n.data},XZ=e=>{const{instanceName:t,remoteJid:n,...r}=e;return gt({...r,queryKey:YZ({instanceName:t,remoteJid:n}),queryFn:()=>ZZ({instanceName:t,remoteJid:n}),enabled:!!t&&!!n})},eX=e=>["chats","findMessages",JSON.stringify(e)],tX=async({instanceName:e,remoteJid:t})=>{const n=await Ce.post(`/chat/findMessages/${e}`,{where:{key:{remoteJid:t}}});return n.data?.messages?.records?n.data.messages.records:n.data},nX=e=>{const{instanceName:t,remoteJid:n,...r}=e;return gt({...r,queryKey:eX({instanceName:t,remoteJid:n}),queryFn:()=>tX({instanceName:t,remoteJid:n}),enabled:!!t&&!!n})},rX=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/message/sendText/${e}`,n,{headers:{apikey:t,"content-type":"application/json"}})).data,sX=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 Ce.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 Ce.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 QR(){return{sendText:ot(rX,{invalidateKeys:[["chats","findMessages"],["chats","findChats"]]})}}function YR(){return{sendMedia:ot(sX)}}function oX(){return{sendAudio:ot(aX)}}const ZR=y.createContext({backgroundColor:"",textForegroundColor:"",primaryColor:"",fromMeBubbleColor:"",fromMeForegroundColor:"",fromOtherBubbleColor:"",fromOtherForegroundColor:"",fromMeQuotedBubbleColor:"",fromOtherQuotedBubbleColor:"",inputBackgroundColor:"",inputTextForegroundColor:"",inputIconsMainColor:""});function iX({children:e}){const[t]=wc(),{theme:n}=Yi(),r=t.get("backgroundColor"),a=t.get("textForegroundColor"),o=t.get("primaryColor"),l=t.get("fromMeBubbleColor"),u=t.get("fromMeForegroundColor"),d=t.get("fromOtherBubbleColor"),f=t.get("fromOtherForegroundColor"),m=t.get("fromMeQuotedBubbleColor"),h=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",N=()=>n==="dark"?"#0b332a":"#c8fff2",T=()=>n==="dark"?"#ffffff":"#020202",_=()=>n==="dark"?"#1d2724":"#e0f0f0",P=()=>n==="dark"?"#ffffff":"#020202",M=()=>n==="dark"?"#161616":"#e0f0f0",O=()=>n==="dark"?"#faf9fa":"#020202",D=()=>n==="dark"?"#1f463d":"#aff7e6",F=()=>n==="dark"?"#0f1413":"#d2e2e2",$=()=>n==="dark"?"#0e6451":"#0b332a";return s.jsx(ZR.Provider,{value:{backgroundColor:r||w(),textForegroundColor:a||C(),primaryColor:o||k(),fromMeBubbleColor:l||N(),fromMeForegroundColor:u||T(),fromOtherBubbleColor:d||_(),fromOtherForegroundColor:f||P(),fromMeQuotedBubbleColor:m||D(),fromOtherQuotedBubbleColor:h||F(),inputBackgroundColor:g||M(),inputTextForegroundColor:x||O(),inputIconsMainColor:b||$()},children:e})}const si=()=>y.useContext(ZR),XR=({setSelectedMedia:e})=>{const{t}=Le(),{inputIconsMainColor:n}=si(),r=y.useRef(null),a=y.useRef(null),[o,l]=y.useState(!1),u=h=>{const g=h.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){X.error(t("chat.media.errors.audioSize"));return}break;case"image":if(b>5){X.error(t("chat.media.errors.imageSize"));return}break;case"video":if(b>16){X.error(t("chat.media.errors.videoSize"));return}break;case"application":case"text":if(b>100){X.error(t("chat.media.errors.documentSize"));return}break;default:X.error(t("chat.media.errors.unsupportedType"));return}e(g)},d=h=>{h.preventDefault(),r.current&&r.current.click()},f=h=>{h.preventDefault(),a.current&&a.current.click()},m=["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 s.jsx(s.Fragment,{children:s.jsxs(gs,{open:o,onOpenChange:l,children:[s.jsx(vs,{asChild:!0,children:s.jsxs(q,{type:"button",variant:"ghost",size:"icon",className:"rounded-full p-2",children:[s.jsx(Zr,{className:"h-6 w-6",style:{color:n}}),s.jsx("span",{className:"sr-only",children:t("chat.media.attach")})]})}),s.jsxs(ys,{align:"end",children:[s.jsx("input",{ref:a,type:"file",accept:m.join(", "),onChange:u,className:"hidden"}),s.jsxs(Ct,{onClick:f,children:[s.jsx(QB,{className:"mr-2 h-4 w-4"}),t("chat.media.document")]}),s.jsx("input",{ref:r,type:"file",accept:"image/*, video/*",onChange:u,className:"hidden"}),s.jsxs(Ct,{onClick:d,children:[s.jsx(rz,{className:"mr-2 h-4 w-4"}),t("chat.media.photosAndVideos")]})]})]})})},eI=({selectedMedia:e,setSelectedMedia:t})=>{const{t:n}=Le(),r=()=>{t(null)},a=l=>l.type.includes("image")?s.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")?s.jsx("div",{className:"flex items-center justify-center",children:s.jsx("video",{className:"w-80 rounded-lg object-cover",src:URL.createObjectURL(l),controls:!0})}):s.jsx("div",{className:"flex items-center justify-center",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(_x,{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 s.jsxs("div",{className:"relative flex items-center rounded-lg bg-[#e0f0f0] dark:bg-[#1d2724] dark:text-white",children:[s.jsx("div",{className:"absolute h-full w-1 rounded-l-lg bg-blue-700 dark:bg-blue-300"}),s.jsxs("div",{className:"flex w-full flex-col items-center justify-center gap-6 p-4 pl-4",children:[e&&a(e),s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2",children:[s.jsx("span",{className:"text-sm font-medium",children:e?.name||n("chat.media.selectedMedia.selectedFile")}),s.jsx("span",{className:"text-xs text-gray-500",children:o(e?.size||0)})]})]}),s.jsx(q,{size:"icon",variant:"ghost",className:"ml-auto h-10 w-10 rounded-full",onClick:r,children:s.jsx(Uh,{className:"h-6 w-6"})})]})},Bk=(e,t,n)=>{const r=new Date,a=new Date(r);a.setDate(a.getDate()-1);const o=new Date(e);return o.toDateString()===r.toDateString()?t("chat.date.today",{defaultValue:"Hoje"}):o.toDateString()===a.toDateString()?t("chat.date.yesterday",{defaultValue:"Ontem"}):Math.floor((r.getTime()-o.getTime())/(1e3*60*60*24))<7?o.toLocaleDateString(n,{weekday:"long"}):o.toLocaleDateString(n,{day:"2-digit",month:"2-digit",year:"numeric"})},Fu=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}},lX=({date:e})=>s.jsx("div",{className:"flex items-center justify-center py-3",children:s.jsx("div",{className:"rounded-full bg-muted/50 px-3 py-1",children:s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:e})})}),zk=(e,t)=>e.toLocaleTimeString(t,{hour:"2-digit",minute:"2-digit"}),Uk=["#e91e63","#9c27b0","#3f51b5","#2196f3","#00bcd4","#009688","#4caf50","#ff9800","#f44336","#795548"],cX=e=>{let t=0;for(let n=0;n{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)},Vk=({message:e})=>{const t=e.messageType;switch(t){case"conversation":if(e.message.contactMessage){const d=e.message.contactMessage;return s.jsxs("div",{className:"p-3 bg-muted rounded-lg max-w-xs",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx("div",{className:"text-xl",children:"👤"}),s.jsx("span",{className:"font-medium",children:"Contact"})]}),d.displayName&&s.jsx("p",{className:"text-sm font-medium",children:d.displayName}),d.vcard&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"Contact card"})]})}if(e.message.locationMessage){const d=e.message.locationMessage;return s.jsxs("div",{className:"p-3 bg-muted rounded-lg max-w-xs",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx("div",{className:"text-xl",children:"📍"}),s.jsx("span",{className:"font-medium",children:"Location"})]}),d.name&&s.jsx("p",{className:"text-sm font-medium",children:d.name}),d.address&&s.jsx("p",{className:"text-xs text-muted-foreground",children:d.address}),d.degreesLatitude&&d.degreesLongitude&&s.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 s.jsx("span",{children:uX(e.message)});case"extendedTextMessage":return s.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 s.jsxs("div",{className:"flex flex-col gap-2",children:[r?s.jsx("img",{src:r,alt:"Image",className:"rounded-lg max-w-full h-auto",style:{maxWidth:"400px",maxHeight:"400px",objectFit:"contain"},loading:"lazy"}):s.jsxs("div",{className:"rounded bg-muted p-4 max-w-xs",children:[s.jsx("p",{className:"text-center text-muted-foreground",children:"Image couldn't be loaded"}),s.jsx("p",{className:"text-center text-xs text-muted-foreground mt-1",children:"Missing base64 data and mediaUrl"})]}),e.message.imageMessage?.caption&&s.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 s.jsxs("div",{className:"flex flex-col gap-2",children:[o?s.jsx("video",{src:o,controls:!0,className:"rounded-lg max-w-full h-auto",style:{maxWidth:"400px",maxHeight:"400px"}}):s.jsxs("div",{className:"rounded bg-muted p-4 max-w-xs",children:[s.jsx("p",{className:"text-center text-muted-foreground",children:"Video couldn't be loaded"}),s.jsx("p",{className:"text-center text-xs text-muted-foreground mt-1",children:"Missing base64 data and mediaUrl"})]}),e.message.videoMessage?.caption&&s.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?s.jsxs("audio",{controls:!0,className:"w-full max-w-xs",children:[s.jsx("source",{src:u,type:"audio/mpeg"}),"Your browser does not support the audio element."]}):s.jsxs("div",{className:"rounded bg-muted p-4 max-w-xs",children:[s.jsx("p",{className:"text-center text-muted-foreground",children:"Audio couldn't be loaded"}),s.jsx("p",{className:"text-center text-xs text-muted-foreground mt-1",children:"Missing base64 data and mediaUrl"})]});case"documentMessage":return s.jsxs("div",{className:"flex items-center gap-2 p-3 bg-muted rounded-lg max-w-xs",children:[s.jsx("div",{className:"text-2xl",children:"📄"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"font-medium truncate",children:e.message.documentMessage?.fileName||"Document"}),e.message.documentMessage?.fileLength&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:[(e.message.documentMessage.fileLength/1024/1024).toFixed(2)," MB"]})]})]});case"stickerMessage":return s.jsx("img",{src:e.message.mediaUrl,alt:"Sticker",className:"max-w-32 max-h-32 object-contain"});default:return s.jsx("div",{className:"text-xs text-muted-foreground bg-muted p-2 rounded max-w-xs",children:s.jsxs("details",{children:[s.jsxs("summary",{children:["Unknown message type: ",t]}),s.jsx("pre",{className:"mt-2 whitespace-pre-wrap break-all text-xs",children:JSON.stringify(e.message,null,2)})]})})}};function tI({textareaRef:e,handleTextareaChange:t,textareaHeight:n,lastMessageRef:r,scrollToBottom:a}){const{t:o,i18n:l}=Le(),u=l.language,{instance:d}=ft(),[f,m]=y.useState(""),[h,g]=y.useState(!1),[x,b]=y.useState(null),[w,C]=y.useState([]),{sendText:k}=QR(),{sendMedia:N}=YR(),{remoteJid:T}=Is(),_=async()=>{if(!(!f.trim()||!T||!d?.name||!d?.token||h))try{g(!0),await k({instanceName:d.name,token:d.token,data:{number:T,text:f.trim()}}),m(""),e.current&&(e.current.value="",t())}catch(H){console.error("Error sending message:",H)}finally{g(!1)}},P=async()=>{if(!(!x||!T||!d?.name||!d?.token||h))try{g(!0);const H=await new Promise((W,U)=>{const A=new FileReader;A.readAsDataURL(x),A.onload=()=>{const re=A.result.split(",")[1];W(re)},A.onerror=U});await N({instanceName:d.name,token:d.token,data:{number:T,mediaMessage:{mediatype:x.type.split("/")[0]==="application"?"document":x.type.split("/")[0],mimetype:x.type,caption:f.trim(),media:H,fileName:x.name}}}),b(null),m(""),e.current&&(e.current.value="",t())}catch(H){console.error("Error sending media:",H)}finally{g(!1)}},M=async()=>{x?await P():await _()},O=H=>{H.key==="Enter"&&!H.shiftKey&&(H.preventDefault(),M())},D=H=>{m(H.target.value),t()},{data:F}=XZ({remoteJid:T,instanceName:d?.name}),{data:$,isSuccess:te}=nX({remoteJid:T,instanceName:d?.name}),z=y.useMemo(()=>{if(!$)return w;const H=new Map;return $.forEach(W=>H.set(W.key.id,W)),w.forEach(W=>{H.set(W.key.id,W)}),Array.from(H.values())},[$,w]);y.useEffect(()=>{if(!d?.name||!T)return;const H=hr(Fn.API_URL);if(!H){console.error("API URL not found in localStorage");return}const W=Nw(H),U=(K,re)=>{if(!d||re.instance!==d.name||re?.data?.key?.remoteJid!==T)return;const ee=re.data;C(ie=>{const de=ie.findIndex(j=>j.key.id===ee.key.id);if(de!==-1){const j=[...ie];return j[de]=ee,j}else return[...ie,ee]})},A=K=>{d&&K.instance===d.name&&console.log("Received message status update:",K)};return W.on("messages.upsert",K=>{U("messages.upsert",K)}),W.on("send.message",K=>{U("send.message",K)}),W.on("messages.update",K=>{A(K)}),W.connect(),()=>{W.off("messages.upsert"),W.off("send.message"),W.off("messages.update"),Tw(W)}},[d?.name,T]);const ue=y.useMemo(()=>{if(!z)return[];const H=[...z].sort((K,re)=>{const ee=Fu(K).getTime(),ie=Fu(re).getTime();return ee-ie}),W=[];let U="",A=[];return H.forEach(K=>{const ee=Fu(K).toDateString();ee!==U?(A.length>0&&W.push({date:Bk(new Date(U),o,u),messages:A}),U=ee,A=[K]):A.push(K)}),A.length>0&&W.push({date:Bk(new Date(U),o,u),messages:A}),W},[z,o,u]);y.useEffect(()=>{te&&z&&a()},[te,z,a]),y.useEffect(()=>{b(null),m(""),C([]),e.current&&(e.current.value="",t())},[T]);const V=H=>s.jsx("div",{className:"mb-4 flex justify-end",children:s.jsxs("div",{className:"max-w-[70%]",children:[s.jsx("div",{className:"rounded-lg bg-primary px-3 py-2 text-sm text-primary-foreground",children:s.jsx(Vk,{message:H})}),s.jsx("span",{className:"mt-0.5 block px-1 text-right text-[11px] text-muted-foreground",children:zk(Fu(H),u)})]})},H.id),ne=H=>{const W=!!T?.endsWith("@g.us"),U=H.key.participant,A=U||H.pushName||"",K=H.pushName||(U?U.split("@")[0]:"");return s.jsx("div",{className:"mb-4 flex justify-start",children:s.jsxs("div",{className:"max-w-[70%]",children:[W&&K&&s.jsx("div",{className:"mb-1 text-xs font-semibold",style:{color:cX(A)},children:K}),s.jsx("div",{className:"rounded-lg border bg-muted px-3 py-2 text-sm text-foreground",children:s.jsx(Vk,{message:H})}),s.jsx("span",{className:"mt-0.5 block px-1 text-[11px] text-muted-foreground",children:zk(Fu(H),u)})]})},H.id)},Y=F?.pushName||F?.remoteJid?.split("@")[0],se=F?.remoteJid?.split("@")[0];return s.jsxs("div",{className:"flex h-full flex-col bg-muted/10",children:[s.jsx("div",{className:"flex-shrink-0 border-b bg-background/95 p-4 backdrop-blur-sm",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs(Ih,{className:"h-10 w-10",children:[s.jsx(Oh,{src:F?.profilePicUrl,alt:Y}),s.jsx(jT,{className:"bg-muted text-muted-foreground",children:s.jsx(Jp,{className:"h-5 w-5"})})]}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("h3",{className:"truncate font-semibold",children:Y}),s.jsx("p",{className:"truncate text-xs text-muted-foreground",children:se})]})]})}),s.jsxs("div",{className:"flex w-full flex-1 flex-col overflow-y-auto px-4 py-4",children:[ue.map((H,W)=>s.jsxs("div",{children:[s.jsx(lX,{date:H.date}),H.messages.map(U=>U.key.fromMe?V(U):ne(U))]},W)),s.jsx("div",{ref:r})]}),s.jsx("div",{className:"flex-shrink-0 border-t bg-background p-3",children:s.jsxs("div",{className:"rounded-lg border border-border bg-card shadow-sm",children:[x&&s.jsx("div",{className:"border-b border-border bg-muted/30 px-3 py-2",children:s.jsx(eI,{selectedMedia:x,setSelectedMedia:b})}),s.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[s.jsx("div",{className:"flex flex-shrink-0 items-center",children:d&&s.jsx(XR,{instance:d,setSelectedMedia:b})}),s.jsx(Ps,{placeholder:o("chat.input.placeholder",{defaultValue:"Digite uma mensagem..."}),name:"message",id:"message",rows:1,ref:e,value:f,onChange:D,onKeyDown:O,disabled:h,style:{height:n},className:"min-h-9 flex-1 resize-none border-none bg-transparent px-2 py-1.5 text-sm shadow-none focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-offset-0"}),s.jsxs(q,{type:"button",size:"icon",onClick:M,disabled:!f.trim()&&!x||h,className:"h-9 w-9 flex-shrink-0 bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground disabled:opacity-50",children:[s.jsx(Gp,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:o("chat.input.send")})]})]})]})})]})}const my=e=>e.split("@")[0];function qk(){const{t:e}=Le(),t=Xa("(min-width: 768px)"),n=y.useRef(null),[r]=y.useState("auto"),a=y.useRef(null),{instance:o}=ft(),[l,u]=y.useState([]),[d,f]=y.useState(""),[m,h]=y.useState("contacts"),{data:g}=nZ({instanceName:o?.name}),x=y.useMemo(()=>{if(!g)return l;const D=new Map;return g.forEach(F=>D.set(F.remoteJid,F)),l.forEach(F=>{const $=D.get(F.remoteJid);D.set(F.remoteJid,$?{...$,...F}:F)}),Array.from(D.values())},[g,l]),{instanceId:b,remoteJid:w}=Is(),C=Nn();y.useEffect(()=>{if(!o?.name)return;const D=hr(Fn.API_URL);if(!D)return;const F=Nw(D),$=te=>{if(!o||te.instance!==o.name)return;const z=te?.data?.key?.remoteJid;z&&u(ue=>{const V=ue.findIndex(Y=>Y.remoteJid===z),ne={id:z,remoteJid:z,pushName:te?.data?.pushName||my(z),profilePicUrl:te?.data?.key?.profilePictureUrl||"",...te?.data,labels:te?.data?.labels??null};if(V!==-1){const Y=[...ue];return Y[V]={...Y[V],...ne},Y}return[...ue,ne]})};return F.on("messages.upsert",$),F.on("send.message",$),F.connect(),()=>{F.off("messages.upsert"),F.off("send.message"),Tw(F)}},[o,o?.name]);const k=y.useCallback(()=>{n.current?.scrollIntoView({})},[]),N=()=>{if(!a.current)return;a.current.style.height="auto";const D=a.current.scrollHeight,$=parseInt(getComputedStyle(a.current).lineHeight)*10;a.current.style.height=`${Math.min(D,$)}px`},T=D=>C(`/manager/instance/${b}/chat/${D}`),_=()=>C(`/manager/instance/${b}/chat`),P=y.useMemo(()=>{const D=m==="contacts",F=x.filter(te=>D?te.remoteJid.includes("@s.whatsapp.net"):te.remoteJid.includes("@g.us"));if(!d.trim())return F;const $=d.toLowerCase();return F.filter(te=>te.pushName&&te.pushName.toLowerCase().includes($)||te.remoteJid.toLowerCase().includes($))},[x,m,d]),M=!w||t,O=!!w;return s.jsxs("div",{className:"flex h-full w-full overflow-hidden rounded-lg border",children:[s.jsxs("aside",{className:on("flex w-full flex-col border-r bg-card/50 md:w-80 md:flex-shrink-0",M?"flex":"hidden md:flex"),children:[s.jsxs("div",{className:"space-y-3 border-b p-4",children:[s.jsxs("div",{className:"relative",children:[s.jsx(aM,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),s.jsx(G,{type:"search",placeholder:e("chat.search"),value:d,onChange:D=>f(D.target.value),className:"pl-9"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(q,{type:"button",size:"sm",variant:m==="contacts"?"secondary":"ghost",className:"h-8",onClick:()=>h("contacts"),children:[s.jsx(Jp,{className:"mr-1 h-4 w-4"}),e("chat.tabs.contacts")]}),s.jsxs(q,{type:"button",size:"sm",variant:m==="groups"?"secondary":"ghost",className:"h-8",onClick:()=>h("groups"),children:[s.jsx($1,{className:"mr-1 h-4 w-4"}),e("chat.tabs.groups")]})]}),s.jsx("div",{className:"flex items-center justify-between",children:s.jsx("span",{className:"text-xs text-muted-foreground",children:e("chat.count",{count:P.length})})})]}),s.jsx("div",{className:"flex-1 overflow-y-auto",children:P.length===0?s.jsxs("div",{className:"flex h-full flex-col items-center justify-center p-6 text-center",children:[s.jsx(lc,{className:"mb-3 h-10 w-10 text-muted-foreground/50"}),s.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:e(d?"chat.empty.search":"chat.empty.default")}),d&&s.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:e("chat.empty.tryAnother")})]}):P.map(D=>{const F=w===D.remoteJid,$=D.pushName||my(D.remoteJid);return s.jsx("button",{type:"button",onClick:()=>T(D.remoteJid),className:on("block w-full cursor-pointer p-4 text-left transition-colors",F?"border-l-2 border-l-primary bg-primary/10":"border-b border-border/50 hover:bg-accent"),children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsxs(Ih,{className:"h-10 w-10 flex-shrink-0",children:[s.jsx(Oh,{src:D.profilePicUrl,alt:$}),s.jsx(jT,{className:"bg-muted text-muted-foreground",children:m==="groups"?s.jsx($1,{className:"h-5 w-5"}):s.jsx(Jp,{className:"h-5 w-5"})})]}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("div",{className:"mb-0.5 flex items-center justify-between gap-2",children:s.jsx("p",{className:"truncate font-medium",children:$})}),s.jsx("p",{className:"truncate text-sm text-muted-foreground",children:my(D.remoteJid)})]})]})},D.remoteJid)})})]}),s.jsx("main",{className:on("flex h-full min-h-0 flex-1 flex-col overflow-hidden",O?"flex":"hidden md:flex"),children:w?s.jsxs(s.Fragment,{children:[!t&&s.jsx("div",{className:"flex items-center border-b bg-background/95 p-2 backdrop-blur-sm",children:s.jsxs(q,{variant:"ghost",size:"sm",onClick:_,children:[s.jsx(FB,{className:"mr-1 h-4 w-4"}),e("chat.back")]})}),s.jsx(tI,{textareaRef:a,handleTextareaChange:N,textareaHeight:r,lastMessageRef:n,scrollToBottom:k})]}):s.jsx("div",{className:"flex h-full flex-1 items-center justify-center p-8",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-muted",children:s.jsx(lc,{className:"h-8 w-8 text-muted-foreground"})}),s.jsx("h3",{className:"mb-1 text-lg font-semibold",children:e("chat.empty.selectTitle")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:e("chat.empty.selectDescription")})]})})})]})}function dX({name:e,envVar:t}){return s.jsxs("div",{className:"flex min-h-[40vh] flex-col items-center justify-center rounded-lg border border-dashed border-border p-8 text-center",children:[s.jsx("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-full bg-muted",children:s.jsx(nM,{className:"h-7 w-7 text-muted-foreground"})}),s.jsxs("h3",{className:"mb-2 text-lg font-semibold",children:["Integração ",e," desabilitada"]}),s.jsxs("p",{className:"max-w-md text-sm text-muted-foreground",children:["Esta integração está desativada no servidor. Para habilitá-la, defina"," ",s.jsxs("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs",children:[t,"=true"]})," ","no arquivo ",s.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs",children:".env"})," ","do evolution-api e reinicie o serviço."]})]})}function fX(e){if(!e)return!1;const n=e?.response?.data?.response?.message;return Array.isArray(n)?n.some(r=>typeof r=="string"&&/is disabled/i.test(r)):typeof n=="string"?/is disabled/i.test(n):!1}function oa({error:e,name:t,envVar:n,children:r}){return fX(e)?s.jsx(dX,{name:t,envVar:n}):s.jsx(s.Fragment,{children:r})}const pX=e=>["chatwoot","fetchChatwoot",JSON.stringify(e)],hX=async({instanceName:e,token:t})=>(await Ce.get(`/chatwoot/find/${e}`,{headers:{apiKey:t}})).data,mX=e=>{const{instanceName:t,token:n,...r}=e;return gt({...r,queryKey:pX({instanceName:t,token:n}),queryFn:()=>hX({instanceName:t,token:n}),enabled:!!t})},gX=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/chatwoot/set/${e}`,n,{headers:{apikey:t}})).data;function vX(){return{createChatwoot:ot(gX,{invalidateKeys:[["chatwoot","fetchChatwoot"]]})}}const tp=he().optional().transform(e=>e===""?void 0:e),yX=hn({enabled:Me(),accountId:he(),token:he(),url:he(),signMsg:Me().optional(),signDelimiter:tp,nameInbox:tp,organization:tp,logo:tp,reopenConversation:Me().optional(),conversationPending:Me().optional(),mergeBrazilContacts:Me().optional(),importContacts:Me().optional(),importMessages:Me().optional(),daysLimitImportMessages:at.number().optional(),autoCreate:Me(),ignoreJids:As(he()).default([])});function bX(){const{t:e}=Le(),{instance:t}=ft(),[,n]=y.useState(!1),{createChatwoot:r}=vX(),{data:a,error:o}=mX({instanceName:t?.name,token:t?.token}),l=mn({resolver:gn(yX),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(a){l.setValue("ignoreJids",a.ignoreJids||[]);const d={enabled:a.enabled,accountId:a.accountId,token:a.token,url:a.url,signMsg:a.signMsg||!1,signDelimiter:a.signDelimiter||"\\n",nameInbox:a.nameInbox||"",organization:a.organization||"",logo:a.logo||"",reopenConversation:a.reopenConversation||!1,conversationPending:a.conversationPending||!1,mergeBrazilContacts:a.mergeBrazilContacts||!1,importContacts:a.importContacts||!1,importMessages:a.importMessages||!1,daysLimitImportMessages:a.daysLimitImportMessages||7,autoCreate:a.autoCreate||!1,ignoreJids:a.ignoreJids};l.reset(d)}},[a,l]);const u=async d=>{if(!t)return;n(!0);const f={enabled:d.enabled,accountId:d.accountId,token:d.token,url:d.url,signMsg:d.signMsg||!1,signDelimiter:d.signDelimiter||"\\n",nameInbox:d.nameInbox||"",organization:d.organization||"",logo:d.logo||"",reopenConversation:d.reopenConversation||!1,conversationPending:d.conversationPending||!1,mergeBrazilContacts:d.mergeBrazilContacts||!1,importContacts:d.importContacts||!1,importMessages:d.importMessages||!1,daysLimitImportMessages:d.daysLimitImportMessages||7,autoCreate:d.autoCreate,ignoreJids:d.ignoreJids};await r({instanceName:t.name,token:t.token,data:f},{onSuccess:()=>{X.success(e("chatwoot.toast.success"))},onError:m=>{console.error(e("chatwoot.toast.error"),m),XN(m)?X.error(`Error: ${m?.response?.data?.response?.message}`):X.error(e("chatwoot.toast.error"))},onSettled:()=>{n(!1)}})};return s.jsx(oa,{error:o,name:"Chatwoot",envVar:"CHATWOOT_ENABLED",children:s.jsx(Ya,{...l,children:s.jsxs("form",{onSubmit:l.handleSubmit(u),className:"w-full space-y-6",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("chatwoot.title")}),s.jsx(ll,{className:"my-4"}),s.jsxs("div",{className:"mx-4 space-y-2 divide-y [&>*]:px-4 [&>*]:py-2",children:[s.jsx(Re,{name:"enabled",label:e("chatwoot.form.enabled.label"),className:"w-full justify-between",helper:e("chatwoot.form.enabled.description")}),s.jsx(le,{name:"url",label:e("chatwoot.form.url.label"),children:s.jsx(G,{})}),s.jsx(le,{name:"accountId",label:e("chatwoot.form.accountId.label"),children:s.jsx(G,{})}),s.jsx(le,{name:"token",label:e("chatwoot.form.token.label"),children:s.jsx(G,{type:"password"})}),s.jsx(Re,{name:"signMsg",label:e("chatwoot.form.signMsg.label"),className:"w-full justify-between",helper:e("chatwoot.form.signMsg.description")}),s.jsx(le,{name:"signDelimiter",label:e("chatwoot.form.signDelimiter.label"),children:s.jsx(G,{})}),s.jsx(le,{name:"nameInbox",label:e("chatwoot.form.nameInbox.label"),children:s.jsx(G,{})}),s.jsx(le,{name:"organization",label:e("chatwoot.form.organization.label"),children:s.jsx(G,{})}),s.jsx(le,{name:"logo",label:e("chatwoot.form.logo.label"),children:s.jsx(G,{})}),s.jsx(Re,{name:"conversationPending",label:e("chatwoot.form.conversationPending.label"),className:"w-full justify-between",helper:e("chatwoot.form.conversationPending.description")}),s.jsx(Re,{name:"reopenConversation",label:e("chatwoot.form.reopenConversation.label"),className:"w-full justify-between",helper:e("chatwoot.form.reopenConversation.description")}),s.jsx(Re,{name:"importContacts",label:e("chatwoot.form.importContacts.label"),className:"w-full justify-between",helper:e("chatwoot.form.importContacts.description")}),s.jsx(Re,{name:"importMessages",label:e("chatwoot.form.importMessages.label"),className:"w-full justify-between",helper:e("chatwoot.form.importMessages.description")}),s.jsx(le,{name:"daysLimitImportMessages",label:e("chatwoot.form.daysLimitImportMessages.label"),children:s.jsx(G,{type:"number"})}),s.jsx(ri,{name:"ignoreJids",label:e("chatwoot.form.ignoreJids.label"),placeholder:e("chatwoot.form.ignoreJids.placeholder")}),s.jsx(Re,{name:"autoCreate",label:e("chatwoot.form.autoCreate.label"),className:"w-full justify-between",helper:e("chatwoot.form.autoCreate.description")})]})]}),s.jsx("div",{className:"mx-4 flex justify-end",children:s.jsx(q,{type:"submit",children:e("chatwoot.button.save")})})]})})})}var xX=Sx("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function nI({className:e,variant:t,...n}){return s.jsx("div",{"data-slot":"alert",role:"alert",className:Et(xX({variant:t}),e),...n})}function rI({className:e,...t}){return s.jsx("div",{"data-slot":"alert-title",className:Et("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function wX({className:e,...t}){return s.jsx("div",{"data-slot":"alert-description",className:Et("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}var Bl={},gy={exports:{}},vy,Hk;function SX(){if(Hk)return vy;Hk=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return vy=e,vy}var yy,Wk;function CX(){if(Wk)return yy;Wk=1;var e=SX();function t(){}function n(){}return n.resetWarningCache=t,yy=function(){function r(l,u,d,f,m,h){if(h!==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 a(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},yy}var Kk;function sI(){return Kk||(Kk=1,gy.exports=CX()()),gy.exports}var by,Gk;function aI(){return Gk||(Gk=1,by={L:1,M:0,Q:3,H:2}),by}var xy,Jk;function oI(){return Jk||(Jk=1,xy={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8}),xy}var wy,Qk;function jX(){if(Qk)return wy;Qk=1;var e=oI();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++}},Cy=e,Cy}var jy,Xk;function iI(){if(Xk)return jy;Xk=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^=a.G15<=0;)l^=a.G18<>>=1;return l},getPatternPosition:function(o){return a.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+m-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 m=-1;m<=7;m++)d+m<=-1||this.moduleCount<=d+m||(0<=f&&f<=6&&(m==0||m==6)||0<=m&&m<=6&&(f==0||f==6)||2<=f&&f<=4&&2<=m&&m<=4?this.modules[u+f][d+m]=!0:this.modules[u+f][d+m]=!1)},l.getBestMaskPattern=function(){for(var u=0,d=0,f=0;f<8;f++){this.makeImpl(!0,f);var m=r.getLostPoint(this);(f==0||u>m)&&(u=m,d=f)}return d},l.createMovieClip=function(u,d,f){var m=u.createEmptyMovieClip(d,f),h=1;this.make();for(var g=0;g>f&1)==1;this.modules[Math.floor(f/3)][f%3+this.moduleCount-8-3]=m}for(var f=0;f<18;f++){var m=!u&&(d>>f&1)==1;this.modules[f%3+this.moduleCount-8-3][Math.floor(f/3)]=m}},l.setupTypeInfo=function(u,d){for(var f=this.errorCorrectLevel<<3|d,m=r.getBCHTypeInfo(f),h=0;h<15;h++){var g=!u&&(m>>h&1)==1;h<6?this.modules[h][8]=g:h<8?this.modules[h+1][8]=g:this.modules[this.moduleCount-15+h][8]=g}for(var h=0;h<15;h++){var g=!u&&(m>>h&1)==1;h<8?this.modules[8][this.moduleCount-h-1]=g:h<9?this.modules[8][15-h-1+1]=g:this.modules[8][15-h-1]=g}this.modules[this.moduleCount-8][8]=!u},l.mapData=function(u,d){for(var f=-1,m=this.moduleCount-1,h=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[m][x-b]==null){var w=!1;g>>h&1)==1);var C=r.getMask(d,m,x-b);C&&(w=!w),this.modules[m][x-b]=w,h--,h==-1&&(g++,h=7)}if(m+=f,m<0||this.moduleCount<=m){m-=f,f=-f;break}}},o.PAD0=236,o.PAD1=17,o.createData=function(u,d,f){for(var m=t.getRSBlocks(u,d),h=new n,g=0;gb*8)throw new Error("code length overflow. ("+h.getLengthInBits()+">"+b*8+")");for(h.getLengthInBits()+4<=b*8&&h.put(0,4);h.getLengthInBits()%8!=0;)h.putBit(!1);for(;!(h.getLengthInBits()>=b*8||(h.put(o.PAD0,8),h.getLengthInBits()>=b*8));)h.put(o.PAD1,8);return o.createBytes(h,m)},o.createBytes=function(u,d){for(var f=0,m=0,h=0,g=new Array(d.length),x=new Array(d.length),b=0;b=0?_.get(P):0}}for(var M=0,k=0;k=0||Object.prototype.hasOwnProperty.call(f,g)&&(h[g]=f[g]);return h}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,m){var h=f.bgColor,g=f.bgD,x=f.fgD,b=f.fgColor,w=f.size,C=f.title,k=f.viewBoxSize,N=f.xmlns,T=N===void 0?"http://www.w3.org/2000/svg":N,_=l(f,["bgColor","bgD","fgD","fgColor","size","title","viewBoxSize","xmlns"]);return a.default.createElement("svg",e({},_,{height:w,ref:m,viewBox:"0 0 "+k+" "+k,width:w,xmlns:T}),C?a.default.createElement("title",null,C):null,a.default.createElement("path",{d:g,fill:h}),a.default.createElement("path",{d:x,fill:b}))});return d.displayName="QRCodeSvg",d.propTypes=u,np.default=d,np}var sE;function _X(){if(sE)return Bl;sE=1,Object.defineProperty(Bl,"__esModule",{value:!0}),Bl.QRCode=void 0;var e=Object.assign||function(w){for(var C=1;C=0||Object.prototype.hasOwnProperty.call(w,N)&&(k[N]=w[N]);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,N=k===void 0?"#FFFFFF":k,T=w.fgColor,_=T===void 0?"#000000":T,P=w.level,M=P===void 0?"L":P,O=w.size,D=O===void 0?256:O,F=w.value,$=g(w,["bgColor","fgColor","level","size","value"]),te=new l.default(-1,a.default[M]);te.addData(F),te.make();var z=te.modules;return d.default.createElement(m.default,e({},$,{bgColor:N,bgD:z.map(function(ue,V){return ue.map(function(ne,Y){return ne?"":"M "+Y+" "+V+" l 1 0 0 1 -1 0 Z"}).join(" ")}).join(" "),fgColor:_,fgD:z.map(function(ue,V){return ue.map(function(ne,Y){return ne?"M "+Y+" "+V+" l 1 0 0 1 -1 0 Z":""}).join(" ")}).join(" "),ref:C,size:D,viewBoxSize:z.length}))});return Bl.QRCode=b,b.displayName="QRCode",b.propTypes=x,Bl.default=b,Bl}var PX=_X();const RX=md(PX);function IX({status:e}){const{t}=Le();return e?e==="open"?s.jsx(Io,{children:t("status.open")}):e==="connecting"?s.jsx(Io,{variant:"warning",children:t("status.connecting")}):e==="close"||e==="closed"?s.jsx(Io,{variant:"destructive",children:t("status.closed")}):s.jsx(Io,{variant:"secondary",children:e}):null}const OX=e=>{navigator.clipboard.writeText(e),X.success("Copiado para a área de transferência")};function AX({token:e,className:t}){const[n,r]=y.useState(!1);return s.jsxs("div",{className:on("flex items-center gap-3 truncate rounded-sm bg-primary/20 px-2 py-1",t),children:[s.jsx("pre",{className:"block truncate text-xs",children:n?e:e?.replace(/\w/g,"*")}),s.jsx(q,{variant:"ghost",size:"icon",onClick:()=>{OX(e)},children:s.jsx(KB,{size:"15"})}),s.jsx(q,{variant:"ghost",size:"icon",onClick:()=>{r(a=>!a)},children:n?s.jsx(GB,{size:"15"}):s.jsx(JB,{size:"15"})})]})}const Hn=({size:e=45,className:t,...n})=>s.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"},children:s.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:on("animate-spin",t),children:s.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})});function DX({open:e,onOpenChange:t}){const{t:n}=Le(),{instance:r,reloadInstance:a}=ft(),{connect:o}=Nc(),[l,u]=y.useState(""),[d,f]=y.useState(""),[m,h]=y.useState(!1),[g,x]=y.useState(""),[b,w]=y.useState(!1),C=r?.connectionStatus==="open",k=y.useCallback(async()=>{if(r){h(!0);try{const M=await o({instanceName:r.name,token:r.token});u(M?.base64??""),f(M?.pairingCode??""),await a()}catch{}finally{h(!1)}}},[o,r,a]),N=y.useCallback(async()=>{if(!(!r||!g.trim())){w(!0);try{const M=await o({instanceName:r.name,token:r.token,number:g.trim()});u(M?.base64??""),f(M?.pairingCode??""),await a(),X.success(n("qrCode.toast.pairingSuccess"))}catch(M){console.error("Pairing error:",M),X.error(n("qrCode.toast.pairingError"))}finally{w(!1)}}},[o,r,g,a,n]),T=y.useCallback(async()=>{await a()},[a]);y.useEffect(()=>{!e||C||k()},[e]),y.useEffect(()=>{if(!e||C)return;const M=setInterval(()=>{T().catch(O=>console.error("Poll failed:",O))},3e3);return()=>clearInterval(M)},[e,C,T]);const _=async()=>{try{await k(),X.success(n("qrCode.toast.refreshSuccess"))}catch{X.error(n("qrCode.toast.refreshError"))}},P=()=>{u(""),f(""),x(""),t(!1)};return r?C?s.jsx(yt,{open:e,onOpenChange:t,children:s.jsxs(ht,{className:"sm:max-w-md",children:[s.jsxs(mt,{children:[s.jsxs(xt,{className:"flex items-center gap-2 text-green-500",children:[s.jsx(L1,{className:"h-5 w-5"}),n("qrCode.connected.title")]}),s.jsx(Er,{children:n("qrCode.connected.description",{instanceName:r.name})})]}),s.jsxs("div",{className:"flex flex-col items-center gap-4 py-6",children:[s.jsx("div",{className:"rounded-full bg-green-500/10 p-4",children:s.jsx(L1,{className:"h-12 w-12 text-green-500"})}),r.profileName&&s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:n("qrCode.connected.connectedAs")}),s.jsx("p",{className:"text-lg font-semibold",children:r.profileName})]})]}),s.jsx("div",{className:"flex justify-end",children:s.jsx(q,{onClick:P,className:"w-full sm:w-auto",children:n("qrCode.button.close")})})]})}):s.jsx(yt,{open:e,onOpenChange:t,children:s.jsxs(ht,{className:"sm:max-w-md",children:[s.jsxs(mt,{children:[s.jsxs(xt,{className:"flex items-center gap-2",children:[s.jsx(Kp,{className:"h-5 w-5 text-primary"}),n("qrCode.title")]}),s.jsxs(Er,{children:[n("qrCode.description")," ",s.jsx("strong",{children:r.name})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-col items-center gap-4",children:[l?s.jsx("div",{className:"rounded-lg border-2 border-border bg-white p-4",children:s.jsx("img",{src:l,alt:"QR Code",className:"h-64 w-64"})}):s.jsx("div",{className:"flex h-64 w-64 items-center justify-center rounded-lg border-2 border-dashed border-border",children:s.jsxs("div",{className:"text-center",children:[s.jsx(Kp,{className:"mx-auto h-12 w-12 text-muted-foreground/40"}),s.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:n(m?"qrCode.generating":"qrCode.waiting")})]})}),d&&s.jsxs("div",{className:"w-full rounded-lg bg-muted p-3 text-center",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:n("qrCode.pairingCode.label")}),s.jsx("p",{className:"mt-1 font-mono text-lg font-semibold tracking-widest",children:d})]})]}),s.jsxs("div",{className:"rounded-lg bg-muted p-4",children:[s.jsx("p",{className:"text-sm font-medium",children:n("qrCode.howTo.title")}),s.jsxs("ol",{className:"mt-2 space-y-1 text-sm text-muted-foreground",children:[s.jsxs("li",{children:["1. ",n("qrCode.howTo.step1")]}),s.jsxs("li",{children:["2. ",n("qrCode.howTo.step2")]}),s.jsxs("li",{children:["3. ",n("qrCode.howTo.step3")]}),s.jsxs("li",{children:["4. ",n("qrCode.howTo.step4")]}),s.jsxs("li",{children:["5. ",n("qrCode.howTo.step5")]})]})]}),s.jsxs("div",{className:"space-y-2 border-t border-border pt-4",children:[s.jsxs(Ve,{htmlFor:"pairing-phone",className:"flex items-center gap-2 text-sm",children:[s.jsx(az,{className:"h-4 w-4"}),n("qrCode.pairingCode.title")]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(G,{id:"pairing-phone",type:"tel",placeholder:"5511999999999",value:g,onChange:M=>x(M.target.value),disabled:b}),s.jsx(q,{type:"button",variant:"outline",onClick:N,disabled:!g.trim()||b,children:n(b?"qrCode.pairingCode.generating":"qrCode.pairingCode.generate")})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:n("qrCode.pairingCode.hint")})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(q,{variant:"outline",onClick:_,disabled:m,className:"flex-1",children:m?s.jsxs(s.Fragment,{children:[s.jsx(cc,{className:"mr-2 h-4 w-4 animate-spin"}),n("qrCode.button.refreshing")]}):s.jsxs(s.Fragment,{children:[s.jsx(cc,{className:"mr-2 h-4 w-4"}),n("qrCode.button.refresh")]})}),s.jsx(q,{variant:"outline",onClick:P,children:s.jsx(Uh,{className:"h-4 w-4"})})]})]})]})}):null}const FX=async({instanceToken:e,number:t,text:n})=>(await pn.post("/send/text",{number:t,text:n},{headers:{apikey:e}})).data;function LX({open:e,onOpenChange:t}){const{t:n}=Le(),{instance:r}=ft(),a=hn({number:he().min(1,n("sendMessage.validation.numberRequired")),message:he().min(1,n("sendMessage.validation.messageRequired"))}),{register:o,handleSubmit:l,reset:u,formState:{errors:d,isSubmitting:f}}=mn({resolver:gn(a),defaultValues:{number:"",message:""}}),m=async g=>{if(!r?.token){X.error(n("sendMessage.toast.noToken"));return}try{await FX({instanceToken:r.token,number:g.number,text:g.message}),X.success(n("sendMessage.toast.success")),u(),t(!1)}catch(x){console.error("Send message error:",x),X.error(n("sendMessage.toast.error"))}},h=()=>{u(),t(!1)};return r?s.jsx(yt,{open:e,onOpenChange:g=>g?t(!0):h(),children:s.jsxs(ht,{className:"sm:max-w-md",children:[s.jsxs(mt,{children:[s.jsxs(xt,{className:"flex items-center gap-2",children:[s.jsx(Gp,{className:"h-5 w-5 text-primary"}),n("sendMessage.title")]}),s.jsxs(Er,{children:[n("sendMessage.description")," ",s.jsx("strong",{children:r.name})]})]}),s.jsxs("form",{onSubmit:l(m),className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{htmlFor:"number",children:n("sendMessage.form.number.label")}),s.jsx(G,{id:"number",type:"text",placeholder:"5511999999999",disabled:f,...o("number")}),d.number&&s.jsx("p",{className:"text-sm text-rose-600",children:d.number.message})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{htmlFor:"message",children:n("sendMessage.form.message.label")}),s.jsx(Ps,{id:"message",rows:4,placeholder:n("sendMessage.form.message.placeholder"),disabled:f,...o("message")}),d.message&&s.jsx("p",{className:"text-sm text-rose-600",children:d.message.message})]}),s.jsxs(Wt,{className:"flex gap-2 sm:gap-0",children:[s.jsx(q,{type:"button",variant:"outline",onClick:h,disabled:f,children:n("button.cancel")}),s.jsx(q,{type:"submit",disabled:f,children:f?s.jsxs(s.Fragment,{children:[s.jsx(zh,{className:"mr-2 h-4 w-4 animate-spin"}),n("sendMessage.button.sending")]}):s.jsxs(s.Fragment,{children:[s.jsx(Gp,{className:"mr-2 h-4 w-4"}),n("sendMessage.button.send")]})})]})]})]})}):null}function $X(){const{t:e,i18n:t}=Le(),n=new Intl.NumberFormat(t.language),[r,a]=y.useState(null),[o,l]=y.useState(""),[u,d]=y.useState(!1),[f,m]=y.useState(!1),[h,g]=y.useState(null),x=hr(Fn.TOKEN),b=Tr()==="go",{theme:w}=Yi(),{connect:C,logout:k,restart:N}=Nc(),{instance:T,reloadInstance:_}=ft();y.useEffect(()=>{T&&(localStorage.setItem(Fn.INSTANCE_ID,T.id),localStorage.setItem(Fn.INSTANCE_NAME,T.name),localStorage.setItem(Fn.INSTANCE_TOKEN,T.token))},[T]);const P=async()=>{try{g("refresh"),await _(),X.success("Instance status refreshed")}catch{X.error("Could not refresh the instance status")}finally{g(null)}},M=async ue=>{try{g("restart"),await N(ue),await _(),X.success("Instance restart completed")}catch(V){console.error("Error:",V),X.error("Instance restart failed")}finally{g(null)}},O=async ue=>{try{g("disconnect"),await k(ue),await _(),X.success("Instance disconnected")}catch(V){console.error("Error:",V),X.error("Could not disconnect the instance")}finally{g(null)}},D=async(ue,V)=>{try{if(a(null),!x)return console.error("Token not found.");if(V){const ne=await C({instanceName:ue,token:x,number:T?.number});l(ne.pairingCode)}else{const ne=await C({instanceName:ue,token:x});a(ne.code)}}catch(ne){console.error("Error:",ne)}},F=async()=>{a(null),l(""),await _()},$=y.useMemo(()=>({contacts:T?._count?.Contact||0,chats:T?._count?.Chat||0,messages:T?._count?.Message||0}),[T]),te=y.useMemo(()=>w==="dark"?"#fff":w==="light"?"#000":"#189d68",[w]);if(!T)return s.jsx(Hn,{});const z=T.connectionStatus==="open";return s.jsxs("div",{className:"flex flex-col",children:[s.jsx(B_,{title:T.name,subtitle:T.profileName||e("instance.dashboard.subtitle",{defaultValue:"Manage your instance"}),secondaryActions:[{label:h==="refresh"?"Refreshing…":e("button.refresh",{defaultValue:"Refresh"}),icon:s.jsx(cc,{className:`h-4 w-4 ${h==="refresh"?"animate-spin":""}`}),onClick:P,disabled:h!==null},{label:h==="restart"?"Restarting…":e("instance.dashboard.button.restart",{defaultValue:"Restart"}),icon:s.jsx(pz,{className:"h-4 w-4"}),onClick:()=>M(T.name),disabled:h!==null},...z?[{label:h==="disconnect"?"Disconnecting…":e("instance.dashboard.button.disconnect",{defaultValue:"Disconnect"}),icon:s.jsx(rM,{className:"h-4 w-4"}),onClick:()=>O(T.name),variant:"destructive",disabled:h!==null}]:[],...b&&z?[{label:e("instance.dashboard.button.sendMessage",{defaultValue:"Send message"}),icon:s.jsx(Gp,{className:"h-4 w-4"}),onClick:()=>m(!0),variant:"default"}]:[]]}),s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsxs(Un,{className:"border-sidebar-border bg-sidebar",children:[s.jsx(Yn,{children:s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[T.profilePicUrl&&s.jsx(Ih,{className:"h-12 w-12",children:s.jsx(Oh,{src:T.profilePicUrl,alt:T.name})}),s.jsxs("div",{children:[s.jsx(Zn,{className:"break-all",children:T.profileName||T.name}),T.ownerJid&&s.jsx("p",{className:"mt-1 break-all text-xs text-muted-foreground",children:T.ownerJid.split("@")[0]})]})]}),s.jsx(IX,{status:T.connectionStatus})]})}),s.jsxs(Vn,{className:"flex flex-col items-start space-y-4",children:[s.jsx("div",{className:"w-full",children:s.jsx(AX,{token:T.token})}),!z&&s.jsxs(nI,{variant:"warning",className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsx(rI,{className:"text-lg font-bold tracking-wide",children:e("instance.dashboard.alert")}),b?s.jsxs(s.Fragment,{children:[s.jsxs(q,{onClick:()=>d(!0),children:[s.jsx(Kp,{className:"mr-2 h-4 w-4"}),e("instance.dashboard.button.qrcode.label")]}),s.jsx(DX,{open:u,onOpenChange:d})]}):s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsxs(yt,{children:[s.jsx(sn,{onClick:()=>D(T.name,!1),asChild:!0,children:s.jsxs(q,{children:[s.jsx(Kp,{className:"mr-2 h-4 w-4"}),e("instance.dashboard.button.qrcode.label")]})}),s.jsxs(ht,{onCloseAutoFocus:F,children:[s.jsx(mt,{children:e("instance.dashboard.button.qrcode.title")}),s.jsx("div",{className:"flex items-center justify-center py-4",children:r?s.jsx(RX,{value:r,size:256,bgColor:"transparent",fgColor:te,className:"rounded-sm"}):s.jsx(Hn,{})})]})]}),T.number&&s.jsxs(yt,{children:[s.jsx(sn,{asChild:!0,children:s.jsx(q,{variant:"outline",onClick:()=>D(T.name,!0),children:e("instance.dashboard.button.pairingCode.label")})}),s.jsx(ht,{onCloseAutoFocus:F,children:s.jsx(mt,{children:s.jsx(Er,{children:o?s.jsxs("div",{className:"py-3",children:[s.jsx("p",{className:"text-center font-semibold",children:e("instance.dashboard.button.pairingCode.title")}),s.jsxs("p",{className:"mt-2 text-center font-mono text-2xl tracking-widest",children:[o.substring(0,4),"-",o.substring(4,8)]})]}):s.jsx(Hn,{})})})})]})]})]})]}),s.jsx(fV,{})]}),b&&s.jsx(LX,{open:f,onOpenChange:m}),s.jsxs("section",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[s.jsxs(Un,{className:"border-sidebar-border bg-sidebar",children:[s.jsx(Yn,{children:s.jsxs(Zn,{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:[s.jsx(qB,{size:"18"}),e("instance.dashboard.contacts")]})}),s.jsx(Vn,{className:"text-3xl font-bold",children:n.format($.contacts)})]}),s.jsxs(Un,{className:"border-sidebar-border bg-sidebar",children:[s.jsx(Yn,{children:s.jsxs(Zn,{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:[s.jsx(wz,{size:"18"}),e("instance.dashboard.chats")]})}),s.jsx(Vn,{className:"text-3xl font-bold",children:n.format($.chats)})]}),s.jsxs(Un,{className:"border-sidebar-border bg-sidebar",children:[s.jsx(Yn,{children:s.jsxs(Zn,{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:[s.jsx(lc,{size:"18"}),e("instance.dashboard.messages")]})}),s.jsx(Vn,{className:"text-3xl font-bold",children:n.format($.messages)})]})]})]})]})}const xm=y.createContext(null);xm.displayName="PanelGroupContext";const $n={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},Mw=10,Li=y.useLayoutEffect,aE=Ho.useId,BX=typeof aE=="function"?aE:()=>null;let zX=0;function _w(e=null){const t=BX(),n=y.useRef(e||t||null);return n.current===null&&(n.current=""+zX++),e??n.current}function cI({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:a,forwardedRef:o,id:l,maxSize:u,minSize:d,onCollapse:f,onExpand:m,onResize:h,order:g,style:x,tagName:b="div",...w}){const C=y.useContext(xm);if(C===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:k,expandPanel:N,getPanelSize:T,getPanelStyle:_,groupId:P,isPanelCollapsed:M,reevaluatePanelConstraints:O,registerPanel:D,resizePanel:F,unregisterPanel:$}=C,te=_w(l),z=y.useRef({callbacks:{onCollapse:f,onExpand:m,onResize:h},constraints:{collapsedSize:n,collapsible:r,defaultSize:a,maxSize:u,minSize:d},id:te,idIsFromProps:l!==void 0,order:g});y.useRef({didLogMissingDefaultSizeWarning:!1}),Li(()=>{const{callbacks:V,constraints:ne}=z.current,Y={...ne};z.current.id=te,z.current.idIsFromProps=l!==void 0,z.current.order=g,V.onCollapse=f,V.onExpand=m,V.onResize=h,ne.collapsedSize=n,ne.collapsible=r,ne.defaultSize=a,ne.maxSize=u,ne.minSize=d,(Y.collapsedSize!==ne.collapsedSize||Y.collapsible!==ne.collapsible||Y.maxSize!==ne.maxSize||Y.minSize!==ne.minSize)&&O(z.current,Y)}),Li(()=>{const V=z.current;return D(V),()=>{$(V)}},[g,te,D,$]),y.useImperativeHandle(o,()=>({collapse:()=>{k(z.current)},expand:V=>{N(z.current,V)},getId(){return te},getSize(){return T(z.current)},isCollapsed(){return M(z.current)},isExpanded(){return!M(z.current)},resize:V=>{F(z.current,V)}}),[k,N,T,M,te,F]);const ue=_(z.current,a);return y.createElement(b,{...w,children:e,className:t,id:te,style:{...ue,...x},[$n.groupId]:P,[$n.panel]:"",[$n.panelCollapsible]:r||void 0,[$n.panelId]:te,[$n.panelSize]:parseFloat(""+ue.flexGrow).toFixed(1)})}const uI=y.forwardRef((e,t)=>y.createElement(cI,{...e,forwardedRef:t}));cI.displayName="Panel";uI.displayName="forwardRef(Panel)";let Xb=null,Dp=-1,Po=null;function UX(e,t,n){const r=(t&mI)!==0,a=(t&gI)!==0,o=(t&vI)!==0,l=(t&yI)!==0;if(t){if(r)return o?"se-resize":l?"ne-resize":"e-resize";if(a)return o?"sw-resize":l?"nw-resize":"w-resize";if(o)return"s-resize";if(l)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function VX(){Po!==null&&(document.head.removeChild(Po),Xb=null,Po=null,Dp=-1)}function Ty(e,t,n){var r,a;const o=UX(e,t);if(Xb!==o){if(Xb=o,Po===null&&(Po=document.createElement("style"),document.head.appendChild(Po)),Dp>=0){var l;(l=Po.sheet)===null||l===void 0||l.removeRule(Dp)}Dp=(r=(a=Po.sheet)===null||a===void 0?void 0:a.insertRule(`*{cursor: ${o} !important;}`))!==null&&r!==void 0?r:-1}}function dI(e){return e.type==="keydown"}function fI(e){return e.type.startsWith("pointer")}function pI(e){return e.type.startsWith("mouse")}function wm(e){if(fI(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(pI(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function qX(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function HX(e,t,n){return e.xt.x&&e.yt.y}function WX(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:lE(e),b:lE(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;Ft(r,"Stacking order can only be calculated for elements with a common ancestor");const a={a:iE(oE(n.a)),b:iE(oE(n.b))};if(a.a===a.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(a.a-a.b)}const KX=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function GX(e){var t;const n=getComputedStyle((t=hI(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function JX(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||GX(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"||KX.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function oE(e){let t=e.length;for(;t--;){const n=e[t];if(Ft(n,"Missing node"),JX(n))return n}return null}function iE(e){return e&&Number(getComputedStyle(e).zIndex)||0}function lE(e){const t=[];for(;e;)t.push(e),e=hI(e);return t}function hI(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const mI=1,gI=2,vI=4,yI=8,QX=qX()==="coarse";let Ys=[],nc=!1,Ro=new Map,Sm=new Map;const fd=new Set;function YX(e,t,n,r,a){var o;const{ownerDocument:l}=t,u={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:a},d=(o=Ro.get(l))!==null&&o!==void 0?o:0;return Ro.set(l,d+1),fd.add(u),mh(),function(){var m;Sm.delete(e),fd.delete(u);const h=(m=Ro.get(l))!==null&&m!==void 0?m:1;if(Ro.set(l,h-1),mh(),h===1&&Ro.delete(l),Ys.includes(u)){const g=Ys.indexOf(u);g>=0&&Ys.splice(g,1),Cm(),a("up",!0,null)}}}function ZX(e){const{target:t}=e,{x:n,y:r}=wm(e);nc=!0,Pw({target:t,x:n,y:r}),mh(),Ys.length>0&&(gh("down",e),Cm(),e.preventDefault(),bI(t)||e.stopImmediatePropagation())}function My(e){const{x:t,y:n}=wm(e);if(nc&&e.type!=="pointerleave"&&e.buttons===0&&(nc=!1,gh("up",e)),!nc){const{target:r}=e;Pw({target:r,x:t,y:n})}gh("move",e),Cm(),Ys.length>0&&e.preventDefault()}function _y(e){const{target:t}=e,{x:n,y:r}=wm(e);Sm.clear(),nc=!1,Ys.length>0&&(e.preventDefault(),bI(t)||e.stopImmediatePropagation()),gh("up",e),Pw({target:t,x:n,y:r}),Cm(),mh()}function bI(e){let t=e;for(;t;){if(t.hasAttribute($n.resizeHandle))return!0;t=t.parentElement}return!1}function Pw({target:e,x:t,y:n}){Ys.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),fd.forEach(a=>{const{element:o,hitAreaMargins:l}=a,u=o.getBoundingClientRect(),{bottom:d,left:f,right:m,top:h}=u,g=QX?l.coarse:l.fine;if(t>=f-g&&t<=m+g&&n>=h-g&&n<=d+g){if(r!==null&&document.contains(r)&&o!==r&&!o.contains(r)&&!r.contains(o)&&WX(r,o)>0){let b=r,w=!1;for(;b&&!b.contains(o);){if(HX(b.getBoundingClientRect(),u)){w=!0;break}b=b.parentElement}if(w)return}Ys.push(a)}})}function Py(e,t){Sm.set(e,t)}function Cm(){let e=!1,t=!1;Ys.forEach(r=>{const{direction:a}=r;a==="horizontal"?e=!0:t=!0});let n=0;Sm.forEach(r=>{n|=r}),e&&t?Ty("intersection",n):e?Ty("horizontal",n):t?Ty("vertical",n):VX()}let Ry;function mh(){var e;(e=Ry)===null||e===void 0||e.abort(),Ry=new AbortController;const t={capture:!0,signal:Ry.signal};fd.size&&(nc?(Ys.length>0&&Ro.forEach((n,r)=>{const{body:a}=r;n>0&&(a.addEventListener("contextmenu",_y,t),a.addEventListener("pointerleave",My,t),a.addEventListener("pointermove",My,t))}),Ro.forEach((n,r)=>{const{body:a}=r;a.addEventListener("pointerup",_y,t),a.addEventListener("pointercancel",_y,t)})):Ro.forEach((n,r)=>{const{body:a}=r;n>0&&(a.addEventListener("pointerdown",ZX,t),a.addEventListener("pointermove",My,t))}))}function gh(e,t){fd.forEach(n=>{const{setResizeHandlerState:r}=n,a=Ys.includes(n);r(e,a,t)})}function XX(){const[e,t]=y.useState(0);return y.useCallback(()=>t(n=>n+1),[])}function Ft(e,t){if(!e)throw console.error(t),Error(t)}function Qi(e,t,n=Mw){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function Da(e,t,n=Mw){return Qi(e,t,n)===0}function ls(e,t,n){return Qi(e,t,n)===0}function eee(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r0&&(e=e<0?0-k:k)}}}{const h=e<0?u:d,g=n[h];Ft(g,`No panel constraints found for index ${h}`);const{collapsedSize:x=0,collapsible:b,minSize:w=0}=g;if(b){const C=t[h];if(Ft(C!=null,`Previous layout not found for panel index ${h}`),ls(C,w)){const k=C-x;Qi(k,Math.abs(e))>0&&(e=e<0?0-k:k)}}}}{const h=e<0?1:-1;let g=e<0?d:u,x=0;for(;;){const w=t[g];Ft(w!=null,`Previous layout not found for panel index ${g}`);const k=Gl({panelConstraints:n,panelIndex:g,size:100})-w;if(x+=k,g+=h,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(eee(a,l))return a;{const h=e<0?d:u,g=t[h];Ft(g!=null,`Previous layout not found for panel index ${h}`);const x=g+f,b=Gl({panelConstraints:n,panelIndex:h,size:x});if(l[h]=b,!ls(b,x)){let w=x-b,k=e<0?d:u;for(;k>=0&&k0?k--:k++}}}const m=l.reduce((h,g)=>g+h,0);return ls(m,100)?l:a}function tee({layout:e,panelsArray:t,pivotIndices:n}){let r=0,a=100,o=0,l=0;const u=n[0];Ft(u!=null,"No pivot index found"),t.forEach((h,g)=>{const{constraints:x}=h,{maxSize:b=100,minSize:w=0}=x;g===u?(r=w,a=b):(o+=w,l+=b)});const d=Math.min(a,100-o),f=Math.max(r,100-l),m=e[u];return{valueMax:d,valueMin:f,valueNow:m}}function pd(e,t=document){return Array.from(t.querySelectorAll(`[${$n.resizeHandleId}][data-panel-group-id="${e}"]`))}function xI(e,t,n=document){const a=pd(e,n).findIndex(o=>o.getAttribute($n.resizeHandleId)===t);return a??null}function wI(e,t,n){const r=xI(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function nee(e){return e instanceof HTMLElement?!0:typeof e=="object"&&e!==null&&"tagName"in e&&"getAttribute"in e}function SI(e,t=document){if(nee(t)&&t.dataset.panelGroupId==e)return t;const n=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return n||null}function jm(e,t=document){const n=t.querySelector(`[${$n.resizeHandleId}="${e}"]`);return n||null}function ree(e,t,n,r=document){var a,o,l,u;const d=jm(t,r),f=pd(e,r),m=d?f.indexOf(d):-1,h=(a=(o=n[m])===null||o===void 0?void 0:o.id)!==null&&a!==void 0?a:null,g=(l=(u=n[m+1])===null||u===void 0?void 0:u.id)!==null&&l!==void 0?l:null;return[h,g]}function see({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:a,panelGroupElement:o,setLayout:l}){y.useRef({didWarnAboutMissingResizeHandle:!1}),Li(()=>{if(!o)return;const u=pd(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,a,o]),y.useEffect(()=>{if(!o)return;const u=t.current;Ft(u,"Eager values not found");const{panelDataArray:d}=u,f=SI(n,o);Ft(f!=null,`No group found for id "${n}"`);const m=pd(n,o);Ft(m,`No resize handles found for group id "${n}"`);const h=m.map(g=>{const x=g.getAttribute($n.resizeHandleId);Ft(x,"Resize handle element has no handle id attribute");const[b,w]=ree(n,x,d,o);if(b==null||w==null)return()=>{};const C=k=>{if(!k.defaultPrevented)switch(k.key){case"Enter":{k.preventDefault();const N=d.findIndex(T=>T.id===b);if(N>=0){const T=d[N];Ft(T,`No panel data found for index ${N}`);const _=r[N],{collapsedSize:P=0,collapsible:M,minSize:O=0}=T.constraints;if(_!=null&&M){const D=Wu({delta:ls(_,P)?O-P:P-_,initialLayout:r,panelConstraints:d.map(F=>F.constraints),pivotIndices:wI(n,x,o),prevLayout:r,trigger:"keyboard"});r!==D&&l(D)}}break}}};return g.addEventListener("keydown",C),()=>{g.removeEventListener("keydown",C)}});return()=>{h.forEach(g=>g())}},[o,e,t,n,r,a,l])}function cE(e,t){if(e.length!==t.length)return!1;for(let n=0;no.constraints);let r=0,a=100;for(let o=0;o{const o=e[a];Ft(o,`Panel data not found for index ${a}`);const{callbacks:l,constraints:u,id:d}=o,{collapsedSize:f=0,collapsible:m}=u,h=n[d];if(h==null||r!==h){n[d]=r;const{onCollapse:g,onExpand:x,onResize:b}=l;b&&b(r,h),m&&(g||x)&&(x&&(h==null||Da(h,f))&&!Da(r,f)&&x(),g&&(h==null||!Da(h,f))&&Da(r,f)&&g())}})}function rp(e,t){if(e.length!==t.length)return!1;for(let n=0;n{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...a)},t)}}function uE(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 jI(e){return`react-resizable-panels:${e}`}function kI(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:a,order:o}=t;return a?r:o?`${o}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function EI(e,t){try{const n=jI(e),r=t.getItem(n);if(r){const a=JSON.parse(r);if(typeof a=="object"&&a!=null)return a}}catch{}return null}function uee(e,t,n){var r,a;const o=(r=EI(e,n))!==null&&r!==void 0?r:{},l=kI(t);return(a=o[l])!==null&&a!==void 0?a:null}function dee(e,t,n,r,a){var o;const l=jI(e),u=kI(t),d=(o=EI(e,a))!==null&&o!==void 0?o:{};d[u]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{a.setItem(l,JSON.stringify(d))}catch(f){console.error(f)}}function dE({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(!ls(r,100)&&n.length>0)for(let o=0;o(uE(Ku),Ku.getItem(e)),setItem:(e,t)=>{uE(Ku),Ku.setItem(e,t)}},fE={};function NI({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:a,id:o=null,onLayout:l=null,keyboardResizeBy:u=null,storage:d=Ku,style:f,tagName:m="div",...h}){const g=_w(o),x=y.useRef(null),[b,w]=y.useState(null),[C,k]=y.useState([]),N=XX(),T=y.useRef({}),_=y.useRef(new Map),P=y.useRef(0),M=y.useRef({autoSaveId:e,direction:r,dragState:b,id:g,keyboardResizeBy:u,onLayout:l,storage:d}),O=y.useRef({layout:C,panelDataArray:[],panelDataArrayChanged:!1});y.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),y.useImperativeHandle(a,()=>({getId:()=>M.current.id,getLayout:()=>{const{layout:re}=O.current;return re},setLayout:re=>{const{onLayout:ee}=M.current,{layout:ie,panelDataArray:de}=O.current,j=dE({layout:re,panelConstraints:de.map(I=>I.constraints)});cE(ie,j)||(k(j),O.current.layout=j,ee&&ee(j),zl(de,j,T.current))}}),[]),Li(()=>{M.current.autoSaveId=e,M.current.direction=r,M.current.dragState=b,M.current.id=g,M.current.onLayout=l,M.current.storage=d}),see({committedValuesRef:M,eagerValuesRef:O,groupId:g,layout:C,panelDataArray:O.current.panelDataArray,setLayout:k,panelGroupElement:x.current}),y.useEffect(()=>{const{panelDataArray:re}=O.current;if(e){if(C.length===0||C.length!==re.length)return;let ee=fE[e];ee==null&&(ee=cee(dee,fee),fE[e]=ee);const ie=[...re],de=new Map(_.current);ee(e,ie,de,C,d)}},[e,C,d]),y.useEffect(()=>{});const D=y.useCallback(re=>{const{onLayout:ee}=M.current,{layout:ie,panelDataArray:de}=O.current;if(re.constraints.collapsible){const j=de.map(rt=>rt.constraints),{collapsedSize:I=0,panelSize:me,pivotIndices:xe}=Ei(de,re,ie);if(Ft(me!=null,`Panel size not found for panel "${re.id}"`),!Da(me,I)){_.current.set(re.id,me);const Je=Hl(de,re)===de.length-1?me-I:I-me,nt=Wu({delta:Je,initialLayout:ie,panelConstraints:j,pivotIndices:xe,prevLayout:ie,trigger:"imperative-api"});rp(ie,nt)||(k(nt),O.current.layout=nt,ee&&ee(nt),zl(de,nt,T.current))}}},[]),F=y.useCallback((re,ee)=>{const{onLayout:ie}=M.current,{layout:de,panelDataArray:j}=O.current;if(re.constraints.collapsible){const I=j.map(qt=>qt.constraints),{collapsedSize:me=0,panelSize:xe=0,minSize:rt=0,pivotIndices:Je}=Ei(j,re,de),nt=ee??rt;if(Da(xe,me)){const qt=_.current.get(re.id),Wn=qt!=null&&qt>=nt?qt:nt,tr=Hl(j,re)===j.length-1?xe-Wn:Wn-xe,wn=Wu({delta:tr,initialLayout:de,panelConstraints:I,pivotIndices:Je,prevLayout:de,trigger:"imperative-api"});rp(de,wn)||(k(wn),O.current.layout=wn,ie&&ie(wn),zl(j,wn,T.current))}}},[]),$=y.useCallback(re=>{const{layout:ee,panelDataArray:ie}=O.current,{panelSize:de}=Ei(ie,re,ee);return Ft(de!=null,`Panel size not found for panel "${re.id}"`),de},[]),te=y.useCallback((re,ee)=>{const{panelDataArray:ie}=O.current,de=Hl(ie,re);return lee({defaultSize:ee,dragState:b,layout:C,panelData:ie,panelIndex:de})},[b,C]),z=y.useCallback(re=>{const{layout:ee,panelDataArray:ie}=O.current,{collapsedSize:de=0,collapsible:j,panelSize:I}=Ei(ie,re,ee);return Ft(I!=null,`Panel size not found for panel "${re.id}"`),j===!0&&Da(I,de)},[]),ue=y.useCallback(re=>{const{layout:ee,panelDataArray:ie}=O.current,{collapsedSize:de=0,collapsible:j,panelSize:I}=Ei(ie,re,ee);return Ft(I!=null,`Panel size not found for panel "${re.id}"`),!j||Qi(I,de)>0},[]),V=y.useCallback(re=>{const{panelDataArray:ee}=O.current;ee.push(re),ee.sort((ie,de)=>{const j=ie.order,I=de.order;return j==null&&I==null?0:j==null?-1:I==null?1:j-I}),O.current.panelDataArrayChanged=!0,N()},[N]);Li(()=>{if(O.current.panelDataArrayChanged){O.current.panelDataArrayChanged=!1;const{autoSaveId:re,onLayout:ee,storage:ie}=M.current,{layout:de,panelDataArray:j}=O.current;let I=null;if(re){const xe=uee(re,j,ie);xe&&(_.current=new Map(Object.entries(xe.expandToSizes)),I=xe.layout)}I==null&&(I=iee({panelDataArray:j}));const me=dE({layout:I,panelConstraints:j.map(xe=>xe.constraints)});cE(de,me)||(k(me),O.current.layout=me,ee&&ee(me),zl(j,me,T.current))}}),Li(()=>{const re=O.current;return()=>{re.layout=[]}},[]);const ne=y.useCallback(re=>{let ee=!1;const ie=x.current;return ie&&window.getComputedStyle(ie,null).getPropertyValue("direction")==="rtl"&&(ee=!0),function(j){j.preventDefault();const I=x.current;if(!I)return()=>null;const{direction:me,dragState:xe,id:rt,keyboardResizeBy:Je,onLayout:nt}=M.current,{layout:qt,panelDataArray:Wn}=O.current,{initialLayout:Pn}=xe??{},tr=wI(rt,re,I);let wn=oee(j,re,me,xe,Je,I);const $r=me==="horizontal";$r&&ee&&(wn=-wn);const Br=Wn.map(B=>B.constraints),or=Wu({delta:wn,initialLayout:Pn??qt,panelConstraints:Br,pivotIndices:tr,prevLayout:qt,trigger:dI(j)?"keyboard":"mouse-or-touch"}),Mr=!rp(qt,or);(fI(j)||pI(j))&&P.current!=wn&&(P.current=wn,!Mr&&wn!==0?$r?Py(re,wn<0?mI:gI):Py(re,wn<0?vI:yI):Py(re,0)),Mr&&(k(or),O.current.layout=or,nt&&nt(or),zl(Wn,or,T.current))}},[]),Y=y.useCallback((re,ee)=>{const{onLayout:ie}=M.current,{layout:de,panelDataArray:j}=O.current,I=j.map(qt=>qt.constraints),{panelSize:me,pivotIndices:xe}=Ei(j,re,de);Ft(me!=null,`Panel size not found for panel "${re.id}"`);const Je=Hl(j,re)===j.length-1?me-ee:ee-me,nt=Wu({delta:Je,initialLayout:de,panelConstraints:I,pivotIndices:xe,prevLayout:de,trigger:"imperative-api"});rp(de,nt)||(k(nt),O.current.layout=nt,ie&&ie(nt),zl(j,nt,T.current))},[]),se=y.useCallback((re,ee)=>{const{layout:ie,panelDataArray:de}=O.current,{collapsedSize:j=0,collapsible:I}=ee,{collapsedSize:me=0,collapsible:xe,maxSize:rt=100,minSize:Je=0}=re.constraints,{panelSize:nt}=Ei(de,re,ie);nt!=null&&(I&&xe&&Da(nt,j)?Da(j,me)||Y(re,me):ntrt&&Y(re,rt))},[Y]),H=y.useCallback((re,ee)=>{const{direction:ie}=M.current,{layout:de}=O.current;if(!x.current)return;const j=jm(re,x.current);Ft(j,`Drag handle element not found for id "${re}"`);const I=CI(ie,ee);w({dragHandleId:re,dragHandleRect:j.getBoundingClientRect(),initialCursorPosition:I,initialLayout:de})},[]),W=y.useCallback(()=>{w(null)},[]),U=y.useCallback(re=>{const{panelDataArray:ee}=O.current,ie=Hl(ee,re);ie>=0&&(ee.splice(ie,1),delete T.current[re.id],O.current.panelDataArrayChanged=!0,N())},[N]),A=y.useMemo(()=>({collapsePanel:D,direction:r,dragState:b,expandPanel:F,getPanelSize:$,getPanelStyle:te,groupId:g,isPanelCollapsed:z,isPanelExpanded:ue,reevaluatePanelConstraints:se,registerPanel:V,registerResizeHandle:ne,resizePanel:Y,startDragging:H,stopDragging:W,unregisterPanel:U,panelGroupElement:x.current}),[D,b,r,F,$,te,g,z,ue,se,V,ne,Y,H,W,U]),K={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return y.createElement(xm.Provider,{value:A},y.createElement(m,{...h,children:t,className:n,id:o,ref:x,style:{...K,...f},[$n.group]:"",[$n.groupDirection]:r,[$n.groupId]:g}))}const TI=y.forwardRef((e,t)=>y.createElement(NI,{...e,forwardedRef:t}));NI.displayName="PanelGroup";TI.displayName="forwardRef(PanelGroup)";function Hl(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function Ei(e,t,n){const r=Hl(e,t),o=r===e.length-1?[r-1,r]:[r,r+1],l=n[r];return{...t.constraints,panelSize:l,pivotIndices:o}}function pee({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){y.useEffect(()=>{if(e||n==null||r==null)return;const a=jm(t,r);if(a==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=a.getAttribute($n.groupId);Ft(u,`No group element found for id "${u}"`);const d=pd(u,r),f=xI(u,t,r);Ft(f!==null,`No resize element found for id "${t}"`);const m=l.shiftKey?f>0?f-1:d.length-1:f+1{a.removeEventListener("keydown",o)}},[r,e,t,n])}function MI({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:a,onBlur:o,onClick:l,onDragging:u,onFocus:d,onPointerDown:f,onPointerUp:m,style:h={},tabIndex:g=0,tagName:x="div",...b}){var w,C;const k=y.useRef(null),N=y.useRef({onClick:l,onDragging:u,onPointerDown:f,onPointerUp:m});y.useEffect(()=>{N.current.onClick=l,N.current.onDragging=u,N.current.onPointerDown=f,N.current.onPointerUp=m});const T=y.useContext(xm);if(T===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:_,groupId:P,registerResizeHandle:M,startDragging:O,stopDragging:D,panelGroupElement:F}=T,$=_w(a),[te,z]=y.useState("inactive"),[ue,V]=y.useState(!1),[ne,Y]=y.useState(null),se=y.useRef({state:te});Li(()=>{se.current.state=te}),y.useEffect(()=>{if(n)Y(null);else{const A=M($);Y(()=>A)}},[n,$,M]);const H=(w=r?.coarse)!==null&&w!==void 0?w:15,W=(C=r?.fine)!==null&&C!==void 0?C:5;y.useEffect(()=>{if(n||ne==null)return;const A=k.current;Ft(A,"Element ref not attached");let K=!1;return YX($,A,_,{coarse:H,fine:W},(ee,ie,de)=>{if(!ie){z("inactive");return}switch(ee){case"down":{z("drag"),K=!1,Ft(de,'Expected event to be defined for "down" action'),O($,de);const{onDragging:j,onPointerDown:I}=N.current;j?.(!0),I?.();break}case"move":{const{state:j}=se.current;K=!0,j!=="drag"&&z("hover"),Ft(de,'Expected event to be defined for "move" action'),ne(de);break}case"up":{z("hover"),D();const{onClick:j,onDragging:I,onPointerUp:me}=N.current;I?.(!1),me?.(),K||j?.();break}}})},[H,_,n,W,M,$,ne,O,D]),pee({disabled:n,handleId:$,resizeHandler:ne,panelGroupElement:F});const U={touchAction:"none",userSelect:"none"};return y.createElement(x,{...b,children:e,className:t,id:a,onBlur:()=>{V(!1),o?.()},onFocus:()=>{V(!0),d?.()},ref:k,role:"separator",style:{...U,...h},tabIndex:g,[$n.groupDirection]:_,[$n.groupId]:P,[$n.resizeHandle]:"",[$n.resizeHandleActive]:te==="drag"?"pointer":ue?"keyboard":void 0,[$n.resizeHandleEnabled]:!n,[$n.resizeHandleId]:$,[$n.resizeHandleState]:te})}MI.displayName="PanelResizeHandle";function ai({className:e,...t}){return s.jsx(TI,{"data-slot":"resizable-panel-group",className:Et("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t})}function Nr({...e}){return s.jsx(uI,{"data-slot":"resizable-panel",...e})}function oi({withHandle:e,className:t,...n}){return s.jsx(MI,{"data-slot":"resizable-handle",className:Et("bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden 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-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),...n,children:e&&s.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:s.jsx(Z6,{className:"size-2.5"})})})}var hee=Symbol.for("react.lazy"),vh=Ho[" use ".trim().toString()];function mee(e){return typeof e=="object"&&e!==null&&"then"in e}function _I(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===hee&&"_payload"in e&&mee(e._payload)}function gee(e){const t=vee(e),n=y.forwardRef((r,a)=>{let{children:o,...l}=r;_I(o)&&typeof vh=="function"&&(o=vh(o._payload));const u=y.Children.toArray(o),d=u.find(bee);if(d){const f=d.props.children,m=u.map(h=>h===d?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:h);return s.jsx(t,{...l,ref:a,children:y.isValidElement(f)?y.cloneElement(f,void 0,m):null})}return s.jsx(t,{...l,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function vee(e){const t=y.forwardRef((n,r)=>{let{children:a,...o}=n;if(_I(a)&&typeof vh=="function"&&(a=vh(a._payload)),y.isValidElement(a)){const l=wee(a),u=xee(o,a.props);return a.type!==y.Fragment&&(u.ref=r?Jo(r,l):l),y.cloneElement(a,u)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var yee=Symbol("radix.slottable");function bee(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===yee}function xee(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...u)=>{const d=o(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function wee(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 See=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Cee=See.reduce((e,t)=>{const n=gee(`Primitive.${t}`),r=y.forwardRef((a,o)=>{const{asChild:l,...u}=a,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...u,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),jee="Separator",pE="horizontal",kee=["horizontal","vertical"],PI=y.forwardRef((e,t)=>{const{decorative:n,orientation:r=pE,...a}=e,o=Eee(r)?r:pE,u=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return s.jsx(Cee.div,{"data-orientation":o,...u,...a,ref:t})});PI.displayName=jee;function Eee(e){return kee.includes(e)}var Nee=PI;function Qt({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return s.jsx(Nee,{"data-slot":"separator",decorative:n,orientation:t,className:Et("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}const Tee=e=>["dify","fetchDify",JSON.stringify(e)],Mee=async({instanceName:e,token:t})=>(await Ce.get(`/dify/find/${e}`,{headers:{apikey:t}})).data,RI=e=>{const{instanceName:t,token:n,...r}=e;return gt({...r,queryKey:Tee({instanceName:t,token:n}),queryFn:()=>Mee({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},_ee=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/dify/create/${e}`,n,{headers:{apikey:t}})).data,Pee=async({instanceName:e,difyId:t,data:n})=>(await Ce.put(`/dify/update/${t}/${e}`,n)).data,Ree=async({instanceName:e,difyId:t})=>(await Ce.delete(`/dify/delete/${t}/${e}`)).data,Iee=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/dify/settings/${e}`,n,{headers:{apikey:t}})).data,Oee=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await Ce.post(`/dify/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function km(){const e=ot(Iee,{invalidateKeys:[["dify","fetchDefaultSettings"]]}),t=ot(Oee,{invalidateKeys:[["dify","getDify"],["dify","fetchSessions"]]}),n=ot(Ree,{invalidateKeys:[["dify","getDify"],["dify","fetchDify"],["dify","fetchSessions"]]}),r=ot(Pee,{invalidateKeys:[["dify","getDify"],["dify","fetchDify"],["dify","fetchSessions"]]}),a=ot(_ee,{invalidateKeys:[["dify","fetchDify"]]});return{setDefaultSettingsDify:e,changeStatusDify:t,deleteDify:n,updateDify:r,createDify:a}}const Aee=e=>["dify","fetchDefaultSettings",JSON.stringify(e)],Dee=async({instanceName:e,token:t})=>(await Ce.get(`/dify/fetchSettings/${e}`,{headers:{apikey:t}})).data,Fee=e=>{const{instanceName:t,token:n,...r}=e;return gt({...r,queryKey:Aee({instanceName:t,token:n}),queryFn:()=>Dee({instanceName:t,token:n}),enabled:!!t})},Lee=hn({expire:he(),keywordFinish:he(),delayMessage:he(),unknownMessage:he(),listeningFromMe:Me(),stopBotFromMe:Me(),keepOpen:Me(),debounceTime:he(),ignoreJids:As(he()).default([]),difyIdFallback:Mc([Tc(),he()]).optional(),splitMessages:Me(),timePerChar:he()});function $ee(){const{t:e}=Le(),{instance:t}=ft(),{setDefaultSettingsDify:n}=km(),[r,a]=y.useState(!1),{data:o,refetch:l}=RI({instanceName:t?.name,token:t?.token,enabled:r}),{data:u,refetch:d}=Fee({instanceName:t?.name,token:t?.token}),f=mn({resolver:gn(Lee),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 m=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}),X.success(e("dify.toast.defaultSettings.success"))}catch(x){console.error("Error:",x),X.error(`Error: ${x?.response?.data?.response?.message}`)}};function h(){d(),l()}return s.jsxs(yt,{open:r,onOpenChange:a,children:[s.jsx(sn,{asChild:!0,children:s.jsxs(q,{variant:"secondary",size:"sm",children:[s.jsx(Qo,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:e("dify.defaultSettings")})]})}),s.jsxs(ht,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:h,children:[s.jsx(mt,{children:s.jsx(xt,{children:e("dify.defaultSettings")})}),s.jsx(mr,{...f,children:s.jsxs("form",{className:"w-full space-y-6",onSubmit:f.handleSubmit(m),children:[s.jsx("div",{children:s.jsxs("div",{className:"space-y-4",children:[s.jsx(cn,{name:"difyIdFallback",label:e("dify.form.difyIdFallback.label"),options:o?.filter(g=>!!g.id).map(g=>({label:g.description,value:g.id}))??[]}),s.jsx(le,{name:"expire",label:e("dify.form.expire.label"),children:s.jsx(G,{type:"number"})}),s.jsx(le,{name:"keywordFinish",label:e("dify.form.keywordFinish.label"),children:s.jsx(G,{})}),s.jsx(le,{name:"delayMessage",label:e("dify.form.delayMessage.label"),children:s.jsx(G,{type:"number"})}),s.jsx(le,{name:"unknownMessage",label:e("dify.form.unknownMessage.label"),children:s.jsx(G,{})}),s.jsx(Re,{name:"listeningFromMe",label:e("dify.form.listeningFromMe.label"),reverse:!0}),s.jsx(Re,{name:"stopBotFromMe",label:e("dify.form.stopBotFromMe.label"),reverse:!0}),s.jsx(Re,{name:"keepOpen",label:e("dify.form.keepOpen.label"),reverse:!0}),s.jsx(le,{name:"debounceTime",label:e("dify.form.debounceTime.label"),children:s.jsx(G,{type:"number"})}),s.jsx(Re,{name:"splitMessages",label:e("dify.form.splitMessages.label"),reverse:!0}),s.jsx(le,{name:"timePerChar",label:e("dify.form.timePerChar.label"),children:s.jsx(G,{type:"number"})}),s.jsx(ri,{name:"ignoreJids",label:e("dify.form.ignoreJids.label"),placeholder:e("dify.form.ignoreJids.placeholder")})]})}),s.jsx(Wt,{children:s.jsx(q,{type:"submit",children:e("dify.button.save")})})]})})]})]})}var Em="Checkbox",[Bee]=ra(Em),[zee,Rw]=Bee(Em);function Uee(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:a,disabled:o,form:l,name:u,onCheckedChange:d,required:f,value:m="on",internal_do_not_use_render:h}=e,[g,x]=Ua({prop:n,defaultProp:a??!1,onChange:d,caller:Em}),[b,w]=y.useState(null),[C,k]=y.useState(null),N=y.useRef(!1),T=b?!!l||!!b.closest("form"):!0,_={checked:g,disabled:o,setChecked:x,control:b,setControl:w,name:u,form:l,value:m,hasConsumerStoppedPropagationRef:N,required:f,defaultChecked:Fo(a)?!1:a,isFormControl:T,bubbleInput:C,setBubbleInput:k};return s.jsx(zee,{scope:t,..._,children:Vee(h)?h(_):r})}var II="CheckboxTrigger",OI=y.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},a)=>{const{control:o,value:l,disabled:u,checked:d,required:f,setControl:m,setChecked:h,hasConsumerStoppedPropagationRef:g,isFormControl:x,bubbleInput:b}=Rw(II,e),w=tn(a,m),C=y.useRef(d);return y.useEffect(()=>{const k=o?.form;if(k){const N=()=>h(C.current);return k.addEventListener("reset",N),()=>k.removeEventListener("reset",N)}},[o,h]),s.jsx(wt.button,{type:"button",role:"checkbox","aria-checked":Fo(d)?"mixed":d,"aria-required":f,"data-state":BI(d),"data-disabled":u?"":void 0,disabled:u,value:l,...r,ref:w,onKeyDown:Ge(t,k=>{k.key==="Enter"&&k.preventDefault()}),onClick:Ge(n,k=>{h(N=>Fo(N)?!0:!N),b&&x&&(g.current=k.isPropagationStopped(),g.current||k.stopPropagation())})})});OI.displayName=II;var AI=y.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:a,defaultChecked:o,required:l,disabled:u,value:d,onCheckedChange:f,form:m,...h}=e;return s.jsx(Uee,{__scopeCheckbox:n,checked:a,defaultChecked:o,disabled:u,required:l,onCheckedChange:f,name:r,form:m,value:d,internal_do_not_use_render:({isFormControl:g})=>s.jsxs(s.Fragment,{children:[s.jsx(OI,{...h,ref:t,__scopeCheckbox:n}),g&&s.jsx($I,{__scopeCheckbox:n})]})})});AI.displayName=Em;var DI="CheckboxIndicator",FI=y.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,o=Rw(DI,n);return s.jsx(sa,{present:r||Fo(o.checked)||o.checked===!0,children:s.jsx(wt.span,{"data-state":BI(o.checked),"data-disabled":o.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});FI.displayName=DI;var LI="CheckboxBubbleInput",$I=y.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:a,checked:o,defaultChecked:l,required:u,disabled:d,name:f,value:m,form:h,bubbleInput:g,setBubbleInput:x}=Rw(LI,e),b=tn(n,x),w=pw(o),C=$x(r);y.useEffect(()=>{const N=g;if(!N)return;const T=window.HTMLInputElement.prototype,P=Object.getOwnPropertyDescriptor(T,"checked").set,M=!a.current;if(w!==o&&P){const O=new Event("click",{bubbles:M});N.indeterminate=Fo(o),P.call(N,Fo(o)?!1:o),N.dispatchEvent(O)}},[g,w,o,a]);const k=y.useRef(Fo(o)?!1:o);return s.jsx(wt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??k.current,required:u,disabled:d,name:f,value:m,form:h,...t,tabIndex:-1,ref:b,style:{...t.style,...C,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});$I.displayName=LI;function Vee(e){return typeof e=="function"}function Fo(e){return e==="indeterminate"}function BI(e){return Fo(e)?"indeterminate":e?"checked":"unchecked"}function es({className:e,...t}){return s.jsx(AI,{"data-slot":"checkbox",className:Et("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:s.jsx(FI,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:s.jsx(Jx,{className:"size-3.5"})})})}/** - * 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 Oo(e,t){return typeof e=="function"?e(t):e}function ms(e,t){return n=>{t.setState(r=>({...r,[e]:Oo(n,r[e])}))}}function Nm(e){return e instanceof Function}function qee(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function zI(e,t){const n=[],r=a=>{a.forEach(o=>{n.push(o);const l=t(o);l!=null&&l.length&&r(l)})};return r(e),n}function ut(e,t,n){let r=[],a;return o=>{let l;n.key&&n.debug&&(l=Date.now());const u=e(o);if(!(u.length!==r.length||u.some((m,h)=>r[h]!==m)))return a;r=u;let f;if(n.key&&n.debug&&(f=Date.now()),a=t(...u),n==null||n.onChange==null||n.onChange(a),n.key&&n.debug&&n!=null&&n.debug()){const m=Math.round((Date.now()-l)*100)/100,h=Math.round((Date.now()-f)*100)/100,g=h/16,x=(b,w)=>{for(b=String(b);b.length{var a;return(a=e?.debugAll)!=null?a:e[t]},key:!1,onChange:r}}function Hee(e,t,n,r){const a=()=>{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:a,getContext:ut(()=>[e,n,t,o],(l,u,d,f)=>({table:l,column:u,row:d,cell:f,getValue:f.getValue,renderValue:f.renderValue}),dt(e.options,"debugCells"))};return e._features.forEach(l=>{l.createCell==null||l.createCell(o,n,t,e)},{}),o}function Wee(e,t,n,r){var a,o;const u={...e._getDefaultColumnDef(),...t},d=u.accessorKey;let f=(a=(o=u.id)!=null?o:d?typeof String.prototype.replaceAll=="function"?d.replaceAll(".","_"):d.replace(/\./g,"_"):void 0)!=null?a:typeof u.header=="string"?u.header:void 0,m;if(u.accessorFn?m=u.accessorFn:d&&(d.includes(".")?m=g=>{let x=g;for(const w of d.split(".")){var b;x=(b=x)==null?void 0:b[w]}return x}:m=g=>g[u.accessorKey]),!f)throw new Error;let h={id:`${String(f)}`,accessorFn:m,parent:r,depth:n,columnDef:u,columns:[],getFlatColumns:ut(()=>[!0],()=>{var g;return[h,...(g=h.columns)==null?void 0:g.flatMap(x=>x.getFlatColumns())]},dt(e.options,"debugColumns")),getLeafColumns:ut(()=>[e._getOrderColumnsFn()],g=>{var x;if((x=h.columns)!=null&&x.length){let b=h.columns.flatMap(w=>w.getLeafColumns());return g(b)}return[h]},dt(e.options,"debugColumns"))};for(const g of e._features)g.createColumn==null||g.createColumn(h,e);return h}const Cr="debugHeaders";function hE(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 Kee={createTable:e=>{e.getHeaderGroups=ut(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,a)=>{var o,l;const u=(o=r?.map(h=>n.find(g=>g.id===h)).filter(Boolean))!=null?o:[],d=(l=a?.map(h=>n.find(g=>g.id===h)).filter(Boolean))!=null?l:[],f=n.filter(h=>!(r!=null&&r.includes(h.id))&&!(a!=null&&a.includes(h.id)));return sp(t,[...u,...f,...d],e)},dt(e.options,Cr)),e.getCenterHeaderGroups=ut(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,a)=>(n=n.filter(o=>!(r!=null&&r.includes(o.id))&&!(a!=null&&a.includes(o.id))),sp(t,n,e,"center")),dt(e.options,Cr)),e.getLeftHeaderGroups=ut(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var a;const o=(a=r?.map(l=>n.find(u=>u.id===l)).filter(Boolean))!=null?a:[];return sp(t,o,e,"left")},dt(e.options,Cr)),e.getRightHeaderGroups=ut(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var a;const o=(a=r?.map(l=>n.find(u=>u.id===l)).filter(Boolean))!=null?a:[];return sp(t,o,e,"right")},dt(e.options,Cr)),e.getFooterGroups=ut(()=>[e.getHeaderGroups()],t=>[...t].reverse(),dt(e.options,Cr)),e.getLeftFooterGroups=ut(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),dt(e.options,Cr)),e.getCenterFooterGroups=ut(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),dt(e.options,Cr)),e.getRightFooterGroups=ut(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),dt(e.options,Cr)),e.getFlatHeaders=ut(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),dt(e.options,Cr)),e.getLeftFlatHeaders=ut(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),dt(e.options,Cr)),e.getCenterFlatHeaders=ut(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),dt(e.options,Cr)),e.getRightFlatHeaders=ut(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),dt(e.options,Cr)),e.getCenterLeafHeaders=ut(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),dt(e.options,Cr)),e.getLeftLeafHeaders=ut(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),dt(e.options,Cr)),e.getRightLeafHeaders=ut(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),dt(e.options,Cr)),e.getLeafHeaders=ut(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var a,o,l,u,d,f;return[...(a=(o=t[0])==null?void 0:o.headers)!=null?a:[],...(l=(u=n[0])==null?void 0:u.headers)!=null?l:[],...(d=(f=r[0])==null?void 0:f.headers)!=null?d:[]].map(m=>m.getLeafHeaders()).flat()},dt(e.options,Cr))}};function sp(e,t,n,r){var a,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],N=C.column.depth===b.depth;let T,_=!1;if(N&&C.column.parent?T=C.column.parent:(T=C.column,_=!0),k&&k?.column===T)k.subHeaders.push(C);else{const P=hE(n,T,{id:[r,x,T.id,C?.id].filter(Boolean).join("_"),isPlaceholder:_,placeholderId:_?`${w.filter(M=>M.column===T).length}`:void 0,depth:x,index:w.length});P.subHeaders.push(C),w.push(P)}b.headers.push(C),C.headerGroup=b}),d.push(b),x>0&&f(w,x-1)},m=t.map((g,x)=>hE(n,g,{depth:l,index:x}));f(m,l-1),d.reverse();const h=g=>g.filter(b=>b.column.getIsVisible()).map(b=>{let w=0,C=0,k=[0];b.subHeaders&&b.subHeaders.length?(k=[],h(b.subHeaders).forEach(T=>{let{colSpan:_,rowSpan:P}=T;w+=_,k.push(P)})):w=1;const N=Math.min(...k);return C=C+N,b.colSpan=w,b.rowSpan=C,{colSpan:w,rowSpan:C}});return h((a=(o=d[0])==null?void 0:o.headers)!=null?a:[]),d}const Tm=(e,t,n,r,a,o,l)=>{let u={id:t,index:r,original:n,depth:a,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:()=>zI(u.subRows,d=>d.subRows),getParentRow:()=>u.parentId?e.getRow(u.parentId,!0):void 0,getParentRows:()=>{let d=[],f=u;for(;;){const m=f.getParentRow();if(!m)break;d.push(m),f=m}return d.reverse()},getAllCells:ut(()=>[e.getAllLeafColumns()],d=>d.map(f=>Hee(e,u,f,f.id)),dt(e.options,"debugRows")),_getAllCellsByColumnId:ut(()=>[u.getAllCells()],d=>d.reduce((f,m)=>(f[m.column.id]=m,f),{}),dt(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()}}},UI=(e,t,n)=>{var r;const a=n.toLowerCase();return!!(!((r=e.getValue(t))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(a))};UI.autoRemove=e=>Zs(e);const VI=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};VI.autoRemove=e=>Zs(e);const qI=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};qI.autoRemove=e=>Zs(e);const HI=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};HI.autoRemove=e=>Zs(e)||!(e!=null&&e.length);const WI=(e,t,n)=>!n.some(r=>{var a;return!((a=e.getValue(t))!=null&&a.includes(r))});WI.autoRemove=e=>Zs(e)||!(e!=null&&e.length);const KI=(e,t,n)=>n.some(r=>{var a;return(a=e.getValue(t))==null?void 0:a.includes(r)});KI.autoRemove=e=>Zs(e)||!(e!=null&&e.length);const GI=(e,t,n)=>e.getValue(t)===n;GI.autoRemove=e=>Zs(e);const JI=(e,t,n)=>e.getValue(t)==n;JI.autoRemove=e=>Zs(e);const Iw=(e,t,n)=>{let[r,a]=n;const o=e.getValue(t);return o>=r&&o<=a};Iw.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,a=typeof n!="number"?parseFloat(n):n,o=t===null||Number.isNaN(r)?-1/0:r,l=n===null||Number.isNaN(a)?1/0:a;if(o>l){const u=o;o=l,l=u}return[o,l]};Iw.autoRemove=e=>Zs(e)||Zs(e[0])&&Zs(e[1]);const Aa={includesString:UI,includesStringSensitive:VI,equalsString:qI,arrIncludes:HI,arrIncludesAll:WI,arrIncludesSome:KI,equals:GI,weakEquals:JI,inNumberRange:Iw};function Zs(e){return e==null||e===""}const Jee={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:ms("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"?Aa.includesString:typeof r=="number"?Aa.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Aa.equals:Array.isArray(r)?Aa.arrIncludes:Aa.weakEquals},e.getFilterFn=()=>{var n,r;return Nm(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:Aa[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,a;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((a=t.options.enableFilters)!=null?a:!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(a=>a.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const a=e.getFilterFn(),o=r?.find(m=>m.id===e.id),l=Oo(n,o?o.value:void 0);if(mE(a,l,e)){var u;return(u=r?.filter(m=>m.id!==e.id))!=null?u:[]}const d={id:e.id,value:l};if(o){var f;return(f=r?.map(m=>m.id===e.id?d:m))!=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=a=>{var o;return(o=Oo(t,a))==null?void 0:o.filter(l=>{const u=n.find(d=>d.id===l.id);if(u){const d=u.getFilterFn();if(mE(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 mE(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const Qee=(e,t,n)=>n.reduce((r,a)=>{const o=a.getValue(e);return r+(typeof o=="number"?o:0)},0),Yee=(e,t,n)=>{let r;return n.forEach(a=>{const o=a.getValue(e);o!=null&&(r>o||r===void 0&&o>=o)&&(r=o)}),r},Zee=(e,t,n)=>{let r;return n.forEach(a=>{const o=a.getValue(e);o!=null&&(r=o)&&(r=o)}),r},Xee=(e,t,n)=>{let r,a;return n.forEach(o=>{const l=o.getValue(e);l!=null&&(r===void 0?l>=l&&(r=a=l):(r>l&&(r=l),a{let n=0,r=0;if(t.forEach(a=>{let o=a.getValue(e);o!=null&&(o=+o)>=o&&(++n,r+=o)}),n)return r/n},tte=(e,t)=>{if(!t.length)return;const n=t.map(o=>o.getValue(e));if(!qee(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),a=n.sort((o,l)=>o-l);return n.length%2!==0?a[r]:(a[r-1]+a[r])/2},nte=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),rte=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,ste=(e,t)=>t.length,Iy={sum:Qee,min:Yee,max:Zee,extent:Xee,mean:ete,median:tte,unique:nte,uniqueCount:rte,count:ste},ate={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:ms("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 Iy.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Iy.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Nm(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:Iy[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 a;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((a=n.subRows)!=null&&a.length)}}};function ote(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 ite={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:ms("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=ut(n=>[Yu(t,n)],n=>n.findIndex(r=>r.id===e.id),dt(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=Yu(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const a=Yu(t,n);return((r=a[a.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=ut(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>a=>{let o=[];if(!(t!=null&&t.length))o=a;else{const l=[...t],u=[...a];for(;u.length&&l.length;){const d=l.shift(),f=u.findIndex(m=>m.id===d);f>-1&&o.push(u.splice(f,1)[0])}o=[...o,...u]}return ote(o,n,r)},dt(e.options,"debugTable"))}},Oy=()=>({left:[],right:[]}),lte={getInitialState:e=>({columnPinning:Oy(),...e}),getDefaultOptions:e=>({onColumnPinningChange:ms("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(a=>a.id).filter(Boolean);t.setColumnPinning(a=>{var o,l;if(n==="right"){var u,d;return{left:((u=a?.left)!=null?u:[]).filter(h=>!(r!=null&&r.includes(h))),right:[...((d=a?.right)!=null?d:[]).filter(h=>!(r!=null&&r.includes(h))),...r]}}if(n==="left"){var f,m;return{left:[...((f=a?.left)!=null?f:[]).filter(h=>!(r!=null&&r.includes(h))),...r],right:((m=a?.right)!=null?m:[]).filter(h=>!(r!=null&&r.includes(h)))}}return{left:((o=a?.left)!=null?o:[]).filter(h=>!(r!=null&&r.includes(h))),right:((l=a?.right)!=null?l:[]).filter(h=>!(r!=null&&r.includes(h)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var a,o,l;return((a=r.columnDef.enablePinning)!=null?a:!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:a}=t.getState().columnPinning,o=n.some(u=>r?.includes(u)),l=n.some(u=>a?.includes(u));return o?"left":l?"right":!1},e.getPinnedIndex=()=>{var n,r;const a=e.getIsPinned();return a?(n=(r=t.getState().columnPinning)==null||(r=r[a])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=ut(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,a)=>{const o=[...r??[],...a??[]];return n.filter(l=>!o.includes(l.column.id))},dt(t.options,"debugRows")),e.getLeftVisibleCells=ut(()=>[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"})),dt(t.options,"debugRows")),e.getRightVisibleCells=ut(()=>[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"})),dt(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?Oy():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Oy())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var a,o;return!!((a=r.left)!=null&&a.length||(o=r.right)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=ut(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(a=>a.id===r)).filter(Boolean),dt(e.options,"debugColumns")),e.getRightLeafColumns=ut(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(a=>a.id===r)).filter(Boolean),dt(e.options,"debugColumns")),e.getCenterLeafColumns=ut(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const a=[...n??[],...r??[]];return t.filter(o=>!a.includes(o.id))},dt(e.options,"debugColumns"))}},ap={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Ay=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),cte={getDefaultColumnDef:()=>ap,getInitialState:e=>({columnSizing:{},columnSizingInfo:Ay(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:ms("columnSizing",e),onColumnSizingInfoChange:ms("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,a;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),(a=e.columnDef.maxSize)!=null?a:ap.maxSize)},e.getStart=ut(n=>[n,Yu(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((a,o)=>a+o.getSize(),0),dt(t.options,"debugColumns")),e.getAfter=ut(n=>[n,Yu(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((a,o)=>a+o.getSize(),0),dt(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...a}=n;return a})},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=a=>{if(a.subHeaders.length)a.subHeaders.forEach(r);else{var o;n+=(o=a.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),a=r?.getCanResize();return o=>{if(!r||!a||(o.persist==null||o.persist(),Dy(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=Dy(o)?Math.round(o.touches[0].clientX):o.clientX,f={},m=(k,N)=>{typeof N=="number"&&(t.setColumnSizingInfo(T=>{var _,P;const M=t.options.columnResizeDirection==="rtl"?-1:1,O=(N-((_=T?.startOffset)!=null?_:0))*M,D=Math.max(O/((P=T?.startSize)!=null?P:0),-.999999);return T.columnSizingStart.forEach(F=>{let[$,te]=F;f[$]=Math.round(Math.max(te+te*D,0)*100)/100}),{...T,deltaOffset:O,deltaPercentage:D}}),(t.options.columnResizeMode==="onChange"||k==="end")&&t.setColumnSizing(T=>({...T,...f})))},h=k=>m("move",k),g=k=>{m("end",k),t.setColumnSizingInfo(N=>({...N,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},x=n||typeof document<"u"?document:null,b={moveHandler:k=>h(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()),h(k.touches[0].clientX),!1),upHandler:k=>{var N;x?.removeEventListener("touchmove",w.moveHandler),x?.removeEventListener("touchend",w.upHandler),k.cancelable&&(k.preventDefault(),k.stopPropagation()),g((N=k.touches[0])==null?void 0:N.clientX)}},C=ute()?{passive:!1}:!1;Dy(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?Ay():(n=e.initialState.columnSizingInfo)!=null?n:Ay())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,a)=>r+a.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,a)=>r+a.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,a)=>r+a.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,a)=>r+a.getSize(),0))!=null?t:0}}};let op=null;function ute(){if(typeof op=="boolean")return op;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 op=e,op}function Dy(e){return e.type==="touchstart"}const dte={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:ms("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 a=e.columns;return(n=a.length?a.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=ut(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),dt(t.options,"debugRows")),e.getVisibleCells=ut(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,a)=>[...n,...r,...a],dt(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>ut(()=>[r(),r().filter(a=>a.getIsVisible()).map(a=>a.id).join("_")],a=>a.filter(o=>o.getIsVisible==null?void 0:o.getIsVisible()),dt(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((a,o)=>({...a,[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 Yu(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const fte={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()}}},pte={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:ms("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,a,o;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((a=t.options.enableFilters)!=null?a:!0)&&((o=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?o:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Aa.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Nm(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Aa[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},hte={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:ms("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,a;if(!t){e._queue(()=>{t=!0});return}if((r=(a=e.options.autoResetAll)!=null?a: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 a,o;e.setExpanded(r?{}:(a=(o=e.initialState)==null?void 0:o.expanded)!=null?a:{})},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(a=>!a.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 a;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=(a=n)!=null?a:!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,a;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((a=e.subRows)!=null&&a.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()}}}},ex=0,tx=10,Fy=()=>({pageIndex:ex,pageSize:tx}),mte={getInitialState:e=>({...e,pagination:{...Fy(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:ms("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,a;if(!t){e._queue(()=>{t=!0});return}if((r=(a=e.options.autoResetAll)!=null?a:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const a=o=>Oo(r,o);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(a)},e.resetPagination=r=>{var a;e.setPagination(r?Fy():(a=e.initialState.pagination)!=null?a:Fy())},e.setPageIndex=r=>{e.setPagination(a=>{let o=Oo(r,a.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)),{...a,pageIndex:o}})},e.resetPageIndex=r=>{var a,o;e.setPageIndex(r?ex:(a=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageIndex)!=null?a:ex)},e.resetPageSize=r=>{var a,o;e.setPageSize(r?tx:(a=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageSize)!=null?a:tx)},e.setPageSize=r=>{e.setPagination(a=>{const o=Math.max(1,Oo(r,a.pageSize)),l=a.pageSize*a.pageIndex,u=Math.floor(l/o);return{...a,pageIndex:u,pageSize:o}})},e.setPageCount=r=>e.setPagination(a=>{var o;let l=Oo(r,(o=e.options.pageCount)!=null?o:-1);return typeof l=="number"&&(l=Math.max(-1,l)),{...a,pageCount:l}}),e.getPageOptions=ut(()=>[e.getPageCount()],r=>{let a=[];return r&&r>0&&(a=[...new Array(r)].fill(null).map((o,l)=>l)),a},dt(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,a=e.getPageCount();return a===-1?!0:a===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}}},Ly=()=>({top:[],bottom:[]}),gte={getInitialState:e=>({rowPinning:Ly(),...e}),getDefaultOptions:e=>({onRowPinningChange:ms("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,a)=>{const o=r?e.getLeafRows().map(d=>{let{id:f}=d;return f}):[],l=a?e.getParentRows().map(d=>{let{id:f}=d;return f}):[],u=new Set([...l,e.id,...o]);t.setRowPinning(d=>{var f,m;if(n==="bottom"){var h,g;return{top:((h=d?.top)!=null?h:[]).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:((m=d?.bottom)!=null?m:[]).filter(w=>!(u!=null&&u.has(w)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:a}=t.options;return typeof r=="function"?r(e):(n=r??a)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:a}=t.getState().rowPinning,o=n.some(u=>r?.includes(u)),l=n.some(u=>a?.includes(u));return o?"top":l?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const a=e.getIsPinned();if(!a)return-1;const o=(n=a==="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?Ly():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Ly())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var a,o;return!!((a=r.top)!=null&&a.length||(o=r.bottom)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var a;return((a=e.options.keepPinnedRows)==null||a?(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=ut(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),dt(e.options,"debugRows")),e.getBottomRows=ut(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),dt(e.options,"debugRows")),e.getCenterRows=ut(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const a=new Set([...n??[],...r??[]]);return t.filter(o=>!a.has(o.id))},dt(e.options,"debugRows"))}},vte={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:ms("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},a=e.getPreGroupedRowModel().flatRows;return t?a.forEach(o=>{o.getCanSelect()&&(r[o.id]=!0)}):a.forEach(o=>{delete r[o.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),a={...n};return e.getRowModel().rows.forEach(o=>{nx(a,o.id,r,!0,e)}),a}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=ut(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?$y(e,n):{rows:[],flatRows:[],rowsById:{}},dt(e.options,"debugTable")),e.getFilteredSelectedRowModel=ut(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?$y(e,n):{rows:[],flatRows:[],rowsById:{}},dt(e.options,"debugTable")),e.getGroupedSelectedRowModel=ut(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?$y(e,n):{rows:[],flatRows:[],rowsById:{}},dt(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(a=>a.getCanSelect()&&!n[a.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(a=>a.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(a=>!n[a.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 a=e.getIsSelected();t.setRowSelection(o=>{var l;if(n=typeof n<"u"?n:!a,e.getCanSelect()&&a===n)return o;const u={...o};return nx(u,e.id,n,(l=r?.selectChildren)!=null?l:!0,t),u})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Ow(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return rx(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return rx(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 a;n&&e.toggleSelected((a=r.target)==null?void 0:a.checked)}}}},nx=(e,t,n,r,a)=>{var o;const l=a.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=>nx(e,u.id,n,r,a))};function $y(e,t){const n=e.getState().rowSelection,r=[],a={},o=function(l,u){return l.map(d=>{var f;const m=Ow(d,n);if(m&&(r.push(d),a[d.id]=d),(f=d.subRows)!=null&&f.length&&(d={...d,subRows:o(d.subRows)}),m)return d}).filter(Boolean)};return{rows:o(t.rows),flatRows:r,rowsById:a}}function Ow(e,t){var n;return(n=t[e.id])!=null?n:!1}function rx(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let a=!0,o=!1;return e.subRows.forEach(l=>{if(!(o&&!a)&&(l.getCanSelect()&&(Ow(l,t)?o=!0:a=!1),l.subRows&&l.subRows.length)){const u=rx(l,t);u==="all"?o=!0:(u==="some"&&(o=!0),a=!1)}}),a?"all":o?"some":!1}const sx=/([0-9]+)/gm,yte=(e,t,n)=>QI(qo(e.getValue(n)).toLowerCase(),qo(t.getValue(n)).toLowerCase()),bte=(e,t,n)=>QI(qo(e.getValue(n)),qo(t.getValue(n))),xte=(e,t,n)=>Aw(qo(e.getValue(n)).toLowerCase(),qo(t.getValue(n)).toLowerCase()),wte=(e,t,n)=>Aw(qo(e.getValue(n)),qo(t.getValue(n))),Ste=(e,t,n)=>{const r=e.getValue(n),a=t.getValue(n);return r>a?1:rAw(e.getValue(n),t.getValue(n));function Aw(e,t){return e===t?0:e>t?1:-1}function qo(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function QI(e,t){const n=e.split(sx).filter(Boolean),r=t.split(sx).filter(Boolean);for(;n.length&&r.length;){const a=n.shift(),o=r.shift(),l=parseInt(a,10),u=parseInt(o,10),d=[l,u].sort();if(isNaN(d[0])){if(a>o)return 1;if(o>a)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 Lu={alphanumeric:yte,alphanumericCaseSensitive:bte,text:xte,textCaseSensitive:wte,datetime:Ste,basic:Cte},jte={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:ms("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const a of n){const o=a?.getValue(e.id);if(Object.prototype.toString.call(o)==="[object Date]")return Lu.datetime;if(typeof o=="string"&&(r=!0,o.split(sx).length>1))return Lu.alphanumeric}return r?Lu.text:Lu.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 Nm(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:Lu[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const a=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=[],m,h=o?n:a==="desc";if(l!=null&&l.length&&e.getCanMultiSort()&&r?u?m="toggle":m="add":l!=null&&l.length&&d!==l.length-1?m="replace":u?m="toggle":m="replace",m==="toggle"&&(o||a||(m="remove")),m==="add"){var g;f=[...l,{id:e.id,desc:h}],f.splice(0,f.length-((g=t.options.maxMultiSortColCount)!=null?g:Number.MAX_SAFE_INTEGER))}else m==="toggle"?f=l.map(x=>x.id===e.id?{...x,desc:h}:x):m==="remove"?f=l.filter(x=>x.id!==e.id):f=[{id:e.id,desc:h}];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,a;const o=e.getFirstSortDir(),l=e.getIsSorted();return l?l!==o&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(a=t.options.enableMultiRemove)!=null)||a)?!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(a=>a.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(a=>a.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())}},kte=[Kee,dte,ite,lte,Gee,Jee,fte,pte,jte,ate,hte,mte,gte,vte,cte];function Ete(e){var t,n;const r=[...kte,...(t=e._features)!=null?t:[]];let a={_features:r};const o=a._features.reduce((g,x)=>Object.assign(g,x.getDefaultOptions==null?void 0:x.getDefaultOptions(a)),{}),l=g=>a.options.mergeOptions?a.options.mergeOptions(o,g):{...o,...g};let d={...{},...(n=e.initialState)!=null?n:{}};a._features.forEach(g=>{var x;d=(x=g.getInitialState==null?void 0:g.getInitialState(d))!=null?x:d});const f=[];let m=!1;const h={_features:r,options:{...o,...e},initialState:d,_queue:g=>{f.push(g),m||(m=!0,Promise.resolve().then(()=>{for(;f.length;)f.shift()();m=!1}).catch(x=>setTimeout(()=>{throw x})))},reset:()=>{a.setState(a.initialState)},setOptions:g=>{const x=Oo(g,a.options);a.options=l(x)},getState:()=>a.options.state,setState:g=>{a.options.onStateChange==null||a.options.onStateChange(g)},_getRowId:(g,x,b)=>{var w;return(w=a.options.getRowId==null?void 0:a.options.getRowId(g,x,b))!=null?w:`${b?[b.id,x].join("."):x}`},getCoreRowModel:()=>(a._getCoreRowModel||(a._getCoreRowModel=a.options.getCoreRowModel(a)),a._getCoreRowModel()),getRowModel:()=>a.getPaginationRowModel(),getRow:(g,x)=>{let b=(x?a.getPrePaginationRowModel():a.getRowModel()).rowsById[g];if(!b&&(b=a.getCoreRowModel().rowsById[g],!b))throw new Error;return b},_getDefaultColumnDef:ut(()=>[a.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},...a._features.reduce((b,w)=>Object.assign(b,w.getDefaultColumnDef==null?void 0:w.getDefaultColumnDef()),{}),...g}},dt(e,"debugColumns")),_getColumnDefs:()=>a.options.columns,getAllColumns:ut(()=>[a._getColumnDefs()],g=>{const x=function(b,w,C){return C===void 0&&(C=0),b.map(k=>{const N=Wee(a,k,C,w),T=k;return N.columns=T.columns?x(T.columns,N,C+1):[],N})};return x(g)},dt(e,"debugColumns")),getAllFlatColumns:ut(()=>[a.getAllColumns()],g=>g.flatMap(x=>x.getFlatColumns()),dt(e,"debugColumns")),_getAllFlatColumnsById:ut(()=>[a.getAllFlatColumns()],g=>g.reduce((x,b)=>(x[b.id]=b,x),{}),dt(e,"debugColumns")),getAllLeafColumns:ut(()=>[a.getAllColumns(),a._getOrderColumnsFn()],(g,x)=>{let b=g.flatMap(w=>w.getLeafColumns());return x(b)},dt(e,"debugColumns")),getColumn:g=>a._getAllFlatColumnsById()[g]};Object.assign(a,h);for(let g=0;gut(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(a,o,l){o===void 0&&(o=0);const u=[];for(let f=0;fe._autoResetPageIndex()))}function Tte(e,t,n){return n.options.filterFromLeafRows?Mte(e,t,n):_te(e,t,n)}function Mte(e,t,n){var r;const a=[],o={},l=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,u=function(d,f){f===void 0&&(f=0);const m=[];for(let g=0;gut(()=>[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&&a.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,m;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 h=g=>{for(let x=0;xe._autoResetPageIndex()))}function Rte(){return e=>ut(()=>[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)),a=[],o={},l=function(d,f,m){if(f===void 0&&(f=0),f>=r.length)return d.map(b=>(b.depth=f,a.push(b),o[b.id]=b,b.subRows&&(b.subRows=l(b.subRows,f+1,b.id)),b));const h=r[f],g=Ite(d,h);return Array.from(g.entries()).map((b,w)=>{let[C,k]=b,N=`${h}:${C}`;N=m?`${m}>${N}`:N;const T=l(k,f+1,N);T.forEach(M=>{M.parentId=N});const _=f?zI(k,M=>M.subRows):k,P=Tm(e,N,_[0].original,w,f,void 0,m);return Object.assign(P,{groupingColumnId:h,groupingValue:C,subRows:T,leafRows:_,getValue:M=>{if(r.includes(M)){if(P._valuesCache.hasOwnProperty(M))return P._valuesCache[M];if(k[0]){var O;P._valuesCache[M]=(O=k[0].getValue(M))!=null?O:void 0}return P._valuesCache[M]}if(P._groupingValuesCache.hasOwnProperty(M))return P._groupingValuesCache[M];const D=e.getColumn(M),F=D?.getAggregationFn();if(F)return P._groupingValuesCache[M]=F(M,_,k),P._groupingValuesCache[M]}}),T.forEach(M=>{a.push(M),o[M.id]=M}),P})},u=l(n.rows,0);return u.forEach(d=>{a.push(d),o[d.id]=d}),{rows:u,flatRows:a,rowsById:o}},dt(e.options,"debugTable","getGroupedRowModel",()=>{e._queue(()=>{e._autoResetExpanded(),e._autoResetPageIndex()})}))}function Ite(e,t){const n=new Map;return e.reduce((r,a)=>{const o=`${a.getGroupingValue(t)}`,l=r.get(o);return l?l.push(a):r.set(o,[a]),r},n)}function Ote(){return e=>ut(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,a=[],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(m=>({...m}));return f.sort((m,h)=>{for(let x=0;x{var h;a.push(m),(h=m.subRows)!=null&&h.length&&(m.subRows=u(m.subRows))}),f};return{rows:u(n.rows),flatRows:a,rowsById:n.rowsById}},dt(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 gE(e,t){return e?Ate(e)?y.createElement(e,t):e:null}function Ate(e){return Dte(e)||typeof e=="function"||Fte(e)}function Dte(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Fte(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Lte(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=y.useState(()=>({current:Ete(t)})),[r,a]=y.useState(()=>n.current.initialState);return n.current.setOptions(o=>({...o,...e,state:{...r,...e.state},onStateChange:l=>{a(l),e.onStateChange==null||e.onStateChange(l)}})),n.current}function $te({className:e,...t}){return s.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:s.jsx("table",{"data-slot":"table",className:Et("w-full caption-bottom text-sm",e),...t})})}function Bte({className:e,...t}){return s.jsx("thead",{"data-slot":"table-header",className:Et("[&_tr]:border-b",e),...t})}function zte({className:e,...t}){return s.jsx("tbody",{"data-slot":"table-body",className:Et("[&_tr:last-child]:border-0",e),...t})}function ip({className:e,...t}){return s.jsx("tr",{"data-slot":"table-row",className:Et("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function Ute({className:e,...t}){return s.jsx("th",{"data-slot":"table-head",className:Et("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function By({className:e,...t}){return s.jsx("td",{"data-slot":"table-cell",className:Et("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function ii({columns:e,data:t,isLoading:n,loadingMessage:r,noResultsMessage:a,enableHeaders:o=!0,className:l,highlightedRows:u,...d}){const{t:f}=Le(),m=Lte({...d,data:t,columns:e,getCoreRowModel:Nte(),getFilteredRowModel:Pte(),getGroupedRowModel:Rte(),getSortedRowModel:Ote()});return s.jsx("div",{className:on("rounded-md border",l),children:s.jsxs($te,{children:[o&&s.jsx(Bte,{children:m.getHeaderGroups().map(h=>s.jsx(ip,{children:h.headers.map(g=>s.jsx(Ute,{children:g.isPlaceholder?null:gE(g.column.columnDef.header,g.getContext())},g.id))},h.id))}),s.jsx(zte,{children:n?s.jsx(ip,{children:s.jsx(By,{colSpan:e.length,className:"h-24 text-center text-muted-foreground",children:r??f("table.loading")})}):s.jsx(s.Fragment,{children:m.getRowModel().rows?.length?m.getRowModel().rows.map(h=>s.jsx(ip,{"data-state":h.getIsSelected()?"selected":u?.includes(h.id)?"highlighted":"",children:h.getVisibleCells().map(g=>s.jsx(By,{children:gE(g.column.columnDef.cell,g.getContext())},g.id))},h.id)):s.jsx(ip,{children:s.jsx(By,{colSpan:e.length,className:"h-24 text-center",children:a??f("table.noResults")})})})})]})})}const Vte=e=>["dify","fetchSessions",JSON.stringify(e)],qte=async({difyId:e,instanceName:t})=>(await Ce.get(`/dify/fetchSessions/${e}/${t}`)).data,Hte=e=>{const{difyId:t,instanceName:n,...r}=e;return gt({...r,queryKey:Vte({difyId:t,instanceName:n}),queryFn:()=>qte({difyId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0),staleTime:1e3*10})},lp={name:"",number:"",status:"all",time:"all",customCondition:"more",customValue:"",customUnit:"minutes"};function Wte(e,t){const n=parseInt(e);return!n||isNaN(n)||n<=0?null:t==="hours"?n*60:t==="days"?n*1440:n}function Kte(e,t){if(t.time==="all")return!0;const n=(Date.now()-new Date(e).getTime())/6e4;if(t.time==="custom"){const r=Wte(t.customValue,t.customUnit);return r===null?!0:t.customCondition==="more"?n>r:n<=r}if(t.time.startsWith(">")){const r=parseInt(t.time.slice(1));return n>r}return n<=parseInt(t.time)}function YI({difyId:e}){const{t}=Le(),{instance:n}=ft(),{changeStatusDify:r}=km(),[a,o]=y.useState(!1),[l,u]=y.useState([]),[d,f]=y.useState({}),[m,h]=y.useState(lp),[g,x]=y.useState(lp),[b,w]=y.useState(9),[C,k]=y.useState(9),[N,T]=y.useState("opened"),[_,P]=y.useState(!1),[M,O]=y.useState(""),[D,F]=y.useState(""),[$,te]=y.useState(!1),{data:z,refetch:ue}=Hte({instanceName:n?.name,difyId:e,enabled:a}),V=y.useMemo(()=>{const j=z??[],I=g.name.trim().toLowerCase(),me=g.number.trim();return j.filter(xe=>!(I&&!xe.pushName?.toLowerCase().includes(I)||me&&!xe.remoteJid.includes(me)||g.status!=="all"&&xe.status!==g.status||!Kte(xe.updatedAt,g)))},[z,g]),ne=V.slice(0,C),Y=y.useMemo(()=>Object.keys(d).filter(j=>d[j]).map(j=>ne[Number(j)]?.remoteJid).filter(Boolean),[d,ne]);y.useEffect(()=>{k(b),f({})},[g,b]);const se=()=>{ue()},H=()=>{x(m)},W=()=>{h(lp),x(lp)},U=async(j,I)=>{try{if(!n)return;await r({instanceName:n.name,token:n.token,remoteJid:j,status:I}),X.success(t("dify.toast.success.status")),se()}catch(me){console.error("Error:",me),X.error(`Error : ${me?.response?.data?.response?.message}`)}},A=async()=>{if(Y.length===0){X.error(t("sessions.mass.noneSelected"));return}try{if(!n)return;await Promise.all(Y.map(j=>r({instanceName:n.name,token:n.token,remoteJid:j,status:N}))),X.success(t("sessions.mass.success")),f({}),se()}catch(j){console.error(j),X.error(j?.response?.data?.response?.message??t("sessions.mass.error"))}},K=j=>{O(j),F(""),P(!0)},re=async()=>{if(!D.trim()){X.error(t("sessions.send.empty"));return}try{if(!n)return;te(!0),await Ce.post(`/message/sendText/${n.name}`,{number:M,text:D},{headers:{apikey:n.token}}),X.success(t("sessions.send.success")),P(!1),F(""),O("")}catch(j){console.error("Error:",j),X.error(j?.response?.data?.response?.message??j?.message??t("sessions.send.error"))}finally{te(!1)}},ee=[{id:"select",header:({table:j})=>s.jsx(es,{checked:j.getIsAllPageRowsSelected()||j.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:I=>j.toggleAllPageRowsSelected(!!I),"aria-label":t("sessions.mass.selectAll")}),cell:({row:j})=>s.jsx(es,{checked:j.getIsSelected(),onCheckedChange:I=>j.toggleSelected(!!I),"aria-label":t("sessions.mass.selectAll")}),enableSorting:!1},{accessorKey:"remoteJid",header:()=>s.jsx("div",{className:"text-center",children:t("dify.sessions.table.remoteJid")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>s.jsx("div",{className:"text-center",children:t("dify.sessions.table.pushName")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("pushName")})},{accessorKey:"sessionId",header:()=>s.jsx("div",{className:"text-center",children:t("dify.sessions.table.sessionId")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("sessionId")})},{accessorKey:"status",header:()=>s.jsx("div",{className:"text-center",children:t("dify.sessions.table.status")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:j})=>{const I=j.original;return s.jsxs(gs,{children:[s.jsx(vs,{asChild:!0,children:s.jsxs(q,{variant:"ghost",size:"icon",children:[s.jsx("span",{className:"sr-only",children:t("dify.sessions.table.actions.title")}),s.jsx(Yo,{className:"h-4 w-4"})]})}),s.jsxs(ys,{align:"end",children:[s.jsx(Zo,{children:t("dify.sessions.table.actions.title")}),s.jsx(Xo,{}),I.status!=="opened"&&s.jsxs(Ct,{onClick:()=>U(I.remoteJid,"opened"),children:[s.jsx(sl,{className:"mr-2 h-4 w-4"}),t("dify.sessions.table.actions.open")]}),I.status!=="paused"&&I.status!=="closed"&&s.jsxs(Ct,{onClick:()=>U(I.remoteJid,"paused"),children:[s.jsx(rl,{className:"mr-2 h-4 w-4"}),t("dify.sessions.table.actions.pause")]}),I.status!=="closed"&&s.jsxs(Ct,{onClick:()=>U(I.remoteJid,"closed"),children:[s.jsx(Xi,{className:"mr-2 h-4 w-4"}),t("dify.sessions.table.actions.close")]}),s.jsxs(Ct,{onClick:()=>K(I.remoteJid),children:[s.jsx(nl,{className:"mr-2 h-4 w-4"}),t("sessions.actions.sendMessage")]}),s.jsxs(Ct,{onClick:()=>U(I.remoteJid,"delete"),children:[s.jsx(el,{className:"mr-2 h-4 w-4"}),t("dify.sessions.table.actions.delete")]})]})]})}}],ie=["all","5","10","15","20","30","60",">60",">120",">300",">1440","custom"],de=["all","opened","paused","closed"];return s.jsxs(yt,{open:a,onOpenChange:o,children:[s.jsx(sn,{asChild:!0,children:s.jsxs(q,{variant:"secondary",size:"sm",children:[s.jsx(tl,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden md:inline",children:t("dify.sessions.label")})]})}),s.jsxs(ht,{className:"max-w-7xl h-[85vh] flex flex-col overflow-hidden",children:[s.jsx(mt,{children:s.jsx(xt,{children:t("dify.sessions.label")})}),s.jsxs("div",{className:"flex-1 space-y-4 overflow-y-auto pr-2",children:[s.jsxs(Un,{children:[s.jsx(Yn,{children:s.jsx(Zn,{className:"text-base",children:t("sessions.filters.title")})}),s.jsxs(Vn,{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.name")}),s.jsx(G,{placeholder:t("sessions.filters.namePlaceholder"),value:m.name,onChange:j=>h(I=>({...I,name:j.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.number")}),s.jsx(G,{placeholder:t("sessions.filters.numberPlaceholder"),value:m.number,onChange:j=>h(I=>({...I,number:j.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.status")}),s.jsxs(_t,{value:m.status,onValueChange:j=>h(I=>({...I,status:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsx(It,{children:de.map(j=>s.jsx(we,{value:j,children:t(`sessions.filters.statusOptions.${j}`)},j))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.time")}),s.jsxs(_t,{value:m.time,onValueChange:j=>h(I=>({...I,time:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsx(It,{children:ie.map(j=>s.jsx(we,{value:j,children:t(`sessions.filters.timeOptions.${j}`)},j))})]})]})]}),m.time==="custom"&&s.jsxs("div",{className:"grid grid-cols-1 gap-2 md:grid-cols-3",children:[s.jsxs(_t,{value:m.customCondition,onValueChange:j=>h(I=>({...I,customCondition:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"more",children:t("sessions.filters.custom.more")}),s.jsx(we,{value:"less",children:t("sessions.filters.custom.less")})]})]}),s.jsx(G,{type:"number",min:1,placeholder:t("sessions.filters.custom.valuePlaceholder"),value:m.customValue,onChange:j=>h(I=>({...I,customValue:j.target.value}))}),s.jsxs(_t,{value:m.customUnit,onValueChange:j=>h(I=>({...I,customUnit:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"minutes",children:t("sessions.filters.custom.minutes")}),s.jsx(we,{value:"hours",children:t("sessions.filters.custom.hours")}),s.jsx(we,{value:"days",children:t("sessions.filters.custom.days")})]})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(q,{onClick:H,size:"sm",children:t("sessions.filters.apply")}),s.jsx(q,{onClick:W,size:"sm",variant:"outline",children:t("sessions.filters.clear")}),s.jsxs(q,{onClick:se,size:"sm",variant:"outline",children:[s.jsx(al,{size:14,className:"mr-1"}),t("button.refresh")]})]})]})]}),Y.length>0&&s.jsxs(Un,{children:[s.jsx(Yn,{children:s.jsx(Zn,{className:"text-base",children:t("sessions.mass.title")})}),s.jsx(Vn,{children:s.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:t("sessions.mass.selected",{count:Y.length})}),s.jsxs("div",{className:"flex-1 min-w-[180px] space-y-1",children:[s.jsx(Ve,{children:t("sessions.mass.newStatus")}),s.jsxs(_t,{value:N,onValueChange:T,children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"opened",children:t("dify.sessions.table.actions.open")}),s.jsx(we,{value:"paused",children:t("dify.sessions.table.actions.pause")}),s.jsx(we,{value:"closed",children:t("dify.sessions.table.actions.close")}),s.jsx(we,{value:"delete",children:t("dify.sessions.table.actions.delete")})]})]})]}),s.jsx(q,{onClick:A,size:"sm",children:t("sessions.mass.apply")})]})})]}),s.jsx(ii,{columns:ee,data:ne,onSortingChange:u,state:{sorting:l,rowSelection:d},onRowSelectionChange:f,enableRowSelection:!0,getRowId:(j,I)=>String(I),noResultsMessage:t("sessions.empty")}),s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 px-1 text-sm text-muted-foreground",children:[s.jsx("span",{children:t("sessions.pagination.showing",{shown:ne.length,total:V.length})}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(Ve,{htmlFor:"per-page",className:"text-xs",children:t("sessions.pagination.perPage")}),s.jsxs(_t,{value:String(b),onValueChange:j=>w(parseInt(j)),children:[s.jsx(Rt,{id:"per-page",className:"h-8 w-20",children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"9",children:"9"}),s.jsx(we,{value:"25",children:"25"}),s.jsx(we,{value:"50",children:"50"}),s.jsx(we,{value:"100",children:"100"})]})]}),Ck(j=>Math.min(j+b,V.length)),children:t("sessions.pagination.showMore")}),Ck(V.length),children:t("sessions.pagination.showAll")}),C>b&&s.jsx(q,{size:"sm",variant:"outline",onClick:()=>k(b),children:t("sessions.pagination.showLess")})]})]})]}),s.jsx(yt,{open:_,onOpenChange:j=>!$&&P(j),children:s.jsxs(ht,{className:"sm:max-w-md",children:[s.jsx(mt,{children:s.jsx(xt,{children:t("sessions.send.title")})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{children:t("sessions.send.to")}),s.jsx(G,{value:M,disabled:!0})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{children:t("sessions.send.messagePlaceholder")}),s.jsx(ei,{rows:4,placeholder:t("sessions.send.messagePlaceholder"),value:D,onChange:j=>F(j.target.value)})]})]}),s.jsxs(Wt,{children:[s.jsx(q,{variant:"outline",onClick:()=>P(!1),disabled:$,children:t("button.cancel")}),s.jsx(q,{onClick:re,disabled:$,children:t($?"sessions.send.sending":"sessions.send.send")})]})]})})]})]})}const Gte=hn({enabled:Me(),description:he(),botType:he(),apiUrl:he(),apiKey:he(),triggerType:he(),triggerOperator:he().optional(),triggerValue:he().optional(),expire:at.number().optional(),keywordFinish:he().optional(),delayMessage:at.number().optional(),unknownMessage:he().optional(),listeningFromMe:Me().optional(),stopBotFromMe:Me().optional(),keepOpen:Me().optional(),debounceTime:at.number().optional(),splitMessages:Me().optional(),timePerChar:at.number().optional()});function ZI({initialData:e,onSubmit:t,handleDelete:n,difyId:r,isModal:a=!1,isLoading:o=!1,openDeletionDialog:l=!1,setOpenDeletionDialog:u=()=>{}}){const{t:d}=Le(),f=mn({resolver:gn(Gte),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}}),m=f.watch("triggerType");return s.jsx(mr,{...f,children:s.jsxs("form",{onSubmit:f.handleSubmit(t),className:"w-full space-y-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsx(Re,{name:"enabled",label:d("dify.form.enabled.label"),reverse:!0}),s.jsx(le,{name:"description",label:d("dify.form.description.label"),required:!0,children:s.jsx(G,{})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("dify.form.difySettings.label")}),s.jsx(Qt,{})]}),s.jsx(cn,{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"}]}),s.jsx(le,{name:"apiUrl",label:d("dify.form.apiUrl.label"),required:!0,children:s.jsx(G,{})}),s.jsx(le,{name:"apiKey",label:d("dify.form.apiKey.label"),required:!0,children:s.jsx(G,{type:"password"})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("dify.form.triggerSettings.label")}),s.jsx(Qt,{})]}),s.jsx(cn,{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"}]}),m==="keyword"&&s.jsxs(s.Fragment,{children:[s.jsx(cn,{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"}]}),s.jsx(le,{name:"triggerValue",label:d("dify.form.triggerValue.label"),children:s.jsx(G,{})})]}),m==="advanced"&&s.jsx(le,{name:"triggerValue",label:d("dify.form.triggerConditions.label"),children:s.jsx(G,{})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("dify.form.generalSettings.label")}),s.jsx(Qt,{})]}),s.jsx(le,{name:"expire",label:d("dify.form.expire.label"),children:s.jsx(G,{type:"number"})}),s.jsx(le,{name:"keywordFinish",label:d("dify.form.keywordFinish.label"),children:s.jsx(G,{})}),s.jsx(le,{name:"delayMessage",label:d("dify.form.delayMessage.label"),children:s.jsx(G,{type:"number"})}),s.jsx(le,{name:"unknownMessage",label:d("dify.form.unknownMessage.label"),children:s.jsx(G,{})}),s.jsx(Re,{name:"listeningFromMe",label:d("dify.form.listeningFromMe.label"),reverse:!0}),s.jsx(Re,{name:"stopBotFromMe",label:d("dify.form.stopBotFromMe.label"),reverse:!0}),s.jsx(Re,{name:"keepOpen",label:d("dify.form.keepOpen.label"),reverse:!0}),s.jsx(le,{name:"debounceTime",label:d("dify.form.debounceTime.label"),children:s.jsx(G,{type:"number"})}),s.jsx(Re,{name:"splitMessages",label:d("dify.form.splitMessages.label"),reverse:!0}),f.watch("splitMessages")&&s.jsx(le,{name:"timePerChar",label:d("dify.form.timePerChar.label"),children:s.jsx(G,{type:"number"})})]}),a&&s.jsx(Wt,{children:s.jsx(q,{disabled:o,type:"submit",children:d(o?"dify.button.saving":"dify.button.save")})}),!a&&s.jsxs("div",{children:[s.jsx(YI,{difyId:r}),s.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[s.jsxs(yt,{open:l,onOpenChange:u,children:[s.jsx(sn,{asChild:!0,children:s.jsx(q,{variant:"destructive",size:"sm",children:d("dify.button.delete")})}),s.jsx(ht,{children:s.jsxs(mt,{children:[s.jsx(xt,{children:d("modal.delete.title")}),s.jsx(Er,{children:d("modal.delete.messageSingle")}),s.jsxs(Wt,{children:[s.jsx(q,{size:"sm",variant:"outline",onClick:()=>u(!1),children:d("button.cancel")}),s.jsx(q,{variant:"destructive",onClick:n,children:d("button.delete")})]})]})})]}),s.jsx(q,{disabled:o,type:"submit",children:d(o?"dify.button.saving":"dify.button.update")})]})]})]})})}function Jte({resetTable:e}){const{t}=Le(),{instance:n}=ft(),[r,a]=y.useState(!1),[o,l]=y.useState(!1),{createDify:u}=km(),d=async f=>{try{if(!n||!n.name)throw new Error("instance not found");a(!0);const m={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:m}),X.success(t("dify.toast.success.create")),l(!1),e()}catch(m){console.error("Error:",m),X.error(`Error: ${m?.response?.data?.response?.message}`)}finally{a(!1)}};return s.jsxs(yt,{open:o,onOpenChange:l,children:[s.jsx(sn,{asChild:!0,children:s.jsxs(q,{size:"sm",children:[s.jsx(Zr,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:t("dify.button.create")})]})}),s.jsxs(ht,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[s.jsx(mt,{children:s.jsx(xt,{children:t("dify.form.title")})}),s.jsx(ZI,{onSubmit:d,isModal:!0,isLoading:r})]})]})}const Qte=e=>["dify","getDify",JSON.stringify(e)],Yte=async({difyId:e,instanceName:t})=>(await Ce.get(`/dify/fetch/${e}/${t}`)).data,Zte=e=>{const{difyId:t,instanceName:n,...r}=e;return gt({...r,queryKey:Qte({difyId:t,instanceName:n}),queryFn:()=>Yte({difyId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0)})};function Xte({difyId:e,resetTable:t}){const{t:n}=Le(),{instance:r}=ft(),a=Nn(),[o,l]=y.useState(!1),{deleteDify:u,updateDify:d}=km(),{data:f,isLoading:m}=Zte({difyId:e,instanceName:r?.name}),h=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}),X.success(n("dify.toast.success.update")),t(),a(`/manager/instance/${r.id}/dify/${e}`)}else console.error("Token not found")}catch(w){console.error("Error:",w),X.error(`Error: ${w?.response?.data?.response?.message}`)}},x=async()=>{try{r&&r.name&&e?(await u({instanceName:r.name,difyId:e}),X.success(n("dify.toast.success.delete")),l(!1),t(),a(`/manager/instance/${r.id}/dify`)):console.error("instance not found")}catch(b){console.error("Erro ao excluir dify:",b)}};return m?s.jsx(Hn,{}):s.jsx("div",{className:"m-4",children:s.jsx(ZI,{initialData:h,onSubmit:g,difyId:e,handleDelete:x,isModal:!1,isLoading:m,openDeletionDialog:o,setOpenDeletionDialog:l})})}function vE(){const{t:e}=Le(),t=Xa("(min-width: 768px)"),{instance:n}=ft(),{difyId:r}=Is(),{data:a,refetch:o,isLoading:l,error:u}=RI({instanceName:n?.name}),d=Nn(),f=h=>{n&&d(`/manager/instance/${n.id}/dify/${h}`)},m=()=>{o()};return s.jsx("main",{className:"pt-5",children:s.jsxs(oa,{error:u,name:"Dify",envVar:"DIFY_ENABLED",children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[s.jsx("h3",{className:"text-lg font-medium",children:e("dify.title")}),s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsx(YI,{}),s.jsx($ee,{}),s.jsx(Jte,{resetTable:m})]})]}),s.jsx(Qt,{className:"my-4"}),s.jsxs(ai,{direction:t?"horizontal":"vertical",children:[s.jsx(Nr,{defaultSize:r?35:100,className:"pr-4",children:s.jsx("div",{className:"flex flex-col gap-3",children:l?s.jsx(Hn,{}):s.jsx(s.Fragment,{children:a&&a.length>0&&Array.isArray(a)?a.map(h=>s.jsxs(q,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>f(`${h.id}`),variant:r===h.id?"secondary":"outline",children:[s.jsx("h4",{className:"text-base",children:h.description||h.id}),s.jsx("p",{className:"text-sm font-normal text-muted-foreground",children:h.botType})]},h.id)):s.jsx(q,{variant:"link",children:e("dify.table.none")})})})}),r&&s.jsxs(s.Fragment,{children:[s.jsx(oi,{withHandle:!0,className:"border border-border"}),s.jsx(Nr,{children:s.jsx(Xte,{difyId:r,resetTable:m})})]})]})]})})}const XI=y.createContext({instance:null,isLoading:!0,error:null});function ene({children:e}){const[t]=wc(),[n,r]=y.useState(null),[a,o]=y.useState(!0),[l,u]=y.useState(null);return y.useEffect(()=>{(async()=>{const f=t.get("token"),m=t.get("instanceName"),h=t.get("apiUrl");if(!f||!m||!h){u("Token, instanceName e apiUrl são obrigatórios"),o(!1);return}try{const g=h.endsWith("/")?h.slice(0,-1):h;localStorage.setItem(Fn.API_URL,g),localStorage.setItem(Fn.INSTANCE_TOKEN,f);const{data:x}=await un.get(`${g}/instance/fetchInstances?instanceName=${m}`,{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]),s.jsx(XI.Provider,{value:{instance:n,isLoading:a,error:l},children:e})}const Dw=()=>y.useContext(XI),Fw=y.createContext({}),tne=({children:e})=>{const[t,n]=y.useState(null);return s.jsx(Fw.Provider,{value:{replyingMessage:t,setReplyingMessage:n},children:e})},nne=e=>{const t=Math.floor(e/60),n=e%60,r=t<10?`${t}`:t,a=n<10?`0${n}`:n;return`${r}:${a}`},yE=200,rne=({imageMessage:e})=>s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("img",{src:e?.mediaUrl,alt:"Quoted message",width:100,height:100}),s.jsx(nz,{className:"mr-2 h-4 w-4 text-muted-foreground"})]}),s.jsx("span",{className:"inline-block max-w-40 overflow-hidden overflow-ellipsis whitespace-nowrap text-sm text-muted-foreground",children:e.caption})]}),sne=({videoMessage:e})=>s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("img",{src:e?.mediaUrl,alt:"Quoted message",width:100,height:100}),s.jsx(Sz,{className:"mr-2 h-4 w-4 text-muted-foreground"})]}),s.jsx("span",{className:"inline-block max-w-40 overflow-hidden overflow-ellipsis whitespace-nowrap text-sm text-muted-foreground",children:e.caption})]}),ane=({audioMessage:e})=>s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(sM,{className:"h-6 w-6 text-muted-foreground"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:nne(e.seconds)})]}),s.jsx("span",{className:"inline-block max-w-40 overflow-hidden overflow-ellipsis whitespace-nowrap text-sm text-muted-foreground",children:e.fileName})]}),one=({stickerMessage:e})=>s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("img",{src:e.mediaUrl,alt:"Sticker",width:100,height:100}),s.jsx(yz,{className:"h-6 w-6 text-muted-foreground"})]}),ine=({documentMessage:e})=>s.jsx("div",{className:"flex flex-col gap-2",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(_x,{className:"h-6 w-6 text-muted-foreground"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:e.fileName})]})}),lne=({documentMessage:e})=>s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(_x,{className:"h-6 w-6 text-muted-foreground"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:e.fileName})]}),s.jsx("span",{className:"inline-block max-w-40 overflow-hidden overflow-ellipsis whitespace-nowrap text-sm text-muted-foreground",children:e.caption})]}),cne=({contactMessage:e})=>s.jsx("div",{className:"flex flex-col gap-2",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Jp,{className:"h-6 w-6 text-muted-foreground"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:e.displayName})]})}),une=({locationMessage:e})=>s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(dz,{className:"h-6 w-6 text-muted-foreground"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:e.name})]}),s.jsx("span",{className:"inline-block max-w-40 text-sm text-muted-foreground",children:e.address})]}),dne=({conversation:e})=>s.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap text-sm text-muted-foreground",children:e.length>yE?`${e.substring(0,yE)}...`:e}),fne=({chat:e})=>{const{replyingMessage:t,setReplyingMessage:n}=y.useContext(Fw),r=()=>{n(null)},a=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 s.jsx(rne,{imageMessage:{caption:t?.message.imageMessage.caption,mediaUrl:t?.message.mediaUrl}});if(t?.messageType==="videoMessage")return s.jsx(sne,{videoMessage:{caption:t?.message.videoMessage.caption,mediaUrl:t?.message.mediaUrl}});if(t?.messageType==="audioMessage")return s.jsx(ane,{audioMessage:t?.message.audioMessage});if(t?.messageType==="stickerMessage")return s.jsx(one,{stickerMessage:t?.message});if(t?.messageType==="documentMessage")return s.jsx(ine,{documentMessage:{name:t?.message.documentMessage.name,mediaUrl:t?.message.mediaUrl}});if(t?.messageType==="documentWithCaptionMessage")return s.jsx(lne,{documentMessage:{name:t?.message.documentWithCaptionMessage.message.documentMessage.name,caption:t?.message.documentWithCaptionMessage.message.documentMessage.caption,mediaUrl:t?.message.mediaUrl}});if(t?.messageType==="contactMessage")return s.jsx(cne,{contactMessage:t?.message.contactMessage});if(t?.messageType==="locationMessage")return s.jsx(une,{locationMessage:t?.message.locationMessage});if(t?.messageType==="conversation"||t?.messageType==="interactiveMessage"||t?.messageType==="extendedTextMessage")return s.jsx(dne,{conversation:a(t?.message)})},{inputIconsMainColor:u,inputBackgroundColor:d}=si();return s.jsxs("div",{className:"relative flex items-center overflow-hidden rounded-lg dark:text-white",style:{backgroundColor:d},children:[s.jsx("div",{className:`absolute h-full w-1 rounded-l-lg ${t?.key.fromMe?"bg-blue-700 dark:bg-blue-300":"bg-blue-100"}`}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2 p-2 pl-4",children:[s.jsx("span",{className:`text-sm font-bold ${t?.key.fromMe?"text-blue-700 dark:text-blue-300":"text-blue-600"}`,children:o()}),l()]}),s.jsx(q,{size:"icon",variant:"ghost",className:"ml-auto h-10 w-10 shrink-0 rounded-full",onClick:r,style:{backgroundColor:d,color:u},children:s.jsx(Uh,{className:"h-6 w-6"})})]})},zy=[{name:"Smileys",icon:oM,emojis:["😀","😃","😄","😁","😆","😅","😂","🤣","😊","😇"]},{name:"Natureza",icon:F1,emojis:["🌿","🌱","🌳","🌴","🌵","🌷","🌸","🌹","🌺","🌻"]},{name:"Comida",icon:F1,emojis:["🍎","🍐","🍊","🍋","🍌","🍉","🍇","🍓","🍒","🍑"]},{name:"Atividades",icon:WB,emojis:["⚽️","🏀","🏈","⚾️","🎾","🏐","🏉","🎱","🏓","🏸"]},{name:"Viagem",icon:$B,emojis:["🚗","🚕","🚙","🚌","🚎","🏎","🚓","🚑","🚒","🚐"]},{name:"Objetos",icon:lz,emojis:["💡","🔦","🕯","🧳","⌛️","⏳","🌡","🧪","🧬","🔬"]},{name:"Símbolos",icon:ZB,emojis:["❤️","🧡","💛","💚","💙","💜","🖤","🤍","🤎","💔"]}];function pne({handleEmojiClick:e}){const{inputIconsMainColor:t}=si(),n=r=>zy.find(o=>o.name===r)?.emojis||[];return s.jsxs(gs,{children:[s.jsx(vs,{asChild:!0,children:s.jsxs(q,{type:"button",variant:"ghost",size:"icon",className:"rounded-full p-2",children:[s.jsx(oM,{className:"h-6 w-6",style:{color:t}}),s.jsx("span",{className:"sr-only",children:"Emojis"})]})}),s.jsx(ys,{className:"bg-background p-2",align:"end",children:s.jsxs(rw,{defaultValue:"Smileys",className:"w-full",children:[s.jsx(sw,{className:"grid grid-cols-8 gap-2",children:zy.map(r=>s.jsx(rh,{value:r.name,children:s.jsx(r.icon,{className:"h-5 w-5"})},r.name))}),zy.map(r=>s.jsx(sh,{value:r.name,children:s.jsx("div",{className:"grid grid-cols-8 gap-2",children:n(r.name).map((a,o)=>s.jsx(q,{variant:"ghost",className:"h-12 p-2 text-2xl",onClick:()=>e(a),children:a},o))})},r.name))]})})]})}const hne=({isSendingMessage:e,isRecording:t,audioBlob:n,elapsedTime:r,startRecording:a,stopRecording:o,clearRecording:l,sendAudioMessage:u,disabled:d})=>{const{inputIconsMainColor:f}=si();return s.jsxs("div",{className:"flex items-center gap-2",children:[t&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(q,{type:"button",size:"icon",variant:"ghost",className:"rounded-full p-2",onClick:o,children:s.jsx(vz,{className:"h-6 w-6 text-[#b03f3f]"})}),s.jsxs("span",{children:[r,"s"]})]}),n&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(q,{type:"button",size:"icon",variant:"ghost",className:"rounded-full p-2",disabled:e,onClick:l,children:s.jsx(xz,{className:"h-6 w-6 text-[#b03f3f]"})}),s.jsx("audio",{controls:!0,src:URL.createObjectURL(n)})]}),s.jsx(q,{type:"button",size:"icon",variant:"ghost",className:"rounded-full p-2",disabled:e||t||d,onClick:n?u:a,children:e?s.jsx(Hn,{className:"h-6 w-6",style:{color:f}}):n?s.jsx(Tx,{className:"h-6 w-6",style:{color:f}}):s.jsx(sM,{className:"h-6 w-6",style:{color:f}})})]})},mne=({isSendingMessage:e,sendMessage:t,disabled:n})=>{const{inputIconsMainColor:r}=si();return s.jsx(q,{type:"button",size:"icon",variant:"ghost",className:"rounded-full p-2",onClick:t,disabled:e||n,children:e?s.jsx(Hn,{className:"h-6 w-6",style:{color:r}}):s.jsx(Tx,{className:"h-6 w-6",style:{color:r}})})},gne=({chat:e})=>{const[t]=wc(),{inputBackgroundColor:n,inputTextForegroundColor:r}=si(),a=t.get("remoteJid"),{instance:o}=Dw(),{sendText:l}=QR(),{sendMedia:u}=YR(),{sendAudio:d}=oX(),{replyingMessage:f,setReplyingMessage:m}=y.useContext(Fw),h=y.useRef(null),g=y.useRef(null),x=y.useRef(null),[b,w]=y.useState(""),[C,k]=y.useState(!1),[N,T]=y.useState(null),[_,P]=y.useState(!1),[M,O]=y.useState(null),[D,F]=y.useState(0),{t:$}=Le();y.useEffect(()=>{m(null),T(null)},[a,m,T]);const te=ee=>{if(w(ee.target.value),h.current){h.current.style.height="auto";const ie=h.current.scrollHeight,j=parseInt(getComputedStyle(h.current).lineHeight)*10;h.current.style.height=`${Math.min(ie,j)}px`}},z=ee=>{if(w(ie=>ie+ee),h.current){h.current.style.height="auto";const ie=h.current.scrollHeight,j=parseInt(getComputedStyle(h.current).lineHeight)*10;h.current.style.height=`${Math.min(ie,j)}px`}},ue=async()=>{try{P(!0);const ee=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:44100,echoCancellation:!0,noiseSuppression:!0}});let ie="";const de=["audio/aac","audio/mp4","audio/mpeg","audio/amr","audio/ogg","audio/opus"];for(const me of de)if(MediaRecorder.isTypeSupported(me)){ie=me;break}if(!ie)throw new Error("Nenhum formato aceito pela Meta disponível");const j=new MediaRecorder(ee,{mimeType:ie,audioBitsPerSecond:128e3});x.current=j;const I=[];j.ondataavailable=me=>{me.data.size>0&&I.push(me.data)},j.onstop=()=>{const me=new Blob(I,{type:ie}),xe=new File([me],`audio.${ie.split("/")[1]}`,{type:ie,lastModified:Date.now()});O(xe)},j.start(),g.current=setInterval(()=>{F(me=>me+1)},1e3)}catch(ee){console.error("Erro ao iniciar gravação:",ee),X.error($("chat.toast.recordingError")),P(!1)}},V=()=>{x.current&&(x.current.stop(),g.current&&clearInterval(g.current),P(!1))},ne=()=>{O(null),F(0)},Y=ee=>{console.error("Error to send message",ee),X.error(XN(ee)?`${$("chat.toast.error")}: ${ee?.response?.data?.response?.message}`:$("chat.toast.sendError"))},se=()=>{k(!1),m(null)},H=async()=>{if(!o?.name||!o?.token||!a)return;const ee={instanceName:o.name,token:o.token,data:{number:a,text:b}};await l(ee,{onSuccess:()=>{w(""),h.current&&(h.current.style.height="auto")},onError:Y,onSettled:se})},W=async()=>{if(!(!o?.name||!o?.token||!N||!a)){k(!0);try{const ee=await new Promise((de,j)=>{const I=new FileReader;I.readAsDataURL(N),I.onload=()=>{const xe=I.result.split(",")[1];de(xe)},I.onerror=j}),ie={instanceName:o.name,token:o.token,data:{number:a,mediaMessage:{mediatype:N.type.split("/")[0]==="application"?"document":N.type.split("/")[0],mimetype:N.type,caption:b,media:ee,fileName:N.name}}};await u(ie,{onSuccess:()=>{T(null),w(""),h.current&&(h.current.style.height="auto")},onError:Y,onSettled:se})}catch(ee){console.error("Error converting media to base64:",ee),Y(ee),k(!1)}}},U=async()=>{if(!(!o?.name||!o?.token||!M||!a)){k(!0);try{const ee=await new Promise((de,j)=>{const I=new FileReader;I.readAsDataURL(M),I.onload=()=>{const xe=I.result.split(",")[1];de(xe)},I.onerror=j}),ie={instanceName:o.name,token:o.token,data:{number:a,audioMessage:{audio:ee}}};await d(ie,{onSuccess:()=>{O(null),F(0)},onError:Y,onSettled:se})}catch(ee){console.error("Error converting audio to base64:",ee),Y(ee),k(!1)}}},A=async()=>{k(!0),N?await W():await H()},K=()=>!b&&!N?s.jsx(hne,{isSendingMessage:C,isRecording:_,audioBlob:M,elapsedTime:D,startRecording:ue,stopRecording:V,clearRecording:ne,sendAudioMessage:U}):s.jsx(mne,{isSendingMessage:C,sendMessage:A}),re=()=>_||M?K():s.jsxs(s.Fragment,{children:[s.jsx(pne,{handleEmojiClick:z}),s.jsx(XR,{instance:o,setSelectedMedia:T}),s.jsx(Ps,{placeholder:$("chat.message.placeholder"),name:"message",id:"message",rows:1,ref:h,value:b,onChange:te,onKeyDown:ee=>{!ee.shiftKey&&ee.key==="Enter"&&!C&&(ee.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}}),K()]});return o?s.jsxs("div",{className:"input-container",children:[N&&s.jsx(eI,{selectedMedia:N,setSelectedMedia:T}),f&&s.jsx(fne,{chat:e}),s.jsx("div",{className:`flex items-end ${(_||M)&&"justify-end"} rounded-3xl px-4 py-1`,style:{backgroundColor:n,color:r},children:re()})]}):s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx("p",{className:"text-muted-foreground",children:$("chat.noInstance")||"Nenhuma instância selecionada"})})},vne=hn({remoteJid:he().min(1)});function yne({onSuccess:e}){const{t}=Le(),{primaryColor:n}=si(),r=mn({resolver:gn(vne),defaultValues:{remoteJid:""}}),a=o=>{e(o)};return s.jsx(Ya,{...r,children:s.jsxs("form",{onSubmit:r.handleSubmit(a),children:[s.jsx(Za,{control:r.control,name:"remoteJid",render:({field:o})=>s.jsxs(Ca,{children:[s.jsx(Xr,{children:t("chat.newChat.contact")}),s.jsx(ta,{children:s.jsx(G,{type:"text",placeholder:t("chat.newChat.placeholder"),...o})})]})}),s.jsx("div",{className:"flex justify-end",children:s.jsx(q,{type:"submit",className:"mt-4",style:{backgroundColor:n},children:t("chat.newChat.submit")})})]})})}function bne({isOpen:e,setIsOpen:t}){const[n]=wc(),{t:r}=Le(),a=Nn(),o=l=>{const u=new URLSearchParams(n);u.set("remoteJid",l.remoteJid),a(`/manager/embed-chat?${u.toString()}`),t(!1)};return s.jsx(yt,{open:e,onOpenChange:t,children:s.jsxs(ht,{className:"max-w-2xl",children:[s.jsxs(mt,{children:[s.jsx(xt,{children:r("chat.newChat.title")}),s.jsx(Er,{children:r("chat.newChat.description")})]}),s.jsx(yne,{onSuccess:o})]})})}const Uy=e=>e?e.replace("@s.whatsapp.net","").replace("@g.us",""):"";function xne(){const[e]=wc(),{backgroundColor:t,textForegroundColor:n,primaryColor:r}=si(),a=Xa("(min-width: 768px)"),{t:o}=Le(),l=Nn(),u=e.get("token"),{remoteJid:d}=Is(),f=d||e.get("remoteJid"),[m,h]=y.useState([]),g=y.useRef(null),x=y.useRef(null),[b,w]=y.useState(null),[C,k]=y.useState(!1),{instance:N}=Dw(),T=P=>{const M=new URLSearchParams(e);l(`/manager/embed-chat/${encodeURIComponent(P.remoteJid||P.id)}?${M.toString()}`)};y.useEffect(()=>{if(!N?.name)return;let P=!0;return(async()=>{try{const{data:O}=await Ce.post(`/chat/findChats/${N.name}`,{where:{}},{headers:{apikey:u||N.token}});P&&h(O||[])}catch(O){P&&(console.error("Erro ao buscar chats:",O),X.error("Erro ao buscar chats"))}})(),()=>{P=!1}},[N?.name,u]),y.useEffect(()=>{if(!N)return;const P=hr(Fn.API_URL);if(!P){console.error("API URL not found in localStorage");return}const M=localStorage.getItem("accessToken");u&&localStorage.setItem("accessToken",u);const O=Nw(P);function D(F,$){N&&$.instance===N.name&&h(te=>{const z=$?.data?.key?.remoteJid,ue=te.findIndex(Y=>Y.remoteJid&&Y.remoteJid===z||Y.id&&Y.id===z),V=ue!==-1?te[ue]:null,ne={id:z,remoteJid:z,pushName:V?.pushName||$?.data?.pushName||Uy(z),profilePicUrl:V?.profilePicUrl||$?.data?.key?.profilePictureUrl||"https://as2.ftcdn.net/jpg/05/89/93/27/1000_F_589932782_vQAEAZhHnq1QCGu5ikwrYaQD0Mmurm0N.jpg",updatedAt:new Date().toISOString(),labels:V?.labels||[],createdAt:V?.createdAt||new Date().toISOString(),instanceId:N.id};if(ue!==-1){const Y=[...te];return Y[ue]={...V,updatedAt:ne.updatedAt},Y}else return[...te,ne]})}return O.on("messages.upsert",F=>{D("messages.upsert",F)}),O.on("send.message",F=>{D("send.message",F)}),O.on("messages.update",F=>{}),O.connect(),()=>{O.off("messages.upsert"),O.off("send.message"),O.off("messages.update"),Tw(O),u?localStorage.setItem("accessToken",M||""):localStorage.removeItem("accessToken")}},[N,f,u]),y.useEffect(()=>{if(f){const P=m.find(M=>M.id===f);w(P||null)}},[f,m]);const _={backgroundColor:t,color:n};return s.jsx("div",{className:"relative h-full",style:_,children:s.jsxs(ai,{direction:a?"horizontal":"vertical",children:[s.jsx(Nr,{defaultSize:30,minSize:20,maxSize:60,children:s.jsxs("div",{className:"hidden flex-col gap-2 text-foreground md:flex",style:_,children:[s.jsx("div",{className:"sticky top-0 p-2",children:s.jsxs(q,{variant:"ghost",className:"w-full justify-start gap-2 px-2 text-left",onClick:()=>k(!0),style:{backgroundColor:r,color:n},children:[s.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-full",children:s.jsx(lc,{className:"h-4 w-4"})}),s.jsx("div",{className:"grow overflow-hidden text-ellipsis whitespace-nowrap text-sm",children:o("chat.title")}),s.jsx(Zr,{className:"h-4 w-4"})]})}),s.jsxs(rw,{defaultValue:"contacts",children:[s.jsxs(sw,{className:"tabs-chat",children:[s.jsx(rh,{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")}),s.jsx(rh,{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")})]}),s.jsx(sh,{value:"contacts",children:s.jsx("div",{className:"contacts-container",children:s.jsxs("div",{className:"grid gap-1 p-2 text-foreground",children:[s.jsx("div",{className:"px-2 text-xs font-medium text-muted-foreground",children:o("chat.contacts")}),m?.sort((P,M)=>new Date(M.lastMessage.messageTimestamp).getTime()-new Date(P.lastMessage.messageTimestamp).getTime()).map(P=>P?.id&&!P.id.includes("@g.us")&&s.jsxs("div",{onClick:()=>T(P),className:"chat-item flex cursor-pointer items-center overflow-hidden rounded-md p-2 text-sm transition-colors",style:{backgroundColor:f===P.id?r:""},children:[s.jsx("span",{className:"chat-avatar mr-2",children:s.jsx("img",{src:P.profilePicUrl||"https://as2.ftcdn.net/jpg/05/89/93/27/1000_F_589932782_vQAEAZhHnq1QCGu5ikwrYaQD0Mmurm0N.jpg",alt:"Avatar",className:"h-12 w-12 rounded-full"})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"chat-title font-medium",style:{color:n},children:P.pushName||Uy(P.id)}),s.jsx("span",{className:"text-xs",style:{color:n}})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsxs("span",{className:"text-xs font-bold",style:{color:n},children:[o("chat.recent"),":"," "]}),s.jsx("span",{className:"block truncate text-xs",style:{color:n}})]})]})]},P.id))]})})}),s.jsx(sh,{value:"groups",children:s.jsx("div",{className:"contacts-container",children:s.jsxs("div",{className:"grid gap-1 p-2 text-foreground",children:[s.jsx("div",{className:"px-2 text-xs font-medium text-muted-foreground",children:o("chat.groups")}),m?.sort((P,M)=>new Date(M.lastMessage.messageTimestamp).getTime()-new Date(P.lastMessage.messageTimestamp).getTime()).map(P=>P?.id&&P.id.includes("@g.us")&&s.jsxs("div",{onClick:()=>T(P),className:"chat-item flex cursor-pointer items-center overflow-hidden rounded-md p-2 text-sm transition-colors",style:{backgroundColor:f===P.id?r:""},children:[s.jsx("span",{className:"chat-avatar mr-2",children:s.jsx("img",{src:P.profilePicUrl||"https://as2.ftcdn.net/jpg/05/89/93/27/1000_F_589932782_vQAEAZhHnq1QCGu5ikwrYaQD0Mmurm0N.jpg",alt:"Avatar",className:"h-12 w-12 rounded-full"})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"chat-title font-medium",children:P.pushName}),s.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400"})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsxs("span",{className:"text-xs font-bold text-gray-500 dark:text-gray-400",children:[o("chat.recent")," "]}),s.jsx("span",{className:"block truncate text-xs text-gray-500"})]})]})]},P.id))]})})})]})]})}),s.jsx(oi,{withHandle:!0}),s.jsxs(Nr,{style:_,children:[f&&s.jsx(tne,{children:s.jsxs("div",{className:"flex h-full flex-col justify-between",style:_,children:[s.jsx("div",{className:"flex items-center gap-3 p-3",children:s.jsxs("div",{className:"flex flex-1 items-center gap-3",children:[s.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"}),s.jsx("div",{className:"flex flex-col",children:s.jsx("span",{className:"font-medium",children:b?.pushName||Uy(f)})})]})}),s.jsx(tI,{textareaRef:g,handleTextareaChange:()=>{},textareaHeight:"auto",lastMessageRef:x,scrollToBottom:()=>{x.current&&x.current.scrollIntoView({behavior:"smooth"})}}),s.jsx(gne,{chat:b})]})}),s.jsx(bne,{isOpen:C,setIsOpen:k})]})]})})}function wne(){const{instance:e,isLoading:t,error:n}=Dw();return t?s.jsx("div",{className:"flex h-screen items-center justify-center",children:s.jsx(Hn,{})}):n?s.jsx("div",{className:"flex h-screen items-center justify-center",children:s.jsx("div",{className:"rounded-md bg-red-50 p-4 dark:bg-red-900",children:s.jsx("span",{className:"text-red-800 dark:text-red-200",children:n})})}):e?s.jsx("div",{className:"h-screen",children:s.jsx(xne,{})}):null}function bE(){return s.jsx(QE,{client:eT,children:s.jsx(F_,{children:s.jsx(ene,{children:s.jsx(iX,{children:s.jsx(wne,{})})})})})}const Sne=e=>["evoai","fetchEvoai",JSON.stringify(e)],Cne=async({instanceName:e,token:t})=>(await Ce.get(`/evoai/find/${e}`,{headers:{apikey:t}})).data,eO=e=>{const{instanceName:t,token:n,...r}=e;return gt({...r,queryKey:Sne({instanceName:t,token:n}),queryFn:()=>Cne({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},jne=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/evoai/create/${e}`,n,{headers:{apikey:t}})).data,kne=async({instanceName:e,evoaiId:t,data:n})=>(await Ce.put(`/evoai/update/${t}/${e}`,n)).data,Ene=async({instanceName:e,evoaiId:t})=>(await Ce.delete(`/evoai/delete/${t}/${e}`)).data,Nne=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/evoai/settings/${e}`,n,{headers:{apikey:t}})).data,Tne=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await Ce.post(`/evoai/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function Mm(){const e=ot(Nne,{invalidateKeys:[["evoai","fetchDefaultSettings"]]}),t=ot(Tne,{invalidateKeys:[["evoai","getEvoai"],["evoai","fetchSessions"]]}),n=ot(Ene,{invalidateKeys:[["evoai","getEvoai"],["evoai","fetchEvoai"],["evoai","fetchSessions"]]}),r=ot(kne,{invalidateKeys:[["evoai","getEvoai"],["evoai","fetchEvoai"],["evoai","fetchSessions"]]}),a=ot(jne,{invalidateKeys:[["evoai","fetchEvoai"]]});return{setDefaultSettingsEvoai:e,changeStatusEvoai:t,deleteEvoai:n,updateEvoai:r,createEvoai:a}}const Mne=e=>["evoai","fetchDefaultSettings",JSON.stringify(e)],_ne=async({instanceName:e,token:t})=>(await Ce.get(`/evoai/fetchSettings/${e}`,{headers:{apikey:t}})).data,Pne=e=>{const{instanceName:t,token:n,...r}=e;return gt({...r,queryKey:Mne({instanceName:t,token:n}),queryFn:()=>_ne({instanceName:t,token:n}),enabled:!!t})},Rne=hn({expire:he(),keywordFinish:he(),delayMessage:he(),unknownMessage:he(),listeningFromMe:Me(),stopBotFromMe:Me(),keepOpen:Me(),debounceTime:he(),ignoreJids:As(he()).default([]),evoaiIdFallback:Mc([Tc(),he()]).optional(),splitMessages:Me(),timePerChar:he()});function Ine(){const{t:e}=Le(),{instance:t}=ft(),{setDefaultSettingsEvoai:n}=Mm(),[r,a]=y.useState(!1),{data:o,refetch:l}=eO({instanceName:t?.name,token:t?.token,enabled:r}),{data:u,refetch:d}=Pne({instanceName:t?.name,token:t?.token}),f=mn({resolver:gn(Rne),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 m=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}),X.success(e("evoai.toast.defaultSettings.success"))}catch(x){console.error("Error:",x),X.error(`Error: ${x?.response?.data?.response?.message}`)}};function h(){d(),l()}return s.jsxs(yt,{open:r,onOpenChange:a,children:[s.jsx(sn,{asChild:!0,children:s.jsxs(q,{variant:"secondary",size:"sm",children:[s.jsx(Qo,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:e("evoai.defaultSettings")})]})}),s.jsxs(ht,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:h,children:[s.jsx(mt,{children:s.jsx(xt,{children:e("evoai.defaultSettings")})}),s.jsx(mr,{...f,children:s.jsxs("form",{className:"w-full space-y-6",onSubmit:f.handleSubmit(m),children:[s.jsx("div",{children:s.jsxs("div",{className:"space-y-4",children:[s.jsx(cn,{name:"evoaiIdFallback",label:e("evoai.form.evoaiIdFallback.label"),options:o?.filter(g=>!!g.id).map(g=>({label:g.description,value:g.id}))??[]}),s.jsx(le,{name:"expire",label:e("evoai.form.expire.label"),children:s.jsx(G,{type:"number"})}),s.jsx(le,{name:"keywordFinish",label:e("evoai.form.keywordFinish.label"),children:s.jsx(G,{})}),s.jsx(le,{name:"delayMessage",label:e("evoai.form.delayMessage.label"),children:s.jsx(G,{type:"number"})}),s.jsx(le,{name:"unknownMessage",label:e("evoai.form.unknownMessage.label"),children:s.jsx(G,{})}),s.jsx(Re,{name:"listeningFromMe",label:e("evoai.form.listeningFromMe.label"),reverse:!0}),s.jsx(Re,{name:"stopBotFromMe",label:e("evoai.form.stopBotFromMe.label"),reverse:!0}),s.jsx(Re,{name:"keepOpen",label:e("evoai.form.keepOpen.label"),reverse:!0}),s.jsx(le,{name:"debounceTime",label:e("evoai.form.debounceTime.label"),children:s.jsx(G,{type:"number"})}),s.jsx(Re,{name:"splitMessages",label:e("evoai.form.splitMessages.label"),reverse:!0}),s.jsx(le,{name:"timePerChar",label:e("evoai.form.timePerChar.label"),children:s.jsx(G,{type:"number"})}),s.jsx(ri,{name:"ignoreJids",label:e("evoai.form.ignoreJids.label"),placeholder:e("evoai.form.ignoreJids.placeholder")})]})}),s.jsx(Wt,{children:s.jsx(q,{type:"submit",children:e("evoai.button.save")})})]})})]})]})}const One=e=>["evoai","fetchSessions",JSON.stringify(e)],Ane=async({evoaiId:e,instanceName:t})=>(await Ce.get(`/evoai/fetchSessions/${e}/${t}`)).data,Dne=e=>{const{evoaiId:t,instanceName:n,...r}=e;return gt({...r,queryKey:One({evoaiId:t,instanceName:n}),queryFn:()=>Ane({evoaiId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0),staleTime:1e3*10})},cp={name:"",number:"",status:"all",time:"all",customCondition:"more",customValue:"",customUnit:"minutes"};function Fne(e,t){const n=parseInt(e);return!n||isNaN(n)||n<=0?null:t==="hours"?n*60:t==="days"?n*1440:n}function Lne(e,t){if(t.time==="all")return!0;const n=(Date.now()-new Date(e).getTime())/6e4;if(t.time==="custom"){const r=Fne(t.customValue,t.customUnit);return r===null?!0:t.customCondition==="more"?n>r:n<=r}if(t.time.startsWith(">")){const r=parseInt(t.time.slice(1));return n>r}return n<=parseInt(t.time)}function tO({evoaiId:e}){const{t}=Le(),{instance:n}=ft(),{changeStatusEvoai:r}=Mm(),[a,o]=y.useState(!1),[l,u]=y.useState([]),[d,f]=y.useState({}),[m,h]=y.useState(cp),[g,x]=y.useState(cp),[b,w]=y.useState(9),[C,k]=y.useState(9),[N,T]=y.useState("opened"),[_,P]=y.useState(!1),[M,O]=y.useState(""),[D,F]=y.useState(""),[$,te]=y.useState(!1),{data:z,refetch:ue}=Dne({instanceName:n?.name,evoaiId:e,enabled:a}),V=y.useMemo(()=>{const j=z??[],I=g.name.trim().toLowerCase(),me=g.number.trim();return j.filter(xe=>!(I&&!xe.pushName?.toLowerCase().includes(I)||me&&!xe.remoteJid.includes(me)||g.status!=="all"&&xe.status!==g.status||!Lne(xe.updatedAt,g)))},[z,g]),ne=V.slice(0,C),Y=y.useMemo(()=>Object.keys(d).filter(j=>d[j]).map(j=>ne[Number(j)]?.remoteJid).filter(Boolean),[d,ne]);y.useEffect(()=>{k(b),f({})},[g,b]);const se=()=>{ue()},H=()=>{x(m)},W=()=>{h(cp),x(cp)},U=async(j,I)=>{try{if(!n)return;await r({instanceName:n.name,token:n.token,remoteJid:j,status:I}),X.success(t("evoai.toast.success.status")),se()}catch(me){console.error("Error:",me),X.error(`Error : ${me?.response?.data?.response?.message}`)}},A=async()=>{if(Y.length===0){X.error(t("sessions.mass.noneSelected"));return}try{if(!n)return;await Promise.all(Y.map(j=>r({instanceName:n.name,token:n.token,remoteJid:j,status:N}))),X.success(t("sessions.mass.success")),f({}),se()}catch(j){console.error(j),X.error(j?.response?.data?.response?.message??t("sessions.mass.error"))}},K=j=>{O(j),F(""),P(!0)},re=async()=>{if(!D.trim()){X.error(t("sessions.send.empty"));return}try{if(!n)return;te(!0),await Ce.post(`/message/sendText/${n.name}`,{number:M,text:D},{headers:{apikey:n.token}}),X.success(t("sessions.send.success")),P(!1),F(""),O("")}catch(j){console.error("Error:",j),X.error(j?.response?.data?.response?.message??j?.message??t("sessions.send.error"))}finally{te(!1)}},ee=[{id:"select",header:({table:j})=>s.jsx(es,{checked:j.getIsAllPageRowsSelected()||j.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:I=>j.toggleAllPageRowsSelected(!!I),"aria-label":t("sessions.mass.selectAll")}),cell:({row:j})=>s.jsx(es,{checked:j.getIsSelected(),onCheckedChange:I=>j.toggleSelected(!!I),"aria-label":t("sessions.mass.selectAll")}),enableSorting:!1},{accessorKey:"remoteJid",header:()=>s.jsx("div",{className:"text-center",children:t("evoai.sessions.table.remoteJid")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>s.jsx("div",{className:"text-center",children:t("evoai.sessions.table.pushName")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("pushName")})},{accessorKey:"sessionId",header:()=>s.jsx("div",{className:"text-center",children:t("evoai.sessions.table.sessionId")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("sessionId")})},{accessorKey:"status",header:()=>s.jsx("div",{className:"text-center",children:t("evoai.sessions.table.status")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:j})=>{const I=j.original;return s.jsxs(gs,{children:[s.jsx(vs,{asChild:!0,children:s.jsxs(q,{variant:"ghost",size:"icon",children:[s.jsx("span",{className:"sr-only",children:t("evoai.sessions.table.actions.title")}),s.jsx(Yo,{className:"h-4 w-4"})]})}),s.jsxs(ys,{align:"end",children:[s.jsx(Zo,{children:t("evoai.sessions.table.actions.title")}),s.jsx(Xo,{}),I.status!=="opened"&&s.jsxs(Ct,{onClick:()=>U(I.remoteJid,"opened"),children:[s.jsx(sl,{className:"mr-2 h-4 w-4"}),t("evoai.sessions.table.actions.open")]}),I.status!=="paused"&&I.status!=="closed"&&s.jsxs(Ct,{onClick:()=>U(I.remoteJid,"paused"),children:[s.jsx(rl,{className:"mr-2 h-4 w-4"}),t("evoai.sessions.table.actions.pause")]}),I.status!=="closed"&&s.jsxs(Ct,{onClick:()=>U(I.remoteJid,"closed"),children:[s.jsx(Xi,{className:"mr-2 h-4 w-4"}),t("evoai.sessions.table.actions.close")]}),s.jsxs(Ct,{onClick:()=>K(I.remoteJid),children:[s.jsx(nl,{className:"mr-2 h-4 w-4"}),t("sessions.actions.sendMessage")]}),s.jsxs(Ct,{onClick:()=>U(I.remoteJid,"delete"),children:[s.jsx(el,{className:"mr-2 h-4 w-4"}),t("evoai.sessions.table.actions.delete")]})]})]})}}],ie=["all","5","10","15","20","30","60",">60",">120",">300",">1440","custom"],de=["all","opened","paused","closed"];return s.jsxs(yt,{open:a,onOpenChange:o,children:[s.jsx(sn,{asChild:!0,children:s.jsxs(q,{variant:"secondary",size:"sm",children:[s.jsx(tl,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden md:inline",children:t("evoai.sessions.label")})]})}),s.jsxs(ht,{className:"max-w-7xl h-[85vh] flex flex-col overflow-hidden",children:[s.jsx(mt,{children:s.jsx(xt,{children:t("evoai.sessions.label")})}),s.jsxs("div",{className:"flex-1 space-y-4 overflow-y-auto pr-2",children:[s.jsxs(Un,{children:[s.jsx(Yn,{children:s.jsx(Zn,{className:"text-base",children:t("sessions.filters.title")})}),s.jsxs(Vn,{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.name")}),s.jsx(G,{placeholder:t("sessions.filters.namePlaceholder"),value:m.name,onChange:j=>h(I=>({...I,name:j.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.number")}),s.jsx(G,{placeholder:t("sessions.filters.numberPlaceholder"),value:m.number,onChange:j=>h(I=>({...I,number:j.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.status")}),s.jsxs(_t,{value:m.status,onValueChange:j=>h(I=>({...I,status:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsx(It,{children:de.map(j=>s.jsx(we,{value:j,children:t(`sessions.filters.statusOptions.${j}`)},j))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.time")}),s.jsxs(_t,{value:m.time,onValueChange:j=>h(I=>({...I,time:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsx(It,{children:ie.map(j=>s.jsx(we,{value:j,children:t(`sessions.filters.timeOptions.${j}`)},j))})]})]})]}),m.time==="custom"&&s.jsxs("div",{className:"grid grid-cols-1 gap-2 md:grid-cols-3",children:[s.jsxs(_t,{value:m.customCondition,onValueChange:j=>h(I=>({...I,customCondition:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"more",children:t("sessions.filters.custom.more")}),s.jsx(we,{value:"less",children:t("sessions.filters.custom.less")})]})]}),s.jsx(G,{type:"number",min:1,placeholder:t("sessions.filters.custom.valuePlaceholder"),value:m.customValue,onChange:j=>h(I=>({...I,customValue:j.target.value}))}),s.jsxs(_t,{value:m.customUnit,onValueChange:j=>h(I=>({...I,customUnit:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"minutes",children:t("sessions.filters.custom.minutes")}),s.jsx(we,{value:"hours",children:t("sessions.filters.custom.hours")}),s.jsx(we,{value:"days",children:t("sessions.filters.custom.days")})]})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(q,{onClick:H,size:"sm",children:t("sessions.filters.apply")}),s.jsx(q,{onClick:W,size:"sm",variant:"outline",children:t("sessions.filters.clear")}),s.jsxs(q,{onClick:se,size:"sm",variant:"outline",children:[s.jsx(al,{size:14,className:"mr-1"}),t("button.refresh")]})]})]})]}),Y.length>0&&s.jsxs(Un,{children:[s.jsx(Yn,{children:s.jsx(Zn,{className:"text-base",children:t("sessions.mass.title")})}),s.jsx(Vn,{children:s.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:t("sessions.mass.selected",{count:Y.length})}),s.jsxs("div",{className:"flex-1 min-w-[180px] space-y-1",children:[s.jsx(Ve,{children:t("sessions.mass.newStatus")}),s.jsxs(_t,{value:N,onValueChange:T,children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"opened",children:t("evoai.sessions.table.actions.open")}),s.jsx(we,{value:"paused",children:t("evoai.sessions.table.actions.pause")}),s.jsx(we,{value:"closed",children:t("evoai.sessions.table.actions.close")}),s.jsx(we,{value:"delete",children:t("evoai.sessions.table.actions.delete")})]})]})]}),s.jsx(q,{onClick:A,size:"sm",children:t("sessions.mass.apply")})]})})]}),s.jsx(ii,{columns:ee,data:ne,onSortingChange:u,state:{sorting:l,rowSelection:d},onRowSelectionChange:f,enableRowSelection:!0,getRowId:(j,I)=>String(I),noResultsMessage:t("sessions.empty")}),s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 px-1 text-sm text-muted-foreground",children:[s.jsx("span",{children:t("sessions.pagination.showing",{shown:ne.length,total:V.length})}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(Ve,{htmlFor:"per-page",className:"text-xs",children:t("sessions.pagination.perPage")}),s.jsxs(_t,{value:String(b),onValueChange:j=>w(parseInt(j)),children:[s.jsx(Rt,{id:"per-page",className:"h-8 w-20",children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"9",children:"9"}),s.jsx(we,{value:"25",children:"25"}),s.jsx(we,{value:"50",children:"50"}),s.jsx(we,{value:"100",children:"100"})]})]}),Ck(j=>Math.min(j+b,V.length)),children:t("sessions.pagination.showMore")}),Ck(V.length),children:t("sessions.pagination.showAll")}),C>b&&s.jsx(q,{size:"sm",variant:"outline",onClick:()=>k(b),children:t("sessions.pagination.showLess")})]})]})]}),s.jsx(yt,{open:_,onOpenChange:j=>!$&&P(j),children:s.jsxs(ht,{className:"sm:max-w-md",children:[s.jsx(mt,{children:s.jsx(xt,{children:t("sessions.send.title")})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{children:t("sessions.send.to")}),s.jsx(G,{value:M,disabled:!0})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{children:t("sessions.send.messagePlaceholder")}),s.jsx(ei,{rows:4,placeholder:t("sessions.send.messagePlaceholder"),value:D,onChange:j=>F(j.target.value)})]})]}),s.jsxs(Wt,{children:[s.jsx(q,{variant:"outline",onClick:()=>P(!1),disabled:$,children:t("button.cancel")}),s.jsx(q,{onClick:re,disabled:$,children:t($?"sessions.send.sending":"sessions.send.send")})]})]})})]})]})}const $ne=hn({enabled:Me(),description:he(),agentUrl:he(),apiKey:he(),triggerType:he(),triggerOperator:he().optional(),triggerValue:he().optional(),expire:at.number().optional(),keywordFinish:he().optional(),delayMessage:at.number().optional(),unknownMessage:he().optional(),listeningFromMe:Me().optional(),stopBotFromMe:Me().optional(),keepOpen:Me().optional(),debounceTime:at.number().optional(),splitMessages:Me().optional(),timePerChar:at.number().optional()});function nO({initialData:e,onSubmit:t,handleDelete:n,evoaiId:r,isModal:a=!1,isLoading:o=!1,openDeletionDialog:l=!1,setOpenDeletionDialog:u=()=>{}}){const{t:d}=Le(),f=mn({resolver:gn($ne),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}}),m=f.watch("triggerType");return s.jsx(mr,{...f,children:s.jsxs("form",{onSubmit:f.handleSubmit(t),className:"w-full space-y-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsx(Re,{name:"enabled",label:d("evoai.form.enabled.label"),reverse:!0}),s.jsx(le,{name:"description",label:d("evoai.form.description.label"),children:s.jsx(G,{})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("evoai.form.evoaiSettings.label")}),s.jsx(Qt,{})]}),s.jsx(le,{name:"agentUrl",label:d("evoai.form.agentUrl.label"),required:!0,children:s.jsx(G,{})}),s.jsx(le,{name:"apiKey",label:d("evoai.form.apiKey.label"),className:"flex-1",children:s.jsx(G,{type:"password"})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("evoai.form.triggerSettings.label")}),s.jsx(Qt,{})]}),s.jsx(cn,{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"}]}),m==="keyword"&&s.jsxs(s.Fragment,{children:[s.jsx(cn,{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"}]}),s.jsx(le,{name:"triggerValue",label:d("evoai.form.triggerValue.label"),children:s.jsx(G,{})})]}),m==="advanced"&&s.jsx(le,{name:"triggerValue",label:d("evoai.form.triggerConditions.label"),children:s.jsx(G,{})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("evoai.form.generalSettings.label")}),s.jsx(Qt,{})]}),s.jsx(le,{name:"expire",label:d("evoai.form.expire.label"),children:s.jsx(G,{type:"number"})}),s.jsx(le,{name:"keywordFinish",label:d("evoai.form.keywordFinish.label"),children:s.jsx(G,{})}),s.jsx(le,{name:"delayMessage",label:d("evoai.form.delayMessage.label"),children:s.jsx(G,{type:"number"})}),s.jsx(le,{name:"unknownMessage",label:d("evoai.form.unknownMessage.label"),children:s.jsx(G,{})}),s.jsx(Re,{name:"listeningFromMe",label:d("evoai.form.listeningFromMe.label"),reverse:!0}),s.jsx(Re,{name:"stopBotFromMe",label:d("evoai.form.stopBotFromMe.label"),reverse:!0}),s.jsx(Re,{name:"keepOpen",label:d("evoai.form.keepOpen.label"),reverse:!0}),s.jsx(le,{name:"debounceTime",label:d("evoai.form.debounceTime.label"),children:s.jsx(G,{type:"number"})}),s.jsx(Re,{name:"splitMessages",label:d("evoai.form.splitMessages.label"),reverse:!0}),f.watch("splitMessages")&&s.jsx(le,{name:"timePerChar",label:d("evoai.form.timePerChar.label"),children:s.jsx(G,{type:"number"})})]}),a&&s.jsx(Wt,{children:s.jsx(q,{disabled:o,type:"submit",children:d(o?"evoai.button.saving":"evoai.button.save")})}),!a&&s.jsxs("div",{children:[s.jsx(tO,{evoaiId:r}),s.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[s.jsxs(yt,{open:l,onOpenChange:u,children:[s.jsx(sn,{asChild:!0,children:s.jsx(q,{variant:"destructive",size:"sm",children:d("evoai.button.delete")})}),s.jsx(ht,{children:s.jsxs(mt,{children:[s.jsx(xt,{children:d("modal.delete.title")}),s.jsx(Er,{children:d("modal.delete.messageSingle")}),s.jsxs(Wt,{children:[s.jsx(q,{size:"sm",variant:"outline",onClick:()=>u(!1),children:d("button.cancel")}),s.jsx(q,{variant:"destructive",onClick:n,children:d("button.delete")})]})]})})]}),s.jsx(q,{disabled:o,type:"submit",children:d(o?"evoai.button.saving":"evoai.button.update")})]})]})]})})}function Bne({resetTable:e}){const{t}=Le(),{instance:n}=ft(),[r,a]=y.useState(!1),[o,l]=y.useState(!1),{createEvoai:u}=Mm(),d=async f=>{try{if(!n||!n.name)throw new Error("instance not found");a(!0);const m={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:m}),X.success(t("evoai.toast.success.create")),l(!1),e()}catch(m){console.error("Error:",m),X.error(`Error: ${m?.response?.data?.response?.message}`)}finally{a(!1)}};return s.jsxs(yt,{open:o,onOpenChange:l,children:[s.jsx(sn,{asChild:!0,children:s.jsxs(q,{size:"sm",children:[s.jsx(Zr,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:t("evoai.button.create")})]})}),s.jsxs(ht,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[s.jsx(mt,{children:s.jsx(xt,{children:t("evoai.form.title")})}),s.jsx(nO,{onSubmit:d,isModal:!0,isLoading:r})]})]})}const zne=e=>["evoai","getEvoai",JSON.stringify(e)],Une=async({evoaiId:e,instanceName:t})=>(await Ce.get(`/evoai/fetch/${e}/${t}`)).data,Vne=e=>{const{evoaiId:t,instanceName:n,...r}=e;return gt({...r,queryKey:zne({evoaiId:t,instanceName:n}),queryFn:()=>Une({evoaiId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0)})};function qne({evoaiId:e,resetTable:t}){const{t:n}=Le(),{instance:r}=ft(),a=Nn(),[o,l]=y.useState(!1),{deleteEvoai:u,updateEvoai:d}=Mm(),{data:f,isLoading:m}=Vne({evoaiId:e,instanceName:r?.name}),h=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}),X.success(n("evoai.toast.success.update")),t(),a(`/manager/instance/${r.id}/evoai/${e}`)}else console.error("Token not found")}catch(w){console.error("Error:",w),X.error(`Error: ${w?.response?.data?.response?.message}`)}},x=async()=>{try{r&&r.name&&e?(await u({instanceName:r.name,evoaiId:e}),X.success(n("evoai.toast.success.delete")),l(!1),t(),a(`/manager/instance/${r.id}/evoai`)):console.error("instance not found")}catch(b){console.error("Erro ao excluir evoai:",b)}};return m?s.jsx(Hn,{}):s.jsx("div",{className:"m-4",children:s.jsx(nO,{initialData:h,onSubmit:g,evoaiId:e,handleDelete:x,isModal:!1,isLoading:m,openDeletionDialog:o,setOpenDeletionDialog:l})})}function xE(){const{t:e}=Le(),t=Xa("(min-width: 768px)"),{instance:n}=ft(),{evoaiId:r}=Is(),{data:a,refetch:o,isLoading:l,error:u}=eO({instanceName:n?.name}),d=Nn(),f=h=>{n&&d(`/manager/instance/${n.id}/evoai/${h}`)},m=()=>{o()};return s.jsx("main",{className:"pt-5",children:s.jsxs(oa,{error:u,name:"Evoai",envVar:"EVOAI_ENABLED",children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[s.jsx("h3",{className:"text-lg font-medium",children:e("evoai.title")}),s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsx(tO,{}),s.jsx(Ine,{}),s.jsx(Bne,{resetTable:m})]})]}),s.jsx(Qt,{className:"my-4"}),s.jsxs(ai,{direction:t?"horizontal":"vertical",children:[s.jsx(Nr,{defaultSize:r?35:100,className:"pr-4",children:s.jsx("div",{className:"flex flex-col gap-3",children:l?s.jsx(Hn,{}):s.jsx(s.Fragment,{children:a&&a.length>0&&Array.isArray(a)?a.map(h=>s.jsx(q,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>f(`${h.id}`),variant:r===h.id?"secondary":"outline",children:s.jsx("h4",{className:"text-base",children:h.description||h.id})},h.id)):s.jsx(q,{variant:"link",children:e("evoai.table.none")})})})}),r&&s.jsxs(s.Fragment,{children:[s.jsx(oi,{withHandle:!0,className:"border border-border"}),s.jsx(Nr,{children:s.jsx(qne,{evoaiId:r,resetTable:m})})]})]})]})})}const Hne=e=>["evolutionBot","findEvolutionBot",JSON.stringify(e)],Wne=async({instanceName:e,token:t})=>(await Ce.get(`/evolutionBot/find/${e}`,{headers:{apiKey:t}})).data,rO=e=>{const{instanceName:t,token:n,...r}=e;return gt({...r,queryKey:Hne({instanceName:t}),queryFn:()=>Wne({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},Kne=e=>["evolutionBot","fetchDefaultSettings",JSON.stringify(e)],Gne=async({instanceName:e,token:t})=>{const n=await Ce.get(`/evolutionBot/fetchSettings/${e}`,{headers:{apiKey:t}});return Array.isArray(n.data)?n.data[0]:n.data},Jne=e=>{const{instanceName:t,token:n,...r}=e;return gt({...r,queryKey:Kne({instanceName:t}),queryFn:()=>Gne({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},Qne=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/evolutionBot/create/${e}`,n,{headers:{apikey:t}})).data,Yne=async({instanceName:e,token:t,evolutionBotId:n,data:r})=>(await Ce.put(`/evolutionBot/update/${n}/${e}`,r,{headers:{apikey:t}})).data,Zne=async({instanceName:e,evolutionBotId:t})=>(await Ce.delete(`/evolutionBot/delete/${t}/${e}`)).data,Xne=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/evolutionBot/settings/${e}`,n,{headers:{apikey:t}})).data,ere=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await Ce.post(`/evolutionBot/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function _m(){const e=ot(Xne,{invalidateKeys:[["evolutionBot","fetchDefaultSettings"]]}),t=ot(ere,{invalidateKeys:[["evolutionBot","getEvolutionBot"],["evolutionBot","fetchSessions"]]}),n=ot(Zne,{invalidateKeys:[["evolutionBot","getEvolutionBot"],["evolutionBot","findEvolutionBot"],["evolutionBot","fetchSessions"]]}),r=ot(Yne,{invalidateKeys:[["evolutionBot","getEvolutionBot"],["evolutionBot","findEvolutionBot"],["evolutionBot","fetchSessions"]]}),a=ot(Qne,{invalidateKeys:[["evolutionBot","findEvolutionBot"]]});return{setDefaultSettingsEvolutionBot:e,changeStatusEvolutionBot:t,deleteEvolutionBot:n,updateEvolutionBot:r,createEvolutionBot:a}}const tre=hn({expire:he(),keywordFinish:he(),delayMessage:he(),unknownMessage:he(),listeningFromMe:Me(),stopBotFromMe:Me(),keepOpen:Me(),debounceTime:he(),ignoreJids:As(he()).default([]),botIdFallback:Mc([Tc(),he()]).optional(),splitMessages:Me(),timePerChar:he()});function nre(){const{t:e}=Le(),{instance:t}=ft(),[n,r]=y.useState(!1),{data:a,refetch:o}=Jne({instanceName:t?.name,enabled:n}),{data:l,refetch:u}=rO({instanceName:t?.name,enabled:n}),{setDefaultSettingsEvolutionBot:d}=_m(),f=mn({resolver:gn(tre),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(()=>{a&&f.reset({expire:a?.expire?a.expire.toString():"0",keywordFinish:a.keywordFinish,delayMessage:a.delayMessage?a.delayMessage.toString():"0",unknownMessage:a.unknownMessage,listeningFromMe:a.listeningFromMe,stopBotFromMe:a.stopBotFromMe,keepOpen:a.keepOpen,debounceTime:a.debounceTime?a.debounceTime.toString():"0",ignoreJids:a.ignoreJids,botIdFallback:a.botIdFallback,splitMessages:a.splitMessages,timePerChar:a.timePerChar?a.timePerChar.toString():"0"})},[a]);const m=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}),X.success(e("evolutionBot.toast.defaultSettings.success"))}catch(x){console.error("Error:",x),X.error(`Error: ${x?.response?.data?.response?.message}`)}};function h(){o(),u()}return s.jsxs(yt,{open:n,onOpenChange:r,children:[s.jsx(sn,{asChild:!0,children:s.jsxs(q,{variant:"secondary",size:"sm",children:[s.jsx(Qo,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:e("evolutionBot.defaultSettings")})]})}),s.jsxs(ht,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:h,children:[s.jsx(mt,{children:s.jsx(xt,{children:e("evolutionBot.defaultSettings")})}),s.jsx(mr,{...f,children:s.jsxs("form",{className:"w-full space-y-6",onSubmit:f.handleSubmit(m),children:[s.jsx("div",{children:s.jsxs("div",{className:"space-y-4",children:[s.jsx(cn,{name:"botIdFallback",label:e("evolutionBot.form.botIdFallback.label"),options:l?.filter(g=>!!g.id).map(g=>({label:g.description,value:g.id}))??[]}),s.jsx(le,{name:"expire",label:e("evolutionBot.form.expire.label"),children:s.jsx(G,{type:"number"})}),s.jsx(le,{name:"keywordFinish",label:e("evolutionBot.form.keywordFinish.label"),children:s.jsx(G,{})}),s.jsx(le,{name:"delayMessage",label:e("evolutionBot.form.delayMessage.label"),children:s.jsx(G,{type:"number"})}),s.jsx(le,{name:"unknownMessage",label:e("evolutionBot.form.unknownMessage.label"),children:s.jsx(G,{})}),s.jsx(Re,{name:"listeningFromMe",label:e("evolutionBot.form.listeningFromMe.label"),reverse:!0}),s.jsx(Re,{name:"stopBotFromMe",label:e("evolutionBot.form.stopBotFromMe.label"),reverse:!0}),s.jsx(Re,{name:"keepOpen",label:e("evolutionBot.form.keepOpen.label"),reverse:!0}),s.jsx(le,{name:"debounceTime",label:e("evolutionBot.form.debounceTime.label"),children:s.jsx(G,{type:"number"})}),s.jsx(Re,{name:"splitMessages",label:e("evolutionBot.form.splitMessages.label"),reverse:!0}),f.watch("splitMessages")&&s.jsx(le,{name:"timePerChar",label:e("evolutionBot.form.timePerChar.label"),children:s.jsx(G,{type:"number"})}),s.jsx(ri,{name:"ignoreJids",label:e("evolutionBot.form.ignoreJids.label"),placeholder:e("evolutionBot.form.ignoreJids.placeholder")})]})}),s.jsx(Wt,{children:s.jsx(q,{type:"submit",children:e("evolutionBot.button.save")})})]})})]})]})}const rre=e=>["evolutionBot","fetchSessions",JSON.stringify(e)],sre=async({instanceName:e,evolutionBotId:t,token:n})=>(await Ce.get(`/evolutionBot/fetchSessions/${t}/${e}`,{headers:{apiKey:n}})).data,are=e=>{const{instanceName:t,token:n,evolutionBotId:r,...a}=e;return gt({...a,queryKey:rre({instanceName:t}),queryFn:()=>sre({instanceName:t,token:n,evolutionBotId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})},up={name:"",number:"",status:"all",time:"all",customCondition:"more",customValue:"",customUnit:"minutes"};function ore(e,t){const n=parseInt(e);return!n||isNaN(n)||n<=0?null:t==="hours"?n*60:t==="days"?n*1440:n}function ire(e,t){if(t.time==="all")return!0;const n=(Date.now()-new Date(e).getTime())/6e4;if(t.time==="custom"){const r=ore(t.customValue,t.customUnit);return r===null?!0:t.customCondition==="more"?n>r:n<=r}if(t.time.startsWith(">")){const r=parseInt(t.time.slice(1));return n>r}return n<=parseInt(t.time)}function sO({evolutionBotId:e}){const{t}=Le(),{instance:n}=ft(),{changeStatusEvolutionBot:r}=_m(),[a,o]=y.useState(!1),[l,u]=y.useState([]),[d,f]=y.useState({}),[m,h]=y.useState(up),[g,x]=y.useState(up),[b,w]=y.useState(9),[C,k]=y.useState(9),[N,T]=y.useState("opened"),[_,P]=y.useState(!1),[M,O]=y.useState(""),[D,F]=y.useState(""),[$,te]=y.useState(!1),{data:z,refetch:ue}=are({instanceName:n?.name,evolutionBotId:e,enabled:a}),V=y.useMemo(()=>{const j=z??[],I=g.name.trim().toLowerCase(),me=g.number.trim();return j.filter(xe=>!(I&&!xe.pushName?.toLowerCase().includes(I)||me&&!xe.remoteJid.includes(me)||g.status!=="all"&&xe.status!==g.status||!ire(xe.updatedAt,g)))},[z,g]),ne=V.slice(0,C),Y=y.useMemo(()=>Object.keys(d).filter(j=>d[j]).map(j=>ne[Number(j)]?.remoteJid).filter(Boolean),[d,ne]);y.useEffect(()=>{k(b),f({})},[g,b]);const se=()=>{ue()},H=()=>{x(m)},W=()=>{h(up),x(up)},U=async(j,I)=>{try{if(!n)return;await r({instanceName:n.name,token:n.token,remoteJid:j,status:I}),X.success(t("evolutionBot.toast.success.status")),se()}catch(me){console.error("Error:",me),X.error(`Error : ${me?.response?.data?.response?.message}`)}},A=async()=>{if(Y.length===0){X.error(t("sessions.mass.noneSelected"));return}try{if(!n)return;await Promise.all(Y.map(j=>r({instanceName:n.name,token:n.token,remoteJid:j,status:N}))),X.success(t("sessions.mass.success")),f({}),se()}catch(j){console.error(j),X.error(j?.response?.data?.response?.message??t("sessions.mass.error"))}},K=j=>{O(j),F(""),P(!0)},re=async()=>{if(!D.trim()){X.error(t("sessions.send.empty"));return}try{if(!n)return;te(!0),await Ce.post(`/message/sendText/${n.name}`,{number:M,text:D},{headers:{apikey:n.token}}),X.success(t("sessions.send.success")),P(!1),F(""),O("")}catch(j){console.error("Error:",j),X.error(j?.response?.data?.response?.message??j?.message??t("sessions.send.error"))}finally{te(!1)}},ee=[{id:"select",header:({table:j})=>s.jsx(es,{checked:j.getIsAllPageRowsSelected()||j.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:I=>j.toggleAllPageRowsSelected(!!I),"aria-label":t("sessions.mass.selectAll")}),cell:({row:j})=>s.jsx(es,{checked:j.getIsSelected(),onCheckedChange:I=>j.toggleSelected(!!I),"aria-label":t("sessions.mass.selectAll")}),enableSorting:!1},{accessorKey:"remoteJid",header:()=>s.jsx("div",{className:"text-center",children:t("evolutionBot.sessions.table.remoteJid")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>s.jsx("div",{className:"text-center",children:t("evolutionBot.sessions.table.pushName")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("pushName")})},{accessorKey:"sessionId",header:()=>s.jsx("div",{className:"text-center",children:t("evolutionBot.sessions.table.sessionId")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("sessionId")})},{accessorKey:"status",header:()=>s.jsx("div",{className:"text-center",children:t("evolutionBot.sessions.table.status")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:j})=>{const I=j.original;return s.jsxs(gs,{children:[s.jsx(vs,{asChild:!0,children:s.jsxs(q,{variant:"ghost",size:"icon",children:[s.jsx("span",{className:"sr-only",children:t("evolutionBot.sessions.table.actions.title")}),s.jsx(Yo,{className:"h-4 w-4"})]})}),s.jsxs(ys,{align:"end",children:[s.jsx(Zo,{children:t("evolutionBot.sessions.table.actions.title")}),s.jsx(Xo,{}),I.status!=="opened"&&s.jsxs(Ct,{onClick:()=>U(I.remoteJid,"opened"),children:[s.jsx(sl,{className:"mr-2 h-4 w-4"}),t("evolutionBot.sessions.table.actions.open")]}),I.status!=="paused"&&I.status!=="closed"&&s.jsxs(Ct,{onClick:()=>U(I.remoteJid,"paused"),children:[s.jsx(rl,{className:"mr-2 h-4 w-4"}),t("evolutionBot.sessions.table.actions.pause")]}),I.status!=="closed"&&s.jsxs(Ct,{onClick:()=>U(I.remoteJid,"closed"),children:[s.jsx(Xi,{className:"mr-2 h-4 w-4"}),t("evolutionBot.sessions.table.actions.close")]}),s.jsxs(Ct,{onClick:()=>K(I.remoteJid),children:[s.jsx(nl,{className:"mr-2 h-4 w-4"}),t("sessions.actions.sendMessage")]}),s.jsxs(Ct,{onClick:()=>U(I.remoteJid,"delete"),children:[s.jsx(el,{className:"mr-2 h-4 w-4"}),t("evolutionBot.sessions.table.actions.delete")]})]})]})}}],ie=["all","5","10","15","20","30","60",">60",">120",">300",">1440","custom"],de=["all","opened","paused","closed"];return s.jsxs(yt,{open:a,onOpenChange:o,children:[s.jsx(sn,{asChild:!0,children:s.jsxs(q,{variant:"secondary",size:"sm",children:[s.jsx(tl,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden md:inline",children:t("evolutionBot.sessions.label")})]})}),s.jsxs(ht,{className:"max-w-7xl h-[85vh] flex flex-col overflow-hidden",children:[s.jsx(mt,{children:s.jsx(xt,{children:t("evolutionBot.sessions.label")})}),s.jsxs("div",{className:"flex-1 space-y-4 overflow-y-auto pr-2",children:[s.jsxs(Un,{children:[s.jsx(Yn,{children:s.jsx(Zn,{className:"text-base",children:t("sessions.filters.title")})}),s.jsxs(Vn,{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.name")}),s.jsx(G,{placeholder:t("sessions.filters.namePlaceholder"),value:m.name,onChange:j=>h(I=>({...I,name:j.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.number")}),s.jsx(G,{placeholder:t("sessions.filters.numberPlaceholder"),value:m.number,onChange:j=>h(I=>({...I,number:j.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.status")}),s.jsxs(_t,{value:m.status,onValueChange:j=>h(I=>({...I,status:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsx(It,{children:de.map(j=>s.jsx(we,{value:j,children:t(`sessions.filters.statusOptions.${j}`)},j))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.time")}),s.jsxs(_t,{value:m.time,onValueChange:j=>h(I=>({...I,time:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsx(It,{children:ie.map(j=>s.jsx(we,{value:j,children:t(`sessions.filters.timeOptions.${j}`)},j))})]})]})]}),m.time==="custom"&&s.jsxs("div",{className:"grid grid-cols-1 gap-2 md:grid-cols-3",children:[s.jsxs(_t,{value:m.customCondition,onValueChange:j=>h(I=>({...I,customCondition:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"more",children:t("sessions.filters.custom.more")}),s.jsx(we,{value:"less",children:t("sessions.filters.custom.less")})]})]}),s.jsx(G,{type:"number",min:1,placeholder:t("sessions.filters.custom.valuePlaceholder"),value:m.customValue,onChange:j=>h(I=>({...I,customValue:j.target.value}))}),s.jsxs(_t,{value:m.customUnit,onValueChange:j=>h(I=>({...I,customUnit:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"minutes",children:t("sessions.filters.custom.minutes")}),s.jsx(we,{value:"hours",children:t("sessions.filters.custom.hours")}),s.jsx(we,{value:"days",children:t("sessions.filters.custom.days")})]})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(q,{onClick:H,size:"sm",children:t("sessions.filters.apply")}),s.jsx(q,{onClick:W,size:"sm",variant:"outline",children:t("sessions.filters.clear")}),s.jsxs(q,{onClick:se,size:"sm",variant:"outline",children:[s.jsx(al,{size:14,className:"mr-1"}),t("button.refresh")]})]})]})]}),Y.length>0&&s.jsxs(Un,{children:[s.jsx(Yn,{children:s.jsx(Zn,{className:"text-base",children:t("sessions.mass.title")})}),s.jsx(Vn,{children:s.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:t("sessions.mass.selected",{count:Y.length})}),s.jsxs("div",{className:"flex-1 min-w-[180px] space-y-1",children:[s.jsx(Ve,{children:t("sessions.mass.newStatus")}),s.jsxs(_t,{value:N,onValueChange:T,children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"opened",children:t("evolutionBot.sessions.table.actions.open")}),s.jsx(we,{value:"paused",children:t("evolutionBot.sessions.table.actions.pause")}),s.jsx(we,{value:"closed",children:t("evolutionBot.sessions.table.actions.close")}),s.jsx(we,{value:"delete",children:t("evolutionBot.sessions.table.actions.delete")})]})]})]}),s.jsx(q,{onClick:A,size:"sm",children:t("sessions.mass.apply")})]})})]}),s.jsx(ii,{columns:ee,data:ne,onSortingChange:u,state:{sorting:l,rowSelection:d},onRowSelectionChange:f,enableRowSelection:!0,getRowId:(j,I)=>String(I),noResultsMessage:t("sessions.empty")}),s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 px-1 text-sm text-muted-foreground",children:[s.jsx("span",{children:t("sessions.pagination.showing",{shown:ne.length,total:V.length})}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(Ve,{htmlFor:"per-page",className:"text-xs",children:t("sessions.pagination.perPage")}),s.jsxs(_t,{value:String(b),onValueChange:j=>w(parseInt(j)),children:[s.jsx(Rt,{id:"per-page",className:"h-8 w-20",children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"9",children:"9"}),s.jsx(we,{value:"25",children:"25"}),s.jsx(we,{value:"50",children:"50"}),s.jsx(we,{value:"100",children:"100"})]})]}),Ck(j=>Math.min(j+b,V.length)),children:t("sessions.pagination.showMore")}),Ck(V.length),children:t("sessions.pagination.showAll")}),C>b&&s.jsx(q,{size:"sm",variant:"outline",onClick:()=>k(b),children:t("sessions.pagination.showLess")})]})]})]}),s.jsx(yt,{open:_,onOpenChange:j=>!$&&P(j),children:s.jsxs(ht,{className:"sm:max-w-md",children:[s.jsx(mt,{children:s.jsx(xt,{children:t("sessions.send.title")})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{children:t("sessions.send.to")}),s.jsx(G,{value:M,disabled:!0})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{children:t("sessions.send.messagePlaceholder")}),s.jsx(ei,{rows:4,placeholder:t("sessions.send.messagePlaceholder"),value:D,onChange:j=>F(j.target.value)})]})]}),s.jsxs(Wt,{children:[s.jsx(q,{variant:"outline",onClick:()=>P(!1),disabled:$,children:t("button.cancel")}),s.jsx(q,{onClick:re,disabled:$,children:t($?"sessions.send.sending":"sessions.send.send")})]})]})})]})]})}const lre=hn({enabled:Me(),description:he(),apiUrl:he(),apiKey:he().optional(),triggerType:he(),triggerOperator:he().optional(),triggerValue:he().optional(),expire:at.number().optional(),keywordFinish:he().optional(),delayMessage:at.number().optional(),unknownMessage:he().optional(),listeningFromMe:Me().optional(),stopBotFromMe:Me().optional(),keepOpen:Me().optional(),debounceTime:at.number().optional(),splitMessages:Me().optional(),timePerChar:at.number().optional()});function aO({initialData:e,onSubmit:t,handleDelete:n,evolutionBotId:r,isModal:a=!1,isLoading:o=!1,openDeletionDialog:l=!1,setOpenDeletionDialog:u=()=>{}}){const{t:d}=Le(),f=mn({resolver:gn(lre),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}}),m=f.watch("triggerType");return s.jsx(mr,{...f,children:s.jsxs("form",{onSubmit:f.handleSubmit(t),className:"w-full space-y-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsx(Re,{name:"enabled",label:d("evolutionBot.form.enabled.label"),reverse:!0}),s.jsx(le,{name:"description",label:d("evolutionBot.form.description.label"),required:!0,children:s.jsx(G,{})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("evolutionBot.form.evolutionBotSettings.label")}),s.jsx(Qt,{})]}),s.jsx(le,{name:"apiUrl",label:d("evolutionBot.form.apiUrl.label"),required:!0,children:s.jsx(G,{})}),s.jsx(le,{name:"apiKey",label:d("evolutionBot.form.apiKey.label"),children:s.jsx(G,{type:"password"})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("evolutionBot.form.triggerSettings.label")}),s.jsx(Qt,{})]}),s.jsx(cn,{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"}]}),m==="keyword"&&s.jsxs(s.Fragment,{children:[s.jsx(cn,{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"}]}),s.jsx(le,{name:"triggerValue",label:d("evolutionBot.form.triggerValue.label"),children:s.jsx(G,{})})]}),m==="advanced"&&s.jsx(le,{name:"triggerValue",label:d("evolutionBot.form.triggerConditions.label"),children:s.jsx(G,{})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("evolutionBot.form.generalSettings.label")}),s.jsx(Qt,{})]}),s.jsx(le,{name:"expire",label:d("evolutionBot.form.expire.label"),children:s.jsx(G,{type:"number"})}),s.jsx(le,{name:"keywordFinish",label:d("evolutionBot.form.keywordFinish.label"),children:s.jsx(G,{})}),s.jsx(le,{name:"delayMessage",label:d("evolutionBot.form.delayMessage.label"),children:s.jsx(G,{type:"number"})}),s.jsx(le,{name:"unknownMessage",label:d("evolutionBot.form.unknownMessage.label"),children:s.jsx(G,{})}),s.jsx(Re,{name:"listeningFromMe",label:d("evolutionBot.form.listeningFromMe.label"),reverse:!0}),s.jsx(Re,{name:"stopBotFromMe",label:d("evolutionBot.form.stopBotFromMe.label"),reverse:!0}),s.jsx(Re,{name:"keepOpen",label:d("evolutionBot.form.keepOpen.label"),reverse:!0}),s.jsx(le,{name:"debounceTime",label:d("evolutionBot.form.debounceTime.label"),children:s.jsx(G,{type:"number"})}),s.jsx(Re,{name:"splitMessages",label:d("evolutionBot.form.splitMessages.label"),reverse:!0}),f.watch("splitMessages")&&s.jsx(le,{name:"timePerChar",label:d("evolutionBot.form.timePerChar.label"),children:s.jsx(G,{type:"number"})})]}),a&&s.jsx(Wt,{children:s.jsx(q,{disabled:o,type:"submit",children:d(o?"evolutionBot.button.saving":"evolutionBot.button.save")})}),!a&&s.jsxs("div",{children:[s.jsx(sO,{evolutionBotId:r}),s.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[s.jsxs(yt,{open:l,onOpenChange:u,children:[s.jsx(sn,{asChild:!0,children:s.jsx(q,{variant:"destructive",size:"sm",children:d("dify.button.delete")})}),s.jsx(ht,{children:s.jsxs(mt,{children:[s.jsx(xt,{children:d("modal.delete.title")}),s.jsx(Er,{children:d("modal.delete.messageSingle")}),s.jsxs(Wt,{children:[s.jsx(q,{size:"sm",variant:"outline",onClick:()=>u(!1),children:d("button.cancel")}),s.jsx(q,{variant:"destructive",onClick:n,children:d("button.delete")})]})]})})]}),s.jsx(q,{disabled:o,type:"submit",children:d(o?"evolutionBot.button.saving":"evolutionBot.button.update")})]})]})]})})}function cre({resetTable:e}){const{t}=Le(),{instance:n}=ft(),[r,a]=y.useState(!1),[o,l]=y.useState(!1),{createEvolutionBot:u}=_m(),d=async f=>{try{if(!n||!n.name)throw new Error("instance not found");a(!0);const m={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:m}),X.success(t("evolutionBot.toast.success.create")),l(!1),e()}catch(m){console.error("Error:",m),X.error(`Error: ${m?.response?.data?.response?.message}`)}finally{a(!1)}};return s.jsxs(yt,{open:o,onOpenChange:l,children:[s.jsx(sn,{asChild:!0,children:s.jsxs(q,{size:"sm",children:[s.jsx(Zr,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:t("evolutionBot.button.create")})]})}),s.jsxs(ht,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[s.jsx(mt,{children:s.jsx(xt,{children:t("evolutionBot.form.title")})}),s.jsx(aO,{onSubmit:d,isModal:!0,isLoading:r})]})]})}const ure=e=>["evolutionBot","getEvolutionBot",JSON.stringify(e)],dre=async({instanceName:e,token:t,evolutionBotId:n})=>{const r=await Ce.get(`/evolutionBot/fetch/${n}/${e}`,{headers:{apiKey:t}});return Array.isArray(r.data)?r.data[0]:r.data},fre=e=>{const{instanceName:t,token:n,evolutionBotId:r,...a}=e;return gt({...a,queryKey:ure({instanceName:t}),queryFn:()=>dre({instanceName:t,token:n,evolutionBotId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function pre({evolutionBotId:e,resetTable:t}){const{t:n}=Le(),{instance:r}=ft(),a=Nn(),[o,l]=y.useState(!1),{deleteEvolutionBot:u,updateEvolutionBot:d}=_m(),{data:f,isLoading:m}=fre({instanceName:r?.name,evolutionBotId:e}),h=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}),X.success(n("evolutionBot.toast.success.update")),t(),a(`/manager/instance/${r.id}/evolutionBot/${e}`)}else console.error("Token not found")}catch(w){console.error("Error:",w),X.error(`Error: ${w?.response?.data?.response?.message}`)}},x=async()=>{try{r&&r.name&&e?(await u({instanceName:r.name,evolutionBotId:e}),X.success(n("evolutionBot.toast.success.delete")),l(!1),t(),a(`/manager/instance/${r.id}/evolutionBot`)):console.error("instance not found")}catch(b){console.error("Erro ao excluir evolutionBot:",b)}};return m?s.jsx(Hn,{}):s.jsx("div",{className:"m-4",children:s.jsx(aO,{initialData:h,onSubmit:g,evolutionBotId:e,handleDelete:x,isModal:!1,openDeletionDialog:o,setOpenDeletionDialog:l})})}function wE(){const{t:e}=Le(),t=Xa("(min-width: 768px)"),{instance:n}=ft(),{evolutionBotId:r}=Is(),{data:a,isLoading:o,refetch:l,error:u}=rO({instanceName:n?.name}),d=Nn(),f=h=>{n&&d(`/manager/instance/${n.id}/evolutionBot/${h}`)},m=()=>{l()};return s.jsx("main",{className:"pt-5",children:s.jsxs(oa,{error:u,name:"Evolution Bot",envVar:"EVOLUTION_BOT_ENABLED",children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[s.jsx("h3",{className:"text-lg font-medium",children:e("evolutionBot.title")}),s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsx(sO,{}),s.jsx(nre,{}),s.jsx(cre,{resetTable:m})]})]}),s.jsx(Qt,{className:"my-4"}),s.jsxs(ai,{direction:t?"horizontal":"vertical",children:[s.jsx(Nr,{defaultSize:r?35:100,className:"pr-4",children:s.jsx("div",{className:"flex flex-col gap-3",children:o?s.jsx(Hn,{}):s.jsx(s.Fragment,{children:a&&a.length>0&&Array.isArray(a)?a.map(h=>s.jsx(q,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>f(`${h.id}`),variant:r===h.id?"secondary":"outline",children:s.jsx("h4",{className:"text-base",children:h.description||h.id})},h.id)):s.jsx(q,{variant:"link",children:e("evolutionBot.table.none")})})})}),r&&s.jsxs(s.Fragment,{children:[s.jsx(oi,{withHandle:!0,className:"border border-border"}),s.jsx(Nr,{children:s.jsx(pre,{evolutionBotId:r,resetTable:m})})]})]})]})})}const hre=e=>["flowise","findFlowise",JSON.stringify(e)],mre=async({instanceName:e,token:t})=>(await Ce.get(`/flowise/find/${e}`,{headers:{apiKey:t}})).data,oO=e=>{const{instanceName:t,token:n,...r}=e;return gt({...r,queryKey:hre({instanceName:t}),queryFn:()=>mre({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},gre=e=>["flowise","fetchDefaultSettings",JSON.stringify(e)],vre=async({instanceName:e,token:t})=>{const n=await Ce.get(`/flowise/fetchSettings/${e}`,{headers:{apiKey:t}});return Array.isArray(n.data)?n.data[0]:n.data},yre=e=>{const{instanceName:t,token:n,...r}=e;return gt({...r,queryKey:gre({instanceName:t}),queryFn:()=>vre({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},bre=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/flowise/create/${e}`,n,{headers:{apikey:t}})).data,xre=async({instanceName:e,flowiseId:t,data:n})=>(await Ce.put(`/flowise/update/${t}/${e}`,n)).data,wre=async({instanceName:e,flowiseId:t})=>(await Ce.delete(`/flowise/delete/${t}/${e}`)).data,Sre=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await Ce.post(`/flowise/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data,Cre=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/flowise/settings/${e}`,n,{headers:{apikey:t}})).data;function Pm(){const e=ot(Cre,{invalidateKeys:[["flowise","fetchDefaultSettings"]]}),t=ot(Sre,{invalidateKeys:[["flowise","getFlowise"],["flowise","fetchSessions"]]}),n=ot(wre,{invalidateKeys:[["flowise","getFlowise"],["flowise","findFlowise"],["flowise","fetchSessions"]]}),r=ot(xre,{invalidateKeys:[["flowise","getFlowise"],["flowise","findFlowise"],["flowise","fetchSessions"]]}),a=ot(bre,{invalidateKeys:[["flowise","findFlowise"]]});return{setDefaultSettingsFlowise:e,changeStatusFlowise:t,deleteFlowise:n,updateFlowise:r,createFlowise:a}}const jre=hn({expire:he(),keywordFinish:he(),delayMessage:he(),unknownMessage:he(),listeningFromMe:Me(),stopBotFromMe:Me(),keepOpen:Me(),debounceTime:he(),ignoreJids:As(he()).default([]),flowiseIdFallback:Mc([Tc(),he()]).optional(),splitMessages:Me(),timePerChar:he()});function kre(){const{t:e}=Le(),{instance:t}=ft(),{setDefaultSettingsFlowise:n}=Pm(),[r,a]=y.useState(!1),{data:o,refetch:l}=yre({instanceName:t?.name,enabled:r}),{data:u,refetch:d}=oO({instanceName:t?.name,enabled:r}),f=mn({resolver:gn(jre),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 m=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}),X.success(e("flowise.toast.defaultSettings.success"))}catch(x){console.error("Error:",x),X.error(`Error: ${x?.response?.data?.response?.message}`)}};function h(){l(),d()}return s.jsxs(yt,{open:r,onOpenChange:a,children:[s.jsx(sn,{asChild:!0,children:s.jsxs(q,{variant:"secondary",size:"sm",children:[s.jsx(Qo,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:e("flowise.defaultSettings")})]})}),s.jsxs(ht,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:h,children:[s.jsx(mt,{children:s.jsx(xt,{children:e("flowise.defaultSettings")})}),s.jsx(mr,{...f,children:s.jsxs("form",{className:"w-full space-y-6",onSubmit:f.handleSubmit(m),children:[s.jsx("div",{children:s.jsxs("div",{className:"space-y-4",children:[s.jsx(cn,{name:"flowiseIdFallback",label:e("flowise.form.flowiseIdFallback.label"),options:u?.filter(g=>!!g.id).map(g=>({label:g.description,value:g.id}))??[]}),s.jsx(le,{name:"expire",label:e("flowise.form.expire.label"),children:s.jsx(G,{type:"number"})}),s.jsx(le,{name:"keywordFinish",label:e("flowise.form.keywordFinish.label"),children:s.jsx(G,{})}),s.jsx(le,{name:"delayMessage",label:e("flowise.form.delayMessage.label"),children:s.jsx(G,{type:"number"})}),s.jsx(le,{name:"unknownMessage",label:e("flowise.form.unknownMessage.label"),children:s.jsx(G,{})}),s.jsx(Re,{name:"listeningFromMe",label:e("flowise.form.listeningFromMe.label"),reverse:!0}),s.jsx(Re,{name:"stopBotFromMe",label:e("flowise.form.stopBotFromMe.label"),reverse:!0}),s.jsx(Re,{name:"keepOpen",label:e("flowise.form.keepOpen.label"),reverse:!0}),s.jsx(le,{name:"debounceTime",label:e("flowise.form.debounceTime.label"),children:s.jsx(G,{type:"number"})}),s.jsx(Re,{name:"splitMessages",label:e("flowise.form.splitMessages.label"),reverse:!0}),f.watch("splitMessages")&&s.jsx(le,{name:"timePerChar",label:e("flowise.form.timePerChar.label"),children:s.jsx(G,{type:"number"})}),s.jsx(ri,{name:"ignoreJids",label:e("flowise.form.ignoreJids.label"),placeholder:e("flowise.form.ignoreJids.placeholder")})]})}),s.jsx(Wt,{children:s.jsx(q,{type:"submit",children:e("flowise.button.save")})})]})})]})]})}const Ere=e=>["flowise","fetchSessions",JSON.stringify(e)],Nre=async({instanceName:e,flowiseId:t,token:n})=>(await Ce.get(`/flowise/fetchSessions/${t}/${e}`,{headers:{apiKey:n}})).data,Tre=e=>{const{instanceName:t,token:n,flowiseId:r,...a}=e;return gt({...a,queryKey:Ere({instanceName:t}),queryFn:()=>Nre({instanceName:t,token:n,flowiseId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})},dp={name:"",number:"",status:"all",time:"all",customCondition:"more",customValue:"",customUnit:"minutes"};function Mre(e,t){const n=parseInt(e);return!n||isNaN(n)||n<=0?null:t==="hours"?n*60:t==="days"?n*1440:n}function _re(e,t){if(t.time==="all")return!0;const n=(Date.now()-new Date(e).getTime())/6e4;if(t.time==="custom"){const r=Mre(t.customValue,t.customUnit);return r===null?!0:t.customCondition==="more"?n>r:n<=r}if(t.time.startsWith(">")){const r=parseInt(t.time.slice(1));return n>r}return n<=parseInt(t.time)}function iO({flowiseId:e}){const{t}=Le(),{instance:n}=ft(),{changeStatusFlowise:r}=Pm(),[a,o]=y.useState(!1),[l,u]=y.useState([]),[d,f]=y.useState({}),[m,h]=y.useState(dp),[g,x]=y.useState(dp),[b,w]=y.useState(9),[C,k]=y.useState(9),[N,T]=y.useState("opened"),[_,P]=y.useState(!1),[M,O]=y.useState(""),[D,F]=y.useState(""),[$,te]=y.useState(!1),{data:z,refetch:ue}=Tre({instanceName:n?.name,flowiseId:e,enabled:a}),V=y.useMemo(()=>{const j=z??[],I=g.name.trim().toLowerCase(),me=g.number.trim();return j.filter(xe=>!(I&&!xe.pushName?.toLowerCase().includes(I)||me&&!xe.remoteJid.includes(me)||g.status!=="all"&&xe.status!==g.status||!_re(xe.updatedAt,g)))},[z,g]),ne=V.slice(0,C),Y=y.useMemo(()=>Object.keys(d).filter(j=>d[j]).map(j=>ne[Number(j)]?.remoteJid).filter(Boolean),[d,ne]);y.useEffect(()=>{k(b),f({})},[g,b]);const se=()=>{ue()},H=()=>{x(m)},W=()=>{h(dp),x(dp)},U=async(j,I)=>{try{if(!n)return;await r({instanceName:n.name,token:n.token,remoteJid:j,status:I}),X.success(t("flowise.toast.success.status")),se()}catch(me){console.error("Error:",me),X.error(`Error : ${me?.response?.data?.response?.message}`)}},A=async()=>{if(Y.length===0){X.error(t("sessions.mass.noneSelected"));return}try{if(!n)return;await Promise.all(Y.map(j=>r({instanceName:n.name,token:n.token,remoteJid:j,status:N}))),X.success(t("sessions.mass.success")),f({}),se()}catch(j){console.error(j),X.error(j?.response?.data?.response?.message??t("sessions.mass.error"))}},K=j=>{O(j),F(""),P(!0)},re=async()=>{if(!D.trim()){X.error(t("sessions.send.empty"));return}try{if(!n)return;te(!0),await Ce.post(`/message/sendText/${n.name}`,{number:M,text:D},{headers:{apikey:n.token}}),X.success(t("sessions.send.success")),P(!1),F(""),O("")}catch(j){console.error("Error:",j),X.error(j?.response?.data?.response?.message??j?.message??t("sessions.send.error"))}finally{te(!1)}},ee=[{id:"select",header:({table:j})=>s.jsx(es,{checked:j.getIsAllPageRowsSelected()||j.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:I=>j.toggleAllPageRowsSelected(!!I),"aria-label":t("sessions.mass.selectAll")}),cell:({row:j})=>s.jsx(es,{checked:j.getIsSelected(),onCheckedChange:I=>j.toggleSelected(!!I),"aria-label":t("sessions.mass.selectAll")}),enableSorting:!1},{accessorKey:"remoteJid",header:()=>s.jsx("div",{className:"text-center",children:t("flowise.sessions.table.remoteJid")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>s.jsx("div",{className:"text-center",children:t("flowise.sessions.table.pushName")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("pushName")})},{accessorKey:"sessionId",header:()=>s.jsx("div",{className:"text-center",children:t("flowise.sessions.table.sessionId")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("sessionId")})},{accessorKey:"status",header:()=>s.jsx("div",{className:"text-center",children:t("flowise.sessions.table.status")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:j})=>{const I=j.original;return s.jsxs(gs,{children:[s.jsx(vs,{asChild:!0,children:s.jsxs(q,{variant:"ghost",size:"icon",children:[s.jsx("span",{className:"sr-only",children:t("flowise.sessions.table.actions.title")}),s.jsx(Yo,{className:"h-4 w-4"})]})}),s.jsxs(ys,{align:"end",children:[s.jsx(Zo,{children:t("flowise.sessions.table.actions.title")}),s.jsx(Xo,{}),I.status!=="opened"&&s.jsxs(Ct,{onClick:()=>U(I.remoteJid,"opened"),children:[s.jsx(sl,{className:"mr-2 h-4 w-4"}),t("flowise.sessions.table.actions.open")]}),I.status!=="paused"&&I.status!=="closed"&&s.jsxs(Ct,{onClick:()=>U(I.remoteJid,"paused"),children:[s.jsx(rl,{className:"mr-2 h-4 w-4"}),t("flowise.sessions.table.actions.pause")]}),I.status!=="closed"&&s.jsxs(Ct,{onClick:()=>U(I.remoteJid,"closed"),children:[s.jsx(Xi,{className:"mr-2 h-4 w-4"}),t("flowise.sessions.table.actions.close")]}),s.jsxs(Ct,{onClick:()=>K(I.remoteJid),children:[s.jsx(nl,{className:"mr-2 h-4 w-4"}),t("sessions.actions.sendMessage")]}),s.jsxs(Ct,{onClick:()=>U(I.remoteJid,"delete"),children:[s.jsx(el,{className:"mr-2 h-4 w-4"}),t("flowise.sessions.table.actions.delete")]})]})]})}}],ie=["all","5","10","15","20","30","60",">60",">120",">300",">1440","custom"],de=["all","opened","paused","closed"];return s.jsxs(yt,{open:a,onOpenChange:o,children:[s.jsx(sn,{asChild:!0,children:s.jsxs(q,{variant:"secondary",size:"sm",children:[s.jsx(tl,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden md:inline",children:t("flowise.sessions.label")})]})}),s.jsxs(ht,{className:"max-w-7xl h-[85vh] flex flex-col overflow-hidden",children:[s.jsx(mt,{children:s.jsx(xt,{children:t("flowise.sessions.label")})}),s.jsxs("div",{className:"flex-1 space-y-4 overflow-y-auto pr-2",children:[s.jsxs(Un,{children:[s.jsx(Yn,{children:s.jsx(Zn,{className:"text-base",children:t("sessions.filters.title")})}),s.jsxs(Vn,{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.name")}),s.jsx(G,{placeholder:t("sessions.filters.namePlaceholder"),value:m.name,onChange:j=>h(I=>({...I,name:j.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.number")}),s.jsx(G,{placeholder:t("sessions.filters.numberPlaceholder"),value:m.number,onChange:j=>h(I=>({...I,number:j.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.status")}),s.jsxs(_t,{value:m.status,onValueChange:j=>h(I=>({...I,status:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsx(It,{children:de.map(j=>s.jsx(we,{value:j,children:t(`sessions.filters.statusOptions.${j}`)},j))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.time")}),s.jsxs(_t,{value:m.time,onValueChange:j=>h(I=>({...I,time:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsx(It,{children:ie.map(j=>s.jsx(we,{value:j,children:t(`sessions.filters.timeOptions.${j}`)},j))})]})]})]}),m.time==="custom"&&s.jsxs("div",{className:"grid grid-cols-1 gap-2 md:grid-cols-3",children:[s.jsxs(_t,{value:m.customCondition,onValueChange:j=>h(I=>({...I,customCondition:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"more",children:t("sessions.filters.custom.more")}),s.jsx(we,{value:"less",children:t("sessions.filters.custom.less")})]})]}),s.jsx(G,{type:"number",min:1,placeholder:t("sessions.filters.custom.valuePlaceholder"),value:m.customValue,onChange:j=>h(I=>({...I,customValue:j.target.value}))}),s.jsxs(_t,{value:m.customUnit,onValueChange:j=>h(I=>({...I,customUnit:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"minutes",children:t("sessions.filters.custom.minutes")}),s.jsx(we,{value:"hours",children:t("sessions.filters.custom.hours")}),s.jsx(we,{value:"days",children:t("sessions.filters.custom.days")})]})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(q,{onClick:H,size:"sm",children:t("sessions.filters.apply")}),s.jsx(q,{onClick:W,size:"sm",variant:"outline",children:t("sessions.filters.clear")}),s.jsxs(q,{onClick:se,size:"sm",variant:"outline",children:[s.jsx(al,{size:14,className:"mr-1"}),t("button.refresh")]})]})]})]}),Y.length>0&&s.jsxs(Un,{children:[s.jsx(Yn,{children:s.jsx(Zn,{className:"text-base",children:t("sessions.mass.title")})}),s.jsx(Vn,{children:s.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:t("sessions.mass.selected",{count:Y.length})}),s.jsxs("div",{className:"flex-1 min-w-[180px] space-y-1",children:[s.jsx(Ve,{children:t("sessions.mass.newStatus")}),s.jsxs(_t,{value:N,onValueChange:T,children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"opened",children:t("flowise.sessions.table.actions.open")}),s.jsx(we,{value:"paused",children:t("flowise.sessions.table.actions.pause")}),s.jsx(we,{value:"closed",children:t("flowise.sessions.table.actions.close")}),s.jsx(we,{value:"delete",children:t("flowise.sessions.table.actions.delete")})]})]})]}),s.jsx(q,{onClick:A,size:"sm",children:t("sessions.mass.apply")})]})})]}),s.jsx(ii,{columns:ee,data:ne,onSortingChange:u,state:{sorting:l,rowSelection:d},onRowSelectionChange:f,enableRowSelection:!0,getRowId:(j,I)=>String(I),noResultsMessage:t("sessions.empty")}),s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 px-1 text-sm text-muted-foreground",children:[s.jsx("span",{children:t("sessions.pagination.showing",{shown:ne.length,total:V.length})}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(Ve,{htmlFor:"per-page",className:"text-xs",children:t("sessions.pagination.perPage")}),s.jsxs(_t,{value:String(b),onValueChange:j=>w(parseInt(j)),children:[s.jsx(Rt,{id:"per-page",className:"h-8 w-20",children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"9",children:"9"}),s.jsx(we,{value:"25",children:"25"}),s.jsx(we,{value:"50",children:"50"}),s.jsx(we,{value:"100",children:"100"})]})]}),Ck(j=>Math.min(j+b,V.length)),children:t("sessions.pagination.showMore")}),Ck(V.length),children:t("sessions.pagination.showAll")}),C>b&&s.jsx(q,{size:"sm",variant:"outline",onClick:()=>k(b),children:t("sessions.pagination.showLess")})]})]})]}),s.jsx(yt,{open:_,onOpenChange:j=>!$&&P(j),children:s.jsxs(ht,{className:"sm:max-w-md",children:[s.jsx(mt,{children:s.jsx(xt,{children:t("sessions.send.title")})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{children:t("sessions.send.to")}),s.jsx(G,{value:M,disabled:!0})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{children:t("sessions.send.messagePlaceholder")}),s.jsx(ei,{rows:4,placeholder:t("sessions.send.messagePlaceholder"),value:D,onChange:j=>F(j.target.value)})]})]}),s.jsxs(Wt,{children:[s.jsx(q,{variant:"outline",onClick:()=>P(!1),disabled:$,children:t("button.cancel")}),s.jsx(q,{onClick:re,disabled:$,children:t($?"sessions.send.sending":"sessions.send.send")})]})]})})]})]})}const Pre=hn({enabled:Me(),description:he(),apiUrl:he(),apiKey:he().optional(),triggerType:he(),triggerOperator:he().optional(),triggerValue:he().optional(),expire:at.number().optional(),keywordFinish:he().optional(),delayMessage:at.number().optional(),unknownMessage:he().optional(),listeningFromMe:Me().optional(),stopBotFromMe:Me().optional(),keepOpen:Me().optional(),debounceTime:at.number().optional(),splitMessages:Me().optional(),timePerChar:at.number().optional()});function lO({initialData:e,onSubmit:t,handleDelete:n,flowiseId:r,isModal:a=!1,isLoading:o=!1,openDeletionDialog:l=!1,setOpenDeletionDialog:u=()=>{}}){const{t:d}=Le(),f=mn({resolver:gn(Pre),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}}),m=f.watch("triggerType");return s.jsx(mr,{...f,children:s.jsxs("form",{onSubmit:f.handleSubmit(t),className:"w-full space-y-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsx(Re,{name:"enabled",label:d("flowise.form.enabled.label"),reverse:!0}),s.jsx(le,{name:"description",label:d("flowise.form.description.label"),required:!0,children:s.jsx(G,{})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("flowise.form.flowiseSettings.label")}),s.jsx(Qt,{})]}),s.jsx(le,{name:"apiUrl",label:d("flowise.form.apiUrl.label"),required:!0,children:s.jsx(G,{})}),s.jsx(le,{name:"apiKey",label:d("flowise.form.apiKey.label"),children:s.jsx(G,{type:"password"})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("flowise.form.triggerSettings.label")}),s.jsx(Qt,{})]}),s.jsx(cn,{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"}]}),m==="keyword"&&s.jsxs(s.Fragment,{children:[s.jsx(cn,{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"}]}),s.jsx(le,{name:"triggerValue",label:d("flowise.form.triggerValue.label"),children:s.jsx(G,{})})]}),m==="advanced"&&s.jsx(le,{name:"triggerValue",label:d("flowise.form.triggerConditions.label"),children:s.jsx(G,{})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("flowise.form.generalSettings.label")}),s.jsx(Qt,{})]}),s.jsx(le,{name:"expire",label:d("flowise.form.expire.label"),children:s.jsx(G,{type:"number"})}),s.jsx(le,{name:"keywordFinish",label:d("flowise.form.keywordFinish.label"),children:s.jsx(G,{})}),s.jsx(le,{name:"delayMessage",label:d("flowise.form.delayMessage.label"),children:s.jsx(G,{type:"number"})}),s.jsx(le,{name:"unknownMessage",label:d("flowise.form.unknownMessage.label"),children:s.jsx(G,{})}),s.jsx(Re,{name:"listeningFromMe",label:d("flowise.form.listeningFromMe.label"),reverse:!0}),s.jsx(Re,{name:"stopBotFromMe",label:d("flowise.form.stopBotFromMe.label"),reverse:!0}),s.jsx(Re,{name:"keepOpen",label:d("flowise.form.keepOpen.label"),reverse:!0}),s.jsx(le,{name:"debounceTime",label:d("flowise.form.debounceTime.label"),children:s.jsx(G,{type:"number"})}),s.jsx(Re,{name:"splitMessages",label:d("flowise.form.splitMessages.label"),reverse:!0}),f.watch("splitMessages")&&s.jsx(le,{name:"timePerChar",label:d("flowise.form.timePerChar.label"),children:s.jsx(G,{type:"number"})})]}),a&&s.jsx(Wt,{children:s.jsx(q,{disabled:o,type:"submit",children:d(o?"flowise.button.saving":"flowise.button.save")})}),!a&&s.jsxs("div",{children:[s.jsx(iO,{flowiseId:r}),s.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[s.jsxs(yt,{open:l,onOpenChange:u,children:[s.jsx(sn,{asChild:!0,children:s.jsx(q,{variant:"destructive",size:"sm",children:d("dify.button.delete")})}),s.jsx(ht,{children:s.jsxs(mt,{children:[s.jsx(xt,{children:d("modal.delete.title")}),s.jsx(Er,{children:d("modal.delete.messageSingle")}),s.jsxs(Wt,{children:[s.jsx(q,{size:"sm",variant:"outline",onClick:()=>u(!1),children:d("button.cancel")}),s.jsx(q,{variant:"destructive",onClick:n,children:d("button.delete")})]})]})})]}),s.jsx(q,{disabled:o,type:"submit",children:d(o?"flowise.button.saving":"flowise.button.update")})]})]})]})})}function Rre({resetTable:e}){const{t}=Le(),{instance:n}=ft(),{createFlowise:r}=Pm(),[a,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 m={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:m}),X.success(t("flowise.toast.success.create")),u(!1),e()}catch(m){console.error("Error:",m),X.error(`Error: ${m?.response?.data?.response?.message}`)}finally{o(!1)}};return s.jsxs(yt,{open:l,onOpenChange:u,children:[s.jsx(sn,{asChild:!0,children:s.jsxs(q,{size:"sm",children:[s.jsx(Zr,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:t("flowise.button.create")})]})}),s.jsxs(ht,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[s.jsx(mt,{children:s.jsx(xt,{children:t("flowise.form.title")})}),s.jsx(lO,{onSubmit:d,isModal:!0,isLoading:a})]})]})}const Ire=e=>["flowise","getFlowise",JSON.stringify(e)],Ore=async({instanceName:e,token:t,flowiseId:n})=>{const r=await Ce.get(`/flowise/fetch/${n}/${e}`,{headers:{apiKey:t}});return Array.isArray(r.data)?r.data[0]:r.data},Are=e=>{const{instanceName:t,token:n,flowiseId:r,...a}=e;return gt({...a,queryKey:Ire({instanceName:t}),queryFn:()=>Ore({instanceName:t,token:n,flowiseId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function Dre({flowiseId:e,resetTable:t}){const{t:n}=Le(),{instance:r}=ft(),a=Nn(),[o,l]=y.useState(!1),{deleteFlowise:u,updateFlowise:d}=Pm(),{data:f,isLoading:m}=Are({instanceName:r?.name,flowiseId:e}),h=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}),X.success(n("flowise.toast.success.update")),t(),a(`/manager/instance/${r.id}/flowise/${e}`)}else console.error("Token not found")}catch(w){console.error("Error:",w),X.error(`Error: ${w?.response?.data?.response?.message}`)}},x=async()=>{try{r&&r.name&&e?(await u({instanceName:r.name,flowiseId:e}),X.success(n("flowise.toast.success.delete")),l(!1),t(),a(`/manager/instance/${r.id}/flowise`)):console.error("instance not found")}catch(b){console.error("Erro ao excluir dify:",b)}};return m?s.jsx(Hn,{}):s.jsx("div",{className:"m-4",children:s.jsx(lO,{initialData:h,onSubmit:g,flowiseId:e,handleDelete:x,isModal:!1,isLoading:m,openDeletionDialog:o,setOpenDeletionDialog:l})})}function SE(){const{t:e}=Le(),t=Xa("(min-width: 768px)"),{instance:n}=ft(),{flowiseId:r}=Is(),{data:a,isLoading:o,refetch:l,error:u}=oO({instanceName:n?.name}),d=Nn(),f=h=>{n&&d(`/manager/instance/${n.id}/flowise/${h}`)},m=()=>{l()};return s.jsx("main",{className:"pt-5",children:s.jsxs(oa,{error:u,name:"Flowise",envVar:"FLOWISE_ENABLED",children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[s.jsx("h3",{className:"text-lg font-medium",children:e("flowise.title")}),s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsx(iO,{}),s.jsx(kre,{}),s.jsx(Rre,{resetTable:m})]})]}),s.jsx(Qt,{className:"my-4"}),s.jsxs(ai,{direction:t?"horizontal":"vertical",children:[s.jsx(Nr,{defaultSize:r?35:100,className:"pr-4",children:s.jsx("div",{className:"flex flex-col gap-3",children:o?s.jsx(Hn,{}):s.jsx(s.Fragment,{children:a&&a.length>0&&Array.isArray(a)?a.map(h=>s.jsx(q,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>f(`${h.id}`),variant:r===h.id?"secondary":"outline",children:s.jsx("h4",{className:"text-base",children:h.description||h.id})},h.id)):s.jsx(q,{variant:"link",children:e("flowise.table.none")})})})}),r&&s.jsxs(s.Fragment,{children:[s.jsx(oi,{withHandle:!0,className:"border border-border"}),s.jsx(Nr,{children:s.jsx(Dre,{flowiseId:r,resetTable:m})})]})]})]})})}const Fre=e=>["n8n","fetchN8n",JSON.stringify(e)],Lre=async({instanceName:e,token:t})=>(await Ce.get(`/n8n/find/${e}`,{headers:{apikey:t}})).data,cO=e=>{const{instanceName:t,token:n,...r}=e;return gt({...r,queryKey:Fre({instanceName:t,token:n}),queryFn:()=>Lre({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},$re=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/n8n/create/${e}`,n,{headers:{apikey:t}})).data,Bre=async({instanceName:e,n8nId:t,data:n})=>(await Ce.put(`/n8n/update/${t}/${e}`,n)).data,zre=async({instanceName:e,n8nId:t})=>(await Ce.delete(`/n8n/delete/${t}/${e}`)).data,Ure=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/n8n/settings/${e}`,n,{headers:{apikey:t}})).data,Vre=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await Ce.post(`/n8n/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function Rm(){const e=ot(Ure,{invalidateKeys:[["n8n","fetchDefaultSettings"]]}),t=ot(Vre,{invalidateKeys:[["n8n","getN8n"],["n8n","fetchSessions"]]}),n=ot(zre,{invalidateKeys:[["n8n","getN8n"],["n8n","fetchN8n"],["n8n","fetchSessions"]]}),r=ot(Bre,{invalidateKeys:[["n8n","getN8n"],["n8n","fetchN8n"],["n8n","fetchSessions"]]}),a=ot($re,{invalidateKeys:[["n8n","fetchN8n"]]});return{setDefaultSettingsN8n:e,changeStatusN8n:t,deleteN8n:n,updateN8n:r,createN8n:a}}const qre=e=>["n8n","fetchDefaultSettings",JSON.stringify(e)],Hre=async({instanceName:e,token:t})=>(await Ce.get(`/n8n/fetchSettings/${e}`,{headers:{apikey:t}})).data,Wre=e=>{const{instanceName:t,token:n,...r}=e;return gt({...r,queryKey:qre({instanceName:t,token:n}),queryFn:()=>Hre({instanceName:t,token:n}),enabled:!!t})},Kre=hn({expire:he(),keywordFinish:he(),delayMessage:he(),unknownMessage:he(),listeningFromMe:Me(),stopBotFromMe:Me(),keepOpen:Me(),debounceTime:he(),ignoreJids:As(he()).default([]),n8nIdFallback:Mc([Tc(),he()]).optional(),splitMessages:Me(),timePerChar:he()});function Gre(){const{t:e}=Le(),{instance:t}=ft(),{setDefaultSettingsN8n:n}=Rm(),[r,a]=y.useState(!1),{data:o,refetch:l}=cO({instanceName:t?.name,token:t?.token,enabled:r}),{data:u,refetch:d}=Wre({instanceName:t?.name,token:t?.token}),f=mn({resolver:gn(Kre),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 m=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}),X.success(e("n8n.toast.defaultSettings.success"))}catch(x){console.error("Error:",x),X.error(`Error: ${x?.response?.data?.response?.message}`)}};function h(){d(),l()}return s.jsxs(yt,{open:r,onOpenChange:a,children:[s.jsx(sn,{asChild:!0,children:s.jsxs(q,{variant:"secondary",size:"sm",children:[s.jsx(Qo,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:e("n8n.defaultSettings")})]})}),s.jsxs(ht,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:h,children:[s.jsx(mt,{children:s.jsx(xt,{children:e("n8n.defaultSettings")})}),s.jsx(mr,{...f,children:s.jsxs("form",{className:"w-full space-y-6",onSubmit:f.handleSubmit(m),children:[s.jsx("div",{children:s.jsxs("div",{className:"space-y-4",children:[s.jsx(cn,{name:"n8nIdFallback",label:e("n8n.form.n8nIdFallback.label"),options:o?.filter(g=>!!g.id).map(g=>({label:g.description,value:g.id}))??[]}),s.jsx(le,{name:"expire",label:e("n8n.form.expire.label"),children:s.jsx(G,{type:"number"})}),s.jsx(le,{name:"keywordFinish",label:e("n8n.form.keywordFinish.label"),children:s.jsx(G,{})}),s.jsx(le,{name:"delayMessage",label:e("n8n.form.delayMessage.label"),children:s.jsx(G,{type:"number"})}),s.jsx(le,{name:"unknownMessage",label:e("n8n.form.unknownMessage.label"),children:s.jsx(G,{})}),s.jsx(Re,{name:"listeningFromMe",label:e("n8n.form.listeningFromMe.label"),reverse:!0}),s.jsx(Re,{name:"stopBotFromMe",label:e("n8n.form.stopBotFromMe.label"),reverse:!0}),s.jsx(Re,{name:"keepOpen",label:e("n8n.form.keepOpen.label"),reverse:!0}),s.jsx(le,{name:"debounceTime",label:e("n8n.form.debounceTime.label"),children:s.jsx(G,{type:"number"})}),s.jsx(Re,{name:"splitMessages",label:e("n8n.form.splitMessages.label"),reverse:!0}),s.jsx(le,{name:"timePerChar",label:e("n8n.form.timePerChar.label"),children:s.jsx(G,{type:"number"})}),s.jsx(ri,{name:"ignoreJids",label:e("n8n.form.ignoreJids.label"),placeholder:e("n8n.form.ignoreJids.placeholder")})]})}),s.jsx(Wt,{children:s.jsx(q,{type:"submit",children:e("n8n.button.save")})})]})})]})]})}const Jre=e=>["n8n","fetchSessions",JSON.stringify(e)],Qre=async({n8nId:e,instanceName:t})=>(await Ce.get(`/n8n/fetchSessions/${e}/${t}`)).data,Yre=e=>{const{n8nId:t,instanceName:n,...r}=e;return gt({...r,queryKey:Jre({n8nId:t,instanceName:n}),queryFn:()=>Qre({n8nId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0),staleTime:1e3*10})},fp={name:"",number:"",status:"all",time:"all",customCondition:"more",customValue:"",customUnit:"minutes"};function Zre(e,t){const n=parseInt(e);return!n||isNaN(n)||n<=0?null:t==="hours"?n*60:t==="days"?n*1440:n}function Xre(e,t){if(t.time==="all")return!0;const n=(Date.now()-new Date(e).getTime())/6e4;if(t.time==="custom"){const r=Zre(t.customValue,t.customUnit);return r===null?!0:t.customCondition==="more"?n>r:n<=r}if(t.time.startsWith(">")){const r=parseInt(t.time.slice(1));return n>r}return n<=parseInt(t.time)}function uO({n8nId:e}){const{t}=Le(),{instance:n}=ft(),{changeStatusN8n:r}=Rm(),[a,o]=y.useState(!1),[l,u]=y.useState([]),[d,f]=y.useState({}),[m,h]=y.useState(fp),[g,x]=y.useState(fp),[b,w]=y.useState(9),[C,k]=y.useState(9),[N,T]=y.useState("opened"),[_,P]=y.useState(!1),[M,O]=y.useState(""),[D,F]=y.useState(""),[$,te]=y.useState(!1),{data:z,refetch:ue}=Yre({instanceName:n?.name,n8nId:e,enabled:a}),V=y.useMemo(()=>{const j=z??[],I=g.name.trim().toLowerCase(),me=g.number.trim();return j.filter(xe=>!(I&&!xe.pushName?.toLowerCase().includes(I)||me&&!xe.remoteJid.includes(me)||g.status!=="all"&&xe.status!==g.status||!Xre(xe.updatedAt,g)))},[z,g]),ne=V.slice(0,C),Y=y.useMemo(()=>Object.keys(d).filter(j=>d[j]).map(j=>ne[Number(j)]?.remoteJid).filter(Boolean),[d,ne]);y.useEffect(()=>{k(b),f({})},[g,b]);const se=()=>{ue()},H=()=>{x(m)},W=()=>{h(fp),x(fp)},U=async(j,I)=>{try{if(!n)return;await r({instanceName:n.name,token:n.token,remoteJid:j,status:I}),X.success(t("n8n.toast.success.status")),se()}catch(me){console.error("Error:",me),X.error(`Error : ${me?.response?.data?.response?.message}`)}},A=async()=>{if(Y.length===0){X.error(t("sessions.mass.noneSelected"));return}try{if(!n)return;await Promise.all(Y.map(j=>r({instanceName:n.name,token:n.token,remoteJid:j,status:N}))),X.success(t("sessions.mass.success")),f({}),se()}catch(j){console.error(j),X.error(j?.response?.data?.response?.message??t("sessions.mass.error"))}},K=j=>{O(j),F(""),P(!0)},re=async()=>{if(!D.trim()){X.error(t("sessions.send.empty"));return}try{if(!n)return;te(!0),await Ce.post(`/message/sendText/${n.name}`,{number:M,text:D},{headers:{apikey:n.token}}),X.success(t("sessions.send.success")),P(!1),F(""),O("")}catch(j){console.error("Error:",j),X.error(j?.response?.data?.response?.message??j?.message??t("sessions.send.error"))}finally{te(!1)}},ee=[{id:"select",header:({table:j})=>s.jsx(es,{checked:j.getIsAllPageRowsSelected()||j.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:I=>j.toggleAllPageRowsSelected(!!I),"aria-label":t("sessions.mass.selectAll")}),cell:({row:j})=>s.jsx(es,{checked:j.getIsSelected(),onCheckedChange:I=>j.toggleSelected(!!I),"aria-label":t("sessions.mass.selectAll")}),enableSorting:!1},{accessorKey:"remoteJid",header:()=>s.jsx("div",{className:"text-center",children:t("n8n.sessions.table.remoteJid")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>s.jsx("div",{className:"text-center",children:t("n8n.sessions.table.pushName")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("pushName")})},{accessorKey:"sessionId",header:()=>s.jsx("div",{className:"text-center",children:t("n8n.sessions.table.sessionId")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("sessionId")})},{accessorKey:"status",header:()=>s.jsx("div",{className:"text-center",children:t("n8n.sessions.table.status")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:j})=>{const I=j.original;return s.jsxs(gs,{children:[s.jsx(vs,{asChild:!0,children:s.jsxs(q,{variant:"ghost",size:"icon",children:[s.jsx("span",{className:"sr-only",children:t("n8n.sessions.table.actions.title")}),s.jsx(Yo,{className:"h-4 w-4"})]})}),s.jsxs(ys,{align:"end",children:[s.jsx(Zo,{children:t("n8n.sessions.table.actions.title")}),s.jsx(Xo,{}),I.status!=="opened"&&s.jsxs(Ct,{onClick:()=>U(I.remoteJid,"opened"),children:[s.jsx(sl,{className:"mr-2 h-4 w-4"}),t("n8n.sessions.table.actions.open")]}),I.status!=="paused"&&I.status!=="closed"&&s.jsxs(Ct,{onClick:()=>U(I.remoteJid,"paused"),children:[s.jsx(rl,{className:"mr-2 h-4 w-4"}),t("n8n.sessions.table.actions.pause")]}),I.status!=="closed"&&s.jsxs(Ct,{onClick:()=>U(I.remoteJid,"closed"),children:[s.jsx(Xi,{className:"mr-2 h-4 w-4"}),t("n8n.sessions.table.actions.close")]}),s.jsxs(Ct,{onClick:()=>K(I.remoteJid),children:[s.jsx(nl,{className:"mr-2 h-4 w-4"}),t("sessions.actions.sendMessage")]}),s.jsxs(Ct,{onClick:()=>U(I.remoteJid,"delete"),children:[s.jsx(el,{className:"mr-2 h-4 w-4"}),t("n8n.sessions.table.actions.delete")]})]})]})}}],ie=["all","5","10","15","20","30","60",">60",">120",">300",">1440","custom"],de=["all","opened","paused","closed"];return s.jsxs(yt,{open:a,onOpenChange:o,children:[s.jsx(sn,{asChild:!0,children:s.jsxs(q,{variant:"secondary",size:"sm",children:[s.jsx(tl,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden md:inline",children:t("n8n.sessions.label")})]})}),s.jsxs(ht,{className:"max-w-7xl h-[85vh] flex flex-col overflow-hidden",children:[s.jsx(mt,{children:s.jsx(xt,{children:t("n8n.sessions.label")})}),s.jsxs("div",{className:"flex-1 space-y-4 overflow-y-auto pr-2",children:[s.jsxs(Un,{children:[s.jsx(Yn,{children:s.jsx(Zn,{className:"text-base",children:t("sessions.filters.title")})}),s.jsxs(Vn,{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.name")}),s.jsx(G,{placeholder:t("sessions.filters.namePlaceholder"),value:m.name,onChange:j=>h(I=>({...I,name:j.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.number")}),s.jsx(G,{placeholder:t("sessions.filters.numberPlaceholder"),value:m.number,onChange:j=>h(I=>({...I,number:j.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.status")}),s.jsxs(_t,{value:m.status,onValueChange:j=>h(I=>({...I,status:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsx(It,{children:de.map(j=>s.jsx(we,{value:j,children:t(`sessions.filters.statusOptions.${j}`)},j))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.time")}),s.jsxs(_t,{value:m.time,onValueChange:j=>h(I=>({...I,time:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsx(It,{children:ie.map(j=>s.jsx(we,{value:j,children:t(`sessions.filters.timeOptions.${j}`)},j))})]})]})]}),m.time==="custom"&&s.jsxs("div",{className:"grid grid-cols-1 gap-2 md:grid-cols-3",children:[s.jsxs(_t,{value:m.customCondition,onValueChange:j=>h(I=>({...I,customCondition:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"more",children:t("sessions.filters.custom.more")}),s.jsx(we,{value:"less",children:t("sessions.filters.custom.less")})]})]}),s.jsx(G,{type:"number",min:1,placeholder:t("sessions.filters.custom.valuePlaceholder"),value:m.customValue,onChange:j=>h(I=>({...I,customValue:j.target.value}))}),s.jsxs(_t,{value:m.customUnit,onValueChange:j=>h(I=>({...I,customUnit:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"minutes",children:t("sessions.filters.custom.minutes")}),s.jsx(we,{value:"hours",children:t("sessions.filters.custom.hours")}),s.jsx(we,{value:"days",children:t("sessions.filters.custom.days")})]})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(q,{onClick:H,size:"sm",children:t("sessions.filters.apply")}),s.jsx(q,{onClick:W,size:"sm",variant:"outline",children:t("sessions.filters.clear")}),s.jsxs(q,{onClick:se,size:"sm",variant:"outline",children:[s.jsx(al,{size:14,className:"mr-1"}),t("button.refresh")]})]})]})]}),Y.length>0&&s.jsxs(Un,{children:[s.jsx(Yn,{children:s.jsx(Zn,{className:"text-base",children:t("sessions.mass.title")})}),s.jsx(Vn,{children:s.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:t("sessions.mass.selected",{count:Y.length})}),s.jsxs("div",{className:"flex-1 min-w-[180px] space-y-1",children:[s.jsx(Ve,{children:t("sessions.mass.newStatus")}),s.jsxs(_t,{value:N,onValueChange:T,children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"opened",children:t("n8n.sessions.table.actions.open")}),s.jsx(we,{value:"paused",children:t("n8n.sessions.table.actions.pause")}),s.jsx(we,{value:"closed",children:t("n8n.sessions.table.actions.close")}),s.jsx(we,{value:"delete",children:t("n8n.sessions.table.actions.delete")})]})]})]}),s.jsx(q,{onClick:A,size:"sm",children:t("sessions.mass.apply")})]})})]}),s.jsx(ii,{columns:ee,data:ne,onSortingChange:u,state:{sorting:l,rowSelection:d},onRowSelectionChange:f,enableRowSelection:!0,getRowId:(j,I)=>String(I),noResultsMessage:t("sessions.empty")}),s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 px-1 text-sm text-muted-foreground",children:[s.jsx("span",{children:t("sessions.pagination.showing",{shown:ne.length,total:V.length})}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(Ve,{htmlFor:"per-page",className:"text-xs",children:t("sessions.pagination.perPage")}),s.jsxs(_t,{value:String(b),onValueChange:j=>w(parseInt(j)),children:[s.jsx(Rt,{id:"per-page",className:"h-8 w-20",children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"9",children:"9"}),s.jsx(we,{value:"25",children:"25"}),s.jsx(we,{value:"50",children:"50"}),s.jsx(we,{value:"100",children:"100"})]})]}),Ck(j=>Math.min(j+b,V.length)),children:t("sessions.pagination.showMore")}),Ck(V.length),children:t("sessions.pagination.showAll")}),C>b&&s.jsx(q,{size:"sm",variant:"outline",onClick:()=>k(b),children:t("sessions.pagination.showLess")})]})]})]}),s.jsx(yt,{open:_,onOpenChange:j=>!$&&P(j),children:s.jsxs(ht,{className:"sm:max-w-md",children:[s.jsx(mt,{children:s.jsx(xt,{children:t("sessions.send.title")})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{children:t("sessions.send.to")}),s.jsx(G,{value:M,disabled:!0})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{children:t("sessions.send.messagePlaceholder")}),s.jsx(ei,{rows:4,placeholder:t("sessions.send.messagePlaceholder"),value:D,onChange:j=>F(j.target.value)})]})]}),s.jsxs(Wt,{children:[s.jsx(q,{variant:"outline",onClick:()=>P(!1),disabled:$,children:t("button.cancel")}),s.jsx(q,{onClick:re,disabled:$,children:t($?"sessions.send.sending":"sessions.send.send")})]})]})})]})]})}const ese=hn({enabled:Me(),description:he(),webhookUrl:he(),basicAuthUser:he(),basicAuthPass:he(),triggerType:he(),triggerOperator:he().optional(),triggerValue:he().optional(),expire:at.number().optional(),keywordFinish:he().optional(),delayMessage:at.number().optional(),unknownMessage:he().optional(),listeningFromMe:Me().optional(),stopBotFromMe:Me().optional(),keepOpen:Me().optional(),debounceTime:at.number().optional(),splitMessages:Me().optional(),timePerChar:at.number().optional()});function dO({initialData:e,onSubmit:t,handleDelete:n,n8nId:r,isModal:a=!1,isLoading:o=!1,openDeletionDialog:l=!1,setOpenDeletionDialog:u=()=>{}}){const{t:d}=Le(),f=mn({resolver:gn(ese),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}}),m=f.watch("triggerType");return s.jsx(mr,{...f,children:s.jsxs("form",{onSubmit:f.handleSubmit(t),className:"w-full space-y-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsx(Re,{name:"enabled",label:d("n8n.form.enabled.label"),reverse:!0}),s.jsx(le,{name:"description",label:d("n8n.form.description.label"),children:s.jsx(G,{})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("n8n.form.n8nSettings.label")}),s.jsx(Qt,{})]}),s.jsx(le,{name:"webhookUrl",label:d("n8n.form.webhookUrl.label"),required:!0,children:s.jsx(G,{})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("n8n.form.basicAuth.label")}),s.jsx(Qt,{})]}),s.jsxs("div",{className:"flex w-full flex-row gap-4",children:[s.jsx(le,{name:"basicAuthUser",label:d("n8n.form.basicAuthUser.label"),className:"flex-1",children:s.jsx(G,{})}),s.jsx(le,{name:"basicAuthPass",label:d("n8n.form.basicAuthPass.label"),className:"flex-1",children:s.jsx(G,{type:"password"})})]}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("n8n.form.triggerSettings.label")}),s.jsx(Qt,{})]}),s.jsx(cn,{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"}]}),m==="keyword"&&s.jsxs(s.Fragment,{children:[s.jsx(cn,{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"}]}),s.jsx(le,{name:"triggerValue",label:d("n8n.form.triggerValue.label"),children:s.jsx(G,{})})]}),m==="advanced"&&s.jsx(le,{name:"triggerValue",label:d("n8n.form.triggerConditions.label"),children:s.jsx(G,{})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("n8n.form.generalSettings.label")}),s.jsx(Qt,{})]}),s.jsx(le,{name:"expire",label:d("n8n.form.expire.label"),children:s.jsx(G,{type:"number"})}),s.jsx(le,{name:"keywordFinish",label:d("n8n.form.keywordFinish.label"),children:s.jsx(G,{})}),s.jsx(le,{name:"delayMessage",label:d("n8n.form.delayMessage.label"),children:s.jsx(G,{type:"number"})}),s.jsx(le,{name:"unknownMessage",label:d("n8n.form.unknownMessage.label"),children:s.jsx(G,{})}),s.jsx(Re,{name:"listeningFromMe",label:d("n8n.form.listeningFromMe.label"),reverse:!0}),s.jsx(Re,{name:"stopBotFromMe",label:d("n8n.form.stopBotFromMe.label"),reverse:!0}),s.jsx(Re,{name:"keepOpen",label:d("n8n.form.keepOpen.label"),reverse:!0}),s.jsx(le,{name:"debounceTime",label:d("n8n.form.debounceTime.label"),children:s.jsx(G,{type:"number"})}),s.jsx(Re,{name:"splitMessages",label:d("n8n.form.splitMessages.label"),reverse:!0}),f.watch("splitMessages")&&s.jsx(le,{name:"timePerChar",label:d("n8n.form.timePerChar.label"),children:s.jsx(G,{type:"number"})})]}),a&&s.jsx(Wt,{children:s.jsx(q,{disabled:o,type:"submit",children:d(o?"n8n.button.saving":"n8n.button.save")})}),!a&&s.jsxs("div",{children:[s.jsx(uO,{n8nId:r}),s.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[s.jsxs(yt,{open:l,onOpenChange:u,children:[s.jsx(sn,{asChild:!0,children:s.jsx(q,{variant:"destructive",size:"sm",children:d("n8n.button.delete")})}),s.jsx(ht,{children:s.jsxs(mt,{children:[s.jsx(xt,{children:d("modal.delete.title")}),s.jsx(Er,{children:d("modal.delete.messageSingle")}),s.jsxs(Wt,{children:[s.jsx(q,{size:"sm",variant:"outline",onClick:()=>u(!1),children:d("button.cancel")}),s.jsx(q,{variant:"destructive",onClick:n,children:d("button.delete")})]})]})})]}),s.jsx(q,{disabled:o,type:"submit",children:d(o?"n8n.button.saving":"n8n.button.update")})]})]})]})})}function tse({resetTable:e}){const{t}=Le(),{instance:n}=ft(),[r,a]=y.useState(!1),[o,l]=y.useState(!1),{createN8n:u}=Rm(),d=async f=>{try{if(!n||!n.name)throw new Error("instance not found");a(!0);const m={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:m}),X.success(t("n8n.toast.success.create")),l(!1),e()}catch(m){console.error("Error:",m),X.error(`Error: ${m?.response?.data?.response?.message}`)}finally{a(!1)}};return s.jsxs(yt,{open:o,onOpenChange:l,children:[s.jsx(sn,{asChild:!0,children:s.jsxs(q,{size:"sm",children:[s.jsx(Zr,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:t("n8n.button.create")})]})}),s.jsxs(ht,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[s.jsx(mt,{children:s.jsx(xt,{children:t("n8n.form.title")})}),s.jsx(dO,{onSubmit:d,isModal:!0,isLoading:r})]})]})}const nse=e=>["n8n","getN8n",JSON.stringify(e)],rse=async({n8nId:e,instanceName:t})=>(await Ce.get(`/n8n/fetch/${e}/${t}`)).data,sse=e=>{const{n8nId:t,instanceName:n,...r}=e;return gt({...r,queryKey:nse({n8nId:t,instanceName:n}),queryFn:()=>rse({n8nId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0)})};function ase({n8nId:e,resetTable:t}){const{t:n}=Le(),{instance:r}=ft(),a=Nn(),[o,l]=y.useState(!1),{deleteN8n:u,updateN8n:d}=Rm(),{data:f,isLoading:m}=sse({n8nId:e,instanceName:r?.name}),h=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}),X.success(n("n8n.toast.success.update")),t(),a(`/manager/instance/${r.id}/n8n/${e}`)}else console.error("Token not found")}catch(w){console.error("Error:",w),X.error(`Error: ${w?.response?.data?.response?.message}`)}},x=async()=>{try{r&&r.name&&e?(await u({instanceName:r.name,n8nId:e}),X.success(n("n8n.toast.success.delete")),l(!1),t(),a(`/manager/instance/${r.id}/n8n`)):console.error("instance not found")}catch(b){console.error("Erro ao excluir n8n:",b)}};return m?s.jsx(Hn,{}):s.jsx("div",{className:"m-4",children:s.jsx(dO,{initialData:h,onSubmit:g,n8nId:e,handleDelete:x,isModal:!1,isLoading:m,openDeletionDialog:o,setOpenDeletionDialog:l})})}function CE(){const{t:e}=Le(),t=Xa("(min-width: 768px)"),{instance:n}=ft(),{n8nId:r}=Is(),{data:a,refetch:o,isLoading:l,error:u}=cO({instanceName:n?.name}),d=Nn(),f=h=>{n&&d(`/manager/instance/${n.id}/n8n/${h}`)},m=()=>{o()};return s.jsx("main",{className:"pt-5",children:s.jsxs(oa,{error:u,name:"n8n",envVar:"N8N_ENABLED",children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[s.jsx("h3",{className:"text-lg font-medium",children:e("n8n.title")}),s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsx(uO,{}),s.jsx(Gre,{}),s.jsx(tse,{resetTable:m})]})]}),s.jsx(Qt,{className:"my-4"}),s.jsxs(ai,{direction:t?"horizontal":"vertical",children:[s.jsx(Nr,{defaultSize:r?35:100,className:"pr-4",children:s.jsx("div",{className:"flex flex-col gap-3",children:l?s.jsx(Hn,{}):s.jsx(s.Fragment,{children:a&&a.length>0&&Array.isArray(a)?a.map(h=>s.jsx(q,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>f(`${h.id}`),variant:r===h.id?"secondary":"outline",children:s.jsx("h4",{className:"text-base",children:h.description||h.id})},h.id)):s.jsx(q,{variant:"link",children:e("n8n.table.none")})})})}),r&&s.jsxs(s.Fragment,{children:[s.jsx(oi,{withHandle:!0,className:"border border-border"}),s.jsx(Nr,{children:s.jsx(ase,{n8nId:r,resetTable:m})})]})]})]})})}const ose=e=>["openai","findOpenai",JSON.stringify(e)],ise=async({instanceName:e,token:t})=>(await Ce.get(`/openai/find/${e}`,{headers:{apiKey:t}})).data,fO=e=>{const{instanceName:t,token:n,...r}=e;return gt({...r,queryKey:ose({instanceName:t}),queryFn:()=>ise({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},lse=e=>["openai","findOpenaiCreds",JSON.stringify(e)],cse=async({instanceName:e,token:t})=>(await Ce.get(`/openai/creds/${e}`,{headers:{apiKey:t}})).data,Lw=e=>{const{instanceName:t,token:n,...r}=e;return gt({staleTime:1e3*60*60*6,...r,queryKey:lse({instanceName:t}),queryFn:()=>cse({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},use=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/openai/creds/${e}`,n,{headers:{apikey:t}})).data,dse=async({openaiCredsId:e,instanceName:t})=>(await Ce.delete(`/openai/creds/${e}/${t}`)).data,fse=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/openai/create/${e}`,n,{headers:{apikey:t}})).data,pse=async({instanceName:e,token:t,openaiId:n,data:r})=>(await Ce.put(`/openai/update/${n}/${e}`,r,{headers:{apikey:t}})).data,hse=async({instanceName:e,token:t,openaiId:n})=>(await Ce.delete(`/openai/delete/${n}/${e}`,{headers:{apikey:t}})).data,mse=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/openai/settings/${e}`,n,{headers:{apikey:t}})).data,gse=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await Ce.post(`/openai/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function Td(){const e=ot(mse,{invalidateKeys:[["openai","fetchDefaultSettings"]]}),t=ot(gse,{invalidateKeys:[["openai","getOpenai"],["openai","fetchSessions"]]}),n=ot(hse,{invalidateKeys:[["openai","getOpenai"],["openai","findOpenai"],["openai","fetchSessions"]]}),r=ot(pse,{invalidateKeys:[["openai","getOpenai"],["openai","findOpenai"],["openai","fetchSessions"]]}),a=ot(fse,{invalidateKeys:[["openai","findOpenai"]]}),o=ot(use,{invalidateKeys:[["openai","findOpenaiCreds"]]}),l=ot(dse,{invalidateKeys:[["openai","findOpenaiCreds"]]});return{setDefaultSettingsOpenai:e,changeStatusOpenai:t,deleteOpenai:n,updateOpenai:r,createOpenai:a,createOpenaiCreds:o,deleteOpenaiCreds:l}}const vse=hn({name:he(),apiKey:he()});function pO({onCredentialsUpdate:e,showText:t=!0}){const{t:n}=Le(),{instance:r}=ft(),{createOpenaiCreds:a,deleteOpenaiCreds:o}=Td(),[l,u]=y.useState(!1),[d,f]=y.useState([]),{data:m}=Lw({instanceName:r?.name,enabled:l}),h=mn({resolver:gn(vse),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 a({instanceName:r.name,token:r.token,data:C}),X.success(n("openai.toast.success.credentialsCreate")),h.reset(),e&&e()}catch(C){console.error("Error:",C),X.error(`Error: ${C?.response?.data?.response?.message}`)}},x=async w=>{if(!r?.name){X.error("Instance not found.");return}try{await o({openaiCredsId:w,instanceName:r?.name}),X.success(n("openai.toast.success.credentialsDelete")),e&&e()}catch(C){console.error("Error:",C),X.error(`Error: ${C?.response?.data?.response?.message}`)}},b=[{accessorKey:"name",header:({column:w})=>s.jsxs(q,{variant:"ghost",onClick:()=>w.toggleSorting(w.getIsSorted()==="asc"),children:[n("openai.credentials.table.name"),s.jsx(LB,{className:"ml-2 h-4 w-4"})]}),cell:({row:w})=>s.jsx("div",{children:w.getValue("name")})},{accessorKey:"apiKey",header:()=>s.jsx("div",{className:"text-right",children:n("openai.credentials.table.apiKey")}),cell:({row:w})=>s.jsxs("div",{children:[`${w.getValue("apiKey")}`.slice(0,20),"..."]})},{id:"actions",enableHiding:!1,cell:({row:w})=>{const C=w.original;return s.jsxs(gs,{children:[s.jsx(vs,{asChild:!0,children:s.jsxs(q,{variant:"ghost",className:"h-8 w-8 p-0",children:[s.jsx("span",{className:"sr-only",children:n("openai.credentials.table.actions.title")}),s.jsx(Yo,{className:"h-4 w-4"})]})}),s.jsxs(ys,{align:"end",children:[s.jsx(Zo,{children:n("openai.credentials.table.actions.title")}),s.jsx(Xo,{}),s.jsx(Ct,{onClick:()=>x(C.id),children:n("openai.credentials.table.actions.delete")})]})]})}}];return s.jsxs(yt,{open:l,onOpenChange:u,children:[s.jsx(sn,{asChild:!0,children:s.jsx(q,{variant:"secondary",size:"sm",type:"button",children:t?s.jsxs(s.Fragment,{children:[s.jsx(cz,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden md:inline",children:n("openai.credentials.title")})]}):s.jsx(Zr,{size:16})})}),s.jsxs(ht,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[s.jsx(mt,{children:s.jsx(xt,{children:n("openai.credentials.title")})}),s.jsx(mr,{...h,children:s.jsx("div",{onClick:w=>w.stopPropagation(),onSubmit:w=>w.stopPropagation(),onKeyDown:w=>w.stopPropagation(),children:s.jsxs("form",{onSubmit:w=>{w.preventDefault(),w.stopPropagation(),h.handleSubmit(g)(w)},className:"w-full space-y-6",children:[s.jsx("div",{children:s.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[s.jsx(le,{name:"name",label:n("openai.credentials.table.name"),children:s.jsx(G,{})}),s.jsx(le,{name:"apiKey",label:n("openai.credentials.table.apiKey"),children:s.jsx(G,{type:"password"})})]})}),s.jsx(Wt,{children:s.jsx(q,{type:"submit",children:n("openai.button.save")})})]})})}),s.jsx(Qt,{}),s.jsx("div",{children:s.jsx(ii,{columns:b,data:m??[],onSortingChange:f,state:{sorting:d},noResultsMessage:n("openai.credentials.table.none")})})]})]})}const yse=e=>["openai","fetchDefaultSettings",JSON.stringify(e)],bse=async({instanceName:e,token:t})=>{const n=await Ce.get(`/openai/fetchSettings/${e}`,{headers:{apiKey:t}});return Array.isArray(n.data)?n.data[0]:n.data},xse=e=>{const{instanceName:t,token:n,...r}=e;return gt({...r,queryKey:yse({instanceName:t}),queryFn:()=>bse({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},wse=hn({openaiCredsId:he(),expire:at.number(),keywordFinish:he(),delayMessage:at.number().default(0),unknownMessage:he(),listeningFromMe:Me(),stopBotFromMe:Me(),keepOpen:Me(),debounceTime:at.number(),speechToText:Me(),ignoreJids:As(he()).default([]),openaiIdFallback:Mc([Tc(),he()]).optional(),splitMessages:Me().optional(),timePerChar:at.number().optional()});function Sse(){const{t:e}=Le(),{instance:t}=ft(),{setDefaultSettingsOpenai:n}=Td(),[r,a]=y.useState(!1),{data:o,refetch:l}=xse({instanceName:t?.name,enabled:r}),{data:u,refetch:d}=fO({instanceName:t?.name,enabled:r}),{data:f}=Lw({instanceName:t?.name,enabled:r}),m=mn({resolver:gn(wse),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&&m.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 h=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}),X.success(e("openai.toast.defaultSettings.success"))}catch(b){console.error("Error:",b),X.error(`Error: ${b?.response?.data?.response?.message}`)}};function g(){l(),d()}return s.jsxs(yt,{open:r,onOpenChange:a,children:[s.jsx(sn,{asChild:!0,children:s.jsxs(q,{variant:"secondary",size:"sm",children:[s.jsx(Qo,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden md:inline",children:e("openai.defaultSettings")})]})}),s.jsxs(ht,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:g,children:[s.jsx(mt,{children:s.jsx(xt,{children:e("openai.defaultSettings")})}),s.jsx(mr,{...m,children:s.jsxs("form",{className:"w-full space-y-6",onSubmit:m.handleSubmit(h),children:[s.jsx("div",{children:s.jsxs("div",{className:"space-y-4",children:[s.jsx(cn,{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}))||[]}),s.jsx(cn,{name:"openaiIdFallback",label:e("openai.form.openaiIdFallback.label"),options:u?.filter(x=>!!x.id).map(x=>({label:x.description,value:x.id}))??[]}),s.jsx(le,{name:"expire",label:e("openai.form.expire.label"),children:s.jsx(G,{type:"number"})}),s.jsx(le,{name:"keywordFinish",label:e("openai.form.keywordFinish.label"),children:s.jsx(G,{})}),s.jsx(le,{name:"delayMessage",label:e("openai.form.delayMessage.label"),children:s.jsx(G,{type:"number"})}),s.jsx(le,{name:"unknownMessage",label:e("openai.form.unknownMessage.label"),children:s.jsx(G,{})}),s.jsx(Re,{name:"listeningFromMe",label:e("openai.form.listeningFromMe.label"),reverse:!0}),s.jsx(Re,{name:"stopBotFromMe",label:e("openai.form.stopBotFromMe.label"),reverse:!0}),s.jsx(Re,{name:"keepOpen",label:e("openai.form.keepOpen.label"),reverse:!0}),s.jsx(Re,{name:"speechToText",label:e("openai.form.speechToText.label"),reverse:!0}),s.jsx(le,{name:"debounceTime",label:e("openai.form.debounceTime.label"),children:s.jsx(G,{type:"number"})}),s.jsx(Re,{name:"splitMessages",label:e("openai.form.splitMessages.label"),reverse:!0}),m.watch("splitMessages")&&s.jsx(le,{name:"timePerChar",label:e("openai.form.timePerChar.label"),children:s.jsx(G,{type:"number"})}),s.jsx(ri,{name:"ignoreJids",label:e("openai.form.ignoreJids.label"),placeholder:e("openai.form.ignoreJids.placeholder")})]})}),s.jsx(Wt,{children:s.jsx(q,{type:"submit",children:e("openai.button.save")})})]})})]})]})}const Cse=e=>["openai","getModels",JSON.stringify(e)],jse=async({instanceName:e,openaiCredsId:t,token:n})=>{const r=t?{openaiCredsId:t}:{};return(await Ce.get(`/openai/getModels/${e}`,{headers:{apiKey:n},params:r})).data},kse=e=>{const{instanceName:t,openaiCredsId:n,token:r,...a}=e;return gt({staleTime:1e3*60*60*6,...a,queryKey:Cse({instanceName:t,openaiCredsId:n}),queryFn:()=>jse({instanceName:t,openaiCredsId:n,token:r}),enabled:!!t&&!!n&&(e.enabled??!0)})},Ese=e=>["openai","fetchSessions",JSON.stringify(e)],Nse=async({instanceName:e,openaiId:t,token:n})=>(await Ce.get(`/openai/fetchSessions/${t}/${e}`,{headers:{apiKey:n}})).data,Tse=e=>{const{instanceName:t,token:n,openaiId:r,...a}=e;return gt({...a,queryKey:Ese({instanceName:t}),queryFn:()=>Nse({instanceName:t,token:n,openaiId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})},pp={name:"",number:"",status:"all",time:"all",customCondition:"more",customValue:"",customUnit:"minutes"};function Mse(e,t){const n=parseInt(e);return!n||isNaN(n)||n<=0?null:t==="hours"?n*60:t==="days"?n*1440:n}function _se(e,t){if(t.time==="all")return!0;const n=(Date.now()-new Date(e).getTime())/6e4;if(t.time==="custom"){const r=Mse(t.customValue,t.customUnit);return r===null?!0:t.customCondition==="more"?n>r:n<=r}if(t.time.startsWith(">")){const r=parseInt(t.time.slice(1));return n>r}return n<=parseInt(t.time)}function hO({openaiId:e}){const{t}=Le(),{instance:n}=ft(),{changeStatusOpenai:r}=Td(),[a,o]=y.useState(!1),[l,u]=y.useState([]),[d,f]=y.useState({}),[m,h]=y.useState(pp),[g,x]=y.useState(pp),[b,w]=y.useState(9),[C,k]=y.useState(9),[N,T]=y.useState("opened"),[_,P]=y.useState(!1),[M,O]=y.useState(""),[D,F]=y.useState(""),[$,te]=y.useState(!1),{data:z,refetch:ue}=Tse({instanceName:n?.name,openaiId:e,enabled:a}),V=y.useMemo(()=>{const j=z??[],I=g.name.trim().toLowerCase(),me=g.number.trim();return j.filter(xe=>!(I&&!xe.pushName?.toLowerCase().includes(I)||me&&!xe.remoteJid.includes(me)||g.status!=="all"&&xe.status!==g.status||!_se(xe.updatedAt,g)))},[z,g]),ne=V.slice(0,C),Y=y.useMemo(()=>Object.keys(d).filter(j=>d[j]).map(j=>ne[Number(j)]?.remoteJid).filter(Boolean),[d,ne]);y.useEffect(()=>{k(b),f({})},[g,b]);const se=()=>{ue()},H=()=>{x(m)},W=()=>{h(pp),x(pp)},U=async(j,I)=>{try{if(!n)return;await r({instanceName:n.name,token:n.token,remoteJid:j,status:I}),X.success(t("openai.toast.success.status")),se()}catch(me){console.error("Error:",me),X.error(`Error : ${me?.response?.data?.response?.message}`)}},A=async()=>{if(Y.length===0){X.error(t("sessions.mass.noneSelected"));return}try{if(!n)return;await Promise.all(Y.map(j=>r({instanceName:n.name,token:n.token,remoteJid:j,status:N}))),X.success(t("sessions.mass.success")),f({}),se()}catch(j){console.error(j),X.error(j?.response?.data?.response?.message??t("sessions.mass.error"))}},K=j=>{O(j),F(""),P(!0)},re=async()=>{if(!D.trim()){X.error(t("sessions.send.empty"));return}try{if(!n)return;te(!0),await Ce.post(`/message/sendText/${n.name}`,{number:M,text:D},{headers:{apikey:n.token}}),X.success(t("sessions.send.success")),P(!1),F(""),O("")}catch(j){console.error("Error:",j),X.error(j?.response?.data?.response?.message??j?.message??t("sessions.send.error"))}finally{te(!1)}},ee=[{id:"select",header:({table:j})=>s.jsx(es,{checked:j.getIsAllPageRowsSelected()||j.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:I=>j.toggleAllPageRowsSelected(!!I),"aria-label":t("sessions.mass.selectAll")}),cell:({row:j})=>s.jsx(es,{checked:j.getIsSelected(),onCheckedChange:I=>j.toggleSelected(!!I),"aria-label":t("sessions.mass.selectAll")}),enableSorting:!1},{accessorKey:"remoteJid",header:()=>s.jsx("div",{className:"text-center",children:t("openai.sessions.table.remoteJid")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>s.jsx("div",{className:"text-center",children:t("openai.sessions.table.pushName")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("pushName")})},{accessorKey:"sessionId",header:()=>s.jsx("div",{className:"text-center",children:t("openai.sessions.table.sessionId")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("sessionId")})},{accessorKey:"status",header:()=>s.jsx("div",{className:"text-center",children:t("openai.sessions.table.status")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:j})=>{const I=j.original;return s.jsxs(gs,{children:[s.jsx(vs,{asChild:!0,children:s.jsxs(q,{variant:"ghost",size:"icon",children:[s.jsx("span",{className:"sr-only",children:t("openai.sessions.table.actions.title")}),s.jsx(Yo,{className:"h-4 w-4"})]})}),s.jsxs(ys,{align:"end",children:[s.jsx(Zo,{children:t("openai.sessions.table.actions.title")}),s.jsx(Xo,{}),I.status!=="opened"&&s.jsxs(Ct,{onClick:()=>U(I.remoteJid,"opened"),children:[s.jsx(sl,{className:"mr-2 h-4 w-4"}),t("openai.sessions.table.actions.open")]}),I.status!=="paused"&&I.status!=="closed"&&s.jsxs(Ct,{onClick:()=>U(I.remoteJid,"paused"),children:[s.jsx(rl,{className:"mr-2 h-4 w-4"}),t("openai.sessions.table.actions.pause")]}),I.status!=="closed"&&s.jsxs(Ct,{onClick:()=>U(I.remoteJid,"closed"),children:[s.jsx(Xi,{className:"mr-2 h-4 w-4"}),t("openai.sessions.table.actions.close")]}),s.jsxs(Ct,{onClick:()=>K(I.remoteJid),children:[s.jsx(nl,{className:"mr-2 h-4 w-4"}),t("sessions.actions.sendMessage")]}),s.jsxs(Ct,{onClick:()=>U(I.remoteJid,"delete"),children:[s.jsx(el,{className:"mr-2 h-4 w-4"}),t("openai.sessions.table.actions.delete")]})]})]})}}],ie=["all","5","10","15","20","30","60",">60",">120",">300",">1440","custom"],de=["all","opened","paused","closed"];return s.jsxs(yt,{open:a,onOpenChange:o,children:[s.jsx(sn,{asChild:!0,children:s.jsxs(q,{variant:"secondary",size:"sm",children:[s.jsx(tl,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden md:inline",children:t("openai.sessions.label")})]})}),s.jsxs(ht,{className:"max-w-7xl h-[85vh] flex flex-col overflow-hidden",children:[s.jsx(mt,{children:s.jsx(xt,{children:t("openai.sessions.label")})}),s.jsxs("div",{className:"flex-1 space-y-4 overflow-y-auto pr-2",children:[s.jsxs(Un,{children:[s.jsx(Yn,{children:s.jsx(Zn,{className:"text-base",children:t("sessions.filters.title")})}),s.jsxs(Vn,{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.name")}),s.jsx(G,{placeholder:t("sessions.filters.namePlaceholder"),value:m.name,onChange:j=>h(I=>({...I,name:j.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.number")}),s.jsx(G,{placeholder:t("sessions.filters.numberPlaceholder"),value:m.number,onChange:j=>h(I=>({...I,number:j.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.status")}),s.jsxs(_t,{value:m.status,onValueChange:j=>h(I=>({...I,status:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsx(It,{children:de.map(j=>s.jsx(we,{value:j,children:t(`sessions.filters.statusOptions.${j}`)},j))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.time")}),s.jsxs(_t,{value:m.time,onValueChange:j=>h(I=>({...I,time:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsx(It,{children:ie.map(j=>s.jsx(we,{value:j,children:t(`sessions.filters.timeOptions.${j}`)},j))})]})]})]}),m.time==="custom"&&s.jsxs("div",{className:"grid grid-cols-1 gap-2 md:grid-cols-3",children:[s.jsxs(_t,{value:m.customCondition,onValueChange:j=>h(I=>({...I,customCondition:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"more",children:t("sessions.filters.custom.more")}),s.jsx(we,{value:"less",children:t("sessions.filters.custom.less")})]})]}),s.jsx(G,{type:"number",min:1,placeholder:t("sessions.filters.custom.valuePlaceholder"),value:m.customValue,onChange:j=>h(I=>({...I,customValue:j.target.value}))}),s.jsxs(_t,{value:m.customUnit,onValueChange:j=>h(I=>({...I,customUnit:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"minutes",children:t("sessions.filters.custom.minutes")}),s.jsx(we,{value:"hours",children:t("sessions.filters.custom.hours")}),s.jsx(we,{value:"days",children:t("sessions.filters.custom.days")})]})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(q,{onClick:H,size:"sm",children:t("sessions.filters.apply")}),s.jsx(q,{onClick:W,size:"sm",variant:"outline",children:t("sessions.filters.clear")}),s.jsxs(q,{onClick:se,size:"sm",variant:"outline",children:[s.jsx(al,{size:14,className:"mr-1"}),t("button.refresh")]})]})]})]}),Y.length>0&&s.jsxs(Un,{children:[s.jsx(Yn,{children:s.jsx(Zn,{className:"text-base",children:t("sessions.mass.title")})}),s.jsx(Vn,{children:s.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:t("sessions.mass.selected",{count:Y.length})}),s.jsxs("div",{className:"flex-1 min-w-[180px] space-y-1",children:[s.jsx(Ve,{children:t("sessions.mass.newStatus")}),s.jsxs(_t,{value:N,onValueChange:T,children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"opened",children:t("openai.sessions.table.actions.open")}),s.jsx(we,{value:"paused",children:t("openai.sessions.table.actions.pause")}),s.jsx(we,{value:"closed",children:t("openai.sessions.table.actions.close")}),s.jsx(we,{value:"delete",children:t("openai.sessions.table.actions.delete")})]})]})]}),s.jsx(q,{onClick:A,size:"sm",children:t("sessions.mass.apply")})]})})]}),s.jsx(ii,{columns:ee,data:ne,onSortingChange:u,state:{sorting:l,rowSelection:d},onRowSelectionChange:f,enableRowSelection:!0,getRowId:(j,I)=>String(I),noResultsMessage:t("sessions.empty")}),s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 px-1 text-sm text-muted-foreground",children:[s.jsx("span",{children:t("sessions.pagination.showing",{shown:ne.length,total:V.length})}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(Ve,{htmlFor:"per-page",className:"text-xs",children:t("sessions.pagination.perPage")}),s.jsxs(_t,{value:String(b),onValueChange:j=>w(parseInt(j)),children:[s.jsx(Rt,{id:"per-page",className:"h-8 w-20",children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"9",children:"9"}),s.jsx(we,{value:"25",children:"25"}),s.jsx(we,{value:"50",children:"50"}),s.jsx(we,{value:"100",children:"100"})]})]}),Ck(j=>Math.min(j+b,V.length)),children:t("sessions.pagination.showMore")}),Ck(V.length),children:t("sessions.pagination.showAll")}),C>b&&s.jsx(q,{size:"sm",variant:"outline",onClick:()=>k(b),children:t("sessions.pagination.showLess")})]})]})]}),s.jsx(yt,{open:_,onOpenChange:j=>!$&&P(j),children:s.jsxs(ht,{className:"sm:max-w-md",children:[s.jsx(mt,{children:s.jsx(xt,{children:t("sessions.send.title")})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{children:t("sessions.send.to")}),s.jsx(G,{value:M,disabled:!0})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{children:t("sessions.send.messagePlaceholder")}),s.jsx(ei,{rows:4,placeholder:t("sessions.send.messagePlaceholder"),value:D,onChange:j=>F(j.target.value)})]})]}),s.jsxs(Wt,{children:[s.jsx(q,{variant:"outline",onClick:()=>P(!1),disabled:$,children:t("button.cancel")}),s.jsx(q,{onClick:re,disabled:$,children:t($?"sessions.send.sending":"sessions.send.send")})]})]})})]})]})}const Pse=hn({enabled:Me(),description:he(),openaiCredsId:he(),botType:he(),assistantId:he().optional(),functionUrl:he().optional(),model:he().optional(),systemMessages:he().optional(),assistantMessages:he().optional(),userMessages:he().optional(),maxTokens:at.number().optional(),triggerType:he(),triggerOperator:he().optional(),triggerValue:he().optional(),expire:at.number().optional(),keywordFinish:he().optional(),delayMessage:at.number().optional(),unknownMessage:he().optional(),listeningFromMe:Me().optional(),stopBotFromMe:Me().optional(),keepOpen:Me().optional(),debounceTime:at.number().optional(),splitMessages:Me().optional(),timePerChar:at.number().optional()});function mO({initialData:e,onSubmit:t,handleDelete:n,openaiId:r,isModal:a=!1,isLoading:o=!1,openDeletionDialog:l=!1,setOpenDeletionDialog:u=()=>{},open:d}){const{t:f}=Le(),{instance:m}=ft(),[h,g]=y.useState(!1),{data:x,refetch:b}=Lw({instanceName:m?.name,enabled:d}),w=mn({resolver:gn(Pse),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"),N=w.watch("openaiCredsId"),{data:T,isLoading:_,refetch:P}=kse({instanceName:m?.name,openaiCredsId:N,token:m?.token,enabled:h&&!!N}),M=()=>{N&&(g(!0),P())},O=()=>{b()};return s.jsx(mr,{...w,children:s.jsxs("form",{onSubmit:w.handleSubmit(t),className:"w-full space-y-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsx(Re,{name:"enabled",label:f("openai.form.enabled.label"),reverse:!0}),s.jsx(le,{name:"description",label:f("openai.form.description.label"),required:!0,children:s.jsx(G,{})}),s.jsx("div",{className:"space-y-2",children:s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsx("div",{className:"flex-1",children:s.jsx(cn,{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}))??[]})}),s.jsx(pO,{onCredentialsUpdate:O,showText:!1})]})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:f("openai.form.openaiSettings.label")}),s.jsx(Qt,{})]}),s.jsx(cn,{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"&&s.jsxs(s.Fragment,{children:[s.jsx(le,{name:"assistantId",label:f("openai.form.assistantId.label"),required:!0,children:s.jsx(G,{})}),s.jsx(le,{name:"functionUrl",label:f("openai.form.functionUrl.label"),required:!0,children:s.jsx(G,{})})]}),C==="chatCompletion"&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"space-y-2",children:s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsx("div",{className:"flex-1",children:s.jsx(cn,{name:"model",label:f("openai.form.model.label"),required:!0,disabled:!T||T.length===0,options:T?.map(D=>({label:D.id,value:D.id}))??[]})}),s.jsx(q,{type:"button",variant:"outline",size:"sm",disabled:!N||_,onClick:M,className:"mb-2",children:_?s.jsxs(s.Fragment,{children:[s.jsx(cc,{className:"mr-2 h-4 w-4 animate-spin"}),f("openai.button.loading")]}):s.jsxs(s.Fragment,{children:[s.jsx(cc,{className:"mr-2 h-4 w-4"}),f("openai.button.loadModels")]})})]})}),s.jsx(le,{name:"systemMessages",label:f("openai.form.systemMessages.label"),children:s.jsx(Ps,{})}),s.jsx(le,{name:"assistantMessages",label:f("openai.form.assistantMessages.label"),children:s.jsx(Ps,{})}),s.jsx(le,{name:"userMessages",label:f("openai.form.userMessages.label"),children:s.jsx(Ps,{})}),s.jsx(le,{name:"maxTokens",label:f("openai.form.maxTokens.label"),children:s.jsx(G,{type:"number"})})]}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:f("openai.form.triggerSettings.label")}),s.jsx(Qt,{})]}),s.jsx(cn,{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"&&s.jsxs(s.Fragment,{children:[s.jsx(cn,{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"}]}),s.jsx(le,{name:"triggerValue",label:f("openai.form.triggerValue.label"),required:!0,children:s.jsx(G,{})})]}),k==="advanced"&&s.jsx(le,{name:"triggerValue",label:f("openai.form.triggerConditions.label"),required:!0,children:s.jsx(G,{})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:f("openai.form.generalSettings.label")}),s.jsx(Qt,{})]}),s.jsx(le,{name:"expire",label:f("openai.form.expire.label"),children:s.jsx(G,{type:"number"})}),s.jsx(le,{name:"keywordFinish",label:f("openai.form.keywordFinish.label"),children:s.jsx(G,{})}),s.jsx(le,{name:"delayMessage",label:f("openai.form.delayMessage.label"),children:s.jsx(G,{type:"number"})}),s.jsx(le,{name:"unknownMessage",label:f("openai.form.unknownMessage.label"),children:s.jsx(G,{})}),s.jsx(Re,{name:"listeningFromMe",label:f("openai.form.listeningFromMe.label"),reverse:!0}),s.jsx(Re,{name:"stopBotFromMe",label:f("openai.form.stopBotFromMe.label"),reverse:!0}),s.jsx(Re,{name:"keepOpen",label:f("openai.form.keepOpen.label"),reverse:!0}),s.jsx(le,{name:"debounceTime",label:f("openai.form.debounceTime.label"),children:s.jsx(G,{type:"number"})}),s.jsx(Re,{name:"splitMessages",label:f("openai.form.splitMessages.label"),reverse:!0}),w.watch("splitMessages")&&s.jsx(le,{name:"timePerChar",label:f("openai.form.timePerChar.label"),children:s.jsx(G,{type:"number"})})]}),a&&s.jsx(Wt,{children:s.jsx(q,{disabled:o,type:"submit",children:f(o?"openai.button.saving":"openai.button.save")})}),!a&&s.jsxs("div",{children:[s.jsx(hO,{openaiId:r}),s.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[s.jsxs(yt,{open:l,onOpenChange:u,children:[s.jsx(sn,{asChild:!0,children:s.jsx(q,{variant:"destructive",size:"sm",children:f("dify.button.delete")})}),s.jsx(ht,{children:s.jsxs(mt,{children:[s.jsx(xt,{children:f("modal.delete.title")}),s.jsx(Er,{children:f("modal.delete.messageSingle")}),s.jsxs(Wt,{children:[s.jsx(q,{size:"sm",variant:"outline",onClick:()=>u(!1),children:f("button.cancel")}),s.jsx(q,{variant:"destructive",onClick:n,children:f("button.delete")})]})]})})]}),s.jsx(q,{disabled:o,type:"submit",children:f(o?"openai.button.saving":"openai.button.update")})]})]})]})})}function Rse({resetTable:e}){const{t}=Le(),{instance:n}=ft(),{createOpenai:r}=Td(),[a,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 m={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:m}),X.success(t("openai.toast.success.create")),u(!1),e()}catch(m){console.error("Error:",m),X.error(`Error: ${m?.response?.data?.response?.message}`)}finally{o(!1)}};return s.jsxs(yt,{open:l,onOpenChange:u,children:[s.jsx(sn,{asChild:!0,children:s.jsxs(q,{size:"sm",children:[s.jsx(Zr,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:t("openai.button.create")})]})}),s.jsxs(ht,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[s.jsx(mt,{children:s.jsx(xt,{children:t("openai.form.title")})}),s.jsx(mO,{onSubmit:d,isModal:!0,isLoading:a,open:l})]})]})}const Ise=e=>["openai","getOpenai",JSON.stringify(e)],Ose=async({instanceName:e,token:t,openaiId:n})=>{const r=await Ce.get(`/openai/fetch/${n}/${e}`,{headers:{apiKey:t}});return Array.isArray(r.data)?r.data[0]:r.data},Ase=e=>{const{instanceName:t,token:n,openaiId:r,...a}=e;return gt({...a,queryKey:Ise({instanceName:t}),queryFn:()=>Ose({instanceName:t,token:n,openaiId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function Dse({openaiId:e,resetTable:t}){const{t:n}=Le(),{instance:r}=ft(),a=Nn(),[o,l]=y.useState(!1),{deleteOpenai:u,updateOpenai:d}=Td(),{data:f,isLoading:m}=Ase({instanceName:r?.name,openaiId:e}),h=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}),X.success(n("openai.toast.success.update")),t(),a(`/manager/instance/${r.id}/openai/${e}`)}else console.error("Token not found")}catch(w){console.error("Error:",w),X.error(`Error: ${w?.response?.data?.response?.message}`)}},x=async()=>{try{r&&r.name&&e?(await u({instanceName:r.name,openaiId:e}),X.success(n("openai.toast.success.delete")),l(!1),t(),a(`/manager/instance/${r.id}/openai`)):console.error("instance not found")}catch(b){console.error("Erro ao excluir dify:",b)}};return m?s.jsx(Hn,{}):s.jsx("div",{className:"m-4",children:s.jsx(mO,{initialData:h,onSubmit:g,openaiId:e,handleDelete:x,isModal:!1,isLoading:m,openDeletionDialog:o,setOpenDeletionDialog:l})})}function jE(){const{t:e}=Le(),t=Xa("(min-width: 768px)"),{instance:n}=ft(),{botId:r}=Is(),{data:a,isLoading:o,refetch:l,error:u}=fO({instanceName:n?.name}),d=Nn(),f=h=>{n&&d(`/manager/instance/${n.id}/openai/${h}`)},m=()=>{l()};return s.jsx("main",{className:"pt-5",children:s.jsxs(oa,{error:u,name:"OpenAI",envVar:"OPENAI_ENABLED",children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[s.jsx("h3",{className:"text-lg font-medium",children:e("openai.title")}),s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsx(hO,{}),s.jsx(Sse,{}),s.jsx(pO,{}),s.jsx(Rse,{resetTable:m})]})]}),s.jsx(Qt,{className:"my-4"}),s.jsxs(ai,{direction:t?"horizontal":"vertical",children:[s.jsx(Nr,{defaultSize:r?35:100,className:"pr-4",children:s.jsx("div",{className:"flex flex-col gap-3",children:o?s.jsx(Hn,{}):s.jsx(s.Fragment,{children:a&&a.length>0&&Array.isArray(a)?a.map(h=>s.jsxs(q,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>f(`${h.id}`),variant:r===h.id?"secondary":"outline",children:[s.jsx("h4",{className:"text-base",children:h.description||h.id}),s.jsx("p",{className:"text-sm font-normal text-muted-foreground",children:h.botType})]},h.id)):s.jsx(q,{variant:"link",children:e("openai.table.none")})})})}),r&&s.jsxs(s.Fragment,{children:[s.jsx(oi,{withHandle:!0,className:"border border-border"}),s.jsx(Nr,{children:s.jsx(Dse,{openaiId:r,resetTable:m})})]})]})]})})}const Fse=e=>{if(!e||e==="")return{enabled:!1,host:"",port:"",protocol:"",username:"",password:""};try{const t=JSON.parse(e);return{enabled:!0,host:t.host??"",port:t.port??"",protocol:"http",username:t.username??"",password:t.password??""}}catch{return{enabled:!1,host:"",port:"",protocol:"",username:"",password:""}}},Lse=e=>["proxy","fetchProxy","go",JSON.stringify(e)],$se=e=>{const t=Wa(),{instanceName:n,token:r,enabled:a,...o}=e;return gt({...o,queryKey:Lse({instanceName:n,token:r}),queryFn:async()=>{let u=t.getQueryData(["instance","fetchInstances","go"])?.find(f=>f.name===n)?.id;if(!u){const f=t.getQueriesData({queryKey:["instance","fetchInstance","go"]});for(const[,m]of f)if(m&&m.name===n){u=m.id;break}}if(!u)throw new Error(`Instance "${n}" not found in cache`);const d=await pn.get(`/instance/info/${u}`);return Fse(d.data?.data?.proxy)},enabled:!!n&&(a??!0),retry:!1})},Bse=e=>["proxy","fetchProxy",JSON.stringify(e)],zse=async({instanceName:e,token:t})=>(await Ce.get(`/proxy/find/${e}`,{headers:{apiKey:t}})).data,Use=e=>{const{instanceName:t,token:n,enabled:r,...a}=e;return gt({...a,queryKey:Bse({instanceName:t,token:n}),queryFn:()=>zse({instanceName:t,token:n}),enabled:!!t&&(r??!0)})},Vse=e=>{const t=Tr(),n=Use({...e,enabled:(e.enabled??!0)&&t==="api"}),r=$se({...e,enabled:(e.enabled??!0)&&t==="go"});return t==="go"?r:n},qse=e=>{const t=r=>e.getQueryData(["instance","fetchInstances","go"])?.find(o=>o.name===r)?.id;return{createProxy:async({instanceName:r,data:a})=>{const o=t(r);if(!o)throw new Error(`Instance "${r}" not found in cache`);if(!(!!a.host&&!!a.port))return(await pn.delete(`/instance/proxy/${o}`)).data;const u={host:a.host,port:a.port,username:a.username??"",password:a.password??""};return(await pn.post(`/instance/proxy/${o}`,u)).data}}},Hse=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/proxy/set/${e}`,n,{headers:{apikey:t}})).data;function Wse(){const e=Wa(),n=Tr()==="go"?qse(e):null;return{createProxy:ot(n?n.createProxy:Hse,{invalidateKeys:[["proxy","fetchProxy"]]})}}const Kse=hn({enabled:Me(),host:he(),port:he(),protocol:he(),username:he(),password:he()});function Gse(){const{t:e}=Le(),{instance:t}=ft(),[n,r]=y.useState(!1),a=Tr()==="go",{createProxy:o}=Wse(),{data:l}=Vse({instanceName:t?.name}),u=mn({resolver:gn(Kse),defaultValues:{enabled:!1,host:"",port:"",protocol:"http",username:"",password:""}});y.useEffect(()=>{l&&u.reset({enabled:l.enabled,host:l.host,port:l.port,protocol:l.protocol,username:l.username,password:l.password})},[l]);const d=async f=>{if(t){r(!0);try{const m={enabled:f.enabled,host:f.host,port:f.port,protocol:f.protocol,username:f.username,password:f.password};await o({instanceName:t.name,token:t.token,data:m}),X.success(e("proxy.toast.success"))}catch(m){console.error(e("proxy.toast.error"),m),X.error(`Error : ${m?.response?.data?.response?.message}`)}finally{r(!1)}}};return s.jsx(s.Fragment,{children:s.jsx(Ya,{...u,children:s.jsx("form",{onSubmit:u.handleSubmit(d),className:"w-full space-y-6",children:s.jsxs("div",{children:[s.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("proxy.title")}),s.jsx(ll,{className:"my-4"}),s.jsxs("div",{className:"mx-4 space-y-2 divide-y [&>*]:p-4",children:[!a&&s.jsx(Re,{name:"enabled",label:e("proxy.form.enabled.label"),className:"w-full justify-between",helper:e("proxy.form.enabled.description")}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-[10rem_1fr_10rem] md:gap-8",children:[s.jsx(le,{name:"protocol",label:e("proxy.form.protocol.label"),children:s.jsx(G,{})}),s.jsx(le,{name:"host",label:e("proxy.form.host.label"),children:s.jsx(G,{})}),s.jsx(le,{name:"port",label:e("proxy.form.port.label"),children:s.jsx(G,{type:"number"})})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 md:gap-8",children:[s.jsx(le,{name:"username",label:e("proxy.form.username.label"),children:s.jsx(G,{})}),s.jsx(le,{name:"password",label:e("proxy.form.password.label"),children:s.jsx(G,{type:"password"})})]}),s.jsx("div",{className:"flex justify-end px-4 pt-6",children:s.jsx(q,{type:"submit",disabled:n,children:e(n?"proxy.button.saving":"proxy.button.save")})})]})]})})})})}const Jse=e=>["rabbitmq","fetchRabbitmq",JSON.stringify(e)],Qse=async({instanceName:e,token:t})=>(await Ce.get(`/rabbitmq/find/${e}`,{headers:{apiKey:t}})).data,Yse=e=>{const{instanceName:t,token:n,...r}=e;return gt({...r,queryKey:Jse({instanceName:t,token:n}),queryFn:()=>Qse({instanceName:t,token:n}),enabled:!!t})},Zse=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/rabbitmq/set/${e}`,{rabbitmq:n},{headers:{apikey:t}})).data;function Xse(){return{createRabbitmq:ot(Zse,{invalidateKeys:[["rabbitmq","fetchRabbitmq"]]})}}const eae=hn({enabled:Me(),events:As(he())});function tae(){const{t:e}=Le(),{instance:t}=ft(),[n,r]=y.useState(!1),{createRabbitmq:a}=Xse(),{data:o,error:l}=Yse({instanceName:t?.name,token:t?.token}),u=mn({resolver:gn(eae),defaultValues:{enabled:!1,events:[]}});y.useEffect(()=>{o&&u.reset({enabled:o.enabled,events:o.events})},[o]);const d=async g=>{if(t){r(!0);try{const x={enabled:g.enabled,events:g.events};await a({instanceName:t.name,token:t.token,data:x}),X.success(e("rabbitmq.toast.success"))}catch(x){console.error(e("rabbitmq.toast.error"),x),X.error(`Error: ${x?.response?.data?.response?.message}`)}finally{r(!1)}}},f=["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"],m=()=>{u.setValue("events",f)},h=()=>{u.setValue("events",[])};return s.jsx(oa,{error:l,name:"RabbitMQ",envVar:"RABBITMQ_ENABLED",children:s.jsx(Ya,{...u,children:s.jsx("form",{onSubmit:u.handleSubmit(d),className:"w-full space-y-6",children:s.jsxs("div",{children:[s.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("rabbitmq.title")}),s.jsx(ll,{className:"my-4"}),s.jsxs("div",{className:"mx-4 space-y-2 divide-y [&>*]:p-4",children:[s.jsx(Re,{name:"enabled",label:e("rabbitmq.form.enabled.label"),className:"w-full justify-between",helper:e("rabbitmq.form.enabled.description")}),s.jsxs("div",{className:"mb-4 flex justify-between",children:[s.jsx(q,{variant:"outline",type:"button",onClick:m,children:e("button.markAll")}),s.jsx(q,{variant:"outline",type:"button",onClick:h,children:e("button.unMarkAll")})]}),s.jsx(Za,{control:u.control,name:"events",render:({field:g})=>s.jsxs(Ca,{className:"flex flex-col",children:[s.jsx(Xr,{className:"my-2 text-lg",children:e("rabbitmq.form.events.label")}),s.jsx(ta,{children:s.jsx("div",{className:"flex flex-col gap-2 space-y-1 divide-y",children:f.sort((x,b)=>x.localeCompare(b)).map(x=>s.jsxs("div",{className:"flex items-center justify-between gap-3 pt-3",children:[s.jsx(Xr,{className:on("break-all",g.value.includes(x)?"text-foreground":"text-muted-foreground"),children:x}),s.jsx(Ed,{checked:g.value.includes(x),onCheckedChange:b=>{b?g.onChange([...g.value,x]):g.onChange(g.value.filter(w=>w!==x))}})]},x))})})]})})]}),s.jsx("div",{className:"mx-4 flex justify-end pt-6",children:s.jsx(q,{type:"submit",disabled:n,children:e(n?"rabbitmq.button.saving":"rabbitmq.button.save")})})]})})})})}const gO=["events","messages","contacts","chats","groups","calls","receipts","reactions"],nae=["image","video","audio","document","sticker"],hp={capture:Object.fromEntries(gO.map(e=>[e,!0])),media:{mode:"all",types:[]},directions:["incoming","outgoing"],retentionDays:null};function rae({instanceName:e}){const[t,n]=y.useState(""),[r,a]=y.useState(),[o,l]=y.useState(hp),[u,d]=y.useState(null),[f,m]=y.useState([]),[h,g]=y.useState(!1),[x,b]=y.useState(""),[w,C]=y.useState(""),[k,N]=y.useState(""),[T,_]=y.useState(""),[P,M]=y.useState(!1),[O,D]=y.useState(null),[F,$]=y.useState(""),[te,z]=y.useState("all"),[ue,V]=y.useState(!0),ne=y.useMemo(()=>({"x-archive-key":t}),[t]),Y=async()=>{if(!t)return X.error("Enter the archive API key first");g(!0);try{const[A,K]=await Promise.all([pn.get("/archive/status",{headers:ne,params:{instanceName:e}}),pn.get("/archive/policies",{headers:ne})]);d(A.data),m(K.data.filter(ee=>ee.enabled&&ee.scope==="jid"&&ee.selector?.instanceName===e));const re=[...K.data].filter(ee=>ee.enabled&&ee.scope==="account"&&ee.selector?.instanceName===e).sort((ee,ie)=>ie.version-ee.version)[0];re&&(a(re.id),l({...hp,...re.policy,capture:{...hp.capture,...re.policy.capture},media:{...hp.media,...re.policy.media}}))}catch(A){X.error(A.response?.data?.response?.message||"Unable to load archive settings")}finally{g(!1)}},se=async()=>{if(!F.trim())return X.error("Enter a group or contact JID");g(!0);try{await pn.put("/archive/policies",{scope:"jid",selector:{instanceName:e,jid:F.trim()},policy:{capture:{messages:ue},media:{mode:te}}},{headers:ne}),$(""),X.success("JID-specific archive rule saved"),await Y()}catch(A){X.error(A.response?.data?.response?.message||"Unable to save JID rule")}finally{g(!1)}},H=async()=>{g(!0);try{const A=await pn.put("/archive/policies",{id:r,scope:"account",selector:{instanceName:e},policy:o},{headers:ne});a(A.data.id),X.success("Archive policy saved. It applies to new events.")}catch(A){X.error(A.response?.data?.response?.message||"Unable to save archive policy")}finally{g(!1)}},W=async()=>{const A={...x?{before:new Date(x).toISOString()}:{},...w.trim()?{groupJid:w.trim()}:{},...k.trim()?{entityJid:k.trim()}:{},...T.trim()?{eventTypes:T.split(",").map(K=>K.trim()).filter(Boolean)}:{},mediaOnly:P};g(!0);try{const K=await pn.post(`/archive/purges/preview/${e}`,A,{headers:ne});D(K.data)}catch(K){X.error(K.response?.data?.response?.message||"Unable to preview purge")}finally{g(!1)}},U=async()=>{if(!(!O||!window.confirm(`Permanently delete ${O.summary.events} events and ${O.summary.media} media objects?`))){g(!0);try{await pn.post("/archive/purges/confirm",{previewId:O.previewId,confirmationToken:O.confirmationToken},{headers:ne}),D(null),X.success("Archive purge completed and a signed tombstone was recorded."),await Y()}catch(A){X.error(A.response?.data?.response?.message||"Unable to confirm purge")}finally{g(!1)}}};return s.jsxs("section",{className:"mt-10 space-y-6",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-medium",children:"WhatsApp archive"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure durable capture, media retention, and irreversible purge for this instance."})]}),s.jsx(Qt,{}),s.jsxs("div",{className:"mx-4 space-y-6",children:[s.jsxs("div",{className:"grid gap-3 md:grid-cols-[1fr_auto]",children:[s.jsxs("div",{children:[s.jsx("label",{className:"text-sm font-medium",children:"Archive API key"}),s.jsx(G,{type:"password",value:t,onChange:A=>n(A.target.value),placeholder:"Required for archive administration"}),s.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Requires a global-admin manager session. Held only in this page's memory; it is not saved in browser storage."})]}),s.jsx(q,{type:"button",className:"self-end",onClick:Y,disabled:h||!t,children:"Load archive"})]}),u&&s.jsxs("div",{className:"rounded border p-3 text-sm",children:["Archive: ",s.jsx("strong",{children:u.enabled?"enabled":"disabled"})," · events: ",u.accounts?.[0]?.events??0," · media: ",u.accounts?.[0]?.media??0," · last sequence:"," ",u.accounts?.[0]?.lastSequence??0]}),s.jsxs("div",{className:"space-y-3",children:[s.jsx("h4",{className:"font-medium",children:"What to keep"}),s.jsx("div",{className:"grid grid-cols-2 gap-2 md:grid-cols-4",children:gO.map(A=>s.jsxs("label",{className:"flex gap-2 text-sm",children:[s.jsx("input",{type:"checkbox",checked:o.capture[A],onChange:K=>l({...o,capture:{...o.capture,[A]:K.target.checked}})}),A]},A))}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[s.jsxs("label",{className:"text-sm",children:["Media mode",s.jsxs("select",{className:"mt-1 w-full rounded border bg-background p-2",value:o.media.mode,onChange:A=>l({...o,media:{...o.media,mode:A.target.value}}),children:[s.jsx("option",{value:"all",children:"Keep all media"}),s.jsx("option",{value:"images",children:"Images only"}),s.jsx("option",{value:"metadata",children:"Metadata only"}),s.jsx("option",{value:"none",children:"No media"})]})]}),s.jsxs("label",{className:"text-sm",children:["Retention target (days; purge stays explicit)",s.jsx(G,{type:"number",min:1,value:o.retentionDays??"",onChange:A=>l({...o,retentionDays:A.target.value?Number(A.target.value):null}),placeholder:"Blank = forever"})]}),s.jsxs("div",{className:"text-sm",children:["Directions",s.jsx("div",{className:"mt-2 flex gap-4",children:["incoming","outgoing"].map(A=>s.jsxs("label",{className:"flex gap-2",children:[s.jsx("input",{type:"checkbox",checked:o.directions.includes(A),onChange:K=>l({...o,directions:K.target.checked?[...o.directions,A]:o.directions.filter(re=>re!==A)})}),A]},A))})]})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-sm",children:"Additional media types"}),s.jsx("div",{className:"mt-2 flex flex-wrap gap-4",children:nae.map(A=>s.jsxs("label",{className:"flex gap-2 text-sm",children:[s.jsx("input",{type:"checkbox",checked:o.media.types.includes(A),onChange:K=>l({...o,media:{...o.media,types:K.target.checked?[...o.media.types,A]:o.media.types.filter(re=>re!==A)}})}),A]},A))})]}),s.jsx(q,{type:"button",onClick:H,disabled:h||!t,children:"Save archive policy"})]}),s.jsxs("div",{className:"space-y-3 rounded border p-4",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium",children:"Group or contact override"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Add a more-specific rule, for example images only for one group or no message history for one chat."})]}),s.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[s.jsxs("label",{className:"text-sm",children:["Group/contact JID",s.jsx(G,{value:F,onChange:A=>$(A.target.value),placeholder:"120363...@g.us"})]}),s.jsxs("label",{className:"text-sm",children:["Media mode",s.jsxs("select",{className:"mt-1 w-full rounded border bg-background p-2",value:te,onChange:A=>z(A.target.value),children:[s.jsx("option",{value:"all",children:"Keep all media"}),s.jsx("option",{value:"images",children:"Images only"}),s.jsx("option",{value:"metadata",children:"Metadata only"}),s.jsx("option",{value:"none",children:"No media"})]})]}),s.jsxs("label",{className:"flex items-center gap-2 self-end pb-2 text-sm",children:[s.jsx("input",{type:"checkbox",checked:ue,onChange:A=>V(A.target.checked)}),"Keep message history"]})]}),s.jsx(q,{type:"button",onClick:se,disabled:h||!t||!F.trim(),children:"Add override"}),f.length>0&&s.jsx("div",{className:"space-y-1 text-xs text-muted-foreground",children:f.map(A=>s.jsxs("div",{children:[A.selector.jid,": messages ",A.policy.capture?.messages===!1?"off":"on",", media ",A.policy.media?.mode??"inherited"," (version ",A.version,")"]},A.id))})]}),s.jsx(Qt,{}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium",children:"Purge archive data"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Preview first. Confirmation permanently removes matching database rows and media objects, then records a signed tombstone."})]}),s.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("label",{className:"text-sm",children:["Delete history before",s.jsx(G,{type:"datetime-local",value:x,onChange:A=>b(A.target.value)})]}),s.jsxs("label",{className:"text-sm",children:["Specific group JID",s.jsx(G,{value:w,onChange:A=>C(A.target.value),placeholder:"120363...@g.us"})]}),s.jsxs("label",{className:"text-sm",children:["Specific chat/contact JID",s.jsx(G,{value:k,onChange:A=>N(A.target.value)})]}),s.jsxs("label",{className:"text-sm",children:["Event types (comma-separated)",s.jsx(Ps,{value:T,onChange:A=>_(A.target.value),placeholder:"messages.upsert, messages.update"})]})]}),s.jsxs("label",{className:"flex gap-2 text-sm",children:[s.jsx("input",{type:"checkbox",checked:P,onChange:A=>M(A.target.checked)}),"Delete matching media only; keep event history"]}),s.jsx(q,{type:"button",onClick:W,disabled:h||!t,children:"Preview purge"}),O&&s.jsxs("div",{className:"rounded border border-destructive p-4",children:[s.jsxs("p",{className:"font-medium",children:["Preview: ",O.summary.events," events and ",O.summary.media," media objects"]}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Expires ",new Date(O.expiresAt).toLocaleString()]}),s.jsx(q,{type:"button",className:"mt-3",onClick:U,disabled:h,children:"Permanently purge this preview"})]})]})]})]})}const sae=e=>["instance","fetchSettings",JSON.stringify(e)],aae=async({instanceName:e,token:t})=>(await Ce.get(`/settings/find/${e}`,{headers:{apikey:t}})).data,oae=e=>{const{instanceName:t,token:n,enabled:r,...a}=e;return gt({...a,queryKey:sae({instanceName:t,token:n}),queryFn:()=>aae({instanceName:t,token:n}),enabled:!!t&&(r??!0)})},iae=e=>{const t=Tr(),n=oae({...e,enabled:(e.enabled??!0)&&t==="api"}),r=WV({...e,enabled:(e.enabled??!0)&&t==="go"});return t==="go"?r:n},lae=hn({rejectCall:Me(),msgCall:he().optional(),groupsIgnore:Me(),alwaysOnline:Me(),readMessages:Me(),syncFullHistory:Me(),readStatus:Me(),localReadTtlSeconds:at.number().int().min(0).max(2592e3),localReadTtlOverrides:he().refine(e=>{try{const t=e.trim()?JSON.parse(e):{};return t&&typeof t=="object"&&!Array.isArray(t)&&Object.values(t).every(n=>Number.isInteger(n)&&Number(n)>=0)}catch{return!1}},"Enter a JSON object whose values are non-negative seconds"),automationEnabled:Me(),typingEnabled:Me(),typingMinMs:at.number().int().min(0).max(2e4),typingMaxMs:at.number().int().min(0).max(2e4),typingCharactersPerSecond:at.number().min(1).max(100),typingJitterPercent:at.number().int().min(0).max(25),typingPresence:fw(["composing","recording"]),typingApplyToMediaCaptions:Me(),instancePerMinute:at.number().int().min(1).max(1e4),instancePerDay:at.number().int().min(1).max(1e6),recipientPerMinute:at.number().int().min(1).max(1e3),recipientPerDay:at.number().int().min(1).max(1e5),minimumIntervalMs:at.number().int().min(0).max(6e5),maxConcurrentSends:at.number().int().min(1).max(100),outreachEnabled:Me(),newOrDormantRecipientsPerDay:at.number().int().min(1).max(1e5),dormantAfterDays:at.number().int().min(1).max(3650),quietHoursEnabled:Me(),quietHoursStart:he().regex(/^([01]\d|2[0-3]):[0-5]\d$/),quietHoursEnd:he().regex(/^([01]\d|2[0-3]):[0-5]\d$/),quietHoursTimeZone:he().min(1).max(100),duplicateEnabled:Me(),duplicateWindowSeconds:at.number().int().min(1).max(86400),duplicateSimilarityThresholdPercent:at.number().int().min(1).max(100),suppressedRecipients:he(),allowlistEnabled:Me(),allowedRecipients:he(),failurePauseEnabled:Me(),failurePauseThreshold:at.number().int().min(1).max(100),failurePauseSeconds:at.number().int().min(1).max(86400),auditRetentionDays:at.number().int().min(1).max(3650)}).refine(e=>e.typingMinMs<=e.typingMaxMs,{path:["typingMaxMs"],message:"Maximum typing time must be at least the minimum"});function cae(){const{t:e}=Le(),[t,n]=y.useState(!1),{instance:r}=ft(),{updateSettings:a}=Nc(),{data:o,isLoading:l}=iae({instanceName:r?.name,token:r?.token}),u=mn({resolver:gn(lae),defaultValues:{rejectCall:!1,msgCall:"",groupsIgnore:!1,alwaysOnline:!1,readMessages:!1,syncFullHistory:!1,readStatus:!1,localReadTtlSeconds:300,localReadTtlOverrides:"{}",automationEnabled:!1,typingEnabled:!0,typingMinMs:500,typingMaxMs:5e3,typingCharactersPerSecond:18,typingJitterPercent:10,typingPresence:"composing",typingApplyToMediaCaptions:!0,instancePerMinute:60,instancePerDay:5e3,recipientPerMinute:10,recipientPerDay:250,minimumIntervalMs:750,maxConcurrentSends:4,outreachEnabled:!0,newOrDormantRecipientsPerDay:50,dormantAfterDays:180,quietHoursEnabled:!1,quietHoursStart:"22:00",quietHoursEnd:"08:00",quietHoursTimeZone:"UTC",duplicateEnabled:!0,duplicateWindowSeconds:30,duplicateSimilarityThresholdPercent:100,suppressedRecipients:"",allowlistEnabled:!1,allowedRecipients:"",failurePauseEnabled:!0,failurePauseThreshold:5,failurePauseSeconds:300,auditRetentionDays:90}});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,localReadTtlSeconds:o.localReadTtlSeconds??300,localReadTtlOverrides:JSON.stringify(o.localReadTtlOverrides??{},null,2),automationEnabled:o.automationSafety?.enabled??!1,typingEnabled:o.automationSafety?.typing?.enabled??!0,typingMinMs:o.automationSafety?.typing?.minMs??500,typingMaxMs:o.automationSafety?.typing?.maxMs??5e3,typingCharactersPerSecond:o.automationSafety?.typing?.charactersPerSecond??18,typingJitterPercent:o.automationSafety?.typing?.jitterPercent??10,typingPresence:o.automationSafety?.typing?.presence??"composing",typingApplyToMediaCaptions:o.automationSafety?.typing?.applyToMediaCaptions??!0,instancePerMinute:o.automationSafety?.rateLimit?.instancePerMinute??60,instancePerDay:o.automationSafety?.rateLimit?.instancePerDay??5e3,recipientPerMinute:o.automationSafety?.rateLimit?.recipientPerMinute??10,recipientPerDay:o.automationSafety?.rateLimit?.recipientPerDay??250,minimumIntervalMs:o.automationSafety?.rateLimit?.minimumIntervalMs??750,maxConcurrentSends:o.automationSafety?.rateLimit?.maxConcurrentSends??4,outreachEnabled:o.automationSafety?.outreach?.enabled??!0,newOrDormantRecipientsPerDay:o.automationSafety?.outreach?.newOrDormantRecipientsPerDay??50,dormantAfterDays:o.automationSafety?.outreach?.dormantAfterDays??180,quietHoursEnabled:o.automationSafety?.quietHours?.enabled??!1,quietHoursStart:o.automationSafety?.quietHours?.start??"22:00",quietHoursEnd:o.automationSafety?.quietHours?.end??"08:00",quietHoursTimeZone:o.automationSafety?.quietHours?.timeZone??"UTC",duplicateEnabled:o.automationSafety?.duplicate?.enabled??!0,duplicateWindowSeconds:o.automationSafety?.duplicate?.windowSeconds??30,duplicateSimilarityThresholdPercent:o.automationSafety?.duplicate?.similarityThresholdPercent??100,suppressedRecipients:(o.automationSafety?.suppression?.recipients??[]).join(` -`),allowlistEnabled:o.automationSafety?.suppression?.allowlistEnabled??!1,allowedRecipients:(o.automationSafety?.suppression?.allowedRecipients??[]).join(` -`),failurePauseEnabled:o.automationSafety?.failurePause?.enabled??!0,failurePauseThreshold:o.automationSafety?.failurePause?.threshold??5,failurePauseSeconds:o.automationSafety?.failurePause?.pauseSeconds??300,auditRetentionDays:o.automationSafety?.audit?.retentionDays??90})},[u,o]);const d=async h=>{try{if(!r||!r.name)throw new Error("instance not found");n(!0);const g={rejectCall:h.rejectCall,msgCall:h.msgCall,groupsIgnore:h.groupsIgnore,alwaysOnline:h.alwaysOnline,readMessages:h.readMessages,syncFullHistory:h.syncFullHistory,readStatus:h.readStatus,localReadTtlSeconds:h.localReadTtlSeconds,localReadTtlOverrides:JSON.parse(h.localReadTtlOverrides||"{}"),automationSafety:{enabled:h.automationEnabled,typing:{enabled:h.typingEnabled,minMs:h.typingMinMs,maxMs:h.typingMaxMs,charactersPerSecond:h.typingCharactersPerSecond,jitterPercent:h.typingJitterPercent,presence:h.typingPresence,applyToMediaCaptions:h.typingApplyToMediaCaptions},rateLimit:{instancePerMinute:h.instancePerMinute,instancePerDay:h.instancePerDay,recipientPerMinute:h.recipientPerMinute,recipientPerDay:h.recipientPerDay,minimumIntervalMs:h.minimumIntervalMs,maxConcurrentSends:h.maxConcurrentSends},outreach:{enabled:h.outreachEnabled,newOrDormantRecipientsPerDay:h.newOrDormantRecipientsPerDay,dormantAfterDays:h.dormantAfterDays},quietHours:{enabled:h.quietHoursEnabled,start:h.quietHoursStart,end:h.quietHoursEnd,timeZone:h.quietHoursTimeZone},duplicate:{enabled:h.duplicateEnabled,windowSeconds:h.duplicateWindowSeconds,similarityThresholdPercent:h.duplicateSimilarityThresholdPercent},suppression:{recipients:h.suppressedRecipients.split(/[\n,]/).map(x=>x.trim()).filter(Boolean),allowlistEnabled:h.allowlistEnabled,allowedRecipients:h.allowedRecipients.split(/[\n,]/).map(x=>x.trim()).filter(Boolean)},failurePause:{enabled:h.failurePauseEnabled,threshold:h.failurePauseThreshold,pauseSeconds:h.failurePauseSeconds},audit:{retentionDays:h.auditRetentionDays}}};await a({instanceName:r.name,token:r.token,data:g}),X.success(e("settings.toast.success"))}catch(g){console.error(e("settings.toast.success"),g),X.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")}],m=u.watch("rejectCall");return l?s.jsx(Hn,{}):s.jsxs(s.Fragment,{children:[s.jsx(Ya,{...u,children:s.jsx("form",{onSubmit:u.handleSubmit(d),className:"w-full space-y-6",children:s.jsxs("div",{children:[s.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("settings.title")}),s.jsx(Qt,{className:"my-4"}),s.jsxs("div",{className:"mx-4 space-y-2 divide-y",children:[s.jsxs("div",{className:"flex flex-col p-4",children:[s.jsx(Re,{name:"rejectCall",label:e("settings.form.rejectCall.label"),className:"w-full justify-between",helper:e("settings.form.rejectCall.description")}),m&&s.jsx("div",{className:"mr-16 mt-2",children:s.jsx(le,{name:"msgCall",children:s.jsx(Ps,{placeholder:e("settings.form.msgCall.description")})})})]}),f.map(h=>s.jsx("div",{className:"flex p-4",children:s.jsx(Re,{name:h.name,label:h.label,className:"w-full justify-between",helper:h.description})},h.name)),s.jsxs("div",{className:"space-y-4 p-4",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium",children:"Local data cache"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Set how long this instance may reuse PostgreSQL snapshots before checking WhatsApp. Empty results automatically retry live."})]}),s.jsx(le,{name:"localReadTtlSeconds",label:"Default TTL (seconds)",children:s.jsx(G,{type:"number",min:0,max:2592e3})}),s.jsx(le,{name:"localReadTtlOverrides",label:"Method TTL overrides (JSON)",children:s.jsx(Ps,{rows:5,placeholder:'{"groupMetadata": 3600, "fetchStatus": 60}'})})]}),s.jsxs("div",{className:"space-y-5 p-4",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium",children:"Automation safety & pacing"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Apply consistent, content-preserving controls to automated sends. These settings do not alter message text or attempt to disguise automation."})]}),s.jsx(Re,{name:"automationEnabled",label:"Enable outbound safety policy",helper:"Applies the limits below to API, n8n, and chatbot sends for this instance."}),s.jsxs("div",{className:"rounded-md border p-4 space-y-4",children:[s.jsx("h5",{className:"font-medium",children:"Typing indicator"}),s.jsx(Re,{name:"typingEnabled",label:"Show a bounded typing indicator",helper:"Duration is based on visible message length with limited anti-burst jitter."}),s.jsx(Re,{name:"typingApplyToMediaCaptions",label:"Include media captions",helper:"Use caption length when calculating the indicator duration."}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:[s.jsx(le,{name:"typingMinMs",label:"Minimum (ms)",children:s.jsx(G,{type:"number",min:0,max:2e4})}),s.jsx(le,{name:"typingMaxMs",label:"Maximum (ms)",children:s.jsx(G,{type:"number",min:0,max:2e4})}),s.jsx(le,{name:"typingCharactersPerSecond",label:"Characters per second",children:s.jsx(G,{type:"number",min:1,max:100,step:"0.5"})}),s.jsx(le,{name:"typingJitterPercent",label:"Bounded jitter (%)",children:s.jsx(G,{type:"number",min:0,max:25})}),s.jsx(cn,{name:"typingPresence",label:"Presence",options:[{value:"composing",label:"Composing"},{value:"recording",label:"Recording"}]})]})]}),s.jsxs("div",{className:"rounded-md border p-4 space-y-4",children:[s.jsx("h5",{className:"font-medium",children:"Rate and concurrency limits"}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:[s.jsx(le,{name:"instancePerMinute",label:"Instance sends / minute",children:s.jsx(G,{type:"number",min:1})}),s.jsx(le,{name:"instancePerDay",label:"Instance sends / day",children:s.jsx(G,{type:"number",min:1})}),s.jsx(le,{name:"recipientPerMinute",label:"Recipient sends / minute",children:s.jsx(G,{type:"number",min:1})}),s.jsx(le,{name:"recipientPerDay",label:"Recipient sends / day",children:s.jsx(G,{type:"number",min:1})}),s.jsx(le,{name:"minimumIntervalMs",label:"Recipient minimum interval (ms)",children:s.jsx(G,{type:"number",min:0})}),s.jsx(le,{name:"maxConcurrentSends",label:"Maximum concurrent sends",children:s.jsx(G,{type:"number",min:1,max:100})})]})]}),s.jsxs("div",{className:"rounded-md border p-4 space-y-4",children:[s.jsxs("div",{children:[s.jsx("h5",{className:"font-medium",children:"New and dormant recipient outreach"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Counts unique direct contacts only. Recent inbound contacts, including anyone who messaged first, do not consume this quota. Groups and broadcasts are excluded."})]}),s.jsx(Re,{name:"outreachEnabled",label:"Limit new or dormant recipients",helper:"A dormant contact is one with no inbound message inside the configured relationship window."}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.jsx(le,{name:"newOrDormantRecipientsPerDay",label:"Unique recipients / rolling 24 hours",children:s.jsx(G,{type:"number",min:1,max:1e5})}),s.jsx(le,{name:"dormantAfterDays",label:"Dormant after days without inbound contact",children:s.jsx(G,{type:"number",min:1,max:3650})})]})]}),s.jsxs("div",{className:"rounded-md border p-4 space-y-4",children:[s.jsx("h5",{className:"font-medium",children:"Quiet hours and suppression"}),s.jsx(Re,{name:"quietHoursEnabled",label:"Enable quiet hours",helper:"Requests during this window are rejected with a retryable policy response; they are never silently queued."}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[s.jsx(le,{name:"quietHoursStart",label:"Start",children:s.jsx(G,{type:"time"})}),s.jsx(le,{name:"quietHoursEnd",label:"End",children:s.jsx(G,{type:"time"})}),s.jsx(le,{name:"quietHoursTimeZone",label:"IANA time zone",children:s.jsx(G,{placeholder:"Europe/Athens"})})]}),s.jsx(le,{name:"suppressedRecipients",label:"Suppressed recipient JIDs or numbers",children:s.jsx(Ps,{rows:4,placeholder:`15551234567@s.whatsapp.net -120363000000000000@g.us`})}),s.jsx(Re,{name:"allowlistEnabled",label:"Require an allowed recipient",helper:"When enabled, automated sends are accepted only for entries in the allowlist below."}),s.jsx(le,{name:"allowedRecipients",label:"Allowed recipient JIDs or numbers",children:s.jsx(Ps,{rows:4,placeholder:`15551234567@s.whatsapp.net -120363000000000000@g.us`})})]}),s.jsxs("div",{className:"rounded-md border p-4 space-y-4",children:[s.jsx("h5",{className:"font-medium",children:"Duplicate and failure protection"}),s.jsx(Re,{name:"duplicateEnabled",label:"Block duplicate or similar text",helper:"Compares text and media captions without changing their contents."}),s.jsx(Re,{name:"failurePauseEnabled",label:"Pause after consecutive failures",helper:"Opens a temporary circuit after the configured number of failed sends."}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[s.jsx(le,{name:"duplicateWindowSeconds",label:"Duplicate window (seconds)",children:s.jsx(G,{type:"number",min:1})}),s.jsx(le,{name:"duplicateSimilarityThresholdPercent",label:"Similarity threshold (%)",children:s.jsx(G,{type:"number",min:1,max:100})}),s.jsx(le,{name:"failurePauseThreshold",label:"Failure threshold",children:s.jsx(G,{type:"number",min:1})}),s.jsx(le,{name:"failurePauseSeconds",label:"Pause duration (seconds)",children:s.jsx(G,{type:"number",min:1})}),s.jsx(le,{name:"auditRetentionDays",label:"Audit retention (days)",children:s.jsx(G,{type:"number",min:1,max:3650})})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"100% blocks exact text only. Lower values also block near-duplicates; 85% is a practical starting point. Every successful message to the same recipient inside the time window is checked—there is no fixed message-count limit."})]})]}),s.jsx("div",{className:"flex justify-end pt-6",children:s.jsx(q,{type:"submit",disabled:t,children:e(t?"settings.button.saving":"settings.button.save")})})]})]})})}),r?.name&&s.jsx(rae,{instanceName:r.name})]})}const uae=e=>["sqs","fetchSqs",JSON.stringify(e)],dae=async({instanceName:e,token:t})=>(await Ce.get(`/sqs/find/${e}`,{headers:{apiKey:t}})).data,fae=e=>{const{instanceName:t,token:n,...r}=e;return gt({...r,queryKey:uae({instanceName:t,token:n}),queryFn:()=>dae({instanceName:t,token:n}),enabled:!!t})},pae=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/sqs/set/${e}`,{sqs:n},{headers:{apikey:t}})).data;function hae(){return{createSqs:ot(pae,{invalidateKeys:[["sqs","fetchSqs"]]})}}const mae=hn({enabled:Me(),events:As(he())});function gae(){const{t:e}=Le(),{instance:t}=ft(),[n,r]=y.useState(!1),{createSqs:a}=hae(),{data:o,error:l}=fae({instanceName:t?.name,token:t?.token}),u=mn({resolver:gn(mae),defaultValues:{enabled:!1,events:[]}});y.useEffect(()=>{o&&u.reset({enabled:o.enabled,events:o.events})},[o]);const d=async g=>{if(t){r(!0);try{const x={enabled:g.enabled,events:g.events};await a({instanceName:t.name,token:t.token,data:x}),X.success(e("sqs.toast.success"))}catch(x){console.error(e("sqs.toast.error"),x),X.error(`Error: ${x?.response?.data?.response?.message}`)}finally{r(!1)}}},f=["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"],m=()=>{u.setValue("events",f)},h=()=>{u.setValue("events",[])};return s.jsx(oa,{error:l,name:"SQS",envVar:"SQS_ENABLED",children:s.jsx(Ya,{...u,children:s.jsx("form",{onSubmit:u.handleSubmit(d),className:"w-full space-y-6",children:s.jsxs("div",{children:[s.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("sqs.title")}),s.jsx(ll,{className:"my-4"}),s.jsxs("div",{className:"mx-4 space-y-2 divide-y [&>*]:p-4",children:[s.jsx(Re,{name:"enabled",label:e("sqs.form.enabled.label"),className:"w-full justify-between",helper:e("sqs.form.enabled.description")}),s.jsxs("div",{className:"mb-4 flex justify-between",children:[s.jsx(q,{variant:"outline",type:"button",onClick:m,children:e("button.markAll")}),s.jsx(q,{variant:"outline",type:"button",onClick:h,children:e("button.unMarkAll")})]}),s.jsx(Za,{control:u.control,name:"events",render:({field:g})=>s.jsxs(Ca,{className:"flex flex-col",children:[s.jsx(Xr,{className:"my-2 text-lg",children:e("sqs.form.events.label")}),s.jsx(ta,{children:s.jsx("div",{className:"flex flex-col gap-2 space-y-1 divide-y",children:f.sort((x,b)=>x.localeCompare(b)).map(x=>s.jsxs("div",{className:"flex items-center justify-between gap-3 pt-3",children:[s.jsx(Xr,{className:on("break-all",g.value.includes(x)?"text-foreground":"text-muted-foreground"),children:x}),s.jsx(Ed,{checked:g.value.includes(x),onCheckedChange:b=>{b?g.onChange([...g.value,x]):g.onChange(g.value.filter(w=>w!==x))}})]},x))})})]})})]}),s.jsx("div",{className:"mx-4 flex justify-end pt-6",children:s.jsx(q,{type:"submit",disabled:n,children:e(n?"sqs.button.saving":"sqs.button.save")})})]})})})})}const vae=e=>["typebot","findTypebot",JSON.stringify(e)],yae=async({instanceName:e,token:t})=>(await Ce.get(`/typebot/find/${e}`,{headers:{apiKey:t}})).data,vO=e=>{const{instanceName:t,token:n,...r}=e;return gt({...r,queryKey:vae({instanceName:t}),queryFn:()=>yae({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},bae=e=>["typebot","fetchDefaultSettings",JSON.stringify(e)],xae=async({instanceName:e,token:t})=>{const n=await Ce.get(`/typebot/fetchSettings/${e}`,{headers:{apiKey:t}});return Array.isArray(n.data)?n.data[0]:n.data},wae=e=>{const{instanceName:t,token:n,...r}=e;return gt({...r,queryKey:bae({instanceName:t}),queryFn:()=>xae({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},Sae=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/typebot/create/${e}`,n,{headers:{apikey:t}})).data,Cae=async({instanceName:e,token:t,typebotId:n,data:r})=>(await Ce.put(`/typebot/update/${n}/${e}`,r,{headers:{apikey:t}})).data,jae=async({instanceName:e,typebotId:t})=>(await Ce.delete(`/typebot/delete/${t}/${e}`)).data,kae=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/typebot/settings/${e}`,n,{headers:{apikey:t}})).data,Eae=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await Ce.post(`/typebot/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function Im(){const e=ot(kae,{invalidateKeys:[["typebot","fetchDefaultSettings"]]}),t=ot(Eae,{invalidateKeys:[["typebot","getTypebot"],["typebot","fetchSessions"]]}),n=ot(jae,{invalidateKeys:[["typebot","getTypebot"],["typebot","findTypebot"],["typebot","fetchSessions"]]}),r=ot(Cae,{invalidateKeys:[["typebot","getTypebot"],["typebot","findTypebot"],["typebot","fetchSessions"]]}),a=ot(Sae,{invalidateKeys:[["typebot","findTypebot"]]});return{setDefaultSettingsTypebot:e,changeStatusTypebot:t,deleteTypebot:n,updateTypebot:r,createTypebot:a}}const Nae=hn({expire:at.number(),keywordFinish:he(),delayMessage:at.number(),unknownMessage:he(),listeningFromMe:Me(),stopBotFromMe:Me(),keepOpen:Me(),debounceTime:at.number()});function Tae(){const{t:e}=Le(),{instance:t}=ft(),[n,r]=y.useState(!1),{setDefaultSettingsTypebot:a}=Im(),{data:o,refetch:l}=wae({instanceName:t?.name,token:t?.token,enabled:n}),{data:u,refetch:d}=vO({instanceName:t?.name,token:t?.token,enabled:n}),f=mn({resolver:gn(Nae),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 m=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 a({instanceName:t.name,token:t.token,data:x}),X.success(e("typebot.toast.defaultSettings.success"))}catch(x){console.error(e("typebot.toast.defaultSettings.error"),x),X.error(`Error: ${x?.response?.data?.response?.message}`)}};function h(){l(),d()}return s.jsxs(yt,{open:n,onOpenChange:r,children:[s.jsx(sn,{asChild:!0,children:s.jsxs(q,{variant:"secondary",size:"sm",children:[s.jsx(Qo,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:e("typebot.button.defaultSettings")})]})}),s.jsxs(ht,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:h,children:[s.jsx(mt,{children:s.jsx(xt,{children:e("typebot.modal.defaultSettings.title")})}),s.jsx(mr,{...f,children:s.jsxs("form",{className:"w-full space-y-6",onSubmit:f.handleSubmit(m),children:[s.jsx("div",{children:s.jsxs("div",{className:"space-y-4",children:[s.jsx(cn,{name:"typebotIdFallback",label:e("typebot.form.typebotIdFallback.label"),options:u?.filter(g=>!!g.id).map(g=>({label:g.typebot,value:g.description}))??[]}),s.jsx(le,{name:"expire",label:e("typebot.form.expire.label"),children:s.jsx(G,{type:"number"})}),s.jsx(le,{name:"keywordFinish",label:e("typebot.form.keywordFinish.label"),children:s.jsx(G,{})}),s.jsx(le,{name:"delayMessage",label:e("typebot.form.delayMessage.label"),children:s.jsx(G,{type:"number"})}),s.jsx(le,{name:"unknownMessage",label:e("typebot.form.unknownMessage.label"),children:s.jsx(G,{})}),s.jsx(Re,{name:"listeningFromMe",label:e("typebot.form.listeningFromMe.label"),reverse:!0}),s.jsx(Re,{name:"stopBotFromMe",label:e("typebot.form.stopBotFromMe.label"),reverse:!0}),s.jsx(Re,{name:"keepOpen",label:e("typebot.form.keepOpen.label"),reverse:!0}),s.jsx(le,{name:"debounceTime",label:e("typebot.form.debounceTime.label"),children:s.jsx(G,{type:"number"})}),s.jsx(ri,{name:"ignoreJids",label:e("typebot.form.ignoreJids.label"),placeholder:e("typebot.form.ignoreJids.placeholder")})]})}),s.jsx(Wt,{children:s.jsx(q,{type:"submit",children:e("typebot.button.save")})})]})})]})]})}const Mae=e=>["typebot","fetchSessions",JSON.stringify(e)],_ae=async({instanceName:e,typebotId:t,token:n})=>(await Ce.get(`/typebot/fetchSessions/${t}/${e}`,{headers:{apiKey:n}})).data,Pae=e=>{const{instanceName:t,token:n,typebotId:r,...a}=e;return gt({...a,queryKey:Mae({instanceName:t}),queryFn:()=>_ae({instanceName:t,token:n,typebotId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})},mp={name:"",number:"",status:"all",time:"all",customCondition:"more",customValue:"",customUnit:"minutes"};function Rae(e,t){const n=parseInt(e);return!n||isNaN(n)||n<=0?null:t==="hours"?n*60:t==="days"?n*1440:n}function Iae(e,t){if(t.time==="all")return!0;const n=(Date.now()-new Date(e).getTime())/6e4;if(t.time==="custom"){const r=Rae(t.customValue,t.customUnit);return r===null?!0:t.customCondition==="more"?n>r:n<=r}if(t.time.startsWith(">")){const r=parseInt(t.time.slice(1));return n>r}return n<=parseInt(t.time)}function yO({typebotId:e}){const{t}=Le(),{instance:n}=ft(),{changeStatusTypebot:r}=Im(),[a,o]=y.useState(!1),[l,u]=y.useState([]),[d,f]=y.useState({}),[m,h]=y.useState(mp),[g,x]=y.useState(mp),[b,w]=y.useState(9),[C,k]=y.useState(9),[N,T]=y.useState("opened"),[_,P]=y.useState(!1),[M,O]=y.useState(""),[D,F]=y.useState(""),[$,te]=y.useState(!1),{data:z,refetch:ue}=Pae({instanceName:n?.name,typebotId:e,enabled:a}),V=y.useMemo(()=>{const j=z??[],I=g.name.trim().toLowerCase(),me=g.number.trim();return j.filter(xe=>!(I&&!xe.pushName?.toLowerCase().includes(I)||me&&!xe.remoteJid.includes(me)||g.status!=="all"&&xe.status!==g.status||!Iae(xe.updatedAt,g)))},[z,g]),ne=V.slice(0,C),Y=y.useMemo(()=>Object.keys(d).filter(j=>d[j]).map(j=>ne[Number(j)]?.remoteJid).filter(Boolean),[d,ne]);y.useEffect(()=>{k(b),f({})},[g,b]);const se=()=>{ue()},H=()=>{x(m)},W=()=>{h(mp),x(mp)},U=async(j,I)=>{try{if(!n)return;await r({instanceName:n.name,token:n.token,remoteJid:j,status:I}),X.success(t("typebot.toast.success.status")),se()}catch(me){console.error("Error:",me),X.error(`Error : ${me?.response?.data?.response?.message}`)}},A=async()=>{if(Y.length===0){X.error(t("sessions.mass.noneSelected"));return}try{if(!n)return;await Promise.all(Y.map(j=>r({instanceName:n.name,token:n.token,remoteJid:j,status:N}))),X.success(t("sessions.mass.success")),f({}),se()}catch(j){console.error(j),X.error(j?.response?.data?.response?.message??t("sessions.mass.error"))}},K=j=>{O(j),F(""),P(!0)},re=async()=>{if(!D.trim()){X.error(t("sessions.send.empty"));return}try{if(!n)return;te(!0),await Ce.post(`/message/sendText/${n.name}`,{number:M,text:D},{headers:{apikey:n.token}}),X.success(t("sessions.send.success")),P(!1),F(""),O("")}catch(j){console.error("Error:",j),X.error(j?.response?.data?.response?.message??j?.message??t("sessions.send.error"))}finally{te(!1)}},ee=[{id:"select",header:({table:j})=>s.jsx(es,{checked:j.getIsAllPageRowsSelected()||j.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:I=>j.toggleAllPageRowsSelected(!!I),"aria-label":t("sessions.mass.selectAll")}),cell:({row:j})=>s.jsx(es,{checked:j.getIsSelected(),onCheckedChange:I=>j.toggleSelected(!!I),"aria-label":t("sessions.mass.selectAll")}),enableSorting:!1},{accessorKey:"remoteJid",header:()=>s.jsx("div",{className:"text-center",children:t("typebot.sessions.table.remoteJid")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>s.jsx("div",{className:"text-center",children:t("typebot.sessions.table.pushName")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("pushName")})},{accessorKey:"sessionId",header:()=>s.jsx("div",{className:"text-center",children:t("typebot.sessions.table.sessionId")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("sessionId")})},{accessorKey:"status",header:()=>s.jsx("div",{className:"text-center",children:t("typebot.sessions.table.status")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:j})=>{const I=j.original;return s.jsxs(gs,{children:[s.jsx(vs,{asChild:!0,children:s.jsxs(q,{variant:"ghost",size:"icon",children:[s.jsx("span",{className:"sr-only",children:t("typebot.sessions.table.actions.title")}),s.jsx(Yo,{className:"h-4 w-4"})]})}),s.jsxs(ys,{align:"end",children:[s.jsx(Zo,{children:t("typebot.sessions.table.actions.title")}),s.jsx(Xo,{}),I.status!=="opened"&&s.jsxs(Ct,{onClick:()=>U(I.remoteJid,"opened"),children:[s.jsx(sl,{className:"mr-2 h-4 w-4"}),t("typebot.sessions.table.actions.open")]}),I.status!=="paused"&&I.status!=="closed"&&s.jsxs(Ct,{onClick:()=>U(I.remoteJid,"paused"),children:[s.jsx(rl,{className:"mr-2 h-4 w-4"}),t("typebot.sessions.table.actions.pause")]}),I.status!=="closed"&&s.jsxs(Ct,{onClick:()=>U(I.remoteJid,"closed"),children:[s.jsx(Xi,{className:"mr-2 h-4 w-4"}),t("typebot.sessions.table.actions.close")]}),s.jsxs(Ct,{onClick:()=>K(I.remoteJid),children:[s.jsx(nl,{className:"mr-2 h-4 w-4"}),t("sessions.actions.sendMessage")]}),s.jsxs(Ct,{onClick:()=>U(I.remoteJid,"delete"),children:[s.jsx(el,{className:"mr-2 h-4 w-4"}),t("typebot.sessions.table.actions.delete")]})]})]})}}],ie=["all","5","10","15","20","30","60",">60",">120",">300",">1440","custom"],de=["all","opened","paused","closed"];return s.jsxs(yt,{open:a,onOpenChange:o,children:[s.jsx(sn,{asChild:!0,children:s.jsxs(q,{variant:"secondary",size:"sm",children:[s.jsx(tl,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden md:inline",children:t("typebot.sessions.label")})]})}),s.jsxs(ht,{className:"max-w-7xl h-[85vh] flex flex-col overflow-hidden",children:[s.jsx(mt,{children:s.jsx(xt,{children:t("typebot.sessions.label")})}),s.jsxs("div",{className:"flex-1 space-y-4 overflow-y-auto pr-2",children:[s.jsxs(Un,{children:[s.jsx(Yn,{children:s.jsx(Zn,{className:"text-base",children:t("sessions.filters.title")})}),s.jsxs(Vn,{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.name")}),s.jsx(G,{placeholder:t("sessions.filters.namePlaceholder"),value:m.name,onChange:j=>h(I=>({...I,name:j.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.number")}),s.jsx(G,{placeholder:t("sessions.filters.numberPlaceholder"),value:m.number,onChange:j=>h(I=>({...I,number:j.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.status")}),s.jsxs(_t,{value:m.status,onValueChange:j=>h(I=>({...I,status:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsx(It,{children:de.map(j=>s.jsx(we,{value:j,children:t(`sessions.filters.statusOptions.${j}`)},j))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.time")}),s.jsxs(_t,{value:m.time,onValueChange:j=>h(I=>({...I,time:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsx(It,{children:ie.map(j=>s.jsx(we,{value:j,children:t(`sessions.filters.timeOptions.${j}`)},j))})]})]})]}),m.time==="custom"&&s.jsxs("div",{className:"grid grid-cols-1 gap-2 md:grid-cols-3",children:[s.jsxs(_t,{value:m.customCondition,onValueChange:j=>h(I=>({...I,customCondition:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"more",children:t("sessions.filters.custom.more")}),s.jsx(we,{value:"less",children:t("sessions.filters.custom.less")})]})]}),s.jsx(G,{type:"number",min:1,placeholder:t("sessions.filters.custom.valuePlaceholder"),value:m.customValue,onChange:j=>h(I=>({...I,customValue:j.target.value}))}),s.jsxs(_t,{value:m.customUnit,onValueChange:j=>h(I=>({...I,customUnit:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"minutes",children:t("sessions.filters.custom.minutes")}),s.jsx(we,{value:"hours",children:t("sessions.filters.custom.hours")}),s.jsx(we,{value:"days",children:t("sessions.filters.custom.days")})]})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(q,{onClick:H,size:"sm",children:t("sessions.filters.apply")}),s.jsx(q,{onClick:W,size:"sm",variant:"outline",children:t("sessions.filters.clear")}),s.jsxs(q,{onClick:se,size:"sm",variant:"outline",children:[s.jsx(al,{size:14,className:"mr-1"}),t("button.refresh")]})]})]})]}),Y.length>0&&s.jsxs(Un,{children:[s.jsx(Yn,{children:s.jsx(Zn,{className:"text-base",children:t("sessions.mass.title")})}),s.jsx(Vn,{children:s.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:t("sessions.mass.selected",{count:Y.length})}),s.jsxs("div",{className:"flex-1 min-w-[180px] space-y-1",children:[s.jsx(Ve,{children:t("sessions.mass.newStatus")}),s.jsxs(_t,{value:N,onValueChange:T,children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"opened",children:t("typebot.sessions.table.actions.open")}),s.jsx(we,{value:"paused",children:t("typebot.sessions.table.actions.pause")}),s.jsx(we,{value:"closed",children:t("typebot.sessions.table.actions.close")}),s.jsx(we,{value:"delete",children:t("typebot.sessions.table.actions.delete")})]})]})]}),s.jsx(q,{onClick:A,size:"sm",children:t("sessions.mass.apply")})]})})]}),s.jsx(ii,{columns:ee,data:ne,onSortingChange:u,state:{sorting:l,rowSelection:d},onRowSelectionChange:f,enableRowSelection:!0,getRowId:(j,I)=>String(I),noResultsMessage:t("sessions.empty")}),s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 px-1 text-sm text-muted-foreground",children:[s.jsx("span",{children:t("sessions.pagination.showing",{shown:ne.length,total:V.length})}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(Ve,{htmlFor:"per-page",className:"text-xs",children:t("sessions.pagination.perPage")}),s.jsxs(_t,{value:String(b),onValueChange:j=>w(parseInt(j)),children:[s.jsx(Rt,{id:"per-page",className:"h-8 w-20",children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"9",children:"9"}),s.jsx(we,{value:"25",children:"25"}),s.jsx(we,{value:"50",children:"50"}),s.jsx(we,{value:"100",children:"100"})]})]}),Ck(j=>Math.min(j+b,V.length)),children:t("sessions.pagination.showMore")}),Ck(V.length),children:t("sessions.pagination.showAll")}),C>b&&s.jsx(q,{size:"sm",variant:"outline",onClick:()=>k(b),children:t("sessions.pagination.showLess")})]})]})]}),s.jsx(yt,{open:_,onOpenChange:j=>!$&&P(j),children:s.jsxs(ht,{className:"sm:max-w-md",children:[s.jsx(mt,{children:s.jsx(xt,{children:t("sessions.send.title")})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{children:t("sessions.send.to")}),s.jsx(G,{value:M,disabled:!0})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{children:t("sessions.send.messagePlaceholder")}),s.jsx(ei,{rows:4,placeholder:t("sessions.send.messagePlaceholder"),value:D,onChange:j=>F(j.target.value)})]})]}),s.jsxs(Wt,{children:[s.jsx(q,{variant:"outline",onClick:()=>P(!1),disabled:$,children:t("button.cancel")}),s.jsx(q,{onClick:re,disabled:$,children:t($?"sessions.send.sending":"sessions.send.send")})]})]})})]})]})}const Oae=hn({enabled:Me(),description:he(),url:he(),typebot:he().optional(),triggerType:he(),triggerOperator:he().optional(),triggerValue:he().optional(),expire:at.number().optional(),keywordFinish:he().optional(),delayMessage:at.number().optional(),unknownMessage:he().optional(),listeningFromMe:Me().optional(),stopBotFromMe:Me().optional(),keepOpen:Me().optional(),debounceTime:at.number().optional()});function bO({initialData:e,onSubmit:t,handleDelete:n,typebotId:r,isModal:a=!1,isLoading:o=!1,openDeletionDialog:l=!1,setOpenDeletionDialog:u=()=>{}}){const{t:d}=Le(),f=mn({resolver:gn(Oae),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}}),m=f.watch("triggerType");return s.jsx(mr,{...f,children:s.jsxs("form",{onSubmit:f.handleSubmit(t),className:"w-full space-y-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsx(Re,{name:"enabled",label:d("typebot.form.enabled.label"),reverse:!0}),s.jsx(le,{name:"description",label:d("typebot.form.description.label"),required:!0,children:s.jsx(G,{})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("typebot.form.typebotSettings.label")}),s.jsx(Qt,{})]}),s.jsx(le,{name:"url",label:d("typebot.form.url.label"),required:!0,children:s.jsx(G,{})}),s.jsx(le,{name:"typebot",label:d("typebot.form.typebot.label"),children:s.jsx(G,{})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("typebot.form.triggerSettings.label")}),s.jsx(Qt,{})]}),s.jsx(cn,{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"}]}),m==="keyword"&&s.jsxs(s.Fragment,{children:[s.jsx(cn,{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"}]}),s.jsx(le,{name:"triggerValue",label:d("typebot.form.triggerValue.label"),children:s.jsx(G,{})})]}),m==="advanced"&&s.jsx(le,{name:"triggerValue",label:d("typebot.form.triggerConditions.label"),children:s.jsx(G,{})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("typebot.form.generalSettings.label")}),s.jsx(Qt,{})]}),s.jsx(le,{name:"expire",label:d("typebot.form.expire.label"),children:s.jsx(G,{type:"number"})}),s.jsx(le,{name:"keywordFinish",label:d("typebot.form.keywordFinish.label"),children:s.jsx(G,{})}),s.jsx(le,{name:"delayMessage",label:d("typebot.form.delayMessage.label"),children:s.jsx(G,{type:"number"})}),s.jsx(le,{name:"unknownMessage",label:d("typebot.form.unknownMessage.label"),children:s.jsx(G,{})}),s.jsx(Re,{name:"listeningFromMe",label:d("typebot.form.listeningFromMe.label"),reverse:!0}),s.jsx(Re,{name:"stopBotFromMe",label:d("typebot.form.stopBotFromMe.label"),reverse:!0}),s.jsx(Re,{name:"keepOpen",label:d("typebot.form.keepOpen.label"),reverse:!0}),s.jsx(le,{name:"debounceTime",label:d("typebot.form.debounceTime.label"),children:s.jsx(G,{type:"number"})})]}),a&&s.jsx(Wt,{children:s.jsx(q,{disabled:o,type:"submit",children:d(o?"typebot.button.saving":"typebot.button.save")})}),!a&&s.jsxs("div",{children:[s.jsx(yO,{typebotId:r}),s.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[s.jsxs(yt,{open:l,onOpenChange:u,children:[s.jsx(sn,{asChild:!0,children:s.jsx(q,{variant:"destructive",size:"sm",children:d("dify.button.delete")})}),s.jsx(ht,{children:s.jsxs(mt,{children:[s.jsx(xt,{children:d("modal.delete.title")}),s.jsx(Er,{children:d("modal.delete.messageSingle")}),s.jsxs(Wt,{children:[s.jsx(q,{size:"sm",variant:"outline",onClick:()=>u(!1),children:d("button.cancel")}),s.jsx(q,{variant:"destructive",onClick:n,children:d("button.delete")})]})]})})]}),s.jsx(q,{disabled:o,type:"submit",children:d(o?"typebot.button.saving":"typebot.button.update")})]})]})]})})}function Aae({resetTable:e}){const{t}=Le(),{instance:n}=ft(),{createTypebot:r}=Im(),[a,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 m={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:m}),X.success(t("typebot.toast.success.create")),u(!1),e()}catch(m){console.error("Error:",m),X.error(`Error: ${m?.response?.data?.response?.message}`)}finally{o(!1)}};return s.jsxs(yt,{open:l,onOpenChange:u,children:[s.jsx(sn,{asChild:!0,children:s.jsxs(q,{size:"sm",children:[s.jsx(Zr,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:t("typebot.button.create")})]})}),s.jsxs(ht,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[s.jsx(mt,{children:s.jsx(xt,{children:t("typebot.form.title")})}),s.jsx(bO,{onSubmit:d,isModal:!0,isLoading:a})]})]})}const Dae=e=>["typebot","getTypebot",JSON.stringify(e)],Fae=async({instanceName:e,token:t,typebotId:n})=>{const r=await Ce.get(`/typebot/fetch/${n}/${e}`,{headers:{apiKey:t}});return Array.isArray(r.data)?r.data[0]:r.data},Lae=e=>{const{instanceName:t,token:n,typebotId:r,...a}=e;return gt({...a,queryKey:Dae({instanceName:t}),queryFn:()=>Fae({instanceName:t,token:n,typebotId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function $ae({typebotId:e,resetTable:t}){const{t:n}=Le(),{instance:r}=ft(),a=Nn(),[o,l]=y.useState(!1),{deleteTypebot:u,updateTypebot:d}=Im(),{data:f,isLoading:m}=Lae({instanceName:r?.name,typebotId:e}),h=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}),X.success(n("typebot.toast.success.update")),t(),a(`/manager/instance/${r.id}/typebot/${e}`)}else console.error("Token not found")}catch(w){console.error("Error:",w),X.error(`Error: ${w?.response?.data?.response?.message}`)}},x=async()=>{try{r&&r.name&&e?(await u({instanceName:r.name,typebotId:e}),X.success(n("typebot.toast.success.delete")),l(!1),t(),a(`/manager/instance/${r.id}/typebot`)):console.error("instance not found")}catch(b){console.error("Erro ao excluir dify:",b)}};return m?s.jsx(Hn,{}):s.jsx("div",{className:"m-4",children:s.jsx(bO,{initialData:h,onSubmit:g,typebotId:e,handleDelete:x,isModal:!1,isLoading:m,openDeletionDialog:o,setOpenDeletionDialog:l})})}function kE(){const{t:e}=Le(),t=Xa("(min-width: 768px)"),{instance:n}=ft(),{typebotId:r}=Is(),{data:a,isLoading:o,refetch:l,error:u}=vO({instanceName:n?.name,token:n?.token}),d=Nn(),f=h=>{n&&d(`/manager/instance/${n.id}/typebot/${h}`)},m=()=>{l()};return s.jsx("main",{className:"pt-5",children:s.jsxs(oa,{error:u,name:"Typebot",envVar:"TYPEBOT_ENABLED",children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[s.jsx("h3",{className:"text-lg font-medium",children:e("typebot.title")}),s.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[s.jsx(yO,{}),s.jsx(Tae,{}),s.jsx(Aae,{resetTable:m})]})]}),s.jsx(Qt,{className:"my-4"}),s.jsxs(ai,{direction:t?"horizontal":"vertical",children:[s.jsx(Nr,{defaultSize:r?35:100,className:"pr-4",children:s.jsx("div",{className:"flex flex-col gap-3",children:o?s.jsx(Hn,{}):s.jsx(s.Fragment,{children:a&&a.length>0&&Array.isArray(a)?a.map(h=>s.jsx(q,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>f(`${h.id}`),variant:r===h.id?"secondary":"outline",children:h.description?s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"text-base",children:h.description}),s.jsxs("p",{className:"text-wrap text-sm font-normal text-muted-foreground",children:[h.url," - ",h.typebot]})]}):s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"text-base",children:h.url}),s.jsx("p",{className:"text-wrap text-sm font-normal text-muted-foreground",children:h.typebot})]})},h.id)):s.jsx(q,{variant:"link",children:e("typebot.table.none")})})})}),r&&s.jsxs(s.Fragment,{children:[s.jsx(oi,{withHandle:!0,className:"border border-black"}),s.jsx(Nr,{children:s.jsx($ae,{typebotId:r,resetTable:m})})]})]})]})})}const Bae=e=>["webhook","fetchWebhook","go",JSON.stringify(e)],zae=(e,t)=>{const r=e.getQueryData(["instance","fetchInstances","go"])?.find(o=>o.name===t);if(r)return r.id;const a=e.getQueriesData({queryKey:["instance","fetchInstance","go"]});for(const[,o]of a)if(o?.name===t)return o.id},Uae=e=>{const t=Wa(),{instanceName:n,token:r,enabled:a,...o}=e;return gt({...o,queryKey:Bae({instanceName:n,token:r}),queryFn:async()=>{const l=zae(t,n);if(!l)throw new Error(`Instance "${n}" not found in cache`);const d=(await pn.get(`/instance/info/${l}`)).data?.data,f=d?.webhook??"",m=d?.events??"",h=m?m.split(",").map(g=>g.trim()).filter(Boolean):[];return{enabled:!!f,url:f,events:h,webhookBase64:!1,webhookByEvents:!1}},enabled:!!n&&(a??!0),retry:!1})},Vae=e=>["webhook","fetchWebhook",JSON.stringify(e)],qae=async({instanceName:e,token:t})=>(await Ce.get(`/webhook/find/${e}`,{headers:{apiKey:t}})).data,Hae=async({instanceName:e,token:t})=>(await Ce.get(`/webhook/find-all/${e}`,{headers:{apiKey:t}})).data,Wae=e=>{const{instanceName:t,token:n,enabled:r,...a}=e;return gt({...a,queryKey:Vae({instanceName:t,token:n}),queryFn:()=>qae({instanceName:t,token:n}),enabled:!!t&&(r??!0)})},Kae=e=>{const t=Tr(),n=Wae({...e,enabled:(e.enabled??!0)&&t==="api"}),r=Uae({...e,enabled:(e.enabled??!0)&&t==="go"});return t==="go"?r:n},Gae=e=>{const{instanceName:t,token:n,enabled:r,...a}=e;return gt({...a,queryKey:["webhook","fetchWebhooks",JSON.stringify({instanceName:t,token:n})],queryFn:()=>Hae({instanceName:t,token:n}),enabled:!!t&&(r??!0)&&Tr()==="api"})},Jae=e=>{const t=r=>{const o=e.getQueryData(["instance","fetchInstances","go"])?.find(u=>u.name===r);if(o)return o;const l=e.getQueriesData({queryKey:["instance","fetchInstance","go"]});for(const[,u]of l)if(u?.name===r)return u};return{createWebhook:async({instanceName:r,data:a})=>{const o=t(r);if(!o)throw new Error(`Instance "${r}" not found in cache`);const l={webhookUrl:a.url??"",subscribe:a.events??[],rabbitmqEnable:"",websocketEnable:"",natsEnable:""};return(await pn.post("/instance/connect",l,{headers:{apikey:o.token}})).data}}},Qae=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/webhook/set/${e}`,{webhook:n},{headers:{apikey:t}})).data,Yae=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/webhook/set-many/${e}`,{webhooks:n},{headers:{apikey:t}})).data;function Zae(){const e=Wa(),n=Tr()==="go"?Jae(e):null,r=ot(n?n.createWebhook:Qae,{invalidateKeys:[["webhook","fetchWebhook"],["webhook","fetchWebhooks"]]}),a=ot(Yae,{invalidateKeys:[["webhook","fetchWebhook"],["webhook","fetchWebhooks"]]});return{createWebhook:r,saveWebhooks:a}}const Xae=hn({name:he().trim().min(1,"Enter a webhook name").max(100),enabled:Me(),url:he().url("Enter a valid HTTP or HTTPS URL"),events:As(he()),base64:Me(),byEvents:Me()}),eoe=hn({webhooks:As(Xae).min(1)}),EE=(e=1)=>({name:`Webhook ${e}`,enabled:!0,url:"",events:[],base64:!1,byEvents:!1}),toe=["ALL","MESSAGE","SEND_MESSAGE","READ_RECEIPT","PRESENCE","HISTORY_SYNC","CHAT_PRESENCE","CALL","CONNECTION","QRCODE","LABEL","CONTACT","GROUP","NEWSLETTER"],noe=["APPLICATION_STARTUP","QRCODE_UPDATED","MESSAGES_SET","MESSAGES_UPSERT","MESSAGES_EDITED","MESSAGES_UPDATE","MESSAGES_DELETE","MESSAGES_MEDIA_UPDATE","MESSAGES_REACTION","MESSAGE_RECEIPT_UPDATE","SEND_MESSAGE","SEND_MESSAGE_UPDATE","CONTACTS_SET","CONTACTS_UPSERT","CONTACTS_UPDATE","PRESENCE_UPDATE","CHATS_SET","CHATS_UPSERT","CHATS_UPDATE","CHATS_DELETE","CHATS_LOCK","GROUPS_UPSERT","GROUPS_UPDATE","GROUP_PARTICIPANTS_UPDATE","GROUP_JOIN_REQUEST","GROUP_MEMBER_TAG_UPDATE","CONNECTION_UPDATE","CREDS_UPDATE","MESSAGING_HISTORY_SET","MESSAGING_HISTORY_STATUS","LID_MAPPING_UPDATE","BLOCKLIST_SET","BLOCKLIST_UPDATE","NEWSLETTER_REACTION","NEWSLETTER_VIEW","NEWSLETTER_PARTICIPANTS_UPDATE","NEWSLETTER_SETTINGS_UPDATE","MESSAGE_CAPPING_UPDATE","SETTINGS_UPDATE","LABELS_EDIT","LABELS_ASSOCIATION","CALL","TYPEBOT_START","TYPEBOT_CHANGE_STATUS","REMOVE_INSTANCE","LOGOUT_INSTANCE","INSTANCE_CREATE","INSTANCE_DELETE","STATUS_INSTANCE"].sort((e,t)=>e.localeCompare(t));function roe(){const{t:e}=Le(),{instance:t}=ft(),[n,r]=y.useState(!1),[a,o]=y.useState(null),l=Tr()==="go",{createWebhook:u,saveWebhooks:d}=Zae(),{data:f}=Kae({instanceName:t?.name,token:t?.token,enabled:l}),{data:m}=Gae({instanceName:t?.name,token:t?.token,enabled:!l}),h=mn({resolver:gn(eoe),defaultValues:{webhooks:[EE()]}}),g=w8({control:h.control,name:"webhooks"}),x=h.watch("webhooks");y.useEffect(()=>{const C=l?f?[f]:[]:m??[];C.length&&h.reset({webhooks:C.map((k,N)=>({name:k.name?.trim()||`Webhook ${N+1}`,enabled:k.enabled,url:k.url,events:k.events??[],base64:k.webhookBase64,byEvents:k.webhookByEvents}))})},[h,l,f,m]);const b=async({webhooks:C})=>{if(t){r(!0);try{const k=C.map(N=>({...N}));l?await u({instanceName:t.name,token:t.token,data:k[0]}):await d({instanceName:t.name,token:t.token,data:k}),X.success(e("webhook.toast.success"))}catch(k){console.error(e("webhook.toast.error"),k),X.error(`Error: ${k?.response?.data?.response?.message??k?.message??"Unable to save webhooks"}`)}finally{r(!1)}}},w=l?toe:noe;return s.jsx(Ya,{...h,children:s.jsxs("form",{onSubmit:h.handleSubmit(b),className:"w-full space-y-6",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("webhook.title")}),!l&&s.jsx("p",{className:"text-sm text-muted-foreground",children:e("webhook.description")})]}),!l&&s.jsx(q,{variant:"outline",type:"button",onClick:()=>g.append(EE(g.fields.length+1)),children:e("webhook.button.add")})]}),s.jsx(ll,{className:"my-4"}),s.jsx("div",{className:"space-y-6",children:g.fields.map((C,k)=>{const N=x[k],T=(N?.events[0]??"messages-upsert").toLowerCase().replace(/_/g,"-"),_=`${(N?.url??"https://automation.example/webhook/whatsapp").replace(/\/+$/,"")}/${T}`;return s.jsx(Xx,{open:a===k,onOpenChange:P=>o(P?k:null),children:s.jsxs("section",{className:"rounded-lg border shadow-sm",children:[s.jsxs("div",{className:"flex items-center gap-2 p-4",children:[s.jsx(ew,{asChild:!0,children:s.jsxs("button",{type:"button",className:"flex min-w-0 flex-1 items-center justify-between gap-3 text-left",children:[s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:"block truncate font-medium",children:N?.name||`Webhook ${k+1}`}),s.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:[N?.enabled?e("webhook.status.enabled"):e("webhook.status.disabled")," · ",N?.events.length??0," ",e("webhook.status.events")]})]}),s.jsx(Mx,{className:on("size-4 shrink-0 transition-transform",a===k&&"rotate-180")})]})}),!l&&g.fields.length>1&&s.jsx(q,{variant:"outline",type:"button",onClick:()=>{g.remove(k),o(null)},children:e("webhook.button.remove")})]}),s.jsx(tw,{children:s.jsxs("div",{className:"space-y-3 border-t p-4",children:[!l&&s.jsx(le,{name:`webhooks.${k}.name`,label:e("webhook.form.name.label"),children:s.jsx(G,{placeholder:"Community join requests"})}),!l&&s.jsx(Re,{name:`webhooks.${k}.enabled`,label:e("webhook.form.enabled.label"),className:"w-full justify-between",helper:e("webhook.form.enabled.description")}),s.jsx(le,{name:`webhooks.${k}.url`,label:e("webhook.form.url.label"),children:s.jsx(G,{placeholder:"https://automation.example/webhook/whatsapp"})}),N?.url.includes("/webhook-test/")&&s.jsx("div",{className:"rounded-md border border-amber-500/40 bg-amber-500/10 p-3 text-xs",children:e("webhook.form.url.n8nTestWarning")}),!l&&s.jsx(Re,{name:`webhooks.${k}.byEvents`,label:e("webhook.form.byEvents.label"),className:"w-full justify-between",helper:e("webhook.form.byEvents.description")}),!l&&N?.byEvents&&s.jsxs("div",{className:"rounded-md border border-amber-500/40 bg-amber-500/10 p-3 text-xs",children:[s.jsx("p",{children:e("webhook.form.byEvents.n8nWarning")}),s.jsx("p",{className:"mt-2 break-all font-mono",children:_})]}),!l&&s.jsx(Re,{name:`webhooks.${k}.base64`,label:e("webhook.form.base64.label"),className:"w-full justify-between",helper:e("webhook.form.base64.description")}),s.jsxs("div",{className:"flex flex-wrap justify-between gap-2 pt-3",children:[s.jsx(q,{variant:"outline",type:"button",onClick:()=>h.setValue(`webhooks.${k}.events`,w),children:e("button.markAll")}),s.jsx(q,{variant:"outline",type:"button",onClick:()=>h.setValue(`webhooks.${k}.events`,[]),children:e("button.unMarkAll")})]}),s.jsx(Za,{control:h.control,name:`webhooks.${k}.events`,render:({field:P})=>s.jsxs(Ca,{className:"flex flex-col",children:[s.jsxs(Xr,{className:"my-2 text-lg",children:[e("webhook.form.events.label")," (",P.value.length," selected)"]}),s.jsx(ta,{children:s.jsx("div",{className:"grid gap-x-8 gap-y-2 md:grid-cols-2",children:w.map(M=>s.jsxs("div",{className:"flex items-center justify-between gap-3 border-t pt-3",children:[s.jsx(Xr,{className:on("break-all text-xs",P.value.includes(M)?"text-foreground":"text-muted-foreground"),children:M}),s.jsx(Ed,{checked:P.value.includes(M),onCheckedChange:O=>P.onChange(O?[...P.value,M]:P.value.filter(D=>D!==M))})]},M))})})]})})]})})]})},C.id)})}),s.jsx("div",{className:"flex justify-end pt-2",children:s.jsx(q,{type:"submit",disabled:n,children:e(n?"webhook.button.saving":"webhook.button.save")})})]})})}const soe=e=>["websocket","fetchWebsocket",JSON.stringify(e)],aoe=async({instanceName:e,token:t})=>(await Ce.get(`/websocket/find/${e}`,{headers:{apiKey:t}})).data,ooe=e=>{const{instanceName:t,token:n,...r}=e;return gt({...r,queryKey:soe({instanceName:t,token:n}),queryFn:()=>aoe({instanceName:t,token:n}),enabled:!!t})},ioe=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/websocket/set/${e}`,{websocket:n},{headers:{apikey:t}})).data;function loe(){return{createWebsocket:ot(ioe,{invalidateKeys:[["websocket","fetchWebsocket"]]})}}const coe=hn({enabled:Me(),events:As(he())});function uoe(){const{t:e}=Le(),{instance:t}=ft(),[n,r]=y.useState(!1),{createWebsocket:a}=loe(),{data:o,error:l}=ooe({instanceName:t?.name,token:t?.token}),u=mn({resolver:gn(coe),defaultValues:{enabled:!1,events:[]}});y.useEffect(()=>{o&&u.reset({enabled:o.enabled,events:o.events})},[o]);const d=async g=>{if(t){r(!0);try{const x={enabled:g.enabled,events:g.events};await a({instanceName:t.name,token:t.token,data:x}),X.success(e("websocket.toast.success"))}catch(x){console.error(e("websocket.toast.error"),x),X.error(`Error: ${x?.response?.data?.response?.message}`)}finally{r(!1)}}},f=["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"],m=()=>{u.setValue("events",f)},h=()=>{u.setValue("events",[])};return s.jsx(oa,{error:l,name:"Websocket",envVar:"WEBSOCKET_ENABLED",children:s.jsx(Ya,{...u,children:s.jsx("form",{onSubmit:u.handleSubmit(d),className:"w-full space-y-6",children:s.jsxs("div",{children:[s.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("websocket.title")}),s.jsx(ll,{className:"my-4"}),s.jsxs("div",{className:"mx-4 space-y-2 divide-y [&>*]:p-4",children:[s.jsx(Re,{name:"enabled",label:e("websocket.form.enabled.label"),className:"w-full justify-between",helper:e("websocket.form.enabled.description")}),s.jsxs("div",{className:"mb-4 flex justify-between",children:[s.jsx(q,{variant:"outline",type:"button",onClick:m,children:e("button.markAll")}),s.jsx(q,{variant:"outline",type:"button",onClick:h,children:e("button.unMarkAll")})]}),s.jsx(Za,{control:u.control,name:"events",render:({field:g})=>s.jsxs(Ca,{className:"flex flex-col",children:[s.jsx(Xr,{className:"my-2 text-lg",children:e("websocket.form.events.label")}),s.jsx(ta,{children:s.jsx("div",{className:"flex flex-col gap-2 space-y-1 divide-y",children:f.sort((x,b)=>x.localeCompare(b)).map(x=>s.jsxs("div",{className:"flex items-center justify-between gap-3 pt-3",children:[s.jsx(Xr,{className:on("break-all",g.value.includes(x)?"text-foreground":"text-muted-foreground"),children:x}),s.jsx(Ed,{checked:g.value.includes(x),onCheckedChange:b=>{b?g.onChange([...g.value,x]):g.onChange(g.value.filter(w=>w!==x))}})]},x))})})]})})]}),s.jsx("div",{className:"mx-4 flex justify-end pt-6",children:s.jsx(q,{type:"submit",disabled:n,children:e(n?"websocket.button.saving":"websocket.button.save")})})]})})})})}const $w=15e3;function Bw(e,t){return`${e.replace(/\/+$/,"")}${t}`}async function doe(e,t){const n={};return t&&(n.apikey=t),(await un.get(Bw(e,"/license/status"),{headers:n,timeout:$w})).data}async function foe(e,t,n){const r={};return n&&(r.apikey=n),(await un.get(Bw(t,"/license/register"),{headers:r,params:{redirect_uri:e},timeout:$w})).data}async function poe(e,t,n){const r={};return n&&(r.apikey=n),(await un.get(Bw(t,"/license/activate"),{headers:r,params:{code:e},timeout:$w})).data}function hoe(){const{t:e}=Le(),{theme:t}=Yi(),n=Nn(),[r]=wc(),a=r.get("code")??"",[o,l]=y.useState("activating"),[u,d]=y.useState(""),f=t==="dark"?"https://evolution-api.com/files/evo/evolution-logo-white.svg":"https://evolution-api.com/files/evo/evolution-logo.svg",m=y.useCallback(async()=>{if(l("activating"),d(""),!a){l("error"),d(e("license.callback.missingCode"));return}const h=hr(Fn.API_URL),g=hr(Fn.TOKEN);if(!h||!g){l("error"),d(e("license.callback.missingCredentials"));return}try{const x=await poe(a,h,g);if(x.status==="active"){l("success"),setTimeout(()=>n("/manager",{replace:!0}),1500);return}l("error"),d(x.message||x.error||e("license.callback.genericError"))}catch(x){l("error");const b=x?.response?.data?.details??x?.response?.data?.message??x?.message??e("license.callback.genericError");d(typeof b=="string"?b:e("license.callback.genericError"))}},[a,n,e]);return y.useEffect(()=>{m()},[m]),s.jsx("div",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-t from-primary/20 via-background/95 to-background p-4",children:s.jsxs("div",{className:"w-full max-w-md space-y-6",children:[s.jsxs("div",{className:"flex flex-col items-center text-center",children:[s.jsx("img",{src:f,alt:"Evolution API",className:"mb-3 h-10"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:e("license.callback.title")})]}),s.jsxs("div",{className:"space-y-4 rounded-lg border bg-background/80 p-8 text-center shadow-lg backdrop-blur-sm",children:[o==="activating"&&s.jsxs(s.Fragment,{children:[s.jsx(zh,{className:"mx-auto h-12 w-12 animate-spin text-primary"}),s.jsx("h2",{className:"text-xl font-semibold",children:e("license.callback.title")}),s.jsx("p",{className:"text-muted-foreground",children:e("license.callback.activating")})]}),o==="success"&&s.jsxs(s.Fragment,{children:[s.jsx(UB,{className:"mx-auto h-12 w-12 text-green-500"}),s.jsx("h2",{className:"text-xl font-semibold",children:e("license.callback.successTitle")}),s.jsx("p",{className:"text-muted-foreground",children:e("license.callback.successDescription")})]}),o==="error"&&s.jsxs(s.Fragment,{children:[s.jsx(HB,{className:"mx-auto h-12 w-12 text-destructive"}),s.jsx("h2",{className:"text-xl font-semibold",children:e("license.callback.errorTitle")}),s.jsx("p",{className:"text-muted-foreground",children:u}),s.jsxs("div",{className:"flex justify-center gap-2 pt-2",children:[s.jsx(q,{variant:"outline",onClick:()=>n("/manager/login",{replace:!0}),children:e("license.callback.back")}),s.jsx(q,{onClick:m,children:e("license.callback.retry")})]})]})]})]})})}const moe=async({url:e,token:t})=>{try{const{data:n}=await un.post(`${e}/verify-creds`,{},{headers:{apikey:t}});return Sp({facebookAppId:n.facebookAppId,facebookConfigId:n.facebookConfigId,facebookUserToken:n.facebookUserToken}),n}catch{return null}},goe=async({url:e,token:t})=>{try{const{data:n}=await un.get(`${e}/server/ok`,{headers:{apikey:t,"Cache-Control":"no-cache"},params:{t:Date.now()}});return n?.status==="ok"}catch{return!1}},voe=async({url:e})=>(await un.get(`${e}/`)).data,yoe=hn({provider:fw(["api","go"]).default(vx),serverUrl:he({required_error:"serverUrl is required"}).url("URL inválida"),apiKey:he({required_error:"ApiKey is required"}).min(1,"API Key é obrigatória")});function boe(){const{t:e}=Le(),t=Nn(),{theme:n}=Yi(),[r,a]=y.useState(""),[o,l]=y.useState(!1),u=n==="dark"?"https://evolution-api.com/files/evo/evolution-logo-white.svg":"https://evolution-api.com/files/evo/evolution-logo.svg",d=mn({resolver:gn(yoe),defaultValues:{provider:vx,serverUrl:window.location.protocol+"//"+window.location.host,apiKey:""}}),f=async h=>{l(!0),a("");try{const g=h.serverUrl.replace(/\/+$/,"");if(h.provider==="api")try{if((await doe(g,h.apiKey)).status!=="active"){const C=`${window.location.origin}/manager/license/callback`,k=await foe(C,g,h.apiKey);if(!k.register_url){const N=k.message||e("license.registerFailed");a(N);return}Sp({url:g,token:h.apiKey,provider:"api"}),window.location.href=k.register_url;return}}catch(w){console.warn("[license] status check skipped:",w)}if(h.provider==="go"){if(!await goe({url:g,token:h.apiKey})){cb();const C=e("login.message.invalidCredentials");d.setError("apiKey",{type:"manual",message:C}),a(C);return}Sp({url:g,token:h.apiKey,provider:"go"}),t("/manager/");return}const x=await voe({url:h.serverUrl});if(!x||!x.version){cb();const w=e("login.message.invalidServer");d.setError("serverUrl",{type:"manual",message:w}),a(w);return}if(!await moe({token:h.apiKey,url:h.serverUrl})){const w=e("login.message.invalidCredentials");d.setError("apiKey",{type:"manual",message:w}),a(w);return}Sp({version:x.version,clientName:x.clientName,url:h.serverUrl,token:h.apiKey,provider:"api"}),t("/manager/")}finally{l(!1)}},m=d.formState.errors;return s.jsx("div",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-t from-primary/20 via-background/95 to-background p-4",children:s.jsxs("div",{className:"w-full max-w-md space-y-6",children:[s.jsxs("div",{className:"flex flex-col items-center text-center",children:[s.jsx("img",{src:u,alt:"Evolution API",className:"mb-3 h-10"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:e("login.description")})]}),s.jsxs("div",{className:"rounded-lg border bg-background/80 p-6 shadow-lg backdrop-blur-sm",children:[s.jsxs("div",{className:"mb-6 space-y-2",children:[s.jsx("h2",{className:"text-2xl font-bold",children:e("login.title")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:e("login.subtitle",{defaultValue:"Digite suas credenciais para acessar o sistema"})})]}),r&&s.jsxs(nI,{variant:"destructive",className:"mb-4",children:[s.jsx(nM,{className:"h-4 w-4"}),s.jsx(rI,{children:"Erro"}),s.jsx(wX,{children:r})]}),s.jsx(Ya,{...d,children:s.jsxs("form",{onSubmit:d.handleSubmit(f),className:"space-y-4",children:[s.jsx("div",{className:"hidden","aria-hidden":"true",children:s.jsx(cn,{required:!0,name:"provider",label:"Provider",options:[{value:"api",label:"Evolution API"},{value:"go",label:"Evolution GO"}]})}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs(Ve,{htmlFor:"login-serverUrl",children:[e("login.form.serverUrl")," ",s.jsx("span",{className:"text-rose-600",children:"*"})]}),s.jsx(G,{id:"login-serverUrl",type:"text",placeholder:window.location.origin,disabled:o,...d.register("serverUrl")}),m.serverUrl&&s.jsx("p",{className:"text-sm text-destructive",children:m.serverUrl.message})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs(Ve,{htmlFor:"login-apiKey",children:[e("login.form.apiKey")," ",s.jsx("span",{className:"text-rose-600",children:"*"})]}),s.jsx(G,{id:"login-apiKey",type:"password",placeholder:"Sua chave de API",disabled:o,...d.register("apiKey")}),m.apiKey&&s.jsx("p",{className:"text-sm text-destructive",children:m.apiKey.message})]}),s.jsx(q,{type:"submit",disabled:o,className:"w-full",children:o?s.jsxs(s.Fragment,{children:[s.jsx(zh,{className:"mr-2 h-4 w-4 animate-spin"}),e("login.button.connecting",{defaultValue:"Conectando..."})]}):e("login.button.login")})]})})]}),s.jsx("div",{className:"text-center text-xs text-muted-foreground",children:s.jsxs("p",{children:["© ",new Date().getFullYear()," Evolution API ·"," ",s.jsx("a",{href:"https://github.com/Neup123/evolution-api/tree/main/docs",target:"_blank",rel:"noreferrer",className:"underline hover:text-primary",children:"Documentation"})]})})]})})}function xoe(){const e=Nn(),{theme:t}=Yi(),n=()=>{e("/manager")};return s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsxs("header",{className:"flex items-center justify-between px-4 py-2",children:[s.jsx("div",{className:"flex items-center",children:s.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"})}),s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx(M_,{}),s.jsx(__,{})]})]}),s.jsx("div",{className:"container mx-auto px-4 py-16",children:s.jsxs("div",{className:"max-w-4xl mx-auto",children:[s.jsxs("div",{className:"text-center mb-12",children:[s.jsx("div",{className:"flex items-center justify-center mb-6",children:s.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"})}),s.jsx("h1",{className:"text-4xl font-bold text-foreground mb-4",children:"Evolution Manager v2"}),s.jsx("p",{className:"text-xl text-muted-foreground mb-6",children:"Modern web interface for Evolution API management"}),s.jsx(Io,{variant:"secondary",className:"text-sm px-3 py-1",children:"Version 2.0.0"})]}),s.jsxs(Un,{className:"mb-8",children:[s.jsxs(Yn,{children:[s.jsxs(Zn,{className:"flex items-center gap-2",children:[s.jsx(gz,{className:"w-5 h-5 text-primary"}),"Welcome to Evolution Manager"]}),s.jsx(ej,{children:"A powerful, modern dashboard for managing your WhatsApp API instances with Evolution API"})]}),s.jsx(Vn,{className:"space-y-6",children:s.jsx("div",{className:"pt-6 border-t border-border",children:s.jsx("div",{className:"flex flex-col sm:flex-row gap-4 justify-center items-center",children:s.jsxs(q,{onClick:n,size:"lg",className:"px-8 py-3",children:["Access Manager Dashboard",s.jsx(Tx,{className:"w-4 h-4 ml-2"})]})})})})]}),s.jsxs(Un,{children:[s.jsxs(Yn,{children:[s.jsx(Zn,{children:"Resources & Support"}),s.jsx(ej,{children:"Get help, contribute, or learn more about Evolution API"})]}),s.jsx(Vn,{children:s.jsxs("div",{className:"grid md:grid-cols-3 gap-4",children:[s.jsxs("a",{href:"https://github.com/evolution-foundation/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:[s.jsx(ez,{className:"w-5 h-5 text-muted-foreground"}),s.jsxs("div",{children:[s.jsx("div",{className:"font-medium text-foreground",children:"GitHub"}),s.jsx("div",{className:"text-sm text-muted-foreground",children:"Source code"})]})]}),s.jsxs("a",{href:"https://evolutionfoundation.com.br",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 p-4 rounded-lg border border-border hover:bg-accent transition-colors",children:[s.jsx(tz,{className:"w-5 h-5 text-muted-foreground"}),s.jsxs("div",{children:[s.jsx("div",{className:"font-medium text-foreground",children:"Website"}),s.jsx("div",{className:"text-sm text-muted-foreground",children:"Official site"})]})]}),s.jsxs("a",{href:"mailto:suporte@evofoundation.com.br",className:"flex items-center gap-3 p-4 rounded-lg border border-border hover:bg-accent transition-colors",children:[s.jsx(uz,{className:"w-5 h-5 text-muted-foreground"}),s.jsxs("div",{children:[s.jsx("div",{className:"font-medium text-foreground",children:"Contact"}),s.jsx("div",{className:"text-sm text-muted-foreground",children:"Get support"})]})]})]})})]}),s.jsx("div",{className:"text-center mt-12 text-sm text-muted-foreground",children:s.jsx("p",{children:"© 2025 Evolution API. Licensed under Apache 2.0 with Evolution API custom conditions."})})]})})]})}const woe=NF([{path:"/",element:s.jsx(xoe,{})},{path:"/manager/login",element:s.jsx(IL,{children:s.jsx(boe,{})})},{path:"/manager/license/callback",element:s.jsx(hoe,{})},{path:"/manager/",element:s.jsx(jn,{children:s.jsx(lV,{children:s.jsx(XY,{})})})},{path:"/manager/instance/:instanceId/dashboard",element:s.jsx(jn,{children:s.jsx(_n,{children:s.jsx($X,{})})})},{path:"/manager/instance/:instanceId/chat",element:s.jsx(jn,{feature:"chat",children:s.jsx(_n,{children:s.jsx(qk,{})})})},{path:"/manager/instance/:instanceId/chat/:remoteJid",element:s.jsx(jn,{feature:"chat",children:s.jsx(_n,{children:s.jsx(qk,{})})})},{path:"/manager/instance/:instanceId/settings",element:s.jsx(jn,{feature:"settings",children:s.jsx(_n,{children:s.jsx(cae,{})})})},{path:"/manager/instance/:instanceId/openai",element:s.jsx(jn,{feature:"openai",children:s.jsx(_n,{children:s.jsx(jE,{})})})},{path:"/manager/instance/:instanceId/openai/:botId",element:s.jsx(jn,{feature:"openai",children:s.jsx(_n,{children:s.jsx(jE,{})})})},{path:"/manager/instance/:instanceId/webhook",element:s.jsx(jn,{feature:"webhook",children:s.jsx(_n,{children:s.jsx(roe,{})})})},{path:"/manager/instance/:instanceId/websocket",element:s.jsx(jn,{feature:"websocket",children:s.jsx(_n,{children:s.jsx(uoe,{})})})},{path:"/manager/instance/:instanceId/rabbitmq",element:s.jsx(jn,{feature:"rabbitmq",children:s.jsx(_n,{children:s.jsx(tae,{})})})},{path:"/manager/instance/:instanceId/sqs",element:s.jsx(jn,{feature:"sqs",children:s.jsx(_n,{children:s.jsx(gae,{})})})},{path:"/manager/instance/:instanceId/chatwoot",element:s.jsx(jn,{feature:"chatwoot",children:s.jsx(_n,{children:s.jsx(bX,{})})})},{path:"/manager/instance/:instanceId/typebot",element:s.jsx(jn,{feature:"typebot",children:s.jsx(_n,{children:s.jsx(kE,{})})})},{path:"/manager/instance/:instanceId/typebot/:typebotId",element:s.jsx(jn,{feature:"typebot",children:s.jsx(_n,{children:s.jsx(kE,{})})})},{path:"/manager/instance/:instanceId/dify",element:s.jsx(jn,{feature:"dify",children:s.jsx(_n,{children:s.jsx(vE,{})})})},{path:"/manager/instance/:instanceId/dify/:difyId",element:s.jsx(jn,{feature:"dify",children:s.jsx(_n,{children:s.jsx(vE,{})})})},{path:"/manager/instance/:instanceId/n8n",element:s.jsx(jn,{feature:"n8n",children:s.jsx(_n,{children:s.jsx(CE,{})})})},{path:"/manager/instance/:instanceId/n8n/:n8nId",element:s.jsx(jn,{feature:"n8n",children:s.jsx(_n,{children:s.jsx(CE,{})})})},{path:"/manager/instance/:instanceId/evoai",element:s.jsx(jn,{feature:"evoai",children:s.jsx(_n,{children:s.jsx(xE,{})})})},{path:"/manager/instance/:instanceId/evoai/:evoaiId",element:s.jsx(jn,{feature:"evoai",children:s.jsx(_n,{children:s.jsx(xE,{})})})},{path:"/manager/instance/:instanceId/evolutionBot",element:s.jsx(jn,{feature:"evolutionBot",children:s.jsx(_n,{children:s.jsx(wE,{})})})},{path:"/manager/instance/:instanceId/evolutionBot/:evolutionBotId",element:s.jsx(jn,{feature:"evolutionBot",children:s.jsx(_n,{children:s.jsx(wE,{})})})},{path:"/manager/instance/:instanceId/flowise",element:s.jsx(jn,{feature:"flowise",children:s.jsx(_n,{children:s.jsx(SE,{})})})},{path:"/manager/instance/:instanceId/flowise/:flowiseId",element:s.jsx(jn,{feature:"flowise",children:s.jsx(_n,{children:s.jsx(SE,{})})})},{path:"/manager/instance/:instanceId/proxy",element:s.jsx(jn,{feature:"proxy",children:s.jsx(_n,{children:s.jsx(Gse,{})})})},{path:"/manager/embed-chat",element:s.jsx(bE,{})},{path:"/manager/embed-chat/:remoteJid",element:s.jsx(bE,{})}]),Soe={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 yh{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||Soe,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 a=this.observers[r].get(n)||0;this.observers[r].set(n,a+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),a=1;a{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,a)=>{e=r,t=a});return n.resolve=e,n.reject=t,n},NE=e=>e==null?"":""+e,Coe=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},joe=/###/g,TE=e=>e&&e.indexOf("###")>-1?e.replace(joe,"."):e,ME=e=>!e||typeof e=="string",Zu=(e,t,n)=>{const r=typeof t!="string"?t:t.split(".");let a=0;for(;a{const{obj:r,k:a}=Zu(e,t,Object);if(r!==void 0||t.length===1){r[a]=n;return}let o=t[t.length-1],l=t.slice(0,t.length-1),u=Zu(e,l,Object);for(;u.obj===void 0&&l.length;)o=`${l[l.length-1]}.${o}`,l=l.slice(0,l.length-1),u=Zu(e,l,Object),u&&u.obj&&typeof u.obj[`${u.k}.${o}`]<"u"&&(u.obj=void 0);u.obj[`${u.k}.${o}`]=n},koe=(e,t,n,r)=>{const{obj:a,k:o}=Zu(e,t,Object);a[o]=a[o]||[],a[o].push(n)},bh=(e,t)=>{const{obj:n,k:r}=Zu(e,t);if(n)return n[r]},Eoe=(e,t,n)=>{const r=bh(e,n);return r!==void 0?r:bh(t,n)},xO=(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]):xO(e[r],t[r],n):e[r]=t[r]);return e},Ul=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Noe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const Toe=e=>typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>Noe[t]):e;class Moe{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 _oe=[" ",",","?","!",";"],Poe=new Moe(20),Roe=(e,t,n)=>{t=t||"",n=n||"";const r=_oe.filter(l=>t.indexOf(l)<0&&n.indexOf(l)<0);if(r.length===0)return!0;const a=Poe.getRegExp(`(${r.map(l=>l==="?"?"\\?":l).join("|")})`);let o=!a.test(e);if(!o){const l=e.indexOf(n);l>0&&!a.test(e.substring(0,l))&&(o=!0)}return o},ax=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 a=e;for(let o=0;o-1&&de&&e.indexOf("_")>0?e.replace("_","-"):e;class PE extends Om{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 a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,l=a.ignoreJSONStructure!==void 0?a.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=bh(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:ax(this.data&&this.data[t]&&this.data[t][n],r,o)}addResource(t,n,r,a){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("."),a=n,n=u[1]),this.addNamespaces(n),_E(this.data,u,a),o.silent||this.emit("added",t,n,r,a)}addResources(t,n,r){let a=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});a.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,a,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("."),a=r,r=n,n=u[1]),this.addNamespaces(n);let d=bh(this.data,u)||{};l.skipCopy||(r=JSON.parse(JSON.stringify(r))),a?xO(d,r,o):d={...d,...r},_E(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(a=>n[a]&&Object.keys(n[a]).length>0)}toJSON(){return this.data}}var wO={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,a){return e.forEach(o=>{this.processors[o]&&(t=this.processors[o].process(t,n,r,a))}),t}};const RE={};class wh extends Om{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Coe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=ya.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 a=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&&!Roe(t,r,a);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!==a||r===a&&this.options.ns.indexOf(f[0])>-1)&&(o=f.shift()),t=f.join(a)}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 a=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,m=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(f&&f.toLowerCase()==="cimode"){if(m){const _=n.nsSeparator||this.options.nsSeparator;return a?{res:`${d}${_}${l}`,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:d,usedParams:this.getUsedParamsDetails(n)}:`${d}${_}${l}`}return a?{res:l,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:d,usedParams:this.getUsedParamsDetails(n)}:l}const h=this.resolve(t,n);let g=h&&h.res;const x=h&&h.usedKey||l,b=h&&h.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,N=!this.i18nFormat||this.i18nFormat.handleAsObject;if(N&&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 a?(h.res=_,h.usedParams=this.getUsedParamsDetails(n),h):_}if(o){const _=Array.isArray(g),P=_?[]:{},M=_?b:x;for(const O in g)if(Object.prototype.hasOwnProperty.call(g,O)){const D=`${M}${o}${O}`;P[O]=this.translate(D,{...n,joinArrays:!1,ns:u}),P[O]===D&&(P[O]=g[O])}g=P}}else if(N&&typeof k=="string"&&Array.isArray(g))g=g.join(k),g&&(g=this.extendTranslation(g,t,n,r));else{let _=!1,P=!1;const M=n.count!==void 0&&typeof n.count!="string",O=wh.hasDefaultValue(n),D=M?this.pluralResolver.getSuffix(f,n.count,n):"",F=n.ordinal&&M?this.pluralResolver.getSuffix(f,n.count,{ordinal:!1}):"",$=M&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),te=$&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${D}`]||n[`defaultValue${F}`]||n.defaultValue;!this.isValidLookup(g)&&O&&(_=!0,g=te),this.isValidLookup(g)||(P=!0,g=l);const ue=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&P?void 0:g,V=O&&te!==g&&this.options.updateMissing;if(P||_||V){if(this.logger.log(V?"updateKey":"missingKey",f,d,l,V?te: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 ne=[];const Y=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Y&&Y[0])for(let H=0;H{const A=O&&U!==g?U:ue;this.options.missingKeyHandler?this.options.missingKeyHandler(H,d,W,A,V,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(H,d,W,A,V,n),this.emit("missingKey",H,d,W,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&M?ne.forEach(H=>{const W=this.pluralResolver.getSuffixes(H,n);$&&n[`defaultValue${this.options.pluralSeparator}zero`]&&W.indexOf(`${this.options.pluralSeparator}zero`)<0&&W.push(`${this.options.pluralSeparator}zero`),W.forEach(U=>{se([H],l+U,n[`defaultValue${U}`]||te)})}):se(ne,l,te))}g=this.extendTranslation(g,t,n,h,r),P&&g===l&&this.options.appendNamespaceToMissingKey&&(g=`${d}:${l}`),(P||_)&&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 a?(h.res=g,h.usedParams=this.getUsedParamsDetails(n),h):g}extendTranslation(t,n,r,a,o){var l=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||a.usedLng,a.usedNS,a.usedKey,{resolved:a});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 m;if(f){const g=t.match(this.interpolator.nestingRegexp);m=g&&g.length}let h=r.replace&&typeof r.replace!="string"?r.replace:r;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),t=this.interpolator.interpolate(t,h,r.lng||this.language||a.usedLng,r),f){const g=t.match(this.interpolator.nestingRegexp),x=g&&g.length;m1&&arguments[1]!==void 0?arguments[1]:{},r,a,o,l,u;return typeof t=="string"&&(t=[t]),t.forEach(d=>{if(this.isValidLookup(r))return;const f=this.extractFromKey(d,n),m=f.key;a=m;let h=f.namespaces;this.options.fallbackNS&&(h=h.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);h.forEach(C=>{this.isValidLookup(r)||(u=C,!RE[`${w[0]}-${C}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(u)&&(RE[`${w[0]}-${C}`]=!0,this.logger.warn(`key "${a}" 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 N=[m];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(N,m,k,C,n);else{let _;g&&(_=this.pluralResolver.getSuffix(k,n.count,n));const P=`${this.options.pluralSeparator}zero`,M=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(g&&(N.push(m+_),n.ordinal&&_.indexOf(M)===0&&N.push(m+_.replace(M,this.options.pluralSeparator)),x&&N.push(m+P)),b){const O=`${m}${this.options.contextSeparator}${n.context}`;N.push(O),g&&(N.push(O+_),n.ordinal&&_.indexOf(M)===0&&N.push(O+_.replace(M,this.options.pluralSeparator)),x&&N.push(O+P))}}let T;for(;T=N.pop();)this.isValidLookup(r)||(o=T,r=this.getResource(k,C,T,n))}))})}),{res:r,usedKey:a,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 a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,a):this.resourceStore.getResource(t,n,r,a)}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 a=r?t.replace:t;if(r&&typeof t.count<"u"&&(a.count=t.count),this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),!r){a={...a};for(const o of n)delete a[o]}return a}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 Vy=e=>e.charAt(0).toUpperCase()+e.slice(1);class IE{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ya.create("languageUtils")}getScriptPartFromCode(t){if(t=xh(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=xh(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(a=>a.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=Vy(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]=Vy(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=Vy(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 a=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(a))&&(n=a)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const a=this.getLanguagePartFromCode(r);if(this.isSupportedCode(a))return n=a;n=this.options.supportedLngs.find(o=>{if(o===a)return o;if(!(o.indexOf("-")<0&&a.indexOf("-")<0)&&(o.indexOf("-")>0&&a.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===a||o.indexOf(a)===0&&a.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),a=[],o=l=>{l&&(this.isSupportedCode(l)?a.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=>{a.indexOf(l)<0&&o(this.formatLanguageCode(l))}),a}}let Ioe=[{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}],Ooe={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 Aoe=["v1","v2","v3"],Doe=["v4"],OE={zero:0,one:1,two:2,few:3,many:4,other:5},Foe=()=>{const e={};return Ioe.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:Ooe[t.fc]}})}),e};class Loe{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=ya.create("pluralResolver"),(!this.options.compatibilityJSON||Doe.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=Foe(),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=xh(t==="dev"?"en":t),a=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:a});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];const l=new Intl.PluralRules(r,{type:a});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(a=>`${n}${a}`)}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((a,o)=>OE[a]-OE[o]).map(a=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${a}`):r.numbers.map(a=>this.getSuffix(t,a,n)):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const a=this.getRule(t,r);return a?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${a.select(n)}`:this.getSuffixRetroCompatible(a,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 a=t.numbers[r];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(a===2?a="plural":a===1&&(a=""));const o=()=>this.options.prepend&&a.toString()?this.options.prepend+a.toString():a.toString();return this.options.compatibilityJSON==="v1"?a===1?"":typeof a=="number"?`_plural_${a.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!Aoe.includes(this.options.compatibilityJSON)}}const AE=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=Eoe(e,t,n);return!o&&a&&typeof n=="string"&&(o=ax(e,n,r),o===void 0&&(o=ax(t,n,r))),o},qy=e=>e.replace(/\$/g,"$$$$");class $oe{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=ya.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:a,prefix:o,prefixEscaped:l,suffix:u,suffixEscaped:d,formatSeparator:f,unescapeSuffix:m,unescapePrefix:h,nestingPrefix:g,nestingPrefixEscaped:x,nestingSuffix:b,nestingSuffixEscaped:w,nestingOptionsSeparator:C,maxReplaces:k,alwaysFormat:N}=t.interpolation;this.escape=n!==void 0?n:Toe,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=a!==void 0?a:!1,this.prefix=o?Ul(o):l||"{{",this.suffix=u?Ul(u):d||"}}",this.formatSeparator=f||",",this.unescapePrefix=m?"":h||"-",this.unescapeSuffix=this.unescapePrefix?"":m||"",this.nestingPrefix=g?Ul(g):x||Ul("$t("),this.nestingSuffix=b?Ul(b):w||Ul(")"),this.nestingOptionsSeparator=C||",",this.maxReplaces=k||1e3,this.alwaysFormat=N!==void 0?N:!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,a){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=AE(n,d,x,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(k,void 0,r,{...a,...n,interpolationkey:x}):k}const b=x.split(this.formatSeparator),w=b.shift().trim(),C=b.join(this.formatSeparator).trim();return this.format(AE(n,d,w,this.options.keySeparator,this.options.ignoreJSONStructure),C,r,{...a,...n,interpolationkey:w})};this.resetRegExp();const m=a&&a.missingInterpolationHandler||this.options.missingInterpolationHandler,h=a&&a.interpolation&&a.interpolation.skipOnVariables!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:x=>qy(x)},{regex:this.regexp,safeValue:x=>this.escapeValue?qy(this.escape(x)):qy(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 m=="function"){const C=m(t,o,a);l=typeof C=="string"?C:""}else if(a&&Object.prototype.hasOwnProperty.call(a,b))l="";else if(h){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=NE(l));const w=x.safeValue(l);if(t=t.replace(o[0],w),h?(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]:{},a,o,l;const u=(d,f)=>{const m=this.nestingOptionsSeparator;if(d.indexOf(m)<0)return d;const h=d.split(new RegExp(`${m}[ ]*{`));let g=`{${h[1]}`;d=h[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}${m}${g}`}return l.defaultValue&&l.defaultValue.indexOf(this.prefix)>-1&&delete l.defaultValue,d};for(;a=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(a[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(a[1])){const m=a[1].split(this.formatSeparator).map(h=>h.trim());a[1]=m.shift(),d=m,f=!0}if(o=n(u.call(this,a[1].trim(),l),l),o&&a[0]===t&&typeof o!="string")return o;typeof o!="string"&&(o=NE(o)),o||(this.logger.warn(`missed to resolve ${a[1]} for nesting ${t}`),o=""),f&&(o=d.reduce((m,h)=>this.format(m,h,r.lng,{...r,interpolationkey:a[1].trim()}),o.trim())),t=t.replace(a[0],o),this.regexp.lastIndex=0}return t}}const Boe=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const a=r[1].substring(0,r[1].length-1);t==="currency"&&a.indexOf(":")<0?n.currency||(n.currency=a.trim()):t==="relativetime"&&a.indexOf(":")<0?n.range||(n.range=a.trim()):a.split(";").forEach(l=>{if(l){const[u,...d]=l.split(":"),f=d.join(":").trim().replace(/^'+|'+$/g,""),m=u.trim();n[m]||(n[m]=f),f==="false"&&(n[m]=!1),f==="true"&&(n[m]=!0),isNaN(f)||(n[m]=parseInt(f,10))}})}return{formatName:t,formatOptions:n}},Vl=e=>{const t={};return(n,r,a)=>{let o=a;a&&a.interpolationkey&&a.formatParams&&a.formatParams[a.interpolationkey]&&a[a.interpolationkey]&&(o={...o,[a.interpolationkey]:void 0});const l=r+JSON.stringify(o);let u=t[l];return u||(u=e(xh(r),a),t[l]=u),u(n)}};class zoe{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=ya.create("formatter"),this.options=t,this.formats={number:Vl((n,r)=>{const a=new Intl.NumberFormat(n,{...r});return o=>a.format(o)}),currency:Vl((n,r)=>{const a=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>a.format(o)}),datetime:Vl((n,r)=>{const a=new Intl.DateTimeFormat(n,{...r});return o=>a.format(o)}),relativetime:Vl((n,r)=>{const a=new Intl.RelativeTimeFormat(n,{...r});return o=>a.format(o,r.range||"day")}),list:Vl((n,r)=>{const a=new Intl.ListFormat(n,{...r});return o=>a.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()]=Vl(n)}format(t,n,r){let a=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:m}=Boe(d);if(this.formats[f]){let h=u;try{const g=a&&a.formatParams&&a.formatParams[a.interpolationkey]||{},x=g.locale||g.lng||a.locale||a.lng||r;h=this.formats[f](u,x,{...m,...a,...g})}catch(g){this.logger.warn(g)}return h}else this.logger.warn(`there was no format function for ${f}`);return u},t)}}const Uoe=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class Voe extends Om{constructor(t,n,r){let a=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=a,this.logger=ya.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=a.maxParallelReads||10,this.readingCalls=0,this.maxRetries=a.maxRetries>=0?a.maxRetries:5,this.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,a.backend,a)}queueLoad(t,n,r,a){const o={},l={},u={},d={};return t.forEach(f=>{let m=!0;n.forEach(h=>{const g=`${f}|${h}`;!r.reload&&this.store.hasResourceBundle(f,h)?this.state[g]=2:this.state[g]<0||(this.state[g]===1?l[g]===void 0&&(l[g]=!0):(this.state[g]=1,m=!1,l[g]===void 0&&(l[g]=!0),o[g]===void 0&&(o[g]=!0),d[h]===void 0&&(d[h]=!0)))}),m||(u[f]=!0)}),(Object.keys(o).length||Object.keys(l).length)&&this.queue.push({pending:l,pendingCount:Object.keys(l).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(o),pending:Object.keys(l),toLoadLanguages:Object.keys(u),toLoadNamespaces:Object.keys(d)}}loaded(t,n,r){const a=t.split("|"),o=a[0],l=a[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=>{koe(d.loaded,[o],l),Uoe(d,t),n&&d.errors.push(n),d.pendingCount===0&&!d.done&&(Object.keys(d.loaded).forEach(f=>{u[f]||(u[f]={});const m=d.loaded[f];m.length&&m.forEach(h=>{u[f][h]===void 0&&(u[f][h]=!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 a=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:a,wait:o,callback:l});return}this.readingCalls++;const u=(f,m)=>{if(this.readingCalls--,this.waitingReads.length>0){const h=this.waitingReads.shift();this.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(f&&m&&a{this.read.call(this,t,n,r,a+1,o*2,l)},o);return}l(f,m)},d=this.backend[r].bind(this.backend);if(d.length===2){try{const f=d(t,n);f&&typeof f.then=="function"?f.then(m=>u(null,m)).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]:{},a=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."),a&&a();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof n=="string"&&(n=[n]);const o=this.queueLoad(t,n,r,a);if(!o.toLoad.length)return o.pending.length||a(),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("|"),a=r[0],o=r[1];this.read(a,o,"read",void 0,void 0,(l,u)=>{l&&this.logger.warn(`${n}loading namespace ${o} for language ${a} failed`,l),!l&&u&&this.logger.log(`${n}loaded namespace ${o} for language ${a}`,u),this.loaded(t,l,u)})}saveMissing(t,n,r,a,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 m;f.length===5?m=f(t,n,r,a,d):m=f(t,n,r,a),m&&typeof m.then=="function"?m.then(h=>u(null,h)).catch(u):u(null,m)}catch(m){u(m)}else f(t,n,r,a,u,d)}!t||!t[0]||this.store.addResource(t[0],n,r,a)}}}const DE=()=>({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}}),FE=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),gp=()=>{},qoe=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class hd extends Om{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=FE(t),this.services={},this.logger=ya,this.modules={external:[]},qoe(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 a=DE();this.options={...a,...this.options,...FE(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...a.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const o=m=>m?typeof m=="function"?new m:m:null;if(!this.options.isClone){this.modules.logger?ya.init(o(this.modules.logger),this.options):ya.init(null,this.options);let m;this.modules.formatter?m=this.modules.formatter:typeof Intl<"u"&&(m=zoe);const h=new IE(this.options);this.store=new PE(this.options.resources,this.options);const g=this.services;g.logger=ya,g.resourceStore=this.store,g.languageUtils=h,g.pluralResolver=new Loe(h,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),m&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(g.formatter=o(m),g.formatter.init(g,this.options),this.options.interpolation.format=g.formatter.format.bind(g.formatter)),g.interpolator=new $oe(this.options),g.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},g.backendConnector=new Voe(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=gp),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const m=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);m.length>0&&m[0]!=="dev"&&(this.options.lng=m[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(m=>{this[m]=function(){return t.store[m](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(m=>{this[m]=function(){return t.store[m](...arguments),t}});const d=$u(),f=()=>{const m=(h,g)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),d.resolve(g),r(h,g)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return m(null,this.t.bind(this));this.changeLanguage(this.options.lng,m)};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]:gp;const a=typeof t=="string"?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(a&&a.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)})};a?l(a):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 a=$u();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=gp),this.services.backendConnector.reload(t,n,o=>{a.resolve(),r(o)}),a}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"&&wO.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 a=$u();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,a.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,m=>{l(m,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),a}getFixedT(t,n,r){var a=this;const o=function(l,u){let d;if(typeof u!="object"){for(var f=arguments.length,m=new Array(f>2?f-2:0),h=2;h`${d.keyPrefix}${g}${b}`):x=d.keyPrefix?`${d.keyPrefix}${g}${l}`:l,a.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],a=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)&&(!a||l(o,t)))}loadNamespaces(t,n){const r=$u();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(a=>{this.options.ns.indexOf(a)<0&&this.options.ns.push(a)}),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=$u();typeof t=="string"&&(t=[t]);const a=this.options.preload||[],o=t.filter(l=>a.indexOf(l)<0&&this.services.languageUtils.isSupportedCode(l));return o.length?(this.options.preload=a.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 IE(DE());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 hd(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:gp;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const a={...this.options,...t,isClone:!0},o=new hd(a);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 PE(this.store.data,a),o.services.resourceStore=o.store),o.translator=new wh(o.services,a),o.translator.on("*",function(u){for(var d=arguments.length,f=new Array(d>1?d-1:0),m=1;m60":"More than 60 minutes",">120":"More than 2 hours",">300":"More than 5 hours",">1440":"More than 24 hours",custom:"Custom"},custom:{more:"More than",less:"Less than",valuePlaceholder:"Value",minutes:"Minutes",hours:"Hours",days:"Days"}},mass:{title:"Mass actions",selectAll:"Select all",selected:"{{count}} selected",newStatus:"New status",apply:"Apply to selected",noneSelected:"Select at least one session",success:"Status updated for selected sessions",error:"Failed to update status in bulk"},pagination:{showing:"Showing {{shown}} of {{total}}",perPage:"Per page",showMore:"Load more",showAll:"Show all",showLess:"Show less"},send:{title:"Send message",to:"To",messagePlaceholder:"Type your message",send:"Send",sending:"Sending...",empty:"Type a message before sending",success:"Message sent successfully",error:"Failed to send message"},actions:{sendMessage:"Send message"},empty:"No sessions found"},Joe={delete:{title:"Delete Record",message:"You are about to delete the instance {{instanceName}}, Are you sure you want to continue?",messageSingle:"This action cannot be undone",confirm:"Type the instance name to confirm:"}},Qoe={all:"All",open:"Connected",connecting:"Connecting",closed:"Disconnected"},Yoe={clientName:"Client name",version:"Version"},Zoe={theme:{label:"Toggle theme",light:"Light",dark:"Dark",system:"System"},language:{label:"Language",english:"English",portuguese:"Portuguese",spanish:"Spanish",french:"French"},logout:{action:"Sign out",title:"Are you sure you want to sign out?",description:"You will be disconnected and redirected to the login screen."}},Xoe={media:{attach:"Attach file",document:"Document",photosAndVideos:"Photos and Videos",errors:{audioSize:"Audio file size must be less than 16 MB",imageSize:"Image file size must be less than 5 MB",videoSize:"Video file size must be less than 16 MB",documentSize:"Document file size must be less than 100 MB",unsupportedType:"Unsupported file type"},selectedMedia:{imageAlt:"Selected image",file:"File",selectedFile:"Selected file"}},search:"Search conversations...",back:"Back",tabs:{contacts:"Contacts",groups:"Groups"},count_one:"{{count}} conversation",count_other:"{{count}} conversations",empty:{default:"No conversations yet",search:"No conversations found",tryAnother:"Try another term",selectTitle:"Select a conversation",selectDescription:"Choose a contact or group from the list to start"},input:{placeholder:"Type a message...",send:"Send"},date:{today:"Today",yesterday:"Yesterday"}},eie={dashboard:"Dashboard",chat:"Chat",configurations:"Configurations",settings:"Settings",proxy:"Proxy",events:"Events",webhook:"Webhook",websocket:"WebSocket",rabbitmq:"RabbitMQ",sqs:"SQS",integrations:"Integrations",chatwoot:"Chatwoot",typebot:"Typebot",openai:"OpenAI",dify:"Dify",n8n:"n8n",evoai:"EvoAI",evolutionBot:"Evolution Bot",flowise:"Flowise",documentation:"Documentation",postman:"Swagger",discord:"Discord"},tie={instance:{created:"Instance created successfully",deleted:"Instance deleted successfully",error:"An error occurred while creating the instance"}},nie={checking:"Checking license...",required:"License required",redirecting:"Redirecting to license registration...",registerFailed:"Failed to initiate license registration",callback:{title:"Activating license",missingCode:"Authorization code not found in URL",missingCredentials:"Credentials not found. Please log in again.",activating:"Please wait while we activate your license.",successTitle:"License activated!",successDescription:"Redirecting...",errorTitle:"Activation error",retry:"Try again",back:"Back to login",genericError:"Failed to activate license"}},rie={title:"Evolution Manager",description:"Please enter your credentials to continue",form:{serverUrl:"Server URL",apiKey:"API Key Global"},message:{invalidServer:"Invalid server",invalidCredentials:"Invalid credentials"},button:{login:"Login",connecting:"Connecting..."},subtitle:"Enter your credentials to access the system"},sie={modal:{title:"New instance"},form:{name:"Name",integration:{label:"Channel",baileys:"Baileys",whatsapp:"WhatsApp Cloud API",facebook:"Facebook",instagram:"Instagram",evolution:"Evolution"},token:"Token",number:"Number",businessId:"Business ID"},button:{save:"Save",saving:"Saving...",create:"Instance",connecting:"Connecting...",facebook:"Connect with Facebook",instagram:"Connect with Instagram",whatsapp:"Connect with WhatsApp"},dashboard:{button:{qrcode:{label:"Get QR Code",title:"Scan the QR code with your WhatsApp Web"},pairingCode:{label:"Get Pairing Code",title:"Get the pairing code to connect with WhatsApp"},restart:"Restart",disconnect:"Disconnect",sendMessage:"Send message"},alert:"To connect, scan the QR code with your WhatsApp Web",contacts:"Contacts",chats:"Chats",messages:"Messages",subtitle:"Manage your instance"}},aie={title:"Settings",toast:{success:"Settings applied successfully",error:"An error occurred while applying the settings"},form:{rejectCall:{label:"Reject Calls",description:"Reject all incoming calls"},msgCall:{label:"Message Reject Call",description:"Send a message when rejecting a call"},groupsIgnore:{label:"Ignore Groups",description:"Ignore all messages from groups"},alwaysOnline:{label:"Always Online",description:"Keep the whatsapp always online"},readMessages:{label:"Read Messages",description:"Mark all messages as read"},syncFullHistory:{label:"Sync Full History",description:"Sync all complete chat history on scan QR code"},readStatus:{label:"Read Status",description:"Mark all statuses as read"}},button:{save:"Save",saving:"Saving..."}},oie={title:"Proxy",toast:{success:"Proxy applied successfully",error:"An error occurred while applying the proxy"},form:{enabled:{label:"Enabled",description:"Enable or disable the proxy"},protocol:{label:"Protocol"},host:{label:"Host"},port:{label:"Port"},username:{label:"Username"},password:{label:"Password"}},button:{save:"Save",saving:"Saving..."}},iie={title:"Webhook destinations",description:"Send each WhatsApp event to one or more independent destinations.",toast:{success:"Webhook applied successfully",error:"An error occurred while applying the webhook"},form:{name:{label:"Webhook name"},enabled:{label:"Enabled",description:"Enable or disable the webhook"},url:{label:"URL",n8nTestWarning:"This is an n8n test URL. It receives events only while Listen for test event is active. Copy the Production URL containing /webhook/ before saving this webhook."},byEvents:{label:"Webhook by Events",description:"Send each event to a URL formed by adding the event name to the end of the base URL",n8nWarning:"n8n Webhook nodes match an exact path and do not catch added subpaths. Create an exact n8n webhook path for each event, or turn off Webhook by Events to send every selected event to the URL above. Example delivery URL:"},base64:{label:"Webhook Base64",description:"Send media base64 data in webhook"},events:{label:"Events"}},button:{save:"Save",saving:"Saving...",add:"Add webhook",remove:"Remove webhook"},status:{enabled:"Enabled",disabled:"Disabled",events:"events"}},lie={title:"Websocket",toast:{success:"Websocket applied successfully",error:"An error occurred while applying the websocket"},form:{enabled:{label:"Enabled",description:"Enable or disable the websocket"},events:{label:"Events"}},button:{save:"Save",saving:"Saving..."}},cie={title:"RabbitMQ",toast:{success:"RabbitMQ applied successfully",error:"An error occurred while applying the rabbitmq"},form:{enabled:{label:"Enabled",description:"Enable or disable the rabbitmq"},events:{label:"Events"}},button:{save:"Save",saving:"Saving..."}},uie={title:"SQS",toast:{success:"SQS applied successfully",error:"An error occurred while applying the sqs"},form:{enabled:{label:"Enabled",description:"Enable or disable the sqs"},events:{label:"Events"}},button:{save:"Save",saving:"Saving..."}},die={title:"Chatwoot",toast:{success:"Chatwoot applied successfully",error:"An error occurred while applying the Chatwoot"},form:{enabled:{label:"Enabled",description:"Enable or disable the sqs"},url:{label:"Chatwoot URL"},accountId:{label:"Account ID"},token:{label:"Token"},signMsg:{label:"Sign Messages",description:"Sign message with chatwoot username"},signDelimiter:{label:"Sign Delimiter"},nameInbox:{label:"Name Inbox"},organization:{label:"Organization"},logo:{label:"Logo"},conversationPending:{label:"Conversation Pending",description:"Conversations start as pending"},reopenConversation:{label:"Reopen Conversation",description:"Reopen conversation when receiving message"},importContacts:{label:"Import Contacts",description:"Import contacts from WhatsApp address book by connecting QR Code"},importMessages:{label:"Import Messages",description:"Import messages from WhatsApp by connecting QR Code"},daysLimitImportMessages:{label:"Days Limit Import Messages"},ignoreJids:{label:"Ignore Jids",placeholder:"Add JIDs ex: 1234567890@s.whatsapp.net and press enter"},autoCreate:{label:"Auto Create",description:"Automatically create chatwoot integration on save"}},button:{save:"Save",saving:"Saving..."}},fie={title:"Typebots",sessions:{label:"Sessions",search:"Search for remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Push Name",sessionId:"Session ID",status:"Status",actions:{title:"Actions",open:"Open",pause:"Pause",close:"Close",delete:"Delete"},none:"Nothing to show"}},defaultSettings:"Default Settings",toast:{defaultSettings:{success:"Default settings applied successfully",error:"An error occurred while applying the default settings"},success:{update:"Typebot updated successfully",create:"Typebot created successfully",delete:"Typebot deleted successfully",status:"Typebot status updated successfully"},error:"An error occurred while creating the Typebot"},table:{none:"Nothing to show"},form:{title:"New Typebot",examples:{keywordFinish:"#FINISH",unknownMessage:"I'm sorry, I didn't understand. Can you try again?"},enabled:{label:"Enabled"},description:{label:"Description"},typebotSettings:{label:"Typebot Settings"},url:{label:"Typebot API URL"},typebot:{label:"Typebot Public Name"},triggerSettings:{label:"Trigger Settings"},triggerType:{label:"Trigger Type",keyword:"Keyword",all:"All",advanced:"Advanced",none:"None"},triggerOperator:{label:"Trigger Operator",contains:"Contains",equals:"Equals",startsWith:"Starts With",endsWith:"Ends With",regex:"Regex"},triggerValue:{label:"Trigger"},triggerConditions:{label:"Conditions"},typebotIdFallback:{label:"Typebot Fallback"},generalSettings:{label:"General Settings"},expire:{label:"Expire in minutes"},keywordFinish:{label:"Keyword Finish"},delayMessage:{label:"Default Delay Message"},unknownMessage:{label:"Unknown Message"},listeningFromMe:{label:"Listening from me",description:"Listen to messages sent by me on the bot"},stopBotFromMe:{label:"Stop bot from me",description:"Pause the bot when I send a message"},keepOpen:{label:"Keep open",description:"Keep the bot open after the conversation ends"},debounceTime:{label:"Debounce Time"},splitMessages:{label:"Split Messages",description:"Split messages into multiple messages"},timePerChar:{label:"Time per character"},ignoreJids:{label:"Ignore Jids",placeholder:"Add JIDs ex: 1234567890@s.whatsapp.net and press enter"}},button:{create:"Typebot",save:"Save",saving:"Saving...",update:"Update",defaultSettings:"Default Settings",delete:"Delete"},modal:{defaultSettings:{title:"Default Settings"}}},pie={title:"OpenAI",sessions:{label:"Sessions",search:"Search for remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Push Name",sessionId:"Session ID",status:"Status",actions:{title:"Actions",open:"Open",pause:"Pause",close:"Close",delete:"Delete"},none:"Nothing to show"}},credentials:{title:"Credentials",table:{name:"Name",apiKey:"API Key",actions:{title:"Actions",delete:"Delete"},none:"Nothing to show"}},defaultSettings:"Default Settings",toast:{defaultSettings:{success:"Default settings applied successfully",error:"An error occurred while applying the default settings"},success:{update:"OpenAI updated successfully",create:"OpenAI created successfully",delete:"OpenAI deleted successfully",status:"OpenAI status updated successfully",credentialsCreate:"OpenAI credentials created successfully",credentialsDelete:"OpenAI credentials deleted successfully"},error:"An error occurred while creating the OpenAI"},table:{none:"Nothing to show"},form:{title:"New OpenAI",examples:{keywordFinish:"#FINISH",unknownMessage:"I'm sorry, I didn't understand. Can you try again?"},openaiCredsId:{label:"OpenAI Credentials"},enabled:{label:"Enabled"},description:{label:"Description"},openaiSettings:{label:"OpenAI Settings"},botType:{label:"Bot Type",assistant:"Assistant",chatCompletion:"Chat Completion"},assistantId:{label:"Assistant ID"},functionUrl:{label:"Function URL"},model:{label:"Language Model"},systemMessages:{label:"System Messages",description:"Send system messages to OpenAI"},assistantMessages:{label:"Assistant Messages",description:"Send assistant messages to OpenAI"},userMessages:{label:"User Messages",description:"Send user messages to OpenAI"},maxTokens:{label:"Max Tokens"},triggerSettings:{label:"Trigger Settings"},triggerType:{label:"Trigger Type",keyword:"Keyword",all:"All",advanced:"Advanced",none:"None"},triggerOperator:{label:"Trigger Operator",contains:"Contains",equals:"Equals",startsWith:"Starts With",endsWith:"Ends With",regex:"Regex"},triggerValue:{label:"Trigger"},triggerConditions:{label:"Conditions"},openaiIdFallback:{label:"OpenAI Fallback"},generalSettings:{label:"General Settings"},expire:{label:"Expire in minutes"},keywordFinish:{label:"Keyword Finish"},delayMessage:{label:"Default Delay Message"},unknownMessage:{label:"Unknown Message"},listeningFromMe:{label:"Listening from me",description:"Listen to messages sent by me on the bot"},stopBotFromMe:{label:"Stop bot from me",description:"Pause the bot when I send a message"},keepOpen:{label:"Keep open",description:"Keep the bot open after the conversation ends"},speechToText:{label:"Speech to Text",description:"Convert voice messages to text"},debounceTime:{label:"Debounce Time"},splitMessages:{label:"Split Messages",description:"Split messages into multiple messages"},timePerChar:{label:"Time per character"},ignoreJids:{label:"Ignore Jids",placeholder:"Add JIDs ex: 1234567890@s.whatsapp.net and press enter"}},button:{create:"OpenAI",save:"Save",saving:"Saving...",update:"Update",defaultSettings:"Default Settings",delete:"Delete",loadModels:"Load Models",loading:"Loading..."},modal:{defaultSettings:{title:"Default Settings"}}},hie={title:"Dify",sessions:{label:"Sessions",search:"Search for remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Push Name",sessionId:"Session ID",status:"Status",actions:{title:"Actions",open:"Open",pause:"Pause",close:"Close",delete:"Delete"},none:"Nothing to show"}},defaultSettings:"Default Settings",toast:{defaultSettings:{success:"Default settings applied successfully",error:"An error occurred while applying the default settings"},success:{update:"Dify updated successfully",create:"Dify created successfully",delete:"Dify deleted successfully",status:"Dify status updated successfully"},error:"An error occurred while creating the Dify"},table:{none:"Nothing to show"},form:{title:"New Dify",examples:{keywordFinish:"#FINISH",unknownMessage:"I'm sorry, I didn't understand. Can you try again?"},enabled:{label:"Enabled"},description:{label:"Description"},difySettings:{label:"Dify Settings"},botType:{label:"Bot Type",chatBot:"Chat Bot",textGenerator:"Text Generator",agent:"Agent",workflow:"Workflow"},apiUrl:{label:"API URL"},apiKey:{label:"API Key"},triggerSettings:{label:"Trigger Settings"},triggerType:{label:"Trigger Type",keyword:"Keyword",all:"All",advanced:"Advanced",none:"None"},triggerOperator:{label:"Trigger Operator",contains:"Contains",equals:"Equals",startsWith:"Starts With",endsWith:"Ends With",regex:"Regex"},triggerValue:{label:"Trigger"},triggerConditions:{label:"Conditions"},difyIdFallback:{label:"Dify Fallback"},generalSettings:{label:"General Settings"},expire:{label:"Expire in minutes"},keywordFinish:{label:"Keyword Finish"},delayMessage:{label:"Default Delay Message"},unknownMessage:{label:"Unknown Message"},listeningFromMe:{label:"Listening from me",description:"Listen to messages sent by me on the bot"},stopBotFromMe:{label:"Stop bot from me",description:"Pause the bot when I send a message"},keepOpen:{label:"Keep open",description:"Keep the bot open after the conversation ends"},debounceTime:{label:"Debounce Time"},splitMessages:{label:"Split Messages",description:"Split messages into multiple messages"},timePerChar:{label:"Time per character"},ignoreJids:{label:"Ignore Jids",placeholder:"Add JIDs ex: 1234567890@s.whatsapp.net and press enter"}},button:{create:"Dify",save:"Save",saving:"Saving...",update:"Update",defaultSettings:"Default Settings",delete:"Delete"},modal:{defaultSettings:{title:"Default Settings"}}},mie={title:"n8n",sessions:{label:"Sessions",search:"Search for remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Push Name",sessionId:"Session ID",status:"Status",actions:{title:"Actions",open:"Open",pause:"Pause",close:"Close",delete:"Delete"},none:"Nothing to show"}},defaultSettings:"Default Settings",toast:{defaultSettings:{success:"Default settings applied successfully",error:"An error occurred while applying the default settings"},success:{update:"n8n updated successfully",create:"n8n created successfully",delete:"n8n deleted successfully",status:"n8n status updated successfully"},error:"An error occurred while creating the n8n chatbot"},table:{none:"Nothing to show"},form:{title:"New n8n chatbot",examples:{keywordFinish:"#FINISH",unknownMessage:"I'm sorry, I didn't understand. Can you try again?"},enabled:{label:"Enabled"},description:{label:"Description"},n8nSettings:{label:"n8n Settings"},webhookUrl:{label:"Webhook URL"},basicAuth:{label:"Basic Auth (Optional)"},basicAuthUser:{label:"Basic Auth User"},basicAuthPass:{label:"Basic Auth Password"},triggerSettings:{label:"Trigger Settings"},triggerType:{label:"Trigger Type",keyword:"Keyword",all:"All",advanced:"Advanced",none:"None"},triggerOperator:{label:"Trigger Operator",contains:"Contains",equals:"Equals",startsWith:"Starts With",endsWith:"Ends With",regex:"Regex"},triggerValue:{label:"Trigger"},triggerConditions:{label:"Conditions"},n8nIdFallback:{label:"n8n Fallback"},generalSettings:{label:"General Settings"},expire:{label:"Expire in minutes"},keywordFinish:{label:"Keyword Finish"},delayMessage:{label:"Default Delay Message"},unknownMessage:{label:"Unknown Message"},listeningFromMe:{label:"Listening from me",description:"Listen to messages sent by me on the bot"},stopBotFromMe:{label:"Stop bot from me",description:"Pause the bot when I send a message"},keepOpen:{label:"Keep open",description:"Keep the bot open after the conversation ends"},debounceTime:{label:"Debounce Time"},splitMessages:{label:"Split Messages",description:"Split messages into multiple messages"},timePerChar:{label:"Time per character"},ignoreJids:{label:"Ignore Jids",placeholder:"Add JIDs ex: 1234567890@s.whatsapp.net and press enter"}},button:{create:"n8n",save:"Save",saving:"Saving...",update:"Update",defaultSettings:"Default Settings",delete:"Delete"},modal:{defaultSettings:{title:"Default Settings"}}},gie={title:"EvoAI",sessions:{label:"Sessions",search:"Search for remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Push Name",sessionId:"Session ID",status:"Status",actions:{title:"Actions",open:"Open",pause:"Pause",close:"Close",delete:"Delete"},none:"Nothing to show"}},defaultSettings:"Default Settings",toast:{defaultSettings:{success:"Default settings applied successfully",error:"An error occurred while applying the default settings"},success:{update:"EvoAI updated successfully",create:"EvoAI created successfully",delete:"EvoAI deleted successfully",status:"EvoAI status updated successfully"},error:"An error occurred while creating the EvoAI chatbot"},table:{none:"Nothing to show"},form:{title:"New EvoAI chatbot",examples:{keywordFinish:"#FINISH",unknownMessage:"I'm sorry, I didn't understand. Can you try again?"},enabled:{label:"Enabled"},description:{label:"Description"},evoaiSettings:{label:"EvoAI Settings"},agentUrl:{label:"Agent URL"},apiKey:{label:"API Key (Optional)"},triggerSettings:{label:"Trigger Settings"},triggerType:{label:"Trigger Type",keyword:"Keyword",all:"All",advanced:"Advanced",none:"None"},triggerOperator:{label:"Trigger Operator",contains:"Contains",equals:"Equals",startsWith:"Starts With",endsWith:"Ends With",regex:"Regex"},triggerValue:{label:"Trigger"},triggerConditions:{label:"Conditions"},evoaiIdFallback:{label:"EvoAI Fallback"},generalSettings:{label:"General Settings"},expire:{label:"Expire in minutes"},keywordFinish:{label:"Keyword Finish"},delayMessage:{label:"Default Delay Message"},unknownMessage:{label:"Unknown Message"},listeningFromMe:{label:"Listening from me",description:"Listen to messages sent by me on the bot"},stopBotFromMe:{label:"Stop bot from me",description:"Pause the bot when I send a message"},keepOpen:{label:"Keep open",description:"Keep the bot open after the conversation ends"},debounceTime:{label:"Debounce Time"},splitMessages:{label:"Split Messages",description:"Split messages into multiple messages"},timePerChar:{label:"Time per character"},ignoreJids:{label:"Ignore Jids",placeholder:"Add JIDs ex: 1234567890@s.whatsapp.net and press enter"}},button:{create:"EvoAI",save:"Save",saving:"Saving...",update:"Update",defaultSettings:"Default Settings",delete:"Delete"},modal:{defaultSettings:{title:"Default Settings"}}},vie={title:"Evolution Bot",sessions:{label:"Sessions",search:"Search for remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Push Name",sessionId:"Session ID",status:"Status",actions:{title:"Actions",open:"Open",pause:"Pause",close:"Close",delete:"Delete"},none:"Nothing to show"}},defaultSettings:"Default Settings",toast:{defaultSettings:{success:"Default settings applied successfully",error:"An error occurred while applying the default settings"},success:{update:"Evolution Bot updated successfully",create:"Evolution Bot created successfully",delete:"Evolution Bot deleted successfully",status:"Evolution Bot status updated successfully"},error:"An error occurred while creating the Evolution Bot"},table:{none:"Nothing to show"},form:{title:"New Evolution Bot",examples:{keywordFinish:"#FINISH",unknownMessage:"I'm sorry, I didn't understand. Can you try again?"},enabled:{label:"Enabled"},description:{label:"Description"},evolutionBotSettings:{label:"Evolution Bot Settings"},apiUrl:{label:"API URL"},apiKey:{label:"API Key"},triggerSettings:{label:"Trigger Settings"},triggerType:{label:"Trigger Type",keyword:"Keyword",all:"All",advanced:"Advanced",none:"None"},triggerOperator:{label:"Trigger Operator",contains:"Contains",equals:"Equals",startsWith:"Starts With",endsWith:"Ends With",regex:"Regex"},triggerValue:{label:"Trigger"},triggerConditions:{label:"Conditions"},botIdFallback:{label:"Evolution Bot Fallback"},generalSettings:{label:"General Settings"},expire:{label:"Expire in minutes"},keywordFinish:{label:"Keyword Finish"},delayMessage:{label:"Default Delay Message"},unknownMessage:{label:"Unknown Message"},listeningFromMe:{label:"Listening from me",description:"Listen to messages sent by me on the bot"},stopBotFromMe:{label:"Stop bot from me",description:"Pause the bot when I send a message"},keepOpen:{label:"Keep open",description:"Keep the bot open after the conversation ends"},debounceTime:{label:"Debounce Time"},splitMessages:{label:"Split Messages",description:"Split messages into multiple messages"},timePerChar:{label:"Time per character"},ignoreJids:{label:"Ignore Jids",placeholder:"Add JIDs ex: 1234567890@s.whatsapp.net and press enter"}},button:{create:"Evolution Bot",save:"Save",saving:"Saving...",update:"Update",defaultSettings:"Default Settings",delete:"Delete"},modal:{defaultSettings:{title:"Default Settings"}}},yie={title:"Flowise",sessions:{label:"Sessions",search:"Search for remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Push Name",sessionId:"Session ID",status:"Status",actions:{title:"Actions",open:"Open",pause:"Pause",close:"Close",delete:"Delete"},none:"Nothing to show"}},defaultSettings:"Default Settings",toast:{defaultSettings:{success:"Default settings applied successfully",error:"An error occurred while applying the default settings"},success:{update:"Flowise updated successfully",create:"Flowise created successfully",delete:"Flowise deleted successfully",status:"Flowise status updated successfully"},error:"An error occurred while creating the Flowise"},table:{none:"Nothing to show"},form:{title:"New Flowise",examples:{keywordFinish:"#FINISH",unknownMessage:"I'm sorry, I didn't understand. Can you try again?"},enabled:{label:"Enabled"},description:{label:"Description"},flowiseSettings:{label:"Flowise Settings"},apiUrl:{label:"API URL"},apiKey:{label:"API Key"},triggerSettings:{label:"Trigger Settings"},triggerType:{label:"Trigger Type",keyword:"Keyword",all:"All",advanced:"Advanced",none:"None"},triggerOperator:{label:"Trigger Operator",contains:"Contains",equals:"Equals",startsWith:"Starts With",endsWith:"Ends With",regex:"Regex"},triggerValue:{label:"Trigger"},triggerConditions:{label:"Conditions"},flowiseIdFallback:{label:"Flowise Fallback"},generalSettings:{label:"General Settings"},expire:{label:"Expire in minutes"},keywordFinish:{label:"Keyword Finish"},delayMessage:{label:"Default Delay Message"},unknownMessage:{label:"Unknown Message"},listeningFromMe:{label:"Listening from me",description:"Listen to messages sent by me on the bot"},stopBotFromMe:{label:"Stop bot from me",description:"Pause the bot when I send a message"},keepOpen:{label:"Keep open",description:"Keep the bot open after the conversation ends"},debounceTime:{label:"Debounce Time"},splitMessages:{label:"Split Messages",description:"Split messages into multiple messages"},timePerChar:{label:"Time per character"},ignoreJids:{label:"Ignore Jids",placeholder:"Add JIDs ex: 1234567890@s.whatsapp.net and press enter"}},button:{create:"Flowise",save:"Save",saving:"Saving...",update:"Update",defaultSettings:"Default Settings",delete:"Delete"},modal:{defaultSettings:{title:"Default Settings"}}},bie={search:"Search..."},xie={title:"Send Message",description:"Send a text message from the instance",validation:{numberRequired:"Number is required",messageRequired:"Message is required"},form:{number:{label:"Number (with country code)"},message:{label:"Message",placeholder:"Type your message..."}},button:{send:"Send",sending:"Sending..."},toast:{success:"Message sent successfully",error:"Error sending message",noToken:"Instance token not available"}},wie={title:"Connect via QR Code",description:"Scan the QR Code to connect the instance",generating:"Generating QR Code...",waiting:"Waiting for QR Code...",connected:{title:"Instance connected",description:"The {{instanceName}} instance is already connected",connectedAs:"Connected as"},pairingCode:{title:"Connect with pairing code",label:"Pairing code",generate:"Generate code",generating:"Generating...",hint:"Enter the number with country code (e.g. 5511999999999) to receive a pairing code"},howTo:{title:"How to connect:",step1:"Open WhatsApp on your phone",step2:"Tap Menu or Settings",step3:"Select Linked devices",step4:"Tap Link a device",step5:"Point your camera at the QR Code"},button:{refresh:"Refresh QR Code",refreshing:"Refreshing...",close:"Close"},toast:{pairingSuccess:"Pairing code generated",pairingError:"Error generating pairing code",refreshSuccess:"QR Code refreshed",refreshError:"Error refreshing QR Code"}},Sie={title:"New Instance",description:"Create a new instance to connect to WhatsApp",validation:{nameMin:"Name must be at least 3 characters",nameMax:"Name must be at most 50 characters",nameFormat:"Name can only contain letters, numbers, hyphens and underscores"},form:{name:{label:"Instance Name",placeholder:"my-instance",hint:"Use letters, numbers, hyphen (-) or underscore (_)"},token:{label:"Token (optional)",placeholder:"Leave blank to generate automatically",hint:"If not provided, a UUID will be generated automatically"}},proxy:{title:"Configure Proxy (optional)",host:{label:"Host",placeholder:"proxy.example.com"},port:{label:"Port"},username:{label:"Username",placeholder:"user"},password:{label:"Password",placeholder:"••••••••"}},button:{create:"Create Instance",creating:"Creating..."}},Cie={loading:"Loading...",noResults:"No results found!"},jie={dashboard:Hoe,button:Woe,testInteractive:Koe,sessions:Goe,modal:Joe,status:Qoe,footer:Yoe,header:Zoe,chat:Xoe,sidebar:eie,toast:tie,license:nie,login:rie,instance:sie,settings:aie,proxy:oie,webhook:iie,websocket:lie,rabbitmq:cie,sqs:uie,chatwoot:die,typebot:fie,openai:pie,dify:hie,n8n:mie,evoai:gie,evolutionBot:vie,flowise:yie,common:bie,sendMessage:xie,qrCode:wie,newInstance:Sie,table:Cie},kie={title:"Instancias",search:"Buscar",status:"Estado",settings:"Configuraciones",instancesNotFound:"No se encontraron instancias",subtitle:"Administre sus instancias de WhatsApp",card:{phone:"Número"},empty:{title:"No se encontraron instancias",description:"Cree su primera instancia para comenzar"}},Eie={delete:"Eliminar",deleting:"Eliminando...",cancel:"Cancelar",markAll:"Marcar Todos",unMarkAll:"Desmarcar Todos",refresh:"Actualizar"},Nie={title:"Probar mensajes interactivos",subtitle:"Instancia: {{instance}} ·",number:"Número de destino",numberHint:"Con código de país/área, solo dígitos (ej.: 5511999999999)",payload:"Payload JSON (editable)",send:"Enviar",sending:"Enviando...",requiresOpen:"Disponible solo con la instancia conectada",tabs:{reply:"Reply",cta:"CTA",pix:"PIX",list:"Lista",carousel:"Carrusel"},success:"Mensaje enviado (id {{id}})",errors:{missingNumber:"Indica el número de destino",invalidJson:"JSON inválido: {{message}}",unknown:"Error al enviar el mensaje"}},Tie={filters:{title:"Filtros avanzados",name:"Filtrar por nombre",namePlaceholder:"Filtrar por nombre",number:"Filtrar por número",numberPlaceholder:"Filtrar por número",status:"Filtrar por estado",time:"Filtrar por tiempo",apply:"Aplicar filtros",clear:"Limpiar",statusOptions:{all:"Todos los estados",opened:"Abierta",paused:"Pausada",closed:"Cerrada"},timeOptions:{5:"Últimos 5 minutos",10:"Últimos 10 minutos",15:"Últimos 15 minutos",20:"Últimos 20 minutos",30:"Últimos 30 minutos",60:"Últimos 60 minutos",all:"Cualquier momento",">60":"Más de 60 minutos",">120":"Más de 2 horas",">300":"Más de 5 horas",">1440":"Más de 24 horas",custom:"Personalizado"},custom:{more:"Más que",less:"Menos que",valuePlaceholder:"Valor",minutes:"Minutos",hours:"Horas",days:"Días"}},mass:{title:"Acciones masivas",selectAll:"Seleccionar todos",selected:"{{count}} seleccionada(s)",newStatus:"Nuevo estado",apply:"Aplicar a seleccionadas",noneSelected:"Selecciona al menos una sesión",success:"Estado actualizado en las sesiones seleccionadas",error:"Error al actualizar el estado en masa"},pagination:{showing:"Mostrando {{shown}} de {{total}}",perPage:"Por página",showMore:"Cargar más",showAll:"Mostrar todas",showLess:"Mostrar menos"},send:{title:"Enviar mensaje",to:"Para",messagePlaceholder:"Escribe tu mensaje",send:"Enviar",sending:"Enviando...",empty:"Escribe un mensaje antes de enviar",success:"Mensaje enviado correctamente",error:"Error al enviar el mensaje"},actions:{sendMessage:"Enviar mensaje"},empty:"No se encontraron sesiones"},Mie={delete:{title:"Eliminar Registro",message:"Estás eliminando la instancia {{instanceName}}. ¿Estás seguro de que deseas continuar?",messageSingle:"Esta acción no se puede deshacer.",confirm:"Escriba el nombre de la instancia para confirmar:"}},_ie={all:"Todos",open:"Conectado",connecting:"Conectando",closed:"Desconectado"},Pie={clientName:"Nombre del Cliente",version:"Versión"},Rie={theme:{label:"Cambiar Tema",light:"Claro",dark:"Oscuro",system:"Sistema"},language:{label:"Idioma",english:"Inglés",portuguese:"Portugués",spanish:"Español",french:"Francés"},logout:{action:"Salir",title:"¿Seguro que desea salir?",description:"Será desconectado y redirigido a la pantalla de inicio de sesión."}},Iie={dashboard:"Visión General",configurations:"Configuraciones",settings:"Comportamiento",proxy:"Proxy",events:"Eventos",webhook:"Webhook",websocket:"WebSocket",rabbitmq:"RabbitMQ",sqs:"SQS",integrations:"Integraciones",chatwoot:"Chatwoot",typebot:"Typebot",openai:"OpenAI",dify:"Dify",evoai:"EvoAI",n8n:"n8n",evolutionBot:"Bot Evolution",flowise:"Flowise",documentation:"Documentación",postman:"Postman",discord:"Discord"},Oie={instance:{created:"Instancia creada con éxito",deleted:"Instancia eliminada con éxito",error:"Ocurrió un error al crear la instancia"}},Aie={checking:"Verificando licencia...",required:"Licencia requerida",redirecting:"Redirigiendo al registro de licencia...",registerFailed:"Error al iniciar el registro de licencia",callback:{title:"Activando licencia",missingCode:"Código de autorización no encontrado en la URL",missingCredentials:"Credenciales no encontradas. Inicia sesión nuevamente.",activating:"Espera mientras activamos tu licencia.",successTitle:"¡Licencia activada!",successDescription:"Redirigiendo...",errorTitle:"Error en la activación",retry:"Intentar de nuevo",back:"Volver al inicio de sesión",genericError:"Error al activar la licencia"}},Die={title:"Evolution Manager",description:"Por favor, inicia sesión para continuar",form:{serverUrl:"URL del Servidor",apiKey:"Clave API Global"},message:{invalidServer:"Servidor inválido",invalidCredentials:"Credenciales inválidas"},button:{login:"Conectar",connecting:"Conectando..."},subtitle:"Ingrese sus credenciales para acceder al sistema"},Fie={modal:{title:"Nueva Instancia"},form:{name:"Nombre",integration:{label:"Canal",baileys:"Baileys",whatsapp:"WhatsApp Cloud API",facebook:"Facebook",instagram:"Instagram",evolution:"Evolution"},token:"Token",number:"Número",businessId:"Business ID"},button:{save:"Guardar",saving:"Guardando...",create:"Instancia",connecting:"Conectando...",facebook:"Conectar con Facebook",instagram:"Conectar con Instagram",whatsapp:"Conectar con WhatsApp"},dashboard:{button:{qrcode:{label:"Generar Código QR",title:"Escanea el Código QR con WhatsApp"},pairingCode:{label:"Generar Código de Emparejamiento",title:"Emparejar con WhatsApp"},restart:"Reiniciar",disconnect:"Desconectar",sendMessage:"Enviar mensaje"},alert:"Para conectar, escanea el Código QR con WhatsApp",contacts:"Contactos",chats:"Chats",messages:"Mensajes",subtitle:"Administre su instancia"}},Lie={title:"Comportamiento",toast:{success:"Comportamiento aplicado con éxito",error:"Ocurrió un error al aplicar el comportamiento"},form:{rejectCall:{label:"Rechazar Llamadas",description:"Rechazar todas las llamadas"},msgCall:{label:"Mensaje de Rechazo de Llamada",description:"Enviar mensaje de rechazo de llamada"},groupsIgnore:{label:"Ignorar Grupos",description:"Ignorar todos los mensajes de grupos"},alwaysOnline:{label:"Siempre Online",description:"Permanecer siempre en línea"},readMessages:{label:"Ver Mensajes",description:"Marcar todos los mensajes como leídos"},syncFullHistory:{label:"Sincronizar Historial Completo",description:"Sincronizar todo el historial al leer el Código QR"},readStatus:{label:"Ver Estado",description:"Marcar todos los estados como vistos"}},button:{save:"Guardar",saving:"Guardando..."}},$ie={title:"Proxy",toast:{success:"Proxy aplicado con éxito",error:"Ocurrió un error al aplicar el proxy"},form:{enabled:{label:"Activo",description:"Activar o desactivar el proxy"},protocol:{label:"Protocolo"},host:{label:"Host"},port:{label:"Puerto"},username:{label:"Usuario"},password:{label:"Contraseña"}},button:{save:"Guardar",saving:"Guardando..."}},Bie={title:"Webhook",toast:{success:"Webhook aplicado con éxito",error:"Ocurrió un error al aplicar el webhook"},form:{enabled:{label:"Activo",description:"Activar o desactivar el webhook"},url:{label:"URL"},byEvents:{label:"Webhook por Eventos",description:"Crear una ruta para cada evento agregando el nombre del evento al final de la URL"},base64:{label:"Webhook Base64",description:"Enviar datos de medios en base64 en el webhook"},events:{label:"Eventos"}},button:{save:"Guardar",saving:"Guardando..."}},zie={title:"WebSocket",toast:{success:"WebSocket aplicado con éxito",error:"Ocurrió un error al aplicar el WebSocket"},form:{enabled:{label:"Activo",description:"Activar o desactivar el WebSocket"},events:{label:"Eventos"}},button:{save:"Guardar",saving:"Guardando..."}},Uie={title:"RabbitMQ",toast:{success:"RabbitMQ aplicado con éxito",error:"Ocurrió un error al aplicar el RabbitMQ"},form:{enabled:{label:"Activo",description:"Activar o desactivar el RabbitMQ"},events:{label:"Eventos"}},button:{save:"Guardar",saving:"Guardando..."}},Vie={title:"SQS",toast:{success:"SQS aplicado con éxito",error:"Ocurrió un error al aplicar el SQS"},form:{enabled:{label:"Activo",description:"Activar o desactivar el SQS"},events:{label:"Eventos"}},button:{save:"Guardar",saving:"Guardando..."}},qie={title:"Chatwoot",toast:{success:"Chatwoot aplicado con éxito",error:"Ocurrió un error al aplicar el Chatwoot"},form:{enabled:{label:"Activo",description:"Activar o desactivar el Chatwoot"},url:{label:"URL de Chatwoot"},accountId:{label:"ID de la Cuenta"},token:{label:"Token"},signMsg:{label:"Firmar Mensajes",description:"Firmar mensajes con el nombre de usuario de Chatwoot"},signDelimiter:{label:"Delimitador de Firma"},nameInbox:{label:"Nombre de la Bandeja de Entrada"},organization:{label:"Organización"},logo:{label:"Logo"},conversationPending:{label:"Conversación Pendiente",description:"Las conversaciones comienzan como pendientes"},reopenConversation:{label:"Reabrir Conversación",description:"Reabrir la conversación al recibir un mensaje"},importContacts:{label:"Importar Contactos",description:"Importar contactos del libro de direcciones de WhatsApp al conectar el Código QR"},importMessages:{label:"Importar Mensajes",description:"Importar mensajes de WhatsApp al conectar el Código QR"},daysLimitImportMessages:{label:"Límite de Días para Importación de Mensajes"},ignoreJids:{label:"Ignorar JIDs",placeholder:"Agregar JIDs ej: 1234567890@s.whatsapp.net y presiona enter"},autoCreate:{label:"Creación Automática",description:"Crear automáticamente la integración con Chatwoot al guardar"}},button:{save:"Guardar",saving:"Guardando..."}},Hie={title:"Typebots",sessions:{label:"Sesiones",search:"Buscar por remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Nombre Visible",sessionId:"ID de Sesión",status:"Estado",actions:{title:"Acciones",open:"Abrir",pause:"Pausar",close:"Cerrar",delete:"Eliminar"},none:"Nada que mostrar"}},defaultSettings:"Configuraciones Predeterminadas",toast:{defaultSettings:{success:"Configuraciones predeterminadas aplicadas con éxito",error:"Ocurrió un error al aplicar las configuraciones predeterminadas"},success:{update:"Typebot actualizado con éxito",create:"Typebot creado con éxito",delete:"Typebot eliminado con éxito",status:"Estado de Typebot actualizado con éxito"},error:"Ocurrió un error al crear el Typebot"},table:{none:"Nada que mostrar"},form:{title:"Nuevo Typebot",examples:{keywordFinish:"#FINISH",unknownMessage:"Lo siento, no entendí. ¿Puedes intentar de nuevo?"},enabled:{label:"Activo"},description:{label:"Descripción"},typebotSettings:{label:"Configuraciones de Typebot"},url:{label:"URL de la API de Typebot"},typebot:{label:"Nombre Público de Typebot"},triggerSettings:{label:"Configuraciones de Disparador"},triggerType:{label:"Tipo de Disparador",keyword:"Palabra clave",all:"Todos",advanced:"Avanzado",none:"Ninguno"},triggerOperator:{label:"Operador de Disparador",contains:"Contiene",equals:"Igual",startsWith:"Comienza Con",endsWith:"Termina Con",regex:"Regex"},triggerValue:{label:"Disparador"},triggerConditions:{label:"Condiciones"},typebotIdFallback:{label:"Fallback de Typebot"},generalSettings:{label:"Configuraciones Generales"},expire:{label:"Expirar en minutos"},keywordFinish:{label:"Palabra clave de Finalización"},delayMessage:{label:"Mensaje de Retraso Predeterminado"},unknownMessage:{label:"Mensaje Desconocido"},listeningFromMe:{label:"Escuchando de mí",description:"Escuchar los mensajes enviados por mí en el bot"},stopBotFromMe:{label:"Detener bot por mí",description:"Pausar el bot cuando yo envíe un mensaje"},keepOpen:{label:"Mantener abierto",description:"Mantener el bot abierto después de que termine la conversación"},debounceTime:{label:"Tiempo de Debounce"},splitMessages:{label:"Dividir Mensajes",description:"Dividir mensajes largos en múltiples mensajes"},timePerChar:{label:"Tiempo por Carácter"},ignoreJids:{label:"Ignorar JIDs",placeholder:"Agregar JIDs ej: 1234567890@s.whatsapp.net y presiona enter"}},button:{create:"Typebot",save:"Guardar",saving:"Guardando...",update:"Actualizar",defaultSettings:"Configuraciones Predeterminadas",delete:"Eliminar"},modal:{defaultSettings:{title:"Configuraciones Predeterminadas"}}},Wie={title:"OpenAI",sessions:{label:"Sesiones",search:"Buscar por remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Nombre Visible",sessionId:"ID de Sesión",status:"Estado",actions:{title:"Acciones",open:"Abrir",pause:"Pausar",close:"Cerrar",delete:"Eliminar"},none:"Nada que mostrar"}},credentials:{title:"Credenciales",table:{name:"Nombre",apiKey:"Clave API",actions:{title:"Acciones",delete:"Eliminar"},none:"Nada que mostrar"}},defaultSettings:"Configuraciones Predeterminadas",toast:{defaultSettings:{success:"Configuraciones predeterminadas aplicadas con éxito",error:"Ocurrió un error al aplicar las configuraciones predeterminadas"},success:{update:"OpenAI actualizado con éxito",create:"OpenAI creado con éxito",delete:"OpenAI eliminado con éxito",status:"Estado de OpenAI actualizado con éxito",credentialsCreate:"Credenciales de OpenAI creadas con éxito",credentialsDelete:"Credenciales de OpenAI eliminadas con éxito"},error:"Ocurrió un error al crear el OpenAI"},table:{none:"Nada que mostrar"},form:{title:"Nuevo OpenAI",examples:{keywordFinish:"#FINISH",unknownMessage:"Lo siento, no entendí. ¿Puedes intentar de nuevo?"},openaiCredsId:{label:"Credenciales de OpenAI"},enabled:{label:"Activo"},description:{label:"Descripción"},openaiSettings:{label:"Configuraciones de OpenAI"},botType:{label:"Tipo de Bot",assistant:"Asistente",chatCompletion:"Chat Completion"},assistantId:{label:"ID del Asistente"},functionUrl:{label:"URL de la Función"},model:{label:"Modelo de Lenguaje"},systemMessages:{label:"Mensajes del Sistema",description:"Enviar mensajes del sistema a OpenAI"},assistantMessages:{label:"Mensajes del Asistente",description:"Enviar mensajes del asistente a OpenAI"},userMessages:{label:"Mensajes del Usuario",description:"Enviar mensajes del usuario a OpenAI"},maxTokens:{label:"Máximo de Tokens"},triggerSettings:{label:"Configuraciones de Disparador"},triggerType:{label:"Tipo de Disparador",keyword:"Palabra clave",all:"Todos",advanced:"Avanzado",none:"Ninguno"},triggerOperator:{label:"Operador de Disparador",contains:"Contiene",equals:"Igual",startsWith:"Comienza Con",endsWith:"Termina Con",regex:"Regex"},triggerValue:{label:"Disparador"},triggerConditions:{label:"Condiciones"},openaiIdFallback:{label:"Fallback de OpenAI"},generalSettings:{label:"Configuraciones Generales"},expire:{label:"Expirar en minutos"},keywordFinish:{label:"Palabra clave de Finalización"},delayMessage:{label:"Mensaje de Retraso Predeterminado"},unknownMessage:{label:"Mensaje Desconocido"},listeningFromMe:{label:"Escuchando de mí",description:"Escuchar los mensajes enviados por mí en el bot"},stopBotFromMe:{label:"Detener bot por mí",description:"Pausar el bot cuando yo envíe un mensaje"},keepOpen:{label:"Mantener abierto",description:"Mantener el bot abierto después de que termine la conversación"},speechToText:{label:"Voz a Texto",description:"Convertir mensajes de voz en texto"},debounceTime:{label:"Tiempo de Debounce"},splitMessages:{label:"Dividir Mensajes",description:"Dividir mensajes largos en múltiples mensajes"},timePerChar:{label:"Tiempo por Carácter"},ignoreJids:{label:"Ignorar JIDs",placeholder:"Agregar JIDs ej: 1234567890@s.whatsapp.net y presiona enter"}},button:{create:"OpenAI",save:"Guardar",saving:"Guardando...",update:"Actualizar",defaultSettings:"Configuraciones Predeterminadas",delete:"Eliminar",loadModels:"Cargar Modelos",loading:"Cargando..."},modal:{defaultSettings:{title:"Configuraciones Predeterminadas"}}},Kie={title:"Dify",sessions:{label:"Sesiones",search:"Buscar por remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Nombre Visible",sessionId:"ID de Sesión",status:"Estado",actions:{title:"Acciones",open:"Abrir",pause:"Pausar",close:"Cerrar",delete:"Eliminar"},none:"Nada que mostrar"}},defaultSettings:"Configuraciones Predeterminadas",toast:{defaultSettings:{success:"Configuraciones predeterminadas aplicadas con éxito",error:"Ocurrió un error al aplicar las configuraciones predeterminadas"},success:{update:"Dify actualizado con éxito",create:"Dify creado con éxito",delete:"Dify eliminado con éxito",status:"Estado de Dify actualizado con éxito"},error:"Ocurrió un error al crear el Dify"},table:{none:"Nada que mostrar"},form:{title:"Nuevo Dify",examples:{keywordFinish:"#FINISH",unknownMessage:"Lo siento, no entendí. ¿Puedes intentar de nuevo?"},enabled:{label:"Activo"},description:{label:"Descripción"},difySettings:{label:"Configuraciones de Dify"},botType:{label:"Tipo de Bot",chatBot:"Chat Bot",textGenerator:"Generador de Texto",agent:"Agente",workflow:"Flujo de Trabajo"},apiUrl:{label:"URL de la API"},apiKey:{label:"Clave API"},triggerSettings:{label:"Configuraciones de Disparador"},triggerType:{label:"Tipo de Disparador",keyword:"Palabra clave",all:"Todos",advanced:"Avanzado",none:"Ninguno"},triggerOperator:{label:"Operador de Disparador",contains:"Contiene",equals:"Igual",startsWith:"Comienza Con",endsWith:"Termina Con",regex:"Regex"},triggerValue:{label:"Disparador"},triggerConditions:{label:"Condiciones"},difyIdFallback:{label:"Fallback de Dify"},generalSettings:{label:"Configuraciones Generales"},expire:{label:"Expirar en minutos"},keywordFinish:{label:"Palabra clave de Finalización"},delayMessage:{label:"Mensaje de Retraso Predeterminado"},unknownMessage:{label:"Mensaje Desconocido"},listeningFromMe:{label:"Escuchando de mí",description:"Escuchar los mensajes enviados por mí en el bot"},stopBotFromMe:{label:"Detener bot por mí",description:"Pausar el bot cuando yo envíe un mensaje"},keepOpen:{label:"Mantener abierto",description:"Mantener el bot abierto después de que termine la conversación"},debounceTime:{label:"Tiempo de Debounce"},splitMessages:{label:"Dividir Mensajes",description:"Dividir mensajes largos en múltiples mensajes"},timePerChar:{label:"Tiempo por Carácter"},ignoreJids:{label:"Ignorar JIDs",placeholder:"Agregar JIDs ej: 1234567890@s.whatsapp.net y presiona enter"}},button:{create:"Dify",save:"Guardar",saving:"Guardando...",update:"Actualizar",defaultSettings:"Configuraciones Predeterminadas",delete:"Eliminar"},modal:{defaultSettings:{title:"Configuraciones Predeterminadas"}}},Gie={title:"n8n",sessions:{label:"Sesiones",search:"Buscar por remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Push Name",sessionId:"Session ID",status:"Estado",actions:{title:"Acciones",open:"Abrir",pause:"Pausar",close:"Cerrar",delete:"Eliminar"},none:"Nada que mostrar"}},defaultSettings:"Configuraciones Predeterminadas",toast:{defaultSettings:{success:"Configuraciones predeterminadas aplicadas con éxito",error:"Ocurrió un error al aplicar las configuraciones predeterminadas"},success:{update:"n8n actualizado con éxito",create:"n8n creado con éxito",delete:"n8n eliminado con éxito",status:"Estado de n8n actualizado con éxito"},error:"Ocurrió un error al crear el chatbot n8n"},table:{none:"Nada que mostrar"},form:{title:"Nuevo chatbot n8n",examples:{keywordFinish:"#FINISH",unknownMessage:"Lo siento, no entendí. ¿Puedes intentar de nuevo?"},enabled:{label:"Activo"},description:{label:"Descripción"},n8nSettings:{label:"Configuraciones de n8n"},webhookUrl:{label:"URL del Webhook"},basicAuth:{label:"Basic Auth (Opcional)"},basicAuthUser:{label:"Basic Auth User"},basicAuthPass:{label:"Basic Auth Password"},triggerSettings:{label:"Configuraciones de Disparador"},triggerType:{label:"Tipo de Disparador",keyword:"Palabra clave",all:"Todos",advanced:"Avanzado",none:"Ninguno"},triggerOperator:{label:"Operador de Disparador",contains:"Contiene",equals:"Igual",startsWith:"Comienza Con",endsWith:"Termina Con",regex:"Regex"},triggerValue:{label:"Disparador"},triggerConditions:{label:"Condiciones"},n8nIdFallback:{label:"Fallback de n8n"},generalSettings:{label:"Configuraciones Generales"},expire:{label:"Expirar en minutos"},keywordFinish:{label:"Palabra clave de Finalización"},delayMessage:{label:"Mensaje de Retraso Predeterminado"},unknownMessage:{label:"Mensaje Desconocido"},listeningFromMe:{label:"Escuchando de mí",description:"Escuchar los mensajes enviados por mí en el bot"},stopBotFromMe:{label:"Detener bot por mí",description:"Pausar el bot cuando yo envíe un mensaje"},keepOpen:{label:"Mantener abierto",description:"Mantener el bot abierto después de que termine la conversación"},debounceTime:{label:"Tiempo de Debounce"},splitMessages:{label:"Dividir Mensajes",description:"Dividir mensajes en múltiples mensajes"},timePerChar:{label:"Tiempo por carácter"},ignoreJids:{label:"Ignorar JIDs",placeholder:"Agregar JIDs ej: 1234567890@s.whatsapp.net y presiona enter"}},button:{create:"n8n",save:"Guardar",saving:"Guardando...",update:"Actualizar",defaultSettings:"Configuraciones Predeterminadas",delete:"Eliminar"},modal:{defaultSettings:{title:"Configuraciones Predeterminadas"}}},Jie={title:"EvoAI",sessions:{label:"Sesiones",search:"Buscar por remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Push Name",sessionId:"Session ID",status:"Estado",actions:{title:"Acciones",open:"Abrir",pause:"Pausar",close:"Cerrar",delete:"Eliminar"},none:"Nada que mostrar"}},defaultSettings:"Configuraciones Predeterminadas",toast:{defaultSettings:{success:"Configuraciones predeterminadas aplicadas con éxito",error:"Ocurrió un error al aplicar las configuraciones predeterminadas"},success:{update:"EvoAI actualizado con éxito",create:"EvoAI creado con éxito",delete:"EvoAI eliminado con éxito",status:"Estado de EvoAI actualizado con éxito"},error:"Ocurrió un error al crear el chatbot EvoAI"},table:{none:"Nada que mostrar"},form:{title:"Nuevo chatbot EvoAI",examples:{keywordFinish:"#FINISH",unknownMessage:"Lo siento, no entendí. ¿Puedes intentar de nuevo?"},enabled:{label:"Activo"},description:{label:"Descripción"},evoaiSettings:{label:"Configuraciones de EvoAI"},agentUrl:{label:"URL del Agente"},apiKey:{label:"API Key (Opcional)"},triggerSettings:{label:"Configuraciones de Disparador"},triggerType:{label:"Tipo de Disparador",keyword:"Palabra clave",all:"Todos",advanced:"Avanzado",none:"Ninguno"},triggerOperator:{label:"Operador de Disparador",contains:"Contiene",equals:"Igual",startsWith:"Comienza Con",endsWith:"Termina Con",regex:"Regex"},triggerValue:{label:"Disparador"},triggerConditions:{label:"Condiciones"},evoaiIdFallback:{label:"Fallback de EvoAI"},generalSettings:{label:"Configuraciones Generales"},expire:{label:"Expirar en minutos"},keywordFinish:{label:"Palabra clave de Finalización"},delayMessage:{label:"Mensaje de Retraso Predeterminado"},unknownMessage:{label:"Mensaje Desconocido"},listeningFromMe:{label:"Escuchando de mí",description:"Escuchar los mensajes enviados por mí en el bot"},stopBotFromMe:{label:"Detener bot por mí",description:"Pausar el bot cuando yo envíe un mensaje"},keepOpen:{label:"Mantener abierto",description:"Mantener el bot abierto después de que termine la conversación"},debounceTime:{label:"Tiempo de Debounce"},splitMessages:{label:"Dividir Mensajes",description:"Dividir mensajes en múltiples mensajes"},timePerChar:{label:"Tiempo por carácter"},ignoreJids:{label:"Ignorar JIDs",placeholder:"Agregar JIDs ej: 1234567890@s.whatsapp.net y presiona enter"}},button:{create:"EvoAI",save:"Guardar",saving:"Guardando...",update:"Actualizar",defaultSettings:"Configuraciones Predeterminadas",delete:"Eliminar"},modal:{defaultSettings:{title:"Configuraciones Predeterminadas"}}},Qie={title:"Bot Evolution",sessions:{label:"Sesiones",search:"Buscar por remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Nombre Visible",sessionId:"ID de Sesión",status:"Estado",actions:{title:"Acciones",open:"Abrir",pause:"Pausar",close:"Cerrar",delete:"Eliminar"},none:"Nada que mostrar"}},defaultSettings:"Configuraciones Predeterminadas",toast:{defaultSettings:{success:"Configuraciones predeterminadas aplicadas con éxito",error:"Ocurrió un error al aplicar las configuraciones predeterminadas"},success:{update:"Bot Evolution actualizado con éxito",create:"Bot Evolution creado con éxito",delete:"Bot Evolution eliminado con éxito",status:"Estado de Bot Evolution actualizado con éxito"},error:"Ocurrió un error al crear el Bot Evolution"},table:{none:"Nada que mostrar"},form:{title:"Nuevo Bot Evolution",examples:{keywordFinish:"#FINISH",unknownMessage:"Lo siento, no entendí. ¿Puedes intentar de nuevo?"},enabled:{label:"Activo"},description:{label:"Descripción"},evolutionBotSettings:{label:"Configuraciones de Bot Evolution"},apiUrl:{label:"URL de la API"},apiKey:{label:"Clave API"},triggerSettings:{label:"Configuraciones de Disparador"},triggerType:{label:"Tipo de Disparador",keyword:"Palabra clave",all:"Todos",advanced:"Avanzado",none:"Ninguno"},triggerOperator:{label:"Operador de Disparador",contains:"Contiene",equals:"Igual",startsWith:"Comienza Con",endsWith:"Termina Con",regex:"Regex"},triggerValue:{label:"Disparador"},triggerConditions:{label:"Condiciones"},botIdFallback:{label:"Fallback de Bot Evolution"},generalSettings:{label:"Configuraciones Generales"},expire:{label:"Expirar en minutos"},keywordFinish:{label:"Palabra clave de Finalización"},delayMessage:{label:"Mensaje de Retraso Predeterminado"},unknownMessage:{label:"Mensaje Desconocido"},listeningFromMe:{label:"Escuchando de mí",description:"Escuchar los mensajes enviados por mí en el bot"},stopBotFromMe:{label:"Detener bot por mí",description:"Pausar el bot cuando yo envíe un mensaje"},keepOpen:{label:"Mantener abierto",description:"Mantener el bot abierto después de que termine la conversación"},debounceTime:{label:"Tiempo de Debounce"},splitMessages:{label:"Dividir Mensajes",description:"Dividir mensajes largos en múltiples mensajes"},timePerChar:{label:"Tiempo por Carácter"},ignoreJids:{label:"Ignorar JIDs",placeholder:"Agregar JIDs ej: 1234567890@s.whatsapp.net y presiona enter"}},button:{create:"Bot Evolution",save:"Guardar",saving:"Guardando...",update:"Actualizar",defaultSettings:"Configuraciones Predeterminadas",delete:"Eliminar"},modal:{defaultSettings:{title:"Configuraciones Predeterminadas"}}},Yie={title:"Flowise",sessions:{label:"Sesiones",search:"Buscar por remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Nombre Visible",sessionId:"ID de Sesión",status:"Estado",actions:{title:"Acciones",open:"Abrir",pause:"Pausar",close:"Cerrar",delete:"Eliminar"},none:"Nada que mostrar"}},defaultSettings:"Configuraciones Predeterminadas",toast:{defaultSettings:{success:"Configuraciones predeterminadas aplicadas con éxito",error:"Ocurrió un error al aplicar las configuraciones predeterminadas"},success:{update:"Flowise actualizado con éxito",create:"Flowise creado con éxito",delete:"Flowise eliminado con éxito",status:"Estado de Flowise actualizado con éxito"},error:"Ocurrió un error al crear el Flowise"},table:{none:"Nada que mostrar"},form:{title:"Nuevo Flowise",examples:{keywordFinish:"#FINISH",unknownMessage:"Lo siento, no entendí. ¿Puedes intentar de nuevo?"},enabled:{label:"Activo"},description:{label:"Descripción"},flowiseSettings:{label:"Configuraciones de Flowise"},apiUrl:{label:"URL de la API"},apiKey:{label:"Clave API"},triggerSettings:{label:"Configuraciones de Disparador"},triggerType:{label:"Tipo de Disparador",keyword:"Palabra clave",all:"Todos",advanced:"Avanzado",none:"Ninguno"},triggerOperator:{label:"Operador de Disparador",contains:"Contiene",equals:"Igual",startsWith:"Comienza Con",endsWith:"Termina Con",regex:"Regex"},triggerValue:{label:"Disparador"},triggerConditions:{label:"Condiciones"},flowiseIdFallback:{label:"Fallback de Flowise"},generalSettings:{label:"Configuraciones Generales"},expire:{label:"Expirar en minutos"},keywordFinish:{label:"Palabra clave de Finalización"},delayMessage:{label:"Mensaje de Retraso Predeterminado"},unknownMessage:{label:"Mensaje Desconocido"},listeningFromMe:{label:"Escuchando de mí",description:"Escuchar los mensajes enviados por mí en el bot"},stopBotFromMe:{label:"Detener bot por mí",description:"Pausar el bot cuando yo envíe un mensaje"},keepOpen:{label:"Mantener abierto",description:"Mantener el bot abierto después de que termine la conversación"},debounceTime:{label:"Tiempo de Debounce"},splitMessages:{label:"Dividir Mensajes",description:"Dividir mensajes largos en múltiples mensajes"},timePerChar:{label:"Tiempo por Carácter"},ignoreJids:{label:"Ignorar JIDs",placeholder:"Agregar JIDs ej: 1234567890@s.whatsapp.net y presiona enter"}},button:{create:"Flowise",save:"Guardar",saving:"Guardando...",update:"Actualizar",defaultSettings:"Configuraciones Predeterminadas",delete:"Eliminar"},modal:{defaultSettings:{title:"Configuraciones Predeterminadas"}}},Zie={search:"Buscar conversaciones...",back:"Volver",tabs:{contacts:"Contactos",groups:"Grupos"},count_one:"{{count}} conversación",count_other:"{{count}} conversaciones",empty:{default:"Aún no hay conversaciones",search:"No se encontraron conversaciones",tryAnother:"Intente otro término",selectTitle:"Seleccione una conversación",selectDescription:"Elija un contacto o grupo de la lista para comenzar"},input:{placeholder:"Escriba un mensaje...",send:"Enviar"},date:{today:"Hoy",yesterday:"Ayer"}},Xie={search:"Buscar..."},ele={title:"Enviar Mensaje",description:"Envíe un mensaje de texto desde la instancia",validation:{numberRequired:"El número es obligatorio",messageRequired:"El mensaje es obligatorio"},form:{number:{label:"Número (con código de país)"},message:{label:"Mensaje",placeholder:"Escriba su mensaje..."}},button:{send:"Enviar",sending:"Enviando..."},toast:{success:"Mensaje enviado con éxito",error:"Error al enviar el mensaje",noToken:"Token de instancia no disponible"}},tle={title:"Conectar con código QR",description:"Escanee el código QR para conectar la instancia",generating:"Generando código QR...",waiting:"Esperando código QR...",connected:{title:"Instancia conectada",description:"La instancia {{instanceName}} ya está conectada",connectedAs:"Conectado como"},pairingCode:{title:"Conectar con código de emparejamiento",label:"Código de emparejamiento",generate:"Generar código",generating:"Generando...",hint:"Ingrese el número con código de país (ej: 5511999999999) para recibir un código de emparejamiento"},howTo:{title:"Cómo conectar:",step1:"Abra WhatsApp en su teléfono",step2:"Toque Menú o Ajustes",step3:"Seleccione Dispositivos vinculados",step4:"Toque Vincular un dispositivo",step5:"Apunte su cámara al código QR"},button:{refresh:"Actualizar código QR",refreshing:"Actualizando...",close:"Cerrar"},toast:{pairingSuccess:"Código de emparejamiento generado",pairingError:"Error al generar el código de emparejamiento",refreshSuccess:"Código QR actualizado",refreshError:"Error al actualizar el código QR"}},nle={title:"Nueva Instancia",description:"Cree una nueva instancia para conectar con WhatsApp",validation:{nameMin:"El nombre debe tener al menos 3 caracteres",nameMax:"El nombre debe tener como máximo 50 caracteres",nameFormat:"El nombre solo puede contener letras, números, guiones y guiones bajos"},form:{name:{label:"Nombre de la Instancia",placeholder:"mi-instancia",hint:"Use letras, números, guion (-) o guion bajo (_)"},token:{label:"Token (opcional)",placeholder:"Deje en blanco para generar automáticamente",hint:"Si no se proporciona, se generará un UUID automáticamente"}},proxy:{title:"Configurar Proxy (opcional)",host:{label:"Host",placeholder:"proxy.ejemplo.com"},port:{label:"Puerto"},username:{label:"Usuario",placeholder:"usuario"},password:{label:"Contraseña",placeholder:"••••••••"}},button:{create:"Crear Instancia",creating:"Creando..."}},rle={loading:"Cargando...",noResults:"¡Ningún resultado encontrado!"},sle={dashboard:kie,button:Eie,testInteractive:Nie,sessions:Tie,modal:Mie,status:_ie,footer:Pie,header:Rie,sidebar:Iie,toast:Oie,license:Aie,login:Die,instance:Fie,settings:Lie,proxy:$ie,webhook:Bie,websocket:zie,rabbitmq:Uie,sqs:Vie,chatwoot:qie,typebot:Hie,openai:Wie,dify:Kie,n8n:Gie,evoai:Jie,evolutionBot:Qie,flowise:Yie,chat:Zie,common:Xie,sendMessage:ele,qrCode:tle,newInstance:nle,table:rle},ale={title:"Instances",search:"Rechercher",status:"Statut",settings:"Paramètres",instancesNotFound:"Aucune instance trouvée",subtitle:"Gérez vos instances WhatsApp",card:{phone:"Numéro"},empty:{title:"Aucune instance trouvée",description:"Créez votre première instance pour commencer"}},ole={delete:"Supprimer",deleting:"Suppression...",cancel:"Annuler",markAll:"Marquer Tous",unMarkAll:"Démarquer Tous",refresh:"Actualiser"},ile={title:"Tester les messages interactifs",subtitle:"Instance : {{instance}} ·",number:"Numéro de destination",numberHint:"Avec indicatif pays/zone, chiffres uniquement (ex. : 5511999999999)",payload:"Payload JSON (modifiable)",send:"Envoyer",sending:"Envoi...",requiresOpen:"Disponible uniquement lorsque l'instance est connectée",tabs:{reply:"Reply",cta:"CTA",pix:"PIX",list:"Liste",carousel:"Carrousel"},success:"Message envoyé (id {{id}})",errors:{missingNumber:"Indiquez le numéro de destination",invalidJson:"JSON invalide : {{message}}",unknown:"Échec de l'envoi du message"}},lle={filters:{title:"Filtres avancés",name:"Filtrer par nom",namePlaceholder:"Filtrer par nom",number:"Filtrer par numéro",numberPlaceholder:"Filtrer par numéro",status:"Filtrer par statut",time:"Filtrer par temps",apply:"Appliquer les filtres",clear:"Effacer",statusOptions:{all:"Tous les statuts",opened:"Ouverte",paused:"En pause",closed:"Fermée"},timeOptions:{5:"Dernières 5 minutes",10:"Dernières 10 minutes",15:"Dernières 15 minutes",20:"Dernières 20 minutes",30:"Dernières 30 minutes",60:"Dernières 60 minutes",all:"À tout moment",">60":"Plus de 60 minutes",">120":"Plus de 2 heures",">300":"Plus de 5 heures",">1440":"Plus de 24 heures",custom:"Personnalisé"},custom:{more:"Plus que",less:"Moins que",valuePlaceholder:"Valeur",minutes:"Minutes",hours:"Heures",days:"Jours"}},mass:{title:"Actions en masse",selectAll:"Sélectionner tout",selected:"{{count}} sélectionnée(s)",newStatus:"Nouveau statut",apply:"Appliquer aux sélectionnées",noneSelected:"Sélectionnez au moins une session",success:"Statut mis à jour pour les sessions sélectionnées",error:"Échec de la mise à jour du statut en masse"},pagination:{showing:"Affichage de {{shown}} sur {{total}}",perPage:"Par page",showMore:"Charger plus",showAll:"Tout afficher",showLess:"Afficher moins"},send:{title:"Envoyer un message",to:"À",messagePlaceholder:"Tapez votre message",send:"Envoyer",sending:"Envoi...",empty:"Tapez un message avant d'envoyer",success:"Message envoyé avec succès",error:"Échec de l'envoi du message"},actions:{sendMessage:"Envoyer un message"},empty:"Aucune session trouvée"},cle={delete:{title:"Supprimer l'Enregistrement",message:"Vous êtes en train de supprimer l'instance {{instanceName}}. Êtes-vous sûr de vouloir continuer ?",messageSingle:"Cette action est irréversible.",confirm:"Tapez le nom de l'instance pour confirmer:"}},ule={all:"Tous",open:"Connecté",connecting:"Connexion",closed:"Déconnecté"},dle={clientName:"Nom du Client",version:"Version"},fle={theme:{label:"Changer de Thème",light:"Clair",dark:"Sombre",system:"Système"},language:{label:"Langue",english:"Anglais",portuguese:"Portugais",french:"Français"},logout:{action:"Déconnexion",title:"Êtes-vous sûr de vouloir vous déconnecter ?",description:"Vous serez déconnecté et redirigé vers l'écran de connexion."}},ple={dashboard:"Vue d'ensemble",configurations:"Configurations",settings:"Comportement",proxy:"Proxy",events:"Evenements",webhook:"Webhook",websocket:"WebSocket",rabbitmq:"RabbitMQ",sqs:"SQS",integrations:"Intégrations",chatwoot:"Chatwoot",typebot:"Typebot",openai:"OpenAI",dify:"Dify",evoai:"EvoAI",n8n:"n8n",evolutionBot:"Bot Evolution",flowise:"Flowise",documentation:"Documentation",postman:"Postman",discord:"Discord"},hle={instance:{created:"Instance créée avec succès",deleted:"Instance supprimée avec succès",error:"Une erreur est survenue lors de la création de l'instance"}},mle={checking:"Vérification de la licence...",required:"Licence requise",redirecting:"Redirection vers l'enregistrement de la licence...",registerFailed:"Échec du démarrage de l'enregistrement de la licence",callback:{title:"Activation de la licence",missingCode:"Code d'autorisation introuvable dans l'URL",missingCredentials:"Identifiants introuvables. Veuillez vous reconnecter.",activating:"Veuillez patienter pendant l'activation de votre licence.",successTitle:"Licence activée !",successDescription:"Redirection...",errorTitle:"Erreur d'activation",retry:"Réessayer",back:"Retour à la connexion",genericError:"Échec de l'activation de la licence"}},gle={title:"Evolution Manager",description:"Veuillez vous connecter pour continuer",form:{serverUrl:"URL du Serveur",apiKey:"Clé API Globale"},message:{invalidServer:"Serveur invalide",invalidCredentials:"Identifiants invalides"},button:{login:"Se connecter",connecting:"Connexion..."},subtitle:"Entrez vos identifiants pour accéder au système"},vle={modal:{title:"Nouvelle Instance"},form:{name:"Nom",integration:{label:"Canal",baileys:"Baileys",whatsapp:"WhatsApp Cloud API",facebook:"Facebook",instagram:"Instagram",evolution:"Evolution"},token:"Token",number:"Numéro",businessId:"ID de l'Entreprise"},button:{save:"Enregistrer",saving:"Enregistrement...",create:"Instance",connecting:"Connexion...",facebook:"Se connecter avec Facebook",instagram:"Se connecter avec Instagram",whatsapp:"Se connecter avec WhatsApp"},dashboard:{button:{qrcode:{label:"Générer un Code QR",title:"Scannez le Code QR avec WhatsApp"},pairingCode:{label:"Générer un Code d'Appairage",title:"Appairez avec WhatsApp"},restart:"Redémarrer",disconnect:"Déconnecter",sendMessage:"Envoyer un message"},alert:"Pour vous connecter, scannez le Code QR avec WhatsApp",contacts:"Contacts",chats:"Chats",messages:"Messages",subtitle:"Gérez votre instance"}},yle={title:"Comportement",toast:{success:"Comportement appliqué avec succès",error:"Une erreur est survenue lors de l'application du comportement"},form:{rejectCall:{label:"Rejeter les Appels",description:"Rejeter tous les appels"},msgCall:{label:"Message de Rejet d'Appel",description:"Envoyer un message de rejet d'appel"},groupsIgnore:{label:"Ignorer les Groupes",description:"Ignorer tous les messages de groupes"},alwaysOnline:{label:"Toujours En Ligne",description:"Rester toujours en ligne"},readMessages:{label:"Lire les Messages",description:"Marquer tous les messages comme lus"},syncFullHistory:{label:"Synchroniser l'Historique Complet",description:"Synchroniser l'historique complet lors de la lecture du Code QR"},readStatus:{label:"Lire le Statut",description:"Marquer tous les statuts comme vus"}},button:{save:"Enregistrer",saving:"Enregistrement..."}},ble={title:"Proxy",toast:{success:"Proxy appliqué avec succès",error:"Une erreur est survenue lors de l'application du proxy"},form:{enabled:{label:"Activé",description:"Activer ou désactiver le proxy"},protocol:{label:"Protocole"},host:{label:"Hôte"},port:{label:"Port"},username:{label:"Utilisateur"},password:{label:"Mot de passe"}},button:{save:"Enregistrer",saving:"Enregistrement..."}},xle={title:"Webhook",toast:{success:"Webhook appliqué avec succès",error:"Une erreur est survenue lors de l'application du webhook"},form:{enabled:{label:"Activé",description:"Activer ou désactiver le webhook"},url:{label:"URL"},byEvents:{label:"Webhook par Événements",description:"Créer une route pour chaque événement en ajoutant le nom de l'événement à la fin de l'URL"},base64:{label:"Webhook Base64",description:"Envoyer des données médias en base64 dans le webhook"},events:{label:"Événements"}},button:{save:"Enregistrer",saving:"Enregistrement..."}},wle={title:"WebSocket",toast:{success:"WebSocket appliqué avec succès",error:"Une erreur est survenue lors de l'application du WebSocket"},form:{enabled:{label:"Activé",description:"Activer ou désactiver le WebSocket"},events:{label:"Événements"}},button:{save:"Enregistrer",saving:"Enregistrement..."}},Sle={title:"RabbitMQ",toast:{success:"RabbitMQ appliqué avec succès",error:"Une erreur est survenue lors de l'application de RabbitMQ"},form:{enabled:{label:"Activé",description:"Activer ou désactiver RabbitMQ"},events:{label:"Événements"}},button:{save:"Enregistrer",saving:"Enregistrement..."}},Cle={title:"SQS",toast:{success:"SQS appliqué avec succès",error:"Une erreur est survenue lors de l'application de SQS"},form:{enabled:{label:"Activé",description:"Activer ou désactiver SQS"},events:{label:"Événements"}},button:{save:"Enregistrer",saving:"Enregistrement..."}},jle={title:"Chatwoot",toast:{success:"Chatwoot appliqué avec succès",error:"Une erreur est survenue lors de l'application de Chatwoot"},form:{enabled:{label:"Activé",description:"Activer ou désactiver Chatwoot"},url:{label:"URL de Chatwoot"},accountId:{label:"ID du Compte"},token:{label:"Token"},signMsg:{label:"Signer les Messages",description:"Signer les messages avec le nom d'utilisateur Chatwoot"},signDelimiter:{label:"Délimiteur de Signature"},nameInbox:{label:"Nom de la Boîte de Réception"},organization:{label:"Organisation"},logo:{label:"Logo"},conversationPending:{label:"Conversation en Attente",description:"Les conversations commencent en attente"},reopenConversation:{label:"Rouvrir la Conversation",description:"Rouvrir la conversation lors de la réception d'un message"},importContacts:{label:"Importer les Contacts",description:"Importer les contacts du carnet d'adresses WhatsApp en scannant le Code QR"},importMessages:{label:"Importer les Messages",description:"Importer les messages WhatsApp en scannant le Code QR"},daysLimitImportMessages:{label:"Limite de Jours pour l'Importation de Messages"},ignoreJids:{label:"Ignorer les JIDs",placeholder:"Ajouter des JIDs ex: 1234567890@s.whatsapp.net et appuyez sur entrer"},autoCreate:{label:"Création Automatique",description:"Créer automatiquement l'intégration Chatwoot lors de l'enregistrement"}},button:{save:"Enregistrer",saving:"Enregistrement..."}},kle={title:"Typebots",sessions:{label:"Sessions",search:"Rechercher par remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Nom d'Affichage",sessionId:"ID de Session",status:"Statut",actions:{title:"Actions",open:"Ouvrir",pause:"Pause",close:"Fermer",delete:"Supprimer"},none:"Rien à afficher"}},defaultSettings:"Paramètres par Défaut",toast:{defaultSettings:{success:"Paramètres par défaut appliqués avec succès",error:"Une erreur est survenue lors de l'application des paramètres par défaut"},success:{update:"Typebot mis à jour avec succès",create:"Typebot créé avec succès",delete:"Typebot supprimé avec succès",status:"Statut de Typebot mis à jour avec succès"},error:"Une erreur est survenue lors de la création du Typebot"},table:{none:"Rien à afficher"},form:{title:"Nouveau Typebot",examples:{keywordFinish:"#FINISH",unknownMessage:"Désolé, je n'ai pas compris. Pouvez-vous réessayer ?"},enabled:{label:"Activé"},description:{label:"Description"},typebotSettings:{label:"Paramètres de Typebot"},url:{label:"URL de l'API de Typebot"},typebot:{label:"Nom Public de Typebot"},triggerSettings:{label:"Paramètres de Déclencheur"},triggerType:{label:"Type de Déclencheur",keyword:"Mot-clé",all:"Tous",advanced:"Avancé",none:"Aucun"},triggerOperator:{label:"Opérateur de Déclencheur",contains:"Contient",equals:"Égal",startsWith:"Commence Par",endsWith:"Se Termine Par",regex:"Regex"},triggerValue:{label:"Déclencheur"},triggerConditions:{label:"Conditions"},typebotIdFallback:{label:"Fallback de Typebot"},generalSettings:{label:"Paramètres Généraux"},expire:{label:"Expirer en minutes"},keywordFinish:{label:"Mot-clé de Fin"},delayMessage:{label:"Message de Délai par Défaut"},unknownMessage:{label:"Message Inconnu"},listeningFromMe:{label:"Écouter de Moi",description:"Écouter les messages envoyés par moi sur le bot"},stopBotFromMe:{label:"Arrêter le Bot de Moi",description:"Mettre en pause le bot quand j'envoie un message"},keepOpen:{label:"Garder Ouvert",description:"Garder le bot ouvert après la fin de la conversation"},debounceTime:{label:"Temps de Déclenchement"},splitMessages:{label:"Diviser les Messages",description:"Diviser les messages en plusieurs messages"},timePerChar:{label:"Temps par Caractère"},ignoreJids:{label:"Ignorer les JIDs",placeholder:"Ajouter des JIDs ex: 1234567890@s.whatsapp.net et appuyez sur entrer"}},button:{create:"Typebot",save:"Enregistrer",saving:"Enregistrement...",update:"Mettre à jour",defaultSettings:"Paramètres par Défaut",delete:"Supprimer"},modal:{defaultSettings:{title:"Paramètres par Défaut"}}},Ele={title:"OpenAI",sessions:{label:"Sessions",search:"Rechercher par remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Nom d'Affichage",sessionId:"ID de Session",status:"Statut",actions:{title:"Actions",open:"Ouvrir",pause:"Pause",close:"Fermer",delete:"Supprimer"},none:"Rien à afficher"}},credentials:{title:"Identifiants",table:{name:"Nom",apiKey:"Clé API",actions:{title:"Actions",delete:"Supprimer"},none:"Rien à afficher"}},defaultSettings:"Paramètres par Défaut",toast:{defaultSettings:{success:"Paramètres par défaut appliqués avec succès",error:"Une erreur est survenue lors de l'application des paramètres par défaut"},success:{update:"OpenAI mis à jour avec succès",create:"OpenAI créé avec succès",delete:"OpenAI supprimé avec succès",status:"Statut de OpenAI mis à jour avec succès",credentialsCreate:"Identifiants OpenAI créés avec succès",credentialsDelete:"Identifiants OpenAI supprimés avec succès"},error:"Une erreur est survenue lors de la création de OpenAI"},table:{none:"Rien à afficher"},form:{title:"Nouveau OpenAI",examples:{keywordFinish:"#FINISH",unknownMessage:"Désolé, je n'ai pas compris. Pouvez-vous réessayer ?"},openaiCredsId:{label:"Identifiants OpenAI"},enabled:{label:"Activé"},description:{label:"Description"},openaiSettings:{label:"Paramètres OpenAI"},botType:{label:"Type de Bot",assistant:"Assistant",chatCompletion:"Chat Completion"},assistantId:{label:"ID de l'Assistant"},functionUrl:{label:"URL de la Fonction"},model:{label:"Modèle de Langage"},systemMessages:{label:"Messages Système",description:"Envoyer des messages système à OpenAI"},assistantMessages:{label:"Messages de l'Assistant",description:"Envoyer des messages de l'assistant à OpenAI"},userMessages:{label:"Messages de l'Utilisateur",description:"Envoyer des messages de l'utilisateur à OpenAI"},maxTokens:{label:"Nombre Maximum de Tokens"},triggerSettings:{label:"Paramètres de Déclencheur"},triggerType:{label:"Type de Déclencheur",keyword:"Mot-clé",all:"Tous",advanced:"Avancé",none:"Aucun"},triggerOperator:{label:"Opérateur de Déclencheur",contains:"Contient",equals:"Égal",startsWith:"Commence Par",endsWith:"Se Termine Par",regex:"Regex"},triggerValue:{label:"Déclencheur"},triggerConditions:{label:"Conditions"},openaiIdFallback:{label:"Fallback de OpenAI"},generalSettings:{label:"Paramètres Généraux"},expire:{label:"Expirer en minutes"},keywordFinish:{label:"Mot-clé de Fin"},delayMessage:{label:"Message de Délai par Défaut"},unknownMessage:{label:"Message Inconnu"},listeningFromMe:{label:"Écouter de Moi",description:"Écouter les messages envoyés par moi sur le bot"},stopBotFromMe:{label:"Arrêter le Bot de Moi",description:"Mettre en pause le bot quand j'envoie un message"},keepOpen:{label:"Garder Ouvert",description:"Garder le bot ouvert après la fin de la conversation"},speechToText:{label:"Parole en Texte",description:"Convertir les messages vocaux en texte"},debounceTime:{label:"Temps de Déclenchement"},splitMessages:{label:"Diviser les Messages",description:"Diviser les messages en plusieurs messages"},timePerChar:{label:"Temps par Caractère"},ignoreJids:{label:"Ignorer les JIDs",placeholder:"Ajouter des JIDs ex: 1234567890@s.whatsapp.net et appuyez sur entrer"}},button:{create:"OpenAI",save:"Enregistrer",saving:"Enregistrement...",update:"Mettre à jour",defaultSettings:"Paramètres par Défaut",delete:"Supprimer",loadModels:"Charger les Modèles",loading:"Chargement..."},modal:{defaultSettings:{title:"Paramètres par Défaut"}}},Nle={title:"Dify",sessions:{label:"Sessions",search:"Rechercher par remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Nom d'Affichage",sessionId:"ID de Session",status:"Statut",actions:{title:"Actions",open:"Ouvrir",pause:"Pause",close:"Fermer",delete:"Supprimer"},none:"Rien à afficher"}},defaultSettings:"Paramètres par Défaut",toast:{defaultSettings:{success:"Paramètres par défaut appliqués avec succès",error:"Une erreur est survenue lors de l'application des paramètres par défaut"},success:{update:"Dify mis à jour avec succès",create:"Dify créé avec succès",delete:"Dify supprimé avec succès",status:"Statut de Dify mis à jour avec succès"},error:"Une erreur est survenue lors de la création de Dify"},table:{none:"Rien à afficher"},form:{title:"Nouveau Dify",examples:{keywordFinish:"#FINISH",unknownMessage:"Désolé, je n'ai pas compris. Pouvez-vous réessayer ?"},enabled:{label:"Activé"},description:{label:"Description"},difySettings:{label:"Paramètres de Dify"},botType:{label:"Type de Bot",chatBot:"Chat Bot",textGenerator:"Générateur de Texte",agent:"Agent",workflow:"Flux de Travail"},apiUrl:{label:"URL de l'API"},apiKey:{label:"Clé API"},triggerSettings:{label:"Paramètres de Déclencheur"},triggerType:{label:"Type de Déclencheur",keyword:"Mot-clé",all:"Tous",advanced:"Avancé",none:"Aucun"},triggerOperator:{label:"Opérateur de Déclencheur",contains:"Contient",equals:"Égal",startsWith:"Commence Par",endsWith:"Se Termine Par",regex:"Regex"},triggerValue:{label:"Déclencheur"},triggerConditions:{label:"Conditions"},difyIdFallback:{label:"Fallback de Dify"},generalSettings:{label:"Paramètres Généraux"},expire:{label:"Expirer en minutes"},keywordFinish:{label:"Mot-clé de Fin"},delayMessage:{label:"Message de Délai par Défaut"},unknownMessage:{label:"Message Inconnu"},listeningFromMe:{label:"Écouter de Moi",description:"Écouter les messages envoyés par moi sur le bot"},stopBotFromMe:{label:"Arrêter le Bot de Moi",description:"Mettre en pause le bot quand j'envoie un message"},keepOpen:{label:"Garder Ouvert",description:"Garder le bot ouvert après la fin de la conversation"},debounceTime:{label:"Temps de Déclenchement"},splitMessages:{label:"Diviser les Messages",description:"Diviser les messages en plusieurs messages"},timePerChar:{label:"Temps par Caractère"},ignoreJids:{label:"Ignorer les JIDs",placeholder:"Ajouter des JIDs ex: 1234567890@s.whatsapp.net et appuyez sur entrer"}},button:{create:"Dify",save:"Enregistrer",saving:"Enregistrement...",update:"Mettre à jour",defaultSettings:"Paramètres par Défaut",delete:"Supprimer"},modal:{defaultSettings:{title:"Paramètres par Défaut"}}},Tle={title:"n8n",sessions:{label:"Sessions",search:"Rechercher par remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Push Name",sessionId:"Session ID",status:"Statut",actions:{title:"Actions",open:"Ouvrir",pause:"Pause",close:"Fermer",delete:"Supprimer"},none:"Rien à afficher"}},defaultSettings:"Paramètres par défaut",toast:{defaultSettings:{success:"Paramètres par défaut appliqués avec succès",error:"Une erreur s'est produite lors de l'application des paramètres par défaut"},success:{update:"n8n mis à jour avec succès",create:"n8n créé avec succès",delete:"n8n supprimé avec succès",status:"Statut de n8n mis à jour avec succès"},error:"Une erreur s'est produite lors de la création du chatbot n8n"},table:{none:"Rien à afficher"},form:{title:"Nouveau chatbot n8n",examples:{keywordFinish:"#FINISH",unknownMessage:"Désolé, je n'ai pas compris. Pouvez-vous réessayer ?"},enabled:{label:"Activé"},description:{label:"Description"},n8nSettings:{label:"Paramètres n8n"},webhookUrl:{label:"URL du Webhook"},basicAuth:{label:"Basic Auth (Optionnel)"},basicAuthUser:{label:"Basic Auth User"},basicAuthPass:{label:"Basic Auth Password"},triggerSettings:{label:"Paramètres du déclencheur"},triggerType:{label:"Type de déclencheur",keyword:"Mot-clé",all:"Tous",advanced:"Avancé",none:"Aucun"},triggerOperator:{label:"Opérateur de déclencheur",contains:"Contient",equals:"Égal",startsWith:"Commence par",endsWith:"Se termine par",regex:"Regex"},triggerValue:{label:"Déclencheur"},triggerConditions:{label:"Conditions"},n8nIdFallback:{label:"Fallback n8n"},generalSettings:{label:"Paramètres généraux"},expire:{label:"Expire en minutes"},keywordFinish:{label:"Mot-clé de fin"},delayMessage:{label:"Message de délai par défaut"},unknownMessage:{label:"Message inconnu"},listeningFromMe:{label:"Écouter mes messages",description:"Écouter les messages envoyés par moi sur le bot"},stopBotFromMe:{label:"Arrêter le bot de ma part",description:"Mettre en pause le bot lorsque j'envoie un message"},keepOpen:{label:"Maintenir ouvert",description:"Maintenir le bot ouvert après la fin de la conversation"},debounceTime:{label:"Temps de debounce"},splitMessages:{label:"Diviser les messages",description:"Diviser les messages en plusieurs messages"},timePerChar:{label:"Temps par caractère"},ignoreJids:{label:"Ignorer les JIDs",placeholder:"Ajouter des JIDs ex: 1234567890@s.whatsapp.net et appuyer sur entrée"}},button:{create:"n8n",save:"Enregistrer",saving:"Enregistrement...",update:"Mettre à jour",defaultSettings:"Paramètres par défaut",delete:"Supprimer"},modal:{defaultSettings:{title:"Paramètres par défaut"}}},Mle={title:"EvoAI",sessions:{label:"Sessions",search:"Rechercher par remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Push Name",sessionId:"Session ID",status:"Statut",actions:{title:"Actions",open:"Ouvrir",pause:"Pause",close:"Fermer",delete:"Supprimer"},none:"Rien à afficher"}},defaultSettings:"Paramètres par défaut",toast:{defaultSettings:{success:"Paramètres par défaut appliqués avec succès",error:"Une erreur s'est produite lors de l'application des paramètres par défaut"},success:{update:"EvoAI mis à jour avec succès",create:"EvoAI créé avec succès",delete:"EvoAI supprimé avec succès",status:"Statut de EvoAI mis à jour avec succès"},error:"Une erreur s'est produite lors de la création du chatbot EvoAI"},table:{none:"Rien à afficher"},form:{title:"Nouveau chatbot EvoAI",examples:{keywordFinish:"#FINISH",unknownMessage:"Désolé, je n'ai pas compris. Pouvez-vous réessayer ?"},enabled:{label:"Activé"},description:{label:"Description"},evoaiSettings:{label:"Paramètres EvoAI"},agentUrl:{label:"URL de l'agent"},apiKey:{label:"API Key (Optionnel)"},triggerSettings:{label:"Paramètres du déclencheur"},triggerType:{label:"Type de déclencheur",keyword:"Mot-clé",all:"Tous",advanced:"Avancé",none:"Aucun"},triggerOperator:{label:"Opérateur de déclencheur",contains:"Contient",equals:"Égal",startsWith:"Commence par",endsWith:"Se termine par",regex:"Regex"},triggerValue:{label:"Déclencheur"},triggerConditions:{label:"Conditions"},evoaiIdFallback:{label:"Fallback EvoAI"},generalSettings:{label:"Paramètres généraux"},expire:{label:"Expire en minutes"},keywordFinish:{label:"Mot-clé de fin"},delayMessage:{label:"Message de délai par défaut"},unknownMessage:{label:"Message inconnu"},listeningFromMe:{label:"Écouter mes messages",description:"Écouter les messages envoyés par moi sur le bot"},stopBotFromMe:{label:"Arrêter le bot de ma part",description:"Mettre en pause le bot lorsque j'envoie un message"},keepOpen:{label:"Maintenir ouvert",description:"Maintenir le bot ouvert après la fin de la conversation"},debounceTime:{label:"Temps de debounce"},splitMessages:{label:"Diviser les messages",description:"Diviser les messages en plusieurs messages"},timePerChar:{label:"Temps par caractère"},ignoreJids:{label:"Ignorer les JIDs",placeholder:"Ajouter des JIDs ex: 1234567890@s.whatsapp.net et appuyer sur entrée"}},button:{create:"EvoAI",save:"Enregistrer",saving:"Enregistrement...",update:"Mettre à jour",defaultSettings:"Paramètres par défaut",delete:"Supprimer"},modal:{defaultSettings:{title:"Paramètres par défaut"}}},_le={title:"Bots Evolution",sessions:{label:"Sessions",search:"Rechercher par remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Nom d'Affichage",sessionId:"ID de Session",status:"Statut",actions:{title:"Actions",open:"Ouvrir",pause:"Pause",close:"Fermer",delete:"Supprimer"},none:"Rien à afficher"}},defaultSettings:"Paramètres par Défaut",toast:{defaultSettings:{success:"Paramètres par défaut appliqués avec succès",error:"Une erreur est survenue lors de l'application des paramètres par défaut"},success:{update:"Bots Evolution mis à jour avec succès",create:"Bots Evolution créé avec succès",delete:"Bots Evolution supprimé avec succès",status:"Statut de Bots Evolution mis à jour avec succès"},error:"Une erreur est survenue lors de la création de Bots Evolution"},table:{none:"Rien à afficher"},form:{title:"Nouveau Bots Evolution",examples:{keywordFinish:"#FINISH",unknownMessage:"Désolé, je n'ai pas compris. Pouvez-vous réessayer ?"},enabled:{label:"Activé"},description:{label:"Description"},evolutionBotSettings:{label:"Paramètres de Bots Evolution"},apiUrl:{label:"URL de l'API"},apiKey:{label:"Clé API"},triggerSettings:{label:"Paramètres de Déclencheur"},triggerType:{label:"Type de Déclencheur",keyword:"Mot-clé",all:"Tous",advanced:"Avancé",none:"Aucun"},triggerOperator:{label:"Opérateur de Déclencheur",contains:"Contient",equals:"Égal",startsWith:"Commence Par",endsWith:"Se Termine Par",regex:"Regex"},triggerValue:{label:"Déclencheur"},triggerConditions:{label:"Conditions"},botIdFallback:{label:"Fallback de Bots Evolution"},generalSettings:{label:"Paramètres Généraux"},expire:{label:"Expirer en minutes"},keywordFinish:{label:"Mot-clé de Fin"},delayMessage:{label:"Message de Délai par Défaut"},unknownMessage:{label:"Message Inconnu"},listeningFromMe:{label:"Écouter de Moi",description:"Écouter les messages envoyés par moi sur le bot"},stopBotFromMe:{label:"Arrêter le Bot de Moi",description:"Mettre en pause le bot quand j'envoie un message"},keepOpen:{label:"Garder Ouvert",description:"Garder le bot ouvert après la fin de la conversation"},debounceTime:{label:"Temps de Déclenchement"},splitMessages:{label:"Diviser les Messages",description:"Diviser les messages en plusieurs messages"},timePerChar:{label:"Temps par Caractère"},ignoreJids:{label:"Ignorer les JIDs",placeholder:"Ajouter des JIDs ex: 1234567890@s.whatsapp.net et appuyez sur entrer"}},button:{create:"Bots Evolution",save:"Enregistrer",saving:"Enregistrement...",update:"Mettre à jour",defaultSettings:"Paramètres par Défaut",delete:"Supprimer"},modal:{defaultSettings:{title:"Paramètres par Défaut"}}},Ple={title:"Flowise",sessions:{label:"Sessions",search:"Rechercher par remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Nom d'Affichage",sessionId:"ID de Session",status:"Statut",actions:{title:"Actions",open:"Ouvrir",pause:"Pause",close:"Fermer",delete:"Supprimer"},none:"Rien à afficher"}},defaultSettings:"Paramètres par Défaut",toast:{defaultSettings:{success:"Paramètres par défaut appliqués avec succès",error:"Une erreur est survenue lors de l'application des paramètres par défaut"},success:{update:"Flowise mis à jour avec succès",create:"Flowise créé avec succès",delete:"Flowise supprimé avec succès",status:"Statut de Flowise mis à jour avec succès"},error:"Une erreur est survenue lors de la création de Flowise"},table:{none:"Rien à afficher"},form:{title:"Nouveau Flowise",examples:{keywordFinish:"#FINISH",unknownMessage:"Désolé, je n'ai pas compris. Pouvez-vous réessayer ?"},enabled:{label:"Activé"},description:{label:"Description"},flowiseSettings:{label:"Paramètres de Flowise"},apiUrl:{label:"URL de l'API"},apiKey:{label:"Clé API"},triggerSettings:{label:"Paramètres de Déclencheur"},triggerType:{label:"Type de Déclencheur",keyword:"Mot-clé",all:"Tous",advanced:"Avancé",none:"Aucun"},triggerOperator:{label:"Opérateur de Déclencheur",contains:"Contient",equals:"Égal",startsWith:"Commence Par",endsWith:"Se Termine Par",regex:"Regex"},triggerValue:{label:"Déclencheur"},triggerConditions:{label:"Conditions"},flowiseIdFallback:{label:"Fallback de Flowise"},generalSettings:{label:"Paramètres Généraux"},expire:{label:"Expirer en minutes"},keywordFinish:{label:"Mot-clé de Fin"},delayMessage:{label:"Message de Délai par Défaut"},unknownMessage:{label:"Message Inconnu"},listeningFromMe:{label:"Écouter de Moi",description:"Écouter les messages envoyés par moi sur le bot"},stopBotFromMe:{label:"Arrêter le Bot de Moi",description:"Mettre en pause le bot quand j'envoie un message"},keepOpen:{label:"Garder Ouvert",description:"Garder le bot ouvert après la fin de la conversation"},debounceTime:{label:"Temps de Déclenchement"},splitMessages:{label:"Diviser les Messages",description:"Diviser les messages en plusieurs messages"},timePerChar:{label:"Temps par Caractère"},ignoreJids:{label:"Ignorer les JIDs",placeholder:"Ajouter des JIDs ex: 1234567890@s.whatsapp.net et appuyez sur entrer"}},button:{create:"Flowise",save:"Enregistrer",saving:"Enregistrement...",update:"Mettre à jour",defaultSettings:"Paramètres par Défaut",delete:"Supprimer"},modal:{defaultSettings:{title:"Paramètres par Défaut"}}},Rle={search:"Rechercher des conversations...",back:"Retour",tabs:{contacts:"Contacts",groups:"Groupes"},count_one:"{{count}} conversation",count_other:"{{count}} conversations",empty:{default:"Aucune conversation pour le moment",search:"Aucune conversation trouvée",tryAnother:"Essayez un autre terme",selectTitle:"Sélectionnez une conversation",selectDescription:"Choisissez un contact ou un groupe dans la liste pour commencer"},input:{placeholder:"Tapez un message...",send:"Envoyer"},date:{today:"Aujourd'hui",yesterday:"Hier"}},Ile={search:"Rechercher..."},Ole={title:"Envoyer un Message",description:"Envoyez un message texte depuis l'instance",validation:{numberRequired:"Le numéro est obligatoire",messageRequired:"Le message est obligatoire"},form:{number:{label:"Numéro (avec indicatif pays)"},message:{label:"Message",placeholder:"Saisissez votre message..."}},button:{send:"Envoyer",sending:"Envoi..."},toast:{success:"Message envoyé avec succès",error:"Erreur lors de l'envoi du message",noToken:"Jeton d'instance non disponible"}},Ale={title:"Connecter via QR Code",description:"Scannez le QR Code pour connecter l'instance",generating:"Génération du QR Code...",waiting:"En attente du QR Code...",connected:{title:"Instance connectée",description:"L'instance {{instanceName}} est déjà connectée",connectedAs:"Connecté en tant que"},pairingCode:{title:"Connecter avec code de jumelage",label:"Code de jumelage",generate:"Générer le code",generating:"Génération...",hint:"Entrez le numéro avec indicatif pays (ex: 5511999999999) pour recevoir un code de jumelage"},howTo:{title:"Comment se connecter :",step1:"Ouvrez WhatsApp sur votre téléphone",step2:"Appuyez sur Menu ou Paramètres",step3:"Sélectionnez Appareils connectés",step4:"Appuyez sur Connecter un appareil",step5:"Pointez votre caméra sur le QR Code"},button:{refresh:"Actualiser le QR Code",refreshing:"Actualisation...",close:"Fermer"},toast:{pairingSuccess:"Code de jumelage généré",pairingError:"Erreur lors de la génération du code de jumelage",refreshSuccess:"QR Code actualisé",refreshError:"Erreur lors de l'actualisation du QR Code"}},Dle={title:"Nouvelle Instance",description:"Créez une nouvelle instance pour vous connecter à WhatsApp",validation:{nameMin:"Le nom doit contenir au moins 3 caractères",nameMax:"Le nom doit contenir au maximum 50 caractères",nameFormat:"Le nom ne peut contenir que des lettres, chiffres, tirets et underscores"},form:{name:{label:"Nom de l'Instance",placeholder:"mon-instance",hint:"Utilisez des lettres, chiffres, tiret (-) ou underscore (_)"},token:{label:"Jeton (optionnel)",placeholder:"Laissez vide pour générer automatiquement",hint:"Si non fourni, un UUID sera généré automatiquement"}},proxy:{title:"Configurer Proxy (optionnel)",host:{label:"Hôte",placeholder:"proxy.exemple.com"},port:{label:"Port"},username:{label:"Utilisateur",placeholder:"utilisateur"},password:{label:"Mot de passe",placeholder:"••••••••"}},button:{create:"Créer l'Instance",creating:"Création..."}},Fle={loading:"Chargement...",noResults:"Aucun résultat trouvé !"},Lle={dashboard:ale,button:ole,testInteractive:ile,sessions:lle,modal:cle,status:ule,footer:dle,header:fle,sidebar:ple,toast:hle,license:mle,login:gle,instance:vle,settings:yle,proxy:ble,webhook:xle,websocket:wle,rabbitmq:Sle,sqs:Cle,chatwoot:jle,typebot:kle,openai:Ele,dify:Nle,n8n:Tle,evoai:Mle,evolutionBot:_le,flowise:Ple,chat:Rle,common:Ile,sendMessage:Ole,qrCode:Ale,newInstance:Dle,table:Fle},$le={title:"Instâncias",subtitle:"Gerencie suas instâncias WhatsApp",search:"Pesquisar",status:"Status",settings:"Configurações",instancesNotFound:"Nenhuma instância encontrada",card:{phone:"Número"},empty:{title:"Nenhuma instância encontrada",description:"Crie sua primeira instância para começar"}},Ble={delete:"Excluir",deleting:"Excluindo...",cancel:"Cancelar",refresh:"Atualizar",markAll:"Marcar Todos",unMarkAll:"Desmarcar Todos"},zle={title:"Testar mensagens interativas",subtitle:"Instância: {{instance}} ·",number:"Número de destino",numberHint:"Com DDI/DDD, somente dígitos (ex.: 5511999999999)",payload:"Payload JSON (editável)",send:"Enviar",sending:"Enviando...",requiresOpen:"Disponível apenas com a instância conectada",tabs:{reply:"Reply",cta:"CTA",pix:"PIX",list:"Lista",carousel:"Carrossel"},success:"Mensagem enviada (id {{id}})",errors:{missingNumber:"Informe o número de destino",invalidJson:"JSON inválido: {{message}}",unknown:"Falha ao enviar a mensagem"}},Ule={filters:{title:"Filtros avançados",name:"Filtrar por nome",namePlaceholder:"Filtrar por nome",number:"Filtrar por número",numberPlaceholder:"Filtrar por número",status:"Filtrar por status",time:"Filtrar por tempo",apply:"Aplicar filtros",clear:"Limpar",statusOptions:{all:"Todos os status",opened:"Aberta",paused:"Pausada",closed:"Fechada"},timeOptions:{5:"Últimos 5 minutos",10:"Últimos 10 minutos",15:"Últimos 15 minutos",20:"Últimos 20 minutos",30:"Últimos 30 minutos",60:"Últimos 60 minutos",all:"Qualquer momento",">60":"Mais de 60 minutos",">120":"Mais de 2 horas",">300":"Mais de 5 horas",">1440":"Mais de 24 horas",custom:"Personalizado"},custom:{more:"Mais que",less:"Menos que",valuePlaceholder:"Valor",minutes:"Minutos",hours:"Horas",days:"Dias"}},mass:{title:"Ações em massa",selectAll:"Selecionar todos",selected:"{{count}} selecionada(s)",newStatus:"Novo status",apply:"Aplicar a selecionadas",noneSelected:"Selecione pelo menos uma sessão",success:"Status atualizado nas sessões selecionadas",error:"Erro ao atualizar status em massa"},pagination:{showing:"Mostrando {{shown}} de {{total}}",perPage:"Por página",showMore:"Carregar mais",showAll:"Mostrar todas",showLess:"Mostrar menos"},send:{title:"Enviar mensagem",to:"Para",messagePlaceholder:"Digite sua mensagem",send:"Enviar",sending:"Enviando...",empty:"Digite uma mensagem antes de enviar",success:"Mensagem enviada com sucesso",error:"Erro ao enviar mensagem"},actions:{sendMessage:"Enviar mensagem"},empty:"Nenhuma sessão encontrada"},Vle={delete:{title:"Excluir Registro",message:"Você está excluindo a instância {{instanceName}}. Tem certeza que deseja continuar?",messageSingle:"Esta ação não pode ser desfeita.",confirm:"Digite o nome da instância para confirmar:"}},qle={all:"Todos",open:"Conectado",connecting:"Conectando",closed:"Desconectado"},Hle={clientName:"Nome do Cliente",version:"Versão"},Wle={theme:{label:"Mudar Tema",light:"Claro",dark:"Escuro",system:"Sistema"},language:{label:"Idioma",english:"Inglês",portuguese:"Português",spanish:"Espanhol",french:"Francês"},logout:{action:"Sair",title:"Deseja realmente sair?",description:"Você será desconectado e redirecionado para a tela de login."}},Kle={dashboard:"Visão Geral",configurations:"Configurações",settings:"Comportamento",proxy:"Proxy",events:"Eventos",webhook:"Webhook",websocket:"WebSocket",rabbitmq:"RabbitMQ",sqs:"SQS",integrations:"Integrações",chatwoot:"Chatwoot",typebot:"Typebot",openai:"OpenAI",dify:"Dify",evoai:"EvoAI",n8n:"n8n",evolutionBot:"Bot Evolution",flowise:"Flowise",documentation:"Documentação",postman:"Postman",discord:"Discord"},Gle={instance:{created:"Instância criada com sucesso",deleted:"Instância excluída com sucesso",error:"Ocorreu um erro ao criar a instância"}},Jle={checking:"Verificando licença...",required:"Licença necessária",redirecting:"Redirecionando para o registro de licença...",registerFailed:"Falha ao iniciar o registro de licença",callback:{title:"Ativando licença",missingCode:"Código de autorização não encontrado na URL",missingCredentials:"Credenciais não encontradas. Faça login novamente.",activating:"Aguarde enquanto ativamos sua licença.",successTitle:"Licença ativada!",successDescription:"Redirecionando...",errorTitle:"Erro na ativação",retry:"Tentar novamente",back:"Voltar ao login",genericError:"Falha ao ativar a licença"}},Qle={title:"Evolution Manager",description:"Por favor, faça login para continuar",subtitle:"Digite suas credenciais para acessar o sistema",form:{serverUrl:"URL do Servidor",apiKey:"Chave de API Global"},message:{invalidServer:"Servidor inválido",invalidCredentials:"Credenciais inválidas"},button:{login:"Conectar",connecting:"Conectando..."}},Yle={modal:{title:"Nova Instância"},form:{name:"Nome",integration:{label:"Canal",baileys:"Baileys",whatsapp:"WhatsApp Cloud API",facebook:"Facebook",instagram:"Instagram",evolution:"Evolution"},token:"Token",number:"Número",businessId:"Business ID"},button:{save:"Salvar",saving:"Salvando...",create:"Instância",connecting:"Conectando...",facebook:"Conectar com Facebook",instagram:"Conectar com Instagram",whatsapp:"Conectar com WhatsApp"},dashboard:{subtitle:"Gerencie sua instância",button:{qrcode:{label:"Gerar QR Code",title:"Scaneie o QR Code com o WhatsApp"},pairingCode:{label:"Gerar Código de Pareamento",title:"Faça o pareamento com o WhatsApp"},restart:"Reiniciar",disconnect:"Desconectar",sendMessage:"Enviar mensagem"},alert:"Para conectar, escaneie o QR Code com o WhatsApp",contacts:"Contatos",chats:"Chats",messages:"Mensagens"}},Zle={title:"Comportamento",toast:{success:"Comportamento aplicado com sucesso",error:"Ocorreu um erro ao aplicar o comportamento"},form:{rejectCall:{label:"Rejeitar Chamadas",description:"Rejeitar todas as chamadas"},msgCall:{label:"Mensagem de Rejeição de Chamada",description:"Enviar mensagem de rejeição de chamada"},groupsIgnore:{label:"Ignorar Grupos",description:"Ignorar todas as mensagens de grupos"},alwaysOnline:{label:"Sempre Online",description:"Permanecer sempre online"},readMessages:{label:"Visualizar Mensagens",description:"Marcar todas as mensagens como lidas"},syncFullHistory:{label:"Sincronizar Histórico Completo",description:"Sincronizar o histórico completo ao ler o QR Code"},readStatus:{label:"Visualizar Status",description:"Marcar todos os status como visualizados"}},button:{save:"Salvar",saving:"Salvando..."}},Xle={title:"Proxy",toast:{success:"Proxy aplicado com sucesso",error:"Ocorreu um erro ao aplicar o proxy"},form:{enabled:{label:"Ativo",description:"Ativar ou desativar o proxy"},protocol:{label:"Protocolo"},host:{label:"Host"},port:{label:"Porta"},username:{label:"Usuário"},password:{label:"Senha"}},button:{save:"Salvar",saving:"Salvando..."}},ece={title:"Webhook",toast:{success:"Webhook aplicado com sucesso",error:"Ocorreu um erro ao aplicar o webhook"},form:{enabled:{label:"Ativo",description:"Ativar ou desativar o webhook"},url:{label:"URL"},byEvents:{label:"Webhook por Eventos",description:"Criar uma rota para cada evento adicionando o nome do evento ao final da URL"},base64:{label:"Webhook Base64",description:"Enviar dados de mídia em base64 no webhook"},events:{label:"Eventos"}},button:{save:"Salvar",saving:"Salvando..."}},tce={title:"WebSocket",toast:{success:"WebSocket aplicado com sucesso",error:"Ocorreu um erro ao aplicar o WebSocket"},form:{enabled:{label:"Ativo",description:"Ativar ou desativar o WebSocket"},events:{label:"Eventos"}},button:{save:"Salvar",saving:"Salvando..."}},nce={title:"RabbitMQ",toast:{success:"RabbitMQ aplicado com sucesso",error:"Ocorreu um erro ao aplicar o RabbitMQ"},form:{enabled:{label:"Ativo",description:"Ativar ou desativar o RabbitMQ"},events:{label:"Eventos"}},button:{save:"Salvar",saving:"Salvando..."}},rce={title:"SQS",toast:{success:"SQS aplicado com sucesso",error:"Ocorreu um erro ao aplicar o SQS"},form:{enabled:{label:"Ativo",description:"Ativar ou desativar o SQS"},events:{label:"Eventos"}},button:{save:"Salvar",saving:"Salvando..."}},sce={title:"Chatwoot",toast:{success:"Chatwoot aplicado com sucesso",error:"Ocorreu um erro ao aplicar o Chatwoot"},form:{enabled:{label:"Ativo",description:"Ativar ou desativar o Chatwoot"},url:{label:"URL do Chatwoot"},accountId:{label:"ID da Conta"},token:{label:"Token"},signMsg:{label:"Assinar Mensagens",description:"Assinar mensagem com o nome de usuário do Chatwoot"},signDelimiter:{label:"Delimitador de Assinatura"},nameInbox:{label:"Nome da Caixa de Entrada"},organization:{label:"Organização"},logo:{label:"Logo"},conversationPending:{label:"Conversação Pendente",description:"Conversas começam como pendentes"},reopenConversation:{label:"Reabrir Conversa",description:"Reabrir a conversa ao receber uma mensagem"},importContacts:{label:"Importar Contatos",description:"Importar contatos da agenda do WhatsApp ao conectar o QR Code"},importMessages:{label:"Importar Mensagens",description:"Importar mensagens do WhatsApp ao conectar o QR Code"},daysLimitImportMessages:{label:"Limite de Dias para Importação de Mensagens"},ignoreJids:{label:"Ignorar JIDs",placeholder:"Adicione JIDs ex: 1234567890@s.whatsapp.net e pressione enter"},autoCreate:{label:"Criação Automática",description:"Criar automaticamente a integração com o Chatwoot ao salvar"}},button:{save:"Salvar",saving:"Salvando..."}},ace={title:"Typebots",sessions:{label:"Sessões",search:"Pesquisar por remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Nome de Exibição",sessionId:"ID da Sessão",status:"Status",actions:{title:"Ações",open:"Abrir",pause:"Pausar",close:"Fechar",delete:"Excluir"},none:"Nada para mostrar"}},defaultSettings:"Configurações Padrão",toast:{defaultSettings:{success:"Configurações padrão aplicadas com sucesso",error:"Ocorreu um erro ao aplicar as configurações padrão"},success:{update:"Typebot atualizado com sucesso",create:"Typebot criado com sucesso",delete:"Typebot excluído com sucesso",status:"Status do Typebot atualizado com sucesso"},error:"Ocorreu um erro ao criar o Typebot"},table:{none:"Nada para mostrar"},form:{title:"Novo Typebot",examples:{keywordFinish:"#FINISH",unknownMessage:"Desculpe, não entendi. Pode tentar novamente?"},enabled:{label:"Ativo"},description:{label:"Descrição"},typebotSettings:{label:"Configurações do Typebot"},url:{label:"URL da API do Typebot"},typebot:{label:"Nome Público do Typebot"},triggerSettings:{label:"Configurações de Gatilho"},triggerType:{label:"Tipo de Gatilho",keyword:"Palavra-chave",all:"Todos",advanced:"Avançado",none:"Nenhum"},triggerOperator:{label:"Operador do Gatilho",contains:"Contém",equals:"Igual",startsWith:"Começa Com",endsWith:"Termina Com",regex:"Regex"},triggerValue:{label:"Gatilho"},triggerConditions:{label:"Condições"},typebotIdFallback:{label:"Fallback do Typebot"},generalSettings:{label:"Configurações Gerais"},expire:{label:"Expirar em minutos"},keywordFinish:{label:"Palavra-chave de Finalização"},delayMessage:{label:"Mensagem de Atraso Padrão"},unknownMessage:{label:"Mensagem Desconhecida"},listeningFromMe:{label:"Ouvindo de mim",description:"Ouvir as mensagens enviadas por mim no bot"},stopBotFromMe:{label:"Parar bot por mim",description:"Pausar o bot quando eu enviar uma mensagem"},keepOpen:{label:"Manter aberto",description:"Manter o bot aberto após o término da conversa"},debounceTime:{label:"Tempo de Debounce"},splitMessages:{label:"Dividir Mensagens",description:"Dividir mensagens longas em várias mensagens"},timePerChar:{label:"Tempo por Caractere"},ignoreJids:{label:"Ignorar JIDs",placeholder:"Adicione JIDs ex: 1234567890@s.whatsapp.net e pressione enter"}},button:{create:"Typebot",save:"Salvar",saving:"Salvando...",update:"Atualizar",defaultSettings:"Configurações Padrão",delete:"Excluir"},modal:{defaultSettings:{title:"Configurações Padrão"}}},oce={title:"OpenAI",sessions:{label:"Sessões",search:"Pesquisar por remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Nome de Exibição",sessionId:"ID da Sessão",status:"Status",actions:{title:"Ações",open:"Abrir",pause:"Pausar",close:"Fechar",delete:"Excluir"},none:"Nada para mostrar"}},credentials:{title:"Credenciais",table:{name:"Nome",apiKey:"Chave de API",actions:{title:"Ações",delete:"Excluir"},none:"Nada para mostrar"}},defaultSettings:"Configurações Padrão",toast:{defaultSettings:{success:"Configurações padrão aplicadas com sucesso",error:"Ocorreu um erro ao aplicar as configurações padrão"},success:{update:"OpenAI atualizado com sucesso",create:"OpenAI criado com sucesso",delete:"OpenAI excluído com sucesso",status:"Status do OpenAI atualizado com sucesso",credentialsCreate:"Credenciais do OpenAI criadas com sucesso",credentialsDelete:"Credenciais do OpenAI excluídas com sucesso"},error:"Ocorreu um erro ao criar o OpenAI"},table:{none:"Nada para mostrar"},form:{title:"Novo OpenAI",examples:{keywordFinish:"#FINISH",unknownMessage:"Desculpe, não entendi. Pode tentar novamente?"},openaiCredsId:{label:"Credenciais do OpenAI"},enabled:{label:"Ativo"},description:{label:"Descrição"},openaiSettings:{label:"Configurações do OpenAI"},botType:{label:"Tipo de Bot",assistant:"Assistente",chatCompletion:"Chat Completion"},assistantId:{label:"ID do Assistente"},functionUrl:{label:"URL da Função"},model:{label:"Modelo de Linguagem"},systemMessages:{label:"Mensagens do Sistema",description:"Enviar mensagens do sistema para o OpenAI"},assistantMessages:{label:"Mensagens do Assistente",description:"Enviar mensagens do assistente para o OpenAI"},userMessages:{label:"Mensagens do Usuário",description:"Enviar mensagens do usuário para o OpenAI"},maxTokens:{label:"Máximo de Tokens"},triggerSettings:{label:"Configurações de Gatilho"},triggerType:{label:"Tipo de Gatilho",keyword:"Palavra-chave",all:"Todos",advanced:"Avançado",none:"Nenhum"},triggerOperator:{label:"Operador do Gatilho",contains:"Contém",equals:"Igual",startsWith:"Começa Com",endsWith:"Termina Com",regex:"Regex"},triggerValue:{label:"Gatilho"},triggerConditions:{label:"Condições"},openaiIdFallback:{label:"Fallback do OpenAI"},generalSettings:{label:"Configurações Gerais"},expire:{label:"Expirar em minutos"},keywordFinish:{label:"Palavra-chave de Finalização"},delayMessage:{label:"Mensagem de Atraso Padrão"},unknownMessage:{label:"Mensagem Desconhecida"},listeningFromMe:{label:"Ouvindo de mim",description:"Ouvir as mensagens enviadas por mim no bot"},stopBotFromMe:{label:"Parar bot por mim",description:"Pausar o bot quando eu enviar uma mensagem"},keepOpen:{label:"Manter aberto",description:"Manter o bot aberto após o término da conversa"},speechToText:{label:"Fala para Texto",description:"Converter mensagens de voz em texto"},debounceTime:{label:"Tempo de Debounce"},splitMessages:{label:"Dividir Mensagens",description:"Dividir mensagens longas em várias mensagens"},timePerChar:{label:"Tempo por Caractere"},ignoreJids:{label:"Ignorar JIDs",placeholder:"Adicione JIDs ex: 1234567890@s.whatsapp.net e pressione enter"}},button:{create:"OpenAI",save:"Salvar",saving:"Salvando...",update:"Atualizar",defaultSettings:"Configurações Padrão",delete:"Excluir",loadModels:"Carregar Modelos",loading:"Carregando..."},modal:{defaultSettings:{title:"Configurações Padrão"}}},ice={title:"Dify",sessions:{label:"Sessões",search:"Pesquisar por remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Nome de Exibição",sessionId:"ID da Sessão",status:"Status",actions:{title:"Ações",open:"Abrir",pause:"Pausar",close:"Fechar",delete:"Excluir"},none:"Nada para mostrar"}},defaultSettings:"Configurações Padrão",toast:{defaultSettings:{success:"Configurações padrão aplicadas com sucesso",error:"Ocorreu um erro ao aplicar as configurações padrão"},success:{update:"Dify atualizado com sucesso",create:"Dify criado com sucesso",delete:"Dify excluído com sucesso",status:"Status do Dify atualizado com sucesso"},error:"Ocorreu um erro ao criar o Dify"},table:{none:"Nada para mostrar"},form:{title:"Novo Dify",examples:{keywordFinish:"#FINISH",unknownMessage:"Desculpe, não entendi. Pode tentar novamente?"},enabled:{label:"Ativo"},description:{label:"Descrição"},difySettings:{label:"Configurações do Dify"},botType:{label:"Tipo de Bot",chatBot:"Bot de Chat",textGenerator:"Gerador de Texto",agent:"Agente",workflow:"Fluxo de Trabalho"},apiUrl:{label:"URL da API"},apiKey:{label:"Chave de API"},triggerSettings:{label:"Configurações de Gatilho"},triggerType:{label:"Tipo de Gatilho",keyword:"Palavra-chave",all:"Todos",advanced:"Avançado",none:"Nenhum"},triggerOperator:{label:"Operador do Gatilho",contains:"Contém",equals:"Igual",startsWith:"Começa Com",endsWith:"Termina Com",regex:"Regex"},triggerValue:{label:"Gatilho"},triggerConditions:{label:"Condições"},difyIdFallback:{label:"Fallback do Dify"},generalSettings:{label:"Configurações Gerais"},expire:{label:"Expirar em minutos"},keywordFinish:{label:"Palavra-chave de Finalização"},delayMessage:{label:"Mensagem de Atraso Padrão"},unknownMessage:{label:"Mensagem Desconhecida"},listeningFromMe:{label:"Ouvindo de mim",description:"Ouvir as mensagens enviadas por mim no bot"},stopBotFromMe:{label:"Parar bot por mim",description:"Pausar o bot quando eu enviar uma mensagem"},keepOpen:{label:"Manter aberto",description:"Manter o bot aberto após o término da conversa"},debounceTime:{label:"Tempo de Debounce"},splitMessages:{label:"Dividir Mensagens",description:"Dividir mensagens longas em várias mensagens"},timePerChar:{label:"Tempo por Caractere"},ignoreJids:{label:"Ignorar JIDs",placeholder:"Adicione JIDs ex: 1234567890@s.whatsapp.net e pressione enter"}},button:{create:"Dify",save:"Salvar",saving:"Salvando...",update:"Atualizar",defaultSettings:"Configurações Padrão",delete:"Excluir"},modal:{defaultSettings:{title:"Configurações Padrão"}}},lce={title:"n8n",sessions:{label:"Sessões",search:"Buscar por remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Push Name",sessionId:"Session ID",status:"Status",actions:{title:"Ações",open:"Abrir",pause:"Pausar",close:"Fechar",delete:"Excluir"},none:"Nada para mostrar"}},defaultSettings:"Configurações Padrão",toast:{defaultSettings:{success:"Configurações padrão aplicadas com sucesso",error:"Ocorreu um erro ao aplicar as configurações padrão"},success:{update:"n8n atualizado com sucesso",create:"n8n criado com sucesso",delete:"n8n excluído com sucesso",status:"Status do n8n atualizado com sucesso"},error:"Ocorreu um erro ao criar o chatbot n8n"},table:{none:"Nada para mostrar"},form:{title:"Novo chatbot n8n",examples:{keywordFinish:"#FINISH",unknownMessage:"Desculpe, não entendi. Pode tentar novamente?"},enabled:{label:"Ativado"},description:{label:"Descrição"},n8nSettings:{label:"Configurações do n8n"},webhookUrl:{label:"URL do Webhook"},basicAuth:{label:"Basic Auth (Opcional)"},basicAuthUser:{label:"Basic Auth User"},basicAuthPass:{label:"Basic Auth Password"},triggerSettings:{label:"Configurações do Gatilho"},triggerType:{label:"Tipo de Gatilho",keyword:"Palavra-chave",all:"Todos",advanced:"Avançado",none:"Nenhum"},triggerOperator:{label:"Operador do Gatilho",contains:"Contém",equals:"Igual",startsWith:"Começa Com",endsWith:"Termina Com",regex:"Regex"},triggerValue:{label:"Gatilho"},triggerConditions:{label:"Condições"},n8nIdFallback:{label:"Fallback do n8n"},generalSettings:{label:"Configurações Gerais"},expire:{label:"Expirar em minutos"},keywordFinish:{label:"Palavra-chave de Finalização"},delayMessage:{label:"Mensagem de Atraso Padrão"},unknownMessage:{label:"Mensagem Desconhecida"},listeningFromMe:{label:"Ouvir de mim",description:"Ouvir mensagens enviadas por mim no bot"},stopBotFromMe:{label:"Parar bot de mim",description:"Pausar o bot quando eu enviar uma mensagem"},keepOpen:{label:"Manter aberto",description:"Manter o bot aberto após o fim da conversa"},debounceTime:{label:"Tempo de Debounce"},splitMessages:{label:"Dividir Mensagens",description:"Dividir mensagens em múltiplas mensagens"},timePerChar:{label:"Tempo por caractere"},ignoreJids:{label:"Ignorar JIDs",placeholder:"Adicionar JIDs ex: 1234567890@s.whatsapp.net e pressione enter"}},button:{create:"n8n",save:"Salvar",saving:"Salvando...",update:"Atualizar",defaultSettings:"Configurações Padrão",delete:"Excluir"},modal:{defaultSettings:{title:"Configurações Padrão"}}},cce={title:"EvoAI",sessions:{label:"Sessões",search:"Buscar por remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Push Name",sessionId:"Session ID",status:"Status",actions:{title:"Ações",open:"Abrir",pause:"Pausar",close:"Fechar",delete:"Excluir"},none:"Nada para mostrar"}},defaultSettings:"Configurações Padrão",toast:{defaultSettings:{success:"Configurações padrão aplicadas com sucesso",error:"Ocorreu um erro ao aplicar as configurações padrão"},success:{update:"EvoAI atualizado com sucesso",create:"EvoAI criado com sucesso",delete:"EvoAI excluído com sucesso",status:"Status do EvoAI atualizado com sucesso"},error:"Ocorreu um erro ao criar o chatbot EvoAI"},table:{none:"Nada para mostrar"},form:{title:"Novo chatbot EvoAI",examples:{keywordFinish:"#FINISH",unknownMessage:"Desculpe, não entendi. Pode tentar novamente?"},enabled:{label:"Ativado"},description:{label:"Descrição"},evoaiSettings:{label:"Configurações do EvoAI"},agentUrl:{label:"URL do Agente"},apiKey:{label:"API Key (Opcional)"},triggerSettings:{label:"Configurações do Gatilho"},triggerType:{label:"Tipo de Gatilho",keyword:"Palavra-chave",all:"Todos",advanced:"Avançado",none:"Nenhum"},triggerOperator:{label:"Operador do Gatilho",contains:"Contém",equals:"Igual",startsWith:"Começa Com",endsWith:"Termina Com",regex:"Regex"},triggerValue:{label:"Gatilho"},triggerConditions:{label:"Condições"},evoaiIdFallback:{label:"Fallback do EvoAI"},generalSettings:{label:"Configurações Gerais"},expire:{label:"Expirar em minutos"},keywordFinish:{label:"Palavra-chave de Finalização"},delayMessage:{label:"Mensagem de Atraso Padrão"},unknownMessage:{label:"Mensagem Desconhecida"},listeningFromMe:{label:"Ouvir de mim",description:"Ouvir mensagens enviadas por mim no bot"},stopBotFromMe:{label:"Parar bot de mim",description:"Pausar o bot quando eu enviar uma mensagem"},keepOpen:{label:"Manter aberto",description:"Manter o bot aberto após o fim da conversa"},debounceTime:{label:"Tempo de Debounce"},splitMessages:{label:"Dividir Mensagens",description:"Dividir mensagens em múltiplas mensagens"},timePerChar:{label:"Tempo por caractere"},ignoreJids:{label:"Ignorar JIDs",placeholder:"Adicionar JIDs ex: 1234567890@s.whatsapp.net e pressione enter"}},button:{create:"EvoAI",save:"Salvar",saving:"Salvando...",update:"Atualizar",defaultSettings:"Configurações Padrão",delete:"Excluir"},modal:{defaultSettings:{title:"Configurações Padrão"}}},uce={title:"Bot Evolution",sessions:{label:"Sessões",search:"Pesquisar por remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Nome de Exibição",sessionId:"ID da Sessão",status:"Status",actions:{title:"Ações",open:"Abrir",pause:"Pausar",close:"Fechar",delete:"Excluir"},none:"Nada para mostrar"}},defaultSettings:"Configurações Padrão",toast:{defaultSettings:{success:"Configurações padrão aplicadas com sucesso",error:"Ocorreu um erro ao aplicar as configurações padrão"},success:{update:"Bot Evolution atualizado com sucesso",create:"Bot Evolution criado com sucesso",delete:"Bot Evolution excluído com sucesso",status:"Status do Bot Evolution atualizado com sucesso"},error:"Ocorreu um erro ao criar o Bot Evolution"},table:{none:"Nada para mostrar"},form:{title:"Novo Bot Evolution",examples:{keywordFinish:"#FINISH",unknownMessage:"Desculpe, não entendi. Pode tentar novamente?"},enabled:{label:"Ativo"},description:{label:"Descrição"},evolutionBotSettings:{label:"Configurações do Bot Evolution"},apiUrl:{label:"URL da API"},apiKey:{label:"Chave de API"},triggerSettings:{label:"Configurações de Gatilho"},triggerType:{label:"Tipo de Gatilho",keyword:"Palavra-chave",all:"Todos",advanced:"Avançado",none:"Nenhum"},triggerOperator:{label:"Operador do Gatilho",contains:"Contém",equals:"Igual",startsWith:"Começa Com",endsWith:"Termina Com",regex:"Regex"},triggerValue:{label:"Gatilho"},triggerConditions:{label:"Condições"},botIdFallback:{label:"Fallback do Bot Evolution"},generalSettings:{label:"Configurações Gerais"},expire:{label:"Expirar em minutos"},keywordFinish:{label:"Palavra-chave de Finalização"},delayMessage:{label:"Mensagem de Atraso Padrão"},unknownMessage:{label:"Mensagem Desconhecida"},listeningFromMe:{label:"Ouvindo de mim",description:"Ouvir as mensagens enviadas por mim no bot"},stopBotFromMe:{label:"Parar bot por mim",description:"Pausar o bot quando eu enviar uma mensagem"},keepOpen:{label:"Manter aberto",description:"Manter o bot aberto após o término da conversa"},debounceTime:{label:"Tempo de Debounce"},splitMessages:{label:"Dividir Mensagens",description:"Dividir mensagens longas em várias mensagens"},timePerChar:{label:"Tempo por Caractere"},ignoreJids:{label:"Ignorar JIDs",placeholder:"Adicione JIDs ex: 1234567890@s.whatsapp.net e pressione enter"}},button:{create:"Bot Evolution",save:"Salvar",saving:"Salvando...",update:"Atualizar",defaultSettings:"Configurações Padrão",delete:"Excluir"},modal:{defaultSettings:{title:"Configurações Padrão"}}},dce={title:"Flowise",sessions:{label:"Sessões",search:"Pesquisar por remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Nome de Exibição",sessionId:"ID da Sessão",status:"Status",actions:{title:"Ações",open:"Abrir",pause:"Pausar",close:"Fechar",delete:"Excluir"},none:"Nada para mostrar"}},defaultSettings:"Configurações Padrão",toast:{defaultSettings:{success:"Configurações padrão aplicadas com sucesso",error:"Ocorreu um erro ao aplicar as configurações padrão"},success:{update:"Flowise atualizado com sucesso",create:"Flowise criado com sucesso",delete:"Flowise excluído com sucesso",status:"Status do Flowise atualizado com sucesso"},error:"Ocorreu um erro ao criar o Flowise"},table:{none:"Nada para mostrar"},form:{title:"Novo Flowise",examples:{keywordFinish:"#FINISH",unknownMessage:"Desculpe, não entendi. Pode tentar novamente?"},enabled:{label:"Ativo"},description:{label:"Descrição"},flowiseSettings:{label:"Configurações do Flowise"},apiUrl:{label:"URL da API"},apiKey:{label:"Chave de API"},triggerSettings:{label:"Configurações de Gatilho"},triggerType:{label:"Tipo de Gatilho",keyword:"Palavra-chave",all:"Todos",advanced:"Avançado",none:"Nenhum"},triggerOperator:{label:"Operador do Gatilho",contains:"Contém",equals:"Igual",startsWith:"Começa Com",endsWith:"Termina Com",regex:"Regex"},triggerValue:{label:"Gatilho"},triggerConditions:{label:"Condições"},flowiseIdFallback:{label:"Fallback do Flowise"},generalSettings:{label:"Configurações Gerais"},expire:{label:"Expirar em minutos"},keywordFinish:{label:"Palavra-chave de Finalização"},delayMessage:{label:"Mensagem de Atraso Padrão"},unknownMessage:{label:"Mensagem Desconhecida"},listeningFromMe:{label:"Ouvindo de mim",description:"Ouvir as mensagens enviadas por mim no bot"},stopBotFromMe:{label:"Parar bot por mim",description:"Pausar o bot quando eu enviar uma mensagem"},keepOpen:{label:"Manter aberto",description:"Manter o bot aberto após o término da conversa"},debounceTime:{label:"Tempo de Debounce"},splitMessages:{label:"Dividir Mensagens",description:"Dividir mensagens longas em várias mensagens"},timePerChar:{label:"Tempo por Caractere"},ignoreJids:{label:"Ignorar JIDs",placeholder:"Adicione JIDs ex: 1234567890@s.whatsapp.net e pressione enter"}},button:{create:"Flowise",save:"Salvar",saving:"Salvando...",update:"Atualizar",defaultSettings:"Configurações Padrão",delete:"Excluir"},modal:{defaultSettings:{title:"Configurações Padrão"}}},fce={search:"Buscar conversas...",back:"Voltar",tabs:{contacts:"Contatos",groups:"Grupos"},count_one:"{{count}} conversa",count_other:"{{count}} conversas",empty:{default:"Nenhuma conversa ainda",search:"Nenhuma conversa encontrada",tryAnother:"Tente outro termo",selectTitle:"Selecione uma conversa",selectDescription:"Escolha um contato ou grupo na lista ao lado para começar"},input:{placeholder:"Digite uma mensagem...",send:"Enviar"},date:{today:"Hoje",yesterday:"Ontem"}},pce={search:"Buscar..."},hce={title:"Enviar Mensagem",description:"Envie uma mensagem de texto a partir da instância",validation:{numberRequired:"Número é obrigatório",messageRequired:"Mensagem é obrigatória"},form:{number:{label:"Número (com DDI)"},message:{label:"Mensagem",placeholder:"Digite sua mensagem..."}},button:{send:"Enviar",sending:"Enviando..."},toast:{success:"Mensagem enviada com sucesso",error:"Erro ao enviar mensagem",noToken:"Token da instância não disponível"}},mce={title:"Conectar via QR Code",description:"Escaneie o QR Code para conectar a instância",generating:"Gerando QR Code...",waiting:"Aguardando QR Code...",connected:{title:"Instância conectada",description:"A instância {{instanceName}} já está conectada",connectedAs:"Conectado como"},pairingCode:{title:"Conectar por código de pareamento",label:"Código de pareamento",generate:"Gerar código",generating:"Gerando...",hint:"Informe o número com DDI (ex: 5511999999999) para receber um código de pareamento"},howTo:{title:"Como conectar:",step1:"Abra o WhatsApp no seu celular",step2:"Toque em Menu ou Configurações",step3:"Selecione Aparelhos conectados",step4:"Toque em Conectar um aparelho",step5:"Aponte a câmera para o QR Code"},button:{refresh:"Atualizar QR Code",refreshing:"Atualizando...",close:"Fechar"},toast:{pairingSuccess:"Código de pareamento gerado",pairingError:"Erro ao gerar código de pareamento",refreshSuccess:"QR Code atualizado",refreshError:"Erro ao atualizar QR Code"}},gce={title:"Nova Instância",description:"Crie uma nova instância para conectar ao WhatsApp",validation:{nameMin:"O nome deve ter pelo menos 3 caracteres",nameMax:"O nome deve ter no máximo 50 caracteres",nameFormat:"O nome pode conter apenas letras, números, hífen e underline"},form:{name:{label:"Nome da Instância",placeholder:"minha-instancia",hint:"Use letras, números, hífen (-) ou underline (_)"},token:{label:"Token (opcional)",placeholder:"Deixe em branco para gerar automaticamente",hint:"Se não informado, um UUID será gerado automaticamente"}},proxy:{title:"Configurar Proxy (opcional)",host:{label:"Host",placeholder:"proxy.exemplo.com"},port:{label:"Porta"},username:{label:"Usuário",placeholder:"usuario"},password:{label:"Senha",placeholder:"••••••••"}},button:{create:"Criar Instância",creating:"Criando..."}},vce={loading:"Carregando...",noResults:"Nenhum resultado encontrado!"},yce={dashboard:$le,button:Ble,testInteractive:zle,sessions:Ule,modal:Vle,status:qle,footer:Hle,header:Wle,sidebar:Kle,toast:Gle,license:Jle,login:Qle,instance:Yle,settings:Zle,proxy:Xle,webhook:ece,websocket:tce,rabbitmq:nce,sqs:rce,chatwoot:sce,typebot:ace,openai:oce,dify:ice,n8n:lce,evoai:cce,evolutionBot:uce,flowise:dce,chat:fce,common:pce,sendMessage:hce,qrCode:mce,newInstance:gce,table:vce};gr.use(r2).init({resources:{"en-US":{translation:jie},"pt-BR":{translation:yce},"es-ES":{translation:sle},"fr-FR":{translation:Lle}},lng:localStorage.getItem("i18nextLng")||"en-US",fallbackLng:"en-US",interpolation:{escapeValue:!1}});HD.createRoot(document.getElementById("root")).render(s.jsxs(ke.StrictMode,{children:[s.jsx(i2,{i18n:gr,children:s.jsx(r4,{defaultTheme:"dark",storageKey:"vite-ui-theme",children:s.jsx(QE,{client:eT,children:s.jsx(AF,{router:woe})})})}),s.jsx(t4,{theme:"colored"})]}))});export default bce(); diff --git a/manager/dist/assets/index-DXskSPzM.css b/manager/dist/assets/index-CSeJbyWk.css similarity index 66% rename from manager/dist/assets/index-DXskSPzM.css rename to manager/dist/assets/index-CSeJbyWk.css index 4c2057a4df..05409fefb9 100644 --- a/manager/dist/assets/index-DXskSPzM.css +++ b/manager/dist/assets/index-CSeJbyWk.css @@ -1 +1 @@ -@layer properties;@layer theme,base,components,utilities;@layer theme{:root,:host{--font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-100: oklch(93.6% .032 17.717);--color-red-500: oklch(63.7% .237 25.331);--color-red-600: oklch(57.7% .245 27.325);--color-red-700: oklch(50.5% .213 27.518);--color-red-800: oklch(44.4% .177 26.899);--color-orange-100: oklch(95.4% .038 75.164);--color-orange-500: oklch(70.5% .213 47.604);--color-orange-600: oklch(64.6% .222 41.116);--color-orange-700: oklch(55.3% .195 38.402);--color-yellow-100: oklch(97.3% .071 103.193);--color-yellow-400: oklch(85.2% .199 91.936);--color-yellow-500: oklch(79.5% .184 86.047);--color-yellow-600: oklch(68.1% .162 75.834);--color-yellow-700: oklch(55.4% .135 66.442);--color-green-50: oklch(98.2% .018 155.826);--color-green-100: oklch(96.2% .044 156.743);--color-green-200: oklch(92.5% .084 155.995);--color-green-400: oklch(79.2% .209 151.711);--color-green-500: oklch(72.3% .219 149.579);--color-green-600: oklch(62.7% .194 149.214);--color-green-700: oklch(52.7% .154 150.069);--color-green-800: oklch(44.8% .119 151.328);--color-blue-50: oklch(97% .014 254.604);--color-blue-100: oklch(93.2% .032 255.585);--color-blue-200: oklch(88.2% .059 254.128);--color-blue-400: oklch(70.7% .165 254.624);--color-blue-500: oklch(62.3% .214 259.815);--color-blue-600: oklch(54.6% .245 262.881);--color-blue-700: oklch(48.8% .243 264.376);--color-blue-800: oklch(42.4% .199 265.638);--color-blue-900: oklch(37.9% .146 265.522);--color-purple-50: oklch(97.7% .014 308.299);--color-purple-100: oklch(94.6% .033 307.174);--color-purple-200: oklch(90.2% .063 306.703);--color-purple-500: oklch(62.7% .265 303.9);--color-purple-600: oklch(55.8% .288 302.321);--color-purple-700: oklch(49.6% .265 301.924);--color-purple-900: oklch(38.1% .176 304.987);--color-pink-50: oklch(97.1% .014 343.198);--color-pink-500: oklch(65.6% .241 354.308);--color-pink-600: oklch(59.2% .249 .584);--color-slate-50: oklch(98.4% .003 247.858);--color-slate-800: oklch(27.9% .041 260.031);--color-slate-900: oklch(20.8% .042 265.755);--color-gray-400: oklch(70.7% .022 261.325);--color-gray-600: oklch(44.6% .03 256.802);--color-gray-700: oklch(37.3% .034 259.733);--color-gray-900: oklch(21% .034 264.665);--color-black: #000;--color-white: #fff;--spacing: .25rem;--container-xs: 20rem;--container-sm: 24rem;--container-md: 28rem;--container-lg: 32rem;--container-2xl: 42rem;--container-4xl: 56rem;--container-6xl: 72rem;--text-xs: .75rem;--text-xs--line-height: calc(1 / .75);--text-sm: .875rem;--text-sm--line-height: calc(1.25 / .875);--text-base: 1rem;--text-base--line-height: 1.5 ;--text-lg: 1.125rem;--text-lg--line-height: calc(1.75 / 1.125);--text-xl: 1.25rem;--text-xl--line-height: calc(1.75 / 1.25);--text-2xl: 1.5rem;--text-2xl--line-height: calc(2 / 1.5);--text-3xl: 1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl: 2.25rem;--text-4xl--line-height: calc(2.5 / 2.25);--font-weight-normal: 400;--font-weight-medium: 500;--font-weight-semibold: 600;--font-weight-bold: 700;--tracking-tight: -.025em;--tracking-widest: .1em;--leading-tight: 1.25;--leading-snug: 1.375;--leading-relaxed: 1.625;--radius-xs: .125rem;--ease-in-out: cubic-bezier(.4, 0, .2, 1);--animate-spin: spin 1s linear infinite;--animate-pulse: pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--aspect-video: 16 / 9;--default-transition-duration: .15s;--default-transition-timing-function: cubic-bezier(.4, 0, .2, 1);--default-font-family: var(--font-sans);--default-mono-font-family: var(--font-mono);--color-background: var(--background);--color-foreground: var(--foreground);--color-primary: var(--primary);--color-primary-foreground: var(--primary-foreground);--color-secondary: var(--secondary);--color-secondary-foreground: var(--secondary-foreground);--color-muted: var(--muted);--color-muted-foreground: var(--muted-foreground);--color-accent: var(--accent);--color-accent-foreground: var(--accent-foreground);--color-destructive: var(--destructive);--color-destructive-foreground: var(--destructive-foreground);--color-border: var(--border);--color-input: var(--input);--color-ring: var(--ring)}}@layer base{*,:after,:before,::backdrop,::file-selector-button{box-sizing:border-box;margin:0;padding:0;border:0 solid}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;tab-size:4;font-family:var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings, normal);font-variation-settings:var(--default-font-variation-settings, normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings, normal);font-variation-settings:var(--default-mono-font-variation-settings, normal);font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea,::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px){::placeholder{color:currentcolor}@supports (color: color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]),::file-selector-button{appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer utilities{.\@container\/card-header{container-type:inline-size;container-name:card-header}.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing) * 0)}.inset-x-0{inset-inline:calc(var(--spacing) * 0)}.inset-y-0{inset-block:calc(var(--spacing) * 0)}.-top-2{top:calc(var(--spacing) * -2)}.-top-12{top:calc(var(--spacing) * -12)}.top-0{top:calc(var(--spacing) * 0)}.top-1\.5{top:calc(var(--spacing) * 1.5)}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing) * 2)}.top-3\.5{top:calc(var(--spacing) * 3.5)}.top-4{top:calc(var(--spacing) * 4)}.top-\[1px\]{top:1px}.top-\[50\%\]{top:50%}.top-\[60\%\]{top:60%}.top-full{top:100%}.-right-0{right:calc(var(--spacing) * -0)}.-right-2{right:calc(var(--spacing) * -2)}.-right-12{right:calc(var(--spacing) * -12)}.right-0{right:calc(var(--spacing) * 0)}.right-1{right:calc(var(--spacing) * 1)}.right-2{right:calc(var(--spacing) * 2)}.right-3{right:calc(var(--spacing) * 3)}.right-4{right:calc(var(--spacing) * 4)}.-bottom-0{bottom:calc(var(--spacing) * -0)}.-bottom-12{bottom:calc(var(--spacing) * -12)}.bottom-0{bottom:calc(var(--spacing) * 0)}.-left-12{left:calc(var(--spacing) * -12)}.left-0{left:calc(var(--spacing) * 0)}.left-1\/2{left:50%}.left-2{left:calc(var(--spacing) * 2)}.left-3{left:calc(var(--spacing) * 3)}.left-4{left:calc(var(--spacing) * 4)}.left-\[50\%\]{left:50%}.isolate{isolation:isolate}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\[1\]{z-index:1}.col-span-2{grid-column:span 2 / span 2}.col-span-3{grid-column:span 3 / span 3}.col-start-2{grid-column-start:2}.row-span-2{grid-row:span 2 / span 2}.row-span-3{grid-row:span 3 / span 3}.row-start-1{grid-row-start:1}.container{width:100%}@media (width >= 40rem){.container{max-width:40rem}}@media (width >= 48rem){.container{max-width:48rem}}@media (width >= 64rem){.container{max-width:64rem}}@media (width >= 80rem){.container{max-width:80rem}}@media (width >= 96rem){.container{max-width:96rem}}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-3\.5{margin-inline:calc(var(--spacing) * 3.5)}.mx-auto{margin-inline:auto}.my-0\.5{margin-block:calc(var(--spacing) * .5)}.my-1{margin-block:calc(var(--spacing) * 1)}.my-4{margin-block:calc(var(--spacing) * 4)}.-mt-1{margin-top:calc(var(--spacing) * -1)}.-mt-4{margin-top:calc(var(--spacing) * -4)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-auto{margin-top:auto}.mr-1{margin-right:calc(var(--spacing) * 1)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.-ml-1{margin-left:calc(var(--spacing) * -1)}.-ml-4{margin-left:calc(var(--spacing) * -4)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-4{margin-left:calc(var(--spacing) * 4)}.ml-8{margin-left:calc(var(--spacing) * 8)}.ml-12{margin-left:calc(var(--spacing) * 12)}.ml-auto{margin-left:auto}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-row{display:table-row}.field-sizing-content{field-sizing:content}.aspect-square{aspect-ratio:1 / 1}.aspect-video{aspect-ratio:var(--aspect-video)}.size-\(--cell-size\){width:var(--cell-size);height:var(--cell-size)}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-2\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-3\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-auto{width:auto;height:auto}.size-full{width:100%;height:100%}.h-\(--cell-size\){height:var(--cell-size)}.h-1{height:calc(var(--spacing) * 1)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-16{height:calc(var(--spacing) * 16)}.h-20{height:calc(var(--spacing) * 20)}.h-24{height:calc(var(--spacing) * 24)}.h-32{height:calc(var(--spacing) * 32)}.h-48{height:calc(var(--spacing) * 48)}.h-\[1\.15rem\]{height:1.15rem}.h-\[100px\]{height:100px}.h-\[150px\]{height:150px}.h-\[200px\]{height:200px}.h-\[300px\]{height:300px}.h-\[400px\]{height:400px}.h-\[500px\]{height:500px}.h-\[calc\(100\%-1px\)\]{height:calc(100% - 1px)}.h-\[var\(--radix-navigation-menu-viewport-height\)\]{height:var(--radix-navigation-menu-viewport-height)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.h-svh{height:100svh}.max-h-\(--radix-context-menu-content-available-height\){max-height:var(--radix-context-menu-content-available-height)}.max-h-\(--radix-dropdown-menu-content-available-height\){max-height:var(--radix-dropdown-menu-content-available-height)}.max-h-\(--radix-select-content-available-height\){max-height:var(--radix-select-content-available-height)}.max-h-\[80vh\]{max-height:80vh}.max-h-\[300px\]{max-height:300px}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-4{min-height:calc(var(--spacing) * 4)}.min-h-16{min-height:calc(var(--spacing) * 16)}.min-h-\[80px\]{min-height:80px}.min-h-\[100px\]{min-height:100px}.min-h-\[100vh\]{min-height:100vh}.min-h-svh{min-height:100svh}.w-\(--cell-size\){width:var(--cell-size)}.w-0{width:calc(var(--spacing) * 0)}.w-1{width:calc(var(--spacing) * 1)}.w-1\/2{width:50%}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-2\/3{width:calc(2/3 * 100%)}.w-3{width:calc(var(--spacing) * 3)}.w-3\/4{width:75%}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-12{width:calc(var(--spacing) * 12)}.w-14{width:calc(var(--spacing) * 14)}.w-16{width:calc(var(--spacing) * 16)}.w-18{width:calc(var(--spacing) * 18)}.w-20{width:calc(var(--spacing) * 20)}.w-24{width:calc(var(--spacing) * 24)}.w-32{width:calc(var(--spacing) * 32)}.w-48{width:calc(var(--spacing) * 48)}.w-56{width:calc(var(--spacing) * 56)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-80{width:calc(var(--spacing) * 80)}.w-96{width:calc(var(--spacing) * 96)}.w-\[--radix-dropdown-menu-trigger-width\]{width:--radix-dropdown-menu-trigger-width}.w-\[50px\]{width:50px}.w-\[100px\]{width:100px}.w-\[180px\]{width:180px}.w-\[200px\]{width:200px}.w-\[250px\]{width:250px}.w-\[280px\]{width:280px}.w-\[300px\]{width:300px}.w-\[350px\]{width:350px}.w-\[400px\]{width:400px}.w-\[500px\]{width:500px}.w-\[600px\]{width:600px}.w-\[var\(--sidebar-width\)\]{width:var(--sidebar-width)}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.w-max{width:max-content}.w-px{width:1px}.max-w-\(--skeleton-width\){max-width:var(--skeleton-width)}.max-w-2xl{max-width:var(--container-2xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-6xl{max-width:var(--container-6xl)}.max-w-\[calc\(100\%-2rem\)\]{max-width:calc(100% - 2rem)}.max-w-lg{max-width:var(--container-lg)}.max-w-max{max-width:max-content}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-\(--cell-size\){min-width:var(--cell-size)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-5{min-width:calc(var(--spacing) * 5)}.min-w-8{min-width:calc(var(--spacing) * 8)}.min-w-9{min-width:calc(var(--spacing) * 9)}.min-w-10{min-width:calc(var(--spacing) * 10)}.min-w-56{min-width:calc(var(--spacing) * 56)}.min-w-\[8rem\]{min-width:8rem}.min-w-\[12rem\]{min-width:12rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.flex-1{flex:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.grow{flex-grow:1}.grow-0{flex-grow:0}.basis-full{flex-basis:100%}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.origin-\(--radix-context-menu-content-transform-origin\){transform-origin:var(--radix-context-menu-content-transform-origin)}.origin-\(--radix-dropdown-menu-content-transform-origin\){transform-origin:var(--radix-dropdown-menu-content-transform-origin)}.origin-\(--radix-hover-card-content-transform-origin\){transform-origin:var(--radix-hover-card-content-transform-origin)}.origin-\(--radix-menubar-content-transform-origin\){transform-origin:var(--radix-menubar-content-transform-origin)}.origin-\(--radix-select-content-transform-origin\){transform-origin:var(--radix-select-content-transform-origin)}.origin-\(--radix-tooltip-content-transform-origin\){transform-origin:var(--radix-tooltip-content-transform-origin)}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-px{--tw-translate-x: -1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-\[-50\%\]{--tw-translate-x: -50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-px{--tw-translate-x: 1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-0\.5{--tw-translate-y: calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y: -50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[calc\(-50\%_-_2px\)\]{--tw-translate-y: calc(-50% - 2px) ;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-45{rotate:45deg}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-caret-blink{animation:caret-blink 1.25s ease-out infinite}.animate-in{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.resize-none{resize:none}.scroll-my-1{scroll-margin-block:calc(var(--spacing) * 1)}.scroll-py-1{scroll-padding-block:calc(var(--spacing) * 1)}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.appearance-none{appearance:none}.auto-rows-min{grid-auto-rows:min-content}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-\[0_1fr\]{grid-template-columns:0 1fr}.grid-rows-\[auto_auto\]{grid-template-rows:auto auto}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.justify-items-start{justify-items:start}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-8{gap:calc(var(--spacing) * 8)}:where(.space-y-0>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 0) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 0) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 8) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-y-reverse)))}:where(.-space-x-2>:not(:last-child)){--tw-space-x-reverse: 0;margin-inline-start:calc(calc(var(--spacing) * -2) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * -2) * calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse: 0;margin-inline-start:calc(calc(var(--spacing) * 2) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-3>:not(:last-child)){--tw-space-x-reverse: 0;margin-inline-start:calc(calc(var(--spacing) * 3) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-4>:not(:last-child)){--tw-space-x-reverse: 0;margin-inline-start:calc(calc(var(--spacing) * 4) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-6>:not(:last-child)){--tw-space-x-reverse: 0;margin-inline-start:calc(calc(var(--spacing) * 6) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-x-reverse)))}.gap-y-0\.5{row-gap:calc(var(--spacing) * .5)}.self-start{align-self:flex-start}.justify-self-end{justify-self:flex-end}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\[2px\]{border-radius:2px}.rounded-\[4px\]{border-radius:4px}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:calc(infinity * 1px)}.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:calc(var(--radius) + 4px)}.rounded-xs{border-radius:var(--radius-xs)}.rounded-l-md{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.rounded-tl-sm{border-top-left-radius:calc(var(--radius) - 4px)}.rounded-r-md{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-\[1\.5px\]{border-style:var(--tw-border-style);border-width:1.5px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-dashed{--tw-border-style: dashed;border-style:dashed}.border-\(--color-border\){border-color:var(--color-border)}.border-background{border-color:var(--background)}.border-blue-200{border-color:var(--color-blue-200)}.border-border\/50{border-color:var(--border)}@supports (color: color-mix(in lab,red,red)){.border-border\/50{border-color:color-mix(in oklab,var(--border) 50%,transparent)}}.border-current{border-color:currentcolor}.border-destructive{border-color:var(--destructive)}.border-destructive\/20{border-color:var(--destructive)}@supports (color: color-mix(in lab,red,red)){.border-destructive\/20{border-color:color-mix(in oklab,var(--destructive) 20%,transparent)}}.border-gray-700{border-color:var(--color-gray-700)}.border-green-200{border-color:var(--color-green-200)}.border-green-500{border-color:var(--color-green-500)}.border-input{border-color:var(--input)}.border-muted{border-color:var(--muted)}.border-primary{border-color:var(--primary)}.border-purple-100{border-color:var(--color-purple-100)}.border-purple-200{border-color:var(--color-purple-200)}.border-sidebar-border{border-color:var(--sidebar-border)}.border-transparent{border-color:transparent}.border-white{border-color:var(--color-white)}.border-yellow-500{border-color:var(--color-yellow-500)}.border-t-transparent{border-top-color:transparent}.border-l-transparent{border-left-color:transparent}.bg-\(--color-bg\){background-color:var(--color-bg)}.bg-accent{background-color:var(--accent)}.bg-background{background-color:var(--background)}.bg-black{background-color:var(--color-black)}.bg-black\/50{background-color:color-mix(in srgb,#000 50%,transparent)}@supports (color: color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black) 50%,transparent)}}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-100{background-color:var(--color-blue-100)}.bg-blue-500{background-color:var(--color-blue-500)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-border{background-color:var(--border)}.bg-card{background-color:var(--card)}.bg-destructive{background-color:var(--destructive)}.bg-destructive\/10{background-color:var(--destructive)}@supports (color: color-mix(in lab,red,red)){.bg-destructive\/10{background-color:color-mix(in oklab,var(--destructive) 10%,transparent)}}.bg-foreground{background-color:var(--foreground)}.bg-gray-400{background-color:var(--color-gray-400)}.bg-gray-600{background-color:var(--color-gray-600)}.bg-gray-900{background-color:var(--color-gray-900)}.bg-green-50{background-color:var(--color-green-50)}.bg-green-100{background-color:var(--color-green-100)}.bg-green-500{background-color:var(--color-green-500)}.bg-green-600{background-color:var(--color-green-600)}.bg-muted{background-color:var(--muted)}.bg-muted\/50{background-color:var(--muted)}@supports (color: color-mix(in lab,red,red)){.bg-muted\/50{background-color:color-mix(in oklab,var(--muted) 50%,transparent)}}.bg-orange-100{background-color:var(--color-orange-100)}.bg-orange-500{background-color:var(--color-orange-500)}.bg-orange-600{background-color:var(--color-orange-600)}.bg-popover{background-color:var(--popover)}.bg-primary{background-color:var(--primary)}.bg-primary\/10{background-color:var(--primary)}@supports (color: color-mix(in lab,red,red)){.bg-primary\/10{background-color:color-mix(in oklab,var(--primary) 10%,transparent)}}.bg-primary\/20{background-color:var(--primary)}@supports (color: color-mix(in lab,red,red)){.bg-primary\/20{background-color:color-mix(in oklab,var(--primary) 20%,transparent)}}.bg-purple-100{background-color:var(--color-purple-100)}.bg-purple-500{background-color:var(--color-purple-500)}.bg-purple-600{background-color:var(--color-purple-600)}.bg-red-100{background-color:var(--color-red-100)}.bg-red-500{background-color:var(--color-red-500)}.bg-red-600{background-color:var(--color-red-600)}.bg-secondary{background-color:var(--secondary)}.bg-sidebar{background-color:var(--sidebar)}.bg-sidebar-border{background-color:var(--sidebar-border)}.bg-sidebar-primary{background-color:var(--sidebar-primary)}.bg-slate-50{background-color:var(--color-slate-50)}.bg-transparent{background-color:transparent}.bg-white{background-color:var(--color-white)}.bg-white\/60{background-color:color-mix(in srgb,#fff 60%,transparent)}@supports (color: color-mix(in lab,red,red)){.bg-white\/60{background-color:color-mix(in oklab,var(--color-white) 60%,transparent)}}.bg-white\/80{background-color:color-mix(in srgb,#fff 80%,transparent)}@supports (color: color-mix(in lab,red,red)){.bg-white\/80{background-color:color-mix(in oklab,var(--color-white) 80%,transparent)}}.bg-yellow-100{background-color:var(--color-yellow-100)}.bg-yellow-500{background-color:var(--color-yellow-500)}.bg-yellow-600{background-color:var(--color-yellow-600)}.bg-gradient-to-b{--tw-gradient-position: to bottom in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-br{--tw-gradient-position: to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-r{--tw-gradient-position: to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-blue-400{--tw-gradient-from: var(--color-blue-400);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-blue-500{--tw-gradient-from: var(--color-blue-500);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-blue-500\/20{--tw-gradient-from: color-mix(in srgb, oklch(62.3% .214 259.815) 20%, transparent);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}@supports (color: color-mix(in lab,red,red)){.from-blue-500\/20{--tw-gradient-from: color-mix(in oklab, var(--color-blue-500) 20%, transparent)}}.from-muted\/50{--tw-gradient-from: var(--muted);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}@supports (color: color-mix(in lab,red,red)){.from-muted\/50{--tw-gradient-from: color-mix(in oklab, var(--muted) 50%, transparent)}}.from-purple-50{--tw-gradient-from: var(--color-purple-50);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-purple-500{--tw-gradient-from: var(--color-purple-500);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-white{--tw-gradient-from: var(--color-white);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-blue-600\/20{--tw-gradient-to: color-mix(in srgb, oklch(54.6% .245 262.881) 20%, transparent);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}@supports (color: color-mix(in lab,red,red)){.to-blue-600\/20{--tw-gradient-to: color-mix(in oklab, var(--color-blue-600) 20%, transparent)}}.to-gray-900{--tw-gradient-to: var(--color-gray-900);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-muted{--tw-gradient-to: var(--muted);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-pink-50{--tw-gradient-to: var(--color-pink-50);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-pink-500{--tw-gradient-to: var(--color-pink-500);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-purple-600{--tw-gradient-to: var(--color-purple-600);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.fill-blue-400{fill:var(--color-blue-400)}.fill-current{fill:currentcolor}.fill-primary{fill:var(--primary)}.fill-yellow-400{fill:var(--color-yellow-400)}.object-cover{object-fit:cover}.p-0{padding:calc(var(--spacing) * 0)}.p-1{padding:calc(var(--spacing) * 1)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.p-\[3px\]{padding:3px}.p-px{padding:1px}.px-\(--cell-size\){padding-inline:var(--cell-size)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.pt-0{padding-top:calc(var(--spacing) * 0)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pr-1{padding-right:calc(var(--spacing) * 1)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-2\.5{padding-right:calc(var(--spacing) * 2.5)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pr-10{padding-right:calc(var(--spacing) * 10)}.pb-0{padding-bottom:calc(var(--spacing) * 0)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-8{padding-left:calc(var(--spacing) * 8)}.pl-10{padding-left:calc(var(--spacing) * 10)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading, var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading, var(--text-3xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading, var(--text-4xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading, var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading, var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading, var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading, var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading, var(--text-xs--line-height))}.text-\[0\.8rem\]{font-size:.8rem}.text-\[10px\]{font-size:10px}.leading-none{--tw-leading: 1;line-height:1}.leading-relaxed{--tw-leading: var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading: var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading: var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight: var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight: var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight: var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight: var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking: var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-widest{--tw-tracking: var(--tracking-widest);letter-spacing:var(--tracking-widest)}.text-balance{text-wrap:balance}.break-words{overflow-wrap:break-word}.whitespace-nowrap{white-space:nowrap}.text-accent-foreground{color:var(--accent-foreground)}.text-blue-400{color:var(--color-blue-400)}.text-blue-500{color:var(--color-blue-500)}.text-blue-600{color:var(--color-blue-600)}.text-blue-700{color:var(--color-blue-700)}.text-blue-800{color:var(--color-blue-800)}.text-blue-900{color:var(--color-blue-900)}.text-card-foreground{color:var(--card-foreground)}.text-current{color:currentcolor}.text-destructive{color:var(--destructive)}.text-destructive-foreground{color:var(--destructive-foreground)}.text-foreground{color:var(--foreground)}.text-green-400{color:var(--color-green-400)}.text-green-500{color:var(--color-green-500)}.text-green-600{color:var(--color-green-600)}.text-green-700{color:var(--color-green-700)}.text-green-800{color:var(--color-green-800)}.text-muted-foreground{color:var(--muted-foreground)}.text-orange-600{color:var(--color-orange-600)}.text-orange-700{color:var(--color-orange-700)}.text-pink-600{color:var(--color-pink-600)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-purple-500{color:var(--color-purple-500)}.text-purple-600{color:var(--color-purple-600)}.text-purple-700{color:var(--color-purple-700)}.text-purple-900{color:var(--color-purple-900)}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.text-red-700{color:var(--color-red-700)}.text-red-800{color:var(--color-red-800)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-sidebar-foreground{color:var(--sidebar-foreground)}.text-sidebar-foreground\/70{color:var(--sidebar-foreground)}@supports (color: color-mix(in lab,red,red)){.text-sidebar-foreground\/70{color:color-mix(in oklab,var(--sidebar-foreground) 70%,transparent)}}.text-sidebar-primary-foreground{color:var(--sidebar-primary-foreground)}.text-white{color:var(--color-white)}.text-yellow-400{color:var(--color-yellow-400)}.text-yellow-600{color:var(--color-yellow-600)}.text-yellow-700{color:var(--color-yellow-700)}.capitalize{text-transform:capitalize}.italic{font-style:italic}.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,)}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0%}.opacity-50{opacity:50%}.opacity-70{opacity:70%}.opacity-75{opacity:75%}.opacity-90{opacity:90%}.opacity-100{opacity:100%}.shadow{--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_0_1px_hsl\(var\(--sidebar-border\)\)\]{--tw-shadow: 0 0 0 1px var(--tw-shadow-color, hsl(var(--sidebar-border)));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 8px 10px -6px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow: 0 1px 2px 0 var(--tw-shadow-color, rgb(0 0 0 / .05));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-primary{--tw-ring-color: var(--primary)}.ring-ring\/50{--tw-ring-color: var(--ring)}@supports (color: color-mix(in lab,red,red)){.ring-ring\/50{--tw-ring-color: color-mix(in oklab, var(--ring) 50%, transparent)}}.ring-sidebar-ring{--tw-ring-color: var(--sidebar-ring)}.ring-offset-background{--tw-ring-offset-color: var(--background)}.outline-hidden{--tw-outline-style: none;outline-style:none}@media (forced-colors: active){.outline-hidden{outline:2px solid transparent;outline-offset:2px}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,visibility,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-\[color\,box-shadow\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-\[left\,right\,width\]{transition-property:left,right,width;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-\[margin\,opacity\]{transition-property:margin,opacity;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-\[width\,height\,padding\]{transition-property:width,height,padding;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-\[width\,height\]{transition-property:width,height;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-none{transition-property:none}.duration-200{--tw-duration: .2s;transition-duration:.2s}.duration-300{--tw-duration: .3s;transition-duration:.3s}.duration-1000{--tw-duration: 1s;transition-duration:1s}.ease-in-out{--tw-ease: var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-linear{--tw-ease: linear;transition-timing-function:linear}.fade-in-0{--tw-enter-opacity: 0 ;--tw-enter-opacity: 0}.outline-none{--tw-outline-style: none;outline-style:none}.select-all{-webkit-user-select:all;user-select:all}.select-none{-webkit-user-select:none;user-select:none}.zoom-in-95{--tw-enter-scale: 95% ;--tw-enter-scale: .95}.\[--cell-size\:--spacing\(8\)\]{--cell-size: calc(var(--spacing) * 8)}.group-focus-within\/menu-item\:opacity-100:is(:where(.group\/menu-item):focus-within *){opacity:100%}@media (hover: hover){.group-hover\/menu-item\:opacity-100:is(:where(.group\/menu-item):hover *){opacity:100%}}.group-has-data-\[sidebar\=menu-action\]\/menu-item\:pr-8:is(:where(.group\/menu-item):has(*[data-sidebar=menu-action]) *){padding-right:calc(var(--spacing) * 8)}.group-has-\[\[data-collapsible\=icon\]\]\/sidebar-wrapper\:h-12:is(:where(.group\/sidebar-wrapper):has(*:is([data-collapsible=icon])) *){height:calc(var(--spacing) * 12)}.group-data-\[collapsible\=icon\]\:-mt-8:is(:where(.group)[data-collapsible=icon] *){margin-top:calc(var(--spacing) * -8)}.group-data-\[collapsible\=icon\]\:hidden:is(:where(.group)[data-collapsible=icon] *){display:none}.group-data-\[collapsible\=icon\]\:size-8\!:is(:where(.group)[data-collapsible=icon] *){width:calc(var(--spacing) * 8)!important;height:calc(var(--spacing) * 8)!important}.group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)\+1rem\)\]:is(:where(.group)[data-collapsible=icon] *){width:calc(var(--sidebar-width-icon) + 1rem)}.group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)\+1rem\+2px\)\]:is(:where(.group)[data-collapsible=icon] *){width:calc(var(--sidebar-width-icon) + 1rem + 2px)}.group-data-\[collapsible\=icon\]\:w-\[var\(--sidebar-width-icon\)\]:is(:where(.group)[data-collapsible=icon] *){width:var(--sidebar-width-icon)}.group-data-\[collapsible\=icon\]\:overflow-hidden:is(:where(.group)[data-collapsible=icon] *){overflow:hidden}.group-data-\[collapsible\=icon\]\:p-0\!:is(:where(.group)[data-collapsible=icon] *){padding:calc(var(--spacing) * 0)!important}.group-data-\[collapsible\=icon\]\:p-2\!:is(:where(.group)[data-collapsible=icon] *){padding:calc(var(--spacing) * 2)!important}.group-data-\[collapsible\=icon\]\:opacity-0:is(:where(.group)[data-collapsible=icon] *){opacity:0%}.group-data-\[collapsible\=offcanvas\]\:right-\[calc\(var\(--sidebar-width\)\*-1\)\]:is(:where(.group)[data-collapsible=offcanvas] *){right:calc(var(--sidebar-width) * -1)}.group-data-\[collapsible\=offcanvas\]\:left-\[calc\(var\(--sidebar-width\)\*-1\)\]:is(:where(.group)[data-collapsible=offcanvas] *){left:calc(var(--sidebar-width) * -1)}.group-data-\[collapsible\=offcanvas\]\:w-0:is(:where(.group)[data-collapsible=offcanvas] *){width:calc(var(--spacing) * 0)}.group-data-\[collapsible\=offcanvas\]\:translate-x-0:is(:where(.group)[data-collapsible=offcanvas] *){--tw-translate-x: calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-data-\[disabled\=true\]\:pointer-events-none:is(:where(.group)[data-disabled=true] *){pointer-events:none}.group-data-\[disabled\=true\]\:opacity-50:is(:where(.group)[data-disabled=true] *){opacity:50%}.group-data-\[focused\=true\]\/day\:relative:is(:where(.group\/day)[data-focused=true] *){position:relative}.group-data-\[focused\=true\]\/day\:z-10:is(:where(.group\/day)[data-focused=true] *){z-index:10}.group-data-\[focused\=true\]\/day\:border-ring:is(:where(.group\/day)[data-focused=true] *){border-color:var(--ring)}.group-data-\[focused\=true\]\/day\:ring-\[3px\]:is(:where(.group\/day)[data-focused=true] *){--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-data-\[focused\=true\]\/day\:ring-ring\/50:is(:where(.group\/day)[data-focused=true] *){--tw-ring-color: var(--ring)}@supports (color: color-mix(in lab,red,red)){.group-data-\[focused\=true\]\/day\:ring-ring\/50:is(:where(.group\/day)[data-focused=true] *){--tw-ring-color: color-mix(in oklab, var(--ring) 50%, transparent)}}.group-data-\[side\=left\]\:-right-4:is(:where(.group)[data-side=left] *){right:calc(var(--spacing) * -4)}.group-data-\[side\=left\]\:border-r:is(:where(.group)[data-side=left] *){border-right-style:var(--tw-border-style);border-right-width:1px}.group-data-\[side\=right\]\:left-0:is(:where(.group)[data-side=right] *){left:calc(var(--spacing) * 0)}.group-data-\[side\=right\]\:rotate-180:is(:where(.group)[data-side=right] *){rotate:180deg}.group-data-\[side\=right\]\:border-l:is(:where(.group)[data-side=right] *){border-left-style:var(--tw-border-style);border-left-width:1px}.group-data-\[state\=open\]\:rotate-180:is(:where(.group)[data-state=open] *){rotate:180deg}.group-data-\[state\=open\]\/collapsible\:rotate-180:is(:where(.group\/collapsible)[data-state=open] *){rotate:180deg}.group-data-\[variant\=floating\]\:rounded-lg:is(:where(.group)[data-variant=floating] *){border-radius:var(--radius)}.group-data-\[variant\=floating\]\:border:is(:where(.group)[data-variant=floating] *){border-style:var(--tw-border-style);border-width:1px}.group-data-\[variant\=floating\]\:border-sidebar-border:is(:where(.group)[data-variant=floating] *){border-color:var(--sidebar-border)}.group-data-\[variant\=floating\]\:shadow-sm:is(:where(.group)[data-variant=floating] *){--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-data-\[vaul-drawer-direction\=bottom\]\/drawer-content\:block:is(:where(.group\/drawer-content)[data-vaul-drawer-direction=bottom] *){display:block}.group-data-\[vaul-drawer-direction\=bottom\]\/drawer-content\:text-center:is(:where(.group\/drawer-content)[data-vaul-drawer-direction=bottom] *){text-align:center}.group-data-\[vaul-drawer-direction\=top\]\/drawer-content\:text-center:is(:where(.group\/drawer-content)[data-vaul-drawer-direction=top] *){text-align:center}.group-data-\[viewport\=false\]\/navigation-menu\:top-full:is(:where(.group\/navigation-menu)[data-viewport=false] *){top:100%}.group-data-\[viewport\=false\]\/navigation-menu\:mt-1\.5:is(:where(.group\/navigation-menu)[data-viewport=false] *){margin-top:calc(var(--spacing) * 1.5)}.group-data-\[viewport\=false\]\/navigation-menu\:overflow-hidden:is(:where(.group\/navigation-menu)[data-viewport=false] *){overflow:hidden}.group-data-\[viewport\=false\]\/navigation-menu\:rounded-md:is(:where(.group\/navigation-menu)[data-viewport=false] *){border-radius:calc(var(--radius) - 2px)}.group-data-\[viewport\=false\]\/navigation-menu\:border:is(:where(.group\/navigation-menu)[data-viewport=false] *){border-style:var(--tw-border-style);border-width:1px}.group-data-\[viewport\=false\]\/navigation-menu\:bg-popover:is(:where(.group\/navigation-menu)[data-viewport=false] *){background-color:var(--popover)}.group-data-\[viewport\=false\]\/navigation-menu\:text-popover-foreground:is(:where(.group\/navigation-menu)[data-viewport=false] *){color:var(--popover-foreground)}.group-data-\[viewport\=false\]\/navigation-menu\:shadow:is(:where(.group\/navigation-menu)[data-viewport=false] *){--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-data-\[viewport\=false\]\/navigation-menu\:duration-200:is(:where(.group\/navigation-menu)[data-viewport=false] *){--tw-duration: .2s;transition-duration:.2s}@media (hover: hover){.peer-hover\/menu-button\:text-sidebar-accent-foreground:is(:where(.peer\/menu-button):hover~*){color:var(--sidebar-accent-foreground)}}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-50:is(:where(.peer):disabled~*){opacity:50%}.peer-data-\[active\=true\]\/menu-button\:text-sidebar-accent-foreground:is(:where(.peer\/menu-button)[data-active=true]~*){color:var(--sidebar-accent-foreground)}.peer-data-\[size\=default\]\/menu-button\:top-1\.5:is(:where(.peer\/menu-button)[data-size=default]~*){top:calc(var(--spacing) * 1.5)}.peer-data-\[size\=lg\]\/menu-button\:top-2\.5:is(:where(.peer\/menu-button)[data-size=lg]~*){top:calc(var(--spacing) * 2.5)}.peer-data-\[size\=sm\]\/menu-button\:top-1:is(:where(.peer\/menu-button)[data-size=sm]~*){top:calc(var(--spacing) * 1)}.selection\:bg-primary *::selection{background-color:var(--primary)}.selection\:bg-primary::selection{background-color:var(--primary)}.selection\:text-primary-foreground *::selection{color:var(--primary-foreground)}.selection\:text-primary-foreground::selection{color:var(--primary-foreground)}.file\:inline-flex::file-selector-button{display:inline-flex}.file\:h-7::file-selector-button{height:calc(var(--spacing) * 7)}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading, var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight: var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--foreground)}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:-inset-2:after{content:var(--tw-content);inset:calc(var(--spacing) * -2)}.after\:inset-y-0:after{content:var(--tw-content);inset-block:calc(var(--spacing) * 0)}.after\:left-1\/2:after{content:var(--tw-content);left:50%}.after\:w-1:after{content:var(--tw-content);width:calc(var(--spacing) * 1)}.after\:w-\[2px\]:after{content:var(--tw-content);width:2px}.after\:-translate-x-1\/2:after{content:var(--tw-content);--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.group-data-\[collapsible\=offcanvas\]\:after\:left-full:is(:where(.group)[data-collapsible=offcanvas] *):after{content:var(--tw-content);left:100%}.first\:rounded-l-md:first-child{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.first\:border-l:first-child{border-left-style:var(--tw-border-style);border-left-width:1px}.last\:rounded-r-md:last-child{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0px}@media (hover: hover){.hover\:border-muted-foreground\/50:hover{border-color:var(--muted-foreground)}@supports (color: color-mix(in lab,red,red)){.hover\:border-muted-foreground\/50:hover{border-color:color-mix(in oklab,var(--muted-foreground) 50%,transparent)}}}@media (hover: hover){.hover\:bg-accent:hover{background-color:var(--accent)}}@media (hover: hover){.hover\:bg-blue-700:hover{background-color:var(--color-blue-700)}}@media (hover: hover){.hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color: color-mix(in lab,red,red)){.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--destructive) 90%,transparent)}}}@media (hover: hover){.hover\:bg-gray-700:hover{background-color:var(--color-gray-700)}}@media (hover: hover){.hover\:bg-green-700:hover{background-color:var(--color-green-700)}}@media (hover: hover){.hover\:bg-muted:hover{background-color:var(--muted)}}@media (hover: hover){.hover\:bg-muted\/50:hover{background-color:var(--muted)}@supports (color: color-mix(in lab,red,red)){.hover\:bg-muted\/50:hover{background-color:color-mix(in oklab,var(--muted) 50%,transparent)}}}@media (hover: hover){.hover\:bg-orange-700:hover{background-color:var(--color-orange-700)}}@media (hover: hover){.hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color: color-mix(in lab,red,red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--primary) 90%,transparent)}}}@media (hover: hover){.hover\:bg-purple-700:hover{background-color:var(--color-purple-700)}}@media (hover: hover){.hover\:bg-red-700:hover{background-color:var(--color-red-700)}}@media (hover: hover){.hover\:bg-secondary\/80:hover{background-color:var(--secondary)}@supports (color: color-mix(in lab,red,red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab,var(--secondary) 80%,transparent)}}}@media (hover: hover){.hover\:bg-sidebar-accent:hover{background-color:var(--sidebar-accent)}}@media (hover: hover){.hover\:bg-white:hover{background-color:var(--color-white)}}@media (hover: hover){.hover\:bg-yellow-700:hover{background-color:var(--color-yellow-700)}}@media (hover: hover){.hover\:from-purple-600:hover{--tw-gradient-from: var(--color-purple-600);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}}@media (hover: hover){.hover\:to-pink-600:hover{--tw-gradient-to: var(--color-pink-600);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}}@media (hover: hover){.hover\:text-accent-foreground:hover{color:var(--accent-foreground)}}@media (hover: hover){.hover\:text-destructive:hover{color:var(--destructive)}}@media (hover: hover){.hover\:text-foreground:hover{color:var(--foreground)}}@media (hover: hover){.hover\:text-muted-foreground:hover{color:var(--muted-foreground)}}@media (hover: hover){.hover\:text-primary:hover{color:var(--primary)}}@media (hover: hover){.hover\:text-sidebar-accent-foreground:hover{color:var(--sidebar-accent-foreground)}}@media (hover: hover){.hover\:underline:hover{text-decoration-line:underline}}@media (hover: hover){.hover\:opacity-90:hover{opacity:90%}}@media (hover: hover){.hover\:opacity-100:hover{opacity:100%}}@media (hover: hover){.hover\:shadow-\[0_0_0_1px_hsl\(var\(--sidebar-accent\)\)\]:hover{--tw-shadow: 0 0 0 1px var(--tw-shadow-color, hsl(var(--sidebar-accent)));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}@media (hover: hover){.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}@media (hover: hover){.hover\:ring-4:hover{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}@media (hover: hover){.hover\:group-data-\[collapsible\=offcanvas\]\:bg-sidebar:hover:is(:where(.group)[data-collapsible=offcanvas] *){background-color:var(--sidebar)}}@media (hover: hover){.hover\:after\:bg-sidebar-border:hover:after{content:var(--tw-content);background-color:var(--sidebar-border)}}.focus\:z-10:focus{z-index:10}.focus\:bg-accent:focus{background-color:var(--accent)}.focus\:text-accent-foreground:focus{color:var(--accent-foreground)}.focus\:shadow-md:focus{--tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-2:focus{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-ring:focus{--tw-ring-color: var(--ring)}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px;--tw-ring-offset-shadow: var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus\:outline-hidden:focus{--tw-outline-style: none;outline-style:none}@media (forced-colors: active){.focus\:outline-hidden:focus{outline:2px solid transparent;outline-offset:2px}}.focus-visible\:z-10:focus-visible{z-index:10}.focus-visible\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\:ring-1:focus-visible{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-4:focus-visible{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color: var(--destructive)}@supports (color: color-mix(in lab,red,red)){.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color: color-mix(in oklab, var(--destructive) 20%, transparent)}}.focus-visible\:ring-green-500\/20:focus-visible{--tw-ring-color: color-mix(in srgb, oklch(72.3% .219 149.579) 20%, transparent)}@supports (color: color-mix(in lab,red,red)){.focus-visible\:ring-green-500\/20:focus-visible{--tw-ring-color: color-mix(in oklab, var(--color-green-500) 20%, transparent)}}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: var(--ring)}.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color: var(--ring)}@supports (color: color-mix(in lab,red,red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color: color-mix(in oklab, var(--ring) 50%, transparent)}}.focus-visible\:ring-yellow-500\/20:focus-visible{--tw-ring-color: color-mix(in srgb, oklch(79.5% .184 86.047) 20%, transparent)}@supports (color: color-mix(in lab,red,red)){.focus-visible\:ring-yellow-500\/20:focus-visible{--tw-ring-color: color-mix(in oklab, var(--color-yellow-500) 20%, transparent)}}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width: 1px;--tw-ring-offset-shadow: var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px;--tw-ring-offset-shadow: var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus-visible\:outline-hidden:focus-visible{--tw-outline-style: none;outline-style:none}@media (forced-colors: active){.focus-visible\:outline-hidden:focus-visible{outline:2px solid transparent;outline-offset:2px}}.focus-visible\:outline-1:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.focus-visible\:outline-ring:focus-visible{outline-color:var(--ring)}.focus-visible\:outline-none:focus-visible{--tw-outline-style: none;outline-style:none}.active\:bg-sidebar-accent:active{background-color:var(--sidebar-accent)}.active\:text-sidebar-accent-foreground:active{color:var(--sidebar-accent-foreground)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:50%}:where(*[data-side=left]) .in-data-\[side\=left\]\:cursor-w-resize{cursor:w-resize}:where(*[data-side=right]) .in-data-\[side\=right\]\:cursor-e-resize{cursor:e-resize}.has-focus\:border-ring:has(*:focus){border-color:var(--ring)}.has-focus\:ring-\[3px\]:has(*:focus){--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.has-focus\:ring-ring\/50:has(*:focus){--tw-ring-color: var(--ring)}@supports (color: color-mix(in lab,red,red)){.has-focus\:ring-ring\/50:has(*:focus){--tw-ring-color: color-mix(in oklab, var(--ring) 50%, transparent)}}.has-disabled\:opacity-50:has(*:disabled){opacity:50%}.has-data-\[slot\=card-action\]\:grid-cols-\[1fr_auto\]:has(*[data-slot=card-action]){grid-template-columns:1fr auto}.has-data-\[variant\=inset\]\:bg-sidebar:has(*[data-variant=inset]){background-color:var(--sidebar)}.has-\[\>svg\]\:grid-cols-\[calc\(var\(--spacing\)\*4\)_1fr\]:has(>svg){grid-template-columns:calc(var(--spacing) * 4) 1fr}.has-\[\>svg\]\:gap-x-3:has(>svg){column-gap:calc(var(--spacing) * 3)}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing) * 2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing) * 3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing) * 4)}.aria-disabled\:pointer-events-none[aria-disabled=true]{pointer-events:none}.aria-disabled\:opacity-50[aria-disabled=true]{opacity:50%}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color: var(--destructive)}@supports (color: color-mix(in lab,red,red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color: color-mix(in oklab, var(--destructive) 20%, transparent)}}.aria-selected\:text-muted-foreground[aria-selected=true]{color:var(--muted-foreground)}.data-\[active\=true\]\:z-10[data-active=true]{z-index:10}.data-\[active\=true\]\:border-ring[data-active=true]{border-color:var(--ring)}.data-\[active\=true\]\:bg-accent\/50[data-active=true]{background-color:var(--accent)}@supports (color: color-mix(in lab,red,red)){.data-\[active\=true\]\:bg-accent\/50[data-active=true]{background-color:color-mix(in oklab,var(--accent) 50%,transparent)}}.data-\[active\=true\]\:bg-sidebar-accent[data-active=true]{background-color:var(--sidebar-accent)}.data-\[active\=true\]\:font-medium[data-active=true]{--tw-font-weight: var(--font-weight-medium);font-weight:var(--font-weight-medium)}.data-\[active\=true\]\:text-accent-foreground[data-active=true]{color:var(--accent-foreground)}.data-\[active\=true\]\:text-sidebar-accent-foreground[data-active=true]{color:var(--sidebar-accent-foreground)}.data-\[active\=true\]\:ring-\[3px\][data-active=true]{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[active\=true\]\:ring-ring\/50[data-active=true]{--tw-ring-color: var(--ring)}@supports (color: color-mix(in lab,red,red)){.data-\[active\=true\]\:ring-ring\/50[data-active=true]{--tw-ring-color: color-mix(in oklab, var(--ring) 50%, transparent)}}@media (hover: hover){.data-\[active\=true\]\:hover\:bg-accent[data-active=true]:hover{background-color:var(--accent)}}.data-\[active\=true\]\:focus\:bg-accent[data-active=true]:focus{background-color:var(--accent)}.data-\[active\=true\]\:aria-invalid\:border-destructive[data-active=true][aria-invalid=true]{border-color:var(--destructive)}.data-\[active\=true\]\:aria-invalid\:ring-destructive\/20[data-active=true][aria-invalid=true]{--tw-ring-color: var(--destructive)}@supports (color: color-mix(in lab,red,red)){.data-\[active\=true\]\:aria-invalid\:ring-destructive\/20[data-active=true][aria-invalid=true]{--tw-ring-color: color-mix(in oklab, var(--destructive) 20%, transparent)}}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:50%}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true]{pointer-events:none}.data-\[disabled\=true\]\:opacity-50[data-disabled=true]{opacity:50%}.data-\[empty\=true\]\:text-muted-foreground[data-empty=true]{color:var(--muted-foreground)}.data-\[error\=true\]\:text-destructive[data-error=true]{color:var(--destructive)}.data-\[inset\]\:pl-8[data-inset]{padding-left:calc(var(--spacing) * 8)}.data-\[motion\=from-end\]\:slide-in-from-right-52[data-motion=from-end]{--tw-enter-translate-x: calc(52*var(--spacing))}.data-\[motion\=from-start\]\:slide-in-from-left-52[data-motion=from-start]{--tw-enter-translate-x: calc(52*var(--spacing)*-1)}.data-\[motion\=to-end\]\:slide-out-to-right-52[data-motion=to-end]{--tw-exit-translate-x: calc(52*var(--spacing))}.data-\[motion\=to-start\]\:slide-out-to-left-52[data-motion=to-start]{--tw-exit-translate-x: calc(52*var(--spacing)*-1)}.data-\[motion\^\=from-\]\:animate-in[data-motion^=from-]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[motion\^\=from-\]\:fade-in[data-motion^=from-]{--tw-enter-opacity: 0}.data-\[motion\^\=to-\]\:animate-out[data-motion^=to-]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[motion\^\=to-\]\:fade-out[data-motion^=to-]{--tw-exit-opacity: 0}.data-\[orientation\=horizontal\]\:h-1\.5[data-orientation=horizontal]{height:calc(var(--spacing) * 1.5)}.data-\[orientation\=horizontal\]\:h-full[data-orientation=horizontal]{height:100%}.data-\[orientation\=horizontal\]\:h-px[data-orientation=horizontal]{height:1px}.data-\[orientation\=horizontal\]\:w-full[data-orientation=horizontal]{width:100%}.data-\[orientation\=vertical\]\:h-full[data-orientation=vertical]{height:100%}.data-\[orientation\=vertical\]\:min-h-44[data-orientation=vertical]{min-height:calc(var(--spacing) * 44)}.data-\[orientation\=vertical\]\:w-1\.5[data-orientation=vertical]{width:calc(var(--spacing) * 1.5)}.data-\[orientation\=vertical\]\:w-auto[data-orientation=vertical]{width:auto}.data-\[orientation\=vertical\]\:w-full[data-orientation=vertical]{width:100%}.data-\[orientation\=vertical\]\:w-px[data-orientation=vertical]{width:1px}.data-\[orientation\=vertical\]\:flex-col[data-orientation=vertical]{flex-direction:column}.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-\[panel-group-direction\=vertical\]\:flex-col[data-panel-group-direction=vertical]{flex-direction:column}.data-\[panel-group-direction\=vertical\]\:after\:left-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);left:calc(var(--spacing) * 0)}.data-\[panel-group-direction\=vertical\]\:after\:h-1[data-panel-group-direction=vertical]:after{content:var(--tw-content);height:calc(var(--spacing) * 1)}.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-x-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-x: calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[panel-group-direction\=vertical\]\:after\:-translate-y-1\/2[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:var(--muted-foreground)}.data-\[range-end\=true\]\:rounded-md[data-range-end=true]{border-radius:calc(var(--radius) - 2px)}.data-\[range-end\=true\]\:rounded-r-md[data-range-end=true]{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.data-\[range-end\=true\]\:bg-primary[data-range-end=true]{background-color:var(--primary)}.data-\[range-end\=true\]\:text-primary-foreground[data-range-end=true]{color:var(--primary-foreground)}.data-\[range-middle\=true\]\:rounded-none[data-range-middle=true]{border-radius:0}.data-\[range-middle\=true\]\:bg-accent[data-range-middle=true]{background-color:var(--accent)}.data-\[range-middle\=true\]\:text-accent-foreground[data-range-middle=true]{color:var(--accent-foreground)}.data-\[range-start\=true\]\:rounded-md[data-range-start=true]{border-radius:calc(var(--radius) - 2px)}.data-\[range-start\=true\]\:rounded-l-md[data-range-start=true]{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.data-\[range-start\=true\]\:bg-primary[data-range-start=true]{background-color:var(--primary)}.data-\[range-start\=true\]\:text-primary-foreground[data-range-start=true]{color:var(--primary-foreground)}.data-\[selected-single\=true\]\:bg-primary[data-selected-single=true]{background-color:var(--primary)}.data-\[selected-single\=true\]\:text-primary-foreground[data-selected-single=true]{color:var(--primary-foreground)}.data-\[selected\=true\]\:rounded-none[data-selected=true]{border-radius:0}.data-\[selected\=true\]\:bg-accent[data-selected=true]{background-color:var(--accent)}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:var(--accent-foreground)}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: calc(var(--spacing) * 1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: calc(2*var(--spacing)*-1)}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: calc(2*var(--spacing))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: calc(var(--spacing) * 1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: calc(2*var(--spacing)*-1)}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: calc(2*var(--spacing))}.data-\[size\=default\]\:h-9[data-size=default]{height:calc(var(--spacing) * 9)}.data-\[size\=sm\]\:h-8[data-size=sm]{height:calc(var(--spacing) * 8)}:is(.\*\:data-\[slot\=alert-description\]\:text-destructive\/90>*)[data-slot=alert-description]{color:var(--destructive)}@supports (color: color-mix(in lab,red,red)){:is(.\*\:data-\[slot\=alert-description\]\:text-destructive\/90>*)[data-slot=alert-description]{color:color-mix(in oklab,var(--destructive) 90%,transparent)}}:is(.\*\*\:data-\[slot\=command-input-wrapper\]\:h-12 *)[data-slot=command-input-wrapper]{height:calc(var(--spacing) * 12)}:is(.\*\*\:data-\[slot\=navigation-menu-link\]\:focus\:ring-0 *)[data-slot=navigation-menu-link]:focus{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}:is(.\*\*\:data-\[slot\=navigation-menu-link\]\:focus\:outline-none *)[data-slot=navigation-menu-link]:focus{--tw-outline-style: none;outline-style:none}:is(.\*\:data-\[slot\=select-value\]\:line-clamp-1>*)[data-slot=select-value]{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}:is(.\*\:data-\[slot\=select-value\]\:flex>*)[data-slot=select-value]{display:flex}:is(.\*\:data-\[slot\=select-value\]\:items-center>*)[data-slot=select-value]{align-items:center}:is(.\*\:data-\[slot\=select-value\]\:gap-2>*)[data-slot=select-value]{gap:calc(var(--spacing) * 2)}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:var(--background)}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[state\=checked\]\:translate-x-\[calc\(100\%-2px\)\][data-state=checked]{--tw-translate-x: calc(100% - 2px) ;translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[state\=checked\]\:border-primary[data-state=checked]{border-color:var(--primary)}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:var(--primary)}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:var(--primary-foreground)}.data-\[state\=closed\]\:animate-accordion-up[data-state=closed]{animation:accordion-up var(--tw-animation-duration,var(--tw-duration,.2s))ease-out}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=closed\]\:duration-300[data-state=closed]{--tw-duration: .3s;transition-duration:.3s}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0 ;--tw-exit-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: 95% ;--tw-exit-scale: .95}.data-\[state\=closed\]\:slide-out-to-bottom[data-state=closed]{--tw-exit-translate-y: 100%}.data-\[state\=closed\]\:slide-out-to-left[data-state=closed]{--tw-exit-translate-x: -100%}.data-\[state\=closed\]\:slide-out-to-right[data-state=closed]{--tw-exit-translate-x: 100%}.data-\[state\=closed\]\:slide-out-to-top[data-state=closed]{--tw-exit-translate-y: -100%}.group-data-\[viewport\=false\]\/navigation-menu\:data-\[state\=closed\]\:animate-out:is(:where(.group\/navigation-menu)[data-viewport=false] *)[data-state=closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.group-data-\[viewport\=false\]\/navigation-menu\:data-\[state\=closed\]\:fade-out-0:is(:where(.group\/navigation-menu)[data-viewport=false] *)[data-state=closed]{--tw-exit-opacity: 0 ;--tw-exit-opacity: 0}.group-data-\[viewport\=false\]\/navigation-menu\:data-\[state\=closed\]\:zoom-out-95:is(:where(.group\/navigation-menu)[data-viewport=false] *)[data-state=closed]{--tw-exit-scale: 95% ;--tw-exit-scale: .95}.data-\[state\=hidden\]\:animate-out[data-state=hidden]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=hidden\]\:fade-out[data-state=hidden]{--tw-exit-opacity: 0}.data-\[state\=on\]\:bg-accent[data-state=on]{background-color:var(--accent)}.data-\[state\=on\]\:text-accent-foreground[data-state=on]{color:var(--accent-foreground)}.data-\[state\=open\]\:animate-accordion-down[data-state=open]{animation:accordion-down var(--tw-animation-duration,var(--tw-duration,.2s))ease-out}.data-\[state\=open\]\:animate-in[data-state=open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:var(--accent)}.data-\[state\=open\]\:bg-accent\/50[data-state=open]{background-color:var(--accent)}@supports (color: color-mix(in lab,red,red)){.data-\[state\=open\]\:bg-accent\/50[data-state=open]{background-color:color-mix(in oklab,var(--accent) 50%,transparent)}}.data-\[state\=open\]\:bg-secondary[data-state=open]{background-color:var(--secondary)}.data-\[state\=open\]\:bg-sidebar-accent[data-state=open]{background-color:var(--sidebar-accent)}.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:var(--accent-foreground)}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:var(--muted-foreground)}.data-\[state\=open\]\:text-sidebar-accent-foreground[data-state=open]{color:var(--sidebar-accent-foreground)}.data-\[state\=open\]\:opacity-100[data-state=open]{opacity:100%}.data-\[state\=open\]\:duration-500[data-state=open]{--tw-duration: .5s;transition-duration:.5s}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity: 0 ;--tw-enter-opacity: 0}.data-\[state\=open\]\:zoom-in-90[data-state=open]{--tw-enter-scale: 90% ;--tw-enter-scale: .9}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: 95% ;--tw-enter-scale: .95}.data-\[state\=open\]\:slide-in-from-bottom[data-state=open]{--tw-enter-translate-y: 100%}.data-\[state\=open\]\:slide-in-from-left[data-state=open]{--tw-enter-translate-x: -100%}.data-\[state\=open\]\:slide-in-from-right[data-state=open]{--tw-enter-translate-x: 100%}.data-\[state\=open\]\:slide-in-from-top[data-state=open]{--tw-enter-translate-y: -100%}.group-data-\[viewport\=false\]\/navigation-menu\:data-\[state\=open\]\:animate-in:is(:where(.group\/navigation-menu)[data-viewport=false] *)[data-state=open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.group-data-\[viewport\=false\]\/navigation-menu\:data-\[state\=open\]\:fade-in-0:is(:where(.group\/navigation-menu)[data-viewport=false] *)[data-state=open]{--tw-enter-opacity: 0 ;--tw-enter-opacity: 0}.group-data-\[viewport\=false\]\/navigation-menu\:data-\[state\=open\]\:zoom-in-95:is(:where(.group\/navigation-menu)[data-viewport=false] *)[data-state=open]{--tw-enter-scale: 95% ;--tw-enter-scale: .95}@media (hover: hover){.data-\[state\=open\]\:hover\:bg-accent[data-state=open]:hover{background-color:var(--accent)}}@media (hover: hover){.data-\[state\=open\]\:hover\:bg-sidebar-accent[data-state=open]:hover{background-color:var(--sidebar-accent)}}@media (hover: hover){.data-\[state\=open\]\:hover\:text-sidebar-accent-foreground[data-state=open]:hover{color:var(--sidebar-accent-foreground)}}.data-\[state\=open\]\:focus\:bg-accent[data-state=open]:focus{background-color:var(--accent)}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:var(--muted)}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x: calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:var(--input)}.data-\[state\=visible\]\:animate-in[data-state=visible]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=visible\]\:fade-in[data-state=visible]{--tw-enter-opacity: 0}.data-\[variant\=destructive\]\:text-destructive[data-variant=destructive]{color:var(--destructive)}.data-\[variant\=destructive\]\:focus\:bg-destructive\/10[data-variant=destructive]:focus{background-color:var(--destructive)}@supports (color: color-mix(in lab,red,red)){.data-\[variant\=destructive\]\:focus\:bg-destructive\/10[data-variant=destructive]:focus{background-color:color-mix(in oklab,var(--destructive) 10%,transparent)}}.data-\[variant\=destructive\]\:focus\:text-destructive[data-variant=destructive]:focus{color:var(--destructive)}.data-\[variant\=outline\]\:border-l-0[data-variant=outline]{border-left-style:var(--tw-border-style);border-left-width:0px}.data-\[variant\=outline\]\:shadow-xs[data-variant=outline]{--tw-shadow: 0 1px 2px 0 var(--tw-shadow-color, rgb(0 0 0 / .05));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[variant\=outline\]\:first\:border-l[data-variant=outline]:first-child{border-left-style:var(--tw-border-style);border-left-width:1px}.data-\[vaul-drawer-direction\=bottom\]\:inset-x-0[data-vaul-drawer-direction=bottom]{inset-inline:calc(var(--spacing) * 0)}.data-\[vaul-drawer-direction\=bottom\]\:bottom-0[data-vaul-drawer-direction=bottom]{bottom:calc(var(--spacing) * 0)}.data-\[vaul-drawer-direction\=bottom\]\:mt-24[data-vaul-drawer-direction=bottom]{margin-top:calc(var(--spacing) * 24)}.data-\[vaul-drawer-direction\=bottom\]\:max-h-\[80vh\][data-vaul-drawer-direction=bottom]{max-height:80vh}.data-\[vaul-drawer-direction\=bottom\]\:rounded-t-lg[data-vaul-drawer-direction=bottom]{border-top-left-radius:var(--radius);border-top-right-radius:var(--radius)}.data-\[vaul-drawer-direction\=bottom\]\:border-t[data-vaul-drawer-direction=bottom]{border-top-style:var(--tw-border-style);border-top-width:1px}.data-\[vaul-drawer-direction\=left\]\:inset-y-0[data-vaul-drawer-direction=left]{inset-block:calc(var(--spacing) * 0)}.data-\[vaul-drawer-direction\=left\]\:left-0[data-vaul-drawer-direction=left]{left:calc(var(--spacing) * 0)}.data-\[vaul-drawer-direction\=left\]\:w-3\/4[data-vaul-drawer-direction=left]{width:75%}.data-\[vaul-drawer-direction\=left\]\:border-r[data-vaul-drawer-direction=left]{border-right-style:var(--tw-border-style);border-right-width:1px}.data-\[vaul-drawer-direction\=right\]\:inset-y-0[data-vaul-drawer-direction=right]{inset-block:calc(var(--spacing) * 0)}.data-\[vaul-drawer-direction\=right\]\:right-0[data-vaul-drawer-direction=right]{right:calc(var(--spacing) * 0)}.data-\[vaul-drawer-direction\=right\]\:w-3\/4[data-vaul-drawer-direction=right]{width:75%}.data-\[vaul-drawer-direction\=right\]\:border-l[data-vaul-drawer-direction=right]{border-left-style:var(--tw-border-style);border-left-width:1px}.data-\[vaul-drawer-direction\=top\]\:inset-x-0[data-vaul-drawer-direction=top]{inset-inline:calc(var(--spacing) * 0)}.data-\[vaul-drawer-direction\=top\]\:top-0[data-vaul-drawer-direction=top]{top:calc(var(--spacing) * 0)}.data-\[vaul-drawer-direction\=top\]\:mb-24[data-vaul-drawer-direction=top]{margin-bottom:calc(var(--spacing) * 24)}.data-\[vaul-drawer-direction\=top\]\:max-h-\[80vh\][data-vaul-drawer-direction=top]{max-height:80vh}.data-\[vaul-drawer-direction\=top\]\:rounded-b-lg[data-vaul-drawer-direction=top]{border-bottom-right-radius:var(--radius);border-bottom-left-radius:var(--radius)}.data-\[vaul-drawer-direction\=top\]\:border-b[data-vaul-drawer-direction=top]{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}@media (width >= 40rem){.sm\:block{display:block}}@media (width >= 40rem){.sm\:flex{display:flex}}@media (width >= 40rem){.sm\:w-auto{width:auto}}@media (width >= 40rem){.sm\:max-w-\[425px\]{max-width:425px}}@media (width >= 40rem){.sm\:max-w-lg{max-width:var(--container-lg)}}@media (width >= 40rem){.sm\:max-w-md{max-width:var(--container-md)}}@media (width >= 40rem){.sm\:max-w-sm{max-width:var(--container-sm)}}@media (width >= 40rem){.sm\:flex-row{flex-direction:row}}@media (width >= 40rem){.sm\:justify-end{justify-content:flex-end}}@media (width >= 40rem){.sm\:gap-2\.5{gap:calc(var(--spacing) * 2.5)}}@media (width >= 40rem){.sm\:pr-2\.5{padding-right:calc(var(--spacing) * 2.5)}}@media (width >= 40rem){.sm\:pl-2\.5{padding-left:calc(var(--spacing) * 2.5)}}@media (width >= 40rem){.sm\:text-left{text-align:left}}@media (width >= 40rem){.data-\[vaul-drawer-direction\=left\]\:sm\:max-w-sm[data-vaul-drawer-direction=left]{max-width:var(--container-sm)}}@media (width >= 40rem){.data-\[vaul-drawer-direction\=right\]\:sm\:max-w-sm[data-vaul-drawer-direction=right]{max-width:var(--container-sm)}}@media (width >= 48rem){.md\:absolute{position:absolute}}@media (width >= 48rem){.md\:block{display:block}}@media (width >= 48rem){.md\:flex{display:flex}}@media (width >= 48rem){.md\:min-h-min{min-height:min-content}}@media (width >= 48rem){.md\:w-\[400px\]{width:400px}}@media (width >= 48rem){.md\:w-\[500px\]{width:500px}}@media (width >= 48rem){.md\:w-\[var\(--radix-navigation-menu-viewport-width\)\]{width:var(--radix-navigation-menu-viewport-width)}}@media (width >= 48rem){.md\:w-auto{width:auto}}@media (width >= 48rem){.md\:basis-1\/2{flex-basis:50%}}@media (width >= 48rem){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (width >= 48rem){.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (width >= 48rem){.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (width >= 48rem){.md\:flex-row{flex-direction:row}}@media (width >= 48rem){.md\:gap-1\.5{gap:calc(var(--spacing) * 1.5)}}@media (width >= 48rem){.md\:text-left{text-align:left}}@media (width >= 48rem){.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading, var(--text-sm--line-height))}}@media (width >= 48rem){.md\:opacity-0{opacity:0%}}@media (width >= 48rem){.md\:peer-data-\[variant\=inset\]\:m-2:is(:where(.peer)[data-variant=inset]~*){margin:calc(var(--spacing) * 2)}}@media (width >= 48rem){.md\:peer-data-\[variant\=inset\]\:ml-0:is(:where(.peer)[data-variant=inset]~*){margin-left:calc(var(--spacing) * 0)}}@media (width >= 48rem){.md\:peer-data-\[variant\=inset\]\:rounded-xl:is(:where(.peer)[data-variant=inset]~*){border-radius:calc(var(--radius) + 4px)}}@media (width >= 48rem){.md\:peer-data-\[variant\=inset\]\:shadow-sm:is(:where(.peer)[data-variant=inset]~*){--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}@media (width >= 48rem){.md\:peer-data-\[variant\=inset\]\:peer-data-\[state\=collapsed\]\:ml-2:is(:where(.peer)[data-variant=inset]~*):is(:where(.peer)[data-state=collapsed]~*){margin-left:calc(var(--spacing) * 2)}}@media (width >= 48rem){.md\:after\:hidden:after{content:var(--tw-content);display:none}}@media (width >= 64rem){.lg\:w-\[500px\]{width:500px}}@media (width >= 64rem){.lg\:w-\[600px\]{width:600px}}@media (width >= 64rem){.lg\:basis-1\/3{flex-basis:calc(1/3 * 100%)}}@media (width >= 64rem){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (width >= 64rem){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (width >= 64rem){.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (width >= 64rem){.lg\:grid-cols-\[\.75fr_1fr\]{grid-template-columns:.75fr 1fr}}.dark\:border-input:is(.dark *){border-color:var(--input)}.dark\:bg-destructive\/60:is(.dark *){background-color:var(--destructive)}@supports (color: color-mix(in lab,red,red)){.dark\:bg-destructive\/60:is(.dark *){background-color:color-mix(in oklab,var(--destructive) 60%,transparent)}}.dark\:bg-input\/30:is(.dark *){background-color:var(--input)}@supports (color: color-mix(in lab,red,red)){.dark\:bg-input\/30:is(.dark *){background-color:color-mix(in oklab,var(--input) 30%,transparent)}}.dark\:bg-slate-800:is(.dark *){background-color:var(--color-slate-800)}.dark\:bg-slate-900:is(.dark *){background-color:var(--color-slate-900)}.dark\:text-muted-foreground:is(.dark *){color:var(--muted-foreground)}@media (hover: hover){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:var(--accent)}@supports (color: color-mix(in lab,red,red)){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--accent) 50%,transparent)}}}@media (hover: hover){.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:var(--input)}@supports (color: color-mix(in lab,red,red)){.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--input) 50%,transparent)}}}@media (hover: hover){.dark\:hover\:text-accent-foreground:is(.dark *):hover{color:var(--accent-foreground)}}.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color: var(--destructive)}@supports (color: color-mix(in lab,red,red)){.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color: color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color: var(--destructive)}@supports (color: color-mix(in lab,red,red)){.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color: color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\:data-\[active\=true\]\:aria-invalid\:ring-destructive\/40:is(.dark *)[data-active=true][aria-invalid=true]{--tw-ring-color: var(--destructive)}@supports (color: color-mix(in lab,red,red)){.dark\:data-\[active\=true\]\:aria-invalid\:ring-destructive\/40:is(.dark *)[data-active=true][aria-invalid=true]{--tw-ring-color: color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\:data-\[state\=active\]\:border-input:is(.dark *)[data-state=active]{border-color:var(--input)}.dark\:data-\[state\=active\]\:bg-input\/30:is(.dark *)[data-state=active]{background-color:var(--input)}@supports (color: color-mix(in lab,red,red)){.dark\:data-\[state\=active\]\:bg-input\/30:is(.dark *)[data-state=active]{background-color:color-mix(in oklab,var(--input) 30%,transparent)}}.dark\:data-\[state\=active\]\:text-foreground:is(.dark *)[data-state=active]{color:var(--foreground)}.dark\:data-\[state\=checked\]\:bg-primary:is(.dark *)[data-state=checked]{background-color:var(--primary)}.dark\:data-\[state\=checked\]\:bg-primary-foreground:is(.dark *)[data-state=checked]{background-color:var(--primary-foreground)}.dark\:data-\[state\=unchecked\]\:bg-foreground:is(.dark *)[data-state=unchecked]{background-color:var(--foreground)}.dark\:data-\[state\=unchecked\]\:bg-input\/80:is(.dark *)[data-state=unchecked]{background-color:var(--input)}@supports (color: color-mix(in lab,red,red)){.dark\:data-\[state\=unchecked\]\:bg-input\/80:is(.dark *)[data-state=unchecked]{background-color:color-mix(in oklab,var(--input) 80%,transparent)}}.dark\:data-\[variant\=destructive\]\:focus\:bg-destructive\/20:is(.dark *)[data-variant=destructive]:focus{background-color:var(--destructive)}@supports (color: color-mix(in lab,red,red)){.dark\:data-\[variant\=destructive\]\:focus\:bg-destructive\/20:is(.dark *)[data-variant=destructive]:focus{background-color:color-mix(in oklab,var(--destructive) 20%,transparent)}}.\[\&_\.recharts-cartesian-axis-tick_text\]\:fill-muted-foreground .recharts-cartesian-axis-tick text{fill:var(--muted-foreground)}.\[\&_\.recharts-cartesian-grid_line\[stroke\=\'\#ccc\'\]\]\:stroke-border\/50 .recharts-cartesian-grid line[stroke="#ccc"]{stroke:var(--border)}@supports (color: color-mix(in lab,red,red)){.\[\&_\.recharts-cartesian-grid_line\[stroke\=\'\#ccc\'\]\]\:stroke-border\/50 .recharts-cartesian-grid line[stroke="#ccc"]{stroke:color-mix(in oklab,var(--border) 50%,transparent)}}.\[\&_\.recharts-curve\.recharts-tooltip-cursor\]\:stroke-border .recharts-curve.recharts-tooltip-cursor{stroke:var(--border)}.\[\&_\.recharts-dot\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-dot[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-layer\]\:outline-hidden .recharts-layer{--tw-outline-style: none;outline-style:none}@media (forced-colors: active){.\[\&_\.recharts-layer\]\:outline-hidden .recharts-layer{outline:2px solid transparent;outline-offset:2px}}.\[\&_\.recharts-polar-grid_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-polar-grid [stroke="#ccc"]{stroke:var(--border)}.\[\&_\.recharts-radial-bar-background-sector\]\:fill-muted .recharts-radial-bar-background-sector{fill:var(--muted)}.\[\&_\.recharts-rectangle\.recharts-tooltip-cursor\]\:fill-muted .recharts-rectangle.recharts-tooltip-cursor{fill:var(--muted)}.\[\&_\.recharts-reference-line_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-reference-line [stroke="#ccc"]{stroke:var(--border)}.\[\&_\.recharts-sector\]\:outline-hidden .recharts-sector{--tw-outline-style: none;outline-style:none}@media (forced-colors: active){.\[\&_\.recharts-sector\]\:outline-hidden .recharts-sector{outline:2px solid transparent;outline-offset:2px}}.\[\&_\.recharts-sector\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-sector[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-surface\]\:outline-hidden .recharts-surface{--tw-outline-style: none;outline-style:none}@media (forced-colors: active){.\[\&_\.recharts-surface\]\:outline-hidden .recharts-surface{outline:2px solid transparent;outline-offset:2px}}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-inline:calc(var(--spacing) * 2)}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-block:calc(var(--spacing) * 1.5)}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:var(--text-xs);line-height:var(--tw-leading, var(--text-xs--line-height))}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{--tw-font-weight: var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:var(--muted-foreground)}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-inline:calc(var(--spacing) * 2)}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:calc(var(--spacing) * 0)}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:calc(var(--spacing) * 5)}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:calc(var(--spacing) * 5)}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:calc(var(--spacing) * 12)}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-inline:calc(var(--spacing) * 2)}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-block:calc(var(--spacing) * 3)}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:calc(var(--spacing) * 5)}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:calc(var(--spacing) * 5)}.\[\&_p\]\:leading-relaxed p{--tw-leading: var(--leading-relaxed);line-height:var(--leading-relaxed)}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&_svg\:not\(\[class\*\=\'text-\'\]\)\]\:text-muted-foreground svg:not([class*=text-]){color:var(--muted-foreground)}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-style:var(--tw-border-style);border-width:0px}.\[\&\:\:-webkit-calendar-picker-indicator\]\:hidden::-webkit-calendar-picker-indicator{display:none}.\[\&\:\:-webkit-calendar-picker-indicator\]\:appearance-none::-webkit-calendar-picker-indicator{appearance:none}.\[\&\:first-child\[data-selected\=true\]_button\]\:rounded-l-md:first-child[data-selected=true] button{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:calc(var(--spacing) * 0)}.\[\.border-b\]\:pb-6:is(.border-b){padding-bottom:calc(var(--spacing) * 6)}.\[\.border-t\]\:pt-6:is(.border-t){padding-top:calc(var(--spacing) * 6)}:is(.rtl\:\*\*\:\[\.rdp-button\\_next\>svg\]\:rotate-180:where(:dir(rtl),[dir=rtl],[dir=rtl] *) *):is(.rdp-button_next>svg){rotate:180deg}:is(.rtl\:\*\*\:\[\.rdp-button\\_previous\>svg\]\:rotate-180:where(:dir(rtl),[dir=rtl],[dir=rtl] *) *):is(.rdp-button_previous>svg){rotate:180deg}:is(.\*\:\[span\]\:last\:flex>*):is(span):last-child{display:flex}:is(.\*\:\[span\]\:last\:items-center>*):is(span):last-child{align-items:center}:is(.\*\:\[span\]\:last\:gap-2>*):is(span):last-child{gap:calc(var(--spacing) * 2)}:is(.data-\[variant\=destructive\]\:\*\:\[svg\]\:\!text-destructive[data-variant=destructive]>*):is(svg){color:var(--destructive)!important}.\[\&\:last-child\[data-selected\=true\]_button\]\:rounded-r-md:last-child[data-selected=true] button{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y: 2px;translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&\>button\]\:hidden>button{display:none}.\[\&\>div\]\:bg-blue-500>div{background-color:var(--color-blue-500)}.\[\&\>div\]\:bg-green-500>div{background-color:var(--color-green-500)}.\[\&\>div\]\:bg-orange-500>div{background-color:var(--color-orange-500)}.\[\&\>div\]\:bg-red-500>div{background-color:var(--color-red-500)}.\[\&\>div\]\:bg-yellow-500>div{background-color:var(--color-yellow-500)}.\[\&\>div\]\:bg-gradient-to-r>div{--tw-gradient-position: to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.\[\&\>div\]\:from-purple-500>div{--tw-gradient-from: var(--color-purple-500);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.\[\&\>div\]\:to-pink-500>div{--tw-gradient-to: var(--color-pink-500);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.\[\&\>span\]\:text-xs>span{font-size:var(--text-xs);line-height:var(--tw-leading, var(--text-xs--line-height))}.\[\&\>span\]\:opacity-70>span{opacity:70%}.\[\&\>span\:last-child\]\:truncate>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.\[\&\>svg\]\:pointer-events-none>svg{pointer-events:none}.\[\&\>svg\]\:size-3>svg{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\[\&\>svg\]\:size-3\.5>svg{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.\[\&\>svg\]\:size-4>svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&\>svg\]\:h-2\.5>svg{height:calc(var(--spacing) * 2.5)}.\[\&\>svg\]\:h-3>svg{height:calc(var(--spacing) * 3)}.\[\&\>svg\]\:w-2\.5>svg{width:calc(var(--spacing) * 2.5)}.\[\&\>svg\]\:w-3>svg{width:calc(var(--spacing) * 3)}.\[\&\>svg\]\:shrink-0>svg{flex-shrink:0}.\[\&\>svg\]\:translate-y-0\.5>svg{--tw-translate-y: calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&\>svg\]\:text-current>svg{color:currentcolor}.\[\&\>svg\]\:text-muted-foreground>svg{color:var(--muted-foreground)}.\[\&\>svg\]\:text-sidebar-accent-foreground>svg{color:var(--sidebar-accent-foreground)}.\[\&\>tr\]\:last\:border-b-0>tr:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0px}.\[\&\[data-panel-group-direction\=vertical\]\>div\]\:rotate-90[data-panel-group-direction=vertical]>div{rotate:90deg}.\[\&\[data-state\=open\]\>svg\]\:rotate-180[data-state=open]>svg{rotate:180deg}[data-side=left][data-collapsible=offcanvas] .\[\[data-side\=left\]\[data-collapsible\=offcanvas\]_\&\]\:-right-2{right:calc(var(--spacing) * -2)}[data-side=left][data-state=collapsed] .\[\[data-side\=left\]\[data-state\=collapsed\]_\&\]\:cursor-e-resize{cursor:e-resize}[data-side=right][data-collapsible=offcanvas] .\[\[data-side\=right\]\[data-collapsible\=offcanvas\]_\&\]\:-left-2{left:calc(var(--spacing) * -2)}[data-side=right][data-state=collapsed] .\[\[data-side\=right\]\[data-state\=collapsed\]_\&\]\:cursor-w-resize{cursor:w-resize}[data-slot=card-content] .\[\[data-slot\=card-content\]_\&\]\:bg-transparent{background-color:transparent}[data-slot=popover-content] .\[\[data-slot\=popover-content\]_\&\]\:bg-transparent{background-color:transparent}@media (hover: hover){a.\[a\&\]\:hover\:bg-accent:hover{background-color:var(--accent)}}@media (hover: hover){a.\[a\&\]\:hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color: color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--destructive) 90%,transparent)}}}@media (hover: hover){a.\[a\&\]\:hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color: color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--primary) 90%,transparent)}}}@media (hover: hover){a.\[a\&\]\:hover\:bg-secondary\/90:hover{background-color:var(--secondary)}@supports (color: color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-secondary\/90:hover{background-color:color-mix(in oklab,var(--secondary) 90%,transparent)}}}@media (hover: hover){a.\[a\&\]\:hover\:text-accent-foreground:hover{color:var(--accent-foreground)}}}@property --tw-animation-delay{syntax: "*"; inherits: false; initial-value: 0s;}@property --tw-animation-direction{syntax: "*"; inherits: false; initial-value: normal;}@property --tw-animation-duration{syntax: "*"; inherits: false;}@property --tw-animation-fill-mode{syntax: "*"; inherits: false; initial-value: none;}@property --tw-animation-iteration-count{syntax: "*"; inherits: false; initial-value: 1;}@property --tw-enter-opacity{syntax: "*"; inherits: false; initial-value: 1;}@property --tw-enter-rotate{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-enter-scale{syntax: "*"; inherits: false; initial-value: 1;}@property --tw-enter-translate-x{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-enter-translate-y{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-exit-opacity{syntax: "*"; inherits: false; initial-value: 1;}@property --tw-exit-rotate{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-exit-scale{syntax: "*"; inherits: false; initial-value: 1;}@property --tw-exit-translate-x{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-exit-translate-y{syntax: "*"; inherits: false; initial-value: 0;}:root{--background: oklch(1 0 0);--foreground: oklch(.145 0 0);--card: oklch(1 0 0);--card-foreground: oklch(.145 0 0);--popover: oklch(1 0 0);--popover-foreground: oklch(.145 0 0);--primary: oklch(67.35% .153 159.64);--primary-foreground: oklch(.985 0 0);--secondary: oklch(.97 0 0);--secondary-foreground: oklch(.205 0 0);--muted: oklch(.97 0 0);--muted-foreground: oklch(.556 0 0);--accent: oklch(.97 0 0);--accent-foreground: oklch(.205 0 0);--destructive: oklch(.577 .245 27.325);--destructive-foreground: oklch(.577 .245 27.325);--border: oklch(.922 0 0);--input: oklch(.922 0 0);--ring: oklch(.708 0 0);--chart-1: oklch(.646 .222 41.116);--chart-2: oklch(.6 .118 184.704);--chart-3: oklch(.398 .07 227.392);--chart-4: oklch(.828 .189 84.429);--chart-5: oklch(.769 .188 70.08);--radius: .625rem;--sidebar: oklch(.985 0 0);--sidebar-foreground: oklch(.145 0 0);--sidebar-primary: oklch(.205 0 0);--sidebar-primary-foreground: oklch(.985 0 0);--sidebar-accent: oklch(.97 0 0);--sidebar-accent-foreground: oklch(.205 0 0);--sidebar-border: oklch(.922 0 0);--sidebar-ring: oklch(.708 0 0)}.dark{--background: oklch(.145 0 0);--foreground: oklch(.985 0 0);--card: oklch(.145 0 0);--card-foreground: oklch(.985 0 0);--popover: oklch(.145 0 0);--popover-foreground: oklch(.985 0 0);--primary: oklch(88.18% .202 159.34);--primary-foreground: oklch(.205 0 0);--secondary: oklch(.269 0 0);--secondary-foreground: oklch(.985 0 0);--muted: oklch(.269 0 0);--muted-foreground: oklch(.708 0 0);--accent: oklch(.269 0 0);--accent-foreground: oklch(.985 0 0);--destructive: oklch(.396 .141 25.723);--destructive-foreground: oklch(.637 .237 25.331);--border: oklch(.269 0 0);--input: oklch(.269 0 0);--ring: oklch(.439 0 0);--chart-1: oklch(.488 .243 264.376);--chart-2: oklch(.696 .17 162.48);--chart-3: oklch(.769 .188 70.08);--chart-4: oklch(.627 .265 303.9);--chart-5: oklch(.645 .246 16.439);--sidebar: oklch(.205 0 0);--sidebar-foreground: oklch(.985 0 0);--sidebar-primary: oklch(.488 .243 264.376);--sidebar-primary-foreground: oklch(.985 0 0);--sidebar-accent: oklch(.269 0 0);--sidebar-accent-foreground: oklch(.985 0 0);--sidebar-border: oklch(.269 0 0);--sidebar-ring: oklch(.439 0 0)}@layer base{*{border-color:var(--border);outline-color:var(--ring)}@supports (color: color-mix(in lab,red,red)){*{outline-color:color-mix(in oklab,var(--ring) 50%,transparent)}}body{background-color:var(--background);color:var(--foreground)}}@property --tw-translate-x{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-translate-y{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-translate-z{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-rotate-x{syntax: "*"; inherits: false;}@property --tw-rotate-y{syntax: "*"; inherits: false;}@property --tw-rotate-z{syntax: "*"; inherits: false;}@property --tw-skew-x{syntax: "*"; inherits: false;}@property --tw-skew-y{syntax: "*"; inherits: false;}@property --tw-space-y-reverse{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-space-x-reverse{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-border-style{syntax: "*"; inherits: false; initial-value: solid;}@property --tw-gradient-position{syntax: "*"; inherits: false;}@property --tw-gradient-from{syntax: ""; inherits: false; initial-value: #0000;}@property --tw-gradient-via{syntax: ""; inherits: false; initial-value: #0000;}@property --tw-gradient-to{syntax: ""; inherits: false; initial-value: #0000;}@property --tw-gradient-stops{syntax: "*"; inherits: false;}@property --tw-gradient-via-stops{syntax: "*"; inherits: false;}@property --tw-gradient-from-position{syntax: ""; inherits: false; initial-value: 0%;}@property --tw-gradient-via-position{syntax: ""; inherits: false; initial-value: 50%;}@property --tw-gradient-to-position{syntax: ""; inherits: false; initial-value: 100%;}@property --tw-leading{syntax: "*"; inherits: false;}@property --tw-font-weight{syntax: "*"; inherits: false;}@property --tw-tracking{syntax: "*"; inherits: false;}@property --tw-ordinal{syntax: "*"; inherits: false;}@property --tw-slashed-zero{syntax: "*"; inherits: false;}@property --tw-numeric-figure{syntax: "*"; inherits: false;}@property --tw-numeric-spacing{syntax: "*"; inherits: false;}@property --tw-numeric-fraction{syntax: "*"; inherits: false;}@property --tw-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: "*"; inherits: false;}@property --tw-shadow-alpha{syntax: ""; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: "*"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: ""; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: "*"; inherits: false;}@property --tw-ring-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: "*"; inherits: false;}@property --tw-inset-ring-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: "*"; inherits: false;}@property --tw-ring-offset-width{syntax: ""; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: "*"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-outline-style{syntax: "*"; inherits: false; initial-value: solid;}@property --tw-duration{syntax: "*"; inherits: false;}@property --tw-ease{syntax: "*"; inherits: false;}@property --tw-content{syntax: "*"; initial-value: ""; inherits: false;}@keyframes pulse{50%{opacity:.5}}@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))}}@keyframes accordion-down{0%{height:0}to{height:var(--radix-accordion-content-height,var(--bits-accordion-content-height,var(--reka-accordion-content-height,var(--kb-accordion-content-height,auto))))}}@keyframes accordion-up{0%{height:var(--radix-accordion-content-height,var(--bits-accordion-content-height,var(--reka-accordion-content-height,var(--kb-accordion-content-height,auto))))}to{height:0}}@keyframes caret-blink{0%,70%,to{opacity:1}20%,50%{opacity:0}}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x: 0;--tw-translate-y: 0;--tw-translate-z: 0;--tw-rotate-x: initial;--tw-rotate-y: initial;--tw-rotate-z: initial;--tw-skew-x: initial;--tw-skew-y: initial;--tw-space-y-reverse: 0;--tw-space-x-reverse: 0;--tw-border-style: solid;--tw-gradient-position: initial;--tw-gradient-from: #0000;--tw-gradient-via: #0000;--tw-gradient-to: #0000;--tw-gradient-stops: initial;--tw-gradient-via-stops: initial;--tw-gradient-from-position: 0%;--tw-gradient-via-position: 50%;--tw-gradient-to-position: 100%;--tw-leading: initial;--tw-font-weight: initial;--tw-tracking: initial;--tw-ordinal: initial;--tw-slashed-zero: initial;--tw-numeric-figure: initial;--tw-numeric-spacing: initial;--tw-numeric-fraction: initial;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000;--tw-outline-style: solid;--tw-duration: initial;--tw-ease: initial;--tw-content: "";--tw-animation-delay: 0s;--tw-animation-direction: normal;--tw-animation-duration: initial;--tw-animation-fill-mode: none;--tw-animation-iteration-count: 1;--tw-enter-opacity: 1;--tw-enter-rotate: 0;--tw-enter-scale: 1;--tw-enter-translate-x: 0;--tw-enter-translate-y: 0;--tw-exit-opacity: 1;--tw-exit-rotate: 0;--tw-exit-scale: 1;--tw-exit-translate-x: 0;--tw-exit-translate-y: 0}}}/*! tailwindcss v4.1.10 | MIT License | https://tailwindcss.com *//*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-x-reverse:0;--tw-border-style:solid;--tw-divide-y-reverse:0;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-content:"";--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-200:oklch(88.5% .062 18.334);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-800:oklch(44.4% .177 26.899);--color-red-900:oklch(39.6% .141 25.723);--color-amber-500:oklch(76.9% .188 70.08);--color-yellow-50:oklch(98.7% .026 102.212);--color-yellow-500:oklch(79.5% .184 86.047);--color-yellow-950:oklch(28.6% .066 53.813);--color-green-500:oklch(72.3% .219 149.579);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-rose-600:oklch(58.6% .253 17.585);--color-rose-700:oklch(51.4% .222 16.935);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-4xl:56rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-widest:.1em;--radius-xs:.125rem;--radius-3xl:1.5rem;--animate-spin:spin 1s linear infinite;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){*{outline-color:color-mix(in oklab,var(--ring) 50%,transparent)}}html,body{height:100%;margin:0;padding:0;overflow:hidden}body{background-color:var(--background);color:var(--foreground);font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif}#root{height:100%}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:0 0;border-radius:4px}::-webkit-scrollbar-thumb{background-color:#ffffff26;background-clip:content-box;border:2px solid #0000;border-radius:4px;transition:background-color .2s}::-webkit-scrollbar-thumb:hover{background-color:#ffffff40}*{scrollbar-width:thin;scrollbar-color:#ffffff26 transparent}@media (max-width:768px){*{scrollbar-width:none}::-webkit-scrollbar{display:none}}}@layer components;@layer utilities{.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.top-0{top:calc(var(--spacing) * 0)}.top-1\/2{top:50%}.top-4{top:calc(var(--spacing) * 4)}.top-\[50\%\]{top:50%}.right-0{right:calc(var(--spacing) * 0)}.right-4{right:calc(var(--spacing) * 4)}.-bottom-4{bottom:calc(var(--spacing) * -4)}.left-0{left:calc(var(--spacing) * 0)}.left-3{left:calc(var(--spacing) * 3)}.left-\[50\%\]{left:50%}.z-10{z-index:10}.z-50{z-index:50}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.-m-2{margin:calc(var(--spacing) * -2)}.m-4{margin:calc(var(--spacing) * 4)}.-mx-4{margin-inline:calc(var(--spacing) * -4)}.mx-4{margin-inline:calc(var(--spacing) * 4)}.mx-auto{margin-inline:auto}.my-2{margin-block:calc(var(--spacing) * 2)}.my-4{margin-block:calc(var(--spacing) * 4)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mt-10{margin-top:calc(var(--spacing) * 10)}.mt-12{margin-top:calc(var(--spacing) * 12)}.mr-1{margin-right:calc(var(--spacing) * 1)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mr-16{margin-right:calc(var(--spacing) * 16)}.mb-0\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.mb-12{margin-bottom:calc(var(--spacing) * 12)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-7{margin-left:calc(var(--spacing) * 7)}.ml-auto{margin-left:auto}.box-border{box-sizing:border-box}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.field-sizing-content{field-sizing:content}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-16{height:calc(var(--spacing) * 16)}.h-24{height:calc(var(--spacing) * 24)}.h-56{height:calc(var(--spacing) * 56)}.h-64{height:calc(var(--spacing) * 64)}.h-\[1\.2rem\]{height:1.2rem}.h-\[1px\]{height:1px}.h-\[85vh\]{height:85vh}.h-auto{height:auto}.h-full{height:100%}.h-screen{height:100vh}.max-h-32{max-height:calc(var(--spacing) * 32)}.max-h-\[200px\]{max-height:200px}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-9{min-height:calc(var(--spacing) * 9)}.min-h-16{min-height:calc(var(--spacing) * 16)}.min-h-\[40vh\]{min-height:40vh}.min-h-screen{min-height:100vh}.w-1{width:calc(var(--spacing) * 1)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-12{width:calc(var(--spacing) * 12)}.w-14{width:calc(var(--spacing) * 14)}.w-16{width:calc(var(--spacing) * 16)}.w-20{width:calc(var(--spacing) * 20)}.w-56{width:calc(var(--spacing) * 56)}.w-64{width:calc(var(--spacing) * 64)}.w-80{width:calc(var(--spacing) * 80)}.w-\[1\.2rem\]{width:1.2rem}.w-\[300px\]{width:300px}.w-full{width:100%}.w-px{width:1px}.max-w-2xl{max-width:var(--container-2xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-7xl{max-width:var(--container-7xl)}.max-w-32{max-width:calc(var(--spacing) * 32)}.max-w-40{max-width:calc(var(--spacing) * 40)}.max-w-\[60\%\]{max-width:60%}.max-w-\[64rem\]{max-width:64rem}.max-w-\[70\%\]{max-width:70%}.max-w-\[320px\]{max-width:320px}.max-w-\[calc\(100\%-2rem\)\]{max-width:calc(100% - 2rem)}.max-w-full{max-width:100%}.max-w-md{max-width:var(--container-md)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\[80px\]{min-width:80px}.min-w-\[180px\]{min-width:180px}.min-w-\[280px\]{min-width:280px}.flex-1{flex:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.translate-x-\[-50\%\]{--tw-translate-x:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.scale-0{--tw-scale-x:0%;--tw-scale-y:0%;--tw-scale-z:0%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}.rotate-0{rotate:0deg}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-1{gap:calc(var(--spacing) * 1)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-8{column-gap:calc(var(--spacing) * 8)}:where(.space-x-3>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * 3) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-x-reverse)))}.gap-y-2{row-gap:calc(var(--spacing) * 2)}:where(.divide-x>:not(:last-child)){--tw-divide-x-reverse:0;border-inline-style:var(--tw-border-style);border-inline-start-width:calc(1px * var(--tw-divide-x-reverse));border-inline-end-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}.self-end{align-self:flex-end}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-3xl{border-radius:var(--radius-3xl)}.rounded-\[16px\]{border-radius:16px}.rounded-full{border-radius:3.40282e38px}.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:calc(var(--radius) + 4px)}.rounded-xs{border-radius:var(--radius-xs)}.rounded-l-lg{border-top-left-radius:var(--radius);border-bottom-left-radius:var(--radius)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-none{--tw-border-style:none;border-style:none}.border-amber-500\/40{border-color:#f99c0066}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/40{border-color:color-mix(in oklab,var(--color-amber-500) 40%,transparent)}}.border-black{border-color:var(--color-black)}.border-black\/10{border-color:#0000001a}@supports (color:color-mix(in lab,red,red)){.border-black\/10{border-color:color-mix(in oklab,var(--color-black) 10%,transparent)}}.border-border,.border-border\/50{border-color:var(--border)}@supports (color:color-mix(in lab,red,red)){.border-border\/50{border-color:color-mix(in oklab,var(--border) 50%,transparent)}}.border-destructive{border-color:var(--destructive)}.border-gray-300{border-color:var(--color-gray-300)}.border-input{border-color:var(--input)}.border-muted{border-color:var(--muted)}.border-sidebar-border{border-color:var(--sidebar-border)}.border-l-primary{border-left-color:var(--primary)}.bg-\[\#b2ece0\]{background-color:#b2ece0}.bg-\[\#c8fff2\]{background-color:#c8fff2}.bg-\[\#d2e2e2\]{background-color:#d2e2e2}.bg-\[\#e0f0f0\]{background-color:#e0f0f0}.bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/10{background-color:color-mix(in oklab,var(--color-amber-500) 10%,transparent)}}.bg-background,.bg-background\/80{background-color:var(--background)}@supports (color:color-mix(in lab,red,red)){.bg-background\/80{background-color:color-mix(in oklab,var(--background) 80%,transparent)}}.bg-background\/95{background-color:var(--background)}@supports (color:color-mix(in lab,red,red)){.bg-background\/95{background-color:color-mix(in oklab,var(--background) 95%,transparent)}}.bg-black\/5{background-color:#0000000d}@supports (color:color-mix(in lab,red,red)){.bg-black\/5{background-color:color-mix(in oklab,var(--color-black) 5%,transparent)}}.bg-black\/10{background-color:#0000001a}@supports (color:color-mix(in lab,red,red)){.bg-black\/10{background-color:color-mix(in oklab,var(--color-black) 10%,transparent)}}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black) 50%,transparent)}}.bg-blue-100{background-color:var(--color-blue-100)}.bg-blue-700{background-color:var(--color-blue-700)}.bg-card,.bg-card\/50{background-color:var(--card)}@supports (color:color-mix(in lab,red,red)){.bg-card\/50{background-color:color-mix(in oklab,var(--card) 50%,transparent)}}.bg-gray-100{background-color:var(--color-gray-100)}.bg-green-500\/10{background-color:#00c7581a}@supports (color:color-mix(in lab,red,red)){.bg-green-500\/10{background-color:color-mix(in oklab,var(--color-green-500) 10%,transparent)}}.bg-muted,.bg-muted\/10{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\/10{background-color:color-mix(in oklab,var(--muted) 10%,transparent)}}.bg-muted\/30{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\/30{background-color:color-mix(in oklab,var(--muted) 30%,transparent)}}.bg-muted\/50{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\/50{background-color:color-mix(in oklab,var(--muted) 50%,transparent)}}.bg-primary,.bg-primary\/10{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.bg-primary\/10{background-color:color-mix(in oklab,var(--primary) 10%,transparent)}}.bg-primary\/20{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.bg-primary\/20{background-color:color-mix(in oklab,var(--primary) 20%,transparent)}}.bg-primary\/30{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.bg-primary\/30{background-color:color-mix(in oklab,var(--primary) 30%,transparent)}}.bg-red-50{background-color:var(--color-red-50)}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500) 10%,transparent)}}.bg-sidebar{background-color:var(--sidebar)}.bg-sidebar-accent\/50{background-color:var(--sidebar-accent)}@supports (color:color-mix(in lab,red,red)){.bg-sidebar-accent\/50{background-color:color-mix(in oklab,var(--sidebar-accent) 50%,transparent)}}.bg-sidebar-border{background-color:var(--sidebar-border)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-yellow-50{background-color:var(--color-yellow-50)}.bg-yellow-500\/10{background-color:#edb2001a}@supports (color:color-mix(in lab,red,red)){.bg-yellow-500\/10{background-color:color-mix(in oklab,var(--color-yellow-500) 10%,transparent)}}.bg-gradient-to-t{--tw-gradient-position:to top in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-primary\/20{--tw-gradient-from:var(--primary)}@supports (color:color-mix(in lab,red,red)){.from-primary\/20{--tw-gradient-from:color-mix(in oklab, var(--primary) 20%, transparent)}}.from-primary\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.via-background\/95{--tw-gradient-via:var(--background)}@supports (color:color-mix(in lab,red,red)){.via-background\/95{--tw-gradient-via:color-mix(in oklab, var(--background) 95%, transparent)}}.via-background\/95{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.to-background{--tw-gradient-to:var(--background);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.fill-gray-100{fill:var(--color-gray-100)}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.p-0{padding:calc(var(--spacing) * 0)}.p-1{padding:calc(var(--spacing) * 1)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.p-\[0\.375rem_1rem_0_1rem\]{padding:.375rem 1rem 0}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-8{padding-inline:calc(var(--spacing) * 8)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-16{padding-block:calc(var(--spacing) * 16)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-5{padding-top:calc(var(--spacing) * 5)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-9{padding-left:calc(var(--spacing) * 9)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[11px\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.text-wrap{text-wrap:wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.overflow-ellipsis,.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#008069\]{color:#008069}.text-\[\#b03f3f\]{color:#b03f3f}.text-black{color:var(--color-black)}.text-blue-600{color:var(--color-blue-600)}.text-blue-700{color:var(--color-blue-700)}.text-destructive{color:var(--destructive)}.text-foreground{color:var(--foreground)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-900{color:var(--color-gray-900)}.text-green-500{color:var(--color-green-500)}.text-muted-foreground,.text-muted-foreground\/40{color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/40{color:color-mix(in oklab,var(--muted-foreground) 40%,transparent)}}.text-muted-foreground\/50{color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/50{color:color-mix(in oklab,var(--muted-foreground) 50%,transparent)}}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-red-500{color:var(--color-red-500)}.text-red-800{color:var(--color-red-800)}.text-rose-600{color:var(--color-rose-600)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-sidebar-foreground,.text-sidebar-foreground\/60{color:var(--sidebar-foreground)}@supports (color:color-mix(in lab,red,red)){.text-sidebar-foreground\/60{color:color-mix(in oklab,var(--sidebar-foreground) 60%,transparent)}}.text-sidebar-foreground\/70{color:var(--sidebar-foreground)}@supports (color:color-mix(in lab,red,red)){.text-sidebar-foreground\/70{color:color-mix(in oklab,var(--sidebar-foreground) 70%,transparent)}}.text-yellow-500{color:var(--color-yellow-500)}.underline{text-decoration-line:underline}.caret-transparent{caret-color:#0000}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-muted-foreground{--tw-ring-color:var(--muted-foreground)}.ring-offset-background{--tw-ring-offset-color:var(--background)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.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(var(--blur-sm));-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-\[color\,box-shadow\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.outline-none{--tw-outline-style:none;outline-style:none}.paused{animation-play-state:paused}.running{animation-play-state:running}@media (hover:hover){.group-hover\:visible:is(:where(.group):hover *){visibility:visible}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.selection\:bg-primary ::selection{background-color:var(--primary)}.selection\:bg-primary::selection{background-color:var(--primary)}.selection\:text-primary-foreground ::selection{color:var(--primary-foreground)}.selection\:text-primary-foreground::selection{color:var(--primary-foreground)}.file\:inline-flex::file-selector-button{display:inline-flex}.file\:h-7::file-selector-button{height:calc(var(--spacing) * 7)}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--foreground)}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:bottom-\[12px\]:after{content:var(--tw-content);bottom:12px}.after\:border-\[8px\]:after{content:var(--tw-content);border-style:var(--tw-border-style);border-width:8px}.after\:border-solid:after{content:var(--tw-content);--tw-border-style:solid;border-style:solid}@media (hover:hover){.hover\:bg-\[\#a4ecde\]:hover{background-color:#a4ecde}.hover\:bg-\[\#b2ece0\]:hover{background-color:#b2ece0}.hover\:bg-\[\#c2d2d2\]:hover{background-color:#c2d2d2}.hover\:bg-accent:hover{background-color:var(--accent)}.hover\:bg-black\/10:hover{background-color:#0000001a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-black\/10:hover{background-color:color-mix(in oklab,var(--color-black) 10%,transparent)}}.hover\:bg-green-500\/20:hover{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.hover\:bg-green-500\/20:hover{background-color:color-mix(in oklab,var(--color-green-500) 20%,transparent)}}.hover\:bg-primary\/85:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/85:hover{background-color:color-mix(in oklab,var(--primary) 85%,transparent)}}.hover\:bg-red-500\/10:hover{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/10:hover{background-color:color-mix(in oklab,var(--color-red-500) 10%,transparent)}}.hover\:bg-red-500\/20:hover{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/20:hover{background-color:color-mix(in oklab,var(--color-red-500) 20%,transparent)}}.hover\:bg-sidebar-accent:hover,.hover\:bg-sidebar-accent\/30:hover{background-color:var(--sidebar-accent)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-sidebar-accent\/30:hover{background-color:color-mix(in oklab,var(--sidebar-accent) 30%,transparent)}}.hover\:bg-yellow-500\/20:hover{background-color:#edb20033}@supports (color:color-mix(in lab,red,red)){.hover\:bg-yellow-500\/20:hover{background-color:color-mix(in oklab,var(--color-yellow-500) 20%,transparent)}}.hover\:stroke-destructive:hover{stroke:var(--destructive)}.hover\:text-foreground:hover{color:var(--foreground)}.hover\:text-primary:hover{color:var(--primary)}.hover\:text-red-400:hover{color:var(--color-red-400)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-lg:hover{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-black\/10:hover{--tw-shadow-color:#0000001a}@supports (color:color-mix(in lab,red,red)){.hover\:shadow-black\/10:hover{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 10%, transparent) var(--tw-shadow-alpha), transparent)}}}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-ring:focus{--tw-ring-color:var(--ring)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus\:outline-hidden:focus{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.focus\:outline-hidden:focus{outline-offset:2px;outline:2px solid #0000}}.focus-visible\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\:ring-0:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-ring:focus-visible,.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}.focus-visible\:ring-transparent:focus-visible{--tw-ring-color:transparent}.focus-visible\:ring-offset-0:focus-visible{--tw-ring-offset-width:0px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus-visible\:ring-offset-transparent:focus-visible{--tw-ring-offset-color:transparent}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-muted:disabled{background-color:var(--muted)}.disabled\:text-muted-foreground:disabled{color:var(--muted-foreground)}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.data-\[state\=active\]\:bg-primary[data-state=active]{background-color:var(--primary)}.data-\[state\=active\]\:text-primary-foreground[data-state=active]{color:var(--primary-foreground)}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\[state\=open\]\:rotate-180[data-state=open]{rotate:180deg}.data-\[state\=open\]\:animate-in[data-state=open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:var(--accent)}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:var(--muted-foreground)}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}@media (min-width:40rem){.sm\:inline{display:inline}.sm\:max-h-\[600px\]{max-height:600px}.sm\:w-auto{width:auto}.sm\:max-w-\[650px\]{max-width:650px}.sm\:max-w-\[740px\]{max-width:740px}.sm\:max-w-lg{max-width:var(--container-lg)}.sm\:max-w-md{max-width:var(--container-md)}.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\:gap-0{gap:calc(var(--spacing) * 0)}.sm\:text-left{text-align:left}}@media (min-width:48rem){.md\:flex{display:flex}.md\:inline{display:inline}.md\:w-80{width:calc(var(--spacing) * 80)}.md\:flex-shrink-0{flex-shrink:0}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-\[1fr_auto\]{grid-template-columns:1fr auto}.md\:flex-row{flex-direction:row}.md\:items-center{align-items:center}.md\:items-start{align-items:flex-start}.md\:justify-between{justify-content:space-between}.md\:gap-8{gap:calc(var(--spacing) * 8)}.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}@media (min-width:64rem){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width:80rem){.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}.dark\:scale-0:is(.dark *){--tw-scale-x:0%;--tw-scale-y:0%;--tw-scale-z:0%;scale:var(--tw-scale-x) var(--tw-scale-y)}.dark\:scale-100:is(.dark *){--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}.dark\:-rotate-90:is(.dark *){rotate:-90deg}.dark\:rotate-0:is(.dark *){rotate:0deg}.dark\:border-gray-700:is(.dark *){border-color:var(--color-gray-700)}.dark\:border-white\/10:is(.dark *){border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.dark\:border-white\/10:is(.dark *){border-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.dark\:bg-\[\#0b332a\]:is(.dark *){background-color:#0b332a}.dark\:bg-\[\#0f1413\]:is(.dark *){background-color:#0f1413}.dark\:bg-\[\#1d2724\]:is(.dark *){background-color:#1d2724}.dark\:bg-\[\#082720\]:is(.dark *){background-color:#082720}.dark\:bg-blue-300:is(.dark *){background-color:var(--color-blue-300)}.dark\:bg-gray-800:is(.dark *){background-color:var(--color-gray-800)}.dark\:bg-gray-900:is(.dark *){background-color:var(--color-gray-900)}.dark\:bg-input\/30:is(.dark *){background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-input\/30:is(.dark *){background-color:color-mix(in oklab,var(--input) 30%,transparent)}}.dark\:bg-red-900:is(.dark *){background-color:var(--color-red-900)}.dark\:bg-white\/5:is(.dark *){background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.dark\:bg-white\/5:is(.dark *){background-color:color-mix(in oklab,var(--color-white) 5%,transparent)}}.dark\:bg-white\/10:is(.dark *){background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.dark\:bg-white\/10:is(.dark *){background-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.dark\:bg-yellow-950:is(.dark *){background-color:var(--color-yellow-950)}.dark\:fill-gray-800:is(.dark *){fill:var(--color-gray-800)}.dark\:text-\[\#00a884\]:is(.dark *){color:#00a884}.dark\:text-blue-300:is(.dark *){color:var(--color-blue-300)}.dark\:text-gray-100:is(.dark *){color:var(--color-gray-100)}.dark\:text-gray-300:is(.dark *){color:var(--color-gray-300)}.dark\:text-gray-400:is(.dark *){color:var(--color-gray-400)}.dark\:text-red-200:is(.dark *){color:var(--color-red-200)}.dark\:text-white:is(.dark *){color:var(--color-white)}@media (hover:hover){.dark\:hover\:bg-\[\#071f19\]:is(.dark *):hover{background-color:#071f19}.dark\:hover\:bg-\[\#141a18\]:is(.dark *):hover{background-color:#141a18}.dark\:hover\:bg-\[\#082720\]:is(.dark *):hover{background-color:#082720}.dark\:hover\:bg-white\/10:is(.dark *):hover{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-white\/10:is(.dark *):hover{background-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}}.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&\>\*\]\:p-4>*{padding:calc(var(--spacing) * 4)}.\[\&\>\*\]\:px-4>*{padding-inline:calc(var(--spacing) * 4)}.\[\&\>\*\]\:py-2>*{padding-block:calc(var(--spacing) * 2)}.\[\&\>svg\]\:fill-rose-600>svg{fill:var(--color-rose-600)}@media (hover:hover){.hover\:\[\&\>svg\]\:fill-rose-700:hover>svg{fill:var(--color-rose-700)}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes spin{to{transform:rotate(360deg)}}@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));filter:blur(var(--tw-enter-blur,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));filter:blur(var(--tw-exit-blur,0))}}: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;-ms-touch-action:none;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:-ms-flexbox;display:flex;-ms-flex-pack:justify;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;-ms-flex:1 1 auto;flex:1 1 auto;padding:6px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.Toastify__toast-body>div:last-child{word-break:break-word;-ms-flex:1;flex:1}.Toastify__toast-icon{-webkit-margin-end:10px;margin-inline-end:10px;width:20px;-ms-flex-negative:0;flex-shrink:0;display:-ms-flexbox;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;-ms-flex-item-align:start;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}.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}} +@layer properties;@layer theme,base,components,utilities;@layer theme{:root,:host{--font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-100: oklch(93.6% .032 17.717);--color-red-500: oklch(63.7% .237 25.331);--color-red-600: oklch(57.7% .245 27.325);--color-red-700: oklch(50.5% .213 27.518);--color-red-800: oklch(44.4% .177 26.899);--color-orange-100: oklch(95.4% .038 75.164);--color-orange-500: oklch(70.5% .213 47.604);--color-orange-600: oklch(64.6% .222 41.116);--color-orange-700: oklch(55.3% .195 38.402);--color-yellow-100: oklch(97.3% .071 103.193);--color-yellow-400: oklch(85.2% .199 91.936);--color-yellow-500: oklch(79.5% .184 86.047);--color-yellow-600: oklch(68.1% .162 75.834);--color-yellow-700: oklch(55.4% .135 66.442);--color-green-50: oklch(98.2% .018 155.826);--color-green-100: oklch(96.2% .044 156.743);--color-green-200: oklch(92.5% .084 155.995);--color-green-400: oklch(79.2% .209 151.711);--color-green-500: oklch(72.3% .219 149.579);--color-green-600: oklch(62.7% .194 149.214);--color-green-700: oklch(52.7% .154 150.069);--color-green-800: oklch(44.8% .119 151.328);--color-blue-50: oklch(97% .014 254.604);--color-blue-100: oklch(93.2% .032 255.585);--color-blue-200: oklch(88.2% .059 254.128);--color-blue-400: oklch(70.7% .165 254.624);--color-blue-500: oklch(62.3% .214 259.815);--color-blue-600: oklch(54.6% .245 262.881);--color-blue-700: oklch(48.8% .243 264.376);--color-blue-800: oklch(42.4% .199 265.638);--color-blue-900: oklch(37.9% .146 265.522);--color-purple-50: oklch(97.7% .014 308.299);--color-purple-100: oklch(94.6% .033 307.174);--color-purple-200: oklch(90.2% .063 306.703);--color-purple-500: oklch(62.7% .265 303.9);--color-purple-600: oklch(55.8% .288 302.321);--color-purple-700: oklch(49.6% .265 301.924);--color-purple-900: oklch(38.1% .176 304.987);--color-pink-50: oklch(97.1% .014 343.198);--color-pink-500: oklch(65.6% .241 354.308);--color-pink-600: oklch(59.2% .249 .584);--color-slate-50: oklch(98.4% .003 247.858);--color-slate-800: oklch(27.9% .041 260.031);--color-slate-900: oklch(20.8% .042 265.755);--color-gray-400: oklch(70.7% .022 261.325);--color-gray-600: oklch(44.6% .03 256.802);--color-gray-700: oklch(37.3% .034 259.733);--color-gray-900: oklch(21% .034 264.665);--color-black: #000;--color-white: #fff;--spacing: .25rem;--container-xs: 20rem;--container-sm: 24rem;--container-md: 28rem;--container-lg: 32rem;--container-2xl: 42rem;--container-4xl: 56rem;--container-6xl: 72rem;--text-xs: .75rem;--text-xs--line-height: calc(1 / .75);--text-sm: .875rem;--text-sm--line-height: calc(1.25 / .875);--text-base: 1rem;--text-base--line-height: 1.5 ;--text-lg: 1.125rem;--text-lg--line-height: calc(1.75 / 1.125);--text-xl: 1.25rem;--text-xl--line-height: calc(1.75 / 1.25);--text-2xl: 1.5rem;--text-2xl--line-height: calc(2 / 1.5);--text-3xl: 1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl: 2.25rem;--text-4xl--line-height: calc(2.5 / 2.25);--font-weight-normal: 400;--font-weight-medium: 500;--font-weight-semibold: 600;--font-weight-bold: 700;--tracking-tight: -.025em;--tracking-widest: .1em;--leading-tight: 1.25;--leading-snug: 1.375;--leading-relaxed: 1.625;--radius-xs: .125rem;--ease-in-out: cubic-bezier(.4, 0, .2, 1);--animate-spin: spin 1s linear infinite;--animate-pulse: pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--aspect-video: 16 / 9;--default-transition-duration: .15s;--default-transition-timing-function: cubic-bezier(.4, 0, .2, 1);--default-font-family: var(--font-sans);--default-mono-font-family: var(--font-mono);--color-background: var(--background);--color-foreground: var(--foreground);--color-primary: var(--primary);--color-primary-foreground: var(--primary-foreground);--color-secondary: var(--secondary);--color-secondary-foreground: var(--secondary-foreground);--color-muted: var(--muted);--color-muted-foreground: var(--muted-foreground);--color-accent: var(--accent);--color-accent-foreground: var(--accent-foreground);--color-destructive: var(--destructive);--color-destructive-foreground: var(--destructive-foreground);--color-border: var(--border);--color-input: var(--input);--color-ring: var(--ring)}}@layer base{*,:after,:before,::backdrop,::file-selector-button{box-sizing:border-box;margin:0;padding:0;border:0 solid}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;tab-size:4;font-family:var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings, normal);font-variation-settings:var(--default-font-variation-settings, normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings, normal);font-variation-settings:var(--default-mono-font-variation-settings, normal);font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea,::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px){::placeholder{color:currentcolor}@supports (color: color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]),::file-selector-button{appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer utilities{.\@container\/card-header{container-type:inline-size;container-name:card-header}.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing) * 0)}.inset-x-0{inset-inline:calc(var(--spacing) * 0)}.inset-y-0{inset-block:calc(var(--spacing) * 0)}.-top-2{top:calc(var(--spacing) * -2)}.-top-12{top:calc(var(--spacing) * -12)}.top-0{top:calc(var(--spacing) * 0)}.top-1\.5{top:calc(var(--spacing) * 1.5)}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing) * 2)}.top-3\.5{top:calc(var(--spacing) * 3.5)}.top-4{top:calc(var(--spacing) * 4)}.top-\[1px\]{top:1px}.top-\[50\%\]{top:50%}.top-\[60\%\]{top:60%}.top-full{top:100%}.-right-0{right:calc(var(--spacing) * -0)}.-right-2{right:calc(var(--spacing) * -2)}.-right-12{right:calc(var(--spacing) * -12)}.right-0{right:calc(var(--spacing) * 0)}.right-1{right:calc(var(--spacing) * 1)}.right-2{right:calc(var(--spacing) * 2)}.right-3{right:calc(var(--spacing) * 3)}.right-4{right:calc(var(--spacing) * 4)}.-bottom-0{bottom:calc(var(--spacing) * -0)}.-bottom-12{bottom:calc(var(--spacing) * -12)}.bottom-0{bottom:calc(var(--spacing) * 0)}.-left-12{left:calc(var(--spacing) * -12)}.left-0{left:calc(var(--spacing) * 0)}.left-1\/2{left:50%}.left-2{left:calc(var(--spacing) * 2)}.left-3{left:calc(var(--spacing) * 3)}.left-4{left:calc(var(--spacing) * 4)}.left-\[50\%\]{left:50%}.isolate{isolation:isolate}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\[1\]{z-index:1}.col-span-2{grid-column:span 2 / span 2}.col-span-3{grid-column:span 3 / span 3}.col-start-2{grid-column-start:2}.row-span-2{grid-row:span 2 / span 2}.row-span-3{grid-row:span 3 / span 3}.row-start-1{grid-row-start:1}.container{width:100%}@media (width >= 40rem){.container{max-width:40rem}}@media (width >= 48rem){.container{max-width:48rem}}@media (width >= 64rem){.container{max-width:64rem}}@media (width >= 80rem){.container{max-width:80rem}}@media (width >= 96rem){.container{max-width:96rem}}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-3\.5{margin-inline:calc(var(--spacing) * 3.5)}.mx-auto{margin-inline:auto}.my-0\.5{margin-block:calc(var(--spacing) * .5)}.my-1{margin-block:calc(var(--spacing) * 1)}.my-4{margin-block:calc(var(--spacing) * 4)}.-mt-1{margin-top:calc(var(--spacing) * -1)}.-mt-4{margin-top:calc(var(--spacing) * -4)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-auto{margin-top:auto}.mr-1{margin-right:calc(var(--spacing) * 1)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.-ml-1{margin-left:calc(var(--spacing) * -1)}.-ml-4{margin-left:calc(var(--spacing) * -4)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-4{margin-left:calc(var(--spacing) * 4)}.ml-8{margin-left:calc(var(--spacing) * 8)}.ml-12{margin-left:calc(var(--spacing) * 12)}.ml-auto{margin-left:auto}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-row{display:table-row}.field-sizing-content{field-sizing:content}.aspect-square{aspect-ratio:1 / 1}.aspect-video{aspect-ratio:var(--aspect-video)}.size-\(--cell-size\){width:var(--cell-size);height:var(--cell-size)}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-2\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-3\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-auto{width:auto;height:auto}.size-full{width:100%;height:100%}.h-\(--cell-size\){height:var(--cell-size)}.h-1{height:calc(var(--spacing) * 1)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-16{height:calc(var(--spacing) * 16)}.h-20{height:calc(var(--spacing) * 20)}.h-24{height:calc(var(--spacing) * 24)}.h-32{height:calc(var(--spacing) * 32)}.h-48{height:calc(var(--spacing) * 48)}.h-\[1\.15rem\]{height:1.15rem}.h-\[100px\]{height:100px}.h-\[150px\]{height:150px}.h-\[200px\]{height:200px}.h-\[300px\]{height:300px}.h-\[400px\]{height:400px}.h-\[500px\]{height:500px}.h-\[calc\(100\%-1px\)\]{height:calc(100% - 1px)}.h-\[var\(--radix-navigation-menu-viewport-height\)\]{height:var(--radix-navigation-menu-viewport-height)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.h-svh{height:100svh}.max-h-\(--radix-context-menu-content-available-height\){max-height:var(--radix-context-menu-content-available-height)}.max-h-\(--radix-dropdown-menu-content-available-height\){max-height:var(--radix-dropdown-menu-content-available-height)}.max-h-\(--radix-select-content-available-height\){max-height:var(--radix-select-content-available-height)}.max-h-\[80vh\]{max-height:80vh}.max-h-\[300px\]{max-height:300px}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-4{min-height:calc(var(--spacing) * 4)}.min-h-16{min-height:calc(var(--spacing) * 16)}.min-h-\[80px\]{min-height:80px}.min-h-\[100px\]{min-height:100px}.min-h-\[100vh\]{min-height:100vh}.min-h-svh{min-height:100svh}.w-\(--cell-size\){width:var(--cell-size)}.w-0{width:calc(var(--spacing) * 0)}.w-1{width:calc(var(--spacing) * 1)}.w-1\/2{width:50%}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-2\/3{width:calc(2/3 * 100%)}.w-3{width:calc(var(--spacing) * 3)}.w-3\/4{width:75%}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-12{width:calc(var(--spacing) * 12)}.w-14{width:calc(var(--spacing) * 14)}.w-16{width:calc(var(--spacing) * 16)}.w-18{width:calc(var(--spacing) * 18)}.w-20{width:calc(var(--spacing) * 20)}.w-24{width:calc(var(--spacing) * 24)}.w-32{width:calc(var(--spacing) * 32)}.w-48{width:calc(var(--spacing) * 48)}.w-56{width:calc(var(--spacing) * 56)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-80{width:calc(var(--spacing) * 80)}.w-96{width:calc(var(--spacing) * 96)}.w-\[--radix-dropdown-menu-trigger-width\]{width:--radix-dropdown-menu-trigger-width}.w-\[50px\]{width:50px}.w-\[100px\]{width:100px}.w-\[180px\]{width:180px}.w-\[200px\]{width:200px}.w-\[250px\]{width:250px}.w-\[280px\]{width:280px}.w-\[300px\]{width:300px}.w-\[350px\]{width:350px}.w-\[400px\]{width:400px}.w-\[500px\]{width:500px}.w-\[600px\]{width:600px}.w-\[var\(--sidebar-width\)\]{width:var(--sidebar-width)}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.w-max{width:max-content}.w-px{width:1px}.max-w-\(--skeleton-width\){max-width:var(--skeleton-width)}.max-w-2xl{max-width:var(--container-2xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-6xl{max-width:var(--container-6xl)}.max-w-\[calc\(100\%-2rem\)\]{max-width:calc(100% - 2rem)}.max-w-lg{max-width:var(--container-lg)}.max-w-max{max-width:max-content}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-\(--cell-size\){min-width:var(--cell-size)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-5{min-width:calc(var(--spacing) * 5)}.min-w-8{min-width:calc(var(--spacing) * 8)}.min-w-9{min-width:calc(var(--spacing) * 9)}.min-w-10{min-width:calc(var(--spacing) * 10)}.min-w-56{min-width:calc(var(--spacing) * 56)}.min-w-\[8rem\]{min-width:8rem}.min-w-\[12rem\]{min-width:12rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.flex-1{flex:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.grow{flex-grow:1}.grow-0{flex-grow:0}.basis-full{flex-basis:100%}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.origin-\(--radix-context-menu-content-transform-origin\){transform-origin:var(--radix-context-menu-content-transform-origin)}.origin-\(--radix-dropdown-menu-content-transform-origin\){transform-origin:var(--radix-dropdown-menu-content-transform-origin)}.origin-\(--radix-hover-card-content-transform-origin\){transform-origin:var(--radix-hover-card-content-transform-origin)}.origin-\(--radix-menubar-content-transform-origin\){transform-origin:var(--radix-menubar-content-transform-origin)}.origin-\(--radix-select-content-transform-origin\){transform-origin:var(--radix-select-content-transform-origin)}.origin-\(--radix-tooltip-content-transform-origin\){transform-origin:var(--radix-tooltip-content-transform-origin)}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-px{--tw-translate-x: -1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-\[-50\%\]{--tw-translate-x: -50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-px{--tw-translate-x: 1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-0\.5{--tw-translate-y: calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y: -50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[calc\(-50\%_-_2px\)\]{--tw-translate-y: calc(-50% - 2px) ;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-45{rotate:45deg}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-caret-blink{animation:caret-blink 1.25s ease-out infinite}.animate-in{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.resize-none{resize:none}.scroll-my-1{scroll-margin-block:calc(var(--spacing) * 1)}.scroll-py-1{scroll-padding-block:calc(var(--spacing) * 1)}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.appearance-none{appearance:none}.auto-rows-min{grid-auto-rows:min-content}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-\[0_1fr\]{grid-template-columns:0 1fr}.grid-rows-\[auto_auto\]{grid-template-rows:auto auto}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.justify-items-start{justify-items:start}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-8{gap:calc(var(--spacing) * 8)}:where(.space-y-0>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 0) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 0) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 8) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-y-reverse)))}:where(.-space-x-2>:not(:last-child)){--tw-space-x-reverse: 0;margin-inline-start:calc(calc(var(--spacing) * -2) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * -2) * calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse: 0;margin-inline-start:calc(calc(var(--spacing) * 2) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-3>:not(:last-child)){--tw-space-x-reverse: 0;margin-inline-start:calc(calc(var(--spacing) * 3) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-4>:not(:last-child)){--tw-space-x-reverse: 0;margin-inline-start:calc(calc(var(--spacing) * 4) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-6>:not(:last-child)){--tw-space-x-reverse: 0;margin-inline-start:calc(calc(var(--spacing) * 6) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-x-reverse)))}.gap-y-0\.5{row-gap:calc(var(--spacing) * .5)}.self-start{align-self:flex-start}.justify-self-end{justify-self:flex-end}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\[2px\]{border-radius:2px}.rounded-\[4px\]{border-radius:4px}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:calc(infinity * 1px)}.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:calc(var(--radius) + 4px)}.rounded-xs{border-radius:var(--radius-xs)}.rounded-l-md{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.rounded-tl-sm{border-top-left-radius:calc(var(--radius) - 4px)}.rounded-r-md{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-\[1\.5px\]{border-style:var(--tw-border-style);border-width:1.5px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-dashed{--tw-border-style: dashed;border-style:dashed}.border-\(--color-border\){border-color:var(--color-border)}.border-background{border-color:var(--background)}.border-blue-200{border-color:var(--color-blue-200)}.border-border\/50{border-color:var(--border)}@supports (color: color-mix(in lab,red,red)){.border-border\/50{border-color:color-mix(in oklab,var(--border) 50%,transparent)}}.border-current{border-color:currentcolor}.border-destructive{border-color:var(--destructive)}.border-destructive\/20{border-color:var(--destructive)}@supports (color: color-mix(in lab,red,red)){.border-destructive\/20{border-color:color-mix(in oklab,var(--destructive) 20%,transparent)}}.border-gray-700{border-color:var(--color-gray-700)}.border-green-200{border-color:var(--color-green-200)}.border-green-500{border-color:var(--color-green-500)}.border-input{border-color:var(--input)}.border-muted{border-color:var(--muted)}.border-primary{border-color:var(--primary)}.border-purple-100{border-color:var(--color-purple-100)}.border-purple-200{border-color:var(--color-purple-200)}.border-sidebar-border{border-color:var(--sidebar-border)}.border-transparent{border-color:transparent}.border-white{border-color:var(--color-white)}.border-yellow-500{border-color:var(--color-yellow-500)}.border-t-transparent{border-top-color:transparent}.border-l-transparent{border-left-color:transparent}.bg-\(--color-bg\){background-color:var(--color-bg)}.bg-accent{background-color:var(--accent)}.bg-background{background-color:var(--background)}.bg-black{background-color:var(--color-black)}.bg-black\/50{background-color:color-mix(in srgb,#000 50%,transparent)}@supports (color: color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black) 50%,transparent)}}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-100{background-color:var(--color-blue-100)}.bg-blue-500{background-color:var(--color-blue-500)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-border{background-color:var(--border)}.bg-card{background-color:var(--card)}.bg-destructive{background-color:var(--destructive)}.bg-destructive\/10{background-color:var(--destructive)}@supports (color: color-mix(in lab,red,red)){.bg-destructive\/10{background-color:color-mix(in oklab,var(--destructive) 10%,transparent)}}.bg-foreground{background-color:var(--foreground)}.bg-gray-400{background-color:var(--color-gray-400)}.bg-gray-600{background-color:var(--color-gray-600)}.bg-gray-900{background-color:var(--color-gray-900)}.bg-green-50{background-color:var(--color-green-50)}.bg-green-100{background-color:var(--color-green-100)}.bg-green-500{background-color:var(--color-green-500)}.bg-green-600{background-color:var(--color-green-600)}.bg-muted{background-color:var(--muted)}.bg-muted\/50{background-color:var(--muted)}@supports (color: color-mix(in lab,red,red)){.bg-muted\/50{background-color:color-mix(in oklab,var(--muted) 50%,transparent)}}.bg-orange-100{background-color:var(--color-orange-100)}.bg-orange-500{background-color:var(--color-orange-500)}.bg-orange-600{background-color:var(--color-orange-600)}.bg-popover{background-color:var(--popover)}.bg-primary{background-color:var(--primary)}.bg-primary\/10{background-color:var(--primary)}@supports (color: color-mix(in lab,red,red)){.bg-primary\/10{background-color:color-mix(in oklab,var(--primary) 10%,transparent)}}.bg-primary\/20{background-color:var(--primary)}@supports (color: color-mix(in lab,red,red)){.bg-primary\/20{background-color:color-mix(in oklab,var(--primary) 20%,transparent)}}.bg-purple-100{background-color:var(--color-purple-100)}.bg-purple-500{background-color:var(--color-purple-500)}.bg-purple-600{background-color:var(--color-purple-600)}.bg-red-100{background-color:var(--color-red-100)}.bg-red-500{background-color:var(--color-red-500)}.bg-red-600{background-color:var(--color-red-600)}.bg-secondary{background-color:var(--secondary)}.bg-sidebar{background-color:var(--sidebar)}.bg-sidebar-border{background-color:var(--sidebar-border)}.bg-sidebar-primary{background-color:var(--sidebar-primary)}.bg-slate-50{background-color:var(--color-slate-50)}.bg-transparent{background-color:transparent}.bg-white{background-color:var(--color-white)}.bg-white\/60{background-color:color-mix(in srgb,#fff 60%,transparent)}@supports (color: color-mix(in lab,red,red)){.bg-white\/60{background-color:color-mix(in oklab,var(--color-white) 60%,transparent)}}.bg-white\/80{background-color:color-mix(in srgb,#fff 80%,transparent)}@supports (color: color-mix(in lab,red,red)){.bg-white\/80{background-color:color-mix(in oklab,var(--color-white) 80%,transparent)}}.bg-yellow-100{background-color:var(--color-yellow-100)}.bg-yellow-500{background-color:var(--color-yellow-500)}.bg-yellow-600{background-color:var(--color-yellow-600)}.bg-gradient-to-b{--tw-gradient-position: to bottom in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-br{--tw-gradient-position: to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-r{--tw-gradient-position: to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-blue-400{--tw-gradient-from: var(--color-blue-400);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-blue-500{--tw-gradient-from: var(--color-blue-500);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-blue-500\/20{--tw-gradient-from: color-mix(in srgb, oklch(62.3% .214 259.815) 20%, transparent);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}@supports (color: color-mix(in lab,red,red)){.from-blue-500\/20{--tw-gradient-from: color-mix(in oklab, var(--color-blue-500) 20%, transparent)}}.from-muted\/50{--tw-gradient-from: var(--muted);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}@supports (color: color-mix(in lab,red,red)){.from-muted\/50{--tw-gradient-from: color-mix(in oklab, var(--muted) 50%, transparent)}}.from-purple-50{--tw-gradient-from: var(--color-purple-50);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-purple-500{--tw-gradient-from: var(--color-purple-500);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-white{--tw-gradient-from: var(--color-white);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-blue-600\/20{--tw-gradient-to: color-mix(in srgb, oklch(54.6% .245 262.881) 20%, transparent);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}@supports (color: color-mix(in lab,red,red)){.to-blue-600\/20{--tw-gradient-to: color-mix(in oklab, var(--color-blue-600) 20%, transparent)}}.to-gray-900{--tw-gradient-to: var(--color-gray-900);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-muted{--tw-gradient-to: var(--muted);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-pink-50{--tw-gradient-to: var(--color-pink-50);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-pink-500{--tw-gradient-to: var(--color-pink-500);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-purple-600{--tw-gradient-to: var(--color-purple-600);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.fill-blue-400{fill:var(--color-blue-400)}.fill-current{fill:currentcolor}.fill-primary{fill:var(--primary)}.fill-yellow-400{fill:var(--color-yellow-400)}.object-cover{object-fit:cover}.p-0{padding:calc(var(--spacing) * 0)}.p-1{padding:calc(var(--spacing) * 1)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.p-\[3px\]{padding:3px}.p-px{padding:1px}.px-\(--cell-size\){padding-inline:var(--cell-size)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.pt-0{padding-top:calc(var(--spacing) * 0)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pr-1{padding-right:calc(var(--spacing) * 1)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-2\.5{padding-right:calc(var(--spacing) * 2.5)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pr-10{padding-right:calc(var(--spacing) * 10)}.pb-0{padding-bottom:calc(var(--spacing) * 0)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-8{padding-left:calc(var(--spacing) * 8)}.pl-10{padding-left:calc(var(--spacing) * 10)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading, var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading, var(--text-3xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading, var(--text-4xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading, var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading, var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading, var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading, var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading, var(--text-xs--line-height))}.text-\[0\.8rem\]{font-size:.8rem}.text-\[10px\]{font-size:10px}.leading-none{--tw-leading: 1;line-height:1}.leading-relaxed{--tw-leading: var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading: var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading: var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight: var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight: var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight: var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight: var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking: var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-widest{--tw-tracking: var(--tracking-widest);letter-spacing:var(--tracking-widest)}.text-balance{text-wrap:balance}.break-words{overflow-wrap:break-word}.whitespace-nowrap{white-space:nowrap}.text-accent-foreground{color:var(--accent-foreground)}.text-blue-400{color:var(--color-blue-400)}.text-blue-500{color:var(--color-blue-500)}.text-blue-600{color:var(--color-blue-600)}.text-blue-700{color:var(--color-blue-700)}.text-blue-800{color:var(--color-blue-800)}.text-blue-900{color:var(--color-blue-900)}.text-card-foreground{color:var(--card-foreground)}.text-current{color:currentcolor}.text-destructive{color:var(--destructive)}.text-destructive-foreground{color:var(--destructive-foreground)}.text-foreground{color:var(--foreground)}.text-green-400{color:var(--color-green-400)}.text-green-500{color:var(--color-green-500)}.text-green-600{color:var(--color-green-600)}.text-green-700{color:var(--color-green-700)}.text-green-800{color:var(--color-green-800)}.text-muted-foreground{color:var(--muted-foreground)}.text-orange-600{color:var(--color-orange-600)}.text-orange-700{color:var(--color-orange-700)}.text-pink-600{color:var(--color-pink-600)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-purple-500{color:var(--color-purple-500)}.text-purple-600{color:var(--color-purple-600)}.text-purple-700{color:var(--color-purple-700)}.text-purple-900{color:var(--color-purple-900)}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.text-red-700{color:var(--color-red-700)}.text-red-800{color:var(--color-red-800)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-sidebar-foreground{color:var(--sidebar-foreground)}.text-sidebar-foreground\/70{color:var(--sidebar-foreground)}@supports (color: color-mix(in lab,red,red)){.text-sidebar-foreground\/70{color:color-mix(in oklab,var(--sidebar-foreground) 70%,transparent)}}.text-sidebar-primary-foreground{color:var(--sidebar-primary-foreground)}.text-white{color:var(--color-white)}.text-yellow-400{color:var(--color-yellow-400)}.text-yellow-600{color:var(--color-yellow-600)}.text-yellow-700{color:var(--color-yellow-700)}.capitalize{text-transform:capitalize}.italic{font-style:italic}.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,)}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0%}.opacity-50{opacity:50%}.opacity-70{opacity:70%}.opacity-75{opacity:75%}.opacity-90{opacity:90%}.opacity-100{opacity:100%}.shadow{--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_0_1px_hsl\(var\(--sidebar-border\)\)\]{--tw-shadow: 0 0 0 1px var(--tw-shadow-color, hsl(var(--sidebar-border)));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 8px 10px -6px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow: 0 1px 2px 0 var(--tw-shadow-color, rgb(0 0 0 / .05));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-primary{--tw-ring-color: var(--primary)}.ring-ring\/50{--tw-ring-color: var(--ring)}@supports (color: color-mix(in lab,red,red)){.ring-ring\/50{--tw-ring-color: color-mix(in oklab, var(--ring) 50%, transparent)}}.ring-sidebar-ring{--tw-ring-color: var(--sidebar-ring)}.ring-offset-background{--tw-ring-offset-color: var(--background)}.outline-hidden{--tw-outline-style: none;outline-style:none}@media (forced-colors: active){.outline-hidden{outline:2px solid transparent;outline-offset:2px}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,visibility,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-\[color\,box-shadow\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-\[left\,right\,width\]{transition-property:left,right,width;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-\[margin\,opacity\]{transition-property:margin,opacity;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-\[width\,height\,padding\]{transition-property:width,height,padding;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-\[width\,height\]{transition-property:width,height;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-none{transition-property:none}.duration-200{--tw-duration: .2s;transition-duration:.2s}.duration-300{--tw-duration: .3s;transition-duration:.3s}.duration-1000{--tw-duration: 1s;transition-duration:1s}.ease-in-out{--tw-ease: var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-linear{--tw-ease: linear;transition-timing-function:linear}.fade-in-0{--tw-enter-opacity: 0 ;--tw-enter-opacity: 0}.outline-none{--tw-outline-style: none;outline-style:none}.select-all{-webkit-user-select:all;user-select:all}.select-none{-webkit-user-select:none;user-select:none}.zoom-in-95{--tw-enter-scale: 95% ;--tw-enter-scale: .95}.\[--cell-size\:--spacing\(8\)\]{--cell-size: calc(var(--spacing) * 8)}.group-focus-within\/menu-item\:opacity-100:is(:where(.group\/menu-item):focus-within *){opacity:100%}@media (hover: hover){.group-hover\/menu-item\:opacity-100:is(:where(.group\/menu-item):hover *){opacity:100%}}.group-has-data-\[sidebar\=menu-action\]\/menu-item\:pr-8:is(:where(.group\/menu-item):has(*[data-sidebar=menu-action]) *){padding-right:calc(var(--spacing) * 8)}.group-has-\[\[data-collapsible\=icon\]\]\/sidebar-wrapper\:h-12:is(:where(.group\/sidebar-wrapper):has(*:is([data-collapsible=icon])) *){height:calc(var(--spacing) * 12)}.group-data-\[collapsible\=icon\]\:-mt-8:is(:where(.group)[data-collapsible=icon] *){margin-top:calc(var(--spacing) * -8)}.group-data-\[collapsible\=icon\]\:hidden:is(:where(.group)[data-collapsible=icon] *){display:none}.group-data-\[collapsible\=icon\]\:size-8\!:is(:where(.group)[data-collapsible=icon] *){width:calc(var(--spacing) * 8)!important;height:calc(var(--spacing) * 8)!important}.group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)\+1rem\)\]:is(:where(.group)[data-collapsible=icon] *){width:calc(var(--sidebar-width-icon) + 1rem)}.group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)\+1rem\+2px\)\]:is(:where(.group)[data-collapsible=icon] *){width:calc(var(--sidebar-width-icon) + 1rem + 2px)}.group-data-\[collapsible\=icon\]\:w-\[var\(--sidebar-width-icon\)\]:is(:where(.group)[data-collapsible=icon] *){width:var(--sidebar-width-icon)}.group-data-\[collapsible\=icon\]\:overflow-hidden:is(:where(.group)[data-collapsible=icon] *){overflow:hidden}.group-data-\[collapsible\=icon\]\:p-0\!:is(:where(.group)[data-collapsible=icon] *){padding:calc(var(--spacing) * 0)!important}.group-data-\[collapsible\=icon\]\:p-2\!:is(:where(.group)[data-collapsible=icon] *){padding:calc(var(--spacing) * 2)!important}.group-data-\[collapsible\=icon\]\:opacity-0:is(:where(.group)[data-collapsible=icon] *){opacity:0%}.group-data-\[collapsible\=offcanvas\]\:right-\[calc\(var\(--sidebar-width\)\*-1\)\]:is(:where(.group)[data-collapsible=offcanvas] *){right:calc(var(--sidebar-width) * -1)}.group-data-\[collapsible\=offcanvas\]\:left-\[calc\(var\(--sidebar-width\)\*-1\)\]:is(:where(.group)[data-collapsible=offcanvas] *){left:calc(var(--sidebar-width) * -1)}.group-data-\[collapsible\=offcanvas\]\:w-0:is(:where(.group)[data-collapsible=offcanvas] *){width:calc(var(--spacing) * 0)}.group-data-\[collapsible\=offcanvas\]\:translate-x-0:is(:where(.group)[data-collapsible=offcanvas] *){--tw-translate-x: calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-data-\[disabled\=true\]\:pointer-events-none:is(:where(.group)[data-disabled=true] *){pointer-events:none}.group-data-\[disabled\=true\]\:opacity-50:is(:where(.group)[data-disabled=true] *){opacity:50%}.group-data-\[focused\=true\]\/day\:relative:is(:where(.group\/day)[data-focused=true] *){position:relative}.group-data-\[focused\=true\]\/day\:z-10:is(:where(.group\/day)[data-focused=true] *){z-index:10}.group-data-\[focused\=true\]\/day\:border-ring:is(:where(.group\/day)[data-focused=true] *){border-color:var(--ring)}.group-data-\[focused\=true\]\/day\:ring-\[3px\]:is(:where(.group\/day)[data-focused=true] *){--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-data-\[focused\=true\]\/day\:ring-ring\/50:is(:where(.group\/day)[data-focused=true] *){--tw-ring-color: var(--ring)}@supports (color: color-mix(in lab,red,red)){.group-data-\[focused\=true\]\/day\:ring-ring\/50:is(:where(.group\/day)[data-focused=true] *){--tw-ring-color: color-mix(in oklab, var(--ring) 50%, transparent)}}.group-data-\[side\=left\]\:-right-4:is(:where(.group)[data-side=left] *){right:calc(var(--spacing) * -4)}.group-data-\[side\=left\]\:border-r:is(:where(.group)[data-side=left] *){border-right-style:var(--tw-border-style);border-right-width:1px}.group-data-\[side\=right\]\:left-0:is(:where(.group)[data-side=right] *){left:calc(var(--spacing) * 0)}.group-data-\[side\=right\]\:rotate-180:is(:where(.group)[data-side=right] *){rotate:180deg}.group-data-\[side\=right\]\:border-l:is(:where(.group)[data-side=right] *){border-left-style:var(--tw-border-style);border-left-width:1px}.group-data-\[state\=open\]\:rotate-180:is(:where(.group)[data-state=open] *){rotate:180deg}.group-data-\[state\=open\]\/collapsible\:rotate-180:is(:where(.group\/collapsible)[data-state=open] *){rotate:180deg}.group-data-\[variant\=floating\]\:rounded-lg:is(:where(.group)[data-variant=floating] *){border-radius:var(--radius)}.group-data-\[variant\=floating\]\:border:is(:where(.group)[data-variant=floating] *){border-style:var(--tw-border-style);border-width:1px}.group-data-\[variant\=floating\]\:border-sidebar-border:is(:where(.group)[data-variant=floating] *){border-color:var(--sidebar-border)}.group-data-\[variant\=floating\]\:shadow-sm:is(:where(.group)[data-variant=floating] *){--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-data-\[vaul-drawer-direction\=bottom\]\/drawer-content\:block:is(:where(.group\/drawer-content)[data-vaul-drawer-direction=bottom] *){display:block}.group-data-\[vaul-drawer-direction\=bottom\]\/drawer-content\:text-center:is(:where(.group\/drawer-content)[data-vaul-drawer-direction=bottom] *){text-align:center}.group-data-\[vaul-drawer-direction\=top\]\/drawer-content\:text-center:is(:where(.group\/drawer-content)[data-vaul-drawer-direction=top] *){text-align:center}.group-data-\[viewport\=false\]\/navigation-menu\:top-full:is(:where(.group\/navigation-menu)[data-viewport=false] *){top:100%}.group-data-\[viewport\=false\]\/navigation-menu\:mt-1\.5:is(:where(.group\/navigation-menu)[data-viewport=false] *){margin-top:calc(var(--spacing) * 1.5)}.group-data-\[viewport\=false\]\/navigation-menu\:overflow-hidden:is(:where(.group\/navigation-menu)[data-viewport=false] *){overflow:hidden}.group-data-\[viewport\=false\]\/navigation-menu\:rounded-md:is(:where(.group\/navigation-menu)[data-viewport=false] *){border-radius:calc(var(--radius) - 2px)}.group-data-\[viewport\=false\]\/navigation-menu\:border:is(:where(.group\/navigation-menu)[data-viewport=false] *){border-style:var(--tw-border-style);border-width:1px}.group-data-\[viewport\=false\]\/navigation-menu\:bg-popover:is(:where(.group\/navigation-menu)[data-viewport=false] *){background-color:var(--popover)}.group-data-\[viewport\=false\]\/navigation-menu\:text-popover-foreground:is(:where(.group\/navigation-menu)[data-viewport=false] *){color:var(--popover-foreground)}.group-data-\[viewport\=false\]\/navigation-menu\:shadow:is(:where(.group\/navigation-menu)[data-viewport=false] *){--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-data-\[viewport\=false\]\/navigation-menu\:duration-200:is(:where(.group\/navigation-menu)[data-viewport=false] *){--tw-duration: .2s;transition-duration:.2s}@media (hover: hover){.peer-hover\/menu-button\:text-sidebar-accent-foreground:is(:where(.peer\/menu-button):hover~*){color:var(--sidebar-accent-foreground)}}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-50:is(:where(.peer):disabled~*){opacity:50%}.peer-data-\[active\=true\]\/menu-button\:text-sidebar-accent-foreground:is(:where(.peer\/menu-button)[data-active=true]~*){color:var(--sidebar-accent-foreground)}.peer-data-\[size\=default\]\/menu-button\:top-1\.5:is(:where(.peer\/menu-button)[data-size=default]~*){top:calc(var(--spacing) * 1.5)}.peer-data-\[size\=lg\]\/menu-button\:top-2\.5:is(:where(.peer\/menu-button)[data-size=lg]~*){top:calc(var(--spacing) * 2.5)}.peer-data-\[size\=sm\]\/menu-button\:top-1:is(:where(.peer\/menu-button)[data-size=sm]~*){top:calc(var(--spacing) * 1)}.selection\:bg-primary *::selection{background-color:var(--primary)}.selection\:bg-primary::selection{background-color:var(--primary)}.selection\:text-primary-foreground *::selection{color:var(--primary-foreground)}.selection\:text-primary-foreground::selection{color:var(--primary-foreground)}.file\:inline-flex::file-selector-button{display:inline-flex}.file\:h-7::file-selector-button{height:calc(var(--spacing) * 7)}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading, var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight: var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--foreground)}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:-inset-2:after{content:var(--tw-content);inset:calc(var(--spacing) * -2)}.after\:inset-y-0:after{content:var(--tw-content);inset-block:calc(var(--spacing) * 0)}.after\:left-1\/2:after{content:var(--tw-content);left:50%}.after\:w-1:after{content:var(--tw-content);width:calc(var(--spacing) * 1)}.after\:w-\[2px\]:after{content:var(--tw-content);width:2px}.after\:-translate-x-1\/2:after{content:var(--tw-content);--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.group-data-\[collapsible\=offcanvas\]\:after\:left-full:is(:where(.group)[data-collapsible=offcanvas] *):after{content:var(--tw-content);left:100%}.first\:rounded-l-md:first-child{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.first\:border-l:first-child{border-left-style:var(--tw-border-style);border-left-width:1px}.last\:rounded-r-md:last-child{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0px}@media (hover: hover){.hover\:border-muted-foreground\/50:hover{border-color:var(--muted-foreground)}@supports (color: color-mix(in lab,red,red)){.hover\:border-muted-foreground\/50:hover{border-color:color-mix(in oklab,var(--muted-foreground) 50%,transparent)}}}@media (hover: hover){.hover\:bg-accent:hover{background-color:var(--accent)}}@media (hover: hover){.hover\:bg-blue-700:hover{background-color:var(--color-blue-700)}}@media (hover: hover){.hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color: color-mix(in lab,red,red)){.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--destructive) 90%,transparent)}}}@media (hover: hover){.hover\:bg-gray-700:hover{background-color:var(--color-gray-700)}}@media (hover: hover){.hover\:bg-green-700:hover{background-color:var(--color-green-700)}}@media (hover: hover){.hover\:bg-muted:hover{background-color:var(--muted)}}@media (hover: hover){.hover\:bg-muted\/50:hover{background-color:var(--muted)}@supports (color: color-mix(in lab,red,red)){.hover\:bg-muted\/50:hover{background-color:color-mix(in oklab,var(--muted) 50%,transparent)}}}@media (hover: hover){.hover\:bg-orange-700:hover{background-color:var(--color-orange-700)}}@media (hover: hover){.hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color: color-mix(in lab,red,red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--primary) 90%,transparent)}}}@media (hover: hover){.hover\:bg-purple-700:hover{background-color:var(--color-purple-700)}}@media (hover: hover){.hover\:bg-red-700:hover{background-color:var(--color-red-700)}}@media (hover: hover){.hover\:bg-secondary\/80:hover{background-color:var(--secondary)}@supports (color: color-mix(in lab,red,red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab,var(--secondary) 80%,transparent)}}}@media (hover: hover){.hover\:bg-sidebar-accent:hover{background-color:var(--sidebar-accent)}}@media (hover: hover){.hover\:bg-white:hover{background-color:var(--color-white)}}@media (hover: hover){.hover\:bg-yellow-700:hover{background-color:var(--color-yellow-700)}}@media (hover: hover){.hover\:from-purple-600:hover{--tw-gradient-from: var(--color-purple-600);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}}@media (hover: hover){.hover\:to-pink-600:hover{--tw-gradient-to: var(--color-pink-600);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}}@media (hover: hover){.hover\:text-accent-foreground:hover{color:var(--accent-foreground)}}@media (hover: hover){.hover\:text-destructive:hover{color:var(--destructive)}}@media (hover: hover){.hover\:text-foreground:hover{color:var(--foreground)}}@media (hover: hover){.hover\:text-muted-foreground:hover{color:var(--muted-foreground)}}@media (hover: hover){.hover\:text-primary:hover{color:var(--primary)}}@media (hover: hover){.hover\:text-sidebar-accent-foreground:hover{color:var(--sidebar-accent-foreground)}}@media (hover: hover){.hover\:underline:hover{text-decoration-line:underline}}@media (hover: hover){.hover\:opacity-90:hover{opacity:90%}}@media (hover: hover){.hover\:opacity-100:hover{opacity:100%}}@media (hover: hover){.hover\:shadow-\[0_0_0_1px_hsl\(var\(--sidebar-accent\)\)\]:hover{--tw-shadow: 0 0 0 1px var(--tw-shadow-color, hsl(var(--sidebar-accent)));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}@media (hover: hover){.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}@media (hover: hover){.hover\:ring-4:hover{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}@media (hover: hover){.hover\:group-data-\[collapsible\=offcanvas\]\:bg-sidebar:hover:is(:where(.group)[data-collapsible=offcanvas] *){background-color:var(--sidebar)}}@media (hover: hover){.hover\:after\:bg-sidebar-border:hover:after{content:var(--tw-content);background-color:var(--sidebar-border)}}.focus\:z-10:focus{z-index:10}.focus\:bg-accent:focus{background-color:var(--accent)}.focus\:text-accent-foreground:focus{color:var(--accent-foreground)}.focus\:shadow-md:focus{--tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-2:focus{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-ring:focus{--tw-ring-color: var(--ring)}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px;--tw-ring-offset-shadow: var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus\:outline-hidden:focus{--tw-outline-style: none;outline-style:none}@media (forced-colors: active){.focus\:outline-hidden:focus{outline:2px solid transparent;outline-offset:2px}}.focus-visible\:z-10:focus-visible{z-index:10}.focus-visible\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\:ring-1:focus-visible{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-4:focus-visible{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color: var(--destructive)}@supports (color: color-mix(in lab,red,red)){.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color: color-mix(in oklab, var(--destructive) 20%, transparent)}}.focus-visible\:ring-green-500\/20:focus-visible{--tw-ring-color: color-mix(in srgb, oklch(72.3% .219 149.579) 20%, transparent)}@supports (color: color-mix(in lab,red,red)){.focus-visible\:ring-green-500\/20:focus-visible{--tw-ring-color: color-mix(in oklab, var(--color-green-500) 20%, transparent)}}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: var(--ring)}.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color: var(--ring)}@supports (color: color-mix(in lab,red,red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color: color-mix(in oklab, var(--ring) 50%, transparent)}}.focus-visible\:ring-yellow-500\/20:focus-visible{--tw-ring-color: color-mix(in srgb, oklch(79.5% .184 86.047) 20%, transparent)}@supports (color: color-mix(in lab,red,red)){.focus-visible\:ring-yellow-500\/20:focus-visible{--tw-ring-color: color-mix(in oklab, var(--color-yellow-500) 20%, transparent)}}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width: 1px;--tw-ring-offset-shadow: var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px;--tw-ring-offset-shadow: var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus-visible\:outline-hidden:focus-visible{--tw-outline-style: none;outline-style:none}@media (forced-colors: active){.focus-visible\:outline-hidden:focus-visible{outline:2px solid transparent;outline-offset:2px}}.focus-visible\:outline-1:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.focus-visible\:outline-ring:focus-visible{outline-color:var(--ring)}.focus-visible\:outline-none:focus-visible{--tw-outline-style: none;outline-style:none}.active\:bg-sidebar-accent:active{background-color:var(--sidebar-accent)}.active\:text-sidebar-accent-foreground:active{color:var(--sidebar-accent-foreground)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:50%}:where(*[data-side=left]) .in-data-\[side\=left\]\:cursor-w-resize{cursor:w-resize}:where(*[data-side=right]) .in-data-\[side\=right\]\:cursor-e-resize{cursor:e-resize}.has-focus\:border-ring:has(*:focus){border-color:var(--ring)}.has-focus\:ring-\[3px\]:has(*:focus){--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.has-focus\:ring-ring\/50:has(*:focus){--tw-ring-color: var(--ring)}@supports (color: color-mix(in lab,red,red)){.has-focus\:ring-ring\/50:has(*:focus){--tw-ring-color: color-mix(in oklab, var(--ring) 50%, transparent)}}.has-disabled\:opacity-50:has(*:disabled){opacity:50%}.has-data-\[slot\=card-action\]\:grid-cols-\[1fr_auto\]:has(*[data-slot=card-action]){grid-template-columns:1fr auto}.has-data-\[variant\=inset\]\:bg-sidebar:has(*[data-variant=inset]){background-color:var(--sidebar)}.has-\[\>svg\]\:grid-cols-\[calc\(var\(--spacing\)\*4\)_1fr\]:has(>svg){grid-template-columns:calc(var(--spacing) * 4) 1fr}.has-\[\>svg\]\:gap-x-3:has(>svg){column-gap:calc(var(--spacing) * 3)}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing) * 2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing) * 3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing) * 4)}.aria-disabled\:pointer-events-none[aria-disabled=true]{pointer-events:none}.aria-disabled\:opacity-50[aria-disabled=true]{opacity:50%}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color: var(--destructive)}@supports (color: color-mix(in lab,red,red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color: color-mix(in oklab, var(--destructive) 20%, transparent)}}.aria-selected\:text-muted-foreground[aria-selected=true]{color:var(--muted-foreground)}.data-\[active\=true\]\:z-10[data-active=true]{z-index:10}.data-\[active\=true\]\:border-ring[data-active=true]{border-color:var(--ring)}.data-\[active\=true\]\:bg-accent\/50[data-active=true]{background-color:var(--accent)}@supports (color: color-mix(in lab,red,red)){.data-\[active\=true\]\:bg-accent\/50[data-active=true]{background-color:color-mix(in oklab,var(--accent) 50%,transparent)}}.data-\[active\=true\]\:bg-sidebar-accent[data-active=true]{background-color:var(--sidebar-accent)}.data-\[active\=true\]\:font-medium[data-active=true]{--tw-font-weight: var(--font-weight-medium);font-weight:var(--font-weight-medium)}.data-\[active\=true\]\:text-accent-foreground[data-active=true]{color:var(--accent-foreground)}.data-\[active\=true\]\:text-sidebar-accent-foreground[data-active=true]{color:var(--sidebar-accent-foreground)}.data-\[active\=true\]\:ring-\[3px\][data-active=true]{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[active\=true\]\:ring-ring\/50[data-active=true]{--tw-ring-color: var(--ring)}@supports (color: color-mix(in lab,red,red)){.data-\[active\=true\]\:ring-ring\/50[data-active=true]{--tw-ring-color: color-mix(in oklab, var(--ring) 50%, transparent)}}@media (hover: hover){.data-\[active\=true\]\:hover\:bg-accent[data-active=true]:hover{background-color:var(--accent)}}.data-\[active\=true\]\:focus\:bg-accent[data-active=true]:focus{background-color:var(--accent)}.data-\[active\=true\]\:aria-invalid\:border-destructive[data-active=true][aria-invalid=true]{border-color:var(--destructive)}.data-\[active\=true\]\:aria-invalid\:ring-destructive\/20[data-active=true][aria-invalid=true]{--tw-ring-color: var(--destructive)}@supports (color: color-mix(in lab,red,red)){.data-\[active\=true\]\:aria-invalid\:ring-destructive\/20[data-active=true][aria-invalid=true]{--tw-ring-color: color-mix(in oklab, var(--destructive) 20%, transparent)}}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:50%}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true]{pointer-events:none}.data-\[disabled\=true\]\:opacity-50[data-disabled=true]{opacity:50%}.data-\[empty\=true\]\:text-muted-foreground[data-empty=true]{color:var(--muted-foreground)}.data-\[error\=true\]\:text-destructive[data-error=true]{color:var(--destructive)}.data-\[inset\]\:pl-8[data-inset]{padding-left:calc(var(--spacing) * 8)}.data-\[motion\=from-end\]\:slide-in-from-right-52[data-motion=from-end]{--tw-enter-translate-x: calc(52*var(--spacing))}.data-\[motion\=from-start\]\:slide-in-from-left-52[data-motion=from-start]{--tw-enter-translate-x: calc(52*var(--spacing)*-1)}.data-\[motion\=to-end\]\:slide-out-to-right-52[data-motion=to-end]{--tw-exit-translate-x: calc(52*var(--spacing))}.data-\[motion\=to-start\]\:slide-out-to-left-52[data-motion=to-start]{--tw-exit-translate-x: calc(52*var(--spacing)*-1)}.data-\[motion\^\=from-\]\:animate-in[data-motion^=from-]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[motion\^\=from-\]\:fade-in[data-motion^=from-]{--tw-enter-opacity: 0}.data-\[motion\^\=to-\]\:animate-out[data-motion^=to-]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[motion\^\=to-\]\:fade-out[data-motion^=to-]{--tw-exit-opacity: 0}.data-\[orientation\=horizontal\]\:h-1\.5[data-orientation=horizontal]{height:calc(var(--spacing) * 1.5)}.data-\[orientation\=horizontal\]\:h-full[data-orientation=horizontal]{height:100%}.data-\[orientation\=horizontal\]\:h-px[data-orientation=horizontal]{height:1px}.data-\[orientation\=horizontal\]\:w-full[data-orientation=horizontal]{width:100%}.data-\[orientation\=vertical\]\:h-full[data-orientation=vertical]{height:100%}.data-\[orientation\=vertical\]\:min-h-44[data-orientation=vertical]{min-height:calc(var(--spacing) * 44)}.data-\[orientation\=vertical\]\:w-1\.5[data-orientation=vertical]{width:calc(var(--spacing) * 1.5)}.data-\[orientation\=vertical\]\:w-auto[data-orientation=vertical]{width:auto}.data-\[orientation\=vertical\]\:w-full[data-orientation=vertical]{width:100%}.data-\[orientation\=vertical\]\:w-px[data-orientation=vertical]{width:1px}.data-\[orientation\=vertical\]\:flex-col[data-orientation=vertical]{flex-direction:column}.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-\[panel-group-direction\=vertical\]\:flex-col[data-panel-group-direction=vertical]{flex-direction:column}.data-\[panel-group-direction\=vertical\]\:after\:left-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);left:calc(var(--spacing) * 0)}.data-\[panel-group-direction\=vertical\]\:after\:h-1[data-panel-group-direction=vertical]:after{content:var(--tw-content);height:calc(var(--spacing) * 1)}.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-x-0[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-x: calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[panel-group-direction\=vertical\]\:after\:-translate-y-1\/2[data-panel-group-direction=vertical]:after{content:var(--tw-content);--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:var(--muted-foreground)}.data-\[range-end\=true\]\:rounded-md[data-range-end=true]{border-radius:calc(var(--radius) - 2px)}.data-\[range-end\=true\]\:rounded-r-md[data-range-end=true]{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.data-\[range-end\=true\]\:bg-primary[data-range-end=true]{background-color:var(--primary)}.data-\[range-end\=true\]\:text-primary-foreground[data-range-end=true]{color:var(--primary-foreground)}.data-\[range-middle\=true\]\:rounded-none[data-range-middle=true]{border-radius:0}.data-\[range-middle\=true\]\:bg-accent[data-range-middle=true]{background-color:var(--accent)}.data-\[range-middle\=true\]\:text-accent-foreground[data-range-middle=true]{color:var(--accent-foreground)}.data-\[range-start\=true\]\:rounded-md[data-range-start=true]{border-radius:calc(var(--radius) - 2px)}.data-\[range-start\=true\]\:rounded-l-md[data-range-start=true]{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.data-\[range-start\=true\]\:bg-primary[data-range-start=true]{background-color:var(--primary)}.data-\[range-start\=true\]\:text-primary-foreground[data-range-start=true]{color:var(--primary-foreground)}.data-\[selected-single\=true\]\:bg-primary[data-selected-single=true]{background-color:var(--primary)}.data-\[selected-single\=true\]\:text-primary-foreground[data-selected-single=true]{color:var(--primary-foreground)}.data-\[selected\=true\]\:rounded-none[data-selected=true]{border-radius:0}.data-\[selected\=true\]\:bg-accent[data-selected=true]{background-color:var(--accent)}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:var(--accent-foreground)}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: calc(var(--spacing) * 1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: calc(2*var(--spacing)*-1)}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: calc(2*var(--spacing))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: calc(var(--spacing) * 1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: calc(2*var(--spacing)*-1)}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: calc(2*var(--spacing))}.data-\[size\=default\]\:h-9[data-size=default]{height:calc(var(--spacing) * 9)}.data-\[size\=sm\]\:h-8[data-size=sm]{height:calc(var(--spacing) * 8)}:is(.\*\:data-\[slot\=alert-description\]\:text-destructive\/90>*)[data-slot=alert-description]{color:var(--destructive)}@supports (color: color-mix(in lab,red,red)){:is(.\*\:data-\[slot\=alert-description\]\:text-destructive\/90>*)[data-slot=alert-description]{color:color-mix(in oklab,var(--destructive) 90%,transparent)}}:is(.\*\*\:data-\[slot\=command-input-wrapper\]\:h-12 *)[data-slot=command-input-wrapper]{height:calc(var(--spacing) * 12)}:is(.\*\*\:data-\[slot\=navigation-menu-link\]\:focus\:ring-0 *)[data-slot=navigation-menu-link]:focus{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}:is(.\*\*\:data-\[slot\=navigation-menu-link\]\:focus\:outline-none *)[data-slot=navigation-menu-link]:focus{--tw-outline-style: none;outline-style:none}:is(.\*\:data-\[slot\=select-value\]\:line-clamp-1>*)[data-slot=select-value]{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}:is(.\*\:data-\[slot\=select-value\]\:flex>*)[data-slot=select-value]{display:flex}:is(.\*\:data-\[slot\=select-value\]\:items-center>*)[data-slot=select-value]{align-items:center}:is(.\*\:data-\[slot\=select-value\]\:gap-2>*)[data-slot=select-value]{gap:calc(var(--spacing) * 2)}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:var(--background)}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[state\=checked\]\:translate-x-\[calc\(100\%-2px\)\][data-state=checked]{--tw-translate-x: calc(100% - 2px) ;translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[state\=checked\]\:border-primary[data-state=checked]{border-color:var(--primary)}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:var(--primary)}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:var(--primary-foreground)}.data-\[state\=closed\]\:animate-accordion-up[data-state=closed]{animation:accordion-up var(--tw-animation-duration,var(--tw-duration,.2s))ease-out}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=closed\]\:duration-300[data-state=closed]{--tw-duration: .3s;transition-duration:.3s}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0 ;--tw-exit-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: 95% ;--tw-exit-scale: .95}.data-\[state\=closed\]\:slide-out-to-bottom[data-state=closed]{--tw-exit-translate-y: 100%}.data-\[state\=closed\]\:slide-out-to-left[data-state=closed]{--tw-exit-translate-x: -100%}.data-\[state\=closed\]\:slide-out-to-right[data-state=closed]{--tw-exit-translate-x: 100%}.data-\[state\=closed\]\:slide-out-to-top[data-state=closed]{--tw-exit-translate-y: -100%}.group-data-\[viewport\=false\]\/navigation-menu\:data-\[state\=closed\]\:animate-out:is(:where(.group\/navigation-menu)[data-viewport=false] *)[data-state=closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.group-data-\[viewport\=false\]\/navigation-menu\:data-\[state\=closed\]\:fade-out-0:is(:where(.group\/navigation-menu)[data-viewport=false] *)[data-state=closed]{--tw-exit-opacity: 0 ;--tw-exit-opacity: 0}.group-data-\[viewport\=false\]\/navigation-menu\:data-\[state\=closed\]\:zoom-out-95:is(:where(.group\/navigation-menu)[data-viewport=false] *)[data-state=closed]{--tw-exit-scale: 95% ;--tw-exit-scale: .95}.data-\[state\=hidden\]\:animate-out[data-state=hidden]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=hidden\]\:fade-out[data-state=hidden]{--tw-exit-opacity: 0}.data-\[state\=on\]\:bg-accent[data-state=on]{background-color:var(--accent)}.data-\[state\=on\]\:text-accent-foreground[data-state=on]{color:var(--accent-foreground)}.data-\[state\=open\]\:animate-accordion-down[data-state=open]{animation:accordion-down var(--tw-animation-duration,var(--tw-duration,.2s))ease-out}.data-\[state\=open\]\:animate-in[data-state=open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:var(--accent)}.data-\[state\=open\]\:bg-accent\/50[data-state=open]{background-color:var(--accent)}@supports (color: color-mix(in lab,red,red)){.data-\[state\=open\]\:bg-accent\/50[data-state=open]{background-color:color-mix(in oklab,var(--accent) 50%,transparent)}}.data-\[state\=open\]\:bg-secondary[data-state=open]{background-color:var(--secondary)}.data-\[state\=open\]\:bg-sidebar-accent[data-state=open]{background-color:var(--sidebar-accent)}.data-\[state\=open\]\:text-accent-foreground[data-state=open]{color:var(--accent-foreground)}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:var(--muted-foreground)}.data-\[state\=open\]\:text-sidebar-accent-foreground[data-state=open]{color:var(--sidebar-accent-foreground)}.data-\[state\=open\]\:opacity-100[data-state=open]{opacity:100%}.data-\[state\=open\]\:duration-500[data-state=open]{--tw-duration: .5s;transition-duration:.5s}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity: 0 ;--tw-enter-opacity: 0}.data-\[state\=open\]\:zoom-in-90[data-state=open]{--tw-enter-scale: 90% ;--tw-enter-scale: .9}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: 95% ;--tw-enter-scale: .95}.data-\[state\=open\]\:slide-in-from-bottom[data-state=open]{--tw-enter-translate-y: 100%}.data-\[state\=open\]\:slide-in-from-left[data-state=open]{--tw-enter-translate-x: -100%}.data-\[state\=open\]\:slide-in-from-right[data-state=open]{--tw-enter-translate-x: 100%}.data-\[state\=open\]\:slide-in-from-top[data-state=open]{--tw-enter-translate-y: -100%}.group-data-\[viewport\=false\]\/navigation-menu\:data-\[state\=open\]\:animate-in:is(:where(.group\/navigation-menu)[data-viewport=false] *)[data-state=open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.group-data-\[viewport\=false\]\/navigation-menu\:data-\[state\=open\]\:fade-in-0:is(:where(.group\/navigation-menu)[data-viewport=false] *)[data-state=open]{--tw-enter-opacity: 0 ;--tw-enter-opacity: 0}.group-data-\[viewport\=false\]\/navigation-menu\:data-\[state\=open\]\:zoom-in-95:is(:where(.group\/navigation-menu)[data-viewport=false] *)[data-state=open]{--tw-enter-scale: 95% ;--tw-enter-scale: .95}@media (hover: hover){.data-\[state\=open\]\:hover\:bg-accent[data-state=open]:hover{background-color:var(--accent)}}@media (hover: hover){.data-\[state\=open\]\:hover\:bg-sidebar-accent[data-state=open]:hover{background-color:var(--sidebar-accent)}}@media (hover: hover){.data-\[state\=open\]\:hover\:text-sidebar-accent-foreground[data-state=open]:hover{color:var(--sidebar-accent-foreground)}}.data-\[state\=open\]\:focus\:bg-accent[data-state=open]:focus{background-color:var(--accent)}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:var(--muted)}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x: calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:var(--input)}.data-\[state\=visible\]\:animate-in[data-state=visible]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=visible\]\:fade-in[data-state=visible]{--tw-enter-opacity: 0}.data-\[variant\=destructive\]\:text-destructive[data-variant=destructive]{color:var(--destructive)}.data-\[variant\=destructive\]\:focus\:bg-destructive\/10[data-variant=destructive]:focus{background-color:var(--destructive)}@supports (color: color-mix(in lab,red,red)){.data-\[variant\=destructive\]\:focus\:bg-destructive\/10[data-variant=destructive]:focus{background-color:color-mix(in oklab,var(--destructive) 10%,transparent)}}.data-\[variant\=destructive\]\:focus\:text-destructive[data-variant=destructive]:focus{color:var(--destructive)}.data-\[variant\=outline\]\:border-l-0[data-variant=outline]{border-left-style:var(--tw-border-style);border-left-width:0px}.data-\[variant\=outline\]\:shadow-xs[data-variant=outline]{--tw-shadow: 0 1px 2px 0 var(--tw-shadow-color, rgb(0 0 0 / .05));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[variant\=outline\]\:first\:border-l[data-variant=outline]:first-child{border-left-style:var(--tw-border-style);border-left-width:1px}.data-\[vaul-drawer-direction\=bottom\]\:inset-x-0[data-vaul-drawer-direction=bottom]{inset-inline:calc(var(--spacing) * 0)}.data-\[vaul-drawer-direction\=bottom\]\:bottom-0[data-vaul-drawer-direction=bottom]{bottom:calc(var(--spacing) * 0)}.data-\[vaul-drawer-direction\=bottom\]\:mt-24[data-vaul-drawer-direction=bottom]{margin-top:calc(var(--spacing) * 24)}.data-\[vaul-drawer-direction\=bottom\]\:max-h-\[80vh\][data-vaul-drawer-direction=bottom]{max-height:80vh}.data-\[vaul-drawer-direction\=bottom\]\:rounded-t-lg[data-vaul-drawer-direction=bottom]{border-top-left-radius:var(--radius);border-top-right-radius:var(--radius)}.data-\[vaul-drawer-direction\=bottom\]\:border-t[data-vaul-drawer-direction=bottom]{border-top-style:var(--tw-border-style);border-top-width:1px}.data-\[vaul-drawer-direction\=left\]\:inset-y-0[data-vaul-drawer-direction=left]{inset-block:calc(var(--spacing) * 0)}.data-\[vaul-drawer-direction\=left\]\:left-0[data-vaul-drawer-direction=left]{left:calc(var(--spacing) * 0)}.data-\[vaul-drawer-direction\=left\]\:w-3\/4[data-vaul-drawer-direction=left]{width:75%}.data-\[vaul-drawer-direction\=left\]\:border-r[data-vaul-drawer-direction=left]{border-right-style:var(--tw-border-style);border-right-width:1px}.data-\[vaul-drawer-direction\=right\]\:inset-y-0[data-vaul-drawer-direction=right]{inset-block:calc(var(--spacing) * 0)}.data-\[vaul-drawer-direction\=right\]\:right-0[data-vaul-drawer-direction=right]{right:calc(var(--spacing) * 0)}.data-\[vaul-drawer-direction\=right\]\:w-3\/4[data-vaul-drawer-direction=right]{width:75%}.data-\[vaul-drawer-direction\=right\]\:border-l[data-vaul-drawer-direction=right]{border-left-style:var(--tw-border-style);border-left-width:1px}.data-\[vaul-drawer-direction\=top\]\:inset-x-0[data-vaul-drawer-direction=top]{inset-inline:calc(var(--spacing) * 0)}.data-\[vaul-drawer-direction\=top\]\:top-0[data-vaul-drawer-direction=top]{top:calc(var(--spacing) * 0)}.data-\[vaul-drawer-direction\=top\]\:mb-24[data-vaul-drawer-direction=top]{margin-bottom:calc(var(--spacing) * 24)}.data-\[vaul-drawer-direction\=top\]\:max-h-\[80vh\][data-vaul-drawer-direction=top]{max-height:80vh}.data-\[vaul-drawer-direction\=top\]\:rounded-b-lg[data-vaul-drawer-direction=top]{border-bottom-right-radius:var(--radius);border-bottom-left-radius:var(--radius)}.data-\[vaul-drawer-direction\=top\]\:border-b[data-vaul-drawer-direction=top]{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}@media (width >= 40rem){.sm\:block{display:block}}@media (width >= 40rem){.sm\:flex{display:flex}}@media (width >= 40rem){.sm\:w-auto{width:auto}}@media (width >= 40rem){.sm\:max-w-\[425px\]{max-width:425px}}@media (width >= 40rem){.sm\:max-w-lg{max-width:var(--container-lg)}}@media (width >= 40rem){.sm\:max-w-md{max-width:var(--container-md)}}@media (width >= 40rem){.sm\:max-w-sm{max-width:var(--container-sm)}}@media (width >= 40rem){.sm\:flex-row{flex-direction:row}}@media (width >= 40rem){.sm\:justify-end{justify-content:flex-end}}@media (width >= 40rem){.sm\:gap-2\.5{gap:calc(var(--spacing) * 2.5)}}@media (width >= 40rem){.sm\:pr-2\.5{padding-right:calc(var(--spacing) * 2.5)}}@media (width >= 40rem){.sm\:pl-2\.5{padding-left:calc(var(--spacing) * 2.5)}}@media (width >= 40rem){.sm\:text-left{text-align:left}}@media (width >= 40rem){.data-\[vaul-drawer-direction\=left\]\:sm\:max-w-sm[data-vaul-drawer-direction=left]{max-width:var(--container-sm)}}@media (width >= 40rem){.data-\[vaul-drawer-direction\=right\]\:sm\:max-w-sm[data-vaul-drawer-direction=right]{max-width:var(--container-sm)}}@media (width >= 48rem){.md\:absolute{position:absolute}}@media (width >= 48rem){.md\:block{display:block}}@media (width >= 48rem){.md\:flex{display:flex}}@media (width >= 48rem){.md\:min-h-min{min-height:min-content}}@media (width >= 48rem){.md\:w-\[400px\]{width:400px}}@media (width >= 48rem){.md\:w-\[500px\]{width:500px}}@media (width >= 48rem){.md\:w-\[var\(--radix-navigation-menu-viewport-width\)\]{width:var(--radix-navigation-menu-viewport-width)}}@media (width >= 48rem){.md\:w-auto{width:auto}}@media (width >= 48rem){.md\:basis-1\/2{flex-basis:50%}}@media (width >= 48rem){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (width >= 48rem){.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (width >= 48rem){.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (width >= 48rem){.md\:flex-row{flex-direction:row}}@media (width >= 48rem){.md\:gap-1\.5{gap:calc(var(--spacing) * 1.5)}}@media (width >= 48rem){.md\:text-left{text-align:left}}@media (width >= 48rem){.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading, var(--text-sm--line-height))}}@media (width >= 48rem){.md\:opacity-0{opacity:0%}}@media (width >= 48rem){.md\:peer-data-\[variant\=inset\]\:m-2:is(:where(.peer)[data-variant=inset]~*){margin:calc(var(--spacing) * 2)}}@media (width >= 48rem){.md\:peer-data-\[variant\=inset\]\:ml-0:is(:where(.peer)[data-variant=inset]~*){margin-left:calc(var(--spacing) * 0)}}@media (width >= 48rem){.md\:peer-data-\[variant\=inset\]\:rounded-xl:is(:where(.peer)[data-variant=inset]~*){border-radius:calc(var(--radius) + 4px)}}@media (width >= 48rem){.md\:peer-data-\[variant\=inset\]\:shadow-sm:is(:where(.peer)[data-variant=inset]~*){--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}@media (width >= 48rem){.md\:peer-data-\[variant\=inset\]\:peer-data-\[state\=collapsed\]\:ml-2:is(:where(.peer)[data-variant=inset]~*):is(:where(.peer)[data-state=collapsed]~*){margin-left:calc(var(--spacing) * 2)}}@media (width >= 48rem){.md\:after\:hidden:after{content:var(--tw-content);display:none}}@media (width >= 64rem){.lg\:w-\[500px\]{width:500px}}@media (width >= 64rem){.lg\:w-\[600px\]{width:600px}}@media (width >= 64rem){.lg\:basis-1\/3{flex-basis:calc(1/3 * 100%)}}@media (width >= 64rem){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (width >= 64rem){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (width >= 64rem){.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (width >= 64rem){.lg\:grid-cols-\[\.75fr_1fr\]{grid-template-columns:.75fr 1fr}}.dark\:border-input:is(.dark *){border-color:var(--input)}.dark\:bg-destructive\/60:is(.dark *){background-color:var(--destructive)}@supports (color: color-mix(in lab,red,red)){.dark\:bg-destructive\/60:is(.dark *){background-color:color-mix(in oklab,var(--destructive) 60%,transparent)}}.dark\:bg-input\/30:is(.dark *){background-color:var(--input)}@supports (color: color-mix(in lab,red,red)){.dark\:bg-input\/30:is(.dark *){background-color:color-mix(in oklab,var(--input) 30%,transparent)}}.dark\:bg-slate-800:is(.dark *){background-color:var(--color-slate-800)}.dark\:bg-slate-900:is(.dark *){background-color:var(--color-slate-900)}.dark\:text-muted-foreground:is(.dark *){color:var(--muted-foreground)}@media (hover: hover){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:var(--accent)}@supports (color: color-mix(in lab,red,red)){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--accent) 50%,transparent)}}}@media (hover: hover){.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:var(--input)}@supports (color: color-mix(in lab,red,red)){.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--input) 50%,transparent)}}}@media (hover: hover){.dark\:hover\:text-accent-foreground:is(.dark *):hover{color:var(--accent-foreground)}}.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color: var(--destructive)}@supports (color: color-mix(in lab,red,red)){.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color: color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color: var(--destructive)}@supports (color: color-mix(in lab,red,red)){.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color: color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\:data-\[active\=true\]\:aria-invalid\:ring-destructive\/40:is(.dark *)[data-active=true][aria-invalid=true]{--tw-ring-color: var(--destructive)}@supports (color: color-mix(in lab,red,red)){.dark\:data-\[active\=true\]\:aria-invalid\:ring-destructive\/40:is(.dark *)[data-active=true][aria-invalid=true]{--tw-ring-color: color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\:data-\[state\=active\]\:border-input:is(.dark *)[data-state=active]{border-color:var(--input)}.dark\:data-\[state\=active\]\:bg-input\/30:is(.dark *)[data-state=active]{background-color:var(--input)}@supports (color: color-mix(in lab,red,red)){.dark\:data-\[state\=active\]\:bg-input\/30:is(.dark *)[data-state=active]{background-color:color-mix(in oklab,var(--input) 30%,transparent)}}.dark\:data-\[state\=active\]\:text-foreground:is(.dark *)[data-state=active]{color:var(--foreground)}.dark\:data-\[state\=checked\]\:bg-primary:is(.dark *)[data-state=checked]{background-color:var(--primary)}.dark\:data-\[state\=checked\]\:bg-primary-foreground:is(.dark *)[data-state=checked]{background-color:var(--primary-foreground)}.dark\:data-\[state\=unchecked\]\:bg-foreground:is(.dark *)[data-state=unchecked]{background-color:var(--foreground)}.dark\:data-\[state\=unchecked\]\:bg-input\/80:is(.dark *)[data-state=unchecked]{background-color:var(--input)}@supports (color: color-mix(in lab,red,red)){.dark\:data-\[state\=unchecked\]\:bg-input\/80:is(.dark *)[data-state=unchecked]{background-color:color-mix(in oklab,var(--input) 80%,transparent)}}.dark\:data-\[variant\=destructive\]\:focus\:bg-destructive\/20:is(.dark *)[data-variant=destructive]:focus{background-color:var(--destructive)}@supports (color: color-mix(in lab,red,red)){.dark\:data-\[variant\=destructive\]\:focus\:bg-destructive\/20:is(.dark *)[data-variant=destructive]:focus{background-color:color-mix(in oklab,var(--destructive) 20%,transparent)}}.\[\&_\.recharts-cartesian-axis-tick_text\]\:fill-muted-foreground .recharts-cartesian-axis-tick text{fill:var(--muted-foreground)}.\[\&_\.recharts-cartesian-grid_line\[stroke\=\'\#ccc\'\]\]\:stroke-border\/50 .recharts-cartesian-grid line[stroke="#ccc"]{stroke:var(--border)}@supports (color: color-mix(in lab,red,red)){.\[\&_\.recharts-cartesian-grid_line\[stroke\=\'\#ccc\'\]\]\:stroke-border\/50 .recharts-cartesian-grid line[stroke="#ccc"]{stroke:color-mix(in oklab,var(--border) 50%,transparent)}}.\[\&_\.recharts-curve\.recharts-tooltip-cursor\]\:stroke-border .recharts-curve.recharts-tooltip-cursor{stroke:var(--border)}.\[\&_\.recharts-dot\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-dot[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-layer\]\:outline-hidden .recharts-layer{--tw-outline-style: none;outline-style:none}@media (forced-colors: active){.\[\&_\.recharts-layer\]\:outline-hidden .recharts-layer{outline:2px solid transparent;outline-offset:2px}}.\[\&_\.recharts-polar-grid_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-polar-grid [stroke="#ccc"]{stroke:var(--border)}.\[\&_\.recharts-radial-bar-background-sector\]\:fill-muted .recharts-radial-bar-background-sector{fill:var(--muted)}.\[\&_\.recharts-rectangle\.recharts-tooltip-cursor\]\:fill-muted .recharts-rectangle.recharts-tooltip-cursor{fill:var(--muted)}.\[\&_\.recharts-reference-line_\[stroke\=\'\#ccc\'\]\]\:stroke-border .recharts-reference-line [stroke="#ccc"]{stroke:var(--border)}.\[\&_\.recharts-sector\]\:outline-hidden .recharts-sector{--tw-outline-style: none;outline-style:none}@media (forced-colors: active){.\[\&_\.recharts-sector\]\:outline-hidden .recharts-sector{outline:2px solid transparent;outline-offset:2px}}.\[\&_\.recharts-sector\[stroke\=\'\#fff\'\]\]\:stroke-transparent .recharts-sector[stroke="#fff"]{stroke:transparent}.\[\&_\.recharts-surface\]\:outline-hidden .recharts-surface{--tw-outline-style: none;outline-style:none}@media (forced-colors: active){.\[\&_\.recharts-surface\]\:outline-hidden .recharts-surface{outline:2px solid transparent;outline-offset:2px}}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-inline:calc(var(--spacing) * 2)}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-block:calc(var(--spacing) * 1.5)}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:var(--text-xs);line-height:var(--tw-leading, var(--text-xs--line-height))}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{--tw-font-weight: var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:var(--muted-foreground)}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-inline:calc(var(--spacing) * 2)}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:calc(var(--spacing) * 0)}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:calc(var(--spacing) * 5)}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:calc(var(--spacing) * 5)}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:calc(var(--spacing) * 12)}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-inline:calc(var(--spacing) * 2)}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-block:calc(var(--spacing) * 3)}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:calc(var(--spacing) * 5)}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:calc(var(--spacing) * 5)}.\[\&_p\]\:leading-relaxed p{--tw-leading: var(--leading-relaxed);line-height:var(--leading-relaxed)}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&_svg\:not\(\[class\*\=\'text-\'\]\)\]\:text-muted-foreground svg:not([class*=text-]){color:var(--muted-foreground)}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-style:var(--tw-border-style);border-width:0px}.\[\&\:\:-webkit-calendar-picker-indicator\]\:hidden::-webkit-calendar-picker-indicator{display:none}.\[\&\:\:-webkit-calendar-picker-indicator\]\:appearance-none::-webkit-calendar-picker-indicator{appearance:none}.\[\&\:first-child\[data-selected\=true\]_button\]\:rounded-l-md:first-child[data-selected=true] button{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:calc(var(--spacing) * 0)}.\[\.border-b\]\:pb-6:is(.border-b){padding-bottom:calc(var(--spacing) * 6)}.\[\.border-t\]\:pt-6:is(.border-t){padding-top:calc(var(--spacing) * 6)}:is(.rtl\:\*\*\:\[\.rdp-button\\_next\>svg\]\:rotate-180:where(:dir(rtl),[dir=rtl],[dir=rtl] *) *):is(.rdp-button_next>svg){rotate:180deg}:is(.rtl\:\*\*\:\[\.rdp-button\\_previous\>svg\]\:rotate-180:where(:dir(rtl),[dir=rtl],[dir=rtl] *) *):is(.rdp-button_previous>svg){rotate:180deg}:is(.\*\:\[span\]\:last\:flex>*):is(span):last-child{display:flex}:is(.\*\:\[span\]\:last\:items-center>*):is(span):last-child{align-items:center}:is(.\*\:\[span\]\:last\:gap-2>*):is(span):last-child{gap:calc(var(--spacing) * 2)}:is(.data-\[variant\=destructive\]\:\*\:\[svg\]\:\!text-destructive[data-variant=destructive]>*):is(svg){color:var(--destructive)!important}.\[\&\:last-child\[data-selected\=true\]_button\]\:rounded-r-md:last-child[data-selected=true] button{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y: 2px;translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&\>button\]\:hidden>button{display:none}.\[\&\>div\]\:bg-blue-500>div{background-color:var(--color-blue-500)}.\[\&\>div\]\:bg-green-500>div{background-color:var(--color-green-500)}.\[\&\>div\]\:bg-orange-500>div{background-color:var(--color-orange-500)}.\[\&\>div\]\:bg-red-500>div{background-color:var(--color-red-500)}.\[\&\>div\]\:bg-yellow-500>div{background-color:var(--color-yellow-500)}.\[\&\>div\]\:bg-gradient-to-r>div{--tw-gradient-position: to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.\[\&\>div\]\:from-purple-500>div{--tw-gradient-from: var(--color-purple-500);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.\[\&\>div\]\:to-pink-500>div{--tw-gradient-to: var(--color-pink-500);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.\[\&\>span\]\:text-xs>span{font-size:var(--text-xs);line-height:var(--tw-leading, var(--text-xs--line-height))}.\[\&\>span\]\:opacity-70>span{opacity:70%}.\[\&\>span\:last-child\]\:truncate>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.\[\&\>svg\]\:pointer-events-none>svg{pointer-events:none}.\[\&\>svg\]\:size-3>svg{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\[\&\>svg\]\:size-3\.5>svg{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.\[\&\>svg\]\:size-4>svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&\>svg\]\:h-2\.5>svg{height:calc(var(--spacing) * 2.5)}.\[\&\>svg\]\:h-3>svg{height:calc(var(--spacing) * 3)}.\[\&\>svg\]\:w-2\.5>svg{width:calc(var(--spacing) * 2.5)}.\[\&\>svg\]\:w-3>svg{width:calc(var(--spacing) * 3)}.\[\&\>svg\]\:shrink-0>svg{flex-shrink:0}.\[\&\>svg\]\:translate-y-0\.5>svg{--tw-translate-y: calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&\>svg\]\:text-current>svg{color:currentcolor}.\[\&\>svg\]\:text-muted-foreground>svg{color:var(--muted-foreground)}.\[\&\>svg\]\:text-sidebar-accent-foreground>svg{color:var(--sidebar-accent-foreground)}.\[\&\>tr\]\:last\:border-b-0>tr:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0px}.\[\&\[data-panel-group-direction\=vertical\]\>div\]\:rotate-90[data-panel-group-direction=vertical]>div{rotate:90deg}.\[\&\[data-state\=open\]\>svg\]\:rotate-180[data-state=open]>svg{rotate:180deg}[data-side=left][data-collapsible=offcanvas] .\[\[data-side\=left\]\[data-collapsible\=offcanvas\]_\&\]\:-right-2{right:calc(var(--spacing) * -2)}[data-side=left][data-state=collapsed] .\[\[data-side\=left\]\[data-state\=collapsed\]_\&\]\:cursor-e-resize{cursor:e-resize}[data-side=right][data-collapsible=offcanvas] .\[\[data-side\=right\]\[data-collapsible\=offcanvas\]_\&\]\:-left-2{left:calc(var(--spacing) * -2)}[data-side=right][data-state=collapsed] .\[\[data-side\=right\]\[data-state\=collapsed\]_\&\]\:cursor-w-resize{cursor:w-resize}[data-slot=card-content] .\[\[data-slot\=card-content\]_\&\]\:bg-transparent{background-color:transparent}[data-slot=popover-content] .\[\[data-slot\=popover-content\]_\&\]\:bg-transparent{background-color:transparent}@media (hover: hover){a.\[a\&\]\:hover\:bg-accent:hover{background-color:var(--accent)}}@media (hover: hover){a.\[a\&\]\:hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color: color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--destructive) 90%,transparent)}}}@media (hover: hover){a.\[a\&\]\:hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color: color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--primary) 90%,transparent)}}}@media (hover: hover){a.\[a\&\]\:hover\:bg-secondary\/90:hover{background-color:var(--secondary)}@supports (color: color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-secondary\/90:hover{background-color:color-mix(in oklab,var(--secondary) 90%,transparent)}}}@media (hover: hover){a.\[a\&\]\:hover\:text-accent-foreground:hover{color:var(--accent-foreground)}}}@property --tw-animation-delay{syntax: "*"; inherits: false; initial-value: 0s;}@property --tw-animation-direction{syntax: "*"; inherits: false; initial-value: normal;}@property --tw-animation-duration{syntax: "*"; inherits: false;}@property --tw-animation-fill-mode{syntax: "*"; inherits: false; initial-value: none;}@property --tw-animation-iteration-count{syntax: "*"; inherits: false; initial-value: 1;}@property --tw-enter-opacity{syntax: "*"; inherits: false; initial-value: 1;}@property --tw-enter-rotate{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-enter-scale{syntax: "*"; inherits: false; initial-value: 1;}@property --tw-enter-translate-x{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-enter-translate-y{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-exit-opacity{syntax: "*"; inherits: false; initial-value: 1;}@property --tw-exit-rotate{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-exit-scale{syntax: "*"; inherits: false; initial-value: 1;}@property --tw-exit-translate-x{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-exit-translate-y{syntax: "*"; inherits: false; initial-value: 0;}:root{--background: oklch(1 0 0);--foreground: oklch(.145 0 0);--card: oklch(1 0 0);--card-foreground: oklch(.145 0 0);--popover: oklch(1 0 0);--popover-foreground: oklch(.145 0 0);--primary: oklch(67.35% .153 159.64);--primary-foreground: oklch(.985 0 0);--secondary: oklch(.97 0 0);--secondary-foreground: oklch(.205 0 0);--muted: oklch(.97 0 0);--muted-foreground: oklch(.556 0 0);--accent: oklch(.97 0 0);--accent-foreground: oklch(.205 0 0);--destructive: oklch(.577 .245 27.325);--destructive-foreground: oklch(.577 .245 27.325);--border: oklch(.922 0 0);--input: oklch(.922 0 0);--ring: oklch(.708 0 0);--chart-1: oklch(.646 .222 41.116);--chart-2: oklch(.6 .118 184.704);--chart-3: oklch(.398 .07 227.392);--chart-4: oklch(.828 .189 84.429);--chart-5: oklch(.769 .188 70.08);--radius: .625rem;--sidebar: oklch(.985 0 0);--sidebar-foreground: oklch(.145 0 0);--sidebar-primary: oklch(.205 0 0);--sidebar-primary-foreground: oklch(.985 0 0);--sidebar-accent: oklch(.97 0 0);--sidebar-accent-foreground: oklch(.205 0 0);--sidebar-border: oklch(.922 0 0);--sidebar-ring: oklch(.708 0 0)}.dark{--background: oklch(.145 0 0);--foreground: oklch(.985 0 0);--card: oklch(.145 0 0);--card-foreground: oklch(.985 0 0);--popover: oklch(.145 0 0);--popover-foreground: oklch(.985 0 0);--primary: oklch(88.18% .202 159.34);--primary-foreground: oklch(.205 0 0);--secondary: oklch(.269 0 0);--secondary-foreground: oklch(.985 0 0);--muted: oklch(.269 0 0);--muted-foreground: oklch(.708 0 0);--accent: oklch(.269 0 0);--accent-foreground: oklch(.985 0 0);--destructive: oklch(.396 .141 25.723);--destructive-foreground: oklch(.637 .237 25.331);--border: oklch(.269 0 0);--input: oklch(.269 0 0);--ring: oklch(.439 0 0);--chart-1: oklch(.488 .243 264.376);--chart-2: oklch(.696 .17 162.48);--chart-3: oklch(.769 .188 70.08);--chart-4: oklch(.627 .265 303.9);--chart-5: oklch(.645 .246 16.439);--sidebar: oklch(.205 0 0);--sidebar-foreground: oklch(.985 0 0);--sidebar-primary: oklch(.488 .243 264.376);--sidebar-primary-foreground: oklch(.985 0 0);--sidebar-accent: oklch(.269 0 0);--sidebar-accent-foreground: oklch(.985 0 0);--sidebar-border: oklch(.269 0 0);--sidebar-ring: oklch(.439 0 0)}@layer base{*{border-color:var(--border);outline-color:var(--ring)}@supports (color: color-mix(in lab,red,red)){*{outline-color:color-mix(in oklab,var(--ring) 50%,transparent)}}body{background-color:var(--background);color:var(--foreground)}}@property --tw-translate-x{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-translate-y{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-translate-z{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-rotate-x{syntax: "*"; inherits: false;}@property --tw-rotate-y{syntax: "*"; inherits: false;}@property --tw-rotate-z{syntax: "*"; inherits: false;}@property --tw-skew-x{syntax: "*"; inherits: false;}@property --tw-skew-y{syntax: "*"; inherits: false;}@property --tw-space-y-reverse{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-space-x-reverse{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-border-style{syntax: "*"; inherits: false; initial-value: solid;}@property --tw-gradient-position{syntax: "*"; inherits: false;}@property --tw-gradient-from{syntax: ""; inherits: false; initial-value: #0000;}@property --tw-gradient-via{syntax: ""; inherits: false; initial-value: #0000;}@property --tw-gradient-to{syntax: ""; inherits: false; initial-value: #0000;}@property --tw-gradient-stops{syntax: "*"; inherits: false;}@property --tw-gradient-via-stops{syntax: "*"; inherits: false;}@property --tw-gradient-from-position{syntax: ""; inherits: false; initial-value: 0%;}@property --tw-gradient-via-position{syntax: ""; inherits: false; initial-value: 50%;}@property --tw-gradient-to-position{syntax: ""; inherits: false; initial-value: 100%;}@property --tw-leading{syntax: "*"; inherits: false;}@property --tw-font-weight{syntax: "*"; inherits: false;}@property --tw-tracking{syntax: "*"; inherits: false;}@property --tw-ordinal{syntax: "*"; inherits: false;}@property --tw-slashed-zero{syntax: "*"; inherits: false;}@property --tw-numeric-figure{syntax: "*"; inherits: false;}@property --tw-numeric-spacing{syntax: "*"; inherits: false;}@property --tw-numeric-fraction{syntax: "*"; inherits: false;}@property --tw-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: "*"; inherits: false;}@property --tw-shadow-alpha{syntax: ""; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: "*"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: ""; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: "*"; inherits: false;}@property --tw-ring-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: "*"; inherits: false;}@property --tw-inset-ring-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: "*"; inherits: false;}@property --tw-ring-offset-width{syntax: ""; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: "*"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-outline-style{syntax: "*"; inherits: false; initial-value: solid;}@property --tw-duration{syntax: "*"; inherits: false;}@property --tw-ease{syntax: "*"; inherits: false;}@property --tw-content{syntax: "*"; initial-value: ""; inherits: false;}@keyframes pulse{50%{opacity:.5}}@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))}}@keyframes accordion-down{0%{height:0}to{height:var(--radix-accordion-content-height,var(--bits-accordion-content-height,var(--reka-accordion-content-height,var(--kb-accordion-content-height,auto))))}}@keyframes accordion-up{0%{height:var(--radix-accordion-content-height,var(--bits-accordion-content-height,var(--reka-accordion-content-height,var(--kb-accordion-content-height,auto))))}to{height:0}}@keyframes caret-blink{0%,70%,to{opacity:1}20%,50%{opacity:0}}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x: 0;--tw-translate-y: 0;--tw-translate-z: 0;--tw-rotate-x: initial;--tw-rotate-y: initial;--tw-rotate-z: initial;--tw-skew-x: initial;--tw-skew-y: initial;--tw-space-y-reverse: 0;--tw-space-x-reverse: 0;--tw-border-style: solid;--tw-gradient-position: initial;--tw-gradient-from: #0000;--tw-gradient-via: #0000;--tw-gradient-to: #0000;--tw-gradient-stops: initial;--tw-gradient-via-stops: initial;--tw-gradient-from-position: 0%;--tw-gradient-via-position: 50%;--tw-gradient-to-position: 100%;--tw-leading: initial;--tw-font-weight: initial;--tw-tracking: initial;--tw-ordinal: initial;--tw-slashed-zero: initial;--tw-numeric-figure: initial;--tw-numeric-spacing: initial;--tw-numeric-fraction: initial;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000;--tw-outline-style: solid;--tw-duration: initial;--tw-ease: initial;--tw-content: "";--tw-animation-delay: 0s;--tw-animation-direction: normal;--tw-animation-duration: initial;--tw-animation-fill-mode: none;--tw-animation-iteration-count: 1;--tw-enter-opacity: 1;--tw-enter-rotate: 0;--tw-enter-scale: 1;--tw-enter-translate-x: 0;--tw-enter-translate-y: 0;--tw-exit-opacity: 1;--tw-exit-rotate: 0;--tw-exit-scale: 1;--tw-exit-translate-x: 0;--tw-exit-translate-y: 0}}}/*! tailwindcss v4.1.10 | MIT License | https://tailwindcss.com *//*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-x-reverse:0;--tw-border-style:solid;--tw-divide-y-reverse:0;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-content:"";--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-200:oklch(88.5% .062 18.334);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-800:oklch(44.4% .177 26.899);--color-red-900:oklch(39.6% .141 25.723);--color-amber-500:oklch(76.9% .188 70.08);--color-yellow-50:oklch(98.7% .026 102.212);--color-yellow-500:oklch(79.5% .184 86.047);--color-yellow-950:oklch(28.6% .066 53.813);--color-green-500:oklch(72.3% .219 149.579);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-rose-600:oklch(58.6% .253 17.585);--color-rose-700:oklch(51.4% .222 16.935);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-4xl:56rem;--container-5xl:64rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-widest:.1em;--radius-xs:.125rem;--radius-3xl:1.5rem;--animate-spin:spin 1s linear infinite;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){*{outline-color:color-mix(in oklab,var(--ring) 50%,transparent)}}html,body{height:100%;margin:0;padding:0;overflow:hidden}body{background-color:var(--background);color:var(--foreground);font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif}#root{height:100%}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:0 0;border-radius:4px}::-webkit-scrollbar-thumb{background-color:#ffffff26;background-clip:content-box;border:2px solid #0000;border-radius:4px;transition:background-color .2s}::-webkit-scrollbar-thumb:hover{background-color:#ffffff40}*{scrollbar-width:thin;scrollbar-color:#ffffff26 transparent}@media (max-width:768px){*{scrollbar-width:none}::-webkit-scrollbar{display:none}}}@layer components;@layer utilities{.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.top-0{top:calc(var(--spacing) * 0)}.top-1\/2{top:50%}.top-4{top:calc(var(--spacing) * 4)}.top-\[50\%\]{top:50%}.right-0{right:calc(var(--spacing) * 0)}.right-4{right:calc(var(--spacing) * 4)}.-bottom-4{bottom:calc(var(--spacing) * -4)}.bottom-0{bottom:calc(var(--spacing) * 0)}.left-0{left:calc(var(--spacing) * 0)}.left-3{left:calc(var(--spacing) * 3)}.left-\[50\%\]{left:50%}.z-10{z-index:10}.z-50{z-index:50}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.-m-2{margin:calc(var(--spacing) * -2)}.m-4{margin:calc(var(--spacing) * 4)}.-mx-4{margin-inline:calc(var(--spacing) * -4)}.mx-4{margin-inline:calc(var(--spacing) * 4)}.mx-auto{margin-inline:auto}.my-2{margin-block:calc(var(--spacing) * 2)}.my-4{margin-block:calc(var(--spacing) * 4)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mt-10{margin-top:calc(var(--spacing) * 10)}.mt-12{margin-top:calc(var(--spacing) * 12)}.mr-1{margin-right:calc(var(--spacing) * 1)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mr-16{margin-right:calc(var(--spacing) * 16)}.mb-0\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.mb-12{margin-bottom:calc(var(--spacing) * 12)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-7{margin-left:calc(var(--spacing) * 7)}.ml-auto{margin-left:auto}.box-border{box-sizing:border-box}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.field-sizing-content{field-sizing:content}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-16{height:calc(var(--spacing) * 16)}.h-24{height:calc(var(--spacing) * 24)}.h-56{height:calc(var(--spacing) * 56)}.h-64{height:calc(var(--spacing) * 64)}.h-\[1\.2rem\]{height:1.2rem}.h-\[1px\]{height:1px}.h-\[85vh\]{height:85vh}.h-auto{height:auto}.h-full{height:100%}.h-screen{height:100vh}.max-h-32{max-height:calc(var(--spacing) * 32)}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-\[92vh\]{max-height:92vh}.max-h-\[200px\]{max-height:200px}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-9{min-height:calc(var(--spacing) * 9)}.min-h-16{min-height:calc(var(--spacing) * 16)}.min-h-\[40vh\]{min-height:40vh}.min-h-screen{min-height:100vh}.w-1{width:calc(var(--spacing) * 1)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-12{width:calc(var(--spacing) * 12)}.w-14{width:calc(var(--spacing) * 14)}.w-16{width:calc(var(--spacing) * 16)}.w-20{width:calc(var(--spacing) * 20)}.w-56{width:calc(var(--spacing) * 56)}.w-64{width:calc(var(--spacing) * 64)}.w-80{width:calc(var(--spacing) * 80)}.w-\[1\.2rem\]{width:1.2rem}.w-\[300px\]{width:300px}.w-full{width:100%}.w-px{width:1px}.max-w-2xl{max-width:var(--container-2xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-5xl{max-width:var(--container-5xl)}.max-w-7xl{max-width:var(--container-7xl)}.max-w-32{max-width:calc(var(--spacing) * 32)}.max-w-40{max-width:calc(var(--spacing) * 40)}.max-w-\[60\%\]{max-width:60%}.max-w-\[64rem\]{max-width:64rem}.max-w-\[70\%\]{max-width:70%}.max-w-\[320px\]{max-width:320px}.max-w-\[calc\(100\%-2rem\)\]{max-width:calc(100% - 2rem)}.max-w-full{max-width:100%}.max-w-md{max-width:var(--container-md)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\[80px\]{min-width:80px}.min-w-\[180px\]{min-width:180px}.min-w-\[280px\]{min-width:280px}.flex-1{flex:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.translate-x-\[-50\%\]{--tw-translate-x:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.scale-0{--tw-scale-x:0%;--tw-scale-y:0%;--tw-scale-z:0%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}.rotate-0{rotate:0deg}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-1{gap:calc(var(--spacing) * 1)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-8{column-gap:calc(var(--spacing) * 8)}:where(.space-x-3>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * 3) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-x-reverse)))}.gap-y-2{row-gap:calc(var(--spacing) * 2)}:where(.divide-x>:not(:last-child)){--tw-divide-x-reverse:0;border-inline-style:var(--tw-border-style);border-inline-start-width:calc(1px * var(--tw-divide-x-reverse));border-inline-end-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}.self-end{align-self:flex-end}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-3xl{border-radius:var(--radius-3xl)}.rounded-\[16px\]{border-radius:16px}.rounded-full{border-radius:3.40282e38px}.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:calc(var(--radius) + 4px)}.rounded-xs{border-radius:var(--radius-xs)}.rounded-l-lg{border-top-left-radius:var(--radius);border-bottom-left-radius:var(--radius)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-none{--tw-border-style:none;border-style:none}.border-amber-500\/40{border-color:#f99c0066}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/40{border-color:color-mix(in oklab,var(--color-amber-500) 40%,transparent)}}.border-black{border-color:var(--color-black)}.border-black\/10{border-color:#0000001a}@supports (color:color-mix(in lab,red,red)){.border-black\/10{border-color:color-mix(in oklab,var(--color-black) 10%,transparent)}}.border-border,.border-border\/50{border-color:var(--border)}@supports (color:color-mix(in lab,red,red)){.border-border\/50{border-color:color-mix(in oklab,var(--border) 50%,transparent)}}.border-destructive{border-color:var(--destructive)}.border-gray-300{border-color:var(--color-gray-300)}.border-input{border-color:var(--input)}.border-muted{border-color:var(--muted)}.border-sidebar-border{border-color:var(--sidebar-border)}.border-l-primary{border-left-color:var(--primary)}.bg-\[\#b2ece0\]{background-color:#b2ece0}.bg-\[\#c8fff2\]{background-color:#c8fff2}.bg-\[\#d2e2e2\]{background-color:#d2e2e2}.bg-\[\#e0f0f0\]{background-color:#e0f0f0}.bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/10{background-color:color-mix(in oklab,var(--color-amber-500) 10%,transparent)}}.bg-background,.bg-background\/80{background-color:var(--background)}@supports (color:color-mix(in lab,red,red)){.bg-background\/80{background-color:color-mix(in oklab,var(--background) 80%,transparent)}}.bg-background\/95{background-color:var(--background)}@supports (color:color-mix(in lab,red,red)){.bg-background\/95{background-color:color-mix(in oklab,var(--background) 95%,transparent)}}.bg-black\/5{background-color:#0000000d}@supports (color:color-mix(in lab,red,red)){.bg-black\/5{background-color:color-mix(in oklab,var(--color-black) 5%,transparent)}}.bg-black\/10{background-color:#0000001a}@supports (color:color-mix(in lab,red,red)){.bg-black\/10{background-color:color-mix(in oklab,var(--color-black) 10%,transparent)}}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black) 50%,transparent)}}.bg-blue-100{background-color:var(--color-blue-100)}.bg-blue-700{background-color:var(--color-blue-700)}.bg-card,.bg-card\/50{background-color:var(--card)}@supports (color:color-mix(in lab,red,red)){.bg-card\/50{background-color:color-mix(in oklab,var(--card) 50%,transparent)}}.bg-gray-100{background-color:var(--color-gray-100)}.bg-green-500\/10{background-color:#00c7581a}@supports (color:color-mix(in lab,red,red)){.bg-green-500\/10{background-color:color-mix(in oklab,var(--color-green-500) 10%,transparent)}}.bg-muted,.bg-muted\/10{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\/10{background-color:color-mix(in oklab,var(--muted) 10%,transparent)}}.bg-muted\/30{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\/30{background-color:color-mix(in oklab,var(--muted) 30%,transparent)}}.bg-muted\/50{background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.bg-muted\/50{background-color:color-mix(in oklab,var(--muted) 50%,transparent)}}.bg-primary,.bg-primary\/10{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.bg-primary\/10{background-color:color-mix(in oklab,var(--primary) 10%,transparent)}}.bg-primary\/20{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.bg-primary\/20{background-color:color-mix(in oklab,var(--primary) 20%,transparent)}}.bg-primary\/30{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.bg-primary\/30{background-color:color-mix(in oklab,var(--primary) 30%,transparent)}}.bg-red-50{background-color:var(--color-red-50)}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500) 10%,transparent)}}.bg-sidebar{background-color:var(--sidebar)}.bg-sidebar-accent\/50{background-color:var(--sidebar-accent)}@supports (color:color-mix(in lab,red,red)){.bg-sidebar-accent\/50{background-color:color-mix(in oklab,var(--sidebar-accent) 50%,transparent)}}.bg-sidebar-border{background-color:var(--sidebar-border)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-yellow-50{background-color:var(--color-yellow-50)}.bg-yellow-500\/10{background-color:#edb2001a}@supports (color:color-mix(in lab,red,red)){.bg-yellow-500\/10{background-color:color-mix(in oklab,var(--color-yellow-500) 10%,transparent)}}.bg-gradient-to-t{--tw-gradient-position:to top in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-primary\/20{--tw-gradient-from:var(--primary)}@supports (color:color-mix(in lab,red,red)){.from-primary\/20{--tw-gradient-from:color-mix(in oklab, var(--primary) 20%, transparent)}}.from-primary\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.via-background\/95{--tw-gradient-via:var(--background)}@supports (color:color-mix(in lab,red,red)){.via-background\/95{--tw-gradient-via:color-mix(in oklab, var(--background) 95%, transparent)}}.via-background\/95{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.to-background{--tw-gradient-to:var(--background);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.fill-gray-100{fill:var(--color-gray-100)}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.p-0{padding:calc(var(--spacing) * 0)}.p-1{padding:calc(var(--spacing) * 1)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.p-\[0\.375rem_1rem_0_1rem\]{padding:.375rem 1rem 0}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-8{padding-inline:calc(var(--spacing) * 8)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-16{padding-block:calc(var(--spacing) * 16)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-5{padding-top:calc(var(--spacing) * 5)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-9{padding-left:calc(var(--spacing) * 9)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[11px\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.text-wrap{text-wrap:wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.overflow-ellipsis,.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#008069\]{color:#008069}.text-\[\#b03f3f\]{color:#b03f3f}.text-black{color:var(--color-black)}.text-blue-600{color:var(--color-blue-600)}.text-blue-700{color:var(--color-blue-700)}.text-destructive{color:var(--destructive)}.text-foreground{color:var(--foreground)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-900{color:var(--color-gray-900)}.text-green-500{color:var(--color-green-500)}.text-muted-foreground,.text-muted-foreground\/40{color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/40{color:color-mix(in oklab,var(--muted-foreground) 40%,transparent)}}.text-muted-foreground\/50{color:var(--muted-foreground)}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/50{color:color-mix(in oklab,var(--muted-foreground) 50%,transparent)}}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-red-500{color:var(--color-red-500)}.text-red-800{color:var(--color-red-800)}.text-rose-600{color:var(--color-rose-600)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-sidebar-foreground,.text-sidebar-foreground\/60{color:var(--sidebar-foreground)}@supports (color:color-mix(in lab,red,red)){.text-sidebar-foreground\/60{color:color-mix(in oklab,var(--sidebar-foreground) 60%,transparent)}}.text-sidebar-foreground\/70{color:var(--sidebar-foreground)}@supports (color:color-mix(in lab,red,red)){.text-sidebar-foreground\/70{color:color-mix(in oklab,var(--sidebar-foreground) 70%,transparent)}}.text-yellow-500{color:var(--color-yellow-500)}.underline{text-decoration-line:underline}.caret-transparent{caret-color:#0000}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-muted-foreground{--tw-ring-color:var(--muted-foreground)}.ring-offset-background{--tw-ring-offset-color:var(--background)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.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(var(--blur-sm));-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-\[color\,box-shadow\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.outline-none{--tw-outline-style:none;outline-style:none}.paused{animation-play-state:paused}.running{animation-play-state:running}@media (hover:hover){.group-hover\:visible:is(:where(.group):hover *){visibility:visible}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.selection\:bg-primary ::selection{background-color:var(--primary)}.selection\:bg-primary::selection{background-color:var(--primary)}.selection\:text-primary-foreground ::selection{color:var(--primary-foreground)}.selection\:text-primary-foreground::selection{color:var(--primary-foreground)}.file\:inline-flex::file-selector-button{display:inline-flex}.file\:h-7::file-selector-button{height:calc(var(--spacing) * 7)}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--foreground)}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:bottom-\[12px\]:after{content:var(--tw-content);bottom:12px}.after\:border-\[8px\]:after{content:var(--tw-content);border-style:var(--tw-border-style);border-width:8px}.after\:border-solid:after{content:var(--tw-content);--tw-border-style:solid;border-style:solid}@media (hover:hover){.hover\:bg-\[\#a4ecde\]:hover{background-color:#a4ecde}.hover\:bg-\[\#b2ece0\]:hover{background-color:#b2ece0}.hover\:bg-\[\#c2d2d2\]:hover{background-color:#c2d2d2}.hover\:bg-accent:hover{background-color:var(--accent)}.hover\:bg-black\/10:hover{background-color:#0000001a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-black\/10:hover{background-color:color-mix(in oklab,var(--color-black) 10%,transparent)}}.hover\:bg-green-500\/20:hover{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.hover\:bg-green-500\/20:hover{background-color:color-mix(in oklab,var(--color-green-500) 20%,transparent)}}.hover\:bg-primary\/85:hover{background-color:var(--primary)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/85:hover{background-color:color-mix(in oklab,var(--primary) 85%,transparent)}}.hover\:bg-red-500\/10:hover{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/10:hover{background-color:color-mix(in oklab,var(--color-red-500) 10%,transparent)}}.hover\:bg-red-500\/20:hover{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/20:hover{background-color:color-mix(in oklab,var(--color-red-500) 20%,transparent)}}.hover\:bg-sidebar-accent:hover,.hover\:bg-sidebar-accent\/30:hover{background-color:var(--sidebar-accent)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-sidebar-accent\/30:hover{background-color:color-mix(in oklab,var(--sidebar-accent) 30%,transparent)}}.hover\:bg-yellow-500\/20:hover{background-color:#edb20033}@supports (color:color-mix(in lab,red,red)){.hover\:bg-yellow-500\/20:hover{background-color:color-mix(in oklab,var(--color-yellow-500) 20%,transparent)}}.hover\:stroke-destructive:hover{stroke:var(--destructive)}.hover\:text-foreground:hover{color:var(--foreground)}.hover\:text-primary:hover{color:var(--primary)}.hover\:text-red-400:hover{color:var(--color-red-400)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-lg:hover{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-black\/10:hover{--tw-shadow-color:#0000001a}@supports (color:color-mix(in lab,red,red)){.hover\:shadow-black\/10:hover{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 10%, transparent) var(--tw-shadow-alpha), transparent)}}}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-ring:focus{--tw-ring-color:var(--ring)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus\:outline-hidden:focus{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.focus\:outline-hidden:focus{outline-offset:2px;outline:2px solid #0000}}.focus-visible\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\:ring-0:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-ring:focus-visible,.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab,red,red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}.focus-visible\:ring-transparent:focus-visible{--tw-ring-color:transparent}.focus-visible\:ring-offset-0:focus-visible{--tw-ring-offset-width:0px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus-visible\:ring-offset-transparent:focus-visible{--tw-ring-offset-color:transparent}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-muted:disabled{background-color:var(--muted)}.disabled\:text-muted-foreground:disabled{color:var(--muted-foreground)}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.data-\[state\=active\]\:bg-primary[data-state=active]{background-color:var(--primary)}.data-\[state\=active\]\:text-primary-foreground[data-state=active]{color:var(--primary-foreground)}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\[state\=open\]\:rotate-180[data-state=open]{rotate:180deg}.data-\[state\=open\]\:animate-in[data-state=open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:var(--accent)}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:var(--muted-foreground)}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}@media (min-width:40rem){.sm\:inline{display:inline}.sm\:max-h-\[600px\]{max-height:600px}.sm\:w-auto{width:auto}.sm\:max-w-\[650px\]{max-width:650px}.sm\:max-w-\[740px\]{max-width:740px}.sm\:max-w-lg{max-width:var(--container-lg)}.sm\:max-w-md{max-width:var(--container-md)}.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\:gap-0{gap:calc(var(--spacing) * 0)}.sm\:text-left{text-align:left}}@media (min-width:48rem){.md\:flex{display:flex}.md\:inline{display:inline}.md\:w-80{width:calc(var(--spacing) * 80)}.md\:flex-shrink-0{flex-shrink:0}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-\[1fr_auto\]{grid-template-columns:1fr auto}.md\:flex-row{flex-direction:row}.md\:items-center{align-items:center}.md\:items-start{align-items:flex-start}.md\:justify-between{justify-content:space-between}.md\:gap-8{gap:calc(var(--spacing) * 8)}.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}@media (min-width:64rem){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width:80rem){.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}.dark\:scale-0:is(.dark *){--tw-scale-x:0%;--tw-scale-y:0%;--tw-scale-z:0%;scale:var(--tw-scale-x) var(--tw-scale-y)}.dark\:scale-100:is(.dark *){--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}.dark\:-rotate-90:is(.dark *){rotate:-90deg}.dark\:rotate-0:is(.dark *){rotate:0deg}.dark\:border-gray-700:is(.dark *){border-color:var(--color-gray-700)}.dark\:border-white\/10:is(.dark *){border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.dark\:border-white\/10:is(.dark *){border-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.dark\:bg-\[\#0b332a\]:is(.dark *){background-color:#0b332a}.dark\:bg-\[\#0f1413\]:is(.dark *){background-color:#0f1413}.dark\:bg-\[\#1d2724\]:is(.dark *){background-color:#1d2724}.dark\:bg-\[\#082720\]:is(.dark *){background-color:#082720}.dark\:bg-blue-300:is(.dark *){background-color:var(--color-blue-300)}.dark\:bg-gray-800:is(.dark *){background-color:var(--color-gray-800)}.dark\:bg-gray-900:is(.dark *){background-color:var(--color-gray-900)}.dark\:bg-input\/30:is(.dark *){background-color:var(--input)}@supports (color:color-mix(in lab,red,red)){.dark\:bg-input\/30:is(.dark *){background-color:color-mix(in oklab,var(--input) 30%,transparent)}}.dark\:bg-red-900:is(.dark *){background-color:var(--color-red-900)}.dark\:bg-white\/5:is(.dark *){background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.dark\:bg-white\/5:is(.dark *){background-color:color-mix(in oklab,var(--color-white) 5%,transparent)}}.dark\:bg-white\/10:is(.dark *){background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.dark\:bg-white\/10:is(.dark *){background-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.dark\:bg-yellow-950:is(.dark *){background-color:var(--color-yellow-950)}.dark\:fill-gray-800:is(.dark *){fill:var(--color-gray-800)}.dark\:text-\[\#00a884\]:is(.dark *){color:#00a884}.dark\:text-blue-300:is(.dark *){color:var(--color-blue-300)}.dark\:text-gray-100:is(.dark *){color:var(--color-gray-100)}.dark\:text-gray-300:is(.dark *){color:var(--color-gray-300)}.dark\:text-gray-400:is(.dark *){color:var(--color-gray-400)}.dark\:text-red-200:is(.dark *){color:var(--color-red-200)}.dark\:text-white:is(.dark *){color:var(--color-white)}@media (hover:hover){.dark\:hover\:bg-\[\#071f19\]:is(.dark *):hover{background-color:#071f19}.dark\:hover\:bg-\[\#141a18\]:is(.dark *):hover{background-color:#141a18}.dark\:hover\:bg-\[\#082720\]:is(.dark *):hover{background-color:#082720}.dark\:hover\:bg-white\/10:is(.dark *):hover{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-white\/10:is(.dark *):hover{background-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}}.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab,red,red)){.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&\>\*\]\:p-4>*{padding:calc(var(--spacing) * 4)}.\[\&\>\*\]\:px-4>*{padding-inline:calc(var(--spacing) * 4)}.\[\&\>\*\]\:py-2>*{padding-block:calc(var(--spacing) * 2)}.\[\&\>svg\]\:fill-rose-600>svg{fill:var(--color-rose-600)}@media (hover:hover){.hover\:\[\&\>svg\]\:fill-rose-700:hover>svg{fill:var(--color-rose-700)}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes spin{to{transform:rotate(360deg)}}@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));filter:blur(var(--tw-enter-blur,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));filter:blur(var(--tw-exit-blur,0))}}: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;-ms-touch-action:none;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:-ms-flexbox;display:flex;-ms-flex-pack:justify;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;-ms-flex:1 1 auto;flex:1 1 auto;padding:6px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.Toastify__toast-body>div:last-child{word-break:break-word;-ms-flex:1;flex:1}.Toastify__toast-icon{-webkit-margin-end:10px;margin-inline-end:10px;width:20px;-ms-flex-negative:0;flex-shrink:0;display:-ms-flexbox;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;-ms-flex-item-align:start;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}.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/assets/index-DojtwdUs.js b/manager/dist/assets/index-DojtwdUs.js new file mode 100644 index 0000000000..0f1a7508a1 --- /dev/null +++ b/manager/dist/assets/index-DojtwdUs.js @@ -0,0 +1,601 @@ +var hD=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Oce=hD((za,Ua)=>{function KE(e,t){for(var n=0;nr[a]})}}}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 a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const o of a)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(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(a){if(a.ep)return;a.ep=!0;const o=n(a);fetch(a.href,o)}})();function yd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yv={exports:{}},Su={},xv={exports:{}},$t={};/** + * @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 vC;function mD(){if(vC)return $t;vC=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=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 b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,w={};function C(A,K,re){this.props=A,this.context=K,this.refs=w,this.updater=re||b}C.prototype.isReactComponent={},C.prototype.setState=function(A,K){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,K,"setState")},C.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function k(){}k.prototype=C.prototype;function N(A,K,re){this.props=A,this.context=K,this.refs=w,this.updater=re||b}var T=N.prototype=new k;T.constructor=N,x(T,C.prototype),T.isPureReactComponent=!0;var _=Array.isArray,P=Object.prototype.hasOwnProperty,M={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};function D(A,K,re){var ee,ie={},ue=null,j=null;if(K!=null)for(ee in K.ref!==void 0&&(j=K.ref),K.key!==void 0&&(ue=""+K.key),K)P.call(K,ee)&&!O.hasOwnProperty(ee)&&(ie[ee]=K[ee]);var I=arguments.length-2;if(I===1)ie.children=re;else if(1{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},sc=typeof window>"u"||"Deno"in globalThis;function Ts(){}function yD(e,t){return typeof e=="function"?e(t):e}function Gy(e){return typeof e=="number"&&e>=0&&e!==1/0}function GE(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ql(e,t){return typeof e=="function"?e(t):e}function Gs(e,t){return typeof e=="function"?e(t):e}function wC(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:o,queryKey:l,stale:u}=e;if(l){if(r){if(t.queryHash!==ub(l,t.options))return!1}else if(!nd(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||a&&a!==t.state.fetchStatus||o&&!o(t))}function SC(e,t){const{exact:n,status:r,predicate:a,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Bi(t.options.mutationKey)!==Bi(o))return!1}else if(!nd(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function ub(e,t){return(t?.queryKeyHashFn||Bi)(e)}function Bi(e){return JSON.stringify(e,(t,n)=>Jy(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function nd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!nd(e[n],t[n])):!1}function JE(e,t){if(e===t)return e;const n=CC(e)&&CC(t);if(n||Jy(e)&&Jy(t)){const r=n?e:Object.keys(e),a=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 Qy(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?JE(e,t):t}function bD(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function wD(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var QE=Symbol();function YE(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===QE?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var SD=class extends xc{#e;#t;#r;constructor(){super(),this.#r=e=>{if(!sc&&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"}},db=new SD,CD=class extends xc{#e=!0;#t;#r;constructor(){super(),this.#r=e=>{if(!sc&&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}},zp=new CD;function jD(e){return Math.min(1e3*2**e,3e4)}function ZE(e){return(e??"online")==="online"?zp.isOnline():!0}var XE=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function bv(e){return e instanceof XE}function eN(e){let t=!1,n=0,r=!1,a,o,l;const u=new Promise((k,N)=>{o=k,l=N}),d=k=>{r||(x(new XE(k)),e.abort?.())},f=()=>{t=!0},h=()=>{t=!1},m=()=>db.isFocused()&&(e.networkMode==="always"||zp.isOnline())&&e.canRun(),g=()=>ZE(e.networkMode)&&e.canRun(),b=k=>{r||(r=!0,e.onSuccess?.(k),a?.(),o(k))},x=k=>{r||(r=!0,e.onError?.(k),a?.(),l(k))},w=()=>new Promise(k=>{a=N=>{(r||m())&&k(N)},e.onPause?.()}).then(()=>{a=void 0,r||e.onContinue?.()}),C=()=>{if(r)return;let k;const N=n===0?e.initialPromise:void 0;try{k=N??e.fn()}catch(T){k=Promise.reject(T)}Promise.resolve(k).then(b).catch(T=>{if(r)return;const _=e.retry??(sc?0:3),P=e.retryDelay??jD,M=typeof P=="function"?P(n,T):P,O=_===!0||typeof _=="number"&&n<_||typeof _=="function"&&_(n,T);if(t||!O){x(T);return}n++,e.onFail?.(n,T),xD(M).then(()=>m()?void 0:w()).then(()=>{t?x(T):C()})})};return{promise:u,cancel:d,continue:()=>(a?.(),u),cancelRetry:f,continueRetry:h,canStart:g,start:()=>(g()?C():w().then(C),u)}}function kD(){let e=[],t=0,n=g=>{g()},r=g=>{g()},a=g=>setTimeout(g,0);const o=g=>{a=g},l=g=>{let b;t++;try{b=g()}finally{t--,t||f()}return b},u=g=>{t?e.push(g):a(()=>{n(g)})},d=g=>(...b)=>{u(()=>{g(...b)})},f=()=>{const g=e;e=[],g.length&&a(()=>{r(()=>{g.forEach(b=>{n(b)})})})};return{batch:l,batchCalls:d,schedule:u,setNotifyFunction:g=>{n=g},setBatchNotifyFunction:g=>{r=g},setScheduler:o}}var ar=kD(),tN=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Gy(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(sc?1/0:300*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}},ED=class extends tN{#e;#t;#r;#n;#o;#a;constructor(e){super(),this.#a=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.cache,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=ND(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.#o,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const n=Qy(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(Ts).catch(Ts):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Gs(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||!GE(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.#a?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.#a=!0,n.signal)})},a=()=>{const u=YE(this.options,t),d={queryKey:this.queryKey,meta:this.meta};return r(d),this.#a=!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:a};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=>{bv(u)&&u.silent||this.#s({type:"error",error:u}),bv(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=eN({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,...nN(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 bv(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),ar.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function nN(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ZE(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function ND(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 TD=class extends xc{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,a=t.queryHash??ub(r,t);let o=this.get(a);return o||(o=new ED({cache:this,queryKey:r,queryHash:a,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(){ar.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=>wC(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>wC(e,n)):t}notify(e){ar.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ar.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ar.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},MD=class extends tN{#e;#t;#r;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||rN(),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=eN({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(r,a)=>{this.#n({type:"failed",failureCount:r,error:a})},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 a=await this.options.onMutate?.(e);a!==this.state.context&&this.#n({type:"pending",context:a,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),ar.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function rN(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var _D=class extends xc{constructor(e={}){super(),this.config=e,this.#e=new Map,this.#t=Date.now()}#e;#t;build(e,t,n){const r=new MD({mutationCache:this,mutationId:++this.#t,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){const t=Lf(e),n=this.#e.get(t)??[];n.push(e),this.#e.set(t,n),this.notify({type:"added",mutation:e})}remove(e){const t=Lf(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(Lf(e))?.find(n=>n.state.status==="pending");return!t||t===e}runNext(e){return this.#e.get(Lf(e))?.find(n=>n!==e&&n.state.isPaused)?.continue()??Promise.resolve()}clear(){ar.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=>SC(t,n))}findAll(e={}){return this.getAll().filter(t=>SC(e,t))}notify(e){ar.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return ar.batch(()=>Promise.all(e.map(t=>t.continue().catch(Ts))))}};function Lf(e){return e.options.scope?.id??String(e.mutationId)}function PD(e){return{onFetch:(t,n)=>{const r=async()=>{const a=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=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(t.signal.aborted?f=!0:t.signal.addEventListener("abort",()=>{f=!0}),t.signal)})},m=YE(t.options,t.fetchOptions),g=async(x,w,C)=>{if(f)return Promise.reject();if(w==null&&x.pages.length)return Promise.resolve(x);const k={queryKey:t.queryKey,pageParam:w,direction:C?"backward":"forward",meta:t.options.meta};h(k);const N=await m(k),{maxPages:T}=t.options,_=C?wD:bD;return{pages:_(x.pages,N,T),pageParams:_(x.pageParams,w,T)}};let b;if(o&&l.length){const x=o==="backward",w=x?RD:kC,C={pages:l,pageParams:u},k=w(a,C);b=await g(C,k,x)}else{b=await g(d,u[0]??a.initialPageParam);const x=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 kC(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 RD(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var ID=class{#e;#t;#r;#n;#o;#a;#s;#i;constructor(e={}){this.#e=e.queryCache||new TD,this.#t=e.mutationCache||new _D,this.#r=e.defaultOptions||{},this.#n=new Map,this.#o=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#s=db.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=zp.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===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(Ql(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=yD(t,o);if(l!==void 0)return this.#e.build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return ar.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;ar.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e,r={type:"active",...e};return ar.batch(()=>(n.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=ar.batch(()=>this.#e.findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(Ts).catch(Ts)}invalidateQueries(e={},t={}){return ar.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=ar.batch(()=>this.#e.findAll(e).filter(a=>!a.isDisabled()).map(a=>{let o=a.fetch(void 0,n);return n.throwOnError||(o=o.catch(Ts)),a.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Ts)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(Ql(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ts).catch(Ts)}fetchInfiniteQuery(e){return e.behavior=PD(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ts).catch(Ts)}resumePausedMutations(){return zp.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(Bi(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#n.values()];let n={};return t.forEach(r=>{nd(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){this.#o.set(Bi(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#o.values()];let n={};return t.forEach(r=>{nd(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=ub(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===QE&&(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()}},OD=class extends xc{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;#o;#a;#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),EC(this.#t,this.options)?this.#d():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Yy(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Yy(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#b(),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 Gs(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&&!Bp(this.options,n)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const a=this.hasListeners();a&&NC(this.#t,r,this.options,n)&&this.#d(),this.updateResult(t),a&&(this.#t!==r||Gs(this.options.enabled,this.#t)!==Gs(n.enabled,this.#t)||Ql(this.options.staleTime,this.#t)!==Ql(n.staleTime,this.#t))&&this.#m();const o=this.#g();a&&(this.#t!==r||Gs(this.options.enabled,this.#t)!==Gs(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 DD(this,n)&&(this.#n=n,this.#a=this.options,this.#o=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(Ts)),t}#m(){this.#x();const e=Ql(this.options.staleTime,this.#t);if(sc||this.#n.isStale||!Gy(e))return;const n=GE(this.#n.dataUpdatedAt,e)+1;this.#c=setTimeout(()=>{this.#n.isStale||this.updateResult()},n)}#g(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#b(),this.#l=e,!(sc||Gs(this.options.enabled,this.#t)===!1||!Gy(this.#l)||this.#l===0)&&(this.#u=setInterval(()=>{(this.options.refetchIntervalInBackground||db.isFocused())&&this.#d()},this.#l))}#y(){this.#m(),this.#v(this.#g())}#x(){this.#c&&(clearTimeout(this.#c),this.#c=void 0)}#b(){this.#u&&(clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,r=this.options,a=this.#n,o=this.#o,l=this.#a,d=e!==n?e.state:this.#r,{state:f}=e;let h={...f},m=!1,g;if(t._optimisticResults){const M=this.hasListeners(),O=!M&&EC(e,t),D=M&&NC(e,n,t,r);(O||D)&&(h={...h,...nN(f.data,e.options)}),t._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:b,errorUpdatedAt:x,status:w}=h;if(t.select&&h.data!==void 0)if(a&&h.data===o?.data&&t.select===this.#i)g=this.#f;else try{this.#i=t.select,g=t.select(h.data),g=Qy(a?.data,g,t),this.#f=g,this.#s=null}catch(M){this.#s=M}else g=h.data;if(t.placeholderData!==void 0&&g===void 0&&w==="pending"){let M;if(a?.isPlaceholderData&&t.placeholderData===l?.placeholderData)M=a.data;else if(M=typeof t.placeholderData=="function"?t.placeholderData(this.#p?.state.data,this.#p):t.placeholderData,t.select&&M!==void 0)try{M=t.select(M),this.#s=null}catch(O){this.#s=O}M!==void 0&&(w="success",g=Qy(a?.data,M,t),m=!0)}this.#s&&(b=this.#s,g=this.#f,x=Date.now(),w="error");const C=h.fetchStatus==="fetching",k=w==="pending",N=w==="error",T=k&&C,_=g!==void 0;return{status:w,fetchStatus:h.fetchStatus,isPending:k,isSuccess:w==="success",isError:N,isInitialLoading:T,isLoading:T,data:g,dataUpdatedAt:h.dataUpdatedAt,error:b,errorUpdatedAt:x,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:N&&!_,isPaused:h.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:N&&_,isStale:fb(e,t),refetch:this.refetch}}updateResult(e){const t=this.#n,n=this.createResult(this.#t,this.options);if(this.#o=this.#t.state,this.#a=this.options,this.#o.data!==void 0&&(this.#p=this.#t),Bp(n,t))return;this.#n=n;const r={},a=()=>{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&&a()&&(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){ar.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#n)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function AD(e,t){return Gs(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function EC(e,t){return AD(e,t)||e.state.data!==void 0&&Yy(e,t,t.refetchOnMount)}function Yy(e,t,n){if(Gs(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&fb(e,t)}return!1}function NC(e,t,n,r){return(e!==t||Gs(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&fb(e,n)}function fb(e,t){return Gs(t.enabled,e)!==!1&&e.isStaleByTime(Ql(t.staleTime,e))}function DD(e,t){return!Bp(e.getCurrentResult(),t)}var FD=class extends xc{#e;#t=void 0;#r;#n;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#o()}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),Bp(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),n?.mutationKey&&this.options.mutationKey&&Bi(n.mutationKey)!==Bi(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.#o(),this.#a(t)}getCurrentResult(){return this.#t}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#o(),this.#a()}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)}#o(){const t=this.#r?.state??rN();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}}#a(t){ar.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)})})}},v=yc();const ke=yd(v),Ko=KE({__proto__:null,default:ke},[v]);var sN=v.createContext(void 0),ja=e=>{const t=v.useContext(sN);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},aN=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(sN.Provider,{value:e,children:t})),oN=v.createContext(!1),LD=()=>v.useContext(oN);oN.Provider;function $D(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var BD=v.createContext($D()),zD=()=>v.useContext(BD);function iN(e,t){return typeof e=="function"?e(...t):!!e}function UD(){}var VD=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},qD=e=>{v.useEffect(()=>{e.clearReset()},[e])},HD=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&iN(n,[e.error,r]),WD=e=>{e.suspense&&(typeof e.staleTime!="number"&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},KD=(e,t)=>e?.suspense&&t.isPending,GD=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function JD(e,t,n){const r=ja(),a=LD(),o=zD(),l=r.defaultQueryOptions(e);r.getDefaultOptions().queries?._experimental_beforeQuery?.(l),l._optimisticResults=a?"isRestoring":"optimistic",WD(l),VD(l,o),qD(o);const[u]=v.useState(()=>new t(r,l)),d=u.getOptimisticResult(l);if(v.useSyncExternalStore(v.useCallback(f=>{const h=a?()=>{}:u.subscribe(ar.batchCalls(f));return u.updateResult(),h},[u,a]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),v.useEffect(()=>{u.setOptions(l,{listeners:!1})},[l,u]),KD(l,d))throw GD(l,u,o);if(HD({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 pt(e,t){return JD(e,OD)}function QD(e,t){const n=ja(),[r]=v.useState(()=>new FD(n,e));v.useEffect(()=>{r.setOptions(e)},[r,e]);const a=v.useSyncExternalStore(v.useCallback(l=>r.subscribe(ar.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=v.useCallback((l,u)=>{r.mutate(l,u).catch(UD)},[r]);if(a.error&&iN(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:o,mutateAsync:a.mutate}}var $f={},wv={exports:{}},Jr={},Sv={exports:{}},Cv={};/** + * @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 TC;function YD(){return TC||(TC=1,(function(e){function t(H,W){var V=H.length;H.push(W);e:for(;0>>1,K=H[A];if(0>>1;Aa(ie,V))uea(j,ie)?(H[A]=j,H[ue]=V,A=ue):(H[A]=ie,H[ee]=V,A=ee);else if(uea(j,V))H[A]=j,H[ue]=V,A=ue;else break e}}return W}function a(H,W){var V=H.sortIndex-W.sortIndex;return V!==0?V:H.id-W.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,b=!1,x=!1,w=!1,C=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T(H){for(var W=n(f);W!==null;){if(W.callback===null)r(f);else if(W.startTime<=H)r(f),W.sortIndex=W.expirationTime,t(d,W);else break;W=n(f)}}function _(H){if(w=!1,T(H),!x)if(n(d)!==null)x=!0,Y(P);else{var W=n(f);W!==null&&se(_,W.startTime-H)}}function P(H,W){x=!1,w&&(w=!1,k(D),D=-1),b=!0;var V=g;try{for(T(W),m=n(d);m!==null&&(!(m.expirationTime>W)||H&&!te());){var A=m.callback;if(typeof A=="function"){m.callback=null,g=m.priorityLevel;var K=A(m.expirationTime<=W);W=e.unstable_now(),typeof K=="function"?m.callback=K:m===n(d)&&r(d),T(W)}else r(d);m=n(d)}if(m!==null)var re=!0;else{var ee=n(f);ee!==null&&se(_,ee.startTime-W),re=!1}return re}finally{m=null,g=V,b=!1}}var M=!1,O=null,D=-1,F=5,B=-1;function te(){return!(e.unstable_now()-BH||125A?(H.sortIndex=V,t(f,H),n(d)===null&&H===n(f)&&(w?(k(D),D=-1):w=!0,se(_,V-A))):(H.sortIndex=K,t(d,H),x||b||(x=!0,Y(P))),H},e.unstable_shouldYield=te,e.unstable_wrapCallback=function(H){var W=g;return function(){var V=g;g=W;try{return H.apply(this,arguments)}finally{g=V}}}})(Cv)),Cv}var MC;function ZD(){return MC||(MC=1,Sv.exports=YD()),Sv.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 _C;function XD(){if(_C)return Jr;_C=1;var e=yc(),t=ZD();function n(i){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+i,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(i){return d.call(m,i)?!0:d.call(h,i)?!1:f.test(i)?m[i]=!0:(h[i]=!0,!1)}function b(i,c,p,y){if(p!==null&&p.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return y?!1:p!==null?!p.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function x(i,c,p,y){if(c===null||typeof c>"u"||b(i,c,p,y))return!0;if(y)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(i,c,p,y,S,E,R){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=y,this.attributeNamespace=S,this.mustUseProperty=p,this.propertyName=i,this.type=c,this.sanitizeURL=E,this.removeEmptyString=R}var C={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){C[i]=new w(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var c=i[0];C[c]=new w(c,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){C[i]=new w(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){C[i]=new w(i,2,!1,i,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(i){C[i]=new w(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){C[i]=new w(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){C[i]=new w(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){C[i]=new w(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){C[i]=new w(i,5,!1,i.toLowerCase(),null,!1,!1)});var k=/[\-:]([a-z])/g;function N(i){return i[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(i){var c=i.replace(k,N);C[c]=new w(c,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var c=i.replace(k,N);C[c]=new w(c,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var c=i.replace(k,N);C[c]=new w(c,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){C[i]=new w(i,1,!1,i.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(i){C[i]=new w(i,1,!1,i.toLowerCase(),null,!0,!0)});function T(i,c,p,y){var S=C.hasOwnProperty(c)?C[c]:null;(S!==null?S.type!==0:y||!(2L||S[R]!==E[L]){var G=` +`+S[R].replace(" at new "," at ");return i.displayName&&G.includes("")&&(G=G.replace("",i.displayName)),G}while(1<=R&&0<=L);break}}}finally{re=!1,Error.prepareStackTrace=p}return(i=i?i.displayName||i.name:"")?K(i):""}function ie(i){switch(i.tag){case 5:return K(i.type);case 16:return K("Lazy");case 13:return K("Suspense");case 19:return K("SuspenseList");case 0:case 2:case 15:return i=ee(i.type,!1),i;case 11:return i=ee(i.type.render,!1),i;case 1:return i=ee(i.type,!0),i;default:return""}}function ue(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case O:return"Fragment";case M:return"Portal";case F:return"Profiler";case D:return"StrictMode";case ce:return"Suspense";case q:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case te:return(i.displayName||"Context")+".Consumer";case B:return(i._context.displayName||"Context")+".Provider";case U:var c=i.render;return i=i.displayName,i||(i=c.displayName||c.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case ne:return c=i.displayName||null,c!==null?c:ue(i.type)||"Memo";case Y:c=i._payload,i=i._init;try{return ue(i(c))}catch{}}return null}function j(i){var c=i.type;switch(i.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 i=c.render,i=i.displayName||i.name||"",c.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ue(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 I(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function me(i){var c=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function be(i){var c=me(i)?"checked":"value",p=Object.getOwnPropertyDescriptor(i.constructor.prototype,c),y=""+i[c];if(!i.hasOwnProperty(c)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var S=p.get,E=p.set;return Object.defineProperty(i,c,{configurable:!0,get:function(){return S.call(this)},set:function(R){y=""+R,E.call(this,R)}}),Object.defineProperty(i,c,{enumerable:p.enumerable}),{getValue:function(){return y},setValue:function(R){y=""+R},stopTracking:function(){i._valueTracker=null,delete i[c]}}}}function st(i){i._valueTracker||(i._valueTracker=be(i))}function Je(i){if(!i)return!1;var c=i._valueTracker;if(!c)return!0;var p=c.getValue(),y="";return i&&(y=me(i)?i.checked?"true":"false":i.value),i=y,i!==p?(c.setValue(i),!0):!1}function rt(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function Ht(i,c){var p=c.checked;return V({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:p??i._wrapperState.initialChecked})}function Wn(i,c){var p=c.defaultValue==null?"":c.defaultValue,y=c.checked!=null?c.checked:c.defaultChecked;p=I(c.value!=null?c.value:p),i._wrapperState={initialChecked:y,initialValue:p,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function Pn(i,c){c=c.checked,c!=null&&T(i,"checked",c,!1)}function tr(i,c){Pn(i,c);var p=I(c.value),y=c.type;if(p!=null)y==="number"?(p===0&&i.value===""||i.value!=p)&&(i.value=""+p):i.value!==""+p&&(i.value=""+p);else if(y==="submit"||y==="reset"){i.removeAttribute("value");return}c.hasOwnProperty("value")?zr(i,c.type,p):c.hasOwnProperty("defaultValue")&&zr(i,c.type,I(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(i.defaultChecked=!!c.defaultChecked)}function Sn(i,c,p){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var y=c.type;if(!(y!=="submit"&&y!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+i._wrapperState.initialValue,p||c===i.value||(i.value=c),i.defaultValue=c}p=i.name,p!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,p!==""&&(i.name=p)}function zr(i,c,p){(c!=="number"||rt(i.ownerDocument)!==i)&&(p==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+p&&(i.defaultValue=""+p))}var Ur=Array.isArray;function or(i,c,p,y){if(i=i.options,c){c={};for(var S=0;S"+c.valueOf().toString()+"",c=Te.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;c.firstChild;)i.appendChild(c.firstChild)}});function ht(i,c){if(c){var p=i.firstChild;if(p&&p===i.lastChild&&p.nodeType===3){p.nodeValue=c;return}}i.textContent=c}var Nt={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},Rn=["Webkit","ms","Moz","O"];Object.keys(Nt).forEach(function(i){Rn.forEach(function(c){c=c+i.charAt(0).toUpperCase()+i.substring(1),Nt[c]=Nt[i]})});function vn(i,c,p){return c==null||typeof c=="boolean"||c===""?"":p||typeof c!="number"||c===0||Nt.hasOwnProperty(i)&&Nt[i]?(""+c).trim():c+"px"}function Ee(i,c){i=i.style;for(var p in c)if(c.hasOwnProperty(p)){var y=p.indexOf("--")===0,S=vn(p,c[p],y);p==="float"&&(p="cssFloat"),y?i.setProperty(p,S):i[p]=S}}var bt=V({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 zt(i,c){if(c){if(bt[i]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(n(137,i));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(i,c){if(i.indexOf("-")===-1)return typeof c.is=="string";switch(i){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 br=null;function ur(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Vr=null,Pr=null,ns=null;function rs(i){if(i=iu(i)){if(typeof Vr!="function")throw Error(n(280));var c=i.stateNode;c&&(c=Zd(c),Vr(i.stateNode,i.type,c))}}function to(i){Pr?ns?ns.push(i):ns=[i]:Pr=i}function Bc(){if(Pr){var i=Pr,c=ns;if(ns=Pr=null,rs(i),c)for(i=0;i>>=0,i===0?32:31-(Fs(i)/Id|0)|0}var Od=64,Ad=4194304;function Vc(i){switch(i&-i){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 i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function Dd(i,c){var p=i.pendingLanes;if(p===0)return 0;var y=0,S=i.suspendedLanes,E=i.pingedLanes,R=p&268435455;if(R!==0){var L=R&~S;L!==0?y=Vc(L):(E&=R,E!==0&&(y=Vc(E)))}else R=p&~S,R!==0?y=Vc(R):E!==0&&(y=Vc(E));if(y===0)return 0;if(c!==0&&c!==y&&(c&S)===0&&(S=y&-y,E=c&-c,S>=E||S===16&&(E&4194240)!==0))return c;if((y&4)!==0&&(y|=p&16),c=i.entangledLanes,c!==0)for(i=i.entanglements,c&=y;0p;p++)c.push(i);return c}function qc(i,c,p){i.pendingLanes|=c,c!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,c=31-Vt(c),i[c]=p}function AO(i,c){var p=i.pendingLanes&~c;i.pendingLanes=c,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=c,i.mutableReadLanes&=c,i.entangledLanes&=c,c=i.entanglements;var y=i.eventTimes;for(i=i.expirationTimes;0=Zc),uS=" ",dS=!1;function fS(i,c){switch(i){case"keyup":return cA.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pS(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var hl=!1;function dA(i,c){switch(i){case"compositionend":return pS(c);case"keypress":return c.which!==32?null:(dS=!0,uS);case"textInput":return i=c.data,i===uS&&dS?null:i;default:return null}}function fA(i,c){if(hl)return i==="compositionend"||!Zm&&fS(i,c)?(i=sS(),zd=Wm=io=null,hl=!1,i):null;switch(i){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-i};i=y}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=bS(p)}}function SS(i,c){return i&&c?i===c?!0:i&&i.nodeType===3?!1:c&&c.nodeType===3?SS(i,c.parentNode):"contains"in i?i.contains(c):i.compareDocumentPosition?!!(i.compareDocumentPosition(c)&16):!1:!1}function CS(){for(var i=window,c=rt();c instanceof i.HTMLIFrameElement;){try{var p=typeof c.contentWindow.location.href=="string"}catch{p=!1}if(p)i=c.contentWindow;else break;c=rt(i.document)}return c}function tg(i){var c=i&&i.nodeName&&i.nodeName.toLowerCase();return c&&(c==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||c==="textarea"||i.contentEditable==="true")}function wA(i){var c=CS(),p=i.focusedElem,y=i.selectionRange;if(c!==p&&p&&p.ownerDocument&&SS(p.ownerDocument.documentElement,p)){if(y!==null&&tg(p)){if(c=y.start,i=y.end,i===void 0&&(i=c),"selectionStart"in p)p.selectionStart=c,p.selectionEnd=Math.min(i,p.value.length);else if(i=(c=p.ownerDocument||document)&&c.defaultView||window,i.getSelection){i=i.getSelection();var S=p.textContent.length,E=Math.min(y.start,S);y=y.end===void 0?E:Math.min(y.end,S),!i.extend&&E>y&&(S=y,y=E,E=S),S=wS(p,E);var R=wS(p,y);S&&R&&(i.rangeCount!==1||i.anchorNode!==S.node||i.anchorOffset!==S.offset||i.focusNode!==R.node||i.focusOffset!==R.offset)&&(c=c.createRange(),c.setStart(S.node,S.offset),i.removeAllRanges(),E>y?(i.addRange(c),i.extend(R.node,R.offset)):(c.setEnd(R.node,R.offset),i.addRange(c)))}}for(c=[],i=p;i=i.parentNode;)i.nodeType===1&&c.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p=document.documentMode,ml=null,ng=null,nu=null,rg=!1;function jS(i,c,p){var y=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;rg||ml==null||ml!==rt(y)||(y=ml,"selectionStart"in y&&tg(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),nu&&tu(nu,y)||(nu=y,y=Jd(ng,"onSelect"),0bl||(i.current=mg[bl],mg[bl]=null,bl--)}function yn(i,c){bl++,mg[bl]=i.current,i.current=c}var fo={},wr=uo(fo),qr=uo(!1),gi=fo;function wl(i,c){var p=i.type.contextTypes;if(!p)return fo;var y=i.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===c)return y.__reactInternalMemoizedMaskedChildContext;var S={},E;for(E in p)S[E]=c[E];return y&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=c,i.__reactInternalMemoizedMaskedChildContext=S),S}function Hr(i){return i=i.childContextTypes,i!=null}function Xd(){jn(qr),jn(wr)}function $S(i,c,p){if(wr.current!==fo)throw Error(n(168));yn(wr,c),yn(qr,p)}function BS(i,c,p){var y=i.stateNode;if(c=c.childContextTypes,typeof y.getChildContext!="function")return p;y=y.getChildContext();for(var S in y)if(!(S in c))throw Error(n(108,j(i)||"Unknown",S));return V({},p,y)}function ef(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||fo,gi=wr.current,yn(wr,i),yn(qr,qr.current),!0}function zS(i,c,p){var y=i.stateNode;if(!y)throw Error(n(169));p?(i=BS(i,c,gi),y.__reactInternalMemoizedMergedChildContext=i,jn(qr),jn(wr),yn(wr,i)):jn(qr),yn(qr,p)}var Ma=null,tf=!1,gg=!1;function US(i){Ma===null?Ma=[i]:Ma.push(i)}function IA(i){tf=!0,US(i)}function po(){if(!gg&&Ma!==null){gg=!0;var i=0,c=cn;try{var p=Ma;for(cn=1;i>=R,S-=R,_a=1<<32-Vt(c)+S|p<yt?(cr=lt,lt=null):cr=lt.sibling;var Xt=Se(le,lt,de[yt],_e);if(Xt===null){lt===null&&(lt=cr);break}i&<&&Xt.alternate===null&&c(le,lt),X=E(Xt,X,yt),it===null?et=Xt:it.sibling=Xt,it=Xt,lt=cr}if(yt===de.length)return p(le,lt),Mn&&yi(le,yt),et;if(lt===null){for(;ytyt?(cr=lt,lt=null):cr=lt.sibling;var So=Se(le,lt,Xt.value,_e);if(So===null){lt===null&&(lt=cr);break}i&<&&So.alternate===null&&c(le,lt),X=E(So,X,yt),it===null?et=So:it.sibling=So,it=So,lt=cr}if(Xt.done)return p(le,lt),Mn&&yi(le,yt),et;if(lt===null){for(;!Xt.done;yt++,Xt=de.next())Xt=Ne(le,Xt.value,_e),Xt!==null&&(X=E(Xt,X,yt),it===null?et=Xt:it.sibling=Xt,it=Xt);return Mn&&yi(le,yt),et}for(lt=y(le,lt);!Xt.done;yt++,Xt=de.next())Xt=ze(lt,le,yt,Xt.value,_e),Xt!==null&&(i&&Xt.alternate!==null&<.delete(Xt.key===null?yt:Xt.key),X=E(Xt,X,yt),it===null?et=Xt:it.sibling=Xt,it=Xt);return i&<.forEach(function(pD){return c(le,pD)}),Mn&&yi(le,yt),et}function Bn(le,X,de,_e){if(typeof de=="object"&&de!==null&&de.type===O&&de.key===null&&(de=de.props.children),typeof de=="object"&&de!==null){switch(de.$$typeof){case P:e:{for(var et=de.key,it=X;it!==null;){if(it.key===et){if(et=de.type,et===O){if(it.tag===7){p(le,it.sibling),X=S(it,de.props.children),X.return=le,le=X;break e}}else if(it.elementType===et||typeof et=="object"&&et!==null&&et.$$typeof===Y&&GS(et)===it.type){p(le,it.sibling),X=S(it,de.props),X.ref=lu(le,it,de),X.return=le,le=X;break e}p(le,it);break}else c(le,it);it=it.sibling}de.type===O?(X=Ei(de.props.children,le.mode,_e,de.key),X.return=le,le=X):(_e=_f(de.type,de.key,de.props,null,le.mode,_e),_e.ref=lu(le,X,de),_e.return=le,le=_e)}return R(le);case M:e:{for(it=de.key;X!==null;){if(X.key===it)if(X.tag===4&&X.stateNode.containerInfo===de.containerInfo&&X.stateNode.implementation===de.implementation){p(le,X.sibling),X=S(X,de.children||[]),X.return=le,le=X;break e}else{p(le,X);break}else c(le,X);X=X.sibling}X=pv(de,le.mode,_e),X.return=le,le=X}return R(le);case Y:return it=de._init,Bn(le,X,it(de._payload),_e)}if(Ur(de))return He(le,X,de,_e);if(W(de))return Qe(le,X,de,_e);af(le,de)}return typeof de=="string"&&de!==""||typeof de=="number"?(de=""+de,X!==null&&X.tag===6?(p(le,X.sibling),X=S(X,de),X.return=le,le=X):(p(le,X),X=fv(de,le.mode,_e),X.return=le,le=X),R(le)):p(le,X)}return Bn}var kl=JS(!0),QS=JS(!1),of=uo(null),lf=null,El=null,Sg=null;function Cg(){Sg=El=lf=null}function jg(i){var c=of.current;jn(of),i._currentValue=c}function kg(i,c,p){for(;i!==null;){var y=i.alternate;if((i.childLanes&c)!==c?(i.childLanes|=c,y!==null&&(y.childLanes|=c)):y!==null&&(y.childLanes&c)!==c&&(y.childLanes|=c),i===p)break;i=i.return}}function Nl(i,c){lf=i,Sg=El=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&c)!==0&&(Wr=!0),i.firstContext=null)}function Ss(i){var c=i._currentValue;if(Sg!==i)if(i={context:i,memoizedValue:c,next:null},El===null){if(lf===null)throw Error(n(308));El=i,lf.dependencies={lanes:0,firstContext:i}}else El=El.next=i;return c}var xi=null;function Eg(i){xi===null?xi=[i]:xi.push(i)}function YS(i,c,p,y){var S=c.interleaved;return S===null?(p.next=p,Eg(c)):(p.next=S.next,S.next=p),c.interleaved=p,Ra(i,y)}function Ra(i,c){i.lanes|=c;var p=i.alternate;for(p!==null&&(p.lanes|=c),p=i,i=i.return;i!==null;)i.childLanes|=c,p=i.alternate,p!==null&&(p.childLanes|=c),p=i,i=i.return;return p.tag===3?p.stateNode:null}var ho=!1;function Ng(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ZS(i,c){i=i.updateQueue,c.updateQueue===i&&(c.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function Ia(i,c){return{eventTime:i,lane:c,tag:0,payload:null,callback:null,next:null}}function mo(i,c,p){var y=i.updateQueue;if(y===null)return null;if(y=y.shared,(Qt&2)!==0){var S=y.pending;return S===null?c.next=c:(c.next=S.next,S.next=c),y.pending=c,Ra(i,p)}return S=y.interleaved,S===null?(c.next=c,Eg(y)):(c.next=S.next,S.next=c),y.interleaved=c,Ra(i,p)}function cf(i,c,p){if(c=c.updateQueue,c!==null&&(c=c.shared,(p&4194240)!==0)){var y=c.lanes;y&=i.pendingLanes,p|=y,c.lanes=p,zm(i,p)}}function XS(i,c){var p=i.updateQueue,y=i.alternate;if(y!==null&&(y=y.updateQueue,p===y)){var S=null,E=null;if(p=p.firstBaseUpdate,p!==null){do{var R={eventTime:p.eventTime,lane:p.lane,tag:p.tag,payload:p.payload,callback:p.callback,next:null};E===null?S=E=R:E=E.next=R,p=p.next}while(p!==null);E===null?S=E=c:E=E.next=c}else S=E=c;p={baseState:y.baseState,firstBaseUpdate:S,lastBaseUpdate:E,shared:y.shared,effects:y.effects},i.updateQueue=p;return}i=p.lastBaseUpdate,i===null?p.firstBaseUpdate=c:i.next=c,p.lastBaseUpdate=c}function uf(i,c,p,y){var S=i.updateQueue;ho=!1;var E=S.firstBaseUpdate,R=S.lastBaseUpdate,L=S.shared.pending;if(L!==null){S.shared.pending=null;var G=L,ve=G.next;G.next=null,R===null?E=ve:R.next=ve,R=G;var je=i.alternate;je!==null&&(je=je.updateQueue,L=je.lastBaseUpdate,L!==R&&(L===null?je.firstBaseUpdate=ve:L.next=ve,je.lastBaseUpdate=G))}if(E!==null){var Ne=S.baseState;R=0,je=ve=G=null,L=E;do{var Se=L.lane,ze=L.eventTime;if((y&Se)===Se){je!==null&&(je=je.next={eventTime:ze,lane:0,tag:L.tag,payload:L.payload,callback:L.callback,next:null});e:{var He=i,Qe=L;switch(Se=c,ze=p,Qe.tag){case 1:if(He=Qe.payload,typeof He=="function"){Ne=He.call(ze,Ne,Se);break e}Ne=He;break e;case 3:He.flags=He.flags&-65537|128;case 0:if(He=Qe.payload,Se=typeof He=="function"?He.call(ze,Ne,Se):He,Se==null)break e;Ne=V({},Ne,Se);break e;case 2:ho=!0}}L.callback!==null&&L.lane!==0&&(i.flags|=64,Se=S.effects,Se===null?S.effects=[L]:Se.push(L))}else ze={eventTime:ze,lane:Se,tag:L.tag,payload:L.payload,callback:L.callback,next:null},je===null?(ve=je=ze,G=Ne):je=je.next=ze,R|=Se;if(L=L.next,L===null){if(L=S.shared.pending,L===null)break;Se=L,L=Se.next,Se.next=null,S.lastBaseUpdate=Se,S.shared.pending=null}}while(!0);if(je===null&&(G=Ne),S.baseState=G,S.firstBaseUpdate=ve,S.lastBaseUpdate=je,c=S.shared.interleaved,c!==null){S=c;do R|=S.lane,S=S.next;while(S!==c)}else E===null&&(S.shared.lanes=0);Si|=R,i.lanes=R,i.memoizedState=Ne}}function e0(i,c,p){if(i=c.effects,c.effects=null,i!==null)for(c=0;cp?p:4,i(!0);var y=Rg.transition;Rg.transition={};try{i(!1),c()}finally{cn=p,Rg.transition=y}}function x0(){return Cs().memoizedState}function FA(i,c,p){var y=xo(i);if(p={lane:y,action:p,hasEagerState:!1,eagerState:null,next:null},b0(i))w0(c,p);else if(p=YS(i,c,p,y),p!==null){var S=Or();Vs(p,i,y,S),S0(p,c,y)}}function LA(i,c,p){var y=xo(i),S={lane:y,action:p,hasEagerState:!1,eagerState:null,next:null};if(b0(i))w0(c,S);else{var E=i.alternate;if(i.lanes===0&&(E===null||E.lanes===0)&&(E=c.lastRenderedReducer,E!==null))try{var R=c.lastRenderedState,L=E(R,p);if(S.hasEagerState=!0,S.eagerState=L,Ls(L,R)){var G=c.interleaved;G===null?(S.next=S,Eg(c)):(S.next=G.next,G.next=S),c.interleaved=S;return}}catch{}finally{}p=YS(i,c,S,y),p!==null&&(S=Or(),Vs(p,i,y,S),S0(p,c,y))}}function b0(i){var c=i.alternate;return i===An||c!==null&&c===An}function w0(i,c){fu=pf=!0;var p=i.pending;p===null?c.next=c:(c.next=p.next,p.next=c),i.pending=c}function S0(i,c,p){if((p&4194240)!==0){var y=c.lanes;y&=i.pendingLanes,p|=y,c.lanes=p,zm(i,p)}}var gf={readContext:Ss,useCallback:Sr,useContext:Sr,useEffect:Sr,useImperativeHandle:Sr,useInsertionEffect:Sr,useLayoutEffect:Sr,useMemo:Sr,useReducer:Sr,useRef:Sr,useState:Sr,useDebugValue:Sr,useDeferredValue:Sr,useTransition:Sr,useMutableSource:Sr,useSyncExternalStore:Sr,useId:Sr,unstable_isNewReconciler:!1},$A={readContext:Ss,useCallback:function(i,c){return fa().memoizedState=[i,c===void 0?null:c],i},useContext:Ss,useEffect:d0,useImperativeHandle:function(i,c,p){return p=p!=null?p.concat([i]):null,hf(4194308,4,h0.bind(null,c,i),p)},useLayoutEffect:function(i,c){return hf(4194308,4,i,c)},useInsertionEffect:function(i,c){return hf(4,2,i,c)},useMemo:function(i,c){var p=fa();return c=c===void 0?null:c,i=i(),p.memoizedState=[i,c],i},useReducer:function(i,c,p){var y=fa();return c=p!==void 0?p(c):c,y.memoizedState=y.baseState=c,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:c},y.queue=i,i=i.dispatch=FA.bind(null,An,i),[y.memoizedState,i]},useRef:function(i){var c=fa();return i={current:i},c.memoizedState=i},useState:c0,useDebugValue:$g,useDeferredValue:function(i){return fa().memoizedState=i},useTransition:function(){var i=c0(!1),c=i[0];return i=DA.bind(null,i[1]),fa().memoizedState=i,[c,i]},useMutableSource:function(){},useSyncExternalStore:function(i,c,p){var y=An,S=fa();if(Mn){if(p===void 0)throw Error(n(407));p=p()}else{if(p=c(),lr===null)throw Error(n(349));(wi&30)!==0||s0(y,c,p)}S.memoizedState=p;var E={value:p,getSnapshot:c};return S.queue=E,d0(o0.bind(null,y,E,i),[i]),y.flags|=2048,mu(9,a0.bind(null,y,E,p,c),void 0,null),p},useId:function(){var i=fa(),c=lr.identifierPrefix;if(Mn){var p=Pa,y=_a;p=(y&~(1<<32-Vt(y)-1)).toString(32)+p,c=":"+c+"R"+p,p=pu++,0<\/script>",i=i.removeChild(i.firstChild)):typeof y.is=="string"?i=R.createElement(p,{is:y.is}):(i=R.createElement(p),p==="select"&&(R=i,y.multiple?R.multiple=!0:y.size&&(R.size=y.size))):i=R.createElementNS(i,p),i[ua]=c,i[ou]=y,U0(i,c,!1,!1),c.stateNode=i;e:{switch(R=Tn(p,y),p){case"dialog":Cn("cancel",i),Cn("close",i),S=y;break;case"iframe":case"object":case"embed":Cn("load",i),S=y;break;case"video":case"audio":for(S=0;SRl&&(c.flags|=128,y=!0,gu(E,!1),c.lanes=4194304)}else{if(!y)if(i=df(R),i!==null){if(c.flags|=128,y=!0,p=i.updateQueue,p!==null&&(c.updateQueue=p,c.flags|=4),gu(E,!0),E.tail===null&&E.tailMode==="hidden"&&!R.alternate&&!Mn)return Cr(c),null}else 2*pn()-E.renderingStartTime>Rl&&p!==1073741824&&(c.flags|=128,y=!0,gu(E,!1),c.lanes=4194304);E.isBackwards?(R.sibling=c.child,c.child=R):(p=E.last,p!==null?p.sibling=R:c.child=R,E.last=R)}return E.tail!==null?(c=E.tail,E.rendering=c,E.tail=c.sibling,E.renderingStartTime=pn(),c.sibling=null,p=On.current,yn(On,y?p&1|2:p&1),c):(Cr(c),null);case 22:case 23:return cv(),y=c.memoizedState!==null,i!==null&&i.memoizedState!==null!==y&&(c.flags|=8192),y&&(c.mode&1)!==0?(ls&1073741824)!==0&&(Cr(c),c.subtreeFlags&6&&(c.flags|=8192)):Cr(c),null;case 24:return null;case 25:return null}throw Error(n(156,c.tag))}function KA(i,c){switch(yg(c),c.tag){case 1:return Hr(c.type)&&Xd(),i=c.flags,i&65536?(c.flags=i&-65537|128,c):null;case 3:return Tl(),jn(qr),jn(wr),Pg(),i=c.flags,(i&65536)!==0&&(i&128)===0?(c.flags=i&-65537|128,c):null;case 5:return Mg(c),null;case 13:if(jn(On),i=c.memoizedState,i!==null&&i.dehydrated!==null){if(c.alternate===null)throw Error(n(340));jl()}return i=c.flags,i&65536?(c.flags=i&-65537|128,c):null;case 19:return jn(On),null;case 4:return Tl(),null;case 10:return jg(c.type._context),null;case 22:case 23:return cv(),null;case 24:return null;default:return null}}var bf=!1,jr=!1,GA=typeof WeakSet=="function"?WeakSet:Set,qe=null;function _l(i,c){var p=i.ref;if(p!==null)if(typeof p=="function")try{p(null)}catch(y){Ln(i,c,y)}else p.current=null}function Yg(i,c,p){try{p()}catch(y){Ln(i,c,y)}}var H0=!1;function JA(i,c){if(cg=$d,i=CS(),tg(i)){if("selectionStart"in i)var p={start:i.selectionStart,end:i.selectionEnd};else e:{p=(p=i.ownerDocument)&&p.defaultView||window;var y=p.getSelection&&p.getSelection();if(y&&y.rangeCount!==0){p=y.anchorNode;var S=y.anchorOffset,E=y.focusNode;y=y.focusOffset;try{p.nodeType,E.nodeType}catch{p=null;break e}var R=0,L=-1,G=-1,ve=0,je=0,Ne=i,Se=null;t:for(;;){for(var ze;Ne!==p||S!==0&&Ne.nodeType!==3||(L=R+S),Ne!==E||y!==0&&Ne.nodeType!==3||(G=R+y),Ne.nodeType===3&&(R+=Ne.nodeValue.length),(ze=Ne.firstChild)!==null;)Se=Ne,Ne=ze;for(;;){if(Ne===i)break t;if(Se===p&&++ve===S&&(L=R),Se===E&&++je===y&&(G=R),(ze=Ne.nextSibling)!==null)break;Ne=Se,Se=Ne.parentNode}Ne=ze}p=L===-1||G===-1?null:{start:L,end:G}}else p=null}p=p||{start:0,end:0}}else p=null;for(ug={focusedElem:i,selectionRange:p},$d=!1,qe=c;qe!==null;)if(c=qe,i=c.child,(c.subtreeFlags&1028)!==0&&i!==null)i.return=c,qe=i;else for(;qe!==null;){c=qe;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 Qe=He.memoizedProps,Bn=He.memoizedState,le=c.stateNode,X=le.getSnapshotBeforeUpdate(c.elementType===c.type?Qe:Bs(c.type,Qe),Bn);le.__reactInternalSnapshotBeforeUpdate=X}break;case 3:var de=c.stateNode.containerInfo;de.nodeType===1?de.textContent="":de.nodeType===9&&de.documentElement&&de.removeChild(de.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(_e){Ln(c,c.return,_e)}if(i=c.sibling,i!==null){i.return=c.return,qe=i;break}qe=c.return}return He=H0,H0=!1,He}function vu(i,c,p){var y=c.updateQueue;if(y=y!==null?y.lastEffect:null,y!==null){var S=y=y.next;do{if((S.tag&i)===i){var E=S.destroy;S.destroy=void 0,E!==void 0&&Yg(c,p,E)}S=S.next}while(S!==y)}}function wf(i,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var p=c=c.next;do{if((p.tag&i)===i){var y=p.create;p.destroy=y()}p=p.next}while(p!==c)}}function Zg(i){var c=i.ref;if(c!==null){var p=i.stateNode;switch(i.tag){case 5:i=p;break;default:i=p}typeof c=="function"?c(i):c.current=i}}function W0(i){var c=i.alternate;c!==null&&(i.alternate=null,W0(c)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(c=i.stateNode,c!==null&&(delete c[ua],delete c[ou],delete c[hg],delete c[PA],delete c[RA])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function K0(i){return i.tag===5||i.tag===3||i.tag===4}function G0(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||K0(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Xg(i,c,p){var y=i.tag;if(y===5||y===6)i=i.stateNode,c?p.nodeType===8?p.parentNode.insertBefore(i,c):p.insertBefore(i,c):(p.nodeType===8?(c=p.parentNode,c.insertBefore(i,p)):(c=p,c.appendChild(i)),p=p._reactRootContainer,p!=null||c.onclick!==null||(c.onclick=Yd));else if(y!==4&&(i=i.child,i!==null))for(Xg(i,c,p),i=i.sibling;i!==null;)Xg(i,c,p),i=i.sibling}function ev(i,c,p){var y=i.tag;if(y===5||y===6)i=i.stateNode,c?p.insertBefore(i,c):p.appendChild(i);else if(y!==4&&(i=i.child,i!==null))for(ev(i,c,p),i=i.sibling;i!==null;)ev(i,c,p),i=i.sibling}var dr=null,zs=!1;function go(i,c,p){for(p=p.child;p!==null;)J0(i,c,p),p=p.sibling}function J0(i,c,p){if(Jt&&typeof Jt.onCommitFiberUnmount=="function")try{Jt.onCommitFiberUnmount(St,p)}catch{}switch(p.tag){case 5:jr||_l(p,c);case 6:var y=dr,S=zs;dr=null,go(i,c,p),dr=y,zs=S,dr!==null&&(zs?(i=dr,p=p.stateNode,i.nodeType===8?i.parentNode.removeChild(p):i.removeChild(p)):dr.removeChild(p.stateNode));break;case 18:dr!==null&&(zs?(i=dr,p=p.stateNode,i.nodeType===8?pg(i.parentNode,p):i.nodeType===1&&pg(i,p),Jc(i)):pg(dr,p.stateNode));break;case 4:y=dr,S=zs,dr=p.stateNode.containerInfo,zs=!0,go(i,c,p),dr=y,zs=S;break;case 0:case 11:case 14:case 15:if(!jr&&(y=p.updateQueue,y!==null&&(y=y.lastEffect,y!==null))){S=y=y.next;do{var E=S,R=E.destroy;E=E.tag,R!==void 0&&((E&2)!==0||(E&4)!==0)&&Yg(p,c,R),S=S.next}while(S!==y)}go(i,c,p);break;case 1:if(!jr&&(_l(p,c),y=p.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=p.memoizedProps,y.state=p.memoizedState,y.componentWillUnmount()}catch(L){Ln(p,c,L)}go(i,c,p);break;case 21:go(i,c,p);break;case 22:p.mode&1?(jr=(y=jr)||p.memoizedState!==null,go(i,c,p),jr=y):go(i,c,p);break;default:go(i,c,p)}}function Q0(i){var c=i.updateQueue;if(c!==null){i.updateQueue=null;var p=i.stateNode;p===null&&(p=i.stateNode=new GA),c.forEach(function(y){var S=sD.bind(null,i,y);p.has(y)||(p.add(y),y.then(S,S))})}}function Us(i,c){var p=c.deletions;if(p!==null)for(var y=0;yS&&(S=R),y&=~E}if(y=S,y=pn()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*YA(y/1960))-y,10i?16:i,yo===null)var y=!1;else{if(i=yo,yo=null,Ef=0,(Qt&6)!==0)throw Error(n(331));var S=Qt;for(Qt|=4,qe=i.current;qe!==null;){var E=qe,R=E.child;if((qe.flags&16)!==0){var L=E.deletions;if(L!==null){for(var G=0;Gpn()-rv?ji(i,0):nv|=p),Gr(i,c)}function cC(i,c){c===0&&((i.mode&1)===0?c=1:(c=Ad,Ad<<=1,(Ad&130023424)===0&&(Ad=4194304)));var p=Or();i=Ra(i,c),i!==null&&(qc(i,c,p),Gr(i,p))}function rD(i){var c=i.memoizedState,p=0;c!==null&&(p=c.retryLane),cC(i,p)}function sD(i,c){var p=0;switch(i.tag){case 13:var y=i.stateNode,S=i.memoizedState;S!==null&&(p=S.retryLane);break;case 19:y=i.stateNode;break;default:throw Error(n(314))}y!==null&&y.delete(c),cC(i,p)}var uC;uC=function(i,c,p){if(i!==null)if(i.memoizedProps!==c.pendingProps||qr.current)Wr=!0;else{if((i.lanes&p)===0&&(c.flags&128)===0)return Wr=!1,HA(i,c,p);Wr=(i.flags&131072)!==0}else Wr=!1,Mn&&(c.flags&1048576)!==0&&VS(c,rf,c.index);switch(c.lanes=0,c.tag){case 2:var y=c.type;xf(i,c),i=c.pendingProps;var S=wl(c,wr.current);Nl(c,p),S=Og(null,c,y,i,S,p);var E=Ag();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,Hr(y)?(E=!0,ef(c)):E=!1,c.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,Ng(c),S.updater=vf,c.stateNode=S,S._reactInternals=c,zg(c,y,i,p),c=Hg(null,c,y,!0,E,p)):(c.tag=0,Mn&&E&&vg(c),Ir(null,c,S,p),c=c.child),c;case 16:y=c.elementType;e:{switch(xf(i,c),i=c.pendingProps,S=y._init,y=S(y._payload),c.type=y,S=c.tag=oD(y),i=Bs(y,i),S){case 0:c=qg(null,c,y,i,p);break e;case 1:c=D0(null,c,y,i,p);break e;case 11:c=P0(null,c,y,i,p);break e;case 14:c=R0(null,c,y,Bs(y.type,i),p);break e}throw Error(n(306,y,""))}return c;case 0:return y=c.type,S=c.pendingProps,S=c.elementType===y?S:Bs(y,S),qg(i,c,y,S,p);case 1:return y=c.type,S=c.pendingProps,S=c.elementType===y?S:Bs(y,S),D0(i,c,y,S,p);case 3:e:{if(F0(c),i===null)throw Error(n(387));y=c.pendingProps,E=c.memoizedState,S=E.element,ZS(i,c),uf(c,y,null,p);var R=c.memoizedState;if(y=R.element,E.isDehydrated)if(E={element:y,isDehydrated:!1,cache:R.cache,pendingSuspenseBoundaries:R.pendingSuspenseBoundaries,transitions:R.transitions},c.updateQueue.baseState=E,c.memoizedState=E,c.flags&256){S=Ml(Error(n(423)),c),c=L0(i,c,y,p,S);break e}else if(y!==S){S=Ml(Error(n(424)),c),c=L0(i,c,y,p,S);break e}else for(is=co(c.stateNode.containerInfo.firstChild),os=c,Mn=!0,$s=null,p=QS(c,null,y,p),c.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling;else{if(jl(),y===S){c=Oa(i,c,p);break e}Ir(i,c,y,p)}c=c.child}return c;case 5:return t0(c),i===null&&bg(c),y=c.type,S=c.pendingProps,E=i!==null?i.memoizedProps:null,R=S.children,dg(y,S)?R=null:E!==null&&dg(y,E)&&(c.flags|=32),A0(i,c),Ir(i,c,R,p),c.child;case 6:return i===null&&bg(c),null;case 13:return $0(i,c,p);case 4:return Tg(c,c.stateNode.containerInfo),y=c.pendingProps,i===null?c.child=kl(c,null,y,p):Ir(i,c,y,p),c.child;case 11:return y=c.type,S=c.pendingProps,S=c.elementType===y?S:Bs(y,S),P0(i,c,y,S,p);case 7:return Ir(i,c,c.pendingProps,p),c.child;case 8:return Ir(i,c,c.pendingProps.children,p),c.child;case 12:return Ir(i,c,c.pendingProps.children,p),c.child;case 10:e:{if(y=c.type._context,S=c.pendingProps,E=c.memoizedProps,R=S.value,yn(of,y._currentValue),y._currentValue=R,E!==null)if(Ls(E.value,R)){if(E.children===S.children&&!qr.current){c=Oa(i,c,p);break e}}else for(E=c.child,E!==null&&(E.return=c);E!==null;){var L=E.dependencies;if(L!==null){R=E.child;for(var G=L.firstContext;G!==null;){if(G.context===y){if(E.tag===1){G=Ia(-1,p&-p),G.tag=2;var ve=E.updateQueue;if(ve!==null){ve=ve.shared;var je=ve.pending;je===null?G.next=G:(G.next=je.next,je.next=G),ve.pending=G}}E.lanes|=p,G=E.alternate,G!==null&&(G.lanes|=p),kg(E.return,p,c),L.lanes|=p;break}G=G.next}}else if(E.tag===10)R=E.type===c.type?null:E.child;else if(E.tag===18){if(R=E.return,R===null)throw Error(n(341));R.lanes|=p,L=R.alternate,L!==null&&(L.lanes|=p),kg(R,p,c),R=E.sibling}else R=E.child;if(R!==null)R.return=E;else for(R=E;R!==null;){if(R===c){R=null;break}if(E=R.sibling,E!==null){E.return=R.return,R=E;break}R=R.return}E=R}Ir(i,c,S.children,p),c=c.child}return c;case 9:return S=c.type,y=c.pendingProps.children,Nl(c,p),S=Ss(S),y=y(S),c.flags|=1,Ir(i,c,y,p),c.child;case 14:return y=c.type,S=Bs(y,c.pendingProps),S=Bs(y.type,S),R0(i,c,y,S,p);case 15:return I0(i,c,c.type,c.pendingProps,p);case 17:return y=c.type,S=c.pendingProps,S=c.elementType===y?S:Bs(y,S),xf(i,c),c.tag=1,Hr(y)?(i=!0,ef(c)):i=!1,Nl(c,p),j0(c,y,S),zg(c,y,S,p),Hg(null,c,y,!0,i,p);case 19:return z0(i,c,p);case 22:return O0(i,c,p)}throw Error(n(156,c.tag))};function dC(i,c){return Kn(i,c)}function aD(i,c,p,y){this.tag=i,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=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ks(i,c,p,y){return new aD(i,c,p,y)}function dv(i){return i=i.prototype,!(!i||!i.isReactComponent)}function oD(i){if(typeof i=="function")return dv(i)?1:0;if(i!=null){if(i=i.$$typeof,i===U)return 11;if(i===ne)return 14}return 2}function wo(i,c){var p=i.alternate;return p===null?(p=ks(i.tag,c,i.key,i.mode),p.elementType=i.elementType,p.type=i.type,p.stateNode=i.stateNode,p.alternate=i,i.alternate=p):(p.pendingProps=c,p.type=i.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=i.flags&14680064,p.childLanes=i.childLanes,p.lanes=i.lanes,p.child=i.child,p.memoizedProps=i.memoizedProps,p.memoizedState=i.memoizedState,p.updateQueue=i.updateQueue,c=i.dependencies,p.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},p.sibling=i.sibling,p.index=i.index,p.ref=i.ref,p}function _f(i,c,p,y,S,E){var R=2;if(y=i,typeof i=="function")dv(i)&&(R=1);else if(typeof i=="string")R=5;else e:switch(i){case O:return Ei(p.children,S,E,c);case D:R=8,S|=8;break;case F:return i=ks(12,p,c,S|2),i.elementType=F,i.lanes=E,i;case ce:return i=ks(13,p,c,S),i.elementType=ce,i.lanes=E,i;case q:return i=ks(19,p,c,S),i.elementType=q,i.lanes=E,i;case se:return Pf(p,S,E,c);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case B:R=10;break e;case te:R=9;break e;case U:R=11;break e;case ne:R=14;break e;case Y:R=16,y=null;break e}throw Error(n(130,i==null?i:typeof i,""))}return c=ks(R,p,c,S),c.elementType=i,c.type=y,c.lanes=E,c}function Ei(i,c,p,y){return i=ks(7,i,y,c),i.lanes=p,i}function Pf(i,c,p,y){return i=ks(22,i,y,c),i.elementType=se,i.lanes=p,i.stateNode={isHidden:!1},i}function fv(i,c,p){return i=ks(6,i,null,c),i.lanes=p,i}function pv(i,c,p){return c=ks(4,i.children!==null?i.children:[],i.key,c),c.lanes=p,c.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},c}function iD(i,c,p,y,S){this.tag=c,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Bm(0),this.expirationTimes=Bm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bm(0),this.identifierPrefix=y,this.onRecoverableError=S,this.mutableSourceEagerHydrationData=null}function hv(i,c,p,y,S,E,R,L,G){return i=new iD(i,c,p,L,G),c===1?(c=1,E===!0&&(c|=8)):c=0,E=ks(3,null,null,c),i.current=E,E.stateNode=i,E.memoizedState={element:y,isDehydrated:p,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ng(E),i}function lD(i,c,p){var y=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),wv.exports=XD(),wv.exports}var RC;function e2(){if(RC)return $f;RC=1;var e=lN();return $f.createRoot=e.createRoot,$f.hydrateRoot=e.hydrateRoot,$f}var t2=e2();const n2=yd(t2),r2=(...e)=>{console?.warn&&(Di(e[0])&&(e[0]=`react-i18next:: ${e[0]}`),console.warn(...e))},IC={},Zy=(...e)=>{Di(e[0])&&IC[e[0]]||(Di(e[0])&&(IC[e[0]]=new Date),r2(...e))},cN=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},OC=(e,t,n)=>{e.loadNamespaces(t,cN(e,n))},AC=(e,t,n,r)=>{Di(n)&&(n=[n]),n.forEach(a=>{e.options.ns.indexOf(a)<0&&e.options.ns.push(a)}),e.loadLanguages(t,cN(e,r))},s2=(e,t,n={})=>!t.languages||!t.languages.length?(Zy("i18n.languages were undefined or empty",t.languages),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,a)=>{if(n.bindI18n?.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!a(r.isLanguageChangingTo,e))return!1}}),Di=e=>typeof e=="string",a2=e=>typeof e=="object"&&e!==null,o2=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,i2={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},l2=e=>i2[e],c2=e=>e.replace(o2,l2);let Xy={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:c2};const u2=(e={})=>{Xy={...Xy,...e}},d2=()=>Xy;let uN;const f2=e=>{uN=e},p2=()=>uN,h2={type:"3rdParty",init(e){u2(e.options.react),f2(e)}},dN=v.createContext();class m2{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]??=!0})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const g2=(e,t)=>{const n=v.useRef();return v.useEffect(()=>{n.current=e},[e,t]),n.current},fN=(e,t,n,r)=>e.getFixedT(t,n,r),v2=(e,t,n,r)=>v.useCallback(fN(e,t,n,r),[e,t,n,r]),Le=(e,t={})=>{const{i18n:n}=t,{i18n:r,defaultNS:a}=v.useContext(dN)||{},o=n||r||p2();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new m2),!o){Zy("You will need to pass in an i18next instance by using initReactI18next");const _=(M,O)=>Di(O)?O:a2(O)&&Di(O.defaultValue)?O.defaultValue:Array.isArray(M)?M[M.length-1]:M,P=[_,{},!1];return P.t=_,P.i18n={},P.ready=!1,P}o.options.react?.wait&&Zy("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const l={...d2(),...o.options.react,...t},{useSuspense:u,keyPrefix:d}=l;let f=a||o.options?.defaultNS;f=Di(f)?[f]:f||["translation"],o.reportNamespaces.addUsedNamespaces?.(f);const h=(o.isInitialized||o.initializedStoreOnce)&&f.every(_=>s2(_,o,l)),m=v2(o,t.lng||null,l.nsMode==="fallback"?f:f[0],d),g=()=>m,b=()=>fN(o,t.lng||null,l.nsMode==="fallback"?f:f[0],d),[x,w]=v.useState(g);let C=f.join();t.lng&&(C=`${t.lng}${C}`);const k=g2(C),N=v.useRef(!0);v.useEffect(()=>{const{bindI18n:_,bindI18nStore:P}=l;N.current=!0,!h&&!u&&(t.lng?AC(o,t.lng,f,()=>{N.current&&w(b)}):OC(o,f,()=>{N.current&&w(b)})),h&&k&&k!==C&&N.current&&w(b);const M=()=>{N.current&&w(b)};return _&&o?.on(_,M),P&&o?.store.on(P,M),()=>{N.current=!1,o&&_?.split(" ").forEach(O=>o.off(O,M)),P&&o&&P.split(" ").forEach(O=>o.store.off(O,M))}},[o,C]),v.useEffect(()=>{N.current&&h&&w(g)},[o,d,h]);const T=[x,o,h];if(T.t=x,T.i18n=o,T.ready=h,h||!h&&!u)return T;throw new Promise(_=>{t.lng?AC(o,t.lng,f,()=>_()):OC(o,f,()=>_())})};function y2({i18n:e,defaultNS:t,children:n}){const r=v.useMemo(()=>({i18n:e,defaultNS:t}),[e,t]);return v.createElement(dN.Provider,{value:r},n)}var bc=lN();const pN=yd(bc),x2=KE({__proto__:null,default:pN},[bc]);/** + * @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 Dn(){return Dn=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function ac(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function w2(){return Math.random().toString(36).substr(2,8)}function FC(e,t){return{usr:e.state,key:e.key,idx:t}}function rd(e,t,n,r){return n===void 0&&(n=null),Dn({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Go(t):t,{state:n,key:t&&t.key||r||w2()})}function zi(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 Go(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 S2(e,t,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:o=!1}=r,l=a.history,u=Jn.Pop,d=null,f=h();f==null&&(f=0,l.replaceState(Dn({},l.state,{idx:f}),""));function h(){return(l.state||{idx:null}).idx}function m(){u=Jn.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=Jn.Push;let N=rd(w.location,C,k);f=h()+1;let T=FC(N,f),_=w.createHref(N);try{l.pushState(T,"",_)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;a.location.assign(_)}o&&d&&d({action:u,location:w.location,delta:1})}function b(C,k){u=Jn.Replace;let N=rd(w.location,C,k);f=h();let T=FC(N,f),_=w.createHref(N);l.replaceState(T,"",_),o&&d&&d({action:u,location:w.location,delta:0})}function x(C){let k=a.location.origin!=="null"?a.location.origin:a.location.href,N=typeof C=="string"?C:zi(C);return N=N.replace(/ $/,"%20"),Dt(k,"No window.location.(origin|href) available to create URL for href: "+N),new URL(N,k)}let w={get action(){return u},get location(){return e(a,l)},listen(C){if(d)throw new Error("A history only accepts one active listener");return a.addEventListener(DC,m),d=C,()=>{a.removeEventListener(DC,m),d=null}},createHref(C){return t(a,C)},createURL:x,encodeLocation(C){let k=x(C);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:g,replace:b,go(C){return l.go(C)}};return w}var wn;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(wn||(wn={}));const C2=new Set(["lazy","caseSensitive","path","id","index","children"]);function j2(e){return e.index===!0}function sd(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((a,o)=>{let l=[...n,String(o)],u=typeof a.id=="string"?a.id:l.join("-");if(Dt(a.index!==!0||!a.children,"Cannot specify children on an index route"),Dt(!r[u],'Found a route id collision on id "'+u+`". Route id's must be globally unique within Data Router usages`),j2(a)){let d=Dn({},a,t(a),{id:u});return r[u]=d,d}else{let d=Dn({},a,t(a),{id:u,children:void 0});return r[u]=d,a.children&&(d.children=sd(a.children,t,l,r)),d}})}function _i(e,t,n){return n===void 0&&(n="/"),bp(e,t,n,!1)}function bp(e,t,n,r){let a=typeof t=="string"?Go(t):t,o=qa(a.pathname||"/",n);if(o==null)return null;let l=hN(e);E2(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("/")&&(Dt(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=Va([r,d.relativePath]),h=n.concat(d);o.children&&o.children.length>0&&(Dt(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),hN(o.children,t,h,f)),!(o.path==null&&!o.index)&&t.push({path:f,score:I2(f,o.index),routesMeta:h})};return e.forEach((o,l)=>{var u;if(o.path===""||!((u=o.path)!=null&&u.includes("?")))a(o,l);else for(let d of mN(o.path))a(o,l,d)}),t}function mN(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return a?[o,""]:[o];let l=mN(r.join("/")),u=[];return u.push(...l.map(d=>d===""?o:[o,d].join("/"))),a&&u.push(...l),u.map(d=>e.startsWith("/")&&d===""?"/":d)}function E2(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:O2(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const N2=/^:[\w-]+$/,T2=3,M2=2,_2=1,P2=10,R2=-2,LC=e=>e==="*";function I2(e,t){let n=e.split("/"),r=n.length;return n.some(LC)&&(r+=R2),t&&(r+=M2),n.filter(a=>!LC(a)).reduce((a,o)=>a+(N2.test(o)?T2:o===""?_2:P2),r)}function O2(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function A2(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,a={},o="/",l=[];for(let u=0;u{let{paramName:g,isOptional:b}=h;if(g==="*"){let w=u[m]||"";l=o.slice(0,o.length-w.length).replace(/(.)\/+$/,"$1")}const x=u[m];return b&&!x?f[g]=void 0:f[g]=(x||"").replace(/%2F/g,"/"),f},{}),pathname:o,pathnameBase:l,pattern:e}}function D2(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),ac(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=[],a="^"+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:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function F2(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ac(!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 qa(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 L2(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?Go(e):e;return{pathname:n?n.startsWith("/")?n:$2(n,t):t,search:z2(r),hash:U2(a)}}function $2(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function jv(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 gN(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function kh(e,t){let n=gN(e);return t?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Eh(e,t,n,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=Go(e):(a=Dn({},e),Dt(!a.pathname||!a.pathname.includes("?"),jv("?","pathname","search",a)),Dt(!a.pathname||!a.pathname.includes("#"),jv("#","pathname","hash",a)),Dt(!a.search||!a.search.includes("#"),jv("#","search","hash",a)));let o=e===""||a.pathname==="",l=o?"/":a.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;a.pathname=g.join("/")}u=m>=0?t[m]:"/"}let d=L2(a,u),f=l&&l!=="/"&&l.endsWith("/"),h=(o||l===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(f||h)&&(d.pathname+="/"),d}const Va=e=>e.join("/").replace(/\/\/+/g,"/"),B2=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),z2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,U2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class pb{constructor(t,n,r,a){a===void 0&&(a=!1),this.status=t,this.statusText=n||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function Nh(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const vN=["post","put","patch","delete"],V2=new Set(vN),q2=["get",...vN],H2=new Set(q2),W2=new Set([301,302,303,307,308]),K2=new Set([307,308]),kv={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},G2={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Cu={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},hb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,J2=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),yN="remix-router-transitions";function Q2(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;Dt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a;if(e.mapRouteProperties)a=e.mapRouteProperties;else if(e.detectErrorBoundary){let J=e.detectErrorBoundary;a=ae=>({hasErrorBoundary:J(ae)})}else a=J2;let o={},l=sd(e.routes,a,void 0,o),u,d=e.basename||"/",f=e.unstable_dataStrategy||tF,h=e.unstable_patchRoutesOnMiss,m=Dn({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),g=null,b=new Set,x=null,w=null,C=null,k=e.hydrationData!=null,N=_i(l,e.history.location,d),T=null;if(N==null&&!h){let J=Ar(404,{pathname:e.history.location.pathname}),{matches:ae,route:ge}=GC(l);N=ae,T={[ge.id]:J}}N&&h&&!e.hydrationData&&ui(N,l,e.history.location.pathname).active&&(N=null);let _;if(!N)_=!1,N=[];else if(N.some(J=>J.route.lazy))_=!1;else if(!N.some(J=>J.route.loader))_=!0;else if(m.v7_partialHydration){let J=e.hydrationData?e.hydrationData.loaderData:null,ae=e.hydrationData?e.hydrationData.errors:null,ge=xe=>xe.route.loader?typeof xe.route.loader=="function"&&xe.route.loader.hydrate===!0?!1:J&&J[xe.route.id]!==void 0||ae&&ae[xe.route.id]!==void 0:!0;if(ae){let xe=N.findIndex($e=>ae[$e.route.id]!==void 0);_=N.slice(0,xe+1).every(ge)}else _=N.every(ge)}else _=e.hydrationData!=null;let P,M={historyAction:e.history.action,location:e.history.location,matches:N,initialized:_,navigation:kv,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||T,fetchers:new Map,blockers:new Map},O=Jn.Pop,D=!1,F,B=!1,te=new Map,U=null,ce=!1,q=!1,ne=[],Y=[],se=new Map,H=0,W=-1,V=new Map,A=new Set,K=new Map,re=new Map,ee=new Set,ie=new Map,ue=new Map,j=new Map,I=!1;function me(){if(g=e.history.listen(J=>{let{action:ae,location:ge,delta:xe}=J;if(I){I=!1;return}ac(ue.size===0||xe!=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 $e=Vr({currentLocation:M.location,nextLocation:ge,historyAction:ae});if($e&&xe!=null){I=!0,e.history.go(xe*-1),ur($e,{state:"blocked",location:ge,proceed(){ur($e,{state:"proceeding",proceed:void 0,reset:void 0,location:ge}),e.history.go(xe)},reset(){let Ze=new Map(M.blockers);Ze.set($e,Cu),Je({blockers:Ze})}});return}return Pn(ae,ge)}),n){hF(t,te);let J=()=>mF(t,te);t.addEventListener("pagehide",J),U=()=>t.removeEventListener("pagehide",J)}return M.initialized||Pn(Jn.Pop,M.location,{initialHydration:!0}),P}function be(){g&&g(),U&&U(),b.clear(),F&&F.abort(),M.fetchers.forEach((J,ae)=>Nt(ae)),M.blockers.forEach((J,ae)=>br(ae))}function st(J){return b.add(J),()=>b.delete(J)}function Je(J,ae){ae===void 0&&(ae={}),M=Dn({},M,J);let ge=[],xe=[];m.v7_fetcherPersist&&M.fetchers.forEach(($e,Ze)=>{$e.state==="idle"&&(ee.has(Ze)?xe.push(Ze):ge.push(Ze))}),[...b].forEach($e=>$e(M,{deletedFetchers:xe,unstable_viewTransitionOpts:ae.viewTransitionOpts,unstable_flushSync:ae.flushSync===!0})),m.v7_fetcherPersist&&(ge.forEach($e=>M.fetchers.delete($e)),xe.forEach($e=>Nt($e)))}function rt(J,ae,ge){var xe,$e;let{flushSync:Ze}=ge===void 0?{}:ge,ut=M.actionData!=null&&M.navigation.formMethod!=null&&Ws(M.navigation.formMethod)&&M.navigation.state==="loading"&&((xe=J.state)==null?void 0:xe._isRedirect)!==!0,Fe;ae.actionData?Object.keys(ae.actionData).length>0?Fe=ae.actionData:Fe=null:ut?Fe=M.actionData:Fe=null;let Tt=ae.loaderData?WC(M.loaderData,ae.loaderData,ae.matches||[],ae.errors):M.loaderData,Xe=M.blockers;Xe.size>0&&(Xe=new Map(Xe),Xe.forEach((sn,on)=>Xe.set(on,Cu)));let at=D===!0||M.navigation.formMethod!=null&&Ws(M.navigation.formMethod)&&(($e=J.state)==null?void 0:$e._isRedirect)!==!0;u&&(l=u,u=void 0),ce||O===Jn.Pop||(O===Jn.Push?e.history.push(J,J.state):O===Jn.Replace&&e.history.replace(J,J.state));let rn;if(O===Jn.Pop){let sn=te.get(M.location.pathname);sn&&sn.has(J.pathname)?rn={currentLocation:M.location,nextLocation:J}:te.has(J.pathname)&&(rn={currentLocation:J,nextLocation:M.location})}else if(B){let sn=te.get(M.location.pathname);sn?sn.add(J.pathname):(sn=new Set([J.pathname]),te.set(M.location.pathname,sn)),rn={currentLocation:M.location,nextLocation:J}}Je(Dn({},ae,{actionData:Fe,loaderData:Tt,historyAction:O,location:J,initialized:!0,navigation:kv,revalidation:"idle",restoreScrollPosition:zc(J,ae.matches||M.matches),preventScrollReset:at,blockers:Xe}),{viewTransitionOpts:rn,flushSync:Ze===!0}),O=Jn.Pop,D=!1,B=!1,ce=!1,q=!1,ne=[],Y=[]}async function Ht(J,ae){if(typeof J=="number"){e.history.go(J);return}let ge=ex(M.location,M.matches,d,m.v7_prependBasename,J,m.v7_relativeSplatPath,ae?.fromRouteId,ae?.relative),{path:xe,submission:$e,error:Ze}=$C(m.v7_normalizeFormMethod,!1,ge,ae),ut=M.location,Fe=rd(M.location,xe,ae&&ae.state);Fe=Dn({},Fe,e.history.encodeLocation(Fe));let Tt=ae&&ae.replace!=null?ae.replace:void 0,Xe=Jn.Push;Tt===!0?Xe=Jn.Replace:Tt===!1||$e!=null&&Ws($e.formMethod)&&$e.formAction===M.location.pathname+M.location.search&&(Xe=Jn.Replace);let at=ae&&"preventScrollReset"in ae?ae.preventScrollReset===!0:void 0,rn=(ae&&ae.unstable_flushSync)===!0,sn=Vr({currentLocation:ut,nextLocation:Fe,historyAction:Xe});if(sn){ur(sn,{state:"blocked",location:Fe,proceed(){ur(sn,{state:"proceeding",proceed:void 0,reset:void 0,location:Fe}),Ht(J,ae)},reset(){let on=new Map(M.blockers);on.set(sn,Cu),Je({blockers:on})}});return}return await Pn(Xe,Fe,{submission:$e,pendingError:Ze,preventScrollReset:at,replace:ae&&ae.replace,enableViewTransition:ae&&ae.unstable_viewTransition,flushSync:rn})}function Wn(){if(Ie(),Je({revalidation:"loading"}),M.navigation.state!=="submitting"){if(M.navigation.state==="idle"){Pn(M.historyAction,M.location,{startUninterruptedRevalidation:!0});return}Pn(O||M.historyAction,M.navigation.location,{overrideNavigation:M.navigation})}}async function Pn(J,ae,ge){F&&F.abort(),F=null,O=J,ce=(ge&&ge.startUninterruptedRevalidation)===!0,Rd(M.location,M.matches),D=(ge&&ge.preventScrollReset)===!0,B=(ge&&ge.enableViewTransition)===!0;let xe=u||l,$e=ge&&ge.overrideNavigation,Ze=_i(xe,ae,d),ut=(ge&&ge.flushSync)===!0,Fe=ui(Ze,xe,ae.pathname);if(Fe.active&&Fe.matches&&(Ze=Fe.matches),!Ze){let{error:Gt,notFoundMatches:Kn,route:In}=Pr(ae.pathname);rt(ae,{matches:Kn,loaderData:{},errors:{[In.id]:Gt}},{flushSync:ut});return}if(M.initialized&&!q&&iF(M.location,ae)&&!(ge&&ge.submission&&Ws(ge.submission.formMethod))){rt(ae,{matches:Ze},{flushSync:ut});return}F=new AbortController;let Tt=Ol(e.history,ae,F.signal,ge&&ge.submission),Xe;if(ge&&ge.pendingError)Xe=[Kl(Ze).route.id,{type:wn.error,error:ge.pendingError}];else if(ge&&ge.submission&&Ws(ge.submission.formMethod)){let Gt=await tr(Tt,ae,ge.submission,Ze,Fe.active,{replace:ge.replace,flushSync:ut});if(Gt.shortCircuited)return;if(Gt.pendingActionResult){let[Kn,In]=Gt.pendingActionResult;if(us(In)&&Nh(In.error)&&In.error.status===404){F=null,rt(ae,{matches:Gt.matches,loaderData:{},errors:{[Kn]:In.error}});return}}Ze=Gt.matches||Ze,Xe=Gt.pendingActionResult,$e=Ev(ae,ge.submission),ut=!1,Fe.active=!1,Tt=Ol(e.history,Tt.url,Tt.signal)}let{shortCircuited:at,matches:rn,loaderData:sn,errors:on}=await Sn(Tt,ae,Ze,Fe.active,$e,ge&&ge.submission,ge&&ge.fetcherSubmission,ge&&ge.replace,ge&&ge.initialHydration===!0,ut,Xe);at||(F=null,rt(ae,Dn({matches:rn||Ze},KC(Xe),{loaderData:sn,errors:on})))}async function tr(J,ae,ge,xe,$e,Ze){Ze===void 0&&(Ze={}),Ie();let ut=fF(ae,ge);if(Je({navigation:ut},{flushSync:Ze.flushSync===!0}),$e){let Xe=await di(xe,ae.pathname,J.signal);if(Xe.type==="aborted")return{shortCircuited:!0};if(Xe.type==="error"){let{boundaryId:at,error:rn}=ns(ae.pathname,Xe);return{matches:Xe.partialMatches,pendingActionResult:[at,{type:wn.error,error:rn}]}}else if(Xe.matches)xe=Xe.matches;else{let{notFoundMatches:at,error:rn,route:sn}=Pr(ae.pathname);return{matches:at,pendingActionResult:[sn.id,{type:wn.error,error:rn}]}}}let Fe,Tt=Vu(xe,ae);if(!Tt.route.action&&!Tt.route.lazy)Fe={type:wn.error,error:Ar(405,{method:J.method,pathname:ae.pathname,routeId:Tt.route.id})};else if(Fe=(await fe("action",J,[Tt],xe))[0],J.signal.aborted)return{shortCircuited:!0};if(Ri(Fe)){let Xe;return Ze&&Ze.replace!=null?Xe=Ze.replace:Xe=VC(Fe.response.headers.get("Location"),new URL(J.url),d)===M.location.pathname+M.location.search,await oe(J,Fe,{submission:ge,replace:Xe}),{shortCircuited:!0}}if(Pi(Fe))throw Ar(400,{type:"defer-action"});if(us(Fe)){let Xe=Kl(xe,Tt.route.id);return(Ze&&Ze.replace)!==!0&&(O=Jn.Push),{matches:xe,pendingActionResult:[Xe.route.id,Fe]}}return{matches:xe,pendingActionResult:[Tt.route.id,Fe]}}async function Sn(J,ae,ge,xe,$e,Ze,ut,Fe,Tt,Xe,at){let rn=$e||Ev(ae,Ze),sn=Ze||ut||YC(rn),on=!ce&&(!m.v7_partialHydration||!Tt);if(xe){if(on){let Jt=zr(at);Je(Dn({navigation:rn},Jt!==void 0?{actionData:Jt}:{}),{flushSync:Xe})}let St=await di(ge,ae.pathname,J.signal);if(St.type==="aborted")return{shortCircuited:!0};if(St.type==="error"){let{boundaryId:Jt,error:Rr}=ns(ae.pathname,St);return{matches:St.partialMatches,loaderData:{},errors:{[Jt]:Rr}}}else if(St.matches)ge=St.matches;else{let{error:Jt,notFoundMatches:Rr,route:Vt}=Pr(ae.pathname);return{matches:Rr,loaderData:{},errors:{[Vt.id]:Jt}}}}let Gt=u||l,[Kn,In]=BC(e.history,M,ge,sn,ae,m.v7_partialHydration&&Tt===!0,m.v7_skipActionErrorRevalidation,q,ne,Y,ee,K,A,Gt,d,at);if(rs(St=>!(ge&&ge.some(Jt=>Jt.route.id===St))||Kn&&Kn.some(Jt=>Jt.route.id===St)),W=++H,Kn.length===0&&In.length===0){let St=bt();return rt(ae,Dn({matches:ge,loaderData:{},errors:at&&us(at[1])?{[at[0]]:at[1].error}:null},KC(at),St?{fetchers:new Map(M.fetchers)}:{}),{flushSync:Xe}),{shortCircuited:!0}}if(on){let St={};if(!xe){St.navigation=rn;let Jt=zr(at);Jt!==void 0&&(St.actionData=Jt)}In.length>0&&(St.fetchers=Ur(In)),Je(St,{flushSync:Xe})}In.forEach(St=>{se.has(St.key)&&vn(St.key),St.controller&&se.set(St.key,St.controller)});let pi=()=>In.forEach(St=>vn(St.key));F&&F.signal.addEventListener("abort",pi);let{loaderResults:la,fetcherResults:pn}=await Ae(M.matches,ge,Kn,In,J);if(J.signal.aborted)return{shortCircuited:!0};F&&F.signal.removeEventListener("abort",pi),In.forEach(St=>se.delete(St.key));let no=JC([...la,...pn]);if(no){if(no.idx>=Kn.length){let St=In[no.idx-Kn.length].key;A.add(St)}return await oe(J,no.result,{replace:Fe}),{shortCircuited:!0}}let{loaderData:ca,errors:ss}=HC(M,ge,Kn,la,at,In,pn,ie);ie.forEach((St,Jt)=>{St.subscribe(Rr=>{(Rr||St.done)&&ie.delete(Jt)})}),m.v7_partialHydration&&Tt&&M.errors&&Object.entries(M.errors).filter(St=>{let[Jt]=St;return!Kn.some(Rr=>Rr.route.id===Jt)}).forEach(St=>{let[Jt,Rr]=St;ss=Object.assign(ss||{},{[Jt]:Rr})});let Na=bt(),dl=zt(W),hi=Na||dl||In.length>0;return Dn({matches:ge,loaderData:ca,errors:ss},hi?{fetchers:new Map(M.fetchers)}:{})}function zr(J){if(J&&!us(J[1]))return{[J[0]]:J[1].data};if(M.actionData)return Object.keys(M.actionData).length===0?null:M.actionData}function Ur(J){return J.forEach(ae=>{let ge=M.fetchers.get(ae.key),xe=ju(void 0,ge?ge.data:void 0);M.fetchers.set(ae.key,xe)}),new Map(M.fetchers)}function or(J,ae,ge,xe){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.");se.has(J)&&vn(J);let $e=(xe&&xe.unstable_flushSync)===!0,Ze=u||l,ut=ex(M.location,M.matches,d,m.v7_prependBasename,ge,m.v7_relativeSplatPath,ae,xe?.relative),Fe=_i(Ze,ut,d),Tt=ui(Fe,Ze,ut);if(Tt.active&&Tt.matches&&(Fe=Tt.matches),!Fe){De(J,ae,Ar(404,{pathname:ut}),{flushSync:$e});return}let{path:Xe,submission:at,error:rn}=$C(m.v7_normalizeFormMethod,!0,ut,xe);if(rn){De(J,ae,rn,{flushSync:$e});return}let sn=Vu(Fe,Xe);if(D=(xe&&xe.preventScrollReset)===!0,at&&Ws(at.formMethod)){_r(J,ae,Xe,sn,Fe,Tt.active,$e,at);return}K.set(J,{routeId:ae,path:Xe}),z(J,ae,Xe,sn,Fe,Tt.active,$e,at)}async function _r(J,ae,ge,xe,$e,Ze,ut,Fe){Ie(),K.delete(J);function Tt(Vt){if(!Vt.route.action&&!Vt.route.lazy){let Fs=Ar(405,{method:Fe.formMethod,pathname:ge,routeId:ae});return De(J,ae,Fs,{flushSync:ut}),!0}return!1}if(!Ze&&Tt(xe))return;let Xe=M.fetchers.get(J);Te(J,pF(Fe,Xe),{flushSync:ut});let at=new AbortController,rn=Ol(e.history,ge,at.signal,Fe);if(Ze){let Vt=await di($e,ge,rn.signal);if(Vt.type==="aborted")return;if(Vt.type==="error"){let{error:Fs}=ns(ge,Vt);De(J,ae,Fs,{flushSync:ut});return}else if(Vt.matches){if($e=Vt.matches,xe=Vu($e,ge),Tt(xe))return}else{De(J,ae,Ar(404,{pathname:ge}),{flushSync:ut});return}}se.set(J,at);let sn=H,Gt=(await fe("action",rn,[xe],$e))[0];if(rn.signal.aborted){se.get(J)===at&&se.delete(J);return}if(m.v7_fetcherPersist&&ee.has(J)){if(Ri(Gt)||us(Gt)){Te(J,To(void 0));return}}else{if(Ri(Gt))if(se.delete(J),W>sn){Te(J,To(void 0));return}else return A.add(J),Te(J,ju(Fe)),oe(rn,Gt,{fetcherSubmission:Fe});if(us(Gt)){De(J,ae,Gt.error);return}}if(Pi(Gt))throw Ar(400,{type:"defer-action"});let Kn=M.navigation.location||M.location,In=Ol(e.history,Kn,at.signal),pi=u||l,la=M.navigation.state!=="idle"?_i(pi,M.navigation.location,d):M.matches;Dt(la,"Didn't find any matches after fetcher action");let pn=++H;V.set(J,pn);let no=ju(Fe,Gt.data);M.fetchers.set(J,no);let[ca,ss]=BC(e.history,M,la,Fe,Kn,!1,m.v7_skipActionErrorRevalidation,q,ne,Y,ee,K,A,pi,d,[xe.route.id,Gt]);ss.filter(Vt=>Vt.key!==J).forEach(Vt=>{let Fs=Vt.key,Id=M.fetchers.get(Fs),Lm=ju(void 0,Id?Id.data:void 0);M.fetchers.set(Fs,Lm),se.has(Fs)&&vn(Fs),Vt.controller&&se.set(Fs,Vt.controller)}),Je({fetchers:new Map(M.fetchers)});let Na=()=>ss.forEach(Vt=>vn(Vt.key));at.signal.addEventListener("abort",Na);let{loaderResults:dl,fetcherResults:hi}=await Ae(M.matches,la,ca,ss,In);if(at.signal.aborted)return;at.signal.removeEventListener("abort",Na),V.delete(J),se.delete(J),ss.forEach(Vt=>se.delete(Vt.key));let St=JC([...dl,...hi]);if(St){if(St.idx>=ca.length){let Vt=ss[St.idx-ca.length].key;A.add(Vt)}return oe(In,St.result)}let{loaderData:Jt,errors:Rr}=HC(M,M.matches,ca,dl,void 0,ss,hi,ie);if(M.fetchers.has(J)){let Vt=To(Gt.data);M.fetchers.set(J,Vt)}zt(pn),M.navigation.state==="loading"&&pn>W?(Dt(O,"Expected pending action"),F&&F.abort(),rt(M.navigation.location,{matches:la,loaderData:Jt,errors:Rr,fetchers:new Map(M.fetchers)})):(Je({errors:Rr,loaderData:WC(M.loaderData,Jt,la,Rr),fetchers:new Map(M.fetchers)}),q=!1)}async function z(J,ae,ge,xe,$e,Ze,ut,Fe){let Tt=M.fetchers.get(J);Te(J,ju(Fe,Tt?Tt.data:void 0),{flushSync:ut});let Xe=new AbortController,at=Ol(e.history,ge,Xe.signal);if(Ze){let Gt=await di($e,ge,at.signal);if(Gt.type==="aborted")return;if(Gt.type==="error"){let{error:Kn}=ns(ge,Gt);De(J,ae,Kn,{flushSync:ut});return}else if(Gt.matches)$e=Gt.matches,xe=Vu($e,ge);else{De(J,ae,Ar(404,{pathname:ge}),{flushSync:ut});return}}se.set(J,Xe);let rn=H,on=(await fe("loader",at,[xe],$e))[0];if(Pi(on)&&(on=await CN(on,at.signal,!0)||on),se.get(J)===Xe&&se.delete(J),!at.signal.aborted){if(ee.has(J)){Te(J,To(void 0));return}if(Ri(on))if(W>rn){Te(J,To(void 0));return}else{A.add(J),await oe(at,on);return}if(us(on)){De(J,ae,on.error);return}Dt(!Pi(on),"Unhandled fetcher deferred data"),Te(J,To(on.data))}}async function oe(J,ae,ge){let{submission:xe,fetcherSubmission:$e,replace:Ze}=ge===void 0?{}:ge;ae.response.headers.has("X-Remix-Revalidate")&&(q=!0);let ut=ae.response.headers.get("Location");Dt(ut,"Expected a Location header on the redirect Response"),ut=VC(ut,new URL(J.url),d);let Fe=rd(M.location,ut,{_isRedirect:!0});if(n){let on=!1;if(ae.response.headers.has("X-Remix-Reload-Document"))on=!0;else if(hb.test(ut)){const Gt=e.history.createURL(ut);on=Gt.origin!==t.location.origin||qa(Gt.pathname,d)==null}if(on){Ze?t.location.replace(ut):t.location.assign(ut);return}}F=null;let Tt=Ze===!0?Jn.Replace:Jn.Push,{formMethod:Xe,formAction:at,formEncType:rn}=M.navigation;!xe&&!$e&&Xe&&at&&rn&&(xe=YC(M.navigation));let sn=xe||$e;if(K2.has(ae.response.status)&&sn&&Ws(sn.formMethod))await Pn(Tt,Fe,{submission:Dn({},sn,{formAction:ut}),preventScrollReset:D});else{let on=Ev(Fe,xe);await Pn(Tt,Fe,{overrideNavigation:on,fetcherSubmission:$e,preventScrollReset:D})}}async function fe(J,ae,ge,xe){try{let $e=await nF(f,J,ae,ge,xe,o,a);return await Promise.all($e.map((Ze,ut)=>{if(cF(Ze)){let Fe=Ze.result;return{type:wn.redirect,response:aF(Fe,ae,ge[ut].route.id,xe,d,m.v7_relativeSplatPath)}}return sF(Ze)}))}catch($e){return ge.map(()=>({type:wn.error,error:$e}))}}async function Ae(J,ae,ge,xe,$e){let[Ze,...ut]=await Promise.all([ge.length?fe("loader",$e,ge,ae):[],...xe.map(Fe=>{if(Fe.matches&&Fe.match&&Fe.controller){let Tt=Ol(e.history,Fe.path,Fe.controller.signal);return fe("loader",Tt,[Fe.match],Fe.matches).then(Xe=>Xe[0])}else return Promise.resolve({type:wn.error,error:Ar(404,{pathname:Fe.path})})})]);return await Promise.all([QC(J,ge,Ze,Ze.map(()=>$e.signal),!1,M.loaderData),QC(J,xe.map(Fe=>Fe.match),ut,xe.map(Fe=>Fe.controller?Fe.controller.signal:null),!0)]),{loaderResults:Ze,fetcherResults:ut}}function Ie(){q=!0,ne.push(...rs()),K.forEach((J,ae)=>{se.has(ae)&&(Y.push(ae),vn(ae))})}function Te(J,ae,ge){ge===void 0&&(ge={}),M.fetchers.set(J,ae),Je({fetchers:new Map(M.fetchers)},{flushSync:(ge&&ge.flushSync)===!0})}function De(J,ae,ge,xe){xe===void 0&&(xe={});let $e=Kl(M.matches,ae);Nt(J),Je({errors:{[$e.route.id]:ge},fetchers:new Map(M.fetchers)},{flushSync:(xe&&xe.flushSync)===!0})}function ht(J){return m.v7_fetcherPersist&&(re.set(J,(re.get(J)||0)+1),ee.has(J)&&ee.delete(J)),M.fetchers.get(J)||G2}function Nt(J){let ae=M.fetchers.get(J);se.has(J)&&!(ae&&ae.state==="loading"&&V.has(J))&&vn(J),K.delete(J),V.delete(J),A.delete(J),ee.delete(J),M.fetchers.delete(J)}function Rn(J){if(m.v7_fetcherPersist){let ae=(re.get(J)||0)-1;ae<=0?(re.delete(J),ee.add(J)):re.set(J,ae)}else Nt(J);Je({fetchers:new Map(M.fetchers)})}function vn(J){let ae=se.get(J);Dt(ae,"Expected fetch controller: "+J),ae.abort(),se.delete(J)}function Ee(J){for(let ae of J){let ge=ht(ae),xe=To(ge.data);M.fetchers.set(ae,xe)}}function bt(){let J=[],ae=!1;for(let ge of A){let xe=M.fetchers.get(ge);Dt(xe,"Expected fetcher: "+ge),xe.state==="loading"&&(A.delete(ge),J.push(ge),ae=!0)}return Ee(J),ae}function zt(J){let ae=[];for(let[ge,xe]of V)if(xe0}function Tn(J,ae){let ge=M.blockers.get(J)||Cu;return ue.get(J)!==ae&&ue.set(J,ae),ge}function br(J){M.blockers.delete(J),ue.delete(J)}function ur(J,ae){let ge=M.blockers.get(J)||Cu;Dt(ge.state==="unblocked"&&ae.state==="blocked"||ge.state==="blocked"&&ae.state==="blocked"||ge.state==="blocked"&&ae.state==="proceeding"||ge.state==="blocked"&&ae.state==="unblocked"||ge.state==="proceeding"&&ae.state==="unblocked","Invalid blocker state transition: "+ge.state+" -> "+ae.state);let xe=new Map(M.blockers);xe.set(J,ae),Je({blockers:xe})}function Vr(J){let{currentLocation:ae,nextLocation:ge,historyAction:xe}=J;if(ue.size===0)return;ue.size>1&&ac(!1,"A router only supports one blocker at a time");let $e=Array.from(ue.entries()),[Ze,ut]=$e[$e.length-1],Fe=M.blockers.get(Ze);if(!(Fe&&Fe.state==="proceeding")&&ut({currentLocation:ae,nextLocation:ge,historyAction:xe}))return Ze}function Pr(J){let ae=Ar(404,{pathname:J}),ge=u||l,{matches:xe,route:$e}=GC(ge);return rs(),{notFoundMatches:xe,route:$e,error:ae}}function ns(J,ae){return{boundaryId:Kl(ae.partialMatches).route.id,error:Ar(400,{type:"route-discovery",pathname:J,message:ae.error!=null&&"message"in ae.error?ae.error:String(ae.error)})}}function rs(J){let ae=[];return ie.forEach((ge,xe)=>{(!J||J(xe))&&(ge.cancel(),ae.push(xe),ie.delete(xe))}),ae}function to(J,ae,ge){if(x=J,C=ae,w=ge||null,!k&&M.navigation===kv){k=!0;let xe=zc(M.location,M.matches);xe!=null&&Je({restoreScrollPosition:xe})}return()=>{x=null,C=null,w=null}}function Bc(J,ae){return w&&w(J,ae.map(xe=>k2(xe,M.loaderData)))||J.key}function Rd(J,ae){if(x&&C){let ge=Bc(J,ae);x[ge]=C()}}function zc(J,ae){if(x){let ge=Bc(J,ae),xe=x[ge];if(typeof xe=="number")return xe}return null}function ui(J,ae,ge){if(h)if(J){let xe=J[J.length-1].route;if(xe.path&&(xe.path==="*"||xe.path.endsWith("/*")))return{active:!0,matches:bp(ae,ge,d,!0)}}else return{active:!0,matches:bp(ae,ge,d,!0)||[]};return{active:!1,matches:null}}async function di(J,ae,ge){let xe=J,$e=xe.length>0?xe[xe.length-1].route:null;for(;;){let Ze=u==null,ut=u||l;try{await eF(h,ae,xe,ut,o,a,j,ge)}catch(at){return{type:"error",error:at,partialMatches:xe}}finally{Ze&&(l=[...l])}if(ge.aborted)return{type:"aborted"};let Fe=_i(ut,ae,d),Tt=!1;if(Fe){let at=Fe[Fe.length-1].route;if(at.index)return{type:"success",matches:Fe};if(at.path&&at.path.length>0)if(at.path==="*")Tt=!0;else return{type:"success",matches:Fe}}let Xe=bp(ut,ae,d,!0);if(!Xe||xe.map(at=>at.route.id).join("-")===Xe.map(at=>at.route.id).join("-"))return{type:"success",matches:Tt?Fe:null};if(xe=Xe,$e=xe[xe.length-1].route,$e.path==="*")return{type:"success",matches:xe}}}function fi(J){o={},u=sd(J,a,void 0,o)}function Uc(J,ae){let ge=u==null;bN(J,ae,u||l,o,a),ge&&(l=[...l],Je({}))}return P={get basename(){return d},get future(){return m},get state(){return M},get routes(){return l},get window(){return t},initialize:me,subscribe:st,enableScrollRestoration:to,navigate:Ht,fetch:or,revalidate:Wn,createHref:J=>e.history.createHref(J),encodeLocation:J=>e.history.encodeLocation(J),getFetcher:ht,deleteFetcher:Rn,dispose:be,getBlocker:Tn,deleteBlocker:br,patchRoutes:Uc,_internalFetchControllers:se,_internalActiveDeferreds:ie,_internalSetRoutes:fi},P}function Y2(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function ex(e,t,n,r,a,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=Eh(a||".",kh(d,o),qa(e.pathname,n)||e.pathname,u==="path");return a==null&&(h.search=e.search,h.hash=e.hash),(a==null||a===""||a===".")&&f&&f.route.index&&!mb(h.search)&&(h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(h.pathname=h.pathname==="/"?n:Va([n,h.pathname])),zi(h)}function $C(e,t,n,r){if(!r||!Y2(r))return{path:n};if(r.formMethod&&!dF(r.formMethod))return{path:n,error:Ar(405,{method:r.formMethod})};let a=()=>({path:n,error:Ar(400,{type:"invalid-body"})}),o=r.formMethod||"get",l=e?o.toUpperCase():o.toLowerCase(),u=wN(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Ws(l))return a();let g=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((b,x)=>{let[w,C]=x;return""+b+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(!Ws(l))return a();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 a()}}}Dt(typeof FormData=="function","FormData is not available in this environment");let d,f;if(r.formData)d=tx(r.formData),f=r.formData;else if(r.body instanceof FormData)d=tx(r.body),f=r.body;else if(r.body instanceof URLSearchParams)d=r.body,f=qC(d);else if(r.body==null)d=new URLSearchParams,f=new FormData;else try{d=new URLSearchParams(r.body),f=qC(d)}catch{return a()}let h={formMethod:l,formAction:u,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(Ws(h.formMethod))return{path:n,submission:h};let m=Go(n);return t&&m.search&&mb(m.search)&&d.append("index",""),m.search="?"+d,{path:zi(m),submission:h}}function Z2(e,t){let n=e;if(t){let r=e.findIndex(a=>a.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function BC(e,t,n,r,a,o,l,u,d,f,h,m,g,b,x,w){let C=w?us(w[1])?w[1].error:w[1].data:void 0,k=e.createURL(t.location),N=e.createURL(a),T=w&&us(w[1])?w[0]:void 0,_=T?Z2(n,T):n,P=w?w[1].statusCode:void 0,M=l&&P&&P>=400,O=_.filter((F,B)=>{let{route:te}=F;if(te.lazy)return!0;if(te.loader==null)return!1;if(o)return typeof te.loader!="function"||te.loader.hydrate?!0:t.loaderData[te.id]===void 0&&(!t.errors||t.errors[te.id]===void 0);if(X2(t.loaderData,t.matches[B],F)||d.some(q=>q===F.route.id))return!0;let U=t.matches[B],ce=F;return zC(F,Dn({currentUrl:k,currentParams:U.params,nextUrl:N,nextParams:ce.params},r,{actionResult:C,actionStatus:P,defaultShouldRevalidate:M?!1:u||k.pathname+k.search===N.pathname+N.search||k.search!==N.search||xN(U,ce)}))}),D=[];return m.forEach((F,B)=>{if(o||!n.some(ne=>ne.route.id===F.routeId)||h.has(B))return;let te=_i(b,F.path,x);if(!te){D.push({key:B,routeId:F.routeId,path:F.path,matches:null,match:null,controller:null});return}let U=t.fetchers.get(B),ce=Vu(te,F.path),q=!1;g.has(B)?q=!1:f.includes(B)?q=!0:U&&U.state!=="idle"&&U.data===void 0?q=u:q=zC(ce,Dn({currentUrl:k,currentParams:t.matches[t.matches.length-1].params,nextUrl:N,nextParams:n[n.length-1].params},r,{actionResult:C,actionStatus:P,defaultShouldRevalidate:M?!1:u})),q&&D.push({key:B,routeId:F.routeId,path:F.path,matches:te,match:ce,controller:new AbortController})}),[O,D]}function X2(e,t,n){let r=!t||n.route.id!==t.route.id,a=e[n.route.id]===void 0;return r||a}function xN(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function zC(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function eF(e,t,n,r,a,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||bN(h,m,r,a,o)}}),l.set(d,f)),f&&lF(f)&&await f}finally{l.delete(d)}}function bN(e,t,n,r,a){if(e){var o;let l=r[e];Dt(l,"No route found to patch children into: routeId = "+e);let u=sd(t,a,[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=sd(t,a,["patch",String(n.length||"0")],r);n.push(...l)}}async function UC(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let a=n[e.id];Dt(a,"No route found in manifest");let o={};for(let l in r){let d=a[l]!==void 0&&l!=="hasErrorBoundary";ac(!d,'Route "'+a.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&&!C2.has(l)&&(o[l]=r[l])}Object.assign(a,o),Object.assign(a,Dn({},t(a),{lazy:void 0}))}function tF(e){return Promise.all(e.matches.map(t=>t.resolve()))}async function nF(e,t,n,r,a,o,l,u){let d=r.reduce((m,g)=>m.add(g.route.id),new Set),f=new Set,h=await e({matches:a.map(m=>{let g=d.has(m.route.id);return Dn({},m,{shouldLoad:g,resolve:x=>(f.add(m.route.id),g?rF(t,n,m,o,l,x,u):Promise.resolve({type:wn.data,result:void 0}))})}),request:n,params:a[0].params,context:u});return a.forEach(m=>Dt(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(a[g].route.id))}async function rF(e,t,n,r,a,o,l){let u,d,f=h=>{let m,g=new Promise((w,C)=>m=C);d=()=>m(),t.signal.addEventListener("abort",d);let b=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]:[]),x;return o?x=o(w=>b(w)):x=(async()=>{try{return{type:"data",result:await b()}}catch(w){return{type:"error",result:w}}})(),Promise.race([x,g])};try{let h=n.route[e];if(n.route.lazy)if(h){let m,[g]=await Promise.all([f(h).catch(b=>{m=b}),UC(n.route,a,r)]);if(m!==void 0)throw m;u=g}else if(await UC(n.route,a,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 Ar(405,{method:t.method,pathname:g,routeId:n.route.id})}else return{type:wn.data,result:void 0};else if(h)u=await f(h);else{let m=new URL(t.url),g=m.pathname+m.search;throw Ar(404,{pathname:g})}Dt(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:wn.error,result:h}}finally{d&&t.signal.removeEventListener("abort",d)}return u}async function sF(e){let{result:t,type:n,status:r}=e;if(SN(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:wn.error,error:u}}return n===wn.error?{type:wn.error,error:new pb(t.status,t.statusText,l),statusCode:t.status,headers:t.headers}:{type:wn.data,data:l,statusCode:t.status,headers:t.headers}}if(n===wn.error)return{type:wn.error,error:t,statusCode:Nh(t)?t.status:r};if(uF(t)){var a,o;return{type:wn.deferred,deferredData:t,statusCode:(a=t.init)==null?void 0:a.status,headers:((o=t.init)==null?void 0:o.headers)&&new Headers(t.init.headers)}}return{type:wn.data,data:t,statusCode:r}}function aF(e,t,n,r,a,o){let l=e.headers.get("Location");if(Dt(l,"Redirects returned/thrown from loaders/actions must have a Location header"),!hb.test(l)){let u=r.slice(0,r.findIndex(d=>d.route.id===n)+1);l=ex(new URL(t.url),u,a,!0,l,o),e.headers.set("Location",l)}return e}function VC(e,t,n){if(hb.test(e)){let r=e,a=r.startsWith("//")?new URL(t.protocol+r):new URL(r),o=qa(a.pathname,n)!=null;if(a.origin===t.origin&&o)return a.pathname+a.search+a.hash}return e}function Ol(e,t,n,r){let a=e.createURL(wN(t)).toString(),o={signal:n};if(r&&Ws(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=tx(r.formData):o.body=r.formData}return new Request(a,o)}function tx(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function qC(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function oF(e,t,n,r,a,o){let l={},u=null,d,f=!1,h={},m=r&&us(r[1])?r[1].error:void 0;return n.forEach((g,b)=>{let x=t[b].route.id;if(Dt(!Ri(g),"Cannot handle redirect results in processLoaderData"),us(g)){let w=g.error;m!==void 0&&(w=m,m=void 0),u=u||{};{let C=Kl(e,x);u[C.route.id]==null&&(u[C.route.id]=w)}l[x]=void 0,f||(f=!0,d=Nh(g.error)?g.error.status:500),g.headers&&(h[x]=g.headers)}else Pi(g)?(a.set(x,g.deferredData),l[x]=g.deferredData.data,g.statusCode!=null&&g.statusCode!==200&&!f&&(d=g.statusCode),g.headers&&(h[x]=g.headers)):(l[x]=g.data,g.statusCode&&g.statusCode!==200&&!f&&(d=g.statusCode),g.headers&&(h[x]=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 HC(e,t,n,r,a,o,l,u){let{loaderData:d,errors:f}=oF(t,n,r,a,u);for(let h=0;hr.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function GC(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 Ar(e,t){let{pathname:n,routeId:r,method:a,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):a&&n&&r?d="You made a "+a+' 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",a&&n&&r?d="You made a "+a.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":a&&(d='Invalid request method "'+a.toUpperCase()+'"')),new pb(e||500,u,new Error(d),!0)}function JC(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(Ri(n))return{result:n,idx:t}}}function wN(e){let t=typeof e=="string"?Go(e):e;return zi(Dn({},t,{hash:""}))}function iF(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function lF(e){return typeof e=="object"&&e!=null&&"then"in e}function cF(e){return SN(e.result)&&W2.has(e.result.status)}function Pi(e){return e.type===wn.deferred}function us(e){return e.type===wn.error}function Ri(e){return(e&&e.type)===wn.redirect}function uF(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 SN(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function dF(e){return H2.has(e.toLowerCase())}function Ws(e){return V2.has(e.toLowerCase())}async function QC(e,t,n,r,a,o){for(let l=0;lm.route.id===d.route.id),h=f!=null&&!xN(f,d)&&(o&&o[d.route.id])!==void 0;if(Pi(u)&&(a||h)){let m=r[l];Dt(m,"Expected an AbortSignal for revalidating fetcher deferred result"),await CN(u,m,a).then(g=>{g&&(n[l]=g||n[l])})}}}async function CN(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:wn.data,data:e.deferredData.unwrappedData}}catch(a){return{type:wn.error,error:a}}return{type:wn.data,data:e.deferredData.data}}}function mb(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Vu(e,t){let n=typeof t=="string"?Go(t).search:t.search;if(e[e.length-1].route.index&&mb(n||""))return e[e.length-1];let r=gN(e);return r[r.length-1]}function YC(e){let{formMethod:t,formAction:n,formEncType:r,text:a,formData:o,json:l}=e;if(!(!t||!n||!r)){if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:a};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 Ev(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 fF(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 ju(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 pF(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 To(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 hF(e,t){try{let n=e.sessionStorage.getItem(yN);if(n){let r=JSON.parse(n);for(let[a,o]of Object.entries(r||{}))o&&Array.isArray(o)&&t.set(a,new Set(o||[]))}}catch{}}function mF(e,t){if(t.size>0){let n={};for(let[r,a]of t)n[r]=[...a];try{e.sessionStorage.setItem(yN,JSON.stringify(n))}catch(r){ac(!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 Vp(){return Vp=Object.assign?Object.assign.bind():function(e){for(var t=1;t{u.current=!0}),v.useCallback(function(f,h){if(h===void 0&&(h={}),!u.current)return;if(typeof f=="number"){r.go(f);return}let m=Eh(f,JSON.parse(l),o,h.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:Va([t,m.pathname])),(h.replace?r.replace:r.push)(m,h.state,h)},[t,r,l,o,e])}function Os(){let{matches:e}=v.useContext(Qa),t=e[e.length-1];return t?t.params:{}}function Th(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=v.useContext(Ja),{matches:a}=v.useContext(Qa),{pathname:o}=Jo(),l=JSON.stringify(kh(a,r.v7_relativeSplatPath));return v.useMemo(()=>Eh(e,JSON.parse(l),o,n==="path"),[e,l,o,n])}function yF(e,t,n,r){wc()||Dt(!1);let{navigator:a}=v.useContext(Ja),{matches:o}=v.useContext(Qa),l=o[o.length-1],u=l?l.params:{};l&&l.pathname;let d=l?l.pathnameBase:"/";l&&l.route;let f=Jo(),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 b=_i(e,{pathname:g});return CF(b&&b.map(w=>Object.assign({},w,{params:Object.assign({},u,w.params),pathname:Va([d,a.encodeLocation?a.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?d:Va([d,a.encodeLocation?a.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),o,n,r)}function xF(){let e=NF(),t=Nh(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a={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:a},n):null,null)}const bF=v.createElement(xF,null);class wF 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(Qa.Provider,{value:this.props.routeContext},v.createElement(jN.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function SF(e){let{routeContext:t,match:n,children:r}=e,a=v.useContext(xd);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement(Qa.Provider,{value:t},r)}function CF(e,t,n,r){var a;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=(a=n)==null?void 0:a.errors;if(u!=null){let h=l.findIndex(m=>m.route.id&&u?.[m.route.id]!==void 0);h>=0||Dt(!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 b,x=!1,w=null,C=null;n&&(b=u&&m.route.id?u[m.route.id]:void 0,w=m.route.errorElement||bF,d&&(f<0&&g===0?(MF("route-fallback"),x=!0,C=null):f===g&&(x=!0,C=m.route.hydrateFallbackElement||null)));let k=t.concat(l.slice(0,g+1)),N=()=>{let T;return b?T=w:x?T=C:m.route.Component?T=v.createElement(m.route.Component,null):m.route.element?T=m.route.element:T=h,v.createElement(SF,{match:m,routeContext:{outlet:h,matches:k,isDataRoute:n!=null},children:T})};return n&&(m.route.ErrorBoundary||m.route.errorElement||g===0)?v.createElement(wF,{location:n.location,revalidation:n.revalidation,component:w,error:b,children:N(),routeContext:{outlet:null,matches:k,isDataRoute:!0}}):N()},null)}var EN=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(EN||{}),NN=(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})(NN||{});function jF(e){let t=v.useContext(xd);return t||Dt(!1),t}function kF(e){let t=v.useContext(gb);return t||Dt(!1),t}function EF(e){let t=v.useContext(Qa);return t||Dt(!1),t}function TN(e){let t=EF(),n=t.matches[t.matches.length-1];return n.route.id||Dt(!1),n.route.id}function NF(){var e;let t=v.useContext(jN),n=kF(NN.UseRouteError),r=TN();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function TF(){let{router:e}=jF(EN.UseNavigateStable),t=TN(),n=v.useRef(!1);return kN(()=>{n.current=!0}),v.useCallback(function(a,o){o===void 0&&(o={}),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,Vp({fromRouteId:t},o)))},[e,t])}const ZC={};function MF(e,t,n){ZC[e]||(ZC[e]=!0)}function nx(e){let{to:t,replace:n,state:r,relative:a}=e;wc()||Dt(!1);let{future:o,static:l}=v.useContext(Ja),{matches:u}=v.useContext(Qa),{pathname:d}=Jo(),f=Nn(),h=Eh(t,kh(u,o.v7_relativeSplatPath),d,a==="path"),m=JSON.stringify(h);return v.useEffect(()=>f(JSON.parse(m),{replace:n,state:r,relative:a}),[f,m,a,n,r]),null}function _F(e){let{basename:t="/",children:n=null,location:r,navigationType:a=Jn.Pop,navigator:o,static:l=!1,future:u}=e;wc()&&Dt(!1);let d=t.replace(/^\/*/,"/"),f=v.useMemo(()=>({basename:d,navigator:o,static:l,future:Vp({v7_relativeSplatPath:!1},u)}),[d,u,o,l]);typeof r=="string"&&(r=Go(r));let{pathname:h="/",search:m="",hash:g="",state:b=null,key:x="default"}=r,w=v.useMemo(()=>{let C=qa(h,d);return C==null?null:{location:{pathname:C,search:m,hash:g,state:b,key:x},navigationType:a}},[d,h,m,g,b,x,a]);return w==null?null:v.createElement(Ja.Provider,{value:f},v.createElement(vb.Provider,{children:n,value:w}))}new Promise(()=>{});function PF(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 oc(){return oc=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[a]=e[a]);return n}function RF(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function IF(e,t){return e.button===0&&(!t||t==="_self")&&!RF(e)}function rx(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(a=>[n,a]):[[n,r]])},[]))}function OF(e,t){let n=rx(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(o=>{n.append(a,o)})}),n}const AF=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],DF=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],FF="6";try{window.__reactRouterVersion=FF}catch{}function LF(e,t){return Q2({basename:void 0,future:oc({},void 0,{v7_prependBasename:!0}),history:b2({window:void 0}),hydrationData:$F(),routes:e,mapRouteProperties:PF,unstable_dataStrategy:void 0,unstable_patchRoutesOnMiss:void 0,window:void 0}).initialize()}function $F(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=oc({},t,{errors:BF(t.errors)})),t}function BF(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,a]of t)if(a&&a.__type==="RouteErrorResponse")n[r]=new pb(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let o=window[a.__subType];if(typeof o=="function")try{let l=new o(a.message);l.stack="",n[r]=l}catch{}}if(n[r]==null){let o=new Error(a.message);o.stack="",n[r]=o}}else n[r]=a;return n}const _N=v.createContext({isTransitioning:!1}),zF=v.createContext(new Map),UF="startTransition",XC=Ko[UF],VF="flushSync",e1=x2[VF];function qF(e){XC?XC(e):e()}function ku(e){e1?e1(e):e()}class HF{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 WF(e){let{fallbackElement:t,router:n,future:r}=e,[a,o]=v.useState(n.state),[l,u]=v.useState(),[d,f]=v.useState({isTransitioning:!1}),[h,m]=v.useState(),[g,b]=v.useState(),[x,w]=v.useState(),C=v.useRef(new Map),{v7_startTransition:k}=r||{},N=v.useCallback(D=>{k?qF(D):D()},[k]),T=v.useCallback((D,F)=>{let{deletedFetchers:B,unstable_flushSync:te,unstable_viewTransitionOpts:U}=F;B.forEach(q=>C.current.delete(q)),D.fetchers.forEach((q,ne)=>{q.data!==void 0&&C.current.set(ne,q.data)});let ce=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!U||ce){te?ku(()=>o(D)):N(()=>o(D));return}if(te){ku(()=>{g&&(h&&h.resolve(),g.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:U.currentLocation,nextLocation:U.nextLocation})});let q=n.window.document.startViewTransition(()=>{ku(()=>o(D))});q.finished.finally(()=>{ku(()=>{m(void 0),b(void 0),u(void 0),f({isTransitioning:!1})})}),ku(()=>b(q));return}g?(h&&h.resolve(),g.skipTransition(),w({state:D,currentLocation:U.currentLocation,nextLocation:U.nextLocation})):(u(D),f({isTransitioning:!0,flushSync:!1,currentLocation:U.currentLocation,nextLocation:U.nextLocation}))},[n.window,g,h,C,N]);v.useLayoutEffect(()=>n.subscribe(T),[n,T]),v.useEffect(()=>{d.isTransitioning&&!d.flushSync&&m(new HF)},[d]),v.useEffect(()=>{if(h&&l&&n.window){let D=l,F=h.promise,B=n.window.document.startViewTransition(async()=>{N(()=>o(D)),await F});B.finished.finally(()=>{m(void 0),b(void 0),u(void 0),f({isTransitioning:!1})}),b(B)}},[N,l,h,n.window]),v.useEffect(()=>{h&&l&&a.location.key===l.location.key&&h.resolve()},[h,g,a.location,l]),v.useEffect(()=>{!d.isTransitioning&&x&&(u(x.state),f({isTransitioning:!0,flushSync:!1,currentLocation:x.currentLocation,nextLocation:x.nextLocation}),w(void 0))},[d.isTransitioning,x]),v.useEffect(()=>{},[]);let _=v.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:D=>n.navigate(D),push:(D,F,B)=>n.navigate(D,{state:F,preventScrollReset:B?.preventScrollReset}),replace:(D,F,B)=>n.navigate(D,{replace:!0,state:F,preventScrollReset:B?.preventScrollReset})}),[n]),P=n.basename||"/",M=v.useMemo(()=>({router:n,navigator:_,static:!1,basename:P}),[n,_,P]),O=v.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return v.createElement(v.Fragment,null,v.createElement(xd.Provider,{value:M},v.createElement(gb.Provider,{value:a},v.createElement(zF.Provider,{value:C.current},v.createElement(_N.Provider,{value:d},v.createElement(_F,{basename:P,location:a.location,navigationType:a.historyAction,navigator:_,future:O},a.initialized||n.future.v7_partialHydration?v.createElement(KF,{routes:n.routes,future:n.future,state:a}):t))))),null)}const KF=v.memo(GF);function GF(e){let{routes:t,future:n,state:r}=e;return yF(t,void 0,r,n)}const JF=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",QF=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,PN=v.forwardRef(function(t,n){let{onClick:r,relative:a,reloadDocument:o,replace:l,state:u,target:d,to:f,preventScrollReset:h,unstable_viewTransition:m}=t,g=MN(t,AF),{basename:b}=v.useContext(Ja),x,w=!1;if(typeof f=="string"&&QF.test(f)&&(x=f,JF))try{let T=new URL(window.location.href),_=f.startsWith("//")?new URL(T.protocol+f):new URL(f),P=qa(_.pathname,b);_.origin===T.origin&&P!=null?f=P+_.search+_.hash:w=!0}catch{}let C=gF(f,{relative:a}),k=ZF(f,{replace:l,state:u,target:d,preventScrollReset:h,relative:a,unstable_viewTransition:m});function N(T){r&&r(T),T.defaultPrevented||k(T)}return v.createElement("a",oc({},g,{href:x||C,onClick:w||o?r:N,ref:n,target:d}))}),RN=v.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:a=!1,className:o="",end:l=!1,style:u,to:d,unstable_viewTransition:f,children:h}=t,m=MN(t,DF),g=Th(d,{relative:m.relative}),b=Jo(),x=v.useContext(gb),{navigator:w,basename:C}=v.useContext(Ja),k=x!=null&&XF(g)&&f===!0,N=w.encodeLocation?w.encodeLocation(g).pathname:g.pathname,T=b.pathname,_=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;a||(T=T.toLowerCase(),_=_?_.toLowerCase():null,N=N.toLowerCase()),_&&C&&(_=qa(_,C)||_);const P=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let M=T===N||!l&&T.startsWith(N)&&T.charAt(P)==="/",O=_!=null&&(_===N||!l&&_.startsWith(N)&&_.charAt(N.length)==="/"),D={isActive:M,isPending:O,isTransitioning:k},F=M?r:void 0,B;typeof o=="function"?B=o(D):B=[o,M?"active":null,O?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let te=typeof u=="function"?u(D):u;return v.createElement(PN,oc({},m,{"aria-current":F,className:B,ref:n,style:te,to:d,unstable_viewTransition:f}),typeof h=="function"?h(D):h)});var sx;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(sx||(sx={}));var t1;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(t1||(t1={}));function YF(e){let t=v.useContext(xd);return t||Dt(!1),t}function ZF(e,t){let{target:n,replace:r,state:a,preventScrollReset:o,relative:l,unstable_viewTransition:u}=t===void 0?{}:t,d=Nn(),f=Jo(),h=Th(e,{relative:l});return v.useCallback(m=>{if(IF(m,n)){m.preventDefault();let g=r!==void 0?r:zi(f)===zi(h);d(e,{replace:g,state:a,preventScrollReset:o,relative:l,unstable_viewTransition:u})}},[f,d,h,r,a,n,e,o,l,u])}function Sc(e){let t=v.useRef(rx(e)),n=v.useRef(!1),r=Jo(),a=v.useMemo(()=>OF(r.search,n.current?null:t.current),[r.search]),o=Nn(),l=v.useCallback((u,d)=>{const f=rx(typeof u=="function"?u(a):u);n.current=!0,o("?"+f,d)},[o,a]);return[a,l]}function XF(e,t){t===void 0&&(t={});let n=v.useContext(_N);n==null&&Dt(!1);let{basename:r}=YF(sx.useViewTransitionState),a=Th(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=qa(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=qa(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Up(a.pathname,l)!=null||Up(a.pathname,o)!=null}function IN(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;ttypeof e=="number"&&!isNaN(e),Fi=e=>typeof e=="string",ps=e=>typeof e=="function",wp=e=>Fi(e)||ps(e)?e:null,ax=e=>v.isValidElement(e)||Fi(e)||ps(e)||ad(e);function e4(e,t,n){n===void 0&&(n=300);const{scrollHeight:r,style:a}=e;requestAnimationFrame(()=>{a.minHeight="initial",a.height=r+"px",a.transition=`all ${n}ms`,requestAnimationFrame(()=>{a.height="0",a.padding="0",a.margin="0",setTimeout(t,n)})})}function Mh(e){let{enter:t,exit:n,appendPosition:r=!1,collapse:a=!0,collapseDuration:o=300}=e;return function(l){let{children:u,position:d,preventExitTransition:f,done:h,nodeRef:m,isIn:g,playToast:b}=l;const x=r?`${t}--${d}`:t,w=r?`${n}--${d}`:n,C=v.useRef(0);return v.useLayoutEffect(()=>{const k=m.current,N=x.split(" "),T=_=>{_.target===m.current&&(b(),k.removeEventListener("animationend",T),k.removeEventListener("animationcancel",T),C.current===0&&_.type!=="animationcancel"&&k.classList.remove(...N))};k.classList.add(...N),k.addEventListener("animationend",T),k.addEventListener("animationcancel",T)},[]),v.useEffect(()=>{const k=m.current,N=()=>{k.removeEventListener("animationend",N),a?e4(k,h,o):h()};g||(f?N():(C.current=1,k.className+=` ${w}`,k.addEventListener("animationend",N)))},[g]),ke.createElement(ke.Fragment,null,u)}}function n1(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 Dr=new Map;let od=[];const ox=new Set,t4=e=>ox.forEach(t=>t(e)),ON=()=>Dr.size>0;function AN(e,t){var n;if(t)return!((n=Dr.get(t))==null||!n.isToastActive(e));let r=!1;return Dr.forEach(a=>{a.isToastActive(e)&&(r=!0)}),r}function DN(e,t){ax(e)&&(ON()||od.push({content:e,options:t}),Dr.forEach(n=>{n.buildToast(e,t)}))}function r1(e,t){Dr.forEach(n=>{t!=null&&t!=null&&t.containerId?t?.containerId===n.id&&n.toggle(e,t?.id):n.toggle(e,t?.id)})}function n4(e){const{subscribe:t,getSnapshot:n,setProps:r}=v.useRef((function(o){const l=o.containerId||1;return{subscribe(u){const d=(function(h,m,g){let b=1,x=0,w=[],C=[],k=[],N=m;const T=new Map,_=new Set,P=()=>{k=Array.from(T.values()),_.forEach(D=>D())},M=D=>{C=D==null?[]:C.filter(F=>F!==D),P()},O=D=>{const{toastId:F,onOpen:B,updateId:te,children:U}=D.props,ce=te==null;D.staleId&&T.delete(D.staleId),T.set(F,D),C=[...C,D.props.toastId].filter(q=>q!==D.staleId),P(),g(n1(D,ce?"added":"updated")),ce&&ps(B)&&B(v.isValidElement(U)&&U.props)};return{id:h,props:N,observe:D=>(_.add(D),()=>_.delete(D)),toggle:(D,F)=>{T.forEach(B=>{F!=null&&F!==B.props.toastId||ps(B.toggle)&&B.toggle(D)})},removeToast:M,toasts:T,clearQueue:()=>{x-=w.length,w=[]},buildToast:(D,F)=>{if((K=>{let{containerId:re,toastId:ee,updateId:ie}=K;const ue=re?re!==h:h!==1,j=T.has(ee)&&ie==null;return ue||j})(F))return;const{toastId:B,updateId:te,data:U,staleId:ce,delay:q}=F,ne=()=>{M(B)},Y=te==null;Y&&x++;const se={...N,style:N.toastStyle,key:b++,...Object.fromEntries(Object.entries(F).filter(K=>{let[re,ee]=K;return ee!=null})),toastId:B,updateId:te,data:U,closeToast:ne,isIn:!1,className:wp(F.className||N.toastClassName),bodyClassName:wp(F.bodyClassName||N.bodyClassName),progressClassName:wp(F.progressClassName||N.progressClassName),autoClose:!F.isLoading&&(H=F.autoClose,W=N.autoClose,H===!1||ad(H)&&H>0?H:W),deleteToast(){const K=T.get(B),{onClose:re,children:ee}=K.props;ps(re)&&re(v.isValidElement(ee)&&ee.props),g(n1(K,"removed")),T.delete(B),x--,x<0&&(x=0),w.length>0?O(w.shift()):P()}};var H,W;se.closeButton=N.closeButton,F.closeButton===!1||ax(F.closeButton)?se.closeButton=F.closeButton:F.closeButton===!0&&(se.closeButton=!ax(N.closeButton)||N.closeButton);let V=D;v.isValidElement(D)&&!Fi(D.type)?V=v.cloneElement(D,{closeToast:ne,toastProps:se,data:U}):ps(D)&&(V=D({closeToast:ne,toastProps:se,data:U}));const A={content:V,props:se,staleId:ce};N.limit&&N.limit>0&&x>N.limit&&Y?w.push(A):ad(q)?setTimeout(()=>{O(A)},q):O(A)},setProps(D){N=D},setToggle:(D,F)=>{T.get(D).toggle=F},isToastActive:D=>C.some(F=>F===D),getSnapshot:()=>N.newestOnTop?k.reverse():k}})(l,o,t4);Dr.set(l,d);const f=d.observe(u);return od.forEach(h=>DN(h.content,h.options)),od=[],()=>{f(),Dr.delete(l)}},setProps(u){var d;(d=Dr.get(l))==null||d.setProps(u)},getSnapshot(){var u;return(u=Dr.get(l))==null?void 0:u.getSnapshot()}}})(e)).current;r(e);const a=v.useSyncExternalStore(t,n,n);return{getToastToRender:function(o){if(!a)return[];const l=new Map;return a.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:AN,count:a?.length}}function r4(e){const[t,n]=v.useState(!1),[r,a]=v.useState(!1),o=v.useRef(null),l=v.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,b;function x(){n(!0)}function w(){n(!1)}function C(T){const _=o.current;l.canDrag&&_&&(l.didMove=!0,t&&w(),l.delta=e.draggableDirection==="x"?T.clientX-l.start:T.clientY-l.start,l.start!==T.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 T=o.current;if(l.canDrag&&l.didMove&&T){if(l.canDrag=!1,Math.abs(l.delta)>l.removalDistance)return a(!0),e.closeToast(),void e.collapseAll();T.style.transition="transform 0.2s, opacity 0.2s",T.style.removeProperty("transform"),T.style.removeProperty("opacity")}}(b=Dr.get((g={id:e.toastId,containerId:e.containerId,fn:n}).containerId||1))==null||b.setToggle(g.id,g.fn),v.useEffect(()=>{if(e.pauseOnFocusLoss)return document.hasFocus()||w(),window.addEventListener("focus",x),window.addEventListener("blur",w),()=>{window.removeEventListener("focus",x),window.removeEventListener("blur",w)}},[e.pauseOnFocusLoss]);const N={onPointerDown:function(T){if(e.draggable===!0||e.draggable===T.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=T.clientX,l.removalDistance=_.offsetWidth*(e.draggablePercent/100)):(l.start=T.clientY,l.removalDistance=_.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent)/100)}},onPointerUp:function(T){const{top:_,bottom:P,left:M,right:O}=o.current.getBoundingClientRect();T.nativeEvent.type!=="touchend"&&e.pauseOnHover&&T.clientX>=M&&T.clientX<=O&&T.clientY>=_&&T.clientY<=P?w():x()}};return u&&d&&(N.onMouseEnter=w,e.stacked||(N.onMouseLeave=x)),m&&(N.onClick=T=>{h&&h(T),l.canCloseOnClick&&f()}),{playToast:x,pauseToast:w,isRunning:t,preventExitTransition:r,toastRef:o,eventHandlers:N}}function s4(e){let{delay:t,isRunning:n,closeToast:r,type:a="default",hide:o,className:l,style:u,controlledProgress:d,progress:f,rtl:h,isIn:m,theme:g}=e;const b=o||d&&f===0,x={...u,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused"};d&&(x.transform=`scaleX(${f})`);const w=Qs("Toastify__progress-bar",d?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${g}`,`Toastify__progress-bar--${a}`,{"Toastify__progress-bar--rtl":h}),C=ps(l)?l({rtl:h,type:a,defaultClassName:w}):Qs(w,l),k={[d&&f>=1?"onTransitionEnd":"onAnimationEnd"]:d&&f<1?null:()=>{m&&r()}};return ke.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":b},ke.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${g} Toastify__progress-bar--${a}`}),ke.createElement("div",{role:"progressbar","aria-hidden":b?"true":"false","aria-label":"notification timer",className:C,style:x,...k}))}let a4=1;const FN=()=>""+a4++;function o4(e){return e&&(Fi(e.toastId)||ad(e.toastId))?e.toastId:FN()}function Yu(e,t){return DN(e,t),t.toastId}function qp(e,t){return{...t,type:t&&t.type||e,toastId:o4(t)}}function Bf(e){return(t,n)=>Yu(t,qp(e,n))}function Q(e,t){return Yu(e,qp("default",t))}Q.loading=(e,t)=>Yu(e,qp("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),Q.promise=function(e,t,n){let r,{pending:a,error:o,success:l}=t;a&&(r=Fi(a)?Q.loading(a,n):Q.loading(a.render,{...n,...a}));const u={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},d=(h,m,g)=>{if(m==null)return void Q.dismiss(r);const b={type:h,...u,...n,data:g},x=Fi(m)?{render:m}:m;return r?Q.update(r,{...b,...x}):Q(x.render,{...b,...x}),g},f=ps(e)?e():e;return f.then(h=>d("success",l,h)).catch(h=>d("error",o,h)),f},Q.success=Bf("success"),Q.info=Bf("info"),Q.error=Bf("error"),Q.warning=Bf("warning"),Q.warn=Q.warning,Q.dark=(e,t)=>Yu(e,qp("default",{theme:"dark",...t})),Q.dismiss=function(e){(function(t){var n;if(ON()){if(t==null||Fi(n=t)||ad(n))Dr.forEach(r=>{r.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){const r=Dr.get(t.containerId);r?r.removeToast(t.id):Dr.forEach(a=>{a.removeToast(t.id)})}}else od=od.filter(r=>t!=null&&r.options.toastId!==t)})(e)},Q.clearWaitingQueue=function(e){e===void 0&&(e={}),Dr.forEach(t=>{!t.props.limit||e.containerId&&t.id!==e.containerId||t.clearQueue()})},Q.isActive=AN,Q.update=function(e,t){t===void 0&&(t={});const n=((r,a)=>{var o;let{containerId:l}=a;return(o=Dr.get(l||1))==null?void 0:o.toasts.get(r)})(e,t);if(n){const{props:r,content:a}=n,o={delay:100,...r,...t,toastId:t.toastId||e,updateId:FN()};o.toastId!==e&&(o.staleId=e);const l=o.render||a;delete o.render,Yu(l,o)}},Q.done=e=>{Q.update(e,{progress:1})},Q.onChange=function(e){return ox.add(e),()=>{ox.delete(e)}},Q.play=e=>r1(!0,e),Q.pause=e=>r1(!1,e);const i4=typeof window<"u"?v.useLayoutEffect:v.useEffect,zf=e=>{let{theme:t,type:n,isLoading:r,...a}=e;return ke.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...a})},Nv={info:function(e){return ke.createElement(zf,{...e},ke.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 ke.createElement(zf,{...e},ke.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 ke.createElement(zf,{...e},ke.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 ke.createElement(zf,{...e},ke.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 ke.createElement("div",{className:"Toastify__spinner"})}},l4=e=>{const{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:a,playToast:o}=r4(e),{closeButton:l,children:u,autoClose:d,onClick:f,type:h,hideProgressBar:m,closeToast:g,transition:b,position:x,className:w,style:C,bodyClassName:k,bodyStyle:N,progressClassName:T,progressStyle:_,updateId:P,role:M,progress:O,rtl:D,toastId:F,deleteToast:B,isIn:te,isLoading:U,closeOnClick:ce,theme:q}=e,ne=Qs("Toastify__toast",`Toastify__toast-theme--${q}`,`Toastify__toast--${h}`,{"Toastify__toast--rtl":D},{"Toastify__toast--close-on-click":ce}),Y=ps(w)?w({rtl:D,position:x,type:h,defaultClassName:ne}):Qs(ne,w),se=(function(A){let{theme:K,type:re,isLoading:ee,icon:ie}=A,ue=null;const j={theme:K,type:re};return ie===!1||(ps(ie)?ue=ie({...j,isLoading:ee}):v.isValidElement(ie)?ue=v.cloneElement(ie,j):ee?ue=Nv.spinner():(I=>I in Nv)(re)&&(ue=Nv[re](j))),ue})(e),H=!!O||!d,W={closeToast:g,type:h,theme:q};let V=null;return l===!1||(V=ps(l)?l(W):v.isValidElement(l)?v.cloneElement(l,W):(function(A){let{closeToast:K,theme:re,ariaLabel:ee="close"}=A;return ke.createElement("button",{className:`Toastify__close-button Toastify__close-button--${re}`,type:"button",onClick:ie=>{ie.stopPropagation(),K(ie)},"aria-label":ee},ke.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},ke.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"})))})(W)),ke.createElement(b,{isIn:te,done:B,position:x,preventExitTransition:n,nodeRef:r,playToast:o},ke.createElement("div",{id:F,onClick:f,"data-in":te,className:Y,...a,style:C,ref:r},ke.createElement("div",{...te&&{role:M},className:ps(k)?k({type:h}):Qs("Toastify__toast-body",k),style:N},se!=null&&ke.createElement("div",{className:Qs("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!U})},se),ke.createElement("div",null,u)),V,ke.createElement(s4,{...P&&!H?{key:`pb-${P}`}:{},rtl:D,theme:q,delay:d,isRunning:t,isIn:te,closeToast:g,hide:m,type:h,style:_,className:T,controlledProgress:H,progress:O||0})))},_h=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},c4=Mh(_h("bounce",!0));Mh(_h("slide",!0));Mh(_h("zoom"));Mh(_h("flip"));const u4={position:"top-right",transition:c4,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function d4(e){let t={...u4,...e};const n=e.stacked,[r,a]=v.useState(!0),o=v.useRef(null),{getToastToRender:l,isToastActive:u,count:d}=n4(t),{className:f,style:h,rtl:m,containerId:g}=t;function b(w){const C=Qs("Toastify__toast-container",`Toastify__toast-container--${w}`,{"Toastify__toast-container--rtl":m});return ps(f)?f({position:w,rtl:m,defaultClassName:C}):Qs(C,wp(f))}function x(){n&&(a(!0),Q.play())}return i4(()=>{if(n){var w;const C=o.current.querySelectorAll('[data-in="true"]'),k=12,N=(w=t.position)==null?void 0:w.includes("top");let T=0,_=0;Array.from(C).reverse().forEach((P,M)=>{const O=P;O.classList.add("Toastify__toast--stacked"),M>0&&(O.dataset.collapsed=`${r}`),O.dataset.pos||(O.dataset.pos=N?"top":"bot");const D=T*(r?.2:1)+(r?0:k*M);O.style.setProperty("--y",`${N?D:-1*D}px`),O.style.setProperty("--g",`${k}`),O.style.setProperty("--s",""+(1-(r?_:0))),T+=O.offsetHeight,_+=.025})}},[r,d,n]),ke.createElement("div",{ref:o,className:"Toastify",id:g,onMouseEnter:()=>{n&&(a(!1),Q.pause())},onMouseLeave:x},l((w,C)=>{const k=C.length?{...h}:{...h,pointerEvents:"none"};return ke.createElement("div",{className:b(w),style:k,key:`container-${w}`},C.map(N=>{let{content:T,props:_}=N;return ke.createElement(l4,{..._,stacked:n,collapseAll:x,isIn:u(_.toastId,_.containerId),style:_.style,key:`toast-${_.key}`},T)}))}))}const f4={theme:"system",setTheme:()=>null},LN=v.createContext(f4);function p4({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[a,o]=v.useState(()=>localStorage.getItem(n)||t);v.useEffect(()=>{const u=window.document.documentElement;if(u.classList.remove("light","dark"),a==="system"){const d=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";u.classList.add(d);return}u.classList.add(a)},[a]);const l={theme:a,setTheme:u=>{localStorage.setItem(n,u),o(u)}};return s.jsx(LN.Provider,{...r,value:l,children:e})}const Zi=()=>{const e=v.useContext(LN);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};function $N(e,t){return function(){return e.apply(t,arguments)}}const{toString:h4}=Object.prototype,{getPrototypeOf:yb}=Object,{iterator:Ph,toStringTag:BN}=Symbol,Rh=(e=>t=>{const n=h4.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),ra=e=>(e=e.toLowerCase(),t=>Rh(t)===e),Ih=e=>t=>typeof t===e,{isArray:Cc}=Array,ic=Ih("undefined");function bd(e){return e!==null&&!ic(e)&&e.constructor!==null&&!ic(e.constructor)&&Zr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const zN=ra("ArrayBuffer");function m4(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&zN(e.buffer),t}const g4=Ih("string"),Zr=Ih("function"),UN=Ih("number"),wd=e=>e!==null&&typeof e=="object",v4=e=>e===!0||e===!1,Sp=e=>{if(Rh(e)!=="object")return!1;const t=yb(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(BN in e)&&!(Ph in e)},y4=e=>{if(!wd(e)||bd(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},x4=ra("Date"),b4=ra("File"),w4=ra("Blob"),S4=ra("FileList"),C4=e=>wd(e)&&Zr(e.pipe),j4=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Zr(e.append)&&((t=Rh(e))==="formdata"||t==="object"&&Zr(e.toString)&&e.toString()==="[object FormData]"))},k4=ra("URLSearchParams"),[E4,N4,T4,M4]=["ReadableStream","Request","Response","Headers"].map(ra),_4=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Sd(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,a;if(typeof e!="object"&&(e=[e]),Cc(e))for(r=0,a=e.length;r0;)if(a=n[r],t===a.toLowerCase())return a;return null}const Ii=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,qN=e=>!ic(e)&&e!==Ii;function ix(){const{caseless:e,skipUndefined:t}=qN(this)&&this||{},n={},r=(a,o)=>{const l=e&&VN(n,o)||o;Sp(n[l])&&Sp(a)?n[l]=ix(n[l],a):Sp(a)?n[l]=ix({},a):Cc(a)?n[l]=a.slice():(!t||!ic(a))&&(n[l]=a)};for(let a=0,o=arguments.length;a(Sd(t,(a,o)=>{n&&Zr(a)?e[o]=$N(a,n):e[o]=a},{allOwnKeys:r}),e),R4=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),I4=(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)},O4=(e,t,n,r)=>{let a,o,l;const u={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),o=a.length;o-- >0;)l=a[o],(!r||r(l,e,t))&&!u[l]&&(t[l]=e[l],u[l]=!0);e=n!==!1&&yb(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},A4=(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},D4=e=>{if(!e)return null;if(Cc(e))return e;let t=e.length;if(!UN(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},F4=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&yb(Uint8Array)),L4=(e,t)=>{const r=(e&&e[Ph]).call(e);let a;for(;(a=r.next())&&!a.done;){const o=a.value;t.call(e,o[0],o[1])}},$4=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},B4=ra("HTMLFormElement"),z4=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,a){return r.toUpperCase()+a}),s1=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),U4=ra("RegExp"),HN=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Sd(n,(a,o)=>{let l;(l=t(a,o,e))!==!1&&(r[o]=l||a)}),Object.defineProperties(e,r)},V4=e=>{HN(e,(t,n)=>{if(Zr(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Zr(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+"'")})}})},q4=(e,t)=>{const n={},r=a=>{a.forEach(o=>{n[o]=!0})};return Cc(e)?r(e):r(String(e).split(t)),n},H4=()=>{},W4=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function K4(e){return!!(e&&Zr(e.append)&&e[BN]==="FormData"&&e[Ph])}const G4=e=>{const t=new Array(10),n=(r,a)=>{if(wd(r)){if(t.indexOf(r)>=0)return;if(bd(r))return r;if(!("toJSON"in r)){t[a]=r;const o=Cc(r)?[]:{};return Sd(r,(l,u)=>{const d=n(l,a+1);!ic(d)&&(o[u]=d)}),t[a]=void 0,o}}return r};return n(e,0)},J4=ra("AsyncFunction"),Q4=e=>e&&(wd(e)||Zr(e))&&Zr(e.then)&&Zr(e.catch),WN=((e,t)=>e?setImmediate:t?((n,r)=>(Ii.addEventListener("message",({source:a,data:o})=>{a===Ii&&o===n&&r.length&&r.shift()()},!1),a=>{r.push(a),Ii.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Zr(Ii.postMessage)),Y4=typeof queueMicrotask<"u"?queueMicrotask.bind(Ii):typeof process<"u"&&process.nextTick||WN,Z4=e=>e!=null&&Zr(e[Ph]),ye={isArray:Cc,isArrayBuffer:zN,isBuffer:bd,isFormData:j4,isArrayBufferView:m4,isString:g4,isNumber:UN,isBoolean:v4,isObject:wd,isPlainObject:Sp,isEmptyObject:y4,isReadableStream:E4,isRequest:N4,isResponse:T4,isHeaders:M4,isUndefined:ic,isDate:x4,isFile:b4,isBlob:w4,isRegExp:U4,isFunction:Zr,isStream:C4,isURLSearchParams:k4,isTypedArray:F4,isFileList:S4,forEach:Sd,merge:ix,extend:P4,trim:_4,stripBOM:R4,inherits:I4,toFlatObject:O4,kindOf:Rh,kindOfTest:ra,endsWith:A4,toArray:D4,forEachEntry:L4,matchAll:$4,isHTMLForm:B4,hasOwnProperty:s1,hasOwnProp:s1,reduceDescriptors:HN,freezeMethods:V4,toObjectSet:q4,toCamelCase:z4,noop:H4,toFiniteNumber:W4,findKey:VN,global:Ii,isContextDefined:qN,isSpecCompliantForm:K4,toJSONObject:G4,isAsyncFn:J4,isThenable:Q4,setImmediate:WN,asap:Y4,isIterable:Z4};function Ot(e,t,n,r,a){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),a&&(this.response=a,this.status=a.status?a.status:null)}ye.inherits(Ot,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:ye.toJSONObject(this.config),code:this.code,status:this.status}}});const KN=Ot.prototype,GN={};["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=>{GN[e]={value:e}});Object.defineProperties(Ot,GN);Object.defineProperty(KN,"isAxiosError",{value:!0});Ot.from=(e,t,n,r,a,o)=>{const l=Object.create(KN);ye.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 Ot.call(l,u,d,n,r,a),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 X4=null;function lx(e){return ye.isPlainObject(e)||ye.isArray(e)}function JN(e){return ye.endsWith(e,"[]")?e.slice(0,-2):e}function a1(e,t,n){return e?e.concat(t).map(function(a,o){return a=JN(a),!n&&o?"["+a+"]":a}).join(n?".":""):t}function eL(e){return ye.isArray(e)&&!e.some(lx)}const tL=ye.toFlatObject(ye,{},null,function(t){return/^is[A-Z]/.test(t)});function Oh(e,t,n){if(!ye.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=ye.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,C){return!ye.isUndefined(C[w])});const r=n.metaTokens,a=n.visitor||h,o=n.dots,l=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&ye.isSpecCompliantForm(t);if(!ye.isFunction(a))throw new TypeError("visitor must be a function");function f(x){if(x===null)return"";if(ye.isDate(x))return x.toISOString();if(ye.isBoolean(x))return x.toString();if(!d&&ye.isBlob(x))throw new Ot("Blob is not supported. Use a Buffer instead.");return ye.isArrayBuffer(x)||ye.isTypedArray(x)?d&&typeof Blob=="function"?new Blob([x]):Buffer.from(x):x}function h(x,w,C){let k=x;if(x&&!C&&typeof x=="object"){if(ye.endsWith(w,"{}"))w=r?w:w.slice(0,-2),x=JSON.stringify(x);else if(ye.isArray(x)&&eL(x)||(ye.isFileList(x)||ye.endsWith(w,"[]"))&&(k=ye.toArray(x)))return w=JN(w),k.forEach(function(T,_){!(ye.isUndefined(T)||T===null)&&t.append(l===!0?a1([w],_,o):l===null?w:w+"[]",f(T))}),!1}return lx(x)?!0:(t.append(a1(C,w,o),f(x)),!1)}const m=[],g=Object.assign(tL,{defaultVisitor:h,convertValue:f,isVisitable:lx});function b(x,w){if(!ye.isUndefined(x)){if(m.indexOf(x)!==-1)throw Error("Circular reference detected in "+w.join("."));m.push(x),ye.forEach(x,function(k,N){(!(ye.isUndefined(k)||k===null)&&a.call(t,k,ye.isString(N)?N.trim():N,w,g))===!0&&b(k,w?w.concat(N):[N])}),m.pop()}}if(!ye.isObject(e))throw new TypeError("data must be an object");return b(e),t}function o1(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function xb(e,t){this._pairs=[],e&&Oh(e,this,t)}const QN=xb.prototype;QN.append=function(t,n){this._pairs.push([t,n])};QN.toString=function(t){const n=t?function(r){return t.call(this,r,o1)}:o1;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};function nL(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function YN(e,t,n){if(!t)return e;const r=n&&n.encode||nL;ye.isFunction(n)&&(n={serialize:n});const a=n&&n.serialize;let o;if(a?o=a(t,n):o=ye.isURLSearchParams(t)?t.toString():new xb(t,n).toString(r),o){const l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class i1{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){ye.forEach(this.handlers,function(r){r!==null&&t(r)})}}const ZN={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},rL=typeof URLSearchParams<"u"?URLSearchParams:xb,sL=typeof FormData<"u"?FormData:null,aL=typeof Blob<"u"?Blob:null,oL={isBrowser:!0,classes:{URLSearchParams:rL,FormData:sL,Blob:aL},protocols:["http","https","file","blob","url","data"]},bb=typeof window<"u"&&typeof document<"u",cx=typeof navigator=="object"&&navigator||void 0,iL=bb&&(!cx||["ReactNative","NativeScript","NS"].indexOf(cx.product)<0),lL=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",cL=bb&&window.location.href||"http://localhost",uL=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:bb,hasStandardBrowserEnv:iL,hasStandardBrowserWebWorkerEnv:lL,navigator:cx,origin:cL},Symbol.toStringTag,{value:"Module"})),Tr={...uL,...oL};function dL(e,t){return Oh(e,new Tr.classes.URLSearchParams,{visitor:function(n,r,a,o){return Tr.isNode&&ye.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function fL(e){return ye.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function pL(e){const t={},n=Object.keys(e);let r;const a=n.length;let o;for(r=0;r=n.length;return l=!l&&ye.isArray(a)?a.length:l,d?(ye.hasOwnProp(a,l)?a[l]=[a[l],r]:a[l]=r,!u):((!a[l]||!ye.isObject(a[l]))&&(a[l]=[]),t(n,r,a[l],o)&&ye.isArray(a[l])&&(a[l]=pL(a[l])),!u)}if(ye.isFormData(e)&&ye.isFunction(e.entries)){const n={};return ye.forEachEntry(e,(r,a)=>{t(fL(r),a,n,0)}),n}return null}function hL(e,t,n){if(ye.isString(e))try{return(t||JSON.parse)(e),ye.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Cd={transitional:ZN,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",a=r.indexOf("application/json")>-1,o=ye.isObject(t);if(o&&ye.isHTMLForm(t)&&(t=new FormData(t)),ye.isFormData(t))return a?JSON.stringify(XN(t)):t;if(ye.isArrayBuffer(t)||ye.isBuffer(t)||ye.isStream(t)||ye.isFile(t)||ye.isBlob(t)||ye.isReadableStream(t))return t;if(ye.isArrayBufferView(t))return t.buffer;if(ye.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 dL(t,this.formSerializer).toString();if((u=ye.isFileList(t))||r.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return Oh(u?{"files[]":t}:t,d&&new d,this.formSerializer)}}return o||a?(n.setContentType("application/json",!1),hL(t)):t}],transformResponse:[function(t){const n=this.transitional||Cd.transitional,r=n&&n.forcedJSONParsing,a=this.responseType==="json";if(ye.isResponse(t)||ye.isReadableStream(t))return t;if(t&&ye.isString(t)&&(r&&!this.responseType||a)){const l=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(t,this.parseReviver)}catch(u){if(l)throw u.name==="SyntaxError"?Ot.from(u,Ot.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:Tr.classes.FormData,Blob:Tr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ye.forEach(["delete","get","head","post","put","patch"],e=>{Cd.headers[e]={}});const mL=ye.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"]),gL=e=>{const t={};let n,r,a;return e&&e.split(` +`).forEach(function(l){a=l.indexOf(":"),n=l.substring(0,a).trim().toLowerCase(),r=l.substring(a+1).trim(),!(!n||t[n]&&mL[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},l1=Symbol("internals");function Eu(e){return e&&String(e).trim().toLowerCase()}function Cp(e){return e===!1||e==null?e:ye.isArray(e)?e.map(Cp):String(e)}function vL(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 yL=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Tv(e,t,n,r,a){if(ye.isFunction(r))return r.call(this,t,n);if(a&&(t=n),!!ye.isString(t)){if(ye.isString(r))return t.indexOf(r)!==-1;if(ye.isRegExp(r))return r.test(t)}}function xL(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function bL(e,t){const n=ye.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(a,o,l){return this[r].call(this,t,a,o,l)},configurable:!0})})}let Xr=class{constructor(t){t&&this.set(t)}set(t,n,r){const a=this;function o(u,d,f){const h=Eu(d);if(!h)throw new Error("header name must be a non-empty string");const m=ye.findKey(a,h);(!m||a[m]===void 0||f===!0||f===void 0&&a[m]!==!1)&&(a[m||d]=Cp(u))}const l=(u,d)=>ye.forEach(u,(f,h)=>o(f,h,d));if(ye.isPlainObject(t)||t instanceof this.constructor)l(t,n);else if(ye.isString(t)&&(t=t.trim())&&!yL(t))l(gL(t),n);else if(ye.isObject(t)&&ye.isIterable(t)){let u={},d,f;for(const h of t){if(!ye.isArray(h))throw TypeError("Object iterator must return a key-value pair");u[f=h[0]]=(d=u[f])?ye.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=Eu(t),t){const r=ye.findKey(this,t);if(r){const a=this[r];if(!n)return a;if(n===!0)return vL(a);if(ye.isFunction(n))return n.call(this,a,r);if(ye.isRegExp(n))return n.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Eu(t),t){const r=ye.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Tv(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let a=!1;function o(l){if(l=Eu(l),l){const u=ye.findKey(r,l);u&&(!n||Tv(r,r[u],u,n))&&(delete r[u],a=!0)}}return ye.isArray(t)?t.forEach(o):o(t),a}clear(t){const n=Object.keys(this);let r=n.length,a=!1;for(;r--;){const o=n[r];(!t||Tv(this,this[o],o,t,!0))&&(delete this[o],a=!0)}return a}normalize(t){const n=this,r={};return ye.forEach(this,(a,o)=>{const l=ye.findKey(r,o);if(l){n[l]=Cp(a),delete n[o];return}const u=t?xL(o):String(o).trim();u!==o&&delete n[o],n[u]=Cp(a),r[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return ye.forEach(this,(r,a)=>{r!=null&&r!==!1&&(n[a]=t&&ye.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(a=>r.set(a)),r}static accessor(t){const r=(this[l1]=this[l1]={accessors:{}}).accessors,a=this.prototype;function o(l){const u=Eu(l);r[u]||(bL(a,l),r[u]=!0)}return ye.isArray(t)?t.forEach(o):o(t),this}};Xr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ye.reduceDescriptors(Xr.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});ye.freezeMethods(Xr);function Mv(e,t){const n=this||Cd,r=t||n,a=Xr.from(r.headers);let o=r.data;return ye.forEach(e,function(u){o=u.call(n,o,a.normalize(),t?t.status:void 0)}),a.normalize(),o}function eT(e){return!!(e&&e.__CANCEL__)}function jc(e,t,n){Ot.call(this,e??"canceled",Ot.ERR_CANCELED,t,n),this.name="CanceledError"}ye.inherits(jc,Ot,{__CANCEL__:!0});function tT(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Ot("Request failed with status code "+n.status,[Ot.ERR_BAD_REQUEST,Ot.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function wL(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function SL(e,t){e=e||10;const n=new Array(e),r=new Array(e);let a=0,o=0,l;return t=t!==void 0?t:1e3,function(d){const f=Date.now(),h=r[o];l||(l=f),n[a]=d,r[a]=f;let m=o,g=0;for(;m!==a;)g+=n[m++],m=m%e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),f-l{n=h,a=null,o&&(clearTimeout(o),o=null),e(...f)};return[(...f)=>{const h=Date.now(),m=h-n;m>=r?l(f,h):(a=f,o||(o=setTimeout(()=>{o=null,l(a)},r-m)))},()=>a&&l(a)]}const Hp=(e,t,n=3)=>{let r=0;const a=SL(50,250);return CL(o=>{const l=o.loaded,u=o.lengthComputable?o.total:void 0,d=l-r,f=a(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)},c1=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},u1=e=>(...t)=>ye.asap(()=>e(...t)),jL=Tr.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Tr.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Tr.origin),Tr.navigator&&/(msie|trident)/i.test(Tr.navigator.userAgent)):()=>!0,kL=Tr.hasStandardBrowserEnv?{write(e,t,n,r,a,o){const l=[e+"="+encodeURIComponent(t)];ye.isNumber(n)&&l.push("expires="+new Date(n).toGMTString()),ye.isString(r)&&l.push("path="+r),ye.isString(a)&&l.push("domain="+a),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 EL(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function NL(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function nT(e,t,n){let r=!EL(t);return e&&(r||n==!1)?NL(e,t):t}const d1=e=>e instanceof Xr?{...e}:e;function Ui(e,t){t=t||{};const n={};function r(f,h,m,g){return ye.isPlainObject(f)&&ye.isPlainObject(h)?ye.merge.call({caseless:g},f,h):ye.isPlainObject(h)?ye.merge({},h):ye.isArray(h)?h.slice():h}function a(f,h,m,g){if(ye.isUndefined(h)){if(!ye.isUndefined(f))return r(void 0,f,m,g)}else return r(f,h,m,g)}function o(f,h){if(!ye.isUndefined(h))return r(void 0,h)}function l(f,h){if(ye.isUndefined(h)){if(!ye.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)=>a(d1(f),d1(h),m,!0)};return ye.forEach(Object.keys({...e,...t}),function(h){const m=d[h]||a,g=m(e[h],t[h],h);ye.isUndefined(g)&&m!==u||(n[h]=g)}),n}const rT=e=>{const t=Ui({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:o,headers:l,auth:u}=t;if(t.headers=l=Xr.from(l),t.url=YN(nT(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),u&&l.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):""))),ye.isFormData(n)){if(Tr.hasStandardBrowserEnv||Tr.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if(ye.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(Tr.hasStandardBrowserEnv&&(r&&ye.isFunction(r)&&(r=r(t)),r||r!==!1&&jL(t.url))){const d=a&&o&&kL.read(o);d&&l.set(a,d)}return t},TL=typeof XMLHttpRequest<"u",ML=TL&&function(e){return new Promise(function(n,r){const a=rT(e);let o=a.data;const l=Xr.from(a.headers).normalize();let{responseType:u,onUploadProgress:d,onDownloadProgress:f}=a,h,m,g,b,x;function w(){b&&b(),x&&x(),a.cancelToken&&a.cancelToken.unsubscribe(h),a.signal&&a.signal.removeEventListener("abort",h)}let C=new XMLHttpRequest;C.open(a.method.toUpperCase(),a.url,!0),C.timeout=a.timeout;function k(){if(!C)return;const T=Xr.from("getAllResponseHeaders"in C&&C.getAllResponseHeaders()),P={data:!u||u==="text"||u==="json"?C.responseText:C.response,status:C.status,statusText:C.statusText,headers:T,config:e,request:C};tT(function(O){n(O),w()},function(O){r(O),w()},P),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 Ot("Request aborted",Ot.ECONNABORTED,e,C)),C=null)},C.onerror=function(_){const P=_&&_.message?_.message:"Network Error",M=new Ot(P,Ot.ERR_NETWORK,e,C);M.event=_||null,r(M),C=null},C.ontimeout=function(){let _=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const P=a.transitional||ZN;a.timeoutErrorMessage&&(_=a.timeoutErrorMessage),r(new Ot(_,P.clarifyTimeoutError?Ot.ETIMEDOUT:Ot.ECONNABORTED,e,C)),C=null},o===void 0&&l.setContentType(null),"setRequestHeader"in C&&ye.forEach(l.toJSON(),function(_,P){C.setRequestHeader(P,_)}),ye.isUndefined(a.withCredentials)||(C.withCredentials=!!a.withCredentials),u&&u!=="json"&&(C.responseType=a.responseType),f&&([g,x]=Hp(f,!0),C.addEventListener("progress",g)),d&&C.upload&&([m,b]=Hp(d),C.upload.addEventListener("progress",m),C.upload.addEventListener("loadend",b)),(a.cancelToken||a.signal)&&(h=T=>{C&&(r(!T||T.type?new jc(null,e,C):T),C.abort(),C=null)},a.cancelToken&&a.cancelToken.subscribe(h),a.signal&&(a.signal.aborted?h():a.signal.addEventListener("abort",h)));const N=wL(a.url);if(N&&Tr.protocols.indexOf(N)===-1){r(new Ot("Unsupported protocol "+N+":",Ot.ERR_BAD_REQUEST,e));return}C.send(o||null)})},_L=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,a;const o=function(f){if(!a){a=!0,u();const h=f instanceof Error?f:this.reason;r.abort(h instanceof Ot?h:new jc(h instanceof Error?h.message:h))}};let l=t&&setTimeout(()=>{l=null,o(new Ot(`timeout ${t} of ms exceeded`,Ot.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=()=>ye.asap(u),d}},PL=function*(e,t){let n=e.byteLength;if(n{const a=RL(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 a.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),a.return()}},{highWaterMark:2})},p1=64*1024,{isFunction:Uf}=ye,OL=(({Request:e,Response:t})=>({Request:e,Response:t}))(ye.global),{ReadableStream:h1,TextEncoder:m1}=ye.global,g1=(e,...t)=>{try{return!!e(...t)}catch{return!1}},AL=e=>{e=ye.merge.call({skipUndefined:!0},OL,e);const{fetch:t,Request:n,Response:r}=e,a=t?Uf(t):typeof fetch=="function",o=Uf(n),l=Uf(r);if(!a)return!1;const u=a&&Uf(h1),d=a&&(typeof m1=="function"?(x=>w=>x.encode(w))(new m1):async x=>new Uint8Array(await new n(x).arrayBuffer())),f=o&&u&&g1(()=>{let x=!1;const w=new n(Tr.origin,{body:new h1,method:"POST",get duplex(){return x=!0,"half"}}).headers.has("Content-Type");return x&&!w}),h=l&&u&&g1(()=>ye.isReadableStream(new r("").body)),m={stream:h&&(x=>x.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(x=>{!m[x]&&(m[x]=(w,C)=>{let k=w&&w[x];if(k)return k.call(w);throw new Ot(`Response type '${x}' is not supported`,Ot.ERR_NOT_SUPPORT,C)})});const g=async x=>{if(x==null)return 0;if(ye.isBlob(x))return x.size;if(ye.isSpecCompliantForm(x))return(await new n(Tr.origin,{method:"POST",body:x}).arrayBuffer()).byteLength;if(ye.isArrayBufferView(x)||ye.isArrayBuffer(x))return x.byteLength;if(ye.isURLSearchParams(x)&&(x=x+""),ye.isString(x))return(await d(x)).byteLength},b=async(x,w)=>{const C=ye.toFiniteNumber(x.getContentLength());return C??g(w)};return async x=>{let{url:w,method:C,data:k,signal:N,cancelToken:T,timeout:_,onDownloadProgress:P,onUploadProgress:M,responseType:O,headers:D,withCredentials:F="same-origin",fetchOptions:B}=rT(x),te=t||fetch;O=O?(O+"").toLowerCase():"text";let U=_L([N,T&&T.toAbortSignal()],_),ce=null;const q=U&&U.unsubscribe&&(()=>{U.unsubscribe()});let ne;try{if(M&&f&&C!=="get"&&C!=="head"&&(ne=await b(D,k))!==0){let A=new n(w,{method:"POST",body:k,duplex:"half"}),K;if(ye.isFormData(k)&&(K=A.headers.get("content-type"))&&D.setContentType(K),A.body){const[re,ee]=c1(ne,Hp(u1(M)));k=f1(A.body,p1,re,ee)}}ye.isString(F)||(F=F?"include":"omit");const Y=o&&"credentials"in n.prototype,se={...B,signal:U,method:C.toUpperCase(),headers:D.normalize().toJSON(),body:k,duplex:"half",credentials:Y?F:void 0};ce=o&&new n(w,se);let H=await(o?te(ce,B):te(w,se));const W=h&&(O==="stream"||O==="response");if(h&&(P||W&&q)){const A={};["status","statusText","headers"].forEach(ie=>{A[ie]=H[ie]});const K=ye.toFiniteNumber(H.headers.get("content-length")),[re,ee]=P&&c1(K,Hp(u1(P),!0))||[];H=new r(f1(H.body,p1,re,()=>{ee&&ee(),q&&q()}),A)}O=O||"text";let V=await m[ye.findKey(m,O)||"text"](H,x);return!W&&q&&q(),await new Promise((A,K)=>{tT(A,K,{data:V,headers:Xr.from(H.headers),status:H.status,statusText:H.statusText,config:x,request:ce})})}catch(Y){throw q&&q(),Y&&Y.name==="TypeError"&&/Load failed|fetch/i.test(Y.message)?Object.assign(new Ot("Network Error",Ot.ERR_NETWORK,x,ce),{cause:Y.cause||Y}):Ot.from(Y,Y&&Y.code,x,ce)}}},DL=new Map,sT=e=>{let t=e?e.env:{};const{fetch:n,Request:r,Response:a}=t,o=[r,a,n];let l=o.length,u=l,d,f,h=DL;for(;u--;)d=o[u],f=h.get(d),f===void 0&&h.set(d,f=u?new Map:AL(t)),h=f;return f};sT();const ux={http:X4,xhr:ML,fetch:{get:sT}};ye.forEach(ux,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const v1=e=>`- ${e}`,FL=e=>ye.isFunction(e)||e===null||e===!1,aT={getAdapter:(e,t)=>{e=ye.isArray(e)?e:[e];const{length:n}=e;let r,a;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(v1).join(` +`):" "+v1(l[0]):"as no adapter specified";throw new Ot("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return a},adapters:ux};function _v(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new jc(null,e)}function y1(e){return _v(e),e.headers=Xr.from(e.headers),e.data=Mv.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),aT.getAdapter(e.adapter||Cd.adapter,e)(e).then(function(r){return _v(e),r.data=Mv.call(e,e.transformResponse,r),r.headers=Xr.from(r.headers),r},function(r){return eT(r)||(_v(e),r&&r.response&&(r.response.data=Mv.call(e,e.transformResponse,r.response),r.response.headers=Xr.from(r.response.headers))),Promise.reject(r)})}const oT="1.12.2",Ah={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ah[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const x1={};Ah.transitional=function(t,n,r){function a(o,l){return"[Axios v"+oT+"] Transitional option '"+o+"'"+l+(r?". "+r:"")}return(o,l,u)=>{if(t===!1)throw new Ot(a(l," has been removed"+(n?" in "+n:"")),Ot.ERR_DEPRECATED);return n&&!x1[l]&&(x1[l]=!0,console.warn(a(l," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,l,u):!0}};Ah.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function LL(e,t,n){if(typeof e!="object")throw new Ot("options must be an object",Ot.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let a=r.length;for(;a-- >0;){const o=r[a],l=t[o];if(l){const u=e[o],d=u===void 0||l(u,o,e);if(d!==!0)throw new Ot("option "+o+" must be "+d,Ot.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Ot("Unknown option "+o,Ot.ERR_BAD_OPTION)}}const jp={assertOptions:LL,validators:Ah},ha=jp.validators;let Li=class{constructor(t){this.defaults=t||{},this.interceptors={request:new i1,response:new i1}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const o=a.stack?a.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=Ui(this.defaults,n);const{transitional:r,paramsSerializer:a,headers:o}=n;r!==void 0&&jp.assertOptions(r,{silentJSONParsing:ha.transitional(ha.boolean),forcedJSONParsing:ha.transitional(ha.boolean),clarifyTimeoutError:ha.transitional(ha.boolean)},!1),a!=null&&(ye.isFunction(a)?n.paramsSerializer={serialize:a}:jp.assertOptions(a,{encode:ha.function,serialize:ha.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),jp.assertOptions(n,{baseUrl:ha.spelling("baseURL"),withXsrfToken:ha.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=o&&ye.merge(o.common,o[n.method]);o&&ye.forEach(["delete","get","head","post","put","patch","common"],x=>{delete o[x]}),n.headers=Xr.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 x=[y1.bind(this),void 0];for(x.unshift(...u),x.push(...f),g=x.length,h=Promise.resolve(n);m{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](a);r._listeners=null}),this.promise.then=a=>{let o;const l=new Promise(u=>{r.subscribe(u),o=u}).then(a);return l.cancel=function(){r.unsubscribe(o)},l},t(function(o,l,u){r.reason||(r.reason=new jc(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 iT(function(a){t=a}),cancel:t}}};function BL(e){return function(n){return e.apply(null,n)}}function zL(e){return ye.isObject(e)&&e.isAxiosError===!0}const dx={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(dx).forEach(([e,t])=>{dx[t]=e});function lT(e){const t=new Li(e),n=$N(Li.prototype.request,t);return ye.extend(n,Li.prototype,t,{allOwnKeys:!0}),ye.extend(n,t,null,{allOwnKeys:!0}),n.create=function(a){return lT(Ui(e,a))},n}const dn=lT(Cd);dn.Axios=Li;dn.CanceledError=jc;dn.CancelToken=$L;dn.isCancel=eT;dn.VERSION=oT;dn.toFormData=Oh;dn.AxiosError=Ot;dn.Cancel=dn.CanceledError;dn.all=function(t){return Promise.all(t)};dn.spread=BL;dn.isAxiosError=zL;dn.mergeConfig=Ui;dn.AxiosHeaders=Xr;dn.formToJSON=e=>XN(ye.isHTMLForm(e)?new FormData(e):e);dn.getAdapter=aT.getAdapter;dn.HttpStatusCode=dx;dn.default=dn;const{Axios:$ce,AxiosError:UL,CanceledError:Bce,isCancel:zce,CancelToken:Uce,VERSION:Vce,all:qce,Cancel:Hce,isAxiosError:cT,spread:Wce,toFormData:Kce,AxiosHeaders:Gce,HttpStatusCode:Jce,formToJSON:Qce,getAdapter:Yce,mergeConfig:Zce}=dn;let Pv=!1;const uT=new ID({defaultOptions:{queries:{staleTime:1e3*60*5,retry(e,t){if(t instanceof UL){const n=t.response?.status;if(n&&n>=400&&n<500)return!1}return e>=3?(Pv===!1&&(Pv=!0,Q.error("The application is taking longer than expected to load, please try again in a few minutes.",{onClose:()=>{Pv=!1}})),!1):!0}}}}),wb="api";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.PROVIDER="provider",e))(Fn||{});const kp=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),e.provider&&localStorage.setItem("provider",e.provider)},fx=()=>{localStorage.removeItem("apiUrl"),localStorage.removeItem("token"),localStorage.removeItem("version"),localStorage.removeItem("facebookAppId"),localStorage.removeItem("facebookConfigId"),localStorage.removeItem("facebookUserToken"),localStorage.removeItem("clientName"),localStorage.removeItem("provider")},mr=e=>localStorage.getItem(e),vr=()=>localStorage.getItem("provider")==="go"?"go":wb,dT={dashboard:{api:!0,go:!0},settingsTemplates:{api:!0,go:!1},chat:{api:!0,go:!1},settings:{api:!0,go:!0},proxy:{api:!0,go:!0},webhook:{api:!0,go:!0},websocket:{api:!0,go:!1},rabbitmq:{api:!0,go:!1},sqs:{api:!0,go:!1},evoai:{api:!0,go:!1},n8n:{api:!0,go:!1},evolutionBot:{api:!0,go:!1},chatwoot:{api:!0,go:!1},typebot:{api:!0,go:!1},openai:{api:!0,go:!1},dify:{api:!0,go:!1},flowise:{api:!0,go:!1}},fT=(e,t)=>{const n=vr();return dT[e][n]},xn=({children:e,feature:t})=>{const n=mr(Fn.API_URL),r=mr(Fn.TOKEN),a=mr(Fn.VERSION);return(vr()==="go"?!!n&&!!r:!!n&&!!r&&!!a)?t&&!fT(t)?s.jsx(nx,{to:"/manager/"}):e:s.jsx(nx,{to:"/manager/login"})},VL=({children:e})=>{const t=mr(Fn.API_URL),n=mr(Fn.TOKEN),r=mr(Fn.VERSION);return(vr()==="go"?!!t&&!!n:!!t&&!!n&&!!r)?s.jsx(nx,{to:"/"}):e},qL=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r({classGroupId:e,validator:t}),pT=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Wp="-",b1=[],WL="arbitrary..",KL=e=>{const t=JL(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return GL(l);const u=l.split(Wp),d=u[0]===""&&u.length>1?1:0;return hT(u,d,t)},getConflictingClassGroupIds:(l,u)=>{if(u){const d=r[l],f=n[l];return d?f?qL(f,d):d:f||b1}return n[l]||b1}}},hT=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const a=e[t],o=n.nextPart.get(a);if(o){const f=hT(e,t+1,o);if(f)return f}const l=n.validators;if(l===null)return;const u=t===0?e.join(Wp):e.slice(t).join(Wp),d=l.length;for(let f=0;fe.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?WL+r:void 0})(),JL=e=>{const{theme:t,classGroups:n}=e;return QL(n,t)},QL=(e,t)=>{const n=pT();for(const r in e){const a=e[r];Sb(a,n,r,t)}return n},Sb=(e,t,n,r)=>{const a=e.length;for(let o=0;o{if(typeof e=="string"){ZL(e,t,n);return}if(typeof e=="function"){XL(e,t,n,r);return}e$(e,t,n,r)},ZL=(e,t,n)=>{const r=e===""?t:mT(t,e);r.classGroupId=n},XL=(e,t,n,r)=>{if(t$(e)){Sb(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(HL(n,e))},e$=(e,t,n,r)=>{const a=Object.entries(e),o=a.length;for(let l=0;l{let n=e;const r=t.split(Wp),a=r.length;for(let o=0;o"isThemeGetter"in e&&e.isThemeGetter===!0,n$=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const a=(o,l)=>{n[o]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(o){let l=n[o];if(l!==void 0)return l;if((l=r[o])!==void 0)return a(o,l),l},set(o,l){o in n?n[o]=l:a(o,l)}}},px="!",w1=":",r$=[],S1=(e,t,n,r,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:a}),s$=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=a=>{const o=[];let l=0,u=0,d=0,f;const h=a.length;for(let w=0;wd?f-d:void 0;return S1(o,b,g,x)};if(t){const a=t+w1,o=r;r=l=>l.startsWith(a)?o(l.slice(a.length)):S1(r$,!1,l,void 0,!0)}if(n){const a=r;r=o=>n({className:o,parseClassName:a})}return r},a$=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let a=[];for(let o=0;o0&&(a.sort(),r.push(...a),a=[]),r.push(l)):a.push(l)}return a.length>0&&(a.sort(),r.push(...a)),r}},o$=e=>({cache:n$(e.cacheSize),parseClassName:s$(e),sortModifiers:a$(e),...KL(e)}),i$=/\s+/,l$=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:o}=t,l=[],u=e.trim().split(i$);let d="";for(let f=u.length-1;f>=0;f-=1){const h=u[f],{isExternal:m,modifiers:g,hasImportantModifier:b,baseClassName:x,maybePostfixModifierPosition:w}=n(h);if(m){d=h+(d.length>0?" "+d:d);continue}let C=!!w,k=r(C?x.substring(0,w):x);if(!k){if(!C){d=h+(d.length>0?" "+d:d);continue}if(k=r(x),!k){d=h+(d.length>0?" "+d:d);continue}C=!1}const N=g.length===0?"":g.length===1?g[0]:o(g).join(":"),T=b?N+px:N,_=T+k;if(l.indexOf(_)>-1)continue;l.push(_);const P=a(k,C);for(let M=0;M0?" "+d:d)}return d},c$=(...e)=>{let t=0,n,r,a="";for(;t{if(typeof e=="string")return e;let t,n="";for(let r=0;r{let n,r,a,o;const l=d=>{const f=t.reduce((h,m)=>m(h),e());return n=o$(f),r=n.cache.get,a=n.cache.set,o=u,u(d)},u=d=>{const f=r(d);if(f)return f;const h=l$(d,n);return a(d,h),h};return o=l,(...d)=>o(c$(...d))},d$=[],sr=e=>{const t=n=>n[e]||d$;return t.isThemeGetter=!0,t},vT=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,yT=/^\((?:(\w[\w-]*):)?(.+)\)$/i,f$=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,p$=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,h$=/\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$/,m$=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,g$=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,v$=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Co=e=>f$.test(e),Lt=e=>!!e&&!Number.isNaN(Number(e)),jo=e=>!!e&&Number.isInteger(Number(e)),Rv=e=>e.endsWith("%")&&Lt(e.slice(0,-1)),Da=e=>p$.test(e),xT=()=>!0,y$=e=>h$.test(e)&&!m$.test(e),Cb=()=>!1,x$=e=>g$.test(e),b$=e=>v$.test(e),w$=e=>!We(e)&&!Ke(e),S$=e=>Qo(e,ST,Cb),We=e=>vT.test(e),Ni=e=>Qo(e,CT,y$),C1=e=>Qo(e,_$,Lt),C$=e=>Qo(e,kT,xT),j$=e=>Qo(e,jT,Cb),j1=e=>Qo(e,bT,Cb),k$=e=>Qo(e,wT,b$),Vf=e=>Qo(e,ET,x$),Ke=e=>yT.test(e),Nu=e=>Xi(e,CT),E$=e=>Xi(e,jT),k1=e=>Xi(e,bT),N$=e=>Xi(e,ST),T$=e=>Xi(e,wT),qf=e=>Xi(e,ET,!0),M$=e=>Xi(e,kT,!0),Qo=(e,t,n)=>{const r=vT.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Xi=(e,t,n=!1)=>{const r=yT.exec(e);return r?r[1]?t(r[1]):n:!1},bT=e=>e==="position"||e==="percentage",wT=e=>e==="image"||e==="url",ST=e=>e==="length"||e==="size"||e==="bg-size",CT=e=>e==="length",_$=e=>e==="number",jT=e=>e==="family-name",kT=e=>e==="number"||e==="weight",ET=e=>e==="shadow",P$=()=>{const e=sr("color"),t=sr("font"),n=sr("text"),r=sr("font-weight"),a=sr("tracking"),o=sr("leading"),l=sr("breakpoint"),u=sr("container"),d=sr("spacing"),f=sr("radius"),h=sr("shadow"),m=sr("inset-shadow"),g=sr("text-shadow"),b=sr("drop-shadow"),x=sr("blur"),w=sr("perspective"),C=sr("aspect"),k=sr("ease"),N=sr("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],P=()=>[..._(),Ke,We],M=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto","contain","none"],D=()=>[Ke,We,d],F=()=>[Co,"full","auto",...D()],B=()=>[jo,"none","subgrid",Ke,We],te=()=>["auto",{span:["full",jo,Ke,We]},jo,Ke,We],U=()=>[jo,"auto",Ke,We],ce=()=>["auto","min","max","fr",Ke,We],q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ne=()=>["start","end","center","stretch","center-safe","end-safe"],Y=()=>["auto",...D()],se=()=>[Co,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],H=()=>[Co,"screen","full","dvw","lvw","svw","min","max","fit",...D()],W=()=>[Co,"screen","full","lh","dvh","lvh","svh","min","max","fit",...D()],V=()=>[e,Ke,We],A=()=>[..._(),k1,j1,{position:[Ke,We]}],K=()=>["no-repeat",{repeat:["","x","y","space","round"]}],re=()=>["auto","cover","contain",N$,S$,{size:[Ke,We]}],ee=()=>[Rv,Nu,Ni],ie=()=>["","none","full",f,Ke,We],ue=()=>["",Lt,Nu,Ni],j=()=>["solid","dashed","dotted","double"],I=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],me=()=>[Lt,Rv,k1,j1],be=()=>["","none",x,Ke,We],st=()=>["none",Lt,Ke,We],Je=()=>["none",Lt,Ke,We],rt=()=>[Lt,Ke,We],Ht=()=>[Co,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Da],breakpoint:[Da],color:[xT],container:[Da],"drop-shadow":[Da],ease:["in","out","in-out"],font:[w$],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Da],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Da],shadow:[Da],spacing:["px",Lt],text:[Da],"text-shadow":[Da],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Co,We,Ke,C]}],container:["container"],columns:[{columns:[Lt,We,Ke,u]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:P()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:F()}],"inset-x":[{"inset-x":F()}],"inset-y":[{"inset-y":F()}],start:[{"inset-s":F(),start:F()}],end:[{"inset-e":F(),end:F()}],"inset-bs":[{"inset-bs":F()}],"inset-be":[{"inset-be":F()}],top:[{top:F()}],right:[{right:F()}],bottom:[{bottom:F()}],left:[{left:F()}],visibility:["visible","invisible","collapse"],z:[{z:[jo,"auto",Ke,We]}],basis:[{basis:[Co,"full","auto",u,...D()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Lt,Co,"auto","initial","none",We]}],grow:[{grow:["",Lt,Ke,We]}],shrink:[{shrink:["",Lt,Ke,We]}],order:[{order:[jo,"first","last","none",Ke,We]}],"grid-cols":[{"grid-cols":B()}],"col-start-end":[{col:te()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":B()}],"row-start-end":[{row:te()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ce()}],"auto-rows":[{"auto-rows":ce()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...ne(),"normal"]}],"justify-self":[{"justify-self":["auto",...ne()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...ne(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ne(),{baseline:["","last"]}]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...ne(),"baseline"]}],"place-self":[{"place-self":["auto",...ne()]}],p:[{p:D()}],px:[{px:D()}],py:[{py:D()}],ps:[{ps:D()}],pe:[{pe:D()}],pbs:[{pbs:D()}],pbe:[{pbe:D()}],pt:[{pt:D()}],pr:[{pr:D()}],pb:[{pb:D()}],pl:[{pl:D()}],m:[{m:Y()}],mx:[{mx:Y()}],my:[{my:Y()}],ms:[{ms:Y()}],me:[{me:Y()}],mbs:[{mbs:Y()}],mbe:[{mbe:Y()}],mt:[{mt:Y()}],mr:[{mr:Y()}],mb:[{mb:Y()}],ml:[{ml:Y()}],"space-x":[{"space-x":D()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":D()}],"space-y-reverse":["space-y-reverse"],size:[{size:se()}],"inline-size":[{inline:["auto",...H()]}],"min-inline-size":[{"min-inline":["auto",...H()]}],"max-inline-size":[{"max-inline":["none",...H()]}],"block-size":[{block:["auto",...W()]}],"min-block-size":[{"min-block":["auto",...W()]}],"max-block-size":[{"max-block":["none",...W()]}],w:[{w:[u,"screen",...se()]}],"min-w":[{"min-w":[u,"screen","none",...se()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...se()]}],h:[{h:["screen","lh",...se()]}],"min-h":[{"min-h":["screen","lh","none",...se()]}],"max-h":[{"max-h":["screen","lh",...se()]}],"font-size":[{text:["base",n,Nu,Ni]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,M$,C$]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Rv,We]}],"font-family":[{font:[E$,j$,t]}],"font-features":[{"font-features":[We]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,Ke,We]}],"line-clamp":[{"line-clamp":[Lt,"none",Ke,C1]}],leading:[{leading:[o,...D()]}],"list-image":[{"list-image":["none",Ke,We]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ke,We]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:V()}],"text-color":[{text:V()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...j(),"wavy"]}],"text-decoration-thickness":[{decoration:[Lt,"from-font","auto",Ke,Ni]}],"text-decoration-color":[{decoration:V()}],"underline-offset":[{"underline-offset":[Lt,"auto",Ke,We]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ke,We]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ke,We]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:A()}],"bg-repeat":[{bg:K()}],"bg-size":[{bg:re()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},jo,Ke,We],radial:["",Ke,We],conic:[jo,Ke,We]},T$,k$]}],"bg-color":[{bg:V()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:V()}],"gradient-via":[{via:V()}],"gradient-to":[{to:V()}],rounded:[{rounded:ie()}],"rounded-s":[{"rounded-s":ie()}],"rounded-e":[{"rounded-e":ie()}],"rounded-t":[{"rounded-t":ie()}],"rounded-r":[{"rounded-r":ie()}],"rounded-b":[{"rounded-b":ie()}],"rounded-l":[{"rounded-l":ie()}],"rounded-ss":[{"rounded-ss":ie()}],"rounded-se":[{"rounded-se":ie()}],"rounded-ee":[{"rounded-ee":ie()}],"rounded-es":[{"rounded-es":ie()}],"rounded-tl":[{"rounded-tl":ie()}],"rounded-tr":[{"rounded-tr":ie()}],"rounded-br":[{"rounded-br":ie()}],"rounded-bl":[{"rounded-bl":ie()}],"border-w":[{border:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-bs":[{"border-bs":ue()}],"border-w-be":[{"border-be":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...j(),"hidden","none"]}],"divide-style":[{divide:[...j(),"hidden","none"]}],"border-color":[{border:V()}],"border-color-x":[{"border-x":V()}],"border-color-y":[{"border-y":V()}],"border-color-s":[{"border-s":V()}],"border-color-e":[{"border-e":V()}],"border-color-bs":[{"border-bs":V()}],"border-color-be":[{"border-be":V()}],"border-color-t":[{"border-t":V()}],"border-color-r":[{"border-r":V()}],"border-color-b":[{"border-b":V()}],"border-color-l":[{"border-l":V()}],"divide-color":[{divide:V()}],"outline-style":[{outline:[...j(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Lt,Ke,We]}],"outline-w":[{outline:["",Lt,Nu,Ni]}],"outline-color":[{outline:V()}],shadow:[{shadow:["","none",h,qf,Vf]}],"shadow-color":[{shadow:V()}],"inset-shadow":[{"inset-shadow":["none",m,qf,Vf]}],"inset-shadow-color":[{"inset-shadow":V()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:V()}],"ring-offset-w":[{"ring-offset":[Lt,Ni]}],"ring-offset-color":[{"ring-offset":V()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":V()}],"text-shadow":[{"text-shadow":["none",g,qf,Vf]}],"text-shadow-color":[{"text-shadow":V()}],opacity:[{opacity:[Lt,Ke,We]}],"mix-blend":[{"mix-blend":[...I(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":I()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Lt]}],"mask-image-linear-from-pos":[{"mask-linear-from":me()}],"mask-image-linear-to-pos":[{"mask-linear-to":me()}],"mask-image-linear-from-color":[{"mask-linear-from":V()}],"mask-image-linear-to-color":[{"mask-linear-to":V()}],"mask-image-t-from-pos":[{"mask-t-from":me()}],"mask-image-t-to-pos":[{"mask-t-to":me()}],"mask-image-t-from-color":[{"mask-t-from":V()}],"mask-image-t-to-color":[{"mask-t-to":V()}],"mask-image-r-from-pos":[{"mask-r-from":me()}],"mask-image-r-to-pos":[{"mask-r-to":me()}],"mask-image-r-from-color":[{"mask-r-from":V()}],"mask-image-r-to-color":[{"mask-r-to":V()}],"mask-image-b-from-pos":[{"mask-b-from":me()}],"mask-image-b-to-pos":[{"mask-b-to":me()}],"mask-image-b-from-color":[{"mask-b-from":V()}],"mask-image-b-to-color":[{"mask-b-to":V()}],"mask-image-l-from-pos":[{"mask-l-from":me()}],"mask-image-l-to-pos":[{"mask-l-to":me()}],"mask-image-l-from-color":[{"mask-l-from":V()}],"mask-image-l-to-color":[{"mask-l-to":V()}],"mask-image-x-from-pos":[{"mask-x-from":me()}],"mask-image-x-to-pos":[{"mask-x-to":me()}],"mask-image-x-from-color":[{"mask-x-from":V()}],"mask-image-x-to-color":[{"mask-x-to":V()}],"mask-image-y-from-pos":[{"mask-y-from":me()}],"mask-image-y-to-pos":[{"mask-y-to":me()}],"mask-image-y-from-color":[{"mask-y-from":V()}],"mask-image-y-to-color":[{"mask-y-to":V()}],"mask-image-radial":[{"mask-radial":[Ke,We]}],"mask-image-radial-from-pos":[{"mask-radial-from":me()}],"mask-image-radial-to-pos":[{"mask-radial-to":me()}],"mask-image-radial-from-color":[{"mask-radial-from":V()}],"mask-image-radial-to-color":[{"mask-radial-to":V()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":_()}],"mask-image-conic-pos":[{"mask-conic":[Lt]}],"mask-image-conic-from-pos":[{"mask-conic-from":me()}],"mask-image-conic-to-pos":[{"mask-conic-to":me()}],"mask-image-conic-from-color":[{"mask-conic-from":V()}],"mask-image-conic-to-color":[{"mask-conic-to":V()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:A()}],"mask-repeat":[{mask:K()}],"mask-size":[{mask:re()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ke,We]}],filter:[{filter:["","none",Ke,We]}],blur:[{blur:be()}],brightness:[{brightness:[Lt,Ke,We]}],contrast:[{contrast:[Lt,Ke,We]}],"drop-shadow":[{"drop-shadow":["","none",b,qf,Vf]}],"drop-shadow-color":[{"drop-shadow":V()}],grayscale:[{grayscale:["",Lt,Ke,We]}],"hue-rotate":[{"hue-rotate":[Lt,Ke,We]}],invert:[{invert:["",Lt,Ke,We]}],saturate:[{saturate:[Lt,Ke,We]}],sepia:[{sepia:["",Lt,Ke,We]}],"backdrop-filter":[{"backdrop-filter":["","none",Ke,We]}],"backdrop-blur":[{"backdrop-blur":be()}],"backdrop-brightness":[{"backdrop-brightness":[Lt,Ke,We]}],"backdrop-contrast":[{"backdrop-contrast":[Lt,Ke,We]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Lt,Ke,We]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Lt,Ke,We]}],"backdrop-invert":[{"backdrop-invert":["",Lt,Ke,We]}],"backdrop-opacity":[{"backdrop-opacity":[Lt,Ke,We]}],"backdrop-saturate":[{"backdrop-saturate":[Lt,Ke,We]}],"backdrop-sepia":[{"backdrop-sepia":["",Lt,Ke,We]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":D()}],"border-spacing-x":[{"border-spacing-x":D()}],"border-spacing-y":[{"border-spacing-y":D()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ke,We]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Lt,"initial",Ke,We]}],ease:[{ease:["linear","initial",k,Ke,We]}],delay:[{delay:[Lt,Ke,We]}],animate:[{animate:["none",N,Ke,We]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Ke,We]}],"perspective-origin":[{"perspective-origin":P()}],rotate:[{rotate:st()}],"rotate-x":[{"rotate-x":st()}],"rotate-y":[{"rotate-y":st()}],"rotate-z":[{"rotate-z":st()}],scale:[{scale:Je()}],"scale-x":[{"scale-x":Je()}],"scale-y":[{"scale-y":Je()}],"scale-z":[{"scale-z":Je()}],"scale-3d":["scale-3d"],skew:[{skew:rt()}],"skew-x":[{"skew-x":rt()}],"skew-y":[{"skew-y":rt()}],transform:[{transform:[Ke,We,"","none","gpu","cpu"]}],"transform-origin":[{origin:P()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ht()}],"translate-x":[{"translate-x":Ht()}],"translate-y":[{"translate-y":Ht()}],"translate-z":[{"translate-z":Ht()}],"translate-none":["translate-none"],accent:[{accent:V()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:V()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ke,We]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mbs":[{"scroll-mbs":D()}],"scroll-mbe":[{"scroll-mbe":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pbs":[{"scroll-pbs":D()}],"scroll-pbe":[{"scroll-pbe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"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",Ke,We]}],fill:[{fill:["none",...V()]}],"stroke-w":[{stroke:[Lt,Nu,Ni,C1]}],stroke:[{stroke:["none",...V()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},R$=u$(P$);function Et(...e){return R$(Qs(e))}function I$(e,t=[]){let n=[];function r(o,l){const u=v.createContext(l);u.displayName=o+"Context";const d=n.length;n=[...n,l];const f=m=>{const{scope:g,children:b,...x}=m,w=g?.[e]?.[d]||u,C=v.useMemo(()=>x,Object.values(x));return s.jsx(w.Provider,{value:C,children:b})};f.displayName=o+"Provider";function h(m,g){const b=g?.[e]?.[d]||u,x=v.useContext(b);if(x)return x;if(l!==void 0)return l;throw new Error(`\`${m}\` must be used within \`${o}\``)}return[f,h]}const a=()=>{const o=n.map(l=>v.createContext(l));return function(u){const d=u?.[e]||o;return v.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return a.scopeName=e,[r,O$(a,...t)]}function O$(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(o){const l=r.reduce((u,{useScope:d,scopeName:f})=>{const m=d(o)[`__scope${f}`];return{...u,...m}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function ea(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>t.current?.(...n),[])}var er=globalThis?.document?v.useLayoutEffect:()=>{};function E1(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Yo(...e){return t=>{let n=!1;const r=e.map(a=>{const o=E1(a,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let a=0;a{let{children:o,...l}=r;NT(o)&&typeof Kp=="function"&&(o=Kp(o._payload));const u=v.Children.toArray(o),d=u.find(B$);if(d){const f=d.props.children,h=u.map(m=>m===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:m);return s.jsx(t,{...l,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...l,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function L$(e){const t=v.forwardRef((n,r)=>{let{children:a,...o}=n;if(NT(a)&&typeof Kp=="function"&&(a=Kp(a._payload)),v.isValidElement(a)){const l=U$(a),u=z$(o,a.props);return a.type!==v.Fragment&&(u.ref=r?Yo(r,l):l),v.cloneElement(a,u)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var $$=Symbol("radix.slottable");function B$(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===$$}function z$(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...u)=>{const d=o(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function U$(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 V$=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],jb=V$.reduce((e,t)=>{const n=F$(`Primitive.${t}`),r=v.forwardRef((a,o)=>{const{asChild:l,...u}=a,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...u,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Iv={exports:{}},Ov={};/** + * @license React + * use-sync-external-store-shim.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var N1;function q$(){if(N1)return Ov;N1=1;var e=yc();function t(m,g){return m===g&&(m!==0||1/m===1/g)||m!==m&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,a=e.useEffect,o=e.useLayoutEffect,l=e.useDebugValue;function u(m,g){var b=g(),x=r({inst:{value:b,getSnapshot:g}}),w=x[0].inst,C=x[1];return o(function(){w.value=b,w.getSnapshot=g,d(w)&&C({inst:w})},[m,b,g]),a(function(){return d(w)&&C({inst:w}),m(function(){d(w)&&C({inst:w})})},[m]),l(b),b}function d(m){var g=m.getSnapshot;m=m.value;try{var b=g();return!n(m,b)}catch{return!0}}function f(m,g){return g()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:u;return Ov.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,Ov}var T1;function H$(){return T1||(T1=1,Iv.exports=q$()),Iv.exports}var W$=H$();function K$(){return W$.useSyncExternalStore(G$,()=>!0,()=>!1)}function G$(){return()=>{}}var kb="Avatar",[J$]=I$(kb),[Q$,TT]=J$(kb),MT=v.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[a,o]=v.useState("idle");return s.jsx(Q$,{scope:n,imageLoadingStatus:a,onImageLoadingStatusChange:o,children:s.jsx(jb.span,{...r,ref:t})})});MT.displayName=kb;var _T="AvatarImage",PT=v.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:a=()=>{},...o}=e,l=TT(_T,n),u=Y$(r,o),d=ea(f=>{a(f),l.onImageLoadingStatusChange(f)});return er(()=>{u!=="idle"&&d(u)},[u,d]),u==="loaded"?s.jsx(jb.img,{...o,ref:t,src:r}):null});PT.displayName=_T;var RT="AvatarFallback",IT=v.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...a}=e,o=TT(RT,n),[l,u]=v.useState(r===void 0);return v.useEffect(()=>{if(r!==void 0){const d=window.setTimeout(()=>u(!0),r);return()=>window.clearTimeout(d)}},[r]),l&&o.imageLoadingStatus!=="loaded"?s.jsx(jb.span,{...a,ref:t}):null});IT.displayName=RT;function M1(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function Y$(e,{referrerPolicy:t,crossOrigin:n}){const r=K$(),a=v.useRef(null),o=r?(a.current||(a.current=new window.Image),a.current):null,[l,u]=v.useState(()=>M1(o,e));return er(()=>{u(M1(o,e))},[o,e]),er(()=>{const d=m=>()=>{u(m)};if(!o)return;const f=d("loaded"),h=d("error");return o.addEventListener("load",f),o.addEventListener("error",h),t&&(o.referrerPolicy=t),typeof n=="string"&&(o.crossOrigin=n),()=>{o.removeEventListener("load",f),o.removeEventListener("error",h)}},[o,n,t]),l}var Z$=MT,X$=PT,e3=IT;function Dh({className:e,...t}){return s.jsx(Z$,{"data-slot":"avatar",className:Et("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),...t})}function Fh({className:e,...t}){return s.jsx(X$,{"data-slot":"avatar-image",className:Et("aspect-square size-full",e),...t})}function OT({className:e,...t}){return s.jsx(e3,{"data-slot":"avatar-fallback",className:Et("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}var t3=Symbol.for("react.lazy"),Gp=Ko[" use ".trim().toString()];function n3(e){return typeof e=="object"&&e!==null&&"then"in e}function AT(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===t3&&"_payload"in e&&n3(e._payload)}function r3(e){const t=s3(e),n=v.forwardRef((r,a)=>{let{children:o,...l}=r;AT(o)&&typeof Gp=="function"&&(o=Gp(o._payload));const u=v.Children.toArray(o),d=u.find(o3);if(d){const f=d.props.children,h=u.map(m=>m===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:m);return s.jsx(t,{...l,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...l,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}var DT=r3("Slot");function s3(e){const t=v.forwardRef((n,r)=>{let{children:a,...o}=n;if(AT(a)&&typeof Gp=="function"&&(a=Gp(a._payload)),v.isValidElement(a)){const l=l3(a),u=i3(o,a.props);return a.type!==v.Fragment&&(u.ref=r?Yo(r,l):l),v.cloneElement(a,u)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var a3=Symbol("radix.slottable");function o3(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===a3}function i3(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...u)=>{const d=o(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function l3(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)}const _1=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,P1=Qs,Eb=(e,t)=>n=>{var r;if(t?.variants==null)return P1(e,n?.class,n?.className);const{variants:a,defaultVariants:o}=t,l=Object.keys(a).map(f=>{const h=n?.[f],m=o?.[f];if(h===null)return null;const g=_1(h)||_1(m);return a[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,...b}=h;return Object.entries(b).every(x=>{let[w,C]=x;return Array.isArray(C)?C.includes({...o,...u}[w]):{...o,...u}[w]===C})?[...f,m,g]:f},[]);return P1(e,l,d,n?.class,n?.className)};var c3=Eb("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}}),$=v.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},o)=>{const l=r?DT:"button";return s.jsx(l,{className:Et(c3({variant:t,size:n,className:e})),ref:o,...a})});$.displayName="Button";function Ge(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e?.(a),n===!1||!a.defaultPrevented)return t?.(a)}}function u3(e,t){const n=v.createContext(t),r=o=>{const{children:l,...u}=o,d=v.useMemo(()=>u,Object.values(u));return s.jsx(n.Provider,{value:d,children:l})};r.displayName=e+"Provider";function a(o){const l=v.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,a]}function sa(e,t=[]){let n=[];function r(o,l){const u=v.createContext(l),d=n.length;n=[...n,l];const f=m=>{const{scope:g,children:b,...x}=m,w=g?.[e]?.[d]||u,C=v.useMemo(()=>x,Object.values(x));return s.jsx(w.Provider,{value:C,children:b})};f.displayName=o+"Provider";function h(m,g){const b=g?.[e]?.[d]||u,x=v.useContext(b);if(x)return x;if(l!==void 0)return l;throw new Error(`\`${m}\` must be used within \`${o}\``)}return[f,h]}const a=()=>{const o=n.map(l=>v.createContext(l));return function(u){const d=u?.[e]||o;return v.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return a.scopeName=e,[r,d3(a,...t)]}function d3(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(o){const l=r.reduce((u,{useScope:d,scopeName:f})=>{const m=d(o)[`__scope${f}`];return{...u,...m}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var f3=Ko[" useId ".trim().toString()]||(()=>{}),p3=0;function Ys(e){const[t,n]=v.useState(f3());return er(()=>{n(r=>r??String(p3++))},[e]),e||(t?`radix-${t}`:"")}var h3=Ko[" useInsertionEffect ".trim().toString()]||er;function Ha({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,o,l]=m3({defaultProp:t,onChange:n}),u=e!==void 0,d=u?e:a;{const h=v.useRef(e!==void 0);v.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=v.useCallback(h=>{if(u){const m=g3(h)?h(e):h;m!==e&&l.current?.(m)}else o(h)},[u,e,o,l]);return[d,f]}function m3({defaultProp:e,onChange:t}){const[n,r]=v.useState(e),a=v.useRef(n),o=v.useRef(t);return h3(()=>{o.current=t},[t]),v.useEffect(()=>{a.current!==n&&(o.current?.(n),a.current=n)},[n,a]),[n,r,o]}function g3(e){return typeof e=="function"}function lc(e){const t=v3(e),n=v.forwardRef((r,a)=>{const{children:o,...l}=r,u=v.Children.toArray(o),d=u.find(x3);if(d){const f=d.props.children,h=u.map(m=>m===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:m);return s.jsx(t,{...l,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...l,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function v3(e){const t=v.forwardRef((n,r)=>{const{children:a,...o}=n;if(v.isValidElement(a)){const l=w3(a),u=b3(o,a.props);return a.type!==v.Fragment&&(u.ref=r?Yo(r,l):l),v.cloneElement(a,u)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var y3=Symbol("radix.slottable");function x3(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===y3}function b3(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...u)=>{const d=o(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function w3(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 S3=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],wt=S3.reduce((e,t)=>{const n=lc(`Primitive.${t}`),r=v.forwardRef((a,o)=>{const{asChild:l,...u}=a,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...u,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function FT(e,t){e&&bc.flushSync(()=>e.dispatchEvent(t))}function C3(e,t=globalThis?.document){const n=ea(e);v.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var j3="DismissableLayer",hx="dismissableLayer.update",k3="dismissableLayer.pointerDownOutside",E3="dismissableLayer.focusOutside",R1,LT=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Lh=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:l,onDismiss:u,...d}=e,f=v.useContext(LT),[h,m]=v.useState(null),g=h?.ownerDocument??globalThis?.document,[,b]=v.useState({}),x=nn(t,O=>m(O)),w=Array.from(f.layers),[C]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),k=w.indexOf(C),N=h?w.indexOf(h):-1,T=f.layersWithOutsidePointerEventsDisabled.size>0,_=N>=k,P=M3(O=>{const D=O.target,F=[...f.branches].some(B=>B.contains(D));!_||F||(a?.(O),l?.(O),O.defaultPrevented||u?.())},g),M=_3(O=>{const D=O.target;[...f.branches].some(B=>B.contains(D))||(o?.(O),l?.(O),O.defaultPrevented||u?.())},g);return C3(O=>{N===f.layers.size-1&&(r?.(O),!O.defaultPrevented&&u&&(O.preventDefault(),u()))},g),v.useEffect(()=>{if(h)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(R1=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),I1(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=R1)}},[h,g,n,f]),v.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),I1())},[h,f]),v.useEffect(()=>{const O=()=>b({});return document.addEventListener(hx,O),()=>document.removeEventListener(hx,O)},[]),s.jsx(wt.div,{...d,ref:x,style:{pointerEvents:T?_?"auto":"none":void 0,...e.style},onFocusCapture:Ge(e.onFocusCapture,M.onFocusCapture),onBlurCapture:Ge(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:Ge(e.onPointerDownCapture,P.onPointerDownCapture)})});Lh.displayName=j3;var N3="DismissableLayerBranch",T3=v.forwardRef((e,t)=>{const n=v.useContext(LT),r=v.useRef(null),a=nn(t,r);return v.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),s.jsx(wt.div,{...e,ref:a})});T3.displayName=N3;function M3(e,t=globalThis?.document){const n=ea(e),r=v.useRef(!1),a=v.useRef(()=>{});return v.useEffect(()=>{const o=u=>{if(u.target&&!r.current){let d=function(){$T(k3,n,f,{discrete:!0})};const f={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=d,t.addEventListener("click",a.current,{once:!0})):d()}else t.removeEventListener("click",a.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",o),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function _3(e,t=globalThis?.document){const n=ea(e),r=v.useRef(!1);return v.useEffect(()=>{const a=o=>{o.target&&!r.current&&$T(E3,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function I1(){const e=new CustomEvent(hx);document.dispatchEvent(e)}function $T(e,t,n,{discrete:r}){const a=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?FT(a,o):a.dispatchEvent(o)}var Av="focusScope.autoFocusOnMount",Dv="focusScope.autoFocusOnUnmount",O1={bubbles:!1,cancelable:!0},P3="FocusScope",$h=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...l}=e,[u,d]=v.useState(null),f=ea(a),h=ea(o),m=v.useRef(null),g=nn(t,w=>d(w)),b=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let w=function(T){if(b.paused||!u)return;const _=T.target;u.contains(_)?m.current=_:Mo(m.current,{select:!0})},C=function(T){if(b.paused||!u)return;const _=T.relatedTarget;_!==null&&(u.contains(_)||Mo(m.current,{select:!0}))},k=function(T){if(document.activeElement===document.body)for(const P of T)P.removedNodes.length>0&&Mo(u)};document.addEventListener("focusin",w),document.addEventListener("focusout",C);const N=new MutationObserver(k);return u&&N.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",C),N.disconnect()}}},[r,u,b.paused]),v.useEffect(()=>{if(u){D1.add(b);const w=document.activeElement;if(!u.contains(w)){const k=new CustomEvent(Av,O1);u.addEventListener(Av,f),u.dispatchEvent(k),k.defaultPrevented||(R3(F3(BT(u)),{select:!0}),document.activeElement===w&&Mo(u))}return()=>{u.removeEventListener(Av,f),setTimeout(()=>{const k=new CustomEvent(Dv,O1);u.addEventListener(Dv,h),u.dispatchEvent(k),k.defaultPrevented||Mo(w??document.body,{select:!0}),u.removeEventListener(Dv,h),D1.remove(b)},0)}}},[u,f,h,b]);const x=v.useCallback(w=>{if(!n&&!r||b.paused)return;const C=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,k=document.activeElement;if(C&&k){const N=w.currentTarget,[T,_]=I3(N);T&&_?!w.shiftKey&&k===_?(w.preventDefault(),n&&Mo(T,{select:!0})):w.shiftKey&&k===T&&(w.preventDefault(),n&&Mo(_,{select:!0})):k===N&&w.preventDefault()}},[n,r,b.paused]);return s.jsx(wt.div,{tabIndex:-1,...l,ref:g,onKeyDown:x})});$h.displayName=P3;function R3(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Mo(r,{select:t}),document.activeElement!==n)return}function I3(e){const t=BT(e),n=A1(t,e),r=A1(t.reverse(),e);return[n,r]}function BT(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function A1(e,t){for(const n of e)if(!O3(n,{upTo:t}))return n}function O3(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 A3(e){return e instanceof HTMLInputElement&&"select"in e}function Mo(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&A3(e)&&t&&e.select()}}var D1=D3();function D3(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=F1(e,t),e.unshift(t)},remove(t){e=F1(e,t),e[0]?.resume()}}}function F1(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function F3(e){return e.filter(t=>t.tagName!=="A")}var L3="Portal",Bh=v.forwardRef((e,t)=>{const{container:n,...r}=e,[a,o]=v.useState(!1);er(()=>o(!0),[]);const l=n||a&&globalThis?.document?.body;return l?pN.createPortal(s.jsx(wt.div,{...r,ref:t}),l):null});Bh.displayName=L3;function $3(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var aa=e=>{const{present:t,children:n}=e,r=B3(t),a=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=nn(r.ref,z3(a));return typeof n=="function"||r.isPresent?v.cloneElement(a,{ref:o}):null};aa.displayName="Presence";function B3(e){const[t,n]=v.useState(),r=v.useRef(null),a=v.useRef(e),o=v.useRef("none"),l=e?"mounted":"unmounted",[u,d]=$3(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const f=Hf(r.current);o.current=u==="mounted"?f:"none"},[u]),er(()=>{const f=r.current,h=a.current;if(h!==e){const g=o.current,b=Hf(f);e?d("MOUNT"):b==="none"||f?.display==="none"?d("UNMOUNT"):d(h&&g!==b?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,d]),er(()=>{if(t){let f;const h=t.ownerDocument.defaultView??window,m=b=>{const w=Hf(r.current).includes(CSS.escape(b.animationName));if(b.target===t&&w&&(d("ANIMATION_END"),!a.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",f=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},g=b=>{b.target===t&&(o.current=Hf(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:v.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function Hf(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 Fv=0;function Nb(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??L1()),document.body.insertAdjacentElement("beforeend",e[1]??L1()),Fv++,()=>{Fv===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Fv--}},[])}function L1(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ga=function(){return ga=Object.assign||function(t){for(var n,r=1,a=arguments.length;r"u")return sB;var t=aB(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])}},iB=qT(),Yl="data-scroll-locked",lB=function(e,t,n,r){var a=e.left,o=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),` + .`.concat(V3,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(u,"px ").concat(r,`; + } + body[`).concat(Yl,`] { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(a,`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(Ep,` { + right: `).concat(u,"px ").concat(r,`; + } + + .`).concat(Np,` { + margin-right: `).concat(u,"px ").concat(r,`; + } + + .`).concat(Ep," .").concat(Ep,` { + right: 0 `).concat(r,`; + } + + .`).concat(Np," .").concat(Np,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(Yl,`] { + `).concat(q3,": ").concat(u,`px; + } +`)},B1=function(){var e=parseInt(document.body.getAttribute(Yl)||"0",10);return isFinite(e)?e:0},cB=function(){v.useEffect(function(){return document.body.setAttribute(Yl,(B1()+1).toString()),function(){var e=B1()-1;e<=0?document.body.removeAttribute(Yl):document.body.setAttribute(Yl,e.toString())}},[])},uB=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;cB();var o=v.useMemo(function(){return oB(a)},[a]);return v.createElement(iB,{styles:lB(o,!t,a,n?"":"!important")})},mx=!1;if(typeof window<"u")try{var Wf=Object.defineProperty({},"passive",{get:function(){return mx=!0,!0}});window.addEventListener("test",Wf,Wf),window.removeEventListener("test",Wf,Wf)}catch{mx=!1}var Al=mx?{passive:!1}:!1,dB=function(e){return e.tagName==="TEXTAREA"},HT=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!dB(e)&&n[t]==="visible")},fB=function(e){return HT(e,"overflowY")},pB=function(e){return HT(e,"overflowX")},z1=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=WT(e,r);if(a){var o=KT(e,r),l=o[1],u=o[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},hB=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},mB=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},WT=function(e,t){return e==="v"?fB(t):pB(t)},KT=function(e,t){return e==="v"?hB(t):mB(t)},gB=function(e,t){return e==="h"&&t==="rtl"?-1:1},vB=function(e,t,n,r,a){var o=gB(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{if(!u)break;var b=KT(e,u),x=b[0],w=b[1],C=b[2],k=w-C-o*x;(x||k)&&WT(e,u)&&(m+=k,g+=x);var N=u.parentNode;u=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}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},Kf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},U1=function(e){return[e.deltaX,e.deltaY]},V1=function(e){return e&&"current"in e?e.current:e},yB=function(e,t){return e[0]===t[0]&&e[1]===t[1]},xB=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},bB=0,Dl=[];function wB(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),a=v.useState(bB++)[0],o=v.useState(qT)[0],l=v.useRef(e);v.useEffect(function(){l.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var w=U3([e.lockRef.current],(e.shards||[]).map(V1),!0).filter(Boolean);return w.forEach(function(C){return C.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),w.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var u=v.useCallback(function(w,C){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!l.current.allowPinchZoom;var k=Kf(w),N=n.current,T="deltaX"in w?w.deltaX:N[0]-k[0],_="deltaY"in w?w.deltaY:N[1]-k[1],P,M=w.target,O=Math.abs(T)>Math.abs(_)?"h":"v";if("touches"in w&&O==="h"&&M.type==="range")return!1;var D=window.getSelection(),F=D&&D.anchorNode,B=F?F===M||F.contains(M):!1;if(B)return!1;var te=z1(O,M);if(!te)return!0;if(te?P=O:(P=O==="v"?"h":"v",te=z1(O,M)),!te)return!1;if(!r.current&&"changedTouches"in w&&(T||_)&&(r.current=P),!P)return!0;var U=r.current||P;return vB(U,C,w,U==="h"?T:_)},[]),d=v.useCallback(function(w){var C=w;if(!(!Dl.length||Dl[Dl.length-1]!==o)){var k="deltaY"in C?U1(C):Kf(C),N=t.current.filter(function(P){return P.name===C.type&&(P.target===C.target||C.target===P.shadowParent)&&yB(P.delta,k)})[0];if(N&&N.should){C.cancelable&&C.preventDefault();return}if(!N){var T=(l.current.shards||[]).map(V1).filter(Boolean).filter(function(P){return P.contains(C.target)}),_=T.length>0?u(C,T[0]):!l.current.noIsolation;_&&C.cancelable&&C.preventDefault()}}},[]),f=v.useCallback(function(w,C,k,N){var T={name:w,delta:C,target:k,should:N,shadowParent:SB(k)};t.current.push(T),setTimeout(function(){t.current=t.current.filter(function(_){return _!==T})},1)},[]),h=v.useCallback(function(w){n.current=Kf(w),r.current=void 0},[]),m=v.useCallback(function(w){f(w.type,U1(w),w.target,u(w,e.lockRef.current))},[]),g=v.useCallback(function(w){f(w.type,Kf(w),w.target,u(w,e.lockRef.current))},[]);v.useEffect(function(){return Dl.push(o),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:g}),document.addEventListener("wheel",d,Al),document.addEventListener("touchmove",d,Al),document.addEventListener("touchstart",h,Al),function(){Dl=Dl.filter(function(w){return w!==o}),document.removeEventListener("wheel",d,Al),document.removeEventListener("touchmove",d,Al),document.removeEventListener("touchstart",h,Al)}},[]);var b=e.removeScrollBar,x=e.inert;return v.createElement(v.Fragment,null,x?v.createElement(o,{styles:xB(a)}):null,b?v.createElement(uB,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function SB(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const CB=Y3(VT,wB);var Uh=v.forwardRef(function(e,t){return v.createElement(zh,ga({},e,{ref:t,sideCar:CB}))});Uh.classNames=zh.classNames;var jB=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Fl=new WeakMap,Gf=new WeakMap,Jf={},zv=0,GT=function(e){return e&&(e.host||GT(e.parentNode))},kB=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=GT(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})},EB=function(e,t,n,r){var a=kB(t,Array.isArray(e)?e:[e]);Jf[n]||(Jf[n]=new WeakMap);var o=Jf[n],l=[],u=new Set,d=new Set(a),f=function(m){!m||u.has(m)||(u.add(m),f(m.parentNode))};a.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 b=g.getAttribute(r),x=b!==null&&b!=="false",w=(Fl.get(g)||0)+1,C=(o.get(g)||0)+1;Fl.set(g,w),o.set(g,C),l.push(g),w===1&&x&&Gf.set(g,!0),C===1&&g.setAttribute(n,"true"),x||g.setAttribute(r,"true")}catch(k){console.error("aria-hidden: cannot operate on ",g,k)}})};return h(t),u.clear(),zv++,function(){l.forEach(function(m){var g=Fl.get(m)-1,b=o.get(m)-1;Fl.set(m,g),o.set(m,b),g||(Gf.has(m)||m.removeAttribute(r),Gf.delete(m)),b||m.removeAttribute(n)}),zv--,zv||(Fl=new WeakMap,Fl=new WeakMap,Gf=new WeakMap,Jf={})}},Tb=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=jB(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live]"))),EB(r,a,n,"aria-hidden")):function(){return null}},Vh="Dialog",[JT]=sa(Vh),[NB,oa]=JT(Vh),QT=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:l=!0}=e,u=v.useRef(null),d=v.useRef(null),[f,h]=Ha({prop:r,defaultProp:a??!1,onChange:o,caller:Vh});return s.jsx(NB,{scope:t,triggerRef:u,contentRef:d,contentId:Ys(),titleId:Ys(),descriptionId:Ys(),open:f,onOpenChange:h,onOpenToggle:v.useCallback(()=>h(m=>!m),[h]),modal:l,children:n})};QT.displayName=Vh;var YT="DialogTrigger",ZT=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=oa(YT,n),o=nn(t,a.triggerRef);return s.jsx(wt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Pb(a.open),...r,ref:o,onClick:Ge(e.onClick,a.onOpenToggle)})});ZT.displayName=YT;var Mb="DialogPortal",[TB,XT]=JT(Mb,{forceMount:void 0}),eM=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,o=oa(Mb,t);return s.jsx(TB,{scope:t,forceMount:n,children:v.Children.map(r,l=>s.jsx(aa,{present:n||o.open,children:s.jsx(Bh,{asChild:!0,container:a,children:l})}))})};eM.displayName=Mb;var Jp="DialogOverlay",tM=v.forwardRef((e,t)=>{const n=XT(Jp,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,o=oa(Jp,e.__scopeDialog);return o.modal?s.jsx(aa,{present:r||o.open,children:s.jsx(_B,{...a,ref:t})}):null});tM.displayName=Jp;var MB=lc("DialogOverlay.RemoveScroll"),_B=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=oa(Jp,n);return s.jsx(Uh,{as:MB,allowPinchZoom:!0,shards:[a.contentRef],children:s.jsx(wt.div,{"data-state":Pb(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Vi="DialogContent",nM=v.forwardRef((e,t)=>{const n=XT(Vi,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,o=oa(Vi,e.__scopeDialog);return s.jsx(aa,{present:r||o.open,children:o.modal?s.jsx(PB,{...a,ref:t}):s.jsx(RB,{...a,ref:t})})});nM.displayName=Vi;var PB=v.forwardRef((e,t)=>{const n=oa(Vi,e.__scopeDialog),r=v.useRef(null),a=nn(t,n.contentRef,r);return v.useEffect(()=>{const o=r.current;if(o)return Tb(o)},[]),s.jsx(rM,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ge(e.onCloseAutoFocus,o=>{o.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Ge(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&o.preventDefault()}),onFocusOutside:Ge(e.onFocusOutside,o=>o.preventDefault())})}),RB=v.forwardRef((e,t)=>{const n=oa(Vi,e.__scopeDialog),r=v.useRef(!1),a=v.useRef(!1);return s.jsx(rM,{...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,a.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=o.target;n.triggerRef.current?.contains(l)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&a.current&&o.preventDefault()}})}),rM=v.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:o,...l}=e,u=oa(Vi,n),d=v.useRef(null),f=nn(t,d);return Nb(),s.jsxs(s.Fragment,{children:[s.jsx($h,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:o,children:s.jsx(Lh,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":Pb(u.open),...l,ref:f,onDismiss:()=>u.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(IB,{titleId:u.titleId}),s.jsx(AB,{contentRef:d,descriptionId:u.descriptionId})]})]})}),_b="DialogTitle",sM=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=oa(_b,n);return s.jsx(wt.h2,{id:a.titleId,...r,ref:t})});sM.displayName=_b;var aM="DialogDescription",oM=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=oa(aM,n);return s.jsx(wt.p,{id:a.descriptionId,...r,ref:t})});oM.displayName=aM;var iM="DialogClose",lM=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=oa(iM,n);return s.jsx(wt.button,{type:"button",...r,ref:t,onClick:Ge(e.onClick,()=>a.onOpenChange(!1))})});lM.displayName=iM;function Pb(e){return e?"open":"closed"}var cM="DialogTitleWarning",[Xce,uM]=u3(cM,{contentName:Vi,titleName:_b,docsSlug:"dialog"}),IB=({titleId:e})=>{const t=uM(cM),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},OB="DialogDescriptionWarning",AB=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${uM(OB).contentName}}.`;return v.useEffect(()=>{const a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},DB=QT,FB=ZT,LB=eM,$B=tM,BB=nM,zB=sM,UB=oM,VB=lM;/** + * @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=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),dM=(...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 HB={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 WB=v.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:o,iconNode:l,...u},d)=>v.createElement("svg",{ref:d,...HB,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:dM("lucide",a),...u},[...l.map(([f,h])=>v.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 Be=(e,t)=>{const n=v.forwardRef(({className:r,...a},o)=>v.createElement(WB,{ref:o,iconNode:t,className:dM(`lucide-${qB(e)}`,r),...a}));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 q1=Be("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 KB=Be("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** + * @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=Be("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 GB=Be("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 JB=Be("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 Ib=Be("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 QB=Be("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 YB=Be("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 fM=Be("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** + * @license lucide-react v0.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=Be("CircleCheckBig",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** + * @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 H1=Be("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** + * @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=Be("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 el=Be("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 ez=Be("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 tz=Be("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** + * @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 nz=Be("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 Zo=Be("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 pM=Be("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 tl=Be("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 Xo=Be("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 rz=Be("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 sz=Be("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 az=Be("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 oz=Be("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 Ob=Be("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 iz=Be("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 lz=Be("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/** + * @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 cz=Be("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 uz=Be("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 dz=Be("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 fz=Be("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 pz=Be("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 hz=Be("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/** + * @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 mz=Be("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 gz=Be("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** + * @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 gx=Be("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 vz=Be("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 nl=Be("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 qh=Be("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** + * @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 yz=Be("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 hM=Be("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** + * @license lucide-react v0.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 xz=Be("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 bz=Be("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 cc=Be("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 rl=Be("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** + * @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=Be("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 wz=Be("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 sl=Be("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 Sz=Be("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** + * @license lucide-react v0.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 al=Be("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 $r=Be("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 Cz=Be("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);/** + * @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 Qp=Be("QrCode",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]);/** + * @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 jz=Be("RadioTower",[["path",{d:"M4.9 16.1C1 12.2 1 5.8 4.9 1.9",key:"s0qx1y"}],["path",{d:"M7.8 4.7a6.14 6.14 0 0 0-.8 7.5",key:"1idnkw"}],["circle",{cx:"12",cy:"9",r:"2",key:"1092wv"}],["path",{d:"M16.2 4.8c2 2 2.26 5.11.8 7.47",key:"ojru2q"}],["path",{d:"M19.1 1.9a9.96 9.96 0 0 1 0 14.1",key:"rhi7fg"}],["path",{d:"M9.5 18h5",key:"mfy3pd"}],["path",{d:"m8 22 4-11 4 11",key:"25yftu"}]]);/** + * @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 uc=Be("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 ol=Be("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 gM=Be("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + * @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 Yp=Be("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/** + * @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 kz=Be("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + * @license lucide-react v0.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 Ez=Be("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 Nz=Be("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/** + * @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=Be("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 Tz=Be("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 Mz=Be("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 _z=Be("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 Ab=Be("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** + * @license lucide-react v0.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 Pz=Be("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 Zp=Be("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 Rz=Be("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 W1=Be("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** + * @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 Iz=Be("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 Hh=Be("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 Oz=Be("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"}]]),Db="-";function Az(e){const t=Fz(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function a(l){const u=l.split(Db);return u[0]===""&&u.length!==1&&u.shift(),yM(u,t)||Dz(l)}function o(l,u){const d=n[l]||[];return u&&r[l]?[...d,...r[l]]:d}return{getClassGroupId:a,getConflictingClassGroupIds:o}}function yM(e,t){if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?yM(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const o=e.join(Db);return t.validators.find(({validator:l})=>l(o))?.classGroupId}const K1=/^\[(.+)\]$/;function Dz(e){if(K1.test(e)){const t=K1.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function Fz(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return $z(Object.entries(e.classGroups),n).forEach(([o,l])=>{vx(l,r,o,t)}),r}function vx(e,t,n,r){e.forEach(a=>{if(typeof a=="string"){const o=a===""?t:G1(t,a);o.classGroupId=n;return}if(typeof a=="function"){if(Lz(a)){vx(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([o,l])=>{vx(l,G1(t,o),n,r)})})}function G1(e,t){let n=e;return t.split(Db).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function Lz(e){return e.isThemeGetter}function $z(e,t){return t?e.map(([n,r])=>{const a=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,a]}):e}function Bz(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function a(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 a(o,l),l},set(o,l){n.has(o)?n.set(o,l):a(o,l)}}}const xM="!";function zz(e){const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,a=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:b,baseClassName:x,maybePostfixModifierPosition:w}}return n?function(d){return n({className:d,parseClassName:l})}:l}function Uz(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 Vz(e){return{cache:Bz(e.cacheSize),parseClassName:zz(e),...Az(e)}}const qz=/\s+/;function Hz(e,t){const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,o=new Set;return e.trim().split(qz).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 b=Uz(u).join(":");return{isTailwindClass:!0,modifierId:d?b+xM:b,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),a(d,f).forEach(m=>o.add(u+m)),!0)}).reverse().map(l=>l.originalClassName).join(" ")}function Wz(){let e=0,t,n,r="";for(;em(h),e());return n=Vz(f),r=n.cache.get,a=n.cache.set,o=u,u(d)}function u(d){const f=r(d);if(f)return f;const h=Hz(d,n);return a(d,h),h}return function(){return o(Wz.apply(null,arguments))}}function kn(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const wM=/^\[(?:([a-z-]+):)?(.+)\]$/i,Gz=/^\d+\/\d+$/,Jz=new Set(["px","full","screen"]),Qz=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Yz=/\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$/,Zz=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Xz=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,e5=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Fa(e){return Oi(e)||Jz.has(e)||Gz.test(e)}function ko(e){return kc(e,"length",l5)}function Oi(e){return!!e&&!Number.isNaN(Number(e))}function Qf(e){return kc(e,"number",Oi)}function Tu(e){return!!e&&Number.isInteger(Number(e))}function t5(e){return e.endsWith("%")&&Oi(e.slice(0,-1))}function At(e){return wM.test(e)}function Eo(e){return Qz.test(e)}const n5=new Set(["length","size","percentage"]);function r5(e){return kc(e,n5,SM)}function s5(e){return kc(e,"position",SM)}const a5=new Set(["image","url"]);function o5(e){return kc(e,a5,u5)}function i5(e){return kc(e,"",c5)}function Mu(){return!0}function kc(e,t,n){const r=wM.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function l5(e){return Yz.test(e)&&!Zz.test(e)}function SM(){return!1}function c5(e){return Xz.test(e)}function u5(e){return e5.test(e)}function d5(){const e=kn("colors"),t=kn("spacing"),n=kn("blur"),r=kn("brightness"),a=kn("borderColor"),o=kn("borderRadius"),l=kn("borderSpacing"),u=kn("borderWidth"),d=kn("contrast"),f=kn("grayscale"),h=kn("hueRotate"),m=kn("invert"),g=kn("gap"),b=kn("gradientColorStops"),x=kn("gradientColorStopPositions"),w=kn("inset"),C=kn("margin"),k=kn("opacity"),N=kn("padding"),T=kn("saturate"),_=kn("scale"),P=kn("sepia"),M=kn("skew"),O=kn("space"),D=kn("translate"),F=()=>["auto","contain","none"],B=()=>["auto","hidden","clip","visible","scroll"],te=()=>["auto",At,t],U=()=>[At,t],ce=()=>["",Fa,ko],q=()=>["auto",Oi,At],ne=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Y=()=>["solid","dashed","dotted","double","none"],se=()=>["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"],W=()=>["","0",At],V=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>[Oi,Qf],K=()=>[Oi,At];return{cacheSize:500,separator:":",theme:{colors:[Mu],spacing:[Fa,ko],blur:["none","",Eo,At],brightness:A(),borderColor:[e],borderRadius:["none","","full",Eo,At],borderSpacing:U(),borderWidth:ce(),contrast:A(),grayscale:W(),hueRotate:K(),invert:W(),gap:U(),gradientColorStops:[e],gradientColorStopPositions:[t5,ko],inset:te(),margin:te(),opacity:A(),padding:U(),saturate:A(),scale:A(),sepia:W(),skew:K(),space:U(),translate:U()},classGroups:{aspect:[{aspect:["auto","square","video",At]}],container:["container"],columns:[{columns:[Eo]}],"break-after":[{"break-after":V()}],"break-before":[{"break-before":V()}],"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:[...ne(),At]}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-y":[{"overscroll-y":F()}],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",Tu,At]}],basis:[{basis:te()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",At]}],grow:[{grow:W()}],shrink:[{shrink:W()}],order:[{order:["first","last","none",Tu,At]}],"grid-cols":[{"grid-cols":[Mu]}],"col-start-end":[{col:["auto",{span:["full",Tu,At]},At]}],"col-start":[{"col-start":q()}],"col-end":[{"col-end":q()}],"grid-rows":[{"grid-rows":[Mu]}],"row-start-end":[{row:["auto",{span:[Tu,At]},At]}],"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",At]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",At]}],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:[N]}],px:[{px:[N]}],py:[{py:[N]}],ps:[{ps:[N]}],pe:[{pe:[N]}],pt:[{pt:[N]}],pr:[{pr:[N]}],pb:[{pb:[N]}],pl:[{pl:[N]}],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",At,t]}],"min-w":[{"min-w":[At,t,"min","max","fit"]}],"max-w":[{"max-w":[At,t,"none","full","min","max","fit","prose",{screen:[Eo]},Eo]}],h:[{h:[At,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[At,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[At,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[At,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Eo,ko]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Qf]}],"font-family":[{font:[Mu]}],"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",At]}],"line-clamp":[{"line-clamp":["none",Oi,Qf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Fa,At]}],"list-image":[{"list-image":["none",At]}],"list-style-type":[{list:["none","disc","decimal",At]}],"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:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Fa,ko]}],"underline-offset":[{"underline-offset":["auto",Fa,At]}],"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:U()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",At]}],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",At]}],"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:[...ne(),s5]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",r5]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},o5]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[b]}],"gradient-via":[{via:[b]}],"gradient-to":[{to:[b]}],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:[...Y(),"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:Y()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...Y()]}],"outline-offset":[{"outline-offset":[Fa,At]}],"outline-w":[{outline:[Fa,ko]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[k]}],"ring-offset-w":[{"ring-offset":[Fa,ko]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Eo,i5]}],"shadow-color":[{shadow:[Mu]}],opacity:[{opacity:[k]}],"mix-blend":[{"mix-blend":[...se(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":se()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",Eo,At]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[m]}],saturate:[{saturate:[T]}],sepia:[{sepia:[P]}],"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":[T]}],"backdrop-sepia":[{"backdrop-sepia":[P]}],"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",At]}],duration:[{duration:K()}],ease:[{ease:["linear","in","out","in-out",At]}],delay:[{delay:K()}],animate:[{animate:["none","spin","ping","pulse","bounce",At]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[_]}],"scale-x":[{"scale-x":[_]}],"scale-y":[{"scale-y":[_]}],rotate:[{rotate:[Tu,At]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[M]}],"skew-y":[{"skew-y":[M]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",At]}],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",At]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"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",At]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Fa,ko,Qf]}],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 f5=Kz(d5);function ln(...e){return f5(Qs(e))}const vt=DB,an=FB,p5=LB,CM=v.forwardRef(({className:e,...t},n)=>s.jsx($B,{ref:n,"data-slot":"dialog-overlay",className:ln("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t}));CM.displayName="DialogOverlay";const mt=v.forwardRef(({className:e,children:t,showCloseButton:n=!0,...r},a)=>s.jsxs(p5,{children:[s.jsx(CM,{}),s.jsxs(BB,{ref:a,"data-slot":"dialog-content",className:ln("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...r,children:[t,n&&s.jsxs(VB,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[s.jsx(Hh,{}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));mt.displayName="DialogContent";const gt=({className:e,...t})=>s.jsx("div",{"data-slot":"dialog-header",className:ln("flex flex-col gap-2 text-center sm:text-left",e),...t});gt.displayName="DialogHeader";const Kt=({className:e,...t})=>s.jsx("div",{"data-slot":"dialog-footer",className:ln("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t});Kt.displayName="DialogFooter";const xt=v.forwardRef(({className:e,...t},n)=>s.jsx(zB,{ref:n,"data-slot":"dialog-title",className:ln("text-lg leading-none font-semibold",e),...t}));xt.displayName="DialogTitle";const gr=v.forwardRef(({className:e,...t},n)=>s.jsx(UB,{ref:n,"data-slot":"dialog-description",className:ln("text-muted-foreground text-sm",e),...t}));gr.displayName="DialogDescription";const Ce=dn.create({timeout:3e4});Ce.interceptors.request.use(async e=>{const t=mr(Fn.API_URL);if(t&&(e.baseURL=t.toString()),!e.headers.has("apikey")){const n=mr(Fn.INSTANCE_TOKEN);n&&e.headers.set("apikey",n)}return e},e=>Promise.reject(e));const qt=dn.create({timeout:3e4});qt.interceptors.request.use(async e=>{const t=mr(Fn.API_URL);if(t&&(e.baseURL=t.toString()),!e.headers.has("apikey")){const n=mr(Fn.TOKEN);n&&e.headers.set("apikey",n)}return e},e=>Promise.reject(e));const jM=e=>({id:e.id,name:e.name,connectionStatus:e.connected?"open":"close",ownerJid:e.jid,profileName:"",profilePicUrl:"",integration:"EVOLUTION_GO",number:e.jid?e.jid.split("@")[0].split(":")[0]:"",businessId:"",token:e.token,clientName:e.client_name,createdAt:e.createdAt,updatedAt:e.createdAt,Setting:{rejectCall:e.rejectCall,msgCall:e.msgRejectCall,groupsIgnore:e.ignoreGroups,alwaysOnline:e.alwaysOnline,readMessages:e.readMessages,readStatus:!e.ignoreStatus,syncFullHistory:!1},_count:{Contact:0,Chat:0,Message:0}}),h5=e=>["instance","fetchInstance","go",JSON.stringify(e)],m5=async({instanceId:e})=>{const t=await qt.get(`/instance/info/${e}`);return jM(t.data.data)},g5=e=>{const{instanceId:t,enabled:n,...r}=e;return pt({...r,queryKey:h5({instanceId:t}),queryFn:()=>m5({instanceId:t}),enabled:!!t&&(n??!0)})},v5=e=>["instance","fetchInstance",JSON.stringify(e)],y5=async({instanceId:e})=>{const t=await qt.get("/instance/fetchInstances",{params:{instanceId:e}});return Array.isArray(t.data)?t.data[0]:t.data},x5=e=>{const{instanceId:t,enabled:n,...r}=e;return pt({...r,queryKey:v5({instanceId:t}),queryFn:()=>y5({instanceId:t}),enabled:!!t&&(n??!0)})},kM=e=>{const t=vr(),n=x5({...e,enabled:(e.enabled??!0)&&t==="api"}),r=g5({...e,enabled:(e.enabled??!0)&&t==="go"});return t==="go"?r:n};function Fb(e){const t=e+"CollectionProvider",[n,r]=sa(t),[a,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=w=>{const{scope:C,children:k}=w,N=ke.useRef(null),T=ke.useRef(new Map).current;return s.jsx(a,{scope:C,itemMap:T,collectionRef:N,children:k})};l.displayName=t;const u=e+"CollectionSlot",d=lc(u),f=ke.forwardRef((w,C)=>{const{scope:k,children:N}=w,T=o(u,k),_=nn(C,T.collectionRef);return s.jsx(d,{ref:_,children:N})});f.displayName=u;const h=e+"CollectionItemSlot",m="data-radix-collection-item",g=lc(h),b=ke.forwardRef((w,C)=>{const{scope:k,children:N,...T}=w,_=ke.useRef(null),P=nn(C,_),M=o(h,k);return ke.useEffect(()=>(M.itemMap.set(_,{ref:_,...T}),()=>void M.itemMap.delete(_))),s.jsx(g,{[m]:"",ref:P,children:N})});b.displayName=h;function x(w){const C=o(e+"CollectionConsumer",w);return ke.useCallback(()=>{const N=C.collectionRef.current;if(!N)return[];const T=Array.from(N.querySelectorAll(`[${m}]`));return Array.from(C.itemMap.values()).sort((M,O)=>T.indexOf(M.ref.current)-T.indexOf(O.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:l,Slot:f,ItemSlot:b},x,r]}var b5=v.createContext(void 0);function Wh(e){const t=v.useContext(b5);return e||t||"ltr"}const w5=["top","right","bottom","left"],ya=Math.min,fs=Math.max,Xp=Math.round,Yf=Math.floor,Bo=e=>({x:e,y:e}),S5={left:"right",right:"left",bottom:"top",top:"bottom"},C5={start:"end",end:"start"};function yx(e,t,n){return fs(e,ya(t,n))}function Wa(e,t){return typeof e=="function"?e(t):e}function Ka(e){return e.split("-")[0]}function Ec(e){return e.split("-")[1]}function Lb(e){return e==="x"?"y":"x"}function $b(e){return e==="y"?"height":"width"}function zo(e){return["top","bottom"].includes(Ka(e))?"y":"x"}function Bb(e){return Lb(zo(e))}function j5(e,t,n){n===void 0&&(n=!1);const r=Ec(e),a=Bb(e),o=$b(a);let l=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=eh(l)),[l,eh(l)]}function k5(e){const t=eh(e);return[xx(e),t,xx(t)]}function xx(e){return e.replace(/start|end/g,t=>C5[t])}function E5(e,t,n){const r=["left","right"],a=["right","left"],o=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?a:r:t?r:a;case"left":case"right":return t?o:l;default:return[]}}function N5(e,t,n,r){const a=Ec(e);let o=E5(Ka(e),n==="start",r);return a&&(o=o.map(l=>l+"-"+a),t&&(o=o.concat(o.map(xx)))),o}function eh(e){return e.replace(/left|right|bottom|top/g,t=>S5[t])}function T5(e){return{top:0,right:0,bottom:0,left:0,...e}}function EM(e){return typeof e!="number"?T5(e):{top:e,right:e,bottom:e,left:e}}function th(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function J1(e,t,n){let{reference:r,floating:a}=e;const o=zo(t),l=Bb(t),u=$b(l),d=Ka(t),f=o==="y",h=r.x+r.width/2-a.width/2,m=r.y+r.height/2-a.height/2,g=r[u]/2-a[u]/2;let b;switch(d){case"top":b={x:h,y:r.y-a.height};break;case"bottom":b={x:h,y:r.y+r.height};break;case"right":b={x:r.x+r.width,y:m};break;case"left":b={x:r.x-a.width,y:m};break;default:b={x:r.x,y:r.y}}switch(Ec(t)){case"start":b[l]-=g*(n&&f?-1:1);break;case"end":b[l]+=g*(n&&f?-1:1);break}return b}const M5=async(e,t,n)=>{const{placement:r="bottom",strategy:a="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:a}),{x:h,y:m}=J1(f,r,d),g=r,b={},x=0;for(let w=0;w({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:o,platform:l,elements:u,middlewareData:d}=t,{element:f,padding:h=0}=Wa(e,t)||{};if(f==null)return{};const m=EM(h),g={x:n,y:r},b=Bb(a),x=$b(b),w=await l.getDimensions(f),C=b==="y",k=C?"top":"left",N=C?"bottom":"right",T=C?"clientHeight":"clientWidth",_=o.reference[x]+o.reference[b]-g[b]-o.floating[x],P=g[b]-o.reference[b],M=await(l.getOffsetParent==null?void 0:l.getOffsetParent(f));let O=M?M[T]:0;(!O||!await(l.isElement==null?void 0:l.isElement(M)))&&(O=u.floating[T]||o.floating[x]);const D=_/2-P/2,F=O/2-w[x]/2-1,B=ya(m[k],F),te=ya(m[N],F),U=B,ce=O-w[x]-te,q=O/2-w[x]/2+D,ne=yx(U,q,ce),Y=!d.arrow&&Ec(a)!=null&&q!==ne&&o.reference[x]/2-(qq<=0)){var te,U;const q=(((te=o.flip)==null?void 0:te.index)||0)+1,ne=O[q];if(ne)return{data:{index:q,overflows:B},reset:{placement:ne}};let Y=(U=B.filter(se=>se.overflows[0]<=0).sort((se,H)=>se.overflows[1]-H.overflows[1])[0])==null?void 0:U.placement;if(!Y)switch(b){case"bestFit":{var ce;const se=(ce=B.filter(H=>{if(M){const W=zo(H.placement);return W===N||W==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(W=>W>0).reduce((W,V)=>W+V,0)]).sort((H,W)=>H[1]-W[1])[0])==null?void 0:ce[0];se&&(Y=se);break}case"initialPlacement":Y=u;break}if(a!==Y)return{reset:{placement:Y}}}return{}}}};function Q1(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Y1(e){return w5.some(t=>e[t]>=0)}const R5=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...a}=Wa(e,t);switch(r){case"referenceHidden":{const o=await id(t,{...a,elementContext:"reference"}),l=Q1(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:Y1(l)}}}case"escaped":{const o=await id(t,{...a,altBoundary:!0}),l=Q1(o,n.floating);return{data:{escapedOffsets:l,escaped:Y1(l)}}}default:return{}}}}};async function I5(e,t){const{placement:n,platform:r,elements:a}=e,o=await(r.isRTL==null?void 0:r.isRTL(a.floating)),l=Ka(n),u=Ec(n),d=zo(n)==="y",f=["left","top"].includes(l)?-1:1,h=o&&d?-1:1,m=Wa(t,e);let{mainAxis:g,crossAxis:b,alignmentAxis:x}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...m};return u&&typeof x=="number"&&(b=u==="end"?x*-1:x),d?{x:b*h,y:g*f}:{x:g*f,y:b*h}}const O5=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:o,placement:l,middlewareData:u}=t,d=await I5(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:a+d.x,y:o+d.y,data:{...d,placement:l}}}}},A5=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:u={fn:C=>{let{x:k,y:N}=C;return{x:k,y:N}}},...d}=Wa(e,t),f={x:n,y:r},h=await id(t,d),m=zo(Ka(a)),g=Lb(m);let b=f[g],x=f[m];if(o){const C=g==="y"?"top":"left",k=g==="y"?"bottom":"right",N=b+h[C],T=b-h[k];b=yx(N,b,T)}if(l){const C=m==="y"?"top":"left",k=m==="y"?"bottom":"right",N=x+h[C],T=x-h[k];x=yx(N,x,T)}const w=u.fn({...t,[g]:b,[m]:x});return{...w,data:{x:w.x-n,y:w.y-r}}}}},D5=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:o,middlewareData:l}=t,{offset:u=0,mainAxis:d=!0,crossAxis:f=!0}=Wa(e,t),h={x:n,y:r},m=zo(a),g=Lb(m);let b=h[g],x=h[m];const w=Wa(u,t),C=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(d){const T=g==="y"?"height":"width",_=o.reference[g]-o.floating[T]+C.mainAxis,P=o.reference[g]+o.reference[T]-C.mainAxis;b<_?b=_:b>P&&(b=P)}if(f){var k,N;const T=g==="y"?"width":"height",_=["top","left"].includes(Ka(a)),P=o.reference[m]-o.floating[T]+(_&&((k=l.offset)==null?void 0:k[m])||0)+(_?0:C.crossAxis),M=o.reference[m]+o.reference[T]+(_?0:((N=l.offset)==null?void 0:N[m])||0)-(_?C.crossAxis:0);xM&&(x=M)}return{[g]:b,[m]:x}}}},F5=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:a,elements:o}=t,{apply:l=()=>{},...u}=Wa(e,t),d=await id(t,u),f=Ka(n),h=Ec(n),m=zo(n)==="y",{width:g,height:b}=r.floating;let x,w;f==="top"||f==="bottom"?(x=f,w=h===(await(a.isRTL==null?void 0:a.isRTL(o.floating))?"start":"end")?"left":"right"):(w=f,x=h==="end"?"top":"bottom");const C=b-d.top-d.bottom,k=g-d.left-d.right,N=ya(b-d[x],C),T=ya(g-d[w],k),_=!t.middlewareData.shift;let P=N,M=T;if(m?M=h||_?ya(T,k):k:P=h||_?ya(N,C):C,_&&!h){const D=fs(d.left,0),F=fs(d.right,0),B=fs(d.top,0),te=fs(d.bottom,0);m?M=g-2*(D!==0||F!==0?D+F:fs(d.left,d.right)):P=b-2*(B!==0||te!==0?B+te:fs(d.top,d.bottom))}await l({...t,availableWidth:M,availableHeight:P});const O=await a.getDimensions(o.floating);return g!==O.width||b!==O.height?{reset:{rects:!0}}:{}}}};function Nc(e){return NM(e)?(e.nodeName||"").toLowerCase():"#document"}function hs(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ya(e){var t;return(t=(NM(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function NM(e){return e instanceof Node||e instanceof hs(e).Node}function wa(e){return e instanceof Element||e instanceof hs(e).Element}function Sa(e){return e instanceof HTMLElement||e instanceof hs(e).HTMLElement}function Z1(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof hs(e).ShadowRoot}function jd(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=ta(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(a)}function L5(e){return["table","td","th"].includes(Nc(e))}function Kh(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function zb(e){const t=Ub(),n=ta(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 $5(e){let t=Uo(e);for(;Sa(t)&&!dc(t);){if(Kh(t))return null;if(zb(t))return t;t=Uo(t)}return null}function Ub(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function dc(e){return["html","body","#document"].includes(Nc(e))}function ta(e){return hs(e).getComputedStyle(e)}function Gh(e){return wa(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Uo(e){if(Nc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Z1(e)&&e.host||Ya(e);return Z1(t)?t.host:t}function TM(e){const t=Uo(e);return dc(t)?e.ownerDocument?e.ownerDocument.body:e.body:Sa(t)&&jd(t)?t:TM(t)}function ld(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=TM(e),o=a===((r=e.ownerDocument)==null?void 0:r.body),l=hs(a);return o?t.concat(l,l.visualViewport||[],jd(a)?a:[],l.frameElement&&n?ld(l.frameElement):[]):t.concat(a,ld(a,[],n))}function MM(e){const t=ta(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Sa(e),o=a?e.offsetWidth:n,l=a?e.offsetHeight:r,u=Xp(n)!==o||Xp(r)!==l;return u&&(n=o,r=l),{width:n,height:r,$:u}}function Vb(e){return wa(e)?e:e.contextElement}function Zl(e){const t=Vb(e);if(!Sa(t))return Bo(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:o}=MM(t);let l=(o?Xp(n.width):n.width)/r,u=(o?Xp(n.height):n.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const B5=Bo(0);function _M(e){const t=hs(e);return!Ub()||!t.visualViewport?B5:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function z5(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==hs(e)?!1:t}function qi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),o=Vb(e);let l=Bo(1);t&&(r?wa(r)&&(l=Zl(r)):l=Zl(e));const u=z5(o,n,r)?_M(o):Bo(0);let d=(a.left+u.x)/l.x,f=(a.top+u.y)/l.y,h=a.width/l.x,m=a.height/l.y;if(o){const g=hs(o),b=r&&wa(r)?hs(r):r;let x=g,w=x.frameElement;for(;w&&r&&b!==x;){const C=Zl(w),k=w.getBoundingClientRect(),N=ta(w),T=k.left+(w.clientLeft+parseFloat(N.paddingLeft))*C.x,_=k.top+(w.clientTop+parseFloat(N.paddingTop))*C.y;d*=C.x,f*=C.y,h*=C.x,m*=C.y,d+=T,f+=_,x=hs(w),w=x.frameElement}}return th({width:h,height:m,x:d,y:f})}function U5(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const o=a==="fixed",l=Ya(r),u=t?Kh(t.floating):!1;if(r===l||u&&o)return n;let d={scrollLeft:0,scrollTop:0},f=Bo(1);const h=Bo(0),m=Sa(r);if((m||!m&&!o)&&((Nc(r)!=="body"||jd(l))&&(d=Gh(r)),Sa(r))){const g=qi(r);f=Zl(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 V5(e){return Array.from(e.getClientRects())}function PM(e){return qi(Ya(e)).left+Gh(e).scrollLeft}function q5(e){const t=Ya(e),n=Gh(e),r=e.ownerDocument.body,a=fs(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=fs(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+PM(e);const u=-n.scrollTop;return ta(r).direction==="rtl"&&(l+=fs(t.clientWidth,r.clientWidth)-a),{width:a,height:o,x:l,y:u}}function H5(e,t){const n=hs(e),r=Ya(e),a=n.visualViewport;let o=r.clientWidth,l=r.clientHeight,u=0,d=0;if(a){o=a.width,l=a.height;const f=Ub();(!f||f&&t==="fixed")&&(u=a.offsetLeft,d=a.offsetTop)}return{width:o,height:l,x:u,y:d}}function W5(e,t){const n=qi(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,o=Sa(e)?Zl(e):Bo(1),l=e.clientWidth*o.x,u=e.clientHeight*o.y,d=a*o.x,f=r*o.y;return{width:l,height:u,x:d,y:f}}function X1(e,t,n){let r;if(t==="viewport")r=H5(e,n);else if(t==="document")r=q5(Ya(e));else if(wa(t))r=W5(t,n);else{const a=_M(e);r={...t,x:t.x-a.x,y:t.y-a.y}}return th(r)}function RM(e,t){const n=Uo(e);return n===t||!wa(n)||dc(n)?!1:ta(n).position==="fixed"||RM(n,t)}function K5(e,t){const n=t.get(e);if(n)return n;let r=ld(e,[],!1).filter(u=>wa(u)&&Nc(u)!=="body"),a=null;const o=ta(e).position==="fixed";let l=o?Uo(e):e;for(;wa(l)&&!dc(l);){const u=ta(l),d=zb(l);!d&&u.position==="fixed"&&(a=null),(o?!d&&!a:!d&&u.position==="static"&&!!a&&["absolute","fixed"].includes(a.position)||jd(l)&&!d&&RM(e,l))?r=r.filter(h=>h!==l):a=u,l=Uo(l)}return t.set(e,r),r}function G5(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const l=[...n==="clippingAncestors"?Kh(t)?[]:K5(t,this._c):[].concat(n),r],u=l[0],d=l.reduce((f,h)=>{const m=X1(t,h,a);return f.top=fs(m.top,f.top),f.right=ya(m.right,f.right),f.bottom=ya(m.bottom,f.bottom),f.left=fs(m.left,f.left),f},X1(t,u,a));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function J5(e){const{width:t,height:n}=MM(e);return{width:t,height:n}}function Q5(e,t,n){const r=Sa(t),a=Ya(t),o=n==="fixed",l=qi(e,!0,o,t);let u={scrollLeft:0,scrollTop:0};const d=Bo(0);if(r||!r&&!o)if((Nc(t)!=="body"||jd(a))&&(u=Gh(t)),r){const m=qi(t,!0,o,t);d.x=m.x+t.clientLeft,d.y=m.y+t.clientTop}else a&&(d.x=PM(a));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 Uv(e){return ta(e).position==="static"}function ej(e,t){return!Sa(e)||ta(e).position==="fixed"?null:t?t(e):e.offsetParent}function IM(e,t){const n=hs(e);if(Kh(e))return n;if(!Sa(e)){let a=Uo(e);for(;a&&!dc(a);){if(wa(a)&&!Uv(a))return a;a=Uo(a)}return n}let r=ej(e,t);for(;r&&L5(r)&&Uv(r);)r=ej(r,t);return r&&dc(r)&&Uv(r)&&!zb(r)?n:r||$5(e)||n}const Y5=async function(e){const t=this.getOffsetParent||IM,n=this.getDimensions,r=await n(e.floating);return{reference:Q5(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Z5(e){return ta(e).direction==="rtl"}const X5={convertOffsetParentRelativeRectToViewportRelativeRect:U5,getDocumentElement:Ya,getClippingRect:G5,getOffsetParent:IM,getElementRects:Y5,getClientRects:V5,getDimensions:J5,getScale:Zl,isElement:wa,isRTL:Z5};function eU(e,t){let n=null,r;const a=Ya(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 b=Yf(h),x=Yf(a.clientWidth-(f+m)),w=Yf(a.clientHeight-(h+g)),C=Yf(f),N={rootMargin:-b+"px "+-x+"px "+-w+"px "+-C+"px",threshold:fs(0,ya(1,d))||1};let T=!0;function _(P){const M=P[0].intersectionRatio;if(M!==d){if(!T)return l();M?l(!1,M):r=setTimeout(()=>{l(!1,1e-7)},1e3)}T=!1}try{n=new IntersectionObserver(_,{...N,root:a.ownerDocument})}catch{n=new IntersectionObserver(_,N)}n.observe(e)}return l(!0),o}function tU(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=Vb(e),h=a||o?[...f?ld(f):[],...ld(t)]:[];h.forEach(k=>{a&&k.addEventListener("scroll",n,{passive:!0}),o&&k.addEventListener("resize",n)});const m=f&&u?eU(f,n):null;let g=-1,b=null;l&&(b=new ResizeObserver(k=>{let[N]=k;N&&N.target===f&&b&&(b.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var T;(T=b)==null||T.observe(t)})),n()}),f&&!d&&b.observe(f),b.observe(t));let x,w=d?qi(e):null;d&&C();function C(){const k=qi(e);w&&(k.x!==w.x||k.y!==w.y||k.width!==w.width||k.height!==w.height)&&n(),w=k,x=requestAnimationFrame(C)}return n(),()=>{var k;h.forEach(N=>{a&&N.removeEventListener("scroll",n),o&&N.removeEventListener("resize",n)}),m?.(),(k=b)==null||k.disconnect(),b=null,d&&cancelAnimationFrame(x)}}const nU=O5,rU=A5,sU=P5,aU=F5,oU=R5,tj=_5,iU=D5,lU=(e,t,n)=>{const r=new Map,a={platform:X5,...n},o={...a.platform,_c:r};return M5(e,t,{...a,platform:o})};var Tp=typeof document<"u"?v.useLayoutEffect:v.useEffect;function nh(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,a;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(!nh(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const o=a[r];if(!(o==="_owner"&&e.$$typeof)&&!nh(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function OM(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function nj(e,t){const n=OM(e);return Math.round(t*n)/n}function rj(e){const t=v.useRef(e);return Tp(()=>{t.current=e}),t}function cU(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:o,floating:l}={},transform:u=!0,whileElementsMounted:d,open:f}=e,[h,m]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,b]=v.useState(r);nh(g,r)||b(r);const[x,w]=v.useState(null),[C,k]=v.useState(null),N=v.useCallback(se=>{se!==M.current&&(M.current=se,w(se))},[]),T=v.useCallback(se=>{se!==O.current&&(O.current=se,k(se))},[]),_=o||x,P=l||C,M=v.useRef(null),O=v.useRef(null),D=v.useRef(h),F=d!=null,B=rj(d),te=rj(a),U=v.useCallback(()=>{if(!M.current||!O.current)return;const se={placement:t,strategy:n,middleware:g};te.current&&(se.platform=te.current),lU(M.current,O.current,se).then(H=>{const W={...H,isPositioned:!0};ce.current&&!nh(D.current,W)&&(D.current=W,bc.flushSync(()=>{m(W)}))})},[g,t,n,te]);Tp(()=>{f===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,m(se=>({...se,isPositioned:!1})))},[f]);const ce=v.useRef(!1);Tp(()=>(ce.current=!0,()=>{ce.current=!1}),[]),Tp(()=>{if(_&&(M.current=_),P&&(O.current=P),_&&P){if(B.current)return B.current(_,P,U);U()}},[_,P,U,B,F]);const q=v.useMemo(()=>({reference:M,floating:O,setReference:N,setFloating:T}),[N,T]),ne=v.useMemo(()=>({reference:_,floating:P}),[_,P]),Y=v.useMemo(()=>{const se={position:n,left:0,top:0};if(!ne.floating)return se;const H=nj(ne.floating,h.x),W=nj(ne.floating,h.y);return u?{...se,transform:"translate("+H+"px, "+W+"px)",...OM(ne.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:W}},[n,u,ne.floating,h.x,h.y]);return v.useMemo(()=>({...h,update:U,refs:q,elements:ne,floatingStyles:Y}),[h,U,q,ne,Y])}const uU=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?tj({element:r.current,padding:a}).fn(n):{}:r?tj({element:r,padding:a}).fn(n):{}}}},dU=(e,t)=>({...nU(e),options:[e,t]}),fU=(e,t)=>({...rU(e),options:[e,t]}),pU=(e,t)=>({...iU(e),options:[e,t]}),hU=(e,t)=>({...sU(e),options:[e,t]}),mU=(e,t)=>({...aU(e),options:[e,t]}),gU=(e,t)=>({...oU(e),options:[e,t]}),vU=(e,t)=>({...uU(e),options:[e,t]});var yU="Arrow",AM=v.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...o}=e;return s.jsx(wt.svg,{...o,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});AM.displayName=yU;var xU=AM;function qb(e){const[t,n]=v.useState(void 0);return er(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const o=a[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 Hb="Popper",[DM,Jh]=sa(Hb),[bU,FM]=DM(Hb),LM=e=>{const{__scopePopper:t,children:n}=e,[r,a]=v.useState(null);return s.jsx(bU,{scope:t,anchor:r,onAnchorChange:a,children:n})};LM.displayName=Hb;var $M="PopperAnchor",BM=v.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,o=FM($M,n),l=v.useRef(null),u=nn(t,l),d=v.useRef(null);return v.useEffect(()=>{const f=d.current;d.current=r?.current||l.current,f!==d.current&&o.onAnchorChange(d.current)}),r?null:s.jsx(wt.div,{...a,ref:u})});BM.displayName=$M;var Wb="PopperContent",[wU,SU]=DM(Wb),zM=v.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:a=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:b="optimized",onPlaced:x,...w}=e,C=FM(Wb,n),[k,N]=v.useState(null),T=nn(t,j=>N(j)),[_,P]=v.useState(null),M=qb(_),O=M?.width??0,D=M?.height??0,F=r+(o!=="center"?"-"+o:""),B=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},te=Array.isArray(f)?f:[f],U=te.length>0,ce={padding:B,boundary:te.filter(jU),altBoundary:U},{refs:q,floatingStyles:ne,placement:Y,isPositioned:se,middlewareData:H}=cU({strategy:"fixed",placement:F,whileElementsMounted:(...j)=>tU(...j,{animationFrame:b==="always"}),elements:{reference:C.anchor},middleware:[dU({mainAxis:a+D,alignmentAxis:l}),d&&fU({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?pU():void 0,...ce}),d&&hU({...ce}),mU({...ce,apply:({elements:j,rects:I,availableWidth:me,availableHeight:be})=>{const{width:st,height:Je}=I.reference,rt=j.floating.style;rt.setProperty("--radix-popper-available-width",`${me}px`),rt.setProperty("--radix-popper-available-height",`${be}px`),rt.setProperty("--radix-popper-anchor-width",`${st}px`),rt.setProperty("--radix-popper-anchor-height",`${Je}px`)}}),_&&vU({element:_,padding:u}),kU({arrowWidth:O,arrowHeight:D}),g&&gU({strategy:"referenceHidden",...ce})]}),[W,V]=qM(Y),A=ea(x);er(()=>{se&&A?.()},[se,A]);const K=H.arrow?.x,re=H.arrow?.y,ee=H.arrow?.centerOffset!==0,[ie,ue]=v.useState();return er(()=>{k&&ue(window.getComputedStyle(k).zIndex)},[k]),s.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...ne,transform:se?ne.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ie,"--radix-popper-transform-origin":[H.transformOrigin?.x,H.transformOrigin?.y].join(" "),...H.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(wU,{scope:n,placedSide:W,onArrowChange:P,arrowX:K,arrowY:re,shouldHideArrow:ee,children:s.jsx(wt.div,{"data-side":W,"data-align":V,...w,ref:T,style:{...w.style,animation:se?void 0:"none"}})})})});zM.displayName=Wb;var UM="PopperArrow",CU={top:"bottom",right:"left",bottom:"top",left:"right"},VM=v.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,o=SU(UM,r),l=CU[o.placedSide];return s.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:s.jsx(xU,{...a,ref:n,style:{...a.style,display:"block"}})})});VM.displayName=UM;function jU(e){return e!==null}var kU=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:a}=t,l=a.arrow?.centerOffset!==0,u=l?0:e.arrowWidth,d=l?0:e.arrowHeight,[f,h]=qM(n),m={start:"0%",center:"50%",end:"100%"}[h],g=(a.arrow?.x??0)+u/2,b=(a.arrow?.y??0)+d/2;let x="",w="";return f==="bottom"?(x=l?m:`${g}px`,w=`${-d}px`):f==="top"?(x=l?m:`${g}px`,w=`${r.floating.height+d}px`):f==="right"?(x=`${-d}px`,w=l?m:`${b}px`):f==="left"&&(x=`${r.floating.width+d}px`,w=l?m:`${b}px`),{data:{x,y:w}}}});function qM(e){const[t,n="center"]=e.split("-");return[t,n]}var HM=LM,WM=BM,KM=zM,GM=VM,Vv="rovingFocusGroup.onEntryFocus",EU={bubbles:!1,cancelable:!0},kd="RovingFocusGroup",[bx,JM,NU]=Fb(kd),[TU,Qh]=sa(kd,[NU]),[MU,_U]=TU(kd),QM=v.forwardRef((e,t)=>s.jsx(bx.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(bx.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(PU,{...e,ref:t})})}));QM.displayName=kd;var PU=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:h=!1,...m}=e,g=v.useRef(null),b=nn(t,g),x=Wh(o),[w,C]=Ha({prop:l,defaultProp:u??null,onChange:d,caller:kd}),[k,N]=v.useState(!1),T=ea(f),_=JM(n),P=v.useRef(!1),[M,O]=v.useState(0);return v.useEffect(()=>{const D=g.current;if(D)return D.addEventListener(Vv,T),()=>D.removeEventListener(Vv,T)},[T]),s.jsx(MU,{scope:n,orientation:r,dir:x,loop:a,currentTabStopId:w,onItemFocus:v.useCallback(D=>C(D),[C]),onItemShiftTab:v.useCallback(()=>N(!0),[]),onFocusableItemAdd:v.useCallback(()=>O(D=>D+1),[]),onFocusableItemRemove:v.useCallback(()=>O(D=>D-1),[]),children:s.jsx(wt.div,{tabIndex:k||M===0?-1:0,"data-orientation":r,...m,ref:b,style:{outline:"none",...e.style},onMouseDown:Ge(e.onMouseDown,()=>{P.current=!0}),onFocus:Ge(e.onFocus,D=>{const F=!P.current;if(D.target===D.currentTarget&&F&&!k){const B=new CustomEvent(Vv,EU);if(D.currentTarget.dispatchEvent(B),!B.defaultPrevented){const te=_().filter(Y=>Y.focusable),U=te.find(Y=>Y.active),ce=te.find(Y=>Y.id===w),ne=[U,ce,...te].filter(Boolean).map(Y=>Y.ref.current);XM(ne,h)}}P.current=!1}),onBlur:Ge(e.onBlur,()=>N(!1))})})}),YM="RovingFocusGroupItem",ZM=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:o,children:l,...u}=e,d=Ys(),f=o||d,h=_U(YM,n),m=h.currentTabStopId===f,g=JM(n),{onFocusableItemAdd:b,onFocusableItemRemove:x,currentTabStopId:w}=h;return v.useEffect(()=>{if(r)return b(),()=>x()},[r,b,x]),s.jsx(bx.ItemSlot,{scope:n,id:f,focusable:r,active:a,children:s.jsx(wt.span,{tabIndex:m?0:-1,"data-orientation":h.orientation,...u,ref:t,onMouseDown:Ge(e.onMouseDown,C=>{r?h.onItemFocus(f):C.preventDefault()}),onFocus:Ge(e.onFocus,()=>h.onItemFocus(f)),onKeyDown:Ge(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){h.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const k=OU(C,h.orientation,h.dir);if(k!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let T=g().filter(_=>_.focusable).map(_=>_.ref.current);if(k==="last")T.reverse();else if(k==="prev"||k==="next"){k==="prev"&&T.reverse();const _=T.indexOf(C.currentTarget);T=h.loop?AU(T,_+1):T.slice(_+1)}setTimeout(()=>XM(T))}}),children:typeof l=="function"?l({isCurrentTabStop:m,hasTabStop:w!=null}):l})})});ZM.displayName=YM;var RU={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function IU(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function OU(e,t,n){const r=IU(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return RU[r]}function XM(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function AU(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var e_=QM,t_=ZM,wx=["Enter"," "],DU=["ArrowDown","PageUp","Home"],n_=["ArrowUp","PageDown","End"],FU=[...DU,...n_],LU={ltr:[...wx,"ArrowRight"],rtl:[...wx,"ArrowLeft"]},$U={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ed="Menu",[cd,BU,zU]=Fb(Ed),[il,r_]=sa(Ed,[zU,Jh,Qh]),Yh=Jh(),s_=Qh(),[UU,ll]=il(Ed),[VU,Nd]=il(Ed),a_=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:o,modal:l=!0}=e,u=Yh(t),[d,f]=v.useState(null),h=v.useRef(!1),m=ea(o),g=Wh(a);return v.useEffect(()=>{const b=()=>{h.current=!0,document.addEventListener("pointerdown",x,{capture:!0,once:!0}),document.addEventListener("pointermove",x,{capture:!0,once:!0})},x=()=>h.current=!1;return document.addEventListener("keydown",b,{capture:!0}),()=>{document.removeEventListener("keydown",b,{capture:!0}),document.removeEventListener("pointerdown",x,{capture:!0}),document.removeEventListener("pointermove",x,{capture:!0})}},[]),s.jsx(HM,{...u,children:s.jsx(UU,{scope:t,open:n,onOpenChange:m,content:d,onContentChange:f,children:s.jsx(VU,{scope:t,onClose:v.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:h,dir:g,modal:l,children:r})})})};a_.displayName=Ed;var qU="MenuAnchor",Kb=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=Yh(n);return s.jsx(WM,{...a,...r,ref:t})});Kb.displayName=qU;var Gb="MenuPortal",[HU,o_]=il(Gb,{forceMount:void 0}),i_=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:a}=e,o=ll(Gb,t);return s.jsx(HU,{scope:t,forceMount:n,children:s.jsx(aa,{present:n||o.open,children:s.jsx(Bh,{asChild:!0,container:a,children:r})})})};i_.displayName=Gb;var Rs="MenuContent",[WU,Jb]=il(Rs),l_=v.forwardRef((e,t)=>{const n=o_(Rs,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,o=ll(Rs,e.__scopeMenu),l=Nd(Rs,e.__scopeMenu);return s.jsx(cd.Provider,{scope:e.__scopeMenu,children:s.jsx(aa,{present:r||o.open,children:s.jsx(cd.Slot,{scope:e.__scopeMenu,children:l.modal?s.jsx(KU,{...a,ref:t}):s.jsx(GU,{...a,ref:t})})})})}),KU=v.forwardRef((e,t)=>{const n=ll(Rs,e.__scopeMenu),r=v.useRef(null),a=nn(t,r);return v.useEffect(()=>{const o=r.current;if(o)return Tb(o)},[]),s.jsx(Qb,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ge(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),GU=v.forwardRef((e,t)=>{const n=ll(Rs,e.__scopeMenu);return s.jsx(Qb,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),JU=lc("MenuContent.ScrollLock"),Qb=v.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:u,onEntryFocus:d,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:g,onDismiss:b,disableOutsideScroll:x,...w}=e,C=ll(Rs,n),k=Nd(Rs,n),N=Yh(n),T=s_(n),_=BU(n),[P,M]=v.useState(null),O=v.useRef(null),D=nn(t,O,C.onContentChange),F=v.useRef(0),B=v.useRef(""),te=v.useRef(0),U=v.useRef(null),ce=v.useRef("right"),q=v.useRef(0),ne=x?Uh:v.Fragment,Y=x?{as:JU,allowPinchZoom:!0}:void 0,se=W=>{const V=B.current+W,A=_().filter(j=>!j.disabled),K=document.activeElement,re=A.find(j=>j.ref.current===K)?.textValue,ee=A.map(j=>j.textValue),ie=i6(ee,V,re),ue=A.find(j=>j.textValue===ie)?.ref.current;(function j(I){B.current=I,window.clearTimeout(F.current),I!==""&&(F.current=window.setTimeout(()=>j(""),1e3))})(V),ue&&setTimeout(()=>ue.focus())};v.useEffect(()=>()=>window.clearTimeout(F.current),[]),Nb();const H=v.useCallback(W=>ce.current===U.current?.side&&c6(W,U.current?.area),[]);return s.jsx(WU,{scope:n,searchRef:B,onItemEnter:v.useCallback(W=>{H(W)&&W.preventDefault()},[H]),onItemLeave:v.useCallback(W=>{H(W)||(O.current?.focus(),M(null))},[H]),onTriggerLeave:v.useCallback(W=>{H(W)&&W.preventDefault()},[H]),pointerGraceTimerRef:te,onPointerGraceIntentChange:v.useCallback(W=>{U.current=W},[]),children:s.jsx(ne,{...Y,children:s.jsx($h,{asChild:!0,trapped:a,onMountAutoFocus:Ge(o,W=>{W.preventDefault(),O.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:s.jsx(Lh,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:g,onDismiss:b,children:s.jsx(e_,{asChild:!0,...T,dir:k.dir,orientation:"vertical",loop:r,currentTabStopId:P,onCurrentTabStopIdChange:M,onEntryFocus:Ge(d,W=>{k.isUsingKeyboardRef.current||W.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(KM,{role:"menu","aria-orientation":"vertical","data-state":j_(C.open),"data-radix-menu-content":"",dir:k.dir,...N,...w,ref:D,style:{outline:"none",...w.style},onKeyDown:Ge(w.onKeyDown,W=>{const A=W.target.closest("[data-radix-menu-content]")===W.currentTarget,K=W.ctrlKey||W.altKey||W.metaKey,re=W.key.length===1;A&&(W.key==="Tab"&&W.preventDefault(),!K&&re&&se(W.key));const ee=O.current;if(W.target!==ee||!FU.includes(W.key))return;W.preventDefault();const ue=_().filter(j=>!j.disabled).map(j=>j.ref.current);n_.includes(W.key)&&ue.reverse(),a6(ue)}),onBlur:Ge(e.onBlur,W=>{W.currentTarget.contains(W.target)||(window.clearTimeout(F.current),B.current="")}),onPointerMove:Ge(e.onPointerMove,ud(W=>{const V=W.target,A=q.current!==W.clientX;if(W.currentTarget.contains(V)&&A){const K=W.clientX>q.current?"right":"left";ce.current=K,q.current=W.clientX}}))})})})})})})});l_.displayName=Rs;var QU="MenuGroup",Yb=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(wt.div,{role:"group",...r,ref:t})});Yb.displayName=QU;var YU="MenuLabel",c_=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(wt.div,{...r,ref:t})});c_.displayName=YU;var rh="MenuItem",sj="menu.itemSelect",Zh=v.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...a}=e,o=v.useRef(null),l=Nd(rh,e.__scopeMenu),u=Jb(rh,e.__scopeMenu),d=nn(t,o),f=v.useRef(!1),h=()=>{const m=o.current;if(!n&&m){const g=new CustomEvent(sj,{bubbles:!0,cancelable:!0});m.addEventListener(sj,b=>r?.(b),{once:!0}),FT(m,g),g.defaultPrevented?f.current=!1:l.onClose()}};return s.jsx(u_,{...a,ref:d,disabled:n,onClick:Ge(e.onClick,h),onPointerDown:m=>{e.onPointerDown?.(m),f.current=!0},onPointerUp:Ge(e.onPointerUp,m=>{f.current||m.currentTarget?.click()}),onKeyDown:Ge(e.onKeyDown,m=>{const g=u.searchRef.current!=="";n||g&&m.key===" "||wx.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});Zh.displayName=rh;var u_=v.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:a,...o}=e,l=Jb(rh,n),u=s_(n),d=v.useRef(null),f=nn(t,d),[h,m]=v.useState(!1),[g,b]=v.useState("");return v.useEffect(()=>{const x=d.current;x&&b((x.textContent??"").trim())},[o.children]),s.jsx(cd.ItemSlot,{scope:n,disabled:r,textValue:a??g,children:s.jsx(t_,{asChild:!0,...u,focusable:!r,children:s.jsx(wt.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:f,onPointerMove:Ge(e.onPointerMove,ud(x=>{r?l.onItemLeave(x):(l.onItemEnter(x),x.defaultPrevented||x.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ge(e.onPointerLeave,ud(x=>l.onItemLeave(x))),onFocus:Ge(e.onFocus,()=>m(!0)),onBlur:Ge(e.onBlur,()=>m(!1))})})})}),ZU="MenuCheckboxItem",d_=v.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...a}=e;return s.jsx(g_,{scope:e.__scopeMenu,checked:n,children:s.jsx(Zh,{role:"menuitemcheckbox","aria-checked":sh(n)?"mixed":n,...a,ref:t,"data-state":Xb(n),onSelect:Ge(a.onSelect,()=>r?.(sh(n)?!0:!n),{checkForDefaultPrevented:!1})})})});d_.displayName=ZU;var f_="MenuRadioGroup",[XU,e6]=il(f_,{value:void 0,onValueChange:()=>{}}),p_=v.forwardRef((e,t)=>{const{value:n,onValueChange:r,...a}=e,o=ea(r);return s.jsx(XU,{scope:e.__scopeMenu,value:n,onValueChange:o,children:s.jsx(Yb,{...a,ref:t})})});p_.displayName=f_;var h_="MenuRadioItem",m_=v.forwardRef((e,t)=>{const{value:n,...r}=e,a=e6(h_,e.__scopeMenu),o=n===a.value;return s.jsx(g_,{scope:e.__scopeMenu,checked:o,children:s.jsx(Zh,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":Xb(o),onSelect:Ge(r.onSelect,()=>a.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});m_.displayName=h_;var Zb="MenuItemIndicator",[g_,t6]=il(Zb,{checked:!1}),v_=v.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...a}=e,o=t6(Zb,n);return s.jsx(aa,{present:r||sh(o.checked)||o.checked===!0,children:s.jsx(wt.span,{...a,ref:t,"data-state":Xb(o.checked)})})});v_.displayName=Zb;var n6="MenuSeparator",y_=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(wt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});y_.displayName=n6;var r6="MenuArrow",x_=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=Yh(n);return s.jsx(GM,{...a,...r,ref:t})});x_.displayName=r6;var s6="MenuSub",[eue,b_]=il(s6),qu="MenuSubTrigger",w_=v.forwardRef((e,t)=>{const n=ll(qu,e.__scopeMenu),r=Nd(qu,e.__scopeMenu),a=b_(qu,e.__scopeMenu),o=Jb(qu,e.__scopeMenu),l=v.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:d}=o,f={__scopeMenu:e.__scopeMenu},h=v.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return v.useEffect(()=>h,[h]),v.useEffect(()=>{const m=u.current;return()=>{window.clearTimeout(m),d(null)}},[u,d]),s.jsx(Kb,{asChild:!0,...f,children:s.jsx(u_,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":j_(n.open),...e,ref:Yo(t,a.onTriggerChange),onClick:m=>{e.onClick?.(m),!(e.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ge(e.onPointerMove,ud(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:Ge(e.onPointerLeave,ud(m=>{h();const g=n.content?.getBoundingClientRect();if(g){const b=n.content?.dataset.side,x=b==="right",w=x?-5:5,C=g[x?"left":"right"],k=g[x?"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:b}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(m),m.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Ge(e.onKeyDown,m=>{const g=o.searchRef.current!=="";e.disabled||g&&m.key===" "||LU[r.dir].includes(m.key)&&(n.onOpenChange(!0),n.content?.focus(),m.preventDefault())})})})});w_.displayName=qu;var S_="MenuSubContent",C_=v.forwardRef((e,t)=>{const n=o_(Rs,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,o=ll(Rs,e.__scopeMenu),l=Nd(Rs,e.__scopeMenu),u=b_(S_,e.__scopeMenu),d=v.useRef(null),f=nn(t,d);return s.jsx(cd.Provider,{scope:e.__scopeMenu,children:s.jsx(aa,{present:r||o.open,children:s.jsx(cd.Slot,{scope:e.__scopeMenu,children:s.jsx(Qb,{id:u.contentId,"aria-labelledby":u.triggerId,...a,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:Ge(e.onFocusOutside,h=>{h.target!==u.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Ge(e.onEscapeKeyDown,h=>{l.onClose(),h.preventDefault()}),onKeyDown:Ge(e.onKeyDown,h=>{const m=h.currentTarget.contains(h.target),g=$U[l.dir].includes(h.key);m&&g&&(o.onOpenChange(!1),u.trigger?.focus(),h.preventDefault())})})})})})});C_.displayName=S_;function j_(e){return e?"open":"closed"}function sh(e){return e==="indeterminate"}function Xb(e){return sh(e)?"indeterminate":e?"checked":"unchecked"}function a6(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function o6(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function i6(e,t,n){const a=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=o6(e,Math.max(o,0));a.length===1&&(l=l.filter(f=>f!==n));const d=l.find(f=>f.toLowerCase().startsWith(a.toLowerCase()));return d!==n?d:void 0}function l6(e,t){const{x:n,y:r}=e;let a=!1;for(let o=0,l=t.length-1;or!=g>r&&n<(m-f)*(r-h)/(g-h)+f&&(a=!a)}return a}function c6(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return l6(n,t)}function ud(e){return t=>t.pointerType==="mouse"?e(t):void 0}var u6=a_,d6=Kb,f6=i_,p6=l_,h6=Yb,m6=c_,g6=Zh,v6=d_,y6=p_,x6=m_,b6=v_,w6=y_,S6=x_,C6=w_,j6=C_,Xh="DropdownMenu",[k6]=sa(Xh,[r_]),Br=r_(),[E6,k_]=k6(Xh),E_=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:a,defaultOpen:o,onOpenChange:l,modal:u=!0}=e,d=Br(t),f=v.useRef(null),[h,m]=Ha({prop:a,defaultProp:o??!1,onChange:l,caller:Xh});return s.jsx(E6,{scope:t,triggerId:Ys(),triggerRef:f,contentId:Ys(),open:h,onOpenChange:m,onOpenToggle:v.useCallback(()=>m(g=>!g),[m]),modal:u,children:s.jsx(u6,{...d,open:h,onOpenChange:m,dir:r,modal:u,children:n})})};E_.displayName=Xh;var N_="DropdownMenuTrigger",T_=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...a}=e,o=k_(N_,n),l=Br(n);return s.jsx(d6,{asChild:!0,...l,children:s.jsx(wt.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,...a,ref:Yo(t,o.triggerRef),onPointerDown:Ge(e.onPointerDown,u=>{!r&&u.button===0&&u.ctrlKey===!1&&(o.onOpenToggle(),o.open||u.preventDefault())}),onKeyDown:Ge(e.onKeyDown,u=>{r||(["Enter"," "].includes(u.key)&&o.onOpenToggle(),u.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})});T_.displayName=N_;var N6="DropdownMenuPortal",M_=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Br(t);return s.jsx(f6,{...r,...n})};M_.displayName=N6;var __="DropdownMenuContent",P_=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=k_(__,n),o=Br(n),l=v.useRef(!1);return s.jsx(p6,{id:a.contentId,"aria-labelledby":a.triggerId,...o,...r,ref:t,onCloseAutoFocus:Ge(e.onCloseAutoFocus,u=>{l.current||a.triggerRef.current?.focus(),l.current=!1,u.preventDefault()}),onInteractOutside:Ge(e.onInteractOutside,u=>{const d=u.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0,h=d.button===2||f;(!a.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)"}})});P_.displayName=__;var T6="DropdownMenuGroup",M6=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Br(n);return s.jsx(h6,{...a,...r,ref:t})});M6.displayName=T6;var _6="DropdownMenuLabel",R_=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Br(n);return s.jsx(m6,{...a,...r,ref:t})});R_.displayName=_6;var P6="DropdownMenuItem",I_=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Br(n);return s.jsx(g6,{...a,...r,ref:t})});I_.displayName=P6;var R6="DropdownMenuCheckboxItem",O_=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Br(n);return s.jsx(v6,{...a,...r,ref:t})});O_.displayName=R6;var I6="DropdownMenuRadioGroup",O6=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Br(n);return s.jsx(y6,{...a,...r,ref:t})});O6.displayName=I6;var A6="DropdownMenuRadioItem",D6=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Br(n);return s.jsx(x6,{...a,...r,ref:t})});D6.displayName=A6;var F6="DropdownMenuItemIndicator",A_=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Br(n);return s.jsx(b6,{...a,...r,ref:t})});A_.displayName=F6;var L6="DropdownMenuSeparator",D_=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Br(n);return s.jsx(w6,{...a,...r,ref:t})});D_.displayName=L6;var $6="DropdownMenuArrow",B6=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Br(n);return s.jsx(S6,{...a,...r,ref:t})});B6.displayName=$6;var z6="DropdownMenuSubTrigger",U6=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Br(n);return s.jsx(C6,{...a,...r,ref:t})});U6.displayName=z6;var V6="DropdownMenuSubContent",q6=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Br(n);return s.jsx(j6,{...a,...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)"}})});q6.displayName=V6;var H6=E_,W6=T_,K6=M_,G6=P_,J6=R_,Q6=I_,Y6=O_,Z6=A_,cl=D_;/** + * @license lucide-react v0.522.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const X6=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),eV=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),aj=e=>{const t=eV(e);return t.charAt(0).toUpperCase()+t.slice(1)},F_=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),tV=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/** + * @license lucide-react v0.522.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var nV={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.522.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rV=v.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:o,iconNode:l,...u},d)=>v.createElement("svg",{ref:d,...nV,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:F_("lucide",a),...!o&&!tV(u)&&{"aria-hidden":"true"},...u},[...l.map(([f,h])=>v.createElement(f,h)),...Array.isArray(o)?o:[o]]));/** + * @license lucide-react v0.522.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const em=(e,t)=>{const n=v.forwardRef(({className:r,...a},o)=>v.createElement(rV,{ref:o,iconNode:t,className:F_(`lucide-${X6(aj(e))}`,`lucide-${e}`,r),...a}));return n.displayName=aj(e),n};/** + * @license lucide-react v0.522.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sV=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ew=em("check",sV);/** + * @license lucide-react v0.522.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const aV=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],L_=em("chevron-down",aV);/** + * @license lucide-react v0.522.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const oV=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],iV=em("chevron-up",oV);/** + * @license lucide-react v0.522.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const lV=[["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"}]],cV=em("grip-vertical",lV);function vs({...e}){return s.jsx(H6,{"data-slot":"dropdown-menu",...e})}function ys({...e}){return s.jsx(W6,{"data-slot":"dropdown-menu-trigger",...e})}function xs({className:e,sideOffset:t=4,...n}){return s.jsx(K6,{children:s.jsx(G6,{"data-slot":"dropdown-menu-content",sideOffset:t,className:Et("bg-popover text-popover-foreground 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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function Ct({className:e,inset:t,variant:n="default",...r}){return s.jsx(Q6,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:Et("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function uV({className:e,children:t,checked:n,...r}){return s.jsxs(Y6,{"data-slot":"dropdown-menu-checkbox-item",className:Et("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:n,...r,children:[s.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:s.jsx(Z6,{children:s.jsx(ew,{className:"size-4"})})}),t]})}function ei({className:e,inset:t,...n}){return s.jsx(J6,{"data-slot":"dropdown-menu-label","data-inset":t,className:Et("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...n})}function ti({className:e,...t}){return s.jsx(cl,{"data-slot":"dropdown-menu-separator",className:Et("bg-border -mx-1 my-1 h-px",e),...t})}function $_(){const{t:e,i18n:t}=Le(),n=r=>{t.changeLanguage(r),localStorage.setItem("i18nextLng",r),window.location.reload()};return s.jsxs(vs,{children:[s.jsx(ys,{asChild:!0,children:s.jsxs($,{variant:"outline",size:"icon",children:[s.jsx(mz,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all"}),s.jsx("span",{className:"sr-only",children:e("header.theme.label")})]})}),s.jsxs(xs,{align:"end",children:[s.jsx(Ct,{className:t.language==="pt-BR"?"font-bold":"",onClick:()=>n("pt-BR"),children:e("header.language.portuguese")}),s.jsx(Ct,{className:t.language==="en-US"?"font-bold":"",onClick:()=>n("en-US"),children:e("header.language.english")}),s.jsx(Ct,{className:t.language==="es-ES"?"font-bold":"",onClick:()=>n("es-ES"),children:e("header.language.spanish")}),s.jsx(Ct,{className:t.language==="fr-FR"?"font-bold":"",onClick:()=>n("fr-FR"),children:e("header.language.french")})]})]})}function B_(){const{t:e}=Le(),{setTheme:t}=Zi();return s.jsxs(vs,{children:[s.jsx(ys,{asChild:!0,children:s.jsxs($,{variant:"outline",size:"icon",children:[s.jsx(_z,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),s.jsx(wz,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),s.jsx("span",{className:"sr-only",children:e("header.theme.label")})]})}),s.jsxs(xs,{align:"end",children:[s.jsx(Ct,{onClick:()=>t("light"),children:e("header.theme.light")}),s.jsx(Ct,{onClick:()=>t("dark"),children:e("header.theme.dark")}),s.jsx(Ct,{onClick:()=>t("system"),children:e("header.theme.system")})]})]})}function z_({instanceId:e}){const{t}=Le(),[n,r]=v.useState(!1),a=Nn(),o=()=>{fx(),a("/manager/login")},{data:l}=kM({instanceId:e});return s.jsxs("header",{className:"flex h-16 items-center justify-end border-b border-sidebar-border bg-sidebar px-4 shadow-sm",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[e&&l&&s.jsxs("div",{className:"mr-2 flex items-center gap-2 rounded-md bg-sidebar-accent/50 px-3 py-1.5",children:[s.jsx(Dh,{className:"h-6 w-6",children:s.jsx(Fh,{src:l.profilePicUrl||"/assets/images/evolution-logo.png",alt:l.name})}),s.jsx("span",{className:"text-sm font-medium text-sidebar-foreground",children:l.profileName||l.name})]}),s.jsx($_,{}),s.jsx(B_,{}),s.jsxs($,{onClick:()=>r(!0),variant:"ghost",size:"sm",className:"gap-2 text-sidebar-foreground hover:bg-sidebar-accent",children:[s.jsx(hM,{className:"h-4 w-4"}),t("header.logout.action")]})]}),s.jsx(vt,{onOpenChange:r,open:n,children:s.jsxs(mt,{children:[s.jsxs(gt,{children:[s.jsx(xt,{children:t("header.logout.title")}),s.jsx(gr,{children:t("header.logout.description")})]}),s.jsx(Kt,{children:s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx($,{onClick:()=>r(!1),size:"sm",variant:"outline",children:t("button.cancel")}),s.jsx($,{onClick:o,variant:"destructive",children:t("header.logout.action")})]})})]})})]})}var tm="Collapsible",[dV]=sa(tm),[fV,tw]=dV(tm),U_=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:a,disabled:o,onOpenChange:l,...u}=e,[d,f]=Ha({prop:r,defaultProp:a??!1,onChange:l,caller:tm});return s.jsx(fV,{scope:n,disabled:o,contentId:Ys(),open:d,onOpenToggle:v.useCallback(()=>f(h=>!h),[f]),children:s.jsx(wt.div,{"data-state":rw(d),"data-disabled":o?"":void 0,...u,ref:t})})});U_.displayName=tm;var V_="CollapsibleTrigger",q_=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,a=tw(V_,n);return s.jsx(wt.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":rw(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...r,ref:t,onClick:Ge(e.onClick,a.onOpenToggle)})});q_.displayName=V_;var nw="CollapsibleContent",H_=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=tw(nw,e.__scopeCollapsible);return s.jsx(aa,{present:n||a.open,children:({present:o})=>s.jsx(pV,{...r,ref:t,present:o})})});H_.displayName=nw;var pV=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:a,...o}=e,l=tw(nw,n),[u,d]=v.useState(r),f=v.useRef(null),h=nn(t,f),m=v.useRef(0),g=m.current,b=v.useRef(0),x=b.current,w=l.open||u,C=v.useRef(w),k=v.useRef(void 0);return v.useEffect(()=>{const N=requestAnimationFrame(()=>C.current=!1);return()=>cancelAnimationFrame(N)},[]),er(()=>{const N=f.current;if(N){k.current=k.current||{transitionDuration:N.style.transitionDuration,animationName:N.style.animationName},N.style.transitionDuration="0s",N.style.animationName="none";const T=N.getBoundingClientRect();m.current=T.height,b.current=T.width,C.current||(N.style.transitionDuration=k.current.transitionDuration,N.style.animationName=k.current.animationName),d(r)}},[l.open,r]),s.jsx(wt.div,{"data-state":rw(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":x?`${x}px`:void 0,...e.style},children:w&&a})});function rw(e){return e?"open":"closed"}var hV=U_;function sw({...e}){return s.jsx(hV,{"data-slot":"collapsible",...e})}function aw({...e}){return s.jsx(q_,{"data-slot":"collapsible-trigger",...e})}function ow({...e}){return s.jsx(H_,{"data-slot":"collapsible-content",...e})}const W_=v.createContext(null),ct=()=>{const e=v.useContext(W_);if(!e)throw new Error("useInstance must be used within an InstanceProvider");return e},K_=({children:e})=>{const t=Os(),[n,r]=v.useState(null),{data:a,refetch:o}=kM({instanceId:n});return v.useEffect(()=>{t.instanceId?r(t.instanceId):r(null)},[t]),s.jsx(W_.Provider,{value:{instance:a??null,reloadInstance:async()=>{const l=await o();if(l.error)throw l.error}},children:e})},mV=new Set(Object.keys(dT)),gV=e=>mV.has(e),Sx=e=>!e||!gV(e)||fT(e);function G_({children:e,footer:t}){const n=new Date().getFullYear(),{theme:r}=Zi(),a=r==="dark"?"https://evolution-api.com/files/evo/evolution-logo-white.svg":"https://evolution-api.com/files/evo/evolution-logo.svg";return s.jsxs("aside",{className:"hidden md:flex bg-sidebar text-sidebar-foreground flex-col w-56 border-r border-sidebar-border",children:[s.jsx("div",{className:"h-16 flex items-center px-4 border-b border-sidebar-border",children:s.jsx("img",{src:a,alt:"Evolution API",className:"h-7"})}),s.jsx("nav",{className:"flex-1 overflow-y-auto px-2 py-4 space-y-1",children:e}),t&&s.jsx("div",{className:"border-t border-sidebar-border px-2 py-3 space-y-1",children:t}),s.jsxs("div",{className:"p-4 border-t border-sidebar-border",children:[s.jsx("div",{className:"text-sm font-medium text-primary",children:"Evolution Manager"}),s.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:["© ",n," All rights reserved"]})]})]})}function Oo({to:e,icon:t,label:n,isExternal:r}){return r?s.jsxs("a",{href:e,target:"_blank",rel:"noreferrer",className:"flex items-center gap-3 rounded-md px-3 py-2.5 text-sm font-medium text-muted-foreground transition-all hover:bg-accent hover:text-foreground",children:[t&&s.jsx(t,{className:"h-5 w-5 flex-shrink-0"}),s.jsx("span",{children:n})]}):s.jsx(RN,{to:e,className:({isActive:a})=>ln("flex items-center gap-3 rounded-md px-3 py-2.5 text-sm font-medium transition-all",a?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-accent hover:text-foreground"),children:({isActive:a})=>s.jsxs(s.Fragment,{children:[t&&s.jsx(t,{className:ln("h-5 w-5 flex-shrink-0",a&&"text-primary")}),s.jsx("span",{children:n})]})})}function J_(){const{t:e}=Le(),t=mr(Fn.API_URL)?.replace(/\/$/,"")??"";return s.jsxs(s.Fragment,{children:[s.jsx(Oo,{to:"https://github.com/Neup123/evolution-api/tree/main/docs",icon:oz,label:e("sidebar.documentation"),isExternal:!0}),s.jsx(Oo,{to:`${t}/docs`,icon:XB,label:"Swagger",isExternal:!0}),s.jsx(Oo,{to:`${t}/webhooks/docs`,icon:jz,label:"Webhook Events",isExternal:!0}),s.jsx(Oo,{to:"https://evolution-api.com/discord",icon:cc,label:e("sidebar.discord"),isExternal:!0})]})}function vV(){const{t:e}=Le();return s.jsxs(G_,{footer:s.jsx(J_,{}),children:[s.jsx(Oo,{to:"/manager",icon:gx,label:e("sidebar.dashboard")}),Sx("settingsTemplates")&&s.jsx(Oo,{to:"/manager/settings-templates",icon:Nz,label:"Settings templates"})]})}function yV(){const{t:e}=Le(),{instance:t}=ct(),{pathname:n}=Jo(),r=t?`/manager/instance/${t.id}`:"",a=v.useMemo(()=>[{id:"dashboard",title:e("sidebar.dashboard"),icon:gx,path:"dashboard"},{id:"chat",title:e("sidebar.chat"),icon:cc,path:"chat"},{title:e("sidebar.configurations"),icon:Zo,children:[{id:"settings",title:e("sidebar.settings"),path:"settings"},{id:"proxy",title:e("sidebar.proxy"),path:"proxy"}]},{title:e("sidebar.events"),icon:pz,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:Oz,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"}]}],[e]),o=v.useMemo(()=>a.map(l=>"children"in l?{...l,children:l.children.filter(u=>Sx(u.id))}:l).filter(l=>"children"in l?l.children.length>0:Sx(l.id)),[a]);return s.jsxs(G_,{footer:s.jsx(J_,{}),children:[s.jsx(Oo,{to:"/manager",icon:gx,label:`← ${e("dashboard.title")}`}),s.jsx("div",{className:"my-2 border-t border-sidebar-border"}),o.map(l=>{if("children"in l){const u=l.children.some(d=>d.path&&n.includes(d.path));return s.jsxs(sw,{defaultOpen:u,children:[s.jsxs(aw,{className:ln("flex w-full items-center gap-3 rounded-md px-3 py-2.5 text-sm font-medium transition-all",u?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-accent hover:text-foreground"),children:[s.jsx(l.icon,{className:ln("h-5 w-5 flex-shrink-0",u&&"text-primary")}),s.jsx("span",{children:l.title}),s.jsx(Ib,{className:"ml-auto h-4 w-4 transition-transform data-[state=open]:rotate-180"})]}),s.jsx(ow,{className:"ml-7 mt-1 flex flex-col gap-1 border-l border-sidebar-border pl-3",children:l.children.map(d=>s.jsx(RN,{to:`${r}/${d.path}`,className:({isActive:f})=>ln("rounded-md px-3 py-1.5 text-sm transition-all",f?"text-primary font-medium":"text-muted-foreground hover:text-foreground"),children:d.title},d.id))})]},l.title)}return s.jsx(Oo,{to:`${r}/${l.path}`,icon:l.icon,label:l.title},l.id)})]})}function _n({children:e}){const{instanceId:t}=Os();return s.jsx(K_,{children:s.jsxs("div",{className:"flex h-screen bg-background",children:[s.jsx(yV,{}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:[s.jsx(z_,{instanceId:t}),s.jsx("main",{className:"min-h-0 flex-1 overflow-y-auto p-6",children:e})]})]})})}function oj({children:e}){return s.jsxs("div",{className:"flex h-screen bg-background",children:[s.jsx(vV,{}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:[s.jsx(z_,{}),s.jsx("main",{className:"min-h-0 flex-1 overflow-y-auto p-6",children:e})]})]})}const xV="file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",Z=v.forwardRef(({className:e,type:t,...n},r)=>s.jsx("input",{ref:r,type:t,"data-slot":"input",className:ln(xV,e),...n}));Z.displayName="Input";function bV({className:e,...t}){return s.jsx("div",{"data-slot":"skeleton",className:Et("bg-accent animate-pulse rounded-md",e),...t})}function iw({title:e,subtitle:t,searchValue:n,onSearchChange:r,searchPlaceholder:a,primaryAction:o,secondaryActions:l=[],className:u,children:d}){const{t:f}=Le(),h=a??f("common.search");return s.jsxs("div",{className:ln("mb-6 space-y-6",u),children:[s.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-start md:justify-between",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx("h1",{className:"mb-1 text-2xl font-bold tracking-tight text-foreground",children:e}),t&&s.jsx("p",{className:"text-sm text-muted-foreground",children:t})]}),o&&s.jsx("div",{className:"flex-shrink-0",children:s.jsxs($,{disabled:o.disabled,onClick:o.onClick,variant:o.variant||"default",className:o.className,children:[o.icon&&s.jsx("span",{className:"mr-2 inline-flex",children:o.icon}),o.label]})})]}),(r||l.length>0)&&s.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[r&&s.jsxs("div",{className:"relative max-w-md flex-1",children:[s.jsx(gM,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),s.jsx(Z,{type:"search",placeholder:h,value:n??"",onChange:m=>r(m.target.value),className:"pl-9"})]}),l.length>0&&s.jsx("div",{className:"flex items-center gap-2",children:l.map((m,g)=>s.jsxs($,{disabled:m.disabled,variant:m.variant||"outline",size:"sm",onClick:m.onClick,className:m.className,children:[m.icon&&s.jsx("span",{className:"mr-2 inline-flex",children:m.icon}),m.label]},g))})]}),d]})}var wV=Eb("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function Ao({className:e,variant:t,asChild:n=!1,...r}){const a=n?DT:"span";return s.jsx(a,{"data-slot":"badge",className:Et(wV({variant:t}),e),...r})}function Un({className:e,...t}){return s.jsx("div",{"data-slot":"card",className:Et("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function Yn({className:e,...t}){return s.jsx("div",{"data-slot":"card-header",className:Et("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function Zn({className:e,...t}){return s.jsx("div",{"data-slot":"card-title",className:Et("leading-none font-semibold",e),...t})}function ij({className:e,...t}){return s.jsx("div",{"data-slot":"card-description",className:Et("text-muted-foreground text-sm",e),...t})}function Vn({className:e,...t}){return s.jsx("div",{"data-slot":"card-content",className:Et("px-6",e),...t})}function SV({className:e,...t}){return s.jsx("div",{"data-slot":"card-footer",className:Et("flex items-center px-6 [.border-t]:pt-6",e),...t})}var CV=Symbol.for("react.lazy"),ah=Ko[" use ".trim().toString()];function jV(e){return typeof e=="object"&&e!==null&&"then"in e}function Q_(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===CV&&"_payload"in e&&jV(e._payload)}function kV(e){const t=EV(e),n=v.forwardRef((r,a)=>{let{children:o,...l}=r;Q_(o)&&typeof ah=="function"&&(o=ah(o._payload));const u=v.Children.toArray(o),d=u.find(TV);if(d){const f=d.props.children,h=u.map(m=>m===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:m);return s.jsx(t,{...l,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...l,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function EV(e){const t=v.forwardRef((n,r)=>{let{children:a,...o}=n;if(Q_(a)&&typeof ah=="function"&&(a=ah(a._payload)),v.isValidElement(a)){const l=_V(a),u=MV(o,a.props);return a.type!==v.Fragment&&(u.ref=r?Yo(r,l):l),v.cloneElement(a,u)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var NV=Symbol("radix.slottable");function TV(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===NV}function MV(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...u)=>{const d=o(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function _V(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 PV=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],RV=PV.reduce((e,t)=>{const n=kV(`Primitive.${t}`),r=v.forwardRef((a,o)=>{const{asChild:l,...u}=a,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...u,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),IV="Label",Y_=v.forwardRef((e,t)=>s.jsx(RV.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Y_.displayName=IV;var OV=Y_;function Ve({className:e,...t}){return s.jsx(OV,{"data-slot":"label",className:Et("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}var nm="Tabs",[AV]=sa(nm,[Qh]),Z_=Qh(),[DV,lw]=AV(nm),X_=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:o,orientation:l="horizontal",dir:u,activationMode:d="automatic",...f}=e,h=Wh(u),[m,g]=Ha({prop:r,onChange:a,defaultProp:o??"",caller:nm});return s.jsx(DV,{scope:n,baseId:Ys(),value:m,onValueChange:g,orientation:l,dir:h,activationMode:d,children:s.jsx(wt.div,{dir:h,"data-orientation":l,...f,ref:t})})});X_.displayName=nm;var eP="TabsList",tP=v.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,o=lw(eP,n),l=Z_(n);return s.jsx(e_,{asChild:!0,...l,orientation:o.orientation,dir:o.dir,loop:r,children:s.jsx(wt.div,{role:"tablist","aria-orientation":o.orientation,...a,ref:t})})});tP.displayName=eP;var nP="TabsTrigger",rP=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...o}=e,l=lw(nP,n),u=Z_(n),d=oP(l.baseId,r),f=iP(l.baseId,r),h=r===l.value;return s.jsx(t_,{asChild:!0,...u,focusable:!a,active:h,children:s.jsx(wt.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":f,"data-state":h?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:d,...o,ref:t,onMouseDown:Ge(e.onMouseDown,m=>{!a&&m.button===0&&m.ctrlKey===!1?l.onValueChange(r):m.preventDefault()}),onKeyDown:Ge(e.onKeyDown,m=>{[" ","Enter"].includes(m.key)&&l.onValueChange(r)}),onFocus:Ge(e.onFocus,()=>{const m=l.activationMode!=="manual";!h&&!a&&m&&l.onValueChange(r)})})})});rP.displayName=nP;var sP="TabsContent",aP=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:o,...l}=e,u=lw(sP,n),d=oP(u.baseId,r),f=iP(u.baseId,r),h=r===u.value,m=v.useRef(h);return v.useEffect(()=>{const g=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(g)},[]),s.jsx(aa,{present:a||h,children:({present:g})=>s.jsx(wt.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})})});aP.displayName=sP;function oP(e,t){return`${e}-trigger-${t}`}function iP(e,t){return`${e}-content-${t}`}var FV=X_,LV=tP,$V=rP,BV=aP;function cw({className:e,...t}){return s.jsx(FV,{"data-slot":"tabs",className:Et("flex flex-col gap-2",e),...t})}function uw({className:e,...t}){return s.jsx(LV,{"data-slot":"tabs-list",className:Et("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function oh({className:e,...t}){return s.jsx($V,{"data-slot":"tabs-trigger",className:Et("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function ih({className:e,...t}){return s.jsx(BV,{"data-slot":"tabs-content",className:Et("flex-1 outline-none",e),...t})}function ni({className:e,...t}){return s.jsx("textarea",{"data-slot":"textarea",className:Et("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}const zV={reply:"sendButtons",cta:"sendButtons",pix:"sendButtons",list:"sendList",carousel:"sendCarousel"},_u={reply:{title:"Resposta Rápida",description:"Escolha uma das opções abaixo:",footer:"Evolution API",buttons:[{type:"reply",displayText:"✅ Confirmar",id:"opt_confirm"},{type:"reply",displayText:"❌ Cancelar",id:"opt_cancel"},{type:"reply",displayText:"🤔 Talvez",id:"opt_maybe"}]},cta:{title:"Botões CTA",description:"Botões de URL e copia-código (cta_url + cta_copy):",footer:"Máx. 2 botões CTA por mensagem",buttons:[{type:"url",displayText:"🌐 Abrir site",url:"https://example.com"},{type:"copy",displayText:"📋 Copiar PIX",copyCode:"00020126580014BR.GOV.BCB.PIX0136abc12345-6789-0000-aaaa-bbbbccccdddd5204000053039865802BR5913FULANO DE TAL6009SAO PAULO62070503***6304ABCD"}]},pix:{title:"Pagamento via PIX",description:"Toque para pagar via PIX (payment_info)",footer:"WhatsApp Pay",buttons:[{type:"pix",currency:"BRL",name:"Empresa Exemplo",keyType:"random",key:"abc12345-6789-0000-aaaa-bbbbccccdddd"}]},list:{title:"Cardápio de Teste",description:"Escolha um item abaixo",footerText:"Validade hoje",buttonText:"Ver opções",sections:[{title:"Bebidas",rows:[{title:"Coca-Cola",description:"Lata 350ml",rowId:"coca"},{title:"Suco de Laranja",description:"300ml natural",rowId:"suco"}]},{title:"Lanches",rows:[{title:"X-Burger",description:"Pão, carne 150g, queijo",rowId:"xburger"}]}]},carousel:{body:"Catálogo da semana",cards:[{body:"Produto A",footer:"R$ 99,90",imageUrl:"https://picsum.photos/seed/a/600/400",buttons:[{type:"url",displayText:"Comprar",url:"https://exemplo.com/a"}]},{body:"Produto B",footer:"R$ 149,90",imageUrl:"https://picsum.photos/seed/b/600/400",buttons:[{type:"url",displayText:"Comprar",url:"https://exemplo.com/b"}]},{body:"Produto C",footer:"R$ 199,90",imageUrl:"https://picsum.photos/seed/c/600/400",buttons:[{type:"reply",displayText:"Quero!",id:"prod_c"}]}]}};function UV({instance:e,open:t,onOpenChange:n}){const{t:r}=Le(),[a,o]=v.useState("reply"),[l,u]=v.useState(""),[d,f]=v.useState(()=>({reply:JSON.stringify(_u.reply,null,2),cta:JSON.stringify(_u.cta,null,2),pix:JSON.stringify(_u.pix,null,2),list:JSON.stringify(_u.list,null,2),carousel:JSON.stringify(_u.carousel,null,2)})),[h,m]=v.useState(!1);v.useEffect(()=>{t||m(!1)},[t]);const g=v.useMemo(()=>`/message/${zV[a]}/${e.name}`,[a,e.name]),b=async()=>{const w=l.replace(/\D/g,"");if(!w){Q.error(r("testInteractive.errors.missingNumber"));return}let C;try{C=JSON.parse(d[a])}catch(k){Q.error(r("testInteractive.errors.invalidJson",{message:k.message}));return}C.number=w;try{m(!0);const k=await Ce.post(g,C,{headers:{apikey:e.token}}),N=k.data?.key?.id||k.data?.messageId||"ok";Q.success(r("testInteractive.success",{id:N})),n(!1)}catch(k){const N=k?.response?.data?.response?.message||k?.response?.data?.message||k?.message||r("testInteractive.errors.unknown");Q.error(Array.isArray(N)?N.join("; "):N)}finally{m(!1)}},x=[{key:"reply",label:r("testInteractive.tabs.reply")},{key:"cta",label:r("testInteractive.tabs.cta")},{key:"pix",label:r("testInteractive.tabs.pix")},{key:"list",label:r("testInteractive.tabs.list")},{key:"carousel",label:r("testInteractive.tabs.carousel")}];return s.jsx(vt,{open:t,onOpenChange:w=>!h&&n(w),children:s.jsxs(mt,{className:"max-w-2xl",children:[s.jsx(gt,{children:s.jsx(xt,{children:r("testInteractive.title")})}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("p",{className:"text-xs text-muted-foreground",children:[r("testInteractive.subtitle",{instance:e.name})," ",s.jsxs("code",{className:"rounded bg-muted px-1 py-0.5 text-[11px]",children:["POST ",g]})]}),s.jsxs(cw,{value:a,onValueChange:w=>o(w),children:[s.jsx(uw,{className:"grid w-full grid-cols-5",children:x.map(w=>s.jsx(oh,{value:w.key,children:w.label},w.key))}),x.map(w=>s.jsxs(ih,{value:w.key,className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{htmlFor:"ti-number",children:r("testInteractive.number")}),s.jsx(Z,{id:"ti-number",placeholder:"5511999999999",value:l,onChange:C=>u(C.target.value)}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:r("testInteractive.numberHint")})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{htmlFor:"ti-payload",children:r("testInteractive.payload")}),s.jsx(ni,{id:"ti-payload",rows:12,className:"font-mono text-xs",value:d[w.key],onChange:C=>f(k=>({...k,[w.key]:C.target.value}))})]})]},w.key))]}),s.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[s.jsx($,{variant:"outline",onClick:()=>n(!1),disabled:h,children:r("button.cancel")}),s.jsx($,{onClick:b,disabled:h,children:r(h?"testInteractive.sending":"testInteractive.send")})]})]})]})})}const VV=({status:e})=>{const{t}=Le();return e==="open"?s.jsx(Ao,{className:"bg-green-500/10 text-green-500 hover:bg-green-500/20",children:t("status.open")}):e==="connecting"?s.jsx(Ao,{className:"bg-yellow-500/10 text-yellow-500 hover:bg-yellow-500/20",children:t("status.connecting")}):s.jsx(Ao,{className:"bg-red-500/10 text-red-500 hover:bg-red-500/20",children:t("status.closed")})};function qV({instance:e,isDeleting:t,onDelete:n}){const{t:r,i18n:a}=Le(),o=Nn(),[l,u]=v.useState(!1),d=new Intl.NumberFormat(a.language),f=e.profileName||e.name,h=()=>o(`/manager/instance/${e.id}/dashboard`),m=e.connectionStatus==="open";return s.jsxs(Un,{className:"group relative overflow-hidden border-sidebar-border bg-sidebar transition-all duration-300 hover:bg-sidebar-accent/30 hover:shadow-lg hover:shadow-black/10",children:[s.jsxs(Vn,{className:"p-0",children:[s.jsxs("button",{type:"button",onClick:h,className:"flex w-full items-center gap-3 border-b border-sidebar-border p-4 text-left",children:[e.profilePicUrl?s.jsx("div",{className:"flex-shrink-0",children:s.jsx("div",{className:"flex h-14 w-14 items-center justify-center overflow-hidden rounded-lg bg-muted",children:s.jsx("img",{src:e.profilePicUrl,alt:f,className:"h-12 w-12 rounded-lg object-cover",onError:g=>{g.target.style.display="none"}})})}):s.jsx("div",{className:"flex h-14 w-14 flex-shrink-0 items-center justify-center rounded-lg bg-muted text-lg font-semibold text-muted-foreground",children:f.slice(0,2).toUpperCase()}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("h3",{className:"truncate text-base font-semibold text-sidebar-foreground",children:f}),s.jsx("p",{className:"truncate text-xs text-sidebar-foreground/60",children:e.name})]}),s.jsx("div",{className:"flex-shrink-0",children:s.jsx(VV,{status:e.connectionStatus})})]}),s.jsxs("div",{className:"space-y-1 px-4 py-3 text-xs text-sidebar-foreground/70",children:[e.ownerJid&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{children:r("dashboard.card.phone",{defaultValue:"Número"})}),s.jsx("span",{className:"ml-2 truncate font-mono",children:e.ownerJid.split("@")[0]})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{children:r("instance.dashboard.contacts")}),s.jsx("span",{className:"font-mono",children:d.format(e._count?.Contact||0)})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{children:r("instance.dashboard.messages")}),s.jsx("span",{className:"font-mono",children:d.format(e._count?.Message||0)})]})]}),s.jsxs("div",{className:"flex border-t border-sidebar-border opacity-0 transition-opacity duration-200 group-hover:opacity-100",children:[s.jsxs($,{variant:"ghost",className:"h-12 flex-1 rounded-none text-muted-foreground hover:bg-accent hover:text-foreground",onClick:h,children:[s.jsx(kz,{className:"mr-2 h-4 w-4"}),r("dashboard.settings")]}),s.jsx("div",{className:"w-px bg-sidebar-border"}),s.jsx($,{variant:"ghost",className:"h-12 rounded-none px-4 text-muted-foreground hover:bg-accent hover:text-foreground disabled:opacity-40",disabled:!m,title:r(m?"testInteractive.title":"testInteractive.requiresOpen"),onClick:()=>u(!0),children:s.jsx(lz,{className:"h-4 w-4"})}),s.jsx("div",{className:"w-px bg-sidebar-border"}),s.jsx($,{variant:"ghost",className:"h-12 rounded-none px-4 text-red-500 hover:bg-red-500/10 hover:text-red-400",disabled:t,onClick:()=>n(e),children:s.jsx(Ab,{className:"h-4 w-4"})})]})]}),s.jsx(UV,{instance:e,open:l,onOpenChange:u})]})}const HV=["instance","fetchInstances","go"],WV=async()=>((await qt.get("/instance/all")).data?.data??[]).map(jM),KV=e=>pt({refetchInterval:5e3,...e,queryKey:HV,queryFn:()=>WV()}),GV=["instance","fetchInstances"],JV=async()=>(await qt.get("/instance/fetchInstances")).data,QV=e=>pt({...e,queryKey:GV,queryFn:()=>JV()}),YV=e=>{const t=vr(),n=QV({...e,enabled:t==="api"}),r=KV({...e,enabled:t==="go"});return t==="go"?r:n},ZV=e=>({rejectCall:e.rejectCall,msgCall:e.msgRejectCall,groupsIgnore:e.ignoreGroups,alwaysOnline:e.alwaysOnline,readMessages:e.readMessages,readStatus:!e.ignoreStatus,syncFullHistory:!1}),XV=e=>({alwaysOnline:e.alwaysOnline,rejectCall:e.rejectCall,msgRejectCall:e.msgCall??"",readMessages:e.readMessages,ignoreGroups:e.groupsIgnore,ignoreStatus:!e.readStatus}),e8=e=>["instance","fetchSettings","go",JSON.stringify(e)],t8=(e,t)=>{const r=e.getQueryData(["instance","fetchInstances","go"])?.find(o=>o.name===t);if(r)return r.id;const a=e.getQueriesData({queryKey:["instance","fetchInstance","go"]});for(const[,o]of a)if(o?.name===t)return o.id},n8=e=>{const t=ja(),{instanceName:n,token:r,enabled:a,...o}=e;return pt({...o,queryKey:e8({instanceName:n,token:r}),queryFn:async()=>{const l=t8(t,n);if(!l)throw new Error(`Instance "${n}" not found in cache`);const u=await qt.get(`/instance/${l}/advanced-settings`,{headers:{apikey:r}}),d=u.data?.data??u.data;return ZV(d)},enabled:!!n&&(a??!0),retry:!1})},Pu=(e,t)=>{const r=e.getQueryData(["instance","fetchInstances","go"])?.find(o=>o.name===t);if(r)return r;const a=e.getQueriesData({queryKey:["instance","fetchInstance","go"]});for(const[,o]of a)if(o?.name===t)return o},r8=e=>({createInstance:async u=>{const d={name:u.instanceName,token:u.token??void 0};return u.proxy?.host&&u.proxy?.port&&(d.proxy={host:u.proxy.host,port:u.proxy.port,username:u.proxy.username??"",password:u.proxy.password??""}),(await qt.post("/instance/create",d)).data},restart:async u=>{const d=Pu(e,u);if(!d)throw new Error(`Instance "${u}" not found in cache`);return(await qt.post("/instance/reconnect",{},{headers:{apikey:d.token}})).data},logout:async u=>{const d=Pu(e,u);if(!d)throw new Error(`Instance "${u}" not found in cache`);return(await qt.delete("/instance/logout",{headers:{apikey:d.token}})).data},deleteInstance:async u=>{const d=Pu(e,u);if(!d)throw new Error(`Instance "${u}" not found in cache`);return(await qt.delete(`/instance/delete/${d.id}`)).data},connect:async({instanceName:u,token:d,number:f})=>{const m=Pu(e,u)?.token??d;if(!m)throw new Error(`Instance "${u}" not found in cache`);const g={webhookUrl:"",subscribe:[],rabbitmqEnable:"",websocketEnable:"",natsEnable:""};try{await qt.post("/instance/connect",g,{headers:{apikey:m}})}catch{}await new Promise(C=>setTimeout(C,1e3));const b=C=>C?C.startsWith("data:")?C:`data:image/png;base64,${C}`:"",x=async()=>{try{const C=await qt.get("/instance/qr",{headers:{apikey:m}}),k=C.data?.data??C.data;return{code:k?.Code??k?.code??"",base64:b(k?.Qrcode??k?.qrcode??"")}}catch{return{code:"",base64:""}}};if(f){let C=f.trim();C.startsWith("+")||(C=`+${C}`);const k=await qt.post("/instance/pair",{subscribe:[],phone:C},{headers:{apikey:m}}),N=k.data?.data??k.data,T=N?.PairingCode??N?.pairingCode??"";return{...await x(),pairingCode:T}}return{...await x(),pairingCode:""}},updateSettings:async({instanceName:u,token:d,data:f})=>{const h=Pu(e,u);if(!h)throw new Error(`Instance "${u}" not found in cache`);return(await qt.put(`/instance/${h.id}/advanced-settings`,XV(f),{headers:{apikey:d}})).data}});function nt(e,t){const n=ja(),r=QD({mutationFn:e});return(a,o)=>r.mutateAsync(a,{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 s8=async e=>(await qt.post("/instance/create",e)).data,a8=async e=>(await Ce.post(`/instance/restart/${e}`)).data,o8=async e=>(await Ce.delete(`/instance/logout/${e}`)).data,i8=async e=>(await qt.delete(`/instance/delete/${e}`)).data,l8=async({instanceName:e,token:t,number:n})=>(await Ce.get(`/instance/connect/${e}`,{headers:{apikey:t},params:{number:n}})).data,c8=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/settings/set/${e}`,n,{headers:{apikey:t}})).data;function Tc(){const e=ja(),n=vr()==="go"?r8(e):null,r=nt(n?n.connect:l8,{invalidateKeys:[["instance","fetchInstance"],["instance","fetchInstances"]]}),a=nt(n?n.updateSettings:c8,{invalidateKeys:[["instance","fetchSettings"]]}),o=nt(n?n.deleteInstance:i8,{invalidateKeys:[["instance","fetchInstance"],["instance","fetchInstances"]]}),l=nt(n?n.logout:o8,{invalidateKeys:[["instance","fetchInstance"],["instance","fetchInstances"]]}),u=nt(n?n.restart:a8,{invalidateKeys:[["instance","fetchInstance"],["instance","fetchInstances"]]}),d=nt(n?n.createInstance:s8,{invalidateKeys:[["instance","fetchInstances"]]});return{connect:r,updateSettings:a,deleteInstance:o,logout:l,restart:u,createInstance:d}}var Td=e=>e.type==="checkbox",Ai=e=>e instanceof Date,Qr=e=>e==null;const lP=e=>typeof e=="object";var qn=e=>!Qr(e)&&!Array.isArray(e)&&lP(e)&&!Ai(e),cP=e=>qn(e)&&e.target?Td(e.target)?e.target.checked:e.target.value:e,uP=(e,t)=>t.split(".").some((n,r,a)=>!isNaN(Number(n))&&e.has(a.slice(0,r).join("."))),u8=e=>{const t=e.constructor&&e.constructor.prototype;return qn(t)&&t.hasOwnProperty("isPrototypeOf")},dw=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function bn(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(dw&&(e instanceof Blob||t))return e;const n=Array.isArray(e);if(!n&&!(qn(e)&&u8(e)))return e;const r=n?[]:Object.create(Object.getPrototypeOf(e));for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&(r[a]=bn(e[a]));return r}var rm=e=>/^\w*$/.test(e),hn=e=>e===void 0,sm=e=>Array.isArray(e)?e.filter(Boolean):[],fw=e=>sm(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Oe=(e,t,n)=>{if(!t||!qn(e))return n;const r=(rm(t)?[t]:fw(t)).reduce((a,o)=>Qr(a)?a:a[o],e);return hn(r)||r===e?hn(e[t])?n:e[t]:r},ds=e=>typeof e=="boolean",Fr=e=>typeof e=="function",en=(e,t,n)=>{let r=-1;const a=rm(t)?[t]:fw(t),o=a.length,l=o-1;for(;++rke.useContext(pw);var fP=(e,t,n,r=!0)=>{const a={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(a,o,{get:()=>{const l=o;return t._proxyFormState[l]!==Ps.all&&(t._proxyFormState[l]=!r||Ps.all),n&&(n[l]=!0),e[l]}});return a};const om=typeof window<"u"?ke.useLayoutEffect:ke.useEffect;function d8(e){const t=am(),{control:n=t,disabled:r,name:a,exact:o}=e||{},[l,u]=ke.useState(n._formState),d=ke.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return om(()=>n._subscribe({name:a,formState:d.current,exact:o,callback:f=>{!r&&u({...n._formState,...f})}}),[a,r,o]),ke.useEffect(()=>{d.current.isValid&&n._setValid(!0)},[n]),ke.useMemo(()=>fP(l,n,d.current,!1),[l,n])}var Lr=e=>typeof e=="string",Cx=(e,t,n,r,a)=>Lr(e)?(r&&t.watch.add(e),Oe(n,e,a)):Array.isArray(e)?e.map(o=>(r&&t.watch.add(o),Oe(n,o))):(r&&(t.watchAll=!0),n),jx=e=>Qr(e)||!lP(e);function Js(e,t,n=new WeakSet){if(jx(e)||jx(t))return Object.is(e,t);if(Ai(e)&&Ai(t))return Object.is(e.getTime(),t.getTime());const r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const o of r){const l=e[o];if(!a.includes(o))return!1;if(o!=="ref"){const u=t[o];if(Ai(l)&&Ai(u)||(qn(l)||Array.isArray(l))&&(qn(u)||Array.isArray(u))?!Js(l,u,n):!Object.is(l,u))return!1}}return!0}function f8(e){const t=am(),{control:n=t,name:r,defaultValue:a,disabled:o,exact:l,compute:u}=e||{},d=ke.useRef(a),f=ke.useRef(u),h=ke.useRef(void 0),m=ke.useRef(n),g=ke.useRef(r);f.current=u;const[b,x]=ke.useState(()=>{const _=n._getWatch(r,d.current);return f.current?f.current(_):_}),w=ke.useCallback(_=>{const P=Cx(r,n._names,_||n._formValues,!1,d.current);return f.current?f.current(P):P},[n._formValues,n._names,r]),C=ke.useCallback(_=>{if(!o){const P=Cx(r,n._names,_||n._formValues,!1,d.current);if(f.current){const M=f.current(P);Js(M,h.current)||(x(M),h.current=M)}else x(P)}},[n._formValues,n._names,o,r]);om(()=>((m.current!==n||!Js(g.current,r))&&(m.current=n,g.current=r,C()),n._subscribe({name:r,formState:{values:!0},exact:l,callback:_=>{C(_.values)}})),[n,l,r,C]),ke.useEffect(()=>n._removeUnmounted());const k=m.current!==n,N=g.current,T=ke.useMemo(()=>{if(o)return null;const _=!k&&!Js(N,r);return k||_?w():null},[o,k,r,N,w]);return T!==null?T:b}function p8(e){const t=am(),{name:n,disabled:r,control:a=t,shouldUnregister:o,defaultValue:l,exact:u=!0}=e,d=uP(a._names.array,n),f=ke.useMemo(()=>Oe(a._formValues,n,Oe(a._defaultValues,n,l)),[a,n,l]),h=f8({control:a,name:n,defaultValue:f,exact:u}),m=d8({control:a,name:n,exact:u}),g=ke.useRef(e),b=ke.useRef(void 0),x=ke.useRef(a.register(n,{...e.rules,value:h,...ds(e.disabled)?{disabled:e.disabled}:{}}));g.current=e;const w=ke.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Oe(m.errors,n)},isDirty:{enumerable:!0,get:()=>!!Oe(m.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Oe(m.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Oe(m.validatingFields,n)},error:{enumerable:!0,get:()=>Oe(m.errors,n)}}),[m,n]),C=ke.useCallback(_=>x.current.onChange({target:{value:cP(_),name:n},type:_o.CHANGE}),[n]),k=ke.useCallback(()=>x.current.onBlur({target:{value:Oe(a._formValues,n),name:n},type:_o.BLUR}),[n,a._formValues]),N=ke.useCallback(_=>{const P=Oe(a._fields,n);P&&P._f&&_&&(P._f.ref={focus:()=>Fr(_.focus)&&_.focus(),select:()=>Fr(_.select)&&_.select(),setCustomValidity:M=>Fr(_.setCustomValidity)&&_.setCustomValidity(M),reportValidity:()=>Fr(_.reportValidity)&&_.reportValidity()})},[a._fields,n]),T=ke.useMemo(()=>({name:n,value:h,...ds(r)||m.disabled?{disabled:m.disabled||r}:{},onChange:C,onBlur:k,ref:N}),[n,r,m.disabled,C,k,N,h]);return ke.useEffect(()=>{const _=a._options.shouldUnregister||o,P=b.current;P&&P!==n&&!d&&a.unregister(P),a.register(n,{...g.current.rules,...ds(g.current.disabled)?{disabled:g.current.disabled}:{}});const M=(O,D)=>{const F=Oe(a._fields,O);F&&F._f&&(F._f.mount=D)};if(M(n,!0),_){const O=bn(Oe(a._options.defaultValues,n,g.current.defaultValue));en(a._defaultValues,n,O),hn(Oe(a._formValues,n))&&en(a._formValues,n,O)}return!d&&a.register(n),b.current=n,()=>{(d?_&&!a._state.action:_)?a.unregister(n):M(n,!1)}},[n,a,d,o]),ke.useEffect(()=>{a._setDisabledField({disabled:r,name:n})},[r,n,a]),ke.useMemo(()=>({field:T,formState:m,fieldState:w}),[T,m,w])}const h8=e=>e.render(p8(e)),hw=ke.createContext(null);hw.displayName="HookFormContext";const m8=()=>ke.useContext(hw),yr=e=>{const{children:t,watch:n,getValues:r,getFieldState:a,setError:o,clearErrors:l,setValue:u,trigger:d,formState:f,resetField:h,reset:m,handleSubmit:g,unregister:b,control:x,register:w,setFocus:C,subscribe:k}=e,N=ke.useMemo(()=>({watch:n,getValues:r,getFieldState:a,setError:o,clearErrors:l,setValue:u,trigger:d,formState:f,resetField:h,reset:m,handleSubmit:g,unregister:b,control:x,register:w,setFocus:C,subscribe:k}),[l,x,f,a,r,g,w,m,h,o,C,u,k,d,b,n]);return ke.createElement(hw.Provider,{value:N},ke.createElement(pw.Provider,{value:N.control},t))};var pP=(e,t,n,r,a)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:a||!0}}:{},Yr=e=>Array.isArray(e)?e:[e],lj=()=>{let e=[];return{get observers(){return e},next:a=>{for(const o of e)o.next&&o.next(a)},subscribe:a=>(e.push(a),{unsubscribe:()=>{e=e.filter(o=>o!==a)}}),unsubscribe:()=>{e=[]}}};function hP(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const a=e[r],o=t[r];if(a&&qn(a)&&o){const l=hP(a,o);qn(l)&&(n[r]=l)}else e[r]&&(n[r]=o)}return n}var Nr=e=>qn(e)&&!Object.keys(e).length,mw=e=>e.type==="file",lh=e=>{if(!dw)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},mP=e=>e.type==="select-multiple",gw=e=>e.type==="radio",g8=e=>gw(e)||Td(e),Hv=e=>lh(e)&&e.isConnected;function v8(e,t){const n=t.slice(0,-1).length;let r=0;for(;r{for(const t in e)if(Fr(e[t]))return!0;return!1};function gP(e){return Array.isArray(e)||qn(e)&&!x8(e)}function kx(e,t={}){for(const n in e){const r=e[n];gP(r)?(t[n]=Array.isArray(r)?[]:{},kx(r,t[n])):hn(r)||(t[n]=!0)}return t}function Hu(e,t,n){n||(n=kx(t));for(const r in e){const a=e[r];if(gP(a))hn(t)||jx(n[r])?n[r]=kx(a,Array.isArray(a)?[]:{}):Hu(a,Qr(t)?{}:t[r],n[r]);else{const o=t[r];n[r]=!Js(a,o)}}return n}const cj={value:!1,isValid:!1},uj={value:!0,isValid:!0};var vP=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&&!hn(e[0].attributes.value)?hn(e[0].value)||e[0].value===""?uj:{value:e[0].value,isValid:!0}:uj:cj}return cj},yP=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>hn(e)?e:t?e===""?NaN:e&&+e:n&&Lr(e)?new Date(e):r?r(e):e;const dj={isValid:!1,value:null};var xP=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,dj):dj;function fj(e){const t=e.ref;return mw(t)?t.files:gw(t)?xP(e.refs).value:mP(t)?[...t.selectedOptions].map(({value:n})=>n):Td(t)?vP(e.refs).value:yP(hn(t.value)?e.ref.value:t.value,e)}var b8=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,w8=(e,t,n,r)=>{const a={};for(const o of e){const l=Oe(t,o);l&&en(a,o,l._f)}return{criteriaMode:n,names:[...e],fields:a,shouldUseNativeValidation:r}},ch=e=>e instanceof RegExp,Ru=e=>hn(e)?e:ch(e)?e.source:qn(e)?ch(e.value)?e.value.source:e.value:e,Gl=e=>({isOnSubmit:!e||e===Ps.onSubmit,isOnBlur:e===Ps.onBlur,isOnChange:e===Ps.onChange,isOnAll:e===Ps.all,isOnTouch:e===Ps.onTouched});const pj="AsyncFunction";var S8=e=>!!e&&!!e.validate&&!!(Fr(e.validate)&&e.validate.constructor.name===pj||qn(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===pj)),C8=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Ex=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Xl=(e,t,n,r)=>{for(const a of n||Object.keys(e)){const o=Oe(e,a);if(o){const{_f:l,...u}=o;if(l){if(l.refs&&l.refs[0]&&t(l.refs[0],a)&&!r)return!0;if(l.ref&&t(l.ref,l.name)&&!r)return!0;if(Xl(u,t))break}else if(qn(u)&&Xl(u,t))break}}};function hj(e,t,n){const r=Oe(e,n);if(r||rm(n))return{error:r,name:n};const a=n.split(".");for(;a.length;){const o=a.join("."),l=Oe(t,o),u=Oe(e,o);if(l&&!Array.isArray(l)&&n!==o)return{name:n};if(u&&u.type)return{name:o,error:u};if(u&&u.root&&u.root.type)return{name:`${o}.root`,error:u.root};a.pop()}return{name:n}}var j8=(e,t,n,r)=>{n(e);const{name:a,...o}=e;return Nr(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(l=>t[l]===(!r||Ps.all))},k8=(e,t,n)=>!e||!t||e===t||Yr(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),E8=(e,t,n,r,a)=>a.isOnAll?!1:!n&&a.isOnTouch?!(t||e):(n?r.isOnBlur:a.isOnBlur)?!e:(n?r.isOnChange:a.isOnChange)?e:!0,N8=(e,t)=>!sm(Oe(e,t)).length&&zn(e,t),bP=(e,t,n)=>{const r=Yr(Oe(e,n));return en(r,dP,t[n]),en(e,n,r),e};function mj(e,t,n="validate"){if(Lr(e)||Array.isArray(e)&&e.every(Lr)||ds(e)&&!e)return{type:n,message:Lr(e)?e:"",ref:t}}var Ll=e=>qn(e)&&!ch(e)?e:{value:e,message:""},Nx=async(e,t,n,r,a,o)=>{const{ref:l,refs:u,required:d,maxLength:f,minLength:h,min:m,max:g,pattern:b,validate:x,name:w,valueAsNumber:C,mount:k}=e._f,N=Oe(n,w);if(!k||t.has(w))return{};const T=u?u[0]:l,_=U=>{a&&T.reportValidity&&(T.setCustomValidity(ds(U)?"":U||""),T.reportValidity())},P={},M=gw(l),O=Td(l),D=M||O,F=(C||mw(l))&&hn(l.value)&&hn(N)||lh(l)&&l.value===""||N===""||Array.isArray(N)&&!N.length,B=pP.bind(null,w,r,P),te=(U,ce,q,ne=qs.maxLength,Y=qs.minLength)=>{const se=U?ce:q;P[w]={type:U?ne:Y,message:se,ref:l,...B(U?ne:Y,se)}};if(o?!Array.isArray(N)||!N.length:d&&(!D&&(F||Qr(N))||ds(N)&&!N||O&&!vP(u).isValid||M&&!xP(u).isValid)){const{value:U,message:ce}=Lr(d)?{value:!!d,message:d}:Ll(d);if(U&&(P[w]={type:qs.required,message:ce,ref:T,...B(qs.required,ce)},!r))return _(ce),P}if(!F&&(!Qr(m)||!Qr(g))){let U,ce;const q=Ll(g),ne=Ll(m);if(!Qr(N)&&!isNaN(N)){const Y=l.valueAsNumber||N&&+N;Qr(q.value)||(U=Y>q.value),Qr(ne.value)||(ce=Ynew Date(new Date().toDateString()+" "+V),H=l.type=="time",W=l.type=="week";Lr(q.value)&&N&&(U=H?se(N)>se(q.value):W?N>q.value:Y>new Date(q.value)),Lr(ne.value)&&N&&(ce=H?se(N)+U.value,ne=!Qr(ce.value)&&N.length<+ce.value;if((q||ne)&&(te(q,U.message,ce.message),!r))return _(P[w].message),P}if(b&&!F&&Lr(N)){const{value:U,message:ce}=Ll(b);if(ch(U)&&!N.match(U)&&(P[w]={type:qs.pattern,message:ce,ref:l,...B(qs.pattern,ce)},!r))return _(ce),P}if(x){if(Fr(x)){const U=await x(N,n),ce=mj(U,T);if(ce&&(P[w]={...ce,...B(qs.validate,ce.message)},!r))return _(ce.message),P}else if(qn(x)){let U={};for(const ce in x){if(!Nr(U)&&!r)break;const q=mj(await x[ce](N,n),T,ce);q&&(U={...q,...B(ce,q.message)},_(q.message),r&&(P[w]=U))}if(!Nr(U)&&(P[w]={ref:T,...U},!r))return P}}return _(!0),P};const T8={mode:Ps.onSubmit,reValidateMode:Ps.onChange,shouldFocusError:!0};function M8(e={}){let t={...T8,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Fr(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},a=qn(t.defaultValues)||qn(t.values)?bn(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:bn(a),l={action:!1,mount:!1,watch:!1,keepIsValid:!1},u={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},d,f=0;const h={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},m={...h};let g={...m};const b={array:lj(),state:lj()},x=t.criteriaMode===Ps.all,w=z=>oe=>{clearTimeout(f),f=setTimeout(z,oe)},C=async z=>{if(!l.keepIsValid&&!t.disabled&&(m.isValid||g.isValid||z)){let oe;t.resolver?(oe=Nr((await F()).errors),k()):oe=await U({fields:r,onlyCheckValid:!0,eventType:_o.VALID}),oe!==n.isValid&&b.state.next({isValid:oe})}},k=(z,oe)=>{!t.disabled&&(m.isValidating||m.validatingFields||g.isValidating||g.validatingFields)&&((z||Array.from(u.mount)).forEach(fe=>{fe&&(oe?en(n.validatingFields,fe,oe):zn(n.validatingFields,fe))}),b.state.next({validatingFields:n.validatingFields,isValidating:!Nr(n.validatingFields)}))},N=z=>{const oe=Hu(a,o),fe=b8(z);en(n.dirtyFields,fe,Oe(oe,fe))},T=(z,oe=[],fe,Ae,Ie=!0,Te=!0)=>{if(Ae&&fe&&!t.disabled){if(l.action=!0,Te&&Array.isArray(Oe(r,z))){const De=fe(Oe(r,z),Ae.argA,Ae.argB);Ie&&en(r,z,De)}if(Te&&Array.isArray(Oe(n.errors,z))){const De=fe(Oe(n.errors,z),Ae.argA,Ae.argB);Ie&&en(n.errors,z,De),N8(n.errors,z)}if((m.touchedFields||g.touchedFields)&&Te&&Array.isArray(Oe(n.touchedFields,z))){const De=fe(Oe(n.touchedFields,z),Ae.argA,Ae.argB);Ie&&en(n.touchedFields,z,De)}(m.dirtyFields||g.dirtyFields)&&N(z),b.state.next({name:z,isDirty:q(z,oe),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else en(o,z,oe)},_=(z,oe)=>{en(n.errors,z,oe),b.state.next({errors:n.errors})},P=z=>{n.errors=z,b.state.next({errors:n.errors,isValid:!1})},M=(z,oe,fe,Ae)=>{const Ie=Oe(r,z);if(Ie){const Te=Oe(o,z,hn(fe)?Oe(a,z):fe);hn(Te)||Ae&&Ae.defaultChecked||oe?en(o,z,oe?Te:fj(Ie._f)):se(z,Te),l.mount&&!l.action&&C()}},O=(z,oe,fe,Ae,Ie)=>{let Te=!1,De=!1;const ht={name:z};if(!t.disabled){if(!fe||Ae){(m.isDirty||g.isDirty)&&(De=n.isDirty,n.isDirty=ht.isDirty=q(),Te=De!==ht.isDirty);const Nt=Js(Oe(a,z),oe);De=!!Oe(n.dirtyFields,z),Nt?zn(n.dirtyFields,z):en(n.dirtyFields,z,!0),ht.dirtyFields=n.dirtyFields,Te=Te||(m.dirtyFields||g.dirtyFields)&&De!==!Nt}if(fe){const Nt=Oe(n.touchedFields,z);Nt||(en(n.touchedFields,z,fe),ht.touchedFields=n.touchedFields,Te=Te||(m.touchedFields||g.touchedFields)&&Nt!==fe)}Te&&Ie&&b.state.next(ht)}return Te?ht:{}},D=(z,oe,fe,Ae)=>{const Ie=Oe(n.errors,z),Te=(m.isValid||g.isValid)&&ds(oe)&&n.isValid!==oe;if(t.delayError&&fe?(d=w(()=>_(z,fe)),d(t.delayError)):(clearTimeout(f),d=null,fe?en(n.errors,z,fe):zn(n.errors,z)),(fe?!Js(Ie,fe):Ie)||!Nr(Ae)||Te){const De={...Ae,...Te&&ds(oe)?{isValid:oe}:{},errors:n.errors,name:z};n={...n,...De},b.state.next(De)}},F=async z=>(k(z,!0),await t.resolver(o,t.context,w8(z||u.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),B=async z=>{const{errors:oe}=await F(z);if(k(z),z)for(const fe of z){const Ae=Oe(oe,fe);Ae?en(n.errors,fe,Ae):zn(n.errors,fe)}else n.errors=oe;return oe},te=async({name:z,eventType:oe})=>{if(e.validate){const fe=await e.validate({formValues:o,formState:n,name:z,eventType:oe});if(qn(fe))for(const Ae in fe)fe[Ae]&&ue(`${qv}.${Ae}`,{message:Lr(fe.message)?fe.message:"",type:qs.validate});else Lr(fe)||!fe?ue(qv,{message:fe||"",type:qs.validate}):ie(qv);return fe}return!0},U=async({fields:z,onlyCheckValid:oe,name:fe,eventType:Ae,context:Ie={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(Ie.runRootValidation=!0,!await te({name:fe,eventType:Ae})&&(Ie.valid=!1,oe)))return Ie.valid;for(const Te in z){const De=z[Te];if(De){const{_f:ht,...Nt}=De;if(ht){const Rn=u.array.has(ht.name),vn=De._f&&S8(De._f);vn&&m.validatingFields&&k([ht.name],!0);const Ee=await Nx(De,u.disabled,o,x,t.shouldUseNativeValidation&&!oe,Rn);if(vn&&m.validatingFields&&k([ht.name]),Ee[ht.name]&&(Ie.valid=!1,oe)||(!oe&&(Oe(Ee,ht.name)?Rn?bP(n.errors,Ee,ht.name):en(n.errors,ht.name,Ee[ht.name]):zn(n.errors,ht.name)),e.shouldUseNativeValidation&&Ee[ht.name]))break}!Nr(Nt)&&await U({context:Ie,onlyCheckValid:oe,fields:Nt,name:Te,eventType:Ae})}}return Ie.valid},ce=()=>{for(const z of u.unMount){const oe=Oe(r,z);oe&&(oe._f.refs?oe._f.refs.every(fe=>!Hv(fe)):!Hv(oe._f.ref))&&be(z)}u.unMount=new Set},q=(z,oe)=>!t.disabled&&(z&&oe&&en(o,z,oe),!Js(re(),a)),ne=(z,oe,fe)=>Cx(z,u,{...l.mount?o:hn(oe)?a:Lr(z)?{[z]:oe}:oe},fe,oe),Y=z=>sm(Oe(l.mount?o:a,z,t.shouldUnregister?Oe(a,z,[]):[])),se=(z,oe,fe={})=>{const Ae=Oe(r,z);let Ie=oe;if(Ae){const Te=Ae._f;Te&&(!Te.disabled&&en(o,z,yP(oe,Te)),Ie=lh(Te.ref)&&Qr(oe)?"":oe,mP(Te.ref)?[...Te.ref.options].forEach(De=>De.selected=Ie.includes(De.value)):Te.refs?Td(Te.ref)?Te.refs.forEach(De=>{(!De.defaultChecked||!De.disabled)&&(Array.isArray(Ie)?De.checked=!!Ie.find(ht=>ht===De.value):De.checked=Ie===De.value||!!Ie)}):Te.refs.forEach(De=>De.checked=De.value===Ie):mw(Te.ref)?Te.ref.value="":(Te.ref.value=Ie,Te.ref.type||b.state.next({name:z,values:bn(o)})))}(fe.shouldDirty||fe.shouldTouch)&&O(z,Ie,fe.shouldTouch,fe.shouldDirty,!0),fe.shouldValidate&&K(z)},H=(z,oe,fe)=>{for(const Ae in oe){if(!oe.hasOwnProperty(Ae))return;const Ie=oe[Ae],Te=z+"."+Ae,De=Oe(r,Te);(u.array.has(z)||qn(Ie)||De&&!De._f)&&!Ai(Ie)?H(Te,Ie,fe):se(Te,Ie,fe)}},W=(z,oe,fe={})=>{const Ae=Oe(r,z),Ie=u.array.has(z),Te=bn(oe);en(o,z,Te),Ie?(b.array.next({name:z,values:bn(o)}),(m.isDirty||m.dirtyFields||g.isDirty||g.dirtyFields)&&fe.shouldDirty&&(N(z),b.state.next({name:z,dirtyFields:n.dirtyFields,isDirty:q(z,Te)}))):Ae&&!Ae._f&&!Qr(Te)?H(z,Te,fe):se(z,Te,fe),Ex(z,u)?b.state.next({...n,name:z,values:bn(o)}):b.state.next({name:l.mount?z:void 0,values:bn(o)})},V=async z=>{l.mount=!0;const oe=z.target;let fe=oe.name,Ae=!0;const Ie=Oe(r,fe),Te=Nt=>{Ae=Number.isNaN(Nt)||Ai(Nt)&&isNaN(Nt.getTime())||Js(Nt,Oe(o,fe,Nt))},De=Gl(t.mode),ht=Gl(t.reValidateMode);if(Ie){let Nt,Rn;const vn=oe.type?fj(Ie._f):cP(z),Ee=z.type===_o.BLUR||z.type===_o.FOCUS_OUT,bt=!C8(Ie._f)&&!e.validate&&!t.resolver&&!Oe(n.errors,fe)&&!Ie._f.deps||E8(Ee,Oe(n.touchedFields,fe),n.isSubmitted,ht,De),zt=Ex(fe,u,Ee);en(o,fe,vn),Ee?(!oe||!oe.readOnly)&&(Ie._f.onBlur&&Ie._f.onBlur(z),d&&d(0)):Ie._f.onChange&&Ie._f.onChange(z);const Tn=O(fe,vn,Ee),br=!Nr(Tn)||zt;if(!Ee&&b.state.next({name:fe,type:z.type,values:bn(o)}),bt)return(m.isValid||g.isValid)&&(t.mode==="onBlur"?Ee&&C():Ee||C()),br&&b.state.next({name:fe,...zt?{}:Tn});if(!t.resolver&&e.validate&&await te({name:fe,eventType:z.type}),!Ee&&zt&&b.state.next({...n}),t.resolver){const{errors:ur}=await F([fe]);if(k([fe]),Te(vn),Ae){const Vr=hj(n.errors,r,fe),Pr=hj(ur,r,Vr.name||fe);Nt=Pr.error,fe=Pr.name,Rn=Nr(ur)}}else k([fe],!0),Nt=(await Nx(Ie,u.disabled,o,x,t.shouldUseNativeValidation))[fe],k([fe]),Te(vn),Ae&&(Nt?Rn=!1:(m.isValid||g.isValid)&&(Rn=await U({fields:r,onlyCheckValid:!0,name:fe,eventType:z.type})));Ae&&(Ie._f.deps&&(!Array.isArray(Ie._f.deps)||Ie._f.deps.length>0)&&K(Ie._f.deps),D(fe,Rn,Nt,Tn))}},A=(z,oe)=>{if(Oe(n.errors,oe)&&z.focus)return z.focus(),1},K=async(z,oe={})=>{let fe,Ae;const Ie=Yr(z);if(t.resolver){const Te=await B(hn(z)?z:Ie);fe=Nr(Te),Ae=z?!Ie.some(De=>Oe(Te,De)):fe}else z?(Ae=(await Promise.all(Ie.map(async Te=>{const De=Oe(r,Te);return await U({fields:De&&De._f?{[Te]:De}:De,eventType:_o.TRIGGER})}))).every(Boolean),!(!Ae&&!n.isValid)&&C()):Ae=fe=await U({fields:r,name:z,eventType:_o.TRIGGER});return b.state.next({...!Lr(z)||(m.isValid||g.isValid)&&fe!==n.isValid?{}:{name:z},...t.resolver||!z?{isValid:fe}:{},errors:n.errors}),oe.shouldFocus&&!Ae&&Xl(r,A,z?Ie:u.mount),Ae},re=(z,oe)=>{let fe={...l.mount?o:a};return oe&&(fe=hP(oe.dirtyFields?n.dirtyFields:n.touchedFields,fe)),hn(z)?fe:Lr(z)?Oe(fe,z):z.map(Ae=>Oe(fe,Ae))},ee=(z,oe)=>({invalid:!!Oe((oe||n).errors,z),isDirty:!!Oe((oe||n).dirtyFields,z),error:Oe((oe||n).errors,z),isValidating:!!Oe(n.validatingFields,z),isTouched:!!Oe((oe||n).touchedFields,z)}),ie=z=>{const oe=z?Yr(z):void 0;oe?.forEach(fe=>zn(n.errors,fe)),oe?oe.forEach(fe=>{b.state.next({name:fe,errors:n.errors})}):b.state.next({errors:{}})},ue=(z,oe,fe)=>{const Ae=(Oe(r,z,{_f:{}})._f||{}).ref,Ie=Oe(n.errors,z)||{},{ref:Te,message:De,type:ht,...Nt}=Ie;en(n.errors,z,{...Nt,...oe,ref:Ae}),b.state.next({name:z,errors:n.errors,isValid:!1}),fe&&fe.shouldFocus&&Ae&&Ae.focus&&Ae.focus()},j=(z,oe)=>Fr(z)?b.state.subscribe({next:fe=>"values"in fe&&z(ne(void 0,oe),fe)}):ne(z,oe,!0),I=z=>b.state.subscribe({next:oe=>{k8(z.name,oe.name,z.exact)&&j8(oe,z.formState||m,Ur,z.reRenderRoot)&&z.callback({values:{...o},...n,...oe,defaultValues:a})}}).unsubscribe,me=z=>(l.mount=!0,g={...g,...z.formState},I({...z,formState:{...h,...z.formState}})),be=(z,oe={})=>{for(const fe of z?Yr(z):u.mount)u.mount.delete(fe),u.array.delete(fe),oe.keepValue||(zn(r,fe),zn(o,fe)),!oe.keepError&&zn(n.errors,fe),!oe.keepDirty&&zn(n.dirtyFields,fe),!oe.keepTouched&&zn(n.touchedFields,fe),!oe.keepIsValidating&&zn(n.validatingFields,fe),!t.shouldUnregister&&!oe.keepDefaultValue&&zn(a,fe);b.state.next({values:bn(o)}),b.state.next({...n,...oe.keepDirty?{isDirty:q()}:{}}),!oe.keepIsValid&&C()},st=({disabled:z,name:oe})=>{if(ds(z)&&l.mount||z||u.disabled.has(oe)){const Ie=u.disabled.has(oe)!==!!z;z?u.disabled.add(oe):u.disabled.delete(oe),Ie&&l.mount&&!l.action&&C()}},Je=(z,oe={})=>{let fe=Oe(r,z);const Ae=ds(oe.disabled)||ds(t.disabled),Ie=!u.registerName.has(z)&&fe&&!fe._f.mount;return en(r,z,{...fe||{},_f:{...fe&&fe._f?fe._f:{ref:{name:z}},name:z,mount:!0,...oe}}),u.mount.add(z),fe&&!Ie?st({disabled:ds(oe.disabled)?oe.disabled:t.disabled,name:z}):M(z,!0,oe.value),{...Ae?{disabled:oe.disabled||t.disabled}:{},...t.progressive?{required:!!oe.required,min:Ru(oe.min),max:Ru(oe.max),minLength:Ru(oe.minLength),maxLength:Ru(oe.maxLength),pattern:Ru(oe.pattern)}:{},name:z,onChange:V,onBlur:V,ref:Te=>{if(Te){u.registerName.add(z),Je(z,oe),u.registerName.delete(z),fe=Oe(r,z);const De=hn(Te.value)&&Te.querySelectorAll&&Te.querySelectorAll("input,select,textarea")[0]||Te,ht=g8(De),Nt=fe._f.refs||[];if(ht?Nt.find(Rn=>Rn===De):De===fe._f.ref)return;en(r,z,{_f:{...fe._f,...ht?{refs:[...Nt.filter(Hv),De,...Array.isArray(Oe(a,z))?[{}]:[]],ref:{type:De.type,name:z}}:{ref:De}}}),M(z,!1,void 0,De)}else fe=Oe(r,z,{}),fe._f&&(fe._f.mount=!1),(t.shouldUnregister||oe.shouldUnregister)&&!(uP(u.array,z)&&l.action)&&u.unMount.add(z)}}},rt=()=>t.shouldFocusError&&Xl(r,A,u.mount),Ht=z=>{ds(z)&&(b.state.next({disabled:z}),Xl(r,(oe,fe)=>{const Ae=Oe(r,fe);Ae&&(oe.disabled=Ae._f.disabled||z,Array.isArray(Ae._f.refs)&&Ae._f.refs.forEach(Ie=>{Ie.disabled=Ae._f.disabled||z}))},0,!1))},Wn=(z,oe)=>async fe=>{let Ae;fe&&(fe.preventDefault&&fe.preventDefault(),fe.persist&&fe.persist());let Ie=bn(o);if(b.state.next({isSubmitting:!0}),t.resolver){const{errors:Te,values:De}=await F();k(),n.errors=Te,Ie=bn(De)}else await U({fields:r,eventType:_o.SUBMIT});if(u.disabled.size)for(const Te of u.disabled)zn(Ie,Te);if(zn(n.errors,dP),Nr(n.errors)){b.state.next({errors:{}});try{await z(Ie,fe)}catch(Te){Ae=Te}}else oe&&await oe({...n.errors},fe),rt(),setTimeout(rt);if(b.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Nr(n.errors)&&!Ae,submitCount:n.submitCount+1,errors:n.errors}),Ae)throw Ae},Pn=(z,oe={})=>{Oe(r,z)&&(hn(oe.defaultValue)?W(z,bn(Oe(a,z))):(W(z,oe.defaultValue),en(a,z,bn(oe.defaultValue))),oe.keepTouched||zn(n.touchedFields,z),oe.keepDirty||(zn(n.dirtyFields,z),n.isDirty=oe.defaultValue?q(z,bn(Oe(a,z))):q()),oe.keepError||(zn(n.errors,z),m.isValid&&C()),b.state.next({...n}))},tr=(z,oe={})=>{const fe=z?bn(z):a,Ae=bn(fe),Ie=Nr(z),Te=Ie?a:Ae;if(oe.keepDefaultValues||(a=fe),!oe.keepValues){if(oe.keepDirtyValues){const De=new Set([...u.mount,...Object.keys(Hu(a,o))]);for(const ht of Array.from(De)){const Nt=Oe(n.dirtyFields,ht),Rn=Oe(o,ht),vn=Oe(Te,ht);Nt&&!hn(Rn)?en(Te,ht,Rn):!Nt&&!hn(vn)&&W(ht,vn)}}else{if(dw&&hn(z))for(const De of u.mount){const ht=Oe(r,De);if(ht&&ht._f){const Nt=Array.isArray(ht._f.refs)?ht._f.refs[0]:ht._f.ref;if(lh(Nt)){const Rn=Nt.closest("form");if(Rn){Rn.reset();break}}}}if(oe.keepFieldsRef)for(const De of u.mount)W(De,Oe(Te,De));else r={}}o=t.shouldUnregister?oe.keepDefaultValues?bn(a):{}:bn(Te),b.array.next({values:{...Te}}),b.state.next({values:{...Te}})}u={mount:oe.keepDirtyValues?u.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},l.mount=!m.isValid||!!oe.keepIsValid||!!oe.keepDirtyValues||!t.shouldUnregister&&!Nr(Te),l.watch=!!t.shouldUnregister,l.keepIsValid=!!oe.keepIsValid,l.action=!1,oe.keepErrors||(n.errors={}),b.state.next({submitCount:oe.keepSubmitCount?n.submitCount:0,isDirty:Ie?!1:oe.keepDirty?n.isDirty:!!(oe.keepDefaultValues&&!Js(z,a)),isSubmitted:oe.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Ie?{}:oe.keepDirtyValues?oe.keepDefaultValues&&o?Hu(a,o):n.dirtyFields:oe.keepDefaultValues&&z?Hu(a,z):oe.keepDirty?n.dirtyFields:{},touchedFields:oe.keepTouched?n.touchedFields:{},errors:oe.keepErrors?n.errors:{},isSubmitSuccessful:oe.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:a})},Sn=(z,oe)=>tr(Fr(z)?z(o):z,{...t.resetOptions,...oe}),zr=(z,oe={})=>{const fe=Oe(r,z),Ae=fe&&fe._f;if(Ae){const Ie=Ae.refs?Ae.refs[0]:Ae.ref;Ie.focus&&setTimeout(()=>{Ie.focus(),oe.shouldSelect&&Fr(Ie.select)&&Ie.select()})}},Ur=z=>{n={...n,...z}},_r={control:{register:Je,unregister:be,getFieldState:ee,handleSubmit:Wn,setError:ue,_subscribe:I,_runSchema:F,_updateIsValidating:k,_focusError:rt,_getWatch:ne,_getDirty:q,_setValid:C,_setFieldArray:T,_setDisabledField:st,_setErrors:P,_getFieldArray:Y,_reset:tr,_resetDefaultValues:()=>Fr(t.defaultValues)&&t.defaultValues().then(z=>{Sn(z,t.resetOptions),b.state.next({isLoading:!1})}),_removeUnmounted:ce,_disableForm:Ht,_subjects:b,_proxyFormState:m,get _fields(){return r},get _formValues(){return o},get _state(){return l},set _state(z){l=z},get _defaultValues(){return a},get _names(){return u},set _names(z){u=z},get _formState(){return n},get _options(){return t},set _options(z){t={...t,...z}}},subscribe:me,trigger:K,register:Je,handleSubmit:Wn,watch:j,setValue:W,getValues:re,reset:Sn,resetField:Pn,clearErrors:ie,unregister:be,setError:ue,setFocus:zr,getFieldState:ee};return{..._r,formControl:_r}}var No=()=>{if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(Math.random()*16+e)%16|0;return(t=="x"?n:n&3|8).toString(16)})},Wv=(e,t,n={})=>n.shouldFocus||hn(n.shouldFocus)?n.focusName||`${e}.${hn(n.focusIndex)?t:n.focusIndex}.`:"",Kv=(e,t)=>[...e,...Yr(t)],Gv=e=>Array.isArray(e)?e.map(()=>{}):void 0;function Jv(e,t,n){return[...e.slice(0,t),...Yr(n),...e.slice(t)]}var Qv=(e,t,n)=>Array.isArray(e)?(hn(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],Yv=(e,t)=>[...Yr(t),...Yr(e)];function _8(e,t){let n=0;const r=[...e];for(const a of t)r.splice(a-n,1),n++;return sm(r).length?r:[]}var Zv=(e,t)=>hn(t)?[]:_8(e,Yr(t).sort((n,r)=>n-r)),Xv=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]},gj=(e,t,n)=>(e[t]=n,e);function P8(e){const t=am(),{control:n=t,name:r,keyName:a="id",shouldUnregister:o,rules:l}=e,[u,d]=ke.useState(n._getFieldArray(r)),f=ke.useRef(n._getFieldArray(r).map(No)),h=ke.useRef(!1);n._names.array.add(r),ke.useMemo(()=>l&&u.length>=0&&n.register(r,l),[n,r,u.length,l]),om(()=>n._subjects.array.subscribe({next:({values:_,name:P})=>{if(P===r||!P){const M=Oe(_,r);Array.isArray(M)&&(d(M),f.current=M.map(No))}}}).unsubscribe,[n,r]);const m=ke.useCallback(_=>{h.current=!0,n._setFieldArray(r,_)},[n,r]),g=(_,P)=>{const M=Yr(bn(_)),O=Kv(n._getFieldArray(r),M);n._names.focus=Wv(r,O.length-1,P),f.current=Kv(f.current,M.map(No)),m(O),d(O),n._setFieldArray(r,O,Kv,{argA:Gv(_)})},b=(_,P)=>{const M=Yr(bn(_)),O=Yv(n._getFieldArray(r),M);n._names.focus=Wv(r,0,P),f.current=Yv(f.current,M.map(No)),m(O),d(O),n._setFieldArray(r,O,Yv,{argA:Gv(_)})},x=_=>{const P=Zv(n._getFieldArray(r),_);f.current=Zv(f.current,_),m(P),d(P),!Array.isArray(Oe(n._fields,r))&&en(n._fields,r,void 0),n._setFieldArray(r,P,Zv,{argA:_})},w=(_,P,M)=>{const O=Yr(bn(P)),D=Jv(n._getFieldArray(r),_,O);n._names.focus=Wv(r,_,M),f.current=Jv(f.current,_,O.map(No)),m(D),d(D),n._setFieldArray(r,D,Jv,{argA:_,argB:Gv(P)})},C=(_,P)=>{const M=n._getFieldArray(r);Xv(M,_,P),Xv(f.current,_,P),m(M),d(M),n._setFieldArray(r,M,Xv,{argA:_,argB:P},!1)},k=(_,P)=>{const M=n._getFieldArray(r);Qv(M,_,P),Qv(f.current,_,P),m(M),d(M),n._setFieldArray(r,M,Qv,{argA:_,argB:P},!1)},N=(_,P)=>{const M=bn(P),O=gj(n._getFieldArray(r),_,M);f.current=[...O].map((D,F)=>!D||F===_?No():f.current[F]),m(O),d([...O]),n._setFieldArray(r,O,gj,{argA:_,argB:M},!0,!1)},T=_=>{const P=Yr(bn(_));f.current=P.map(No),m([...P]),d([...P]),n._setFieldArray(r,[...P],M=>M,{},!0,!1)};return ke.useEffect(()=>{if(n._state.action=!1,Ex(r,n._names)&&n._subjects.state.next({...n._formState}),h.current&&(!Gl(n._options.mode).isOnSubmit||n._formState.isSubmitted)&&!Gl(n._options.reValidateMode).isOnSubmit)if(n._options.resolver)n._runSchema([r]).then(_=>{n._updateIsValidating([r]);const P=Oe(_.errors,r),M=Oe(n._formState.errors,r);(M?!P&&M.type||P&&(M.type!==P.type||M.message!==P.message):P&&P.type)&&(P?en(n._formState.errors,r,P):zn(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const _=Oe(n._fields,r);_&&_._f&&!(Gl(n._options.reValidateMode).isOnSubmit&&Gl(n._options.mode).isOnSubmit)&&Nx(_,n._names.disabled,n._formValues,n._options.criteriaMode===Ps.all,n._options.shouldUseNativeValidation,!0).then(P=>!Nr(P)&&n._subjects.state.next({errors:bP(n._formState.errors,P,r)}))}n._subjects.state.next({name:r,values:bn(n._formValues)}),n._names.focus&&Xl(n._fields,(_,P)=>{if(n._names.focus&&P.startsWith(n._names.focus)&&_.focus)return _.focus(),1}),n._names.focus="",n._setValid(),h.current=!1},[u,r,n]),ke.useEffect(()=>(!Oe(n._formValues,r)&&n._setFieldArray(r),()=>{const _=(P,M)=>{const O=Oe(n._fields,P);O&&O._f&&(O._f.mount=M)};n._options.shouldUnregister||o?n.unregister(r):_(r,!1)}),[r,n,a,o]),{swap:ke.useCallback(C,[m,r,n]),move:ke.useCallback(k,[m,r,n]),prepend:ke.useCallback(b,[m,r,n]),append:ke.useCallback(g,[m,r,n]),remove:ke.useCallback(x,[m,r,n]),insert:ke.useCallback(w,[m,r,n]),update:ke.useCallback(N,[m,r,n]),replace:ke.useCallback(T,[m,r,n]),fields:ke.useMemo(()=>u.map((_,P)=>({..._,[a]:f.current[P]||No()})),[u,a])}}function mn(e={}){const t=ke.useRef(void 0),n=ke.useRef(void 0),[r,a]=ke.useState({isDirty:!1,isValidating:!1,isLoading:Fr(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Fr(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!Fr(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:l,...u}=M8(e);t.current={...u,formState:r}}const o=t.current.control;return o._options=e,om(()=>{const l=o._subscribe({formState:o._proxyFormState,callback:()=>a({...o._formState}),reRenderRoot:!0});return a(u=>({...u,isReady:!0})),o._formState.isReady=!0,l},[o]),ke.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),ke.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),ke.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),ke.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),ke.useEffect(()=>{if(o._proxyFormState.isDirty){const l=o._getDirty();l!==r.isDirty&&o._subjects.state.next({isDirty:l})}},[o,r.isDirty]),ke.useEffect(()=>{var l;e.values&&!Js(e.values,n.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),!((l=o._options.resetOptions)===null||l===void 0)&&l.keepIsValid||o._setValid(),n.current=e.values,a(u=>({...u}))):o._resetDefaultValues()},[o,e.values]),ke.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=ke.useMemo(()=>fP(r,o),[o,r]),t.current}const vj=(e,t,n)=>{if(e&&"reportValidity"in e){const r=Oe(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},wP=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?vj(r.ref,n,e):r.refs&&r.refs.forEach(a=>vj(a,n,e))}},R8=(e,t)=>{t.shouldUseNativeValidation&&wP(e,t);const n={};for(const r in e){const a=Oe(t.fields,r),o=Object.assign(e[r]||{},{ref:a&&a.ref});if(I8(t.names||Object.keys(e),r)){const l=Object.assign({},Oe(n,r));en(l,"root",o),en(n,r,l)}else en(n,r,o)}return n},I8=(e,t)=>e.some(n=>n.startsWith(t+"."));var O8=function(e,t){for(var n={};e.length;){var r=e[0],a=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:a};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]=pP(l,t,n,a,f?[].concat(f,r.message):r.message)}e.shift()}return n},gn=function(e,t,n){return n===void 0&&(n={}),function(r,a,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&&wP({},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:R8(O8(l.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw l}))}catch(l){return Promise.reject(l)}}},hr=[];for(var ey=0;ey<256;++ey)hr.push((ey+256).toString(16).slice(1));function A8(e,t=0){return(hr[e[t+0]]+hr[e[t+1]]+hr[e[t+2]]+hr[e[t+3]]+"-"+hr[e[t+4]]+hr[e[t+5]]+"-"+hr[e[t+6]]+hr[e[t+7]]+"-"+hr[e[t+8]]+hr[e[t+9]]+"-"+hr[e[t+10]]+hr[e[t+11]]+hr[e[t+12]]+hr[e[t+13]]+hr[e[t+14]]+hr[e[t+15]]).toLowerCase()}var Zf,D8=new Uint8Array(16);function F8(){if(!Zf&&(Zf=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Zf))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Zf(D8)}var L8=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const yj={randomUUID:L8};function Tx(e,t,n){if(yj.randomUUID&&!e)return yj.randomUUID();e=e||{};var r=e.random||(e.rng||F8)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,A8(r)}var tn;(function(e){e.assertEqual=a=>{};function t(a){}e.assertIs=t;function n(a){throw new Error}e.assertNever=n,e.arrayToEnum=a=>{const o={};for(const l of a)o[l]=l;return o},e.getValidEnumValues=a=>{const o=e.objectKeys(a).filter(u=>typeof a[a[u]]!="number"),l={};for(const u of o)l[u]=a[u];return e.objectValues(l)},e.objectValues=a=>e.objectKeys(a).map(function(o){return a[o]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const o=[];for(const l in a)Object.prototype.hasOwnProperty.call(a,l)&&o.push(l);return o},e.find=(a,o)=>{for(const l of a)if(o(l))return l},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function r(a,o=" | "){return a.map(l=>typeof l=="string"?`'${l}'`:l).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(a,o)=>typeof o=="bigint"?o.toString():o})(tn||(tn={}));var xj;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(xj||(xj={}));const Ye=tn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Po=e=>{switch(typeof e){case"undefined":return Ye.undefined;case"string":return Ye.string;case"number":return Number.isNaN(e)?Ye.nan:Ye.number;case"boolean":return Ye.boolean;case"function":return Ye.function;case"bigint":return Ye.bigint;case"symbol":return Ye.symbol;case"object":return Array.isArray(e)?Ye.array:e===null?Ye.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Ye.promise:typeof Map<"u"&&e instanceof Map?Ye.map:typeof Set<"u"&&e instanceof Set?Ye.set:typeof Date<"u"&&e instanceof Date?Ye.date:Ye.object;default:return Ye.unknown}},Pe=tn.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"]);class Ga extends Error{get errors(){return this.issues}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}format(t){const n=t||function(o){return o.message},r={_errors:[]},a=o=>{for(const l of o.issues)if(l.code==="invalid_union")l.unionErrors.map(a);else if(l.code==="invalid_return_type")a(l.returnTypeError);else if(l.code==="invalid_arguments")a(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 a of this.issues)if(a.path.length>0){const o=a.path[0];n[o]=n[o]||[],n[o].push(t(a))}else r.push(t(a));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Ga.create=e=>new Ga(e);const Mx=(e,t)=>{let n;switch(e.code){case Pe.invalid_type:e.received===Ye.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Pe.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,tn.jsonStringifyReplacer)}`;break;case Pe.unrecognized_keys:n=`Unrecognized key(s) in object: ${tn.joinValues(e.keys,", ")}`;break;case Pe.invalid_union:n="Invalid input";break;case Pe.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${tn.joinValues(e.options)}`;break;case Pe.invalid_enum_value:n=`Invalid enum value. Expected ${tn.joinValues(e.options)}, received '${e.received}'`;break;case Pe.invalid_arguments:n="Invalid function arguments";break;case Pe.invalid_return_type:n="Invalid function return type";break;case Pe.invalid_date:n="Invalid date";break;case Pe.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}"`:tn.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Pe.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==="bigint"?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 Pe.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 Pe.custom:n="Invalid input";break;case Pe.invalid_intersection_types:n="Intersection results could not be merged";break;case Pe.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Pe.not_finite:n="Number must be finite";break;default:n=t.defaultError,tn.assertNever(e)}return{message:n}};let $8=Mx;function B8(){return $8}const z8=e=>{const{data:t,path:n,errorMaps:r,issueData:a}=e,o=[...n,...a.path||[]],l={...a,path:o};if(a.message!==void 0)return{...a,path:o,message:a.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{...a,path:o,message:u}};function Ue(e,t){const n=B8(),r=z8({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Mx?void 0:Mx].filter(a=>!!a)});e.common.issues.push(r)}class ms{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 a of n){if(a.status==="aborted")return jt;a.status==="dirty"&&t.dirty(),r.push(a.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const a of n){const o=await a.key,l=await a.value;r.push({key:o,value:l})}return ms.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const a of n){const{key:o,value:l}=a;if(o.status==="aborted"||l.status==="aborted")return jt;o.status==="dirty"&&t.dirty(),l.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof l.value<"u"||a.alwaysSet)&&(r[o.value]=l.value)}return{status:t.value,value:r}}}const jt=Object.freeze({status:"aborted"}),Wu=e=>({status:"dirty",value:e}),As=e=>({status:"valid",value:e}),bj=e=>e.status==="aborted",wj=e=>e.status==="dirty",fc=e=>e.status==="valid",uh=e=>typeof Promise<"u"&&e instanceof Promise;var tt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(tt||(tt={}));class Vo{constructor(t,n,r,a){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Sj=(e,t)=>{if(fc(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 Ga(e.common.issues);return this._error=n,this._error}}};function Bt(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:a}=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:a}:{errorMap:(l,u)=>{const{message:d}=e;return l.code==="invalid_enum_value"?{message:d??u.defaultError}:typeof u.data>"u"?{message:d??r??u.defaultError}:l.code!=="invalid_type"?{message:u.defaultError}:{message:d??n??u.defaultError}},description:a}}class Zt{get description(){return this._def.description}_getType(t){return Po(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Po(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ms,ctx:{common:t.parent.common,data:t.data,parsedType:Po(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(uh(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){const r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Po(t)},a=this._parseSync({data:t,path:r.path,parent:r});return Sj(r,a)}"~validate"(t){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Po(t)};if(!this["~standard"].async)try{const r=this._parseSync({data:t,path:[],parent:n});return fc(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(r=>fc(r)?{value:r.value}:{issues:n.common.issues})}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:Po(t)},a=this._parse({data:t,path:r.path,parent:r}),o=await(uh(a)?a:Promise.resolve(a));return Sj(r,o)}refine(t,n){const r=a=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(a):n;return this._refinement((a,o)=>{const l=t(a),u=()=>o.addIssue({code:Pe.custom,...r(a)});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,a)=>t(r)?!0:(a.addIssue(typeof n=="function"?n(r,a):n),!1))}_refinement(t){return new mc({schema:this,typeName:kt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}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),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Fo.create(this,this._def)}nullable(){return gc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ba.create(this)}promise(){return hh.create(this,this._def)}or(t){return fh.create([this,t],this._def)}and(t){return ph.create(this,t,this._def)}transform(t){return new mc({...Bt(this._def),schema:this,typeName:kt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Rx({...Bt(this._def),innerType:this,defaultValue:n,typeName:kt.ZodDefault})}brand(){return new uq({typeName:kt.ZodBranded,type:this,...Bt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Ix({...Bt(this._def),innerType:this,catchValue:n,typeName:kt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return vw.create(this,t)}readonly(){return Ox.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const U8=/^c[^\s-]{8,}$/i,V8=/^[0-9a-z]+$/,q8=/^[0-9A-HJKMNP-TV-Z]{26}$/i,H8=/^[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,W8=/^[a-z0-9_-]{21}$/i,K8=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,G8=/^[-+]?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)?)??$/,J8=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Q8="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ty;const Y8=/^(?:(?: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])$/,Z8=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,X8=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,eq=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,tq=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,nq=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,SP="((\\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])))",rq=new RegExp(`^${SP}$`);function CP(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function sq(e){return new RegExp(`^${CP(e)}$`)}function aq(e){let t=`${SP}T${CP(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 oq(e,t){return!!((t==="v4"||!t)&&Y8.test(e)||(t==="v6"||!t)&&X8.test(e))}function iq(e,t){if(!K8.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),a=JSON.parse(atob(r));return!(typeof a!="object"||a===null||"typ"in a&&a?.typ!=="JWT"||!a.alg||t&&a.alg!==t)}catch{return!1}}function lq(e,t){return!!((t==="v4"||!t)&&Z8.test(e)||(t==="v6"||!t)&&eq.test(e))}class Ba extends Zt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Ye.string){const o=this._getOrReturnCtx(t);return Ue(o,{code:Pe.invalid_type,expected:Ye.string,received:o.parsedType}),jt}const r=new ms;let a;for(const o of this._def.checks)if(o.kind==="min")t.data.lengtho.value&&(a=this._getOrReturnCtx(t,a),Ue(a,{code:Pe.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(a),{validation:n,code:Pe.invalid_string,...tt.errToObj(r)})}_addCheck(t){return new Ba({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...tt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...tt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...tt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...tt.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...tt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...tt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...tt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...tt.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...tt.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...tt.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...tt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...tt.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...tt.errToObj(t)})}datetime(t){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:t?.offset??!1,local:t?.local??!1,...tt.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,...tt.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...tt.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...tt.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...tt.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...tt.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...tt.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...tt.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...tt.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...tt.errToObj(n)})}nonempty(t){return this.min(1,tt.errToObj(t))}trim(){return new Ba({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ba({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ba({...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 isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}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.valuenew Ba({checks:[],typeName:kt.ZodString,coerce:e?.coerce??!1,...Bt(e)});function cq(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,a=n>r?n:r,o=Number.parseInt(e.toFixed(a).replace(".","")),l=Number.parseInt(t.toFixed(a).replace(".",""));return o%l/10**a}class Hi extends Zt{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)!==Ye.number){const o=this._getOrReturnCtx(t);return Ue(o,{code:Pe.invalid_type,expected:Ye.number,received:o.parsedType}),jt}let r;const a=new ms;for(const o of this._def.checks)o.kind==="int"?tn.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Ue(r,{code:Pe.invalid_type,expected:"integer",received:"float",message:o.message}),a.dirty()):o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),Ue(r,{code:Pe.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),a.dirty()):o.kind==="multipleOf"?cq(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),Ue(r,{code:Pe.not_multiple_of,multipleOf:o.value,message:o.message}),a.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Ue(r,{code:Pe.not_finite,message:o.message}),a.dirty()):tn.assertNever(o);return{status:a.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,tt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,tt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,tt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,tt.toString(n))}setLimit(t,n,r,a){return new Hi({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:tt.toString(a)}]})}_addCheck(t){return new Hi({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:tt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:tt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:tt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:tt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:tt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:tt.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:tt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:tt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:tt.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"&&tn.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 Hi({checks:[],typeName:kt.ZodNumber,coerce:e?.coerce||!1,...Bt(e)});class Wi extends Zt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Ye.bigint)return this._getInvalidInput(t);let r;const a=new ms;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),Ue(r,{code:Pe.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),a.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Ue(r,{code:Pe.not_multiple_of,multipleOf:o.value,message:o.message}),a.dirty()):tn.assertNever(o);return{status:a.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return Ue(n,{code:Pe.invalid_type,expected:Ye.bigint,received:n.parsedType}),jt}gte(t,n){return this.setLimit("min",t,!0,tt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,tt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,tt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,tt.toString(n))}setLimit(t,n,r,a){return new Wi({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:tt.toString(a)}]})}_addCheck(t){return new Wi({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:tt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:tt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:tt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:tt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:tt.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.valuenew Wi({checks:[],typeName:kt.ZodBigInt,coerce:e?.coerce??!1,...Bt(e)});class dh extends Zt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Ye.boolean){const r=this._getOrReturnCtx(t);return Ue(r,{code:Pe.invalid_type,expected:Ye.boolean,received:r.parsedType}),jt}return As(t.data)}}dh.create=e=>new dh({typeName:kt.ZodBoolean,coerce:e?.coerce||!1,...Bt(e)});class pc extends Zt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Ye.date){const o=this._getOrReturnCtx(t);return Ue(o,{code:Pe.invalid_type,expected:Ye.date,received:o.parsedType}),jt}if(Number.isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return Ue(o,{code:Pe.invalid_date}),jt}const r=new ms;let a;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()o.value&&(a=this._getOrReturnCtx(t,a),Ue(a,{code:Pe.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):tn.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new pc({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:tt.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:tt.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 pc({checks:[],coerce:e?.coerce||!1,typeName:kt.ZodDate,...Bt(e)});class Cj extends Zt{_parse(t){if(this._getType(t)!==Ye.symbol){const r=this._getOrReturnCtx(t);return Ue(r,{code:Pe.invalid_type,expected:Ye.symbol,received:r.parsedType}),jt}return As(t.data)}}Cj.create=e=>new Cj({typeName:kt.ZodSymbol,...Bt(e)});class jj extends Zt{_parse(t){if(this._getType(t)!==Ye.undefined){const r=this._getOrReturnCtx(t);return Ue(r,{code:Pe.invalid_type,expected:Ye.undefined,received:r.parsedType}),jt}return As(t.data)}}jj.create=e=>new jj({typeName:kt.ZodUndefined,...Bt(e)});class _x extends Zt{_parse(t){if(this._getType(t)!==Ye.null){const r=this._getOrReturnCtx(t);return Ue(r,{code:Pe.invalid_type,expected:Ye.null,received:r.parsedType}),jt}return As(t.data)}}_x.create=e=>new _x({typeName:kt.ZodNull,...Bt(e)});class kj extends Zt{constructor(){super(...arguments),this._any=!0}_parse(t){return As(t.data)}}kj.create=e=>new kj({typeName:kt.ZodAny,...Bt(e)});class Ej extends Zt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return As(t.data)}}Ej.create=e=>new Ej({typeName:kt.ZodUnknown,...Bt(e)});class qo extends Zt{_parse(t){const n=this._getOrReturnCtx(t);return Ue(n,{code:Pe.invalid_type,expected:Ye.never,received:n.parsedType}),jt}}qo.create=e=>new qo({typeName:kt.ZodNever,...Bt(e)});class Nj extends Zt{_parse(t){if(this._getType(t)!==Ye.undefined){const r=this._getOrReturnCtx(t);return Ue(r,{code:Pe.invalid_type,expected:Ye.void,received:r.parsedType}),jt}return As(t.data)}}Nj.create=e=>new Nj({typeName:kt.ZodVoid,...Bt(e)});class ba extends Zt{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),a=this._def;if(n.parsedType!==Ye.array)return Ue(n,{code:Pe.invalid_type,expected:Ye.array,received:n.parsedType}),jt;if(a.exactLength!==null){const l=n.data.length>a.exactLength.value,u=n.data.lengtha.maxLength.value&&(Ue(n,{code:Pe.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((l,u)=>a.type._parseAsync(new Vo(n,l,n.path,u)))).then(l=>ms.mergeArray(r,l));const o=[...n.data].map((l,u)=>a.type._parseSync(new Vo(n,l,n.path,u)));return ms.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new ba({...this._def,minLength:{value:t,message:tt.toString(n)}})}max(t,n){return new ba({...this._def,maxLength:{value:t,message:tt.toString(n)}})}length(t,n){return new ba({...this._def,exactLength:{value:t,message:tt.toString(n)}})}nonempty(t){return this.min(1,t)}}ba.create=(e,t)=>new ba({type:e,minLength:null,maxLength:null,exactLength:null,typeName:kt.ZodArray,...Bt(t)});function Hl(e){if(e instanceof Qn){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Fo.create(Hl(r))}return new Qn({...e._def,shape:()=>t})}else return e instanceof ba?new ba({...e._def,type:Hl(e.element)}):e instanceof Fo?Fo.create(Hl(e.unwrap())):e instanceof gc?gc.create(Hl(e.unwrap())):e instanceof Ki?Ki.create(e.items.map(t=>Hl(t))):e}class Qn extends Zt{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=tn.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==Ye.object){const f=this._getOrReturnCtx(t);return Ue(f,{code:Pe.invalid_type,expected:Ye.object,received:f.parsedType}),jt}const{status:r,ctx:a}=this._processInputParams(t),{shape:o,keys:l}=this._getCached(),u=[];if(!(this._def.catchall instanceof qo&&this._def.unknownKeys==="strip"))for(const f in a.data)l.includes(f)||u.push(f);const d=[];for(const f of l){const h=o[f],m=a.data[f];d.push({key:{status:"valid",value:f},value:h._parse(new Vo(a,m,a.path,f)),alwaysSet:f in a.data})}if(this._def.catchall instanceof qo){const f=this._def.unknownKeys;if(f==="passthrough")for(const h of u)d.push({key:{status:"valid",value:h},value:{status:"valid",value:a.data[h]}});else if(f==="strict")u.length>0&&(Ue(a,{code:Pe.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=a.data[h];d.push({key:{status:"valid",value:h},value:f._parse(new Vo(a,m,a.path,h)),alwaysSet:h in a.data})}}return a.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=>ms.mergeObjectSync(r,f)):ms.mergeObjectSync(r,d)}get shape(){return this._def.shape()}strict(t){return tt.errToObj,new Qn({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{const a=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:tt.errToObj(t).message??a}:{message:a}}}:{}})}strip(){return new Qn({...this._def,unknownKeys:"strip"})}passthrough(){return new Qn({...this._def,unknownKeys:"passthrough"})}extend(t){return new Qn({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Qn({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:kt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Qn({...this._def,catchall:t})}pick(t){const n={};for(const r of tn.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Qn({...this._def,shape:()=>n})}omit(t){const n={};for(const r of tn.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new Qn({...this._def,shape:()=>n})}deepPartial(){return Hl(this)}partial(t){const n={};for(const r of tn.objectKeys(this.shape)){const a=this.shape[r];t&&!t[r]?n[r]=a:n[r]=a.optional()}return new Qn({...this._def,shape:()=>n})}required(t){const n={};for(const r of tn.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Fo;)o=o._def.innerType;n[r]=o}return new Qn({...this._def,shape:()=>n})}keyof(){return jP(tn.objectKeys(this.shape))}}Qn.create=(e,t)=>new Qn({shape:()=>e,unknownKeys:"strip",catchall:qo.create(),typeName:kt.ZodObject,...Bt(t)});Qn.strictCreate=(e,t)=>new Qn({shape:()=>e,unknownKeys:"strict",catchall:qo.create(),typeName:kt.ZodObject,...Bt(t)});Qn.lazycreate=(e,t)=>new Qn({shape:e,unknownKeys:"strip",catchall:qo.create(),typeName:kt.ZodObject,...Bt(t)});class fh extends Zt{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function a(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 Ga(u.ctx.common.issues));return Ue(n,{code:Pe.invalid_union,unionErrors:l}),jt}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(a);{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 Ga(d));return Ue(n,{code:Pe.invalid_union,unionErrors:u}),jt}}get options(){return this._def.options}}fh.create=(e,t)=>new fh({options:e,typeName:kt.ZodUnion,...Bt(t)});function Px(e,t){const n=Po(e),r=Po(t);if(e===t)return{valid:!0,data:e};if(n===Ye.object&&r===Ye.object){const a=tn.objectKeys(t),o=tn.objectKeys(e).filter(u=>a.indexOf(u)!==-1),l={...e,...t};for(const u of o){const d=Px(e[u],t[u]);if(!d.valid)return{valid:!1};l[u]=d.data}return{valid:!0,data:l}}else if(n===Ye.array&&r===Ye.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let o=0;o{if(bj(o)||bj(l))return jt;const u=Px(o.value,l.value);return u.valid?((wj(o)||wj(l))&&n.dirty(),{status:n.value,value:u.data}):(Ue(r,{code:Pe.invalid_intersection_types}),jt)};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])=>a(o,l)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ph.create=(e,t,n)=>new ph({left:e,right:t,typeName:kt.ZodIntersection,...Bt(n)});class Ki extends Zt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ye.array)return Ue(r,{code:Pe.invalid_type,expected:Ye.array,received:r.parsedType}),jt;if(r.data.lengththis._def.items.length&&(Ue(r,{code:Pe.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 Vo(r,l,r.path,u)):null}).filter(l=>!!l);return r.common.async?Promise.all(o).then(l=>ms.mergeArray(n,l)):ms.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new Ki({...this._def,rest:t})}}Ki.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ki({items:e,typeName:kt.ZodTuple,rest:null,...Bt(t)})};class Tj extends Zt{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!==Ye.map)return Ue(r,{code:Pe.invalid_type,expected:Ye.map,received:r.parsedType}),jt;const a=this._def.keyType,o=this._def.valueType,l=[...r.data.entries()].map(([u,d],f)=>({key:a._parse(new Vo(r,u,r.path,[f,"key"])),value:o._parse(new Vo(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 jt;(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 jt;(f.status==="dirty"||h.status==="dirty")&&n.dirty(),u.set(f.value,h.value)}return{status:n.value,value:u}}}}Tj.create=(e,t,n)=>new Tj({valueType:t,keyType:e,typeName:kt.ZodMap,...Bt(n)});class dd extends Zt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ye.set)return Ue(r,{code:Pe.invalid_type,expected:Ye.set,received:r.parsedType}),jt;const a=this._def;a.minSize!==null&&r.data.sizea.maxSize.value&&(Ue(r,{code:Pe.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.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 jt;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 Vo(r,d,r.path,f)));return r.common.async?Promise.all(u).then(d=>l(d)):l(u)}min(t,n){return new dd({...this._def,minSize:{value:t,message:tt.toString(n)}})}max(t,n){return new dd({...this._def,maxSize:{value:t,message:tt.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}dd.create=(e,t)=>new dd({valueType:e,minSize:null,maxSize:null,typeName:kt.ZodSet,...Bt(t)});class Mj extends Zt{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})}}Mj.create=(e,t)=>new Mj({getter:e,typeName:kt.ZodLazy,...Bt(t)});class _j extends Zt{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Ue(n,{received:n.data,code:Pe.invalid_literal,expected:this._def.value}),jt}return{status:"valid",value:t.data}}get value(){return this._def.value}}_j.create=(e,t)=>new _j({value:e,typeName:kt.ZodLiteral,...Bt(t)});function jP(e,t){return new hc({values:e,typeName:kt.ZodEnum,...Bt(t)})}class hc extends Zt{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Ue(n,{expected:tn.joinValues(r),received:n.parsedType,code:Pe.invalid_type}),jt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return Ue(n,{received:n.data,code:Pe.invalid_enum_value,options:r}),jt}return As(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 hc.create(t,{...this._def,...n})}exclude(t,n=this._def){return hc.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}hc.create=jP;class Pj extends Zt{_parse(t){const n=tn.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Ye.string&&r.parsedType!==Ye.number){const a=tn.objectValues(n);return Ue(r,{expected:tn.joinValues(a),received:r.parsedType,code:Pe.invalid_type}),jt}if(this._cache||(this._cache=new Set(tn.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const a=tn.objectValues(n);return Ue(r,{received:r.data,code:Pe.invalid_enum_value,options:a}),jt}return As(t.data)}get enum(){return this._def.values}}Pj.create=(e,t)=>new Pj({values:e,typeName:kt.ZodNativeEnum,...Bt(t)});class hh extends Zt{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Ye.promise&&n.common.async===!1)return Ue(n,{code:Pe.invalid_type,expected:Ye.promise,received:n.parsedType}),jt;const r=n.parsedType===Ye.promise?n.data:Promise.resolve(n.data);return As(r.then(a=>this._def.type.parseAsync(a,{path:n.path,errorMap:n.common.contextualErrorMap})))}}hh.create=(e,t)=>new hh({type:e,typeName:kt.ZodPromise,...Bt(t)});class mc extends Zt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===kt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=this._def.effect||null,o={addIssue:l=>{Ue(r,l),l.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),a.type==="preprocess"){const l=a.transform(r.data,o);if(r.common.async)return Promise.resolve(l).then(async u=>{if(n.value==="aborted")return jt;const d=await this._def.schema._parseAsync({data:u,path:r.path,parent:r});return d.status==="aborted"?jt:d.status==="dirty"||n.value==="dirty"?Wu(d.value):d});{if(n.value==="aborted")return jt;const u=this._def.schema._parseSync({data:l,path:r.path,parent:r});return u.status==="aborted"?jt:u.status==="dirty"||n.value==="dirty"?Wu(u.value):u}}if(a.type==="refinement"){const l=u=>{const d=a.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"?jt:(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"?jt:(u.status==="dirty"&&n.dirty(),l(u.value).then(()=>({status:n.value,value:u.value}))))}if(a.type==="transform")if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!fc(l))return jt;const u=a.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=>fc(l)?Promise.resolve(a.transform(l.value,o)).then(u=>({status:n.value,value:u})):jt);tn.assertNever(a)}}mc.create=(e,t,n)=>new mc({schema:e,typeName:kt.ZodEffects,effect:t,...Bt(n)});mc.createWithPreprocess=(e,t,n)=>new mc({schema:t,effect:{type:"preprocess",transform:e},typeName:kt.ZodEffects,...Bt(n)});class Fo extends Zt{_parse(t){return this._getType(t)===Ye.undefined?As(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Fo.create=(e,t)=>new Fo({innerType:e,typeName:kt.ZodOptional,...Bt(t)});class gc extends Zt{_parse(t){return this._getType(t)===Ye.null?As(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}gc.create=(e,t)=>new gc({innerType:e,typeName:kt.ZodNullable,...Bt(t)});class Rx extends Zt{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Ye.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Rx.create=(e,t)=>new Rx({innerType:e,typeName:kt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Bt(t)});class Ix extends Zt{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return uh(a)?a.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ga(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Ga(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Ix.create=(e,t)=>new Ix({innerType:e,typeName:kt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Bt(t)});class Rj extends Zt{_parse(t){if(this._getType(t)!==Ye.nan){const r=this._getOrReturnCtx(t);return Ue(r,{code:Pe.invalid_type,expected:Ye.nan,received:r.parsedType}),jt}return{status:"valid",value:t.data}}}Rj.create=e=>new Rj({typeName:kt.ZodNaN,...Bt(e)});class uq extends Zt{_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 vw extends Zt{_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"?jt:o.status==="dirty"?(n.dirty(),Wu(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?jt:a.status==="dirty"?(n.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(t,n){return new vw({in:t,out:n,typeName:kt.ZodPipeline})}}class Ox extends Zt{_parse(t){const n=this._def.innerType._parse(t),r=a=>(fc(a)&&(a.value=Object.freeze(a.value)),a);return uh(n)?n.then(a=>r(a)):r(n)}unwrap(){return this._def.innerType}}Ox.create=(e,t)=>new Ox({innerType:e,typeName:kt.ZodReadonly,...Bt(t)});var kt;(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"})(kt||(kt={}));const he=Ba.create;Hi.create;Wi.create;const Me=dh.create;pc.create;const Mc=_x.create;qo.create;const Ds=ba.create,fn=Qn.create,_c=fh.create;ph.create;Ki.create;const yw=hc.create;hh.create;Fo.create;gc.create;const ot={string:(e=>Ba.create({...e,coerce:!0})),number:(e=>Hi.create({...e,coerce:!0})),boolean:(e=>dh.create({...e,coerce:!0})),bigint:(e=>Wi.create({...e,coerce:!0})),date:(e=>pc.create({...e,coerce:!0}))};function Ij(e,[t,n]){return Math.min(n,Math.max(t,e))}function xw(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 kP=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"}),dq="VisuallyHidden",fq=v.forwardRef((e,t)=>s.jsx(wt.span,{...e,ref:t,style:{...kP,...e.style}}));fq.displayName=dq;var pq=[" ","Enter","ArrowUp","ArrowDown"],hq=[" ","Enter"],Gi="Select",[im,lm,mq]=Fb(Gi),[Pc]=sa(Gi,[mq,Jh]),cm=Jh(),[gq,ri]=Pc(Gi),[vq,yq]=Pc(Gi),EP=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:o,value:l,defaultValue:u,onValueChange:d,dir:f,name:h,autoComplete:m,disabled:g,required:b,form:x}=e,w=cm(t),[C,k]=v.useState(null),[N,T]=v.useState(null),[_,P]=v.useState(!1),M=Wh(f),[O,D]=Ha({prop:r,defaultProp:a??!1,onChange:o,caller:Gi}),[F,B]=Ha({prop:l,defaultProp:u,onChange:d,caller:Gi}),te=v.useRef(null),U=C?x||!!C.closest("form"):!0,[ce,q]=v.useState(new Set),ne=Array.from(ce).map(Y=>Y.props.value).join(";");return s.jsx(HM,{...w,children:s.jsxs(gq,{required:b,scope:t,trigger:C,onTriggerChange:k,valueNode:N,onValueNodeChange:T,valueNodeHasChildren:_,onValueNodeHasChildrenChange:P,contentId:Ys(),value:F,onValueChange:B,open:O,onOpenChange:D,dir:M,triggerPointerDownPosRef:te,disabled:g,children:[s.jsx(im.Provider,{scope:t,children:s.jsx(vq,{scope:e.__scopeSelect,onNativeOptionAdd:v.useCallback(Y=>{q(se=>new Set(se).add(Y))},[]),onNativeOptionRemove:v.useCallback(Y=>{q(se=>{const H=new Set(se);return H.delete(Y),H})},[]),children:n})}),U?s.jsxs(GP,{"aria-hidden":!0,required:b,tabIndex:-1,name:h,autoComplete:m,value:F,onChange:Y=>B(Y.target.value),disabled:g,form:x,children:[F===void 0?s.jsx("option",{value:""}):null,Array.from(ce)]},ne):null]})})};EP.displayName=Gi;var NP="SelectTrigger",TP=v.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,o=cm(n),l=ri(NP,n),u=l.disabled||r,d=nn(t,l.onTriggerChange),f=lm(n),h=v.useRef("touch"),[m,g,b]=QP(w=>{const C=f().filter(T=>!T.disabled),k=C.find(T=>T.value===l.value),N=YP(C,w,k);N!==void 0&&l.onValueChange(N.value)}),x=w=>{u||(l.onOpenChange(!0),b()),w&&(l.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return s.jsx(WM,{asChild:!0,...o,children:s.jsx(wt.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":JP(l.value)?"":void 0,...a,ref:d,onClick:Ge(a.onClick,w=>{w.currentTarget.focus(),h.current!=="mouse"&&x(w)}),onPointerDown:Ge(a.onPointerDown,w=>{h.current=w.pointerType;const C=w.target;C.hasPointerCapture(w.pointerId)&&C.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(x(w),w.preventDefault())}),onKeyDown:Ge(a.onKeyDown,w=>{const C=m.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&g(w.key),!(C&&w.key===" ")&&pq.includes(w.key)&&(x(),w.preventDefault())})})})});TP.displayName=NP;var MP="SelectValue",_P=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:o,placeholder:l="",...u}=e,d=ri(MP,n),{onValueNodeHasChildrenChange:f}=d,h=o!==void 0,m=nn(t,d.onValueNodeChange);return er(()=>{f(h)},[f,h]),s.jsx(wt.span,{...u,ref:m,style:{pointerEvents:"none"},children:JP(d.value)?s.jsx(s.Fragment,{children:l}):o})});_P.displayName=MP;var xq="SelectIcon",PP=v.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return s.jsx(wt.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});PP.displayName=xq;var bq="SelectPortal",RP=e=>s.jsx(Bh,{asChild:!0,...e});RP.displayName=bq;var Ji="SelectContent",IP=v.forwardRef((e,t)=>{const n=ri(Ji,e.__scopeSelect),[r,a]=v.useState();if(er(()=>{a(new DocumentFragment)},[]),!n.open){const o=r;return o?bc.createPortal(s.jsx(OP,{scope:e.__scopeSelect,children:s.jsx(im.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),o):null}return s.jsx(AP,{...e,ref:t})});IP.displayName=Ji;var Hs=10,[OP,si]=Pc(Ji),wq="SelectContentImpl",Sq=lc("SelectContent.RemoveScroll"),AP=v.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:o,onPointerDownOutside:l,side:u,sideOffset:d,align:f,alignOffset:h,arrowPadding:m,collisionBoundary:g,collisionPadding:b,sticky:x,hideWhenDetached:w,avoidCollisions:C,...k}=e,N=ri(Ji,n),[T,_]=v.useState(null),[P,M]=v.useState(null),O=nn(t,j=>_(j)),[D,F]=v.useState(null),[B,te]=v.useState(null),U=lm(n),[ce,q]=v.useState(!1),ne=v.useRef(!1);v.useEffect(()=>{if(T)return Tb(T)},[T]),Nb();const Y=v.useCallback(j=>{const[I,...me]=U().map(Je=>Je.ref.current),[be]=me.slice(-1),st=document.activeElement;for(const Je of j)if(Je===st||(Je?.scrollIntoView({block:"nearest"}),Je===I&&P&&(P.scrollTop=0),Je===be&&P&&(P.scrollTop=P.scrollHeight),Je?.focus(),document.activeElement!==st))return},[U,P]),se=v.useCallback(()=>Y([D,T]),[Y,D,T]);v.useEffect(()=>{ce&&se()},[ce,se]);const{onOpenChange:H,triggerPointerDownPosRef:W}=N;v.useEffect(()=>{if(T){let j={x:0,y:0};const I=be=>{j={x:Math.abs(Math.round(be.pageX)-(W.current?.x??0)),y:Math.abs(Math.round(be.pageY)-(W.current?.y??0))}},me=be=>{j.x<=10&&j.y<=10?be.preventDefault():T.contains(be.target)||H(!1),document.removeEventListener("pointermove",I),W.current=null};return W.current!==null&&(document.addEventListener("pointermove",I),document.addEventListener("pointerup",me,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",I),document.removeEventListener("pointerup",me,{capture:!0})}}},[T,H,W]),v.useEffect(()=>{const j=()=>H(!1);return window.addEventListener("blur",j),window.addEventListener("resize",j),()=>{window.removeEventListener("blur",j),window.removeEventListener("resize",j)}},[H]);const[V,A]=QP(j=>{const I=U().filter(st=>!st.disabled),me=I.find(st=>st.ref.current===document.activeElement),be=YP(I,j,me);be&&setTimeout(()=>be.ref.current.focus())}),K=v.useCallback((j,I,me)=>{const be=!ne.current&&!me;(N.value!==void 0&&N.value===I||be)&&(F(j),be&&(ne.current=!0))},[N.value]),re=v.useCallback(()=>T?.focus(),[T]),ee=v.useCallback((j,I,me)=>{const be=!ne.current&&!me;(N.value!==void 0&&N.value===I||be)&&te(j)},[N.value]),ie=r==="popper"?Ax:DP,ue=ie===Ax?{side:u,sideOffset:d,align:f,alignOffset:h,arrowPadding:m,collisionBoundary:g,collisionPadding:b,sticky:x,hideWhenDetached:w,avoidCollisions:C}:{};return s.jsx(OP,{scope:n,content:T,viewport:P,onViewportChange:M,itemRefCallback:K,selectedItem:D,onItemLeave:re,itemTextRefCallback:ee,focusSelectedItem:se,selectedItemText:B,position:r,isPositioned:ce,searchRef:V,children:s.jsx(Uh,{as:Sq,allowPinchZoom:!0,children:s.jsx($h,{asChild:!0,trapped:N.open,onMountAutoFocus:j=>{j.preventDefault()},onUnmountAutoFocus:Ge(a,j=>{N.trigger?.focus({preventScroll:!0}),j.preventDefault()}),children:s.jsx(Lh,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:j=>j.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:s.jsx(ie,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:j=>j.preventDefault(),...k,...ue,onPlaced:()=>q(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...k.style},onKeyDown:Ge(k.onKeyDown,j=>{const I=j.ctrlKey||j.altKey||j.metaKey;if(j.key==="Tab"&&j.preventDefault(),!I&&j.key.length===1&&A(j.key),["ArrowUp","ArrowDown","Home","End"].includes(j.key)){let be=U().filter(st=>!st.disabled).map(st=>st.ref.current);if(["ArrowUp","End"].includes(j.key)&&(be=be.slice().reverse()),["ArrowUp","ArrowDown"].includes(j.key)){const st=j.target,Je=be.indexOf(st);be=be.slice(Je+1)}setTimeout(()=>Y(be)),j.preventDefault()}})})})})})})});AP.displayName=wq;var Cq="SelectItemAlignedPosition",DP=v.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,o=ri(Ji,n),l=si(Ji,n),[u,d]=v.useState(null),[f,h]=v.useState(null),m=nn(t,O=>h(O)),g=lm(n),b=v.useRef(!1),x=v.useRef(!0),{viewport:w,selectedItem:C,selectedItemText:k,focusSelectedItem:N}=l,T=v.useCallback(()=>{if(o.trigger&&o.valueNode&&u&&f&&w&&C&&k){const O=o.trigger.getBoundingClientRect(),D=f.getBoundingClientRect(),F=o.valueNode.getBoundingClientRect(),B=k.getBoundingClientRect();if(o.dir!=="rtl"){const st=B.left-D.left,Je=F.left-st,rt=O.left-Je,Ht=O.width+rt,Wn=Math.max(Ht,D.width),Pn=window.innerWidth-Hs,tr=Ij(Je,[Hs,Math.max(Hs,Pn-Wn)]);u.style.minWidth=Ht+"px",u.style.left=tr+"px"}else{const st=D.right-B.right,Je=window.innerWidth-F.right-st,rt=window.innerWidth-O.right-Je,Ht=O.width+rt,Wn=Math.max(Ht,D.width),Pn=window.innerWidth-Hs,tr=Ij(Je,[Hs,Math.max(Hs,Pn-Wn)]);u.style.minWidth=Ht+"px",u.style.right=tr+"px"}const te=g(),U=window.innerHeight-Hs*2,ce=w.scrollHeight,q=window.getComputedStyle(f),ne=parseInt(q.borderTopWidth,10),Y=parseInt(q.paddingTop,10),se=parseInt(q.borderBottomWidth,10),H=parseInt(q.paddingBottom,10),W=ne+Y+ce+H+se,V=Math.min(C.offsetHeight*5,W),A=window.getComputedStyle(w),K=parseInt(A.paddingTop,10),re=parseInt(A.paddingBottom,10),ee=O.top+O.height/2-Hs,ie=U-ee,ue=C.offsetHeight/2,j=C.offsetTop+ue,I=ne+Y+j,me=W-I;if(I<=ee){const st=te.length>0&&C===te[te.length-1].ref.current;u.style.bottom="0px";const Je=f.clientHeight-w.offsetTop-w.offsetHeight,rt=Math.max(ie,ue+(st?re:0)+Je+se),Ht=I+rt;u.style.height=Ht+"px"}else{const st=te.length>0&&C===te[0].ref.current;u.style.top="0px";const rt=Math.max(ee,ne+w.offsetTop+(st?K:0)+ue)+me;u.style.height=rt+"px",w.scrollTop=I-ee+w.offsetTop}u.style.margin=`${Hs}px 0`,u.style.minHeight=V+"px",u.style.maxHeight=U+"px",r?.(),requestAnimationFrame(()=>b.current=!0)}},[g,o.trigger,o.valueNode,u,f,w,C,k,o.dir,r]);er(()=>T(),[T]);const[_,P]=v.useState();er(()=>{f&&P(window.getComputedStyle(f).zIndex)},[f]);const M=v.useCallback(O=>{O&&x.current===!0&&(T(),N?.(),x.current=!1)},[T,N]);return s.jsx(kq,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:b,onScrollButtonChange:M,children:s.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:s.jsx(wt.div,{...a,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});DP.displayName=Cq;var jq="SelectPopperPosition",Ax=v.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=Hs,...o}=e,l=cm(n);return s.jsx(KM,{...l,...o,ref:t,align:r,collisionPadding:a,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)"}})});Ax.displayName=jq;var[kq,bw]=Pc(Ji,{}),Dx="SelectViewport",FP=v.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,o=si(Dx,n),l=bw(Dx,n),u=nn(t,o.onViewportChange),d=v.useRef(0);return s.jsxs(s.Fragment,{children:[s.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}),s.jsx(im.Slot,{scope:n,children:s.jsx(wt.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Ge(a.onScroll,f=>{const h=f.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:g}=l;if(g?.current&&m){const b=Math.abs(d.current-h.scrollTop);if(b>0){const x=window.innerHeight-Hs*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})})})]})});FP.displayName=Dx;var LP="SelectGroup",[Eq,Nq]=Pc(LP),Tq=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Ys();return s.jsx(Eq,{scope:n,id:a,children:s.jsx(wt.div,{role:"group","aria-labelledby":a,...r,ref:t})})});Tq.displayName=LP;var $P="SelectLabel",Mq=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Nq($P,n);return s.jsx(wt.div,{id:a.id,...r,ref:t})});Mq.displayName=$P;var mh="SelectItem",[_q,BP]=Pc(mh),zP=v.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:o,...l}=e,u=ri(mh,n),d=si(mh,n),f=u.value===r,[h,m]=v.useState(o??""),[g,b]=v.useState(!1),x=nn(t,N=>d.itemRefCallback?.(N,r,a)),w=Ys(),C=v.useRef("touch"),k=()=>{a||(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 s.jsx(_q,{scope:n,value:r,disabled:a,textId:w,isSelected:f,onItemTextChange:v.useCallback(N=>{m(T=>T||(N?.textContent??"").trim())},[]),children:s.jsx(im.ItemSlot,{scope:n,value:r,disabled:a,textValue:h,children:s.jsx(wt.div,{role:"option","aria-labelledby":w,"data-highlighted":g?"":void 0,"aria-selected":f&&g,"data-state":f?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...l,ref:x,onFocus:Ge(l.onFocus,()=>b(!0)),onBlur:Ge(l.onBlur,()=>b(!1)),onClick:Ge(l.onClick,()=>{C.current!=="mouse"&&k()}),onPointerUp:Ge(l.onPointerUp,()=>{C.current==="mouse"&&k()}),onPointerDown:Ge(l.onPointerDown,N=>{C.current=N.pointerType}),onPointerMove:Ge(l.onPointerMove,N=>{C.current=N.pointerType,a?d.onItemLeave?.():C.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ge(l.onPointerLeave,N=>{N.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:Ge(l.onKeyDown,N=>{d.searchRef?.current!==""&&N.key===" "||(hq.includes(N.key)&&k(),N.key===" "&&N.preventDefault())})})})})});zP.displayName=mh;var Ku="SelectItemText",UP=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...o}=e,l=ri(Ku,n),u=si(Ku,n),d=BP(Ku,n),f=yq(Ku,n),[h,m]=v.useState(null),g=nn(t,k=>m(k),d.onItemTextChange,k=>u.itemTextRefCallback?.(k,d.value,d.disabled)),b=h?.textContent,x=v.useMemo(()=>s.jsx("option",{value:d.value,disabled:d.disabled,children:b},d.value),[d.disabled,d.value,b]),{onNativeOptionAdd:w,onNativeOptionRemove:C}=f;return er(()=>(w(x),()=>C(x)),[w,C,x]),s.jsxs(s.Fragment,{children:[s.jsx(wt.span,{id:d.textId,...o,ref:g}),d.isSelected&&l.valueNode&&!l.valueNodeHasChildren?bc.createPortal(o.children,l.valueNode):null]})});UP.displayName=Ku;var VP="SelectItemIndicator",qP=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return BP(VP,n).isSelected?s.jsx(wt.span,{"aria-hidden":!0,...r,ref:t}):null});qP.displayName=VP;var Fx="SelectScrollUpButton",HP=v.forwardRef((e,t)=>{const n=si(Fx,e.__scopeSelect),r=bw(Fx,e.__scopeSelect),[a,o]=v.useState(!1),l=nn(t,r.onScrollButtonChange);return er(()=>{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]),a?s.jsx(KP,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=n;u&&d&&(u.scrollTop=u.scrollTop-d.offsetHeight)}}):null});HP.displayName=Fx;var Lx="SelectScrollDownButton",WP=v.forwardRef((e,t)=>{const n=si(Lx,e.__scopeSelect),r=bw(Lx,e.__scopeSelect),[a,o]=v.useState(!1),l=nn(t,r.onScrollButtonChange);return er(()=>{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]),a?s.jsx(KP,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=n;u&&d&&(u.scrollTop=u.scrollTop+d.offsetHeight)}}):null});WP.displayName=Lx;var KP=v.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,o=si("SelectScrollButton",n),l=v.useRef(null),u=lm(n),d=v.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return v.useEffect(()=>()=>d(),[d]),er(()=>{u().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[u]),s.jsx(wt.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:Ge(a.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:Ge(a.onPointerMove,()=>{o.onItemLeave?.(),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:Ge(a.onPointerLeave,()=>{d()})})}),Pq="SelectSeparator",Rq=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return s.jsx(wt.div,{"aria-hidden":!0,...r,ref:t})});Rq.displayName=Pq;var $x="SelectArrow",Iq=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=cm(n),o=ri($x,n),l=si($x,n);return o.open&&l.position==="popper"?s.jsx(GM,{...a,...r,ref:t}):null});Iq.displayName=$x;var Oq="SelectBubbleInput",GP=v.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=v.useRef(null),o=nn(r,a),l=xw(t);return v.useEffect(()=>{const u=a.current;if(!u)return;const d=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(d,"value").set;if(l!==t&&h){const m=new Event("change",{bubbles:!0});h.call(u,t),u.dispatchEvent(m)}},[l,t]),s.jsx(wt.select,{...n,style:{...kP,...n.style},ref:o,defaultValue:t})});GP.displayName=Oq;function JP(e){return e===""||e===void 0}function QP(e){const t=ea(e),n=v.useRef(""),r=v.useRef(0),a=v.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=v.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,o]}function YP(e,t,n){const a=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=Aq(e,Math.max(o,0));a.length===1&&(l=l.filter(f=>f!==n));const d=l.find(f=>f.textValue.toLowerCase().startsWith(a.toLowerCase()));return d!==n?d:void 0}function Aq(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Dq=EP,Fq=TP,Lq=_P,$q=PP,Bq=RP,zq=IP,Uq=FP,Vq=zP,qq=UP,Hq=qP,Wq=HP,Kq=WP;function _t({...e}){return s.jsx(Dq,{"data-slot":"select",...e})}function Pt({...e}){return s.jsx(Lq,{"data-slot":"select-value",...e})}function Rt({className:e,size:t="default",children:n,...r}){return s.jsxs(Fq,{"data-slot":"select-trigger","data-size":t,className:Et("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,s.jsx($q,{asChild:!0,children:s.jsx(L_,{className:"size-4 opacity-50"})})]})}function It({className:e,children:t,position:n="popper",...r}){return s.jsx(Bq,{children:s.jsxs(zq,{"data-slot":"select-content",className:Et("bg-popover text-popover-foreground 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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",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:[s.jsx(Gq,{}),s.jsx(Uq,{className:Et("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),s.jsx(Jq,{})]})})}function we({className:e,children:t,...n}){return s.jsxs(Vq,{"data-slot":"select-item",className:Et("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[s.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:s.jsx(Hq,{children:s.jsx(ew,{className:"size-4"})})}),s.jsx(qq,{children:t})]})}function Gq({className:e,...t}){return s.jsx(Wq,{"data-slot":"select-scroll-up-button",className:Et("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(iV,{className:"size-4"})})}function Jq({className:e,...t}){return s.jsx(Kq,{"data-slot":"select-scroll-down-button",className:Et("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(L_,{className:"size-4"})})}var um="Switch",[Qq]=sa(um),[Yq,Zq]=Qq(um),ZP=v.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:a,defaultChecked:o,required:l,disabled:u,value:d="on",onCheckedChange:f,form:h,...m}=e,[g,b]=v.useState(null),x=nn(t,T=>b(T)),w=v.useRef(!1),C=g?h||!!g.closest("form"):!0,[k,N]=Ha({prop:a,defaultProp:o??!1,onChange:f,caller:um});return s.jsxs(Yq,{scope:n,checked:k,disabled:u,children:[s.jsx(wt.button,{type:"button",role:"switch","aria-checked":k,"aria-required":l,"data-state":nR(k),"data-disabled":u?"":void 0,disabled:u,value:d,...m,ref:x,onClick:Ge(e.onClick,T=>{N(_=>!_),C&&(w.current=T.isPropagationStopped(),w.current||T.stopPropagation())})}),C&&s.jsx(tR,{control:g,bubbles:!w.current,name:r,value:d,checked:k,required:l,disabled:u,form:h,style:{transform:"translateX(-100%)"}})]})});ZP.displayName=um;var XP="SwitchThumb",eR=v.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,a=Zq(XP,n);return s.jsx(wt.span,{"data-state":nR(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})});eR.displayName=XP;var Xq="SwitchBubbleInput",tR=v.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...a},o)=>{const l=v.useRef(null),u=nn(l,o),d=xw(n),f=qb(t);return v.useEffect(()=>{const h=l.current;if(!h)return;const m=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(m,"checked").set;if(d!==n&&b){const x=new Event("click",{bubbles:r});b.call(h,n),h.dispatchEvent(x)}},[d,n,r]),s.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:u,style:{...a.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});tR.displayName=Xq;function nR(e){return e?"checked":"unchecked"}var eH=ZP,tH=eR;function Md({className:e,...t}){return s.jsx(eH,{"data-slot":"switch",className:Et("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:s.jsx(tH,{"data-slot":"switch-thumb",className:Et("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}var rR=v.createContext({dragDropManager:void 0}),Ms;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Ms||(Ms={}));function Mt(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),a=2;a-1})}var oH={type:ww,payload:{clientOffset:null,sourceClientOffset:null}};function iH(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},a=r.publishSource,o=a===void 0?!0:a,l=r.clientOffset,u=r.getSourceClientOffset,d=e.getMonitor(),f=e.getRegistry();e.dispatch(Oj(l)),lH(n,d,f);var h=dH(n,d);if(h===null){e.dispatch(oH);return}var m=null;if(l){if(!u)throw new Error("getSourceClientOffset must be defined");cH(u),m=u(h)}e.dispatch(Oj(l,m));var g=f.getSource(h),b=g.beginDrag(d,h);if(b!=null){uH(b),f.pinSource(h);var x=f.getSourceType(h);return{type:dm,payload:{itemType:x,item:b,sourceId:h,clientOffset:l||null,sourceClientOffset:m||null,isSourcePublic:!!o}}}}}function lH(e,t,n){Mt(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(r){Mt(n.getSource(r),"Expected sourceIds to be registered.")})}function cH(e){Mt(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function uH(e){Mt(sR(e),"Item must be an object.")}function dH(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 fH(e){return function(){var n=e.getMonitor();if(n.isDragging())return{type:Sw}}}function Bx(e,t){return t===null?e===null:Array.isArray(e)?e.some(function(n){return n===t}):e===t}function pH(e){return function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=r.clientOffset;hH(n);var o=n.slice(0),l=e.getMonitor(),u=e.getRegistry();mH(o,l,u);var d=l.getItemType();return gH(o,u,d),vH(o,l,u),{type:fm,payload:{targetIds:o,clientOffset:a||null}}}}function hH(e){Mt(Array.isArray(e),"Expected targetIds to be an array.")}function mH(e,t,n){Mt(t.isDragging(),"Cannot call hover while not dragging."),Mt(!t.didDrop(),"Cannot call hover after drop.");for(var r=0;r=0;r--){var a=e[r],o=t.getTargetType(a);Bx(o,n)||e.splice(r,1)}}function vH(e,t,n){e.forEach(function(r){var a=n.getTarget(r);a.hover(t,r)})}function Aj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Dj(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{},r=e.getMonitor(),a=e.getRegistry();bH(r);var o=CH(r);o.forEach(function(l,u){var d=wH(l,u,a,r),f={type:pm,payload:{dropResult:Dj(Dj({},n),d)}};e.dispatch(f)})}}function bH(e){Mt(e.isDragging(),"Cannot call drop while not dragging."),Mt(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function wH(e,t,n,r){var a=n.getTarget(e),o=a?a.drop(r,e):void 0;return SH(o),typeof o>"u"&&(o=t===0?{}:r.getDropResult()),o}function SH(e){Mt(typeof e>"u"||sR(e),"Drop result must either be an object or undefined.")}function CH(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function jH(e){return function(){var n=e.getMonitor(),r=e.getRegistry();kH(n);var a=n.getSourceId();if(a!=null){var o=r.getSource(a,!0);o.endDrag(n,a),r.unpinSource()}return{type:hm}}}function kH(e){Mt(e.isDragging(),"Cannot call endDrag while not dragging.")}function EH(e){return{beginDrag:iH(e),publishDragSource:fH(e),hover:pH(e),drop:xH(e),endDrag:jH(e)}}function NH(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function TH(e,t){for(var n=0;n0;r.backend&&(a&&!r.isSetUp?(r.backend.setup(),r.isSetUp=!0):!a&&r.isSetUp&&(r.backend.teardown(),r.isSetUp=!1))}),this.store=t,this.monitor=n,t.subscribe(this.handleRefCountChange)}return MH(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 a(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(Es(1));return n(aR)(e,t)}if(typeof e!="function")throw new Error(Es(2));var a=e,o=t,l=[],u=l,d=!1;function f(){u===l&&(u=l.slice())}function h(){if(d)throw new Error(Es(3));return o}function m(w){if(typeof w!="function")throw new Error(Es(4));if(d)throw new Error(Es(5));var C=!0;return f(),u.push(w),function(){if(C){if(d)throw new Error(Es(6));C=!1,f();var N=u.indexOf(w);u.splice(N,1),l=null}}}function g(w){if(!PH(w))throw new Error(Es(7));if(typeof w.type>"u")throw new Error(Es(8));if(d)throw new Error(Es(9));try{d=!0,o=a(o,w)}finally{d=!1}for(var C=l=u,k=0;k2&&arguments[2]!==void 0?arguments[2]:RH;if(e.length!==t.length)return!1;for(var r=0;r0&&arguments[0]!==void 0?arguments[0]:Uj,t=arguments.length>1?arguments[1]:void 0,n=t.payload;switch(t.type){case ww:case dm:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case fm:return IH(e.clientOffset,n.clientOffset)?e:zj(zj({},e),{},{clientOffset:n.clientOffset});case hm:case pm:return Uj;default:return e}}var Cw="dnd-core/ADD_SOURCE",jw="dnd-core/ADD_TARGET",kw="dnd-core/REMOVE_SOURCE",mm="dnd-core/REMOVE_TARGET";function FH(e){return{type:Cw,payload:{sourceId:e}}}function LH(e){return{type:jw,payload:{targetId:e}}}function $H(e){return{type:kw,payload:{sourceId:e}}}function BH(e){return{type:mm,payload:{targetId:e}}}function Vj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ns(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:UH,t=arguments.length>1?arguments[1]:void 0,n=t.payload;switch(t.type){case dm:return Ns(Ns({},e),{},{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case Sw:return Ns(Ns({},e),{},{isSourcePublic:!0});case fm:return Ns(Ns({},e),{},{targetIds:n.targetIds});case mm:return e.targetIds.indexOf(n.targetId)===-1?e:Ns(Ns({},e),{},{targetIds:rH(e.targetIds,n.targetId)});case pm:return Ns(Ns({},e),{},{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case hm:return Ns(Ns({},e),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function qH(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Cw:case jw:return e+1;case kw:case mm:return e-1;default:return e}}var gh=[],Ew=[];gh.__IS_NONE__=!0;Ew.__IS_ALL__=!0;function HH(e,t){if(e===gh)return!1;if(e===Ew||typeof t>"u")return!0;var n=aH(t,e);return n.length>0}function WH(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case fm:break;case Cw:case jw:case mm:case kw:return gh;case dm:case Sw:case hm:case pm:default:return Ew}var t=e.payload,n=t.targetIds,r=n===void 0?[]:n,a=t.prevTargetIds,o=a===void 0?[]:a,l=sH(r,o),u=l.length>0||!OH(r,o);if(!u)return gh;var d=o[o.length-1],f=r[r.length-1];return d!==f&&(d&&l.push(d),f&&l.push(f)),l}function KH(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e+1}function qj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Hj(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:WH(e.dirtyHandlerIds,{type:t.type,payload:Hj(Hj({},t.payload),{},{prevTargetIds:nH(e,"dragOperation.targetIds",[])})}),dragOffset:DH(e.dragOffset,t),refCount:qH(e.refCount,t),dragOperation:VH(e.dragOperation,t),stateId:KH(e.stateId)}}function QH(e,t){return{x:e.x+t.x,y:e.y+t.y}}function oR(e,t){return{x:e.x-t.x,y:e.y-t.y}}function YH(e){var t=e.clientOffset,n=e.initialClientOffset,r=e.initialSourceClientOffset;return!t||!n||!r?null:oR(QH(t,r),n)}function ZH(e){var t=e.clientOffset,n=e.initialClientOffset;return!t||!n?null:oR(t,n)}function XH(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function e9(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0},o=a.handlerIds;Mt(typeof n=="function","listener must be a function."),Mt(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&&!HH(f.dirtyHandlerIds,o);m||n()}finally{l=h}};return this.store.subscribe(u)}},{key:"subscribeToOffsetChange",value:function(n){var r=this;Mt(typeof n=="function","listener must be a function.");var a=this.store.getState().dragOffset,o=function(){var u=r.store.getState().dragOffset;u!==a&&(a=u,n())};return this.store.subscribe(o)}},{key:"canDragSource",value:function(n){if(!n)return!1;var r=this.registry.getSource(n);return Mt(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(Mt(r,"Expected to find a valid target. targetId=".concat(n)),!this.isDragging()||this.didDrop())return!1;var a=this.registry.getTargetType(n),o=this.getItemType();return Bx(a,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(Mt(r,"Expected to find a valid source. sourceId=".concat(n)),!this.isDragging()||!this.isSourcePublic())return!1;var a=this.registry.getSourceType(n),o=this.getItemType();return a!==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 a=r.shallow;if(!this.isDragging())return!1;var o=this.registry.getTargetType(n),l=this.getItemType();if(l&&!Bx(o,l))return!1;var u=this.getTargetIds();if(!u.length)return!1;var d=u.indexOf(n);return a?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 YH(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return ZH(this.store.getState().dragOffset)}}]),e})(),r9=0;function s9(){return r9++}function _p(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_p=function(n){return typeof n}:_p=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},_p(e)}function a9(e){Mt(typeof e.canDrag=="function","Expected canDrag to be a function."),Mt(typeof e.beginDrag=="function","Expected beginDrag to be a function."),Mt(typeof e.endDrag=="function","Expected endDrag to be a function.")}function o9(e){Mt(typeof e.canDrop=="function","Expected canDrop to be a function."),Mt(typeof e.hover=="function","Expected hover to be a function."),Mt(typeof e.drop=="function","Expected beginDrag to be a function.")}function zx(e,t){if(t&&Array.isArray(e)){e.forEach(function(n){return zx(n,!1)});return}Mt(typeof e=="string"||_p(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 Kj=typeof global<"u"?global:self,iR=Kj.MutationObserver||Kj.WebKitMutationObserver;function lR(e){return function(){const n=setTimeout(a,0),r=setInterval(a,50);function a(){clearTimeout(n),clearInterval(r),e()}}}function i9(e){let t=1;const n=new iR(e),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}const l9=typeof iR=="function"?i9:lR;class c9{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,a=t.length-this.index;r{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=l9(this.flush),this.requestErrorThrow=lR(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class u9{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 d9{create(t){const n=this.freeTasks,r=n.length?n.pop():new u9(this.onError,a=>n[n.length]=a);return r.task=t,r}constructor(t){this.onError=t,this.freeTasks=[]}}const cR=new c9,f9=new d9(cR.registerPendingError);function p9(e){cR.enqueueTask(f9.create(e))}function h9(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m9(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;Mt(this.isSourceId(n),"Expected a valid source ID.");var a=r&&n===this.pinnedSourceId,o=a?this.pinnedSource:this.dragSources.get(n);return o}},{key:"getTarget",value:function(n){return Mt(this.isTargetId(n),"Expected a valid target ID."),this.dropTargets.get(n)}},{key:"getSourceType",value:function(n){return Mt(this.isSourceId(n),"Expected a valid source ID."),this.types.get(n)}},{key:"getTargetType",value:function(n){return Mt(this.isTargetId(n),"Expected a valid target ID."),this.types.get(n)}},{key:"isSourceId",value:function(n){var r=Jj(n);return r===Ms.SOURCE}},{key:"isTargetId",value:function(n){var r=Jj(n);return r===Ms.TARGET}},{key:"removeSource",value:function(n){var r=this;Mt(this.getSource(n),"Expected an existing source."),this.store.dispatch($H(n)),p9(function(){r.dragSources.delete(n),r.types.delete(n)})}},{key:"removeTarget",value:function(n){Mt(this.getTarget(n),"Expected an existing target."),this.store.dispatch(BH(n)),this.dropTargets.delete(n),this.types.delete(n)}},{key:"pinSource",value:function(n){var r=this.getSource(n);Mt(r,"Expected an existing source."),this.pinnedSourceId=n,this.pinnedSource=r}},{key:"unpinSource",value:function(){Mt(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(n,r,a){var o=S9(n);return this.types.set(o,r),n===Ms.SOURCE?this.dragSources.set(o,a):n===Ms.TARGET&&this.dropTargets.set(o,a),o}}]),e})();function j9(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,a=k9(r),o=new n9(a,new C9(a)),l=new _H(a,o),u=e(l,t,n);return l.receiveBackend(u),l}function k9(e){var t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return aR(JH,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}var E9=["children"];function N9(e,t){return P9(e)||_9(e,t)||M9(e,t)||T9()}function T9(){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 M9(e,t){if(e){if(typeof e=="string")return Yj(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 Yj(e,t)}}function Yj(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 I9(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,o;for(o=0;o=0)&&(n[a]=e[a]);return n}var Zj=0,Pp=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),O9=v.memo(function(t){var n=t.children,r=R9(t,E9),a=A9(r),o=N9(a,2),l=o[0],u=o[1];return v.useEffect(function(){if(u){var d=uR();return++Zj,function(){--Zj===0&&(d[Pp]=null)}}},[]),s.jsx(rR.Provider,Object.assign({value:l},{children:n}),void 0)});function A9(e){if("manager"in e){var t={dragDropManager:e.manager};return[t,!1]}var n=D9(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[n,r]}function D9(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:uR(),n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,a=t;return a[Pp]||(a[Pp]={dragDropManager:j9(e,t,n,r)}),a[Pp]}function uR(){return typeof global<"u"?global:window}function F9(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function L9(e,t){for(var n=0;n, or turn it into a ")+"drag source or a drop target itself.")}}function W9(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 a=t;H9(a);var o=n?function(l){return e(l,n)}:e;return K9(a,o)}}function dR(e){var t={};return Object.keys(e).forEach(function(n){var r=e[n];if(n.endsWith("Ref"))t[n]=e[n];else{var a=W9(r);t[n]=function(){return a}}}),t}function tk(e,t){typeof e=="function"?e(t):e.current=t}function K9(e,t){var n=e.ref;return Mt(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(a){tk(n,a),tk(t,a)}}):v.cloneElement(e,{ref:t})}function Rp(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Rp=function(n){return typeof n}:Rp=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Rp(e)}function Ux(e){return e!==null&&Rp(e)==="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Vx(e,t,n,r){var a=void 0;if(a!==void 0)return!!a;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=rW(this.entered.filter(this.isNodeInDocument),n),r>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),e})(),cW=hR(function(){return/firefox/i.test(navigator.userAgent)}),mR=hR(function(){return!!window.safari});function uW(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dW(e,t){for(var n=0;nn)h=m-1;else return a[m]}d=Math.max(0,h);var b=n-r[d],x=b*b;return a[d]+o[d]*b+l[d]*x+u[d]*b*x}}]),e})(),pW=1;function gR(e){var t=e.nodeType===pW?e:e.parentElement;if(!t)return null;var n=t.getBoundingClientRect(),r=n.top,a=n.left;return{x:a,y:r}}function Xf(e){return{x:e.clientX,y:e.clientY}}function hW(e){var t;return e.nodeName==="IMG"&&(cW()||!((t=document.documentElement)!==null&&t!==void 0&&t.contains(e)))}function mW(e,t,n,r){var a=e?t.width:n,o=e?t.height:r;return mR()&&e&&(o/=window.devicePixelRatio,a/=window.devicePixelRatio),{dragPreviewWidth:a,dragPreviewHeight:o}}function gW(e,t,n,r,a){var o=hW(t),l=o?e:t,u=gR(l),d={x:n.x-u.x,y:n.y-u.y},f=e.offsetWidth,h=e.offsetHeight,m=r.anchorX,g=r.anchorY,b=mW(o,t,f,h),x=b.dragPreviewWidth,w=b.dragPreviewHeight,C=function(){var O=new ck([0,.5,1],[d.y,d.y/h*w,d.y+w-h]),D=O.interpolate(g);return mR()&&o&&(D+=(window.devicePixelRatio-1)*w),D},k=function(){var O=new ck([0,.5,1],[d.x,d.x/f*x,d.x+x-f]);return O.interpolate(m)},N=a.offsetX,T=a.offsetY,_=N===0||N,P=T===0||T;return{x:_?N:k(),y:P?T:C()}}var vR="__NATIVE_FILE__",yR="__NATIVE_URL__",xR="__NATIVE_TEXT__",bR="__NATIVE_HTML__";const uk=Object.freeze(Object.defineProperty({__proto__:null,FILE:vR,HTML:bR,TEXT:xR,URL:yR},Symbol.toStringTag,{value:"Module"}));function iy(e,t,n){var r=t.reduce(function(a,o){return a||e.getData(o)},"");return r??n}var Bl;function ep(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Hx=(Bl={},ep(Bl,vR,{exposeProperties:{files:function(t){return Array.prototype.slice.call(t.files)},items:function(t){return t.items},dataTransfer:function(t){return t}},matchesTypes:["Files"]}),ep(Bl,bR,{exposeProperties:{html:function(t,n){return iy(t,n,"")},dataTransfer:function(t){return t}},matchesTypes:["Html","text/html"]}),ep(Bl,yR,{exposeProperties:{urls:function(t,n){return iy(t,n,"").split(` +`)},dataTransfer:function(t){return t}},matchesTypes:["Url","text/uri-list"]}),ep(Bl,xR,{exposeProperties:{text:function(t,n){return iy(t,n,"")},dataTransfer:function(t){return t}},matchesTypes:["Text","text/plain"]}),Bl);function vW(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yW(e,t){for(var n=0;n-1})})[0]||null}function SW(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function CW(e,t){for(var n=0;n0&&a.actions.hover(l,{clientOffset:Xf(o)});var u=l.some(function(d){return a.monitor.canDropOnTarget(d)});u&&(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=a.getCurrentDropEffect()))}}),Ut(this,"handleTopDragOverCapture",function(){a.dragOverTargetIds=[]}),Ut(this,"handleTopDragOver",function(o){var l=a.dragOverTargetIds;if(a.dragOverTargetIds=[],!a.monitor.isDragging()){o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none");return}a.altKeyPressed=o.altKey,a.lastClientOffset=Xf(o),a.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(a.hoverRafId=requestAnimationFrame(function(){a.monitor.isDragging()&&a.actions.hover(l||[],{clientOffset:a.lastClientOffset}),a.hoverRafId=null}));var u=(l||[]).some(function(d){return a.monitor.canDropOnTarget(d)});u?(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=a.getCurrentDropEffect())):a.isDraggingNativeItem()?o.preventDefault():(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none"))}),Ut(this,"handleTopDragLeaveCapture",function(o){a.isDraggingNativeItem()&&o.preventDefault();var l=a.enterLeaveCounter.leave(o.target);l&&a.isDraggingNativeItem()&&setTimeout(function(){return a.endDragNativeItem()},0)}),Ut(this,"handleTopDropCapture",function(o){if(a.dropTargetIds=[],a.isDraggingNativeItem()){var l;o.preventDefault(),(l=a.currentNativeSource)===null||l===void 0||l.loadDataTransfer(o.dataTransfer)}else ly(o.dataTransfer)&&o.preventDefault();a.enterLeaveCounter.reset()}),Ut(this,"handleTopDrop",function(o){var l=a.dropTargetIds;a.dropTargetIds=[],a.actions.hover(l,{clientOffset:Xf(o)}),a.actions.drop({dropEffect:a.getCurrentDropEffect()}),a.isDraggingNativeItem()?a.endDragNativeItem():a.monitor.isDragging()&&a.actions.endDrag()}),Ut(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 kW(n,r),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new lW(this.isNodeInDocument)}return TW(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,a){var o=this;return this.sourcePreviewNodeOptions.set(n,a),this.sourcePreviewNodes.set(n,r),function(){o.sourcePreviewNodes.delete(n),o.sourcePreviewNodeOptions.delete(n)}}},{key:"connectDragSource",value:function(n,r,a){var o=this;this.sourceNodes.set(n,r),this.sourceNodeOptions.set(n,a);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 a=this,o=function(f){return a.handleDragEnter(f,n)},l=function(f){return a.handleDragOver(f,n)},u=function(f){return a.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 pk({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 pk({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}},{key:"isDraggingNativeItem",value:function(){var n=this.monitor.getItemType();return Object.keys(uk).some(function(r){return uk[r]===n})}},{key:"beginDragNativeItem",value:function(n,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=wW(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 a=1e3;this.mouseMoveTimeoutTimer=setTimeout(function(){var o;return(o=r.rootElement)===null||o===void 0?void 0:o.addEventListener("mousemove",r.endDragIfSourceWasRemovedFromDOM,!0)},a)}},{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})(),_W=function(t,n,r){return new MW(t,n,r)},PW=Object.create,wR=Object.defineProperty,RW=Object.getOwnPropertyDescriptor,SR=Object.getOwnPropertyNames,IW=Object.getPrototypeOf,OW=Object.prototype.hasOwnProperty,AW=(e,t)=>function(){return t||(0,e[SR(e)[0]])((t={exports:{}}).exports,t),t.exports},DW=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of SR(t))!OW.call(e,a)&&a!==n&&wR(e,a,{get:()=>t[a],enumerable:!(r=RW(t,a))||r.enumerable});return e},CR=(e,t,n)=>(n=e!=null?PW(IW(e)):{},DW(wR(n,"default",{value:e,enumerable:!0}),e)),jR=AW({"node_modules/classnames/index.js"(e,t){(function(){var n={}.hasOwnProperty;function r(){for(var a=[],o=0;o-1}var qK=VK,HK=9007199254740991,WK=/^(?:0|[1-9]\d*)$/;function KK(e,t){var n=typeof e;return t=t??HK,!!t&&(n=="number"||n!="symbol"&&WK.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=QK}var PR=YK;function ZK(e){return e!=null&&PR(e.length)&&!MR(e)}var XK=ZK,eG=Object.prototype;function tG(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||eG;return e===n}var nG=tG;function rG(e,t){for(var n=-1,r=Array(e);++n-1}var OJ=IJ;function AJ(e,t){var n=this.__data__,r=gm(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var DJ=AJ;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,b=n&VQ?new LR:void 0;for(o.set(e,t),o.set(t,e);++m":">",'"':""","'":"'"},SY=tQ(wY),CY=SY,UR=/[&<>"']/g,jY=RegExp(UR.source);function kY(e){return e=FR(e),e&&jY.test(e)?e.replace(UR,CY):e}var EY=kY,VR=/[\\^$.*+?()[\]{}|]/g,NY=RegExp(VR.source);function TY(e){return e=FR(e),e&&NY.test(e)?e.replace(VR,"\\$&"):e}var MY=TY;function _Y(e,t){return yY(e,t)}var PY=_Y,RY=1/0,IY=tc&&1/Nw(new tc([,-0]))[1]==RY?function(e){return new tc(e)}:OK,OY=IY,AY=200;function DY(e,t,n){var r=-1,a=qK,o=e.length,l=!0,u=[],d=u;if(n)l=!1,a=bY;else if(o>=AY){var f=t?null:OY(e);if(f)return Nw(f);l=!1,a=$R,d=new LR}else d=t?[]:u;e:for(;++rs.jsx("button",{className:e.classNames.clearAll,onClick:e.onClick,children:"Clear all"}),zY=BY,UY=(e,t)=>{const n=t.offsetHeight,r=e.offsetHeight,a=e.offsetTop-t.scrollTop;a+r>=n?t.scrollTop+=a-n+r:a<0&&(t.scrollTop+=a)},Qx=(e,t,n,r)=>typeof r=="function"?r(e):e.length>=t&&n,VY=e=>{const t=v.createRef(),{labelField:n,minQueryLength:r,isFocused:a,classNames:o,selectedIndex:l,query:u}=e;v.useEffect(()=>{if(!t.current)return;const m=t.current.querySelector(`.${o.activeSuggestion}`);m&&UY(m,t.current)},[l]);const d=(m,g)=>{const b=g.trim().replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&"),{[n]:x}=m;return{__html:x.replace(RegExp(b,"gi"),w=>`${EY(w)}`)}},f=(m,g)=>typeof e.renderSuggestion=="function"?e.renderSuggestion(m,g):s.jsx("span",{dangerouslySetInnerHTML:d(m,g)}),h=e.suggestions.map((m,g)=>s.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||!Qx(u,r||2,a,e.shouldRenderSuggestions)?null:s.jsx("div",{ref:t,className:o.suggestions,"data-testid":"suggestions",children:s.jsxs("ul",{children:[" ",h," "]})})},qY=(e,t)=>{const{query:n,minQueryLength:r=2,isFocused:a,suggestions:o}=t;return!!(e.isFocused===a&&PY(e.suggestions,o)&&Qx(n,r,a,t.shouldRenderSuggestions)===Qx(e.query,e.minQueryLength??2,e.isFocused,e.shouldRenderSuggestions)&&e.selectedIndex===t.selectedIndex)},HY=v.memo(VY,qY),WY=HY,KY=CR(jR()),GY=CR(jR());function JY(e){const t=e.map(r=>{const a=r-48*Math.floor(r/48);return String.fromCharCode(96<=r?a:r)}).join(""),n=MY(t);return new RegExp(`[${n}]+`)}function QY(e){switch(e){case va.ENTER:return[10,13];case va.TAB:return 9;case va.COMMA:return 188;case va.SPACE:return 32;case va.SEMICOLON:return 186;default:return 0}}function $k(e){const{moveTag:t,readOnly:n,allowDragDrop:r}=e;return t!==void 0&&!n&&r}function YY(e){const{readOnly:t,allowDragDrop:n}=e;return!t&&n}var ZY=e=>{const{readOnly:t,removeComponent:n,onRemove:r,className:a,tag:o,index:l}=e,u=f=>{if(ec.ENTER.includes(f.keyCode)||f.keyCode===ec.SPACE){f.preventDefault(),f.stopPropagation();return}f.keyCode===ec.BACKSPACE&&r(f)};if(t)return s.jsx("span",{});const d=`Tag at index ${l} with value ${o.id} focussed. Press backspace to remove`;if(n){const f=n;return s.jsx(f,{"data-testid":"remove",onRemove:r,onKeyDown:u,className:a,"aria-label":d,tag:o,index:l})}return s.jsx("button",{"data-testid":"remove",onClick:r,onKeyDown:u,className:a,type:"button","aria-label":d,children:s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",height:"12",width:"12",fill:"#fff",children:s.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"})})})},XY=ZY,Bk={TAG:"tag"},eZ=e=>{const t=v.useRef(null),{readOnly:n=!1,tag:r,classNames:a,index:o,moveTag:l,allowDragDrop:u=!0,labelField:d="text",tags:f}=e,[{isDragging:h},m]=B7(()=>({type:Bk.TAG,collect:C=>({isDragging:!!C.isDragging()}),item:e,canDrag:()=>$k({moveTag:l,readOnly:n,allowDragDrop:u})}),[f]),[,g]=nW(()=>({accept:Bk.TAG,drop:C=>{const k=C.index,N=o;k!==N&&e?.moveTag?.(k,N)},canDrop:C=>YY(C)}),[f]);m(g(t));const b=e.tag[d],{className:x=""}=r,w=h?0:1;return s.jsxs("span",{ref:t,className:(0,GY.default)("tag-wrapper",a.tag,x),style:{opacity:w,cursor:$k({moveTag:l,readOnly:n,allowDragDrop:u})?"move":"auto"},"data-testid":"tag",onClick:e.onTagClicked,onTouchStart:e.onTagClicked,children:[b,s.jsx(XY,{tag:e.tag,className:a.remove,removeComponent:e.removeComponent,onRemove:e.onDelete,readOnly:n,index:o})]})},tZ=e=>{const{autofocus:t,autoFocus:n,readOnly:r,labelField:a,allowDeleteFromEmptyInput:o,allowAdditionFromPaste:l,allowDragDrop:u,minQueryLength:d,shouldRenderSuggestions:f,removeComponent:h,autocomplete:m,inline:g,maxTags:b,allowUnique:x,editable:w,placeholder:C,delimiters:k,separators:N,tags:T,inputFieldPosition:_,inputProps:P,classNames:M,maxLength:O,inputValue:D,clearAll:F}=e,[B,te]=v.useState(e.suggestions),[U,ce]=v.useState(""),[q,ne]=v.useState(!1),[Y,se]=v.useState(-1),[H,W]=v.useState(!1),[V,A]=v.useState(""),[K,re]=v.useState(-1),[ee,ie]=v.useState(""),ue=v.createRef(),j=v.useRef(null),I=v.useRef(null);v.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")},[]),v.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]),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&&st()},[n,n,r]),v.useEffect(()=>{Pn()},[U,e.suggestions]);const me=Ee=>{let bt=e.suggestions.slice();if(x){const br=T.map(ur=>ur.id.trim().toLowerCase());bt=bt.filter(ur=>!br.includes(ur.id.toLowerCase()))}if(e.handleFilterSuggestions)return e.handleFilterSuggestions(Ee,bt);const zt=bt.filter(br=>be(Ee,br)===0),Tn=bt.filter(br=>be(Ee,br)>0);return zt.concat(Tn)},be=(Ee,bt)=>bt[a].toLowerCase().indexOf(Ee.toLowerCase()),st=()=>{ce(""),j.current&&(j.current.value="",j.current.focus())},Je=(Ee,bt)=>{bt.preventDefault(),bt.stopPropagation();const zt=T.slice();zt.length!==0&&(ie(""),e?.handleDelete?.(Ee,bt),rt(Ee,zt))},rt=(Ee,bt)=>{if(!ue?.current)return;const zt=ue.current.querySelectorAll(".ReactTags__remove");let Tn="";Ee===0&&bt.length>1?(Tn=`Tag at index ${Ee} with value ${bt[Ee].id} deleted. Tag at index 0 with value ${bt[1].id} focussed. Press backspace to remove`,zt[0].focus()):Ee>0?(Tn=`Tag at index ${Ee} with value ${bt[Ee].id} deleted. Tag at index ${Ee-1} with value ${bt[Ee-1].id} focussed. Press backspace to remove`,zt[Ee-1].focus()):(Tn=`Tag at index ${Ee} with value ${bt[Ee].id} deleted. Input focussed. Press enter to add a new tag`,j.current?.focus()),A(Tn)},Ht=(Ee,bt,zt)=>{r||(w&&(re(Ee),ce(bt[a]),I.current?.focus()),e.handleTagClick?.(Ee,zt))},Wn=Ee=>{e.handleInputChange&&e.handleInputChange(Ee.target.value,Ee);const bt=Ee.target.value.trim();ce(bt)},Pn=()=>{const Ee=me(U);te(Ee),se(Y>=Ee.length?Ee.length-1:Y)},tr=Ee=>{const bt=Ee.target.value;e.handleInputFocus&&e.handleInputFocus(bt,Ee),ne(!0)},Sn=Ee=>{const bt=Ee.target.value;e.handleInputBlur&&(e.handleInputBlur(bt,Ee),j.current&&(j.current.value="")),ne(!1),re(-1)},zr=Ee=>{if(Ee.key==="Escape"&&(Ee.preventDefault(),Ee.stopPropagation(),se(-1),W(!1),te([]),re(-1)),(N.indexOf(Ee.key)!==-1||k.indexOf(Ee.keyCode)!==-1)&&!Ee.shiftKey){(Ee.keyCode!==ec.TAB||U!=="")&&Ee.preventDefault();const bt=H&&Y!==-1?B[Y]:{id:U.trim(),[a]:U.trim(),className:""};Object.keys(bt)&&_r(bt)}Ee.key==="Backspace"&&U===""&&(o||_===Au.INLINE)&&Je(T.length-1,Ee),Ee.keyCode===ec.UP_ARROW&&(Ee.preventDefault(),se(Y<=0?B.length-1:Y-1),W(!0)),Ee.keyCode===ec.DOWN_ARROW&&(Ee.preventDefault(),W(!0),B.length===0?se(-1):se((Y+1)%B.length))},Ur=()=>b&&T.length>=b,or=Ee=>{if(!l)return;if(Ur()){ie(mk.TAG_LIMIT),st();return}ie(""),Ee.preventDefault();const bt=Ee.clipboardData||window.clipboardData,zt=bt.getData("text"),{maxLength:Tn=zt.length}=e,br=Math.min(Tn,zt.length),ur=bt.getData("text").substr(0,br);let Vr=k;N.length&&(Vr=[],N.forEach(rs=>{const to=QY(rs);Array.isArray(to)?Vr=[...Vr,...to]:Vr.push(to)}));const Pr=JY(Vr),ns=ur.split(Pr).map(rs=>rs.trim());$Y(ns).forEach(rs=>_r({id:rs.trim(),[a]:rs.trim(),className:""}))},_r=Ee=>{if(!Ee.id||!Ee[a])return;if(K===-1){if(Ur()){ie(mk.TAG_LIMIT),st();return}ie("")}const bt=T.map(zt=>zt.id.toLowerCase());if(!(x&&bt.indexOf(Ee.id.trim().toLowerCase())>=0)){if(m){const zt=me(Ee[a]);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&&zt.length===1||m===!0&&zt.length)&&(Ee=zt[0])}K!==-1&&e.onTagUpdate?e.onTagUpdate(K,Ee):e?.handleAddition?.(Ee),ce(""),W(!1),se(-1),re(-1),st()}},z=Ee=>{_r(B[Ee])},oe=()=>{e.onClearAll&&e.onClearAll(),ie(""),st()},fe=Ee=>{se(Ee),W(!0)},Ae=(Ee,bt)=>{const zt=T[Ee];e?.handleDrag?.(zt,Ee,bt)},Te=(()=>{const Ee={...hk,...e.classNames};return T.map((bt,zt)=>s.jsx(v.Fragment,{children:K===zt?s.jsx("div",{className:Ee.editTagInput,children:s.jsx("input",{ref:Tn=>{I.current=Tn},onFocus:tr,value:U,onChange:Wn,onKeyDown:zr,onBlur:Sn,className:Ee.editTagInputField,onPaste:or,"data-testid":"tag-edit"})}):s.jsx(eZ,{index:zt,tag:bt,tags:T,labelField:a,onDelete:Tn=>Je(zt,Tn),moveTag:u?Ae:void 0,removeComponent:h,onTagClicked:Tn=>Ht(zt,bt,Tn),readOnly:r,classNames:Ee,allowDragDrop:u})},zt))})(),De={...hk,...M},{name:ht,id:Nt}=e,Rn=g===!1?Au.BOTTOM:_,vn=r?null:s.jsxs("div",{className:De.tagInput,children:[s.jsx("input",{...P,ref:Ee=>{j.current=Ee},className:De.tagInputField,type:"text",placeholder:C,"aria-label":C,onFocus:tr,onBlur:Sn,onChange:Wn,onKeyDown:zr,onPaste:or,name:ht,id:Nt,maxLength:O,value:D,"data-automation":"input","data-testid":"input"}),s.jsx(WY,{query:U.trim(),suggestions:B,labelField:a,selectedIndex:Y,handleClick:z,handleHover:fe,minQueryLength:d,shouldRenderSuggestions:f,isFocused:q,classNames:De,renderSuggestion:e.renderSuggestion}),F&&T.length>0&&s.jsx(zY,{classNames:De,onClick:oe}),ee&&s.jsxs("div",{"data-testid":"error",className:"ReactTags__error",children:[s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",height:"24",width:"24",fill:"#e03131",children:s.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"})}),ee]})]});return s.jsxs("div",{className:(0,KY.default)(De.tags,"react-tags-wrapper"),ref:ue,children:[s.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:V}),Rn===Au.TOP&&vn,s.jsxs("div",{className:De.selected,children:[Te,Rn===Au.INLINE&&vn]}),Rn===Au.BOTTOM&&vn]})},nZ=tZ,rZ=e=>{const{placeholder:t=FW,labelField:n=LW,suggestions:r=[],delimiters:a=[],separators:o=e.delimiters?.length?[]:[va.ENTER,va.TAB],autofocus:l,autoFocus:u=!0,inline:d,inputFieldPosition:f="inline",allowDeleteFromEmptyInput:h=!1,allowAdditionFromPaste:m=!0,autocomplete:g=!1,readOnly:b=!1,allowUnique:x=!0,allowDragDrop:w=!0,tags:C=[],inputProps:k={},editable:N=!1,clearAll:T=!1,handleDelete:_,handleAddition:P,onTagUpdate:M,handleDrag:O,handleFilterSuggestions:D,handleTagClick:F,handleInputChange:B,handleInputFocus:te,handleInputBlur:U,minQueryLength:ce,shouldRenderSuggestions:q,removeComponent:ne,onClearAll:Y,classNames:se,name:H,id:W,maxLength:V,inputValue:A,maxTags:K,renderSuggestion:re}=e;return s.jsx(nZ,{placeholder:t,labelField:n,suggestions:r,delimiters:a,separators:o,autofocus:l,autoFocus:u,inline:d,inputFieldPosition:f,allowDeleteFromEmptyInput:h,allowAdditionFromPaste:m,autocomplete:g,readOnly:b,allowUnique:x,allowDragDrop:w,tags:C,inputProps:k,editable:N,clearAll:T,handleDelete:_,handleAddition:P,onTagUpdate:M,handleDrag:O,handleFilterSuggestions:D,handleTagClick:F,handleInputChange:B,handleInputFocus:te,handleInputBlur:U,minQueryLength:ce,shouldRenderSuggestions:q,removeComponent:ne,onClearAll:Y,classNames:se,name:H,id:W,maxLength:V,inputValue:A,maxTags:K,renderSuggestion:re})},sZ=({...e})=>s.jsx(O9,{backend:_W,children:s.jsx(rZ,{...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 + *) +*/const aZ="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",ka=yr,qR=v.createContext({}),Xa=({...e})=>s.jsx(qR.Provider,{value:{name:e.name},children:s.jsx(h8,{...e})}),xm=()=>{const e=v.useContext(qR),t=v.useContext(HR),{getFieldState:n,formState:r}=m8(),a=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`,...a}},HR=v.createContext({}),Ea=v.forwardRef(({className:e,...t},n)=>{const r=v.useId();return s.jsx(HR.Provider,{value:{id:r},children:s.jsx("div",{ref:n,className:ln("space-y-2",e),...t})})});Ea.displayName="FormItem";const es=v.forwardRef(({className:e,...t},n)=>{const{error:r,formItemId:a}=xm();return s.jsx(Ve,{ref:n,className:ln(r&&"text-rose-600",e),htmlFor:a,...t})});es.displayName="FormLabel";const na=({children:e})=>{const{error:t,formItemId:n,formDescriptionId:r,formMessageId:a}=xm();return v.isValidElement(e)?v.cloneElement(e,{id:n,"aria-describedby":t?`${r} ${a}`:`${r}`,"aria-invalid":!!t}):null};na.displayName="FormControl";const bm=v.forwardRef(({className:e,...t},n)=>{const{formDescriptionId:r}=xm();return s.jsx("p",{ref:n,id:r,className:ln("text-sm text-muted-foreground",e),...t})});bm.displayName="FormDescription";const _d=v.forwardRef(({className:e,children:t,...n},r)=>{const{error:a,formMessageId:o}=xm(),l=a?String(a?.message):t;return l?s.jsx("p",{ref:r,id:o,className:ln("text-sm font-medium text-rose-600",e),...n,children:l}):null});_d.displayName="FormMessage";const pe=({name:e,label:t,children:n,required:r,readOnly:a,className:o,...l})=>s.jsx(Xa,{...l,name:e,render:({field:u})=>s.jsxs(Ea,{className:o,children:[t&&s.jsxs(es,{children:[t,r&&s.jsx("span",{className:"ml-2 text-rose-600",children:"*"})]}),s.jsx(na,{children:v.isValidElement(n)&&v.cloneElement(n,{name:u.name,value:u.value??"",onChange:u.onChange,onBlur:u.onBlur,required:r,readOnly:a})}),s.jsx(_d,{})]})}),Re=({name:e,label:t,required:n,className:r,helper:a,reverse:o,...l})=>s.jsx(Xa,{...l,name:e,render:({field:u})=>s.jsxs(Ea,{className:ln("flex items-center gap-3",o&&"flex-row-reverse justify-end",r),children:[s.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[t&&s.jsxs(es,{className:"break-all",children:[t,n&&s.jsx("span",{className:"ml-2 text-rose-600",children:"*"})]}),a&&s.jsx(bm,{className:"text-xs",children:a})]}),s.jsx(na,{children:s.jsx(Md,{checked:u.value,onCheckedChange:u.onChange,required:n})}),s.jsx(_d,{})]})}),un=({name:e,label:t,helper:n,required:r,options:a,placeholder:o,disabled:l,...u})=>s.jsx(Xa,{...u,name:e,render:({field:d})=>s.jsxs(Ea,{children:[t&&s.jsxs(es,{children:[t,r&&s.jsx("span",{className:"ml-2 text-rose-600",children:"*"})]}),s.jsx(na,{children:s.jsxs(_t,{onValueChange:d.onChange,defaultValue:d.value,disabled:l,children:[s.jsx(na,{children:s.jsx(Rt,{children:s.jsx(Pt,{placeholder:o})})}),s.jsx(It,{children:a.map(f=>s.jsx(we,{value:f.value,children:f.label},f.value))})]})}),n&&s.jsx(bm,{children:n}),s.jsx(_d,{})]})}),ai=({name:e,label:t,helper:n,required:r,placeholder:a,...o})=>s.jsx(Xa,{...o,name:e,render:({field:l})=>{let u=[];return Array.isArray(l.value)&&(u=l.value),s.jsxs(Ea,{children:[t&&s.jsxs(es,{children:[t,r&&s.jsx("span",{className:"ml-2 text-rose-600",children:"*"})]}),s.jsx(na,{children:s.jsx(sZ,{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:a,autoFocus:!1,allowDragDrop:!1,separators:[va.ENTER,va.TAB,va.COMMA],classNames:{tags:"tagsClass",tagInput:"tagInputClass",tagInputField:aZ,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&&s.jsx(bm,{children:n}),s.jsx(_d,{})]})}});function oZ({resetTable:e,open:t,onOpenChange:n}){const{t:r}=Le(),{createInstance:a}=Tc(),o=n,[l,u]=v.useState(!1),[d,f]=v.useState(!1),h=fn({instanceName:he().min(3,r("newInstance.validation.nameMin")).max(50,r("newInstance.validation.nameMax")).regex(/^[a-zA-Z0-9-_]+$/,r("newInstance.validation.nameFormat")),token:he().optional(),proxyHost:he().optional(),proxyPort:he().optional(),proxyUsername:he().optional(),proxyPassword:he().optional()}),{register:m,handleSubmit:g,reset:b,formState:{errors:x}}=mn({resolver:gn(h),defaultValues:{instanceName:"",token:"",proxyHost:"",proxyPort:"",proxyUsername:"",proxyPassword:""}}),w=async k=>{f(!0);try{const N={instanceName:k.instanceName,integration:"EVOLUTION_GO",token:k.token&&k.token.trim()!==""?k.token:Tx(),number:null,businessId:null,...k.proxyHost&&k.proxyPort?{proxy:{host:k.proxyHost,port:k.proxyPort,username:k.proxyUsername,password:k.proxyPassword}}:{}};await a(N),Q.success(r("toast.instance.created")),o(!1),b(),u(!1),e()}catch(N){console.error("Error:",N);const T=N instanceof Error?N.message:r("toast.instance.error");Q.error(T)}finally{f(!1)}},C=k=>{d||(o(k),k||(b(),u(!1)))};return s.jsx(vt,{open:t,onOpenChange:C,children:s.jsxs(mt,{className:"sm:max-w-md",children:[s.jsxs(gt,{children:[s.jsxs(xt,{className:"flex items-center gap-2",children:[s.jsx($r,{className:"h-5 w-5 text-primary"}),r("newInstance.title")]}),s.jsx(gr,{children:r("newInstance.description")})]}),s.jsxs("form",{onSubmit:g(w),className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs(Ve,{htmlFor:"instanceName",children:[r("newInstance.form.name.label")," ",s.jsx("span",{className:"text-rose-600",children:"*"})]}),s.jsx(Z,{id:"instanceName",type:"text",placeholder:r("newInstance.form.name.placeholder"),disabled:d,...m("instanceName")}),x.instanceName&&s.jsx("p",{className:"text-sm text-rose-600",children:x.instanceName.message}),s.jsx("p",{className:"text-xs text-muted-foreground",children:r("newInstance.form.name.hint")})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{htmlFor:"token",children:r("newInstance.form.token.label")}),s.jsx(Z,{id:"token",type:"text",placeholder:r("newInstance.form.token.placeholder"),disabled:d,...m("token")}),x.token&&s.jsx("p",{className:"text-sm text-rose-600",children:x.token.message}),s.jsx("p",{className:"text-xs text-muted-foreground",children:r("newInstance.form.token.hint")})]}),s.jsxs(sw,{open:l,onOpenChange:u,className:"space-y-2",children:[s.jsx(aw,{asChild:!0,children:s.jsxs($,{type:"button",variant:"outline",disabled:d,className:"w-full justify-between",children:[s.jsx("span",{children:r("newInstance.proxy.title")}),l?s.jsx(QB,{className:"h-4 w-4"}):s.jsx(Ib,{className:"h-4 w-4"})]})}),s.jsxs(ow,{className:"space-y-4 border-t border-border pt-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{htmlFor:"proxyHost",children:r("newInstance.proxy.host.label")}),s.jsx(Z,{id:"proxyHost",type:"text",placeholder:r("newInstance.proxy.host.placeholder"),disabled:d,...m("proxyHost")})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{htmlFor:"proxyPort",children:r("newInstance.proxy.port.label")}),s.jsx(Z,{id:"proxyPort",type:"text",placeholder:"8080",disabled:d,...m("proxyPort")})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{htmlFor:"proxyUsername",children:r("newInstance.proxy.username.label")}),s.jsx(Z,{id:"proxyUsername",type:"text",placeholder:r("newInstance.proxy.username.placeholder"),disabled:d,...m("proxyUsername")})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{htmlFor:"proxyPassword",children:r("newInstance.proxy.password.label")}),s.jsx(Z,{id:"proxyPassword",type:"password",placeholder:r("newInstance.proxy.password.placeholder"),disabled:d,...m("proxyPassword")})]})]})]}),s.jsxs(Kt,{className:"flex gap-2 sm:gap-0",children:[s.jsx($,{type:"button",variant:"outline",onClick:()=>C(!1),disabled:d,children:r("button.cancel")}),s.jsx($,{type:"submit",disabled:d,children:d?s.jsxs(s.Fragment,{children:[s.jsx(qh,{className:"mr-2 h-4 w-4 animate-spin"}),r("newInstance.button.creating")]}):s.jsxs(s.Fragment,{children:[s.jsx($r,{className:"mr-2 h-4 w-4"}),r("newInstance.button.create")]})})]})]})]})})}const hy=he().optional().transform(e=>e===""?void 0:e),iZ=fn({name:he(),token:hy,number:hy,businessId:hy,integration:yw(["WHATSAPP-BUSINESS","WHATSAPP-BAILEYS","EVOLUTION"])});function lZ({resetTable:e,open:t,onOpenChange:n}){const{t:r}=Le(),{createInstance:a}=Tc(),o=n,l=[{value:"WHATSAPP-BAILEYS",label:r("instance.form.integration.baileys")},{value:"WHATSAPP-BUSINESS",label:r("instance.form.integration.whatsapp")},{value:"EVOLUTION",label:r("instance.form.integration.evolution")}],u=mn({resolver:gn(iZ),defaultValues:{name:"",integration:"WHATSAPP-BAILEYS",token:Tx().replace("-","").toUpperCase(),number:"",businessId:""}}),d=u.watch("integration"),f=async m=>{try{const g={instanceName:m.name,integration:m.integration,token:m.token===""?null:m.token,number:m.number===""?null:m.number,businessId:m.businessId===""?null:m.businessId};await a(g),Q.success(r("toast.instance.created")),o(!1),h(),e()}catch(g){console.error("Error:",g),Q.error(`Error : ${g?.response?.data?.response?.message}`)}},h=()=>{u.reset({name:"",integration:"WHATSAPP-BAILEYS",token:Tx().replace("-","").toLocaleUpperCase(),number:"",businessId:""})};return vr()==="go"?s.jsx(oZ,{resetTable:e,open:t,onOpenChange:n}):s.jsx(vt,{open:t,onOpenChange:o,children:s.jsxs(mt,{className:"sm:max-w-[650px]",onCloseAutoFocus:h,children:[s.jsx(gt,{children:s.jsx(xt,{children:r("instance.modal.title")})}),s.jsx(yr,{...u,children:s.jsxs("form",{onSubmit:u.handleSubmit(f),className:"grid gap-4 py-4",children:[s.jsx(pe,{required:!0,name:"name",label:r("instance.form.name"),children:s.jsx(Z,{})}),s.jsx(un,{name:"integration",label:r("instance.form.integration.label"),options:l}),s.jsx(pe,{required:!0,name:"token",label:r("instance.form.token"),children:s.jsx(Z,{})}),s.jsx(pe,{name:"number",label:r("instance.form.number"),children:s.jsx(Z,{type:"tel"})}),d==="WHATSAPP-BUSINESS"&&s.jsx(pe,{required:!0,name:"businessId",label:r("instance.form.businessId"),children:s.jsx(Z,{})}),s.jsx(Kt,{children:s.jsx($,{type:"submit",children:r("instance.button.save")})})]})})]})})}function cZ(){const{t:e}=Le(),[t,n]=v.useState(!1),[r,a]=v.useState(null),[o,l]=v.useState(""),[u,d]=v.useState(null),[f,h]=v.useState(""),[m,g]=v.useState("all"),{deleteInstance:b,logout:x}=Tc(),{data:w,isLoading:C,refetch:k}=YV(),N=async()=>{await k()},T=()=>{a(null),l("")},_=async()=>{if(!r)return;const F=r.name;d(F);try{try{await x(F)}catch(B){console.error("Error logout:",B)}await b(F),await new Promise(B=>setTimeout(B,1e3)),await N(),Q.success(e("toast.instance.deleted",{defaultValue:"Instância removida com sucesso!"})),T()}catch(B){console.error("Error instance delete:",B);const te=B instanceof Error?B.message:"Erro ao remover instância";Q.error(te)}finally{d(null)}},P=v.useMemo(()=>{let F=w??[];m!=="all"&&(F=F.filter(te=>te.connectionStatus===m));const B=f.trim().toLowerCase();return B?F.filter(te=>te.name.toLowerCase().includes(B)||te.profileName&&te.profileName.toLowerCase().includes(B)):F},[w,f,m]),M=[{value:"all",label:e("status.all")},{value:"close",label:e("status.closed")},{value:"connecting",label:e("status.connecting")},{value:"open",label:e("status.open")}],O=P.length,D=o===r?.name;return s.jsxs("div",{className:"flex h-full flex-col",children:[s.jsx(iw,{title:e("dashboard.title"),subtitle:e("dashboard.subtitle",{defaultValue:"Gerencie suas instâncias WhatsApp"}),searchValue:f,onSearchChange:h,searchPlaceholder:e("dashboard.search"),primaryAction:{label:e("instance.button.create"),icon:s.jsx($r,{className:"h-4 w-4"}),onClick:()=>n(!0)},secondaryActions:[{label:e("button.refresh",{defaultValue:"Atualizar"}),icon:s.jsx(uc,{className:"h-4 w-4"}),onClick:N}],children:s.jsx("div",{className:"flex items-center justify-end",children:s.jsxs(vs,{children:[s.jsx(ys,{asChild:!0,children:s.jsxs($,{variant:"secondary",size:"sm",children:[e("dashboard.status"),s.jsx(YB,{className:"ml-2 h-4 w-4"})]})}),s.jsx(xs,{align:"end",children:M.map(F=>s.jsx(uV,{checked:m===F.value,onCheckedChange:B=>{B&&g(F.value)},children:F.label},F.value))})]})})}),s.jsx("div",{className:"flex-1",children:C?s.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:Array.from({length:6}).map((F,B)=>s.jsx(bV,{className:"h-56 rounded-lg"},B))}):O===0?s.jsxs("div",{className:"flex min-h-[40vh] flex-col items-center justify-center gap-3 rounded-lg border border-dashed border-sidebar-border p-8 text-center",children:[s.jsx(gz,{className:"h-10 w-10 text-muted-foreground"}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold",children:e("dashboard.empty.title",{defaultValue:"Nenhuma instância encontrada"})}),s.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:e("dashboard.empty.description",{defaultValue:"Crie sua primeira instância para começar"})})]}),s.jsxs($,{onClick:()=>n(!0),className:"mt-2",children:[s.jsx($r,{className:"mr-2 h-4 w-4"}),e("instance.button.create")]})]}):s.jsx("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:P.map(F=>s.jsx(qV,{instance:F,isDeleting:u===F.name,onDelete:B=>a(B)},F.id))})}),s.jsx(lZ,{resetTable:N,open:t,onOpenChange:n}),s.jsx(vt,{open:!!r,onOpenChange:F=>!F&&T(),children:s.jsxs(mt,{className:"sm:max-w-md",children:[s.jsxs(gt,{children:[s.jsxs(xt,{className:"flex items-center gap-2 text-red-500",children:[s.jsx(Ab,{className:"h-5 w-5"}),e("modal.delete.title")]}),s.jsx(gr,{children:e("modal.delete.message",{instanceName:r?.name??""})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium",children:e("modal.delete.confirm",{defaultValue:"Digite o nome da instância para confirmar:"})}),s.jsx(Z,{placeholder:r?.name,value:o,onChange:F=>l(F.target.value)})]}),s.jsxs(Kt,{className:"flex gap-2",children:[s.jsx($,{variant:"outline",onClick:T,children:e("button.cancel")}),s.jsx($,{variant:"destructive",onClick:_,disabled:!D||u===r?.name,children:u===r?.name?e("button.deleting"):e("button.delete")})]})]})})]})}const Tw=["settings-templates"],WR=()=>pt({queryKey:Tw,queryFn:async()=>(await qt.get("/settings-template/list")).data}),uZ=e=>pt({queryKey:[...Tw,"bindings",e],queryFn:async()=>(await qt.get(`/settings-template/bindings/${e}`)).data,enabled:!!e});function KR(){const e=ja(),t=()=>e.invalidateQueries({queryKey:Tw}),n=nt(async d=>(await qt.post("/settings-template/create",d)).data),r=nt(async d=>(await qt.post("/settings-template/edit",d)).data),a=nt(async d=>(await qt.post("/settings-template/duplicate",d)).data),o=nt(async d=>(await qt.delete("/settings-template/delete",{data:{templateId:d}})).data),l=nt(async d=>(await qt.post(`/settings-template/assign/${d.instanceName}`,{templateId:d.templateId,scope:d.scope,...d.target?{target:d.target}:{}})).data),u=nt(async d=>(await qt.delete(`/settings-template/unassign/${d.instanceName}`,{data:{scope:d.scope,...d.target?{target:d.target}:{}}})).data);return{create:async d=>{const f=await n(d);return await t(),f},edit:async d=>{const f=await r(d);return await t(),f},duplicate:async d=>{const f=await a(d);return await t(),f},remove:async d=>{const f=await o(d);return await t(),f},assign:async d=>{const f=await l(d);return await t(),f},unassign:async d=>{const f=await u(d);return await t(),f}}}const dZ="border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",Is=v.forwardRef(({className:e,...t},n)=>s.jsx("textarea",{ref:n,"data-slot":"textarea",className:ln(dZ,e),...t}));Is.displayName="Textarea";const fZ=fn({name:he().trim().min(1).max(255),localReadTtlSeconds:ot.number().int().min(0).max(2592e3),localReadTtlOverrides:he().refine(e=>{try{const t=JSON.parse(e||"{}");return t&&typeof t=="object"&&!Array.isArray(t)&&Object.values(t).every(n=>Number.isInteger(n)&&Number(n)>=0&&Number(n)<=2592e3)}catch{return!1}},"Enter a JSON object with TTL seconds"),automationEnabled:Me(),typingEnabled:Me(),typingMinMs:ot.number().int().min(0).max(2e4),typingMaxMs:ot.number().int().min(0).max(2e4),typingCharactersPerSecond:ot.number().min(1).max(100),typingJitterPercent:ot.number().int().min(0).max(25),typingPresence:yw(["composing","recording"]),typingApplyToMediaCaptions:Me(),instancePerMinute:ot.number().int().min(1).max(1e4),instancePerDay:ot.number().int().min(1).max(1e6),recipientPerMinute:ot.number().int().min(1).max(1e3),recipientPerDay:ot.number().int().min(1).max(1e5),minimumIntervalMs:ot.number().int().min(0).max(6e5),maxConcurrentSends:ot.number().int().min(1).max(100),outreachEnabled:Me(),newOrDormantRecipientsPerDay:ot.number().int().min(1).max(1e5),dormantAfterDays:ot.number().int().min(1).max(3650),quietHoursEnabled:Me(),quietHoursStart:he().regex(/^([01]\d|2[0-3]):[0-5]\d$/),quietHoursEnd:he().regex(/^([01]\d|2[0-3]):[0-5]\d$/),quietHoursTimeZone:he().min(1).max(100),duplicateEnabled:Me(),duplicateWindowSeconds:ot.number().int().min(1).max(86400),duplicateSimilarityThresholdPercent:ot.number().int().min(1).max(100),suppressedRecipients:he(),allowlistEnabled:Me(),allowedRecipients:he(),failurePauseEnabled:Me(),failurePauseThreshold:ot.number().int().min(1).max(100),failurePauseSeconds:ot.number().int().min(1).max(86400),auditRetentionDays:ot.number().int().min(1).max(3650)}).refine(e=>e.typingMinMs<=e.typingMaxMs,{path:["typingMaxMs"],message:"Maximum must be at least minimum"}),zk={name:"",localReadTtlSeconds:300,localReadTtlOverrides:"{}",automationEnabled:!1,typingEnabled:!0,typingMinMs:500,typingMaxMs:5e3,typingCharactersPerSecond:18,typingJitterPercent:10,typingPresence:"composing",typingApplyToMediaCaptions:!0,instancePerMinute:60,instancePerDay:5e3,recipientPerMinute:10,recipientPerDay:250,minimumIntervalMs:750,maxConcurrentSends:4,outreachEnabled:!0,newOrDormantRecipientsPerDay:50,dormantAfterDays:180,quietHoursEnabled:!1,quietHoursStart:"22:00",quietHoursEnd:"08:00",quietHoursTimeZone:"UTC",duplicateEnabled:!0,duplicateWindowSeconds:30,duplicateSimilarityThresholdPercent:100,suppressedRecipients:"",allowlistEnabled:!1,allowedRecipients:"",failurePauseEnabled:!0,failurePauseThreshold:5,failurePauseSeconds:300,auditRetentionDays:90},Uk=e=>e.split(/[\n,]/).map(t=>t.trim()).filter(Boolean);function pZ({template:e,busy:t,onCancel:n,onSave:r}){const a=mn({resolver:gn(fZ),defaultValues:zk});v.useEffect(()=>{const l=e?.settings.automationSafety??{};a.reset({...zk,name:e?.name??"",localReadTtlSeconds:e?.settings.localReadTtlSeconds??300,localReadTtlOverrides:JSON.stringify(e?.settings.localReadTtlOverrides??{},null,2),automationEnabled:l.enabled??!1,typingEnabled:l.typing?.enabled??!0,typingMinMs:l.typing?.minMs??500,typingMaxMs:l.typing?.maxMs??5e3,typingCharactersPerSecond:l.typing?.charactersPerSecond??18,typingJitterPercent:l.typing?.jitterPercent??10,typingPresence:l.typing?.presence??"composing",typingApplyToMediaCaptions:l.typing?.applyToMediaCaptions??!0,instancePerMinute:l.rateLimit?.instancePerMinute??60,instancePerDay:l.rateLimit?.instancePerDay??5e3,recipientPerMinute:l.rateLimit?.recipientPerMinute??10,recipientPerDay:l.rateLimit?.recipientPerDay??250,minimumIntervalMs:l.rateLimit?.minimumIntervalMs??750,maxConcurrentSends:l.rateLimit?.maxConcurrentSends??4,outreachEnabled:l.outreach?.enabled??!0,newOrDormantRecipientsPerDay:l.outreach?.newOrDormantRecipientsPerDay??50,dormantAfterDays:l.outreach?.dormantAfterDays??180,quietHoursEnabled:l.quietHours?.enabled??!1,quietHoursStart:l.quietHours?.start??"22:00",quietHoursEnd:l.quietHours?.end??"08:00",quietHoursTimeZone:l.quietHours?.timeZone??"UTC",duplicateEnabled:l.duplicate?.enabled??!0,duplicateWindowSeconds:l.duplicate?.windowSeconds??30,duplicateSimilarityThresholdPercent:l.duplicate?.similarityThresholdPercent??100,suppressedRecipients:(l.suppression?.recipients??[]).join(` +`),allowlistEnabled:l.suppression?.allowlistEnabled??!1,allowedRecipients:(l.suppression?.allowedRecipients??[]).join(` +`),failurePauseEnabled:l.failurePause?.enabled??!0,failurePauseThreshold:l.failurePause?.threshold??5,failurePauseSeconds:l.failurePause?.pauseSeconds??300,auditRetentionDays:l.audit?.retentionDays??90})},[a,e]);const o=l=>r({name:l.name,settings:{localReadTtlSeconds:l.localReadTtlSeconds,localReadTtlOverrides:JSON.parse(l.localReadTtlOverrides||"{}"),automationSafety:{enabled:l.automationEnabled,typing:{enabled:l.typingEnabled,minMs:l.typingMinMs,maxMs:l.typingMaxMs,charactersPerSecond:l.typingCharactersPerSecond,jitterPercent:l.typingJitterPercent,presence:l.typingPresence,applyToMediaCaptions:l.typingApplyToMediaCaptions},rateLimit:{instancePerMinute:l.instancePerMinute,instancePerDay:l.instancePerDay,recipientPerMinute:l.recipientPerMinute,recipientPerDay:l.recipientPerDay,minimumIntervalMs:l.minimumIntervalMs,maxConcurrentSends:l.maxConcurrentSends},outreach:{enabled:l.outreachEnabled,newOrDormantRecipientsPerDay:l.newOrDormantRecipientsPerDay,dormantAfterDays:l.dormantAfterDays},quietHours:{enabled:l.quietHoursEnabled,start:l.quietHoursStart,end:l.quietHoursEnd,timeZone:l.quietHoursTimeZone},duplicate:{enabled:l.duplicateEnabled,windowSeconds:l.duplicateWindowSeconds,similarityThresholdPercent:l.duplicateSimilarityThresholdPercent},suppression:{recipients:Uk(l.suppressedRecipients),allowlistEnabled:l.allowlistEnabled,allowedRecipients:Uk(l.allowedRecipients)},failurePause:{enabled:l.failurePauseEnabled,threshold:l.failurePauseThreshold,pauseSeconds:l.failurePauseSeconds},audit:{retentionDays:l.auditRetentionDays}}}});return s.jsx(ka,{...a,children:s.jsxs("form",{onSubmit:a.handleSubmit(o),className:"space-y-5",children:[s.jsx(pe,{name:"name",label:"Template name",children:s.jsx(Z,{placeholder:"Careful outreach"})}),s.jsxs("section",{className:"space-y-4 rounded-md border p-4",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium",children:"Local data cache"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Control how long PostgreSQL snapshots can be reused before checking WhatsApp."})]}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.jsx(pe,{name:"localReadTtlSeconds",label:"Default TTL (seconds)",children:s.jsx(Z,{type:"number",min:0,max:2592e3})}),s.jsx(pe,{name:"localReadTtlOverrides",label:"Method TTL overrides (JSON)",children:s.jsx(Is,{rows:3,placeholder:'{"groupMetadata": 3600}'})})]})]}),s.jsxs("section",{className:"space-y-5 rounded-md border p-4",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium",children:"Automation safety & pacing"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Shared controls for automated API, n8n, and chatbot sends."})]}),s.jsx(Re,{name:"automationEnabled",label:"Enable outbound safety policy"}),s.jsxs(Fu,{title:"Typing indicator",children:[s.jsx(Re,{name:"typingEnabled",label:"Show a bounded typing indicator"}),s.jsx(Re,{name:"typingApplyToMediaCaptions",label:"Include media captions"}),s.jsxs(Lu,{children:[s.jsx(pr,{name:"typingMinMs",label:"Minimum (ms)"}),s.jsx(pr,{name:"typingMaxMs",label:"Maximum (ms)"}),s.jsx(pr,{name:"typingCharactersPerSecond",label:"Characters / second"}),s.jsx(pr,{name:"typingJitterPercent",label:"Bounded jitter (%)"}),s.jsx(un,{name:"typingPresence",label:"Presence",options:[{value:"composing",label:"Composing"},{value:"recording",label:"Recording"}]})]})]}),s.jsx(Fu,{title:"Rate and concurrency limits",children:s.jsxs(Lu,{children:[s.jsx(pr,{name:"instancePerMinute",label:"Instance sends / minute"}),s.jsx(pr,{name:"instancePerDay",label:"Instance sends / day"}),s.jsx(pr,{name:"recipientPerMinute",label:"Recipient sends / minute"}),s.jsx(pr,{name:"recipientPerDay",label:"Recipient sends / day"}),s.jsx(pr,{name:"minimumIntervalMs",label:"Recipient interval (ms)"}),s.jsx(pr,{name:"maxConcurrentSends",label:"Concurrent sends"})]})}),s.jsxs(Fu,{title:"New and dormant recipient outreach",children:[s.jsx(Re,{name:"outreachEnabled",label:"Limit new or dormant recipients"}),s.jsxs(Lu,{children:[s.jsx(pr,{name:"newOrDormantRecipientsPerDay",label:"Unique recipients / 24h"}),s.jsx(pr,{name:"dormantAfterDays",label:"Dormant after days"})]})]}),s.jsxs(Fu,{title:"Quiet hours and suppression",children:[s.jsx(Re,{name:"quietHoursEnabled",label:"Enable quiet hours"}),s.jsxs(Lu,{children:[s.jsx(pe,{name:"quietHoursStart",label:"Start",children:s.jsx(Z,{type:"time"})}),s.jsx(pe,{name:"quietHoursEnd",label:"End",children:s.jsx(Z,{type:"time"})}),s.jsx(pe,{name:"quietHoursTimeZone",label:"IANA time zone",children:s.jsx(Z,{placeholder:"Europe/Athens"})})]}),s.jsx(pe,{name:"suppressedRecipients",label:"Suppressed recipient JIDs",children:s.jsx(Is,{rows:3})}),s.jsx(Re,{name:"allowlistEnabled",label:"Require an allowed recipient"}),s.jsx(pe,{name:"allowedRecipients",label:"Allowed recipient JIDs",children:s.jsx(Is,{rows:3})})]}),s.jsxs(Fu,{title:"Duplicate and failure protection",children:[s.jsx(Re,{name:"duplicateEnabled",label:"Block duplicate or similar text"}),s.jsx(Re,{name:"failurePauseEnabled",label:"Pause after consecutive failures"}),s.jsxs(Lu,{children:[s.jsx(pr,{name:"duplicateWindowSeconds",label:"Duplicate window (seconds)"}),s.jsx(pr,{name:"duplicateSimilarityThresholdPercent",label:"Similarity threshold (%)"}),s.jsx(pr,{name:"failurePauseThreshold",label:"Failure threshold"}),s.jsx(pr,{name:"failurePauseSeconds",label:"Pause duration (seconds)"}),s.jsx(pr,{name:"auditRetentionDays",label:"Audit retention (days)"})]})]})]}),s.jsxs("div",{className:"sticky bottom-0 flex justify-end gap-2 border-t bg-background py-4",children:[s.jsx($,{type:"button",variant:"outline",onClick:n,children:"Cancel"}),s.jsx($,{type:"submit",disabled:t,children:t?"Saving…":"Save template"})]})]})})}function Fu({title:e,children:t}){return s.jsxs("div",{className:"space-y-4 rounded-md border p-4",children:[s.jsx("h5",{className:"font-medium",children:e}),t]})}function Lu({children:e}){return s.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:e})}function pr({name:e,label:t}){return s.jsx(pe,{name:e,label:t,children:s.jsx(Z,{type:"number"})})}function hZ(){const{data:e=[],isLoading:t}=WR(),n=KR(),[r,a]=v.useState(""),[o,l]=v.useState(null),[u,d]=v.useState(!1),[f,h]=v.useState(!1),m=v.useMemo(()=>e.filter(C=>C.name.toLowerCase().includes(r.toLowerCase())),[e,r]),g=C=>{l(C??null),d(!0)},b=async C=>{try{h(!0),o?await n.edit({templateId:o.id,...C}):await n.create(C),Q.success(o?"Template updated":"Template created"),d(!1)}catch(k){Q.error(k instanceof Error?k.message:"Could not save template")}finally{h(!1)}},x=async C=>{const k=window.prompt("Name for the duplicate",`${C.name} copy`);if(k)try{await n.duplicate({templateId:C.id,name:k}),Q.success("Template duplicated")}catch(N){Q.error(N instanceof Error?N.message:"Could not duplicate")}},w=async C=>{if(window.confirm(`Delete ${C.name}? Its assignments will be removed.`))try{await n.remove(C.id),Q.success("Template deleted")}catch(k){Q.error(k instanceof Error?k.message:"Could not delete")}};return s.jsxs("div",{className:"flex h-full flex-col",children:[s.jsx(iw,{title:"Settings templates",subtitle:"Live shared cache and Automation Safety policies. Edits apply to every assignment.",searchValue:r,onSearchChange:a,searchPlaceholder:"Search templates",primaryAction:{label:"New template",icon:s.jsx($r,{className:"h-4 w-4"}),onClick:()=>g()}}),s.jsxs("div",{className:"mb-5 rounded-md border bg-muted/30 p-4 text-sm",children:[s.jsx("strong",{children:"Precedence:"})," per-request override → matching group/contact → instance default → existing settings. Assign templates from an instance's Settings page."]}),t?s.jsx("p",{children:"Loading…"}):s.jsx("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:m.map(C=>s.jsxs("article",{className:"rounded-lg border bg-card p-5 shadow-sm",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"font-semibold",children:C.name}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[C.bindings?.length??0," assignments · updated ",new Date(C.updatedAt).toLocaleString()]})]}),s.jsxs("div",{className:"flex gap-1",children:[s.jsx($,{size:"icon",variant:"ghost",onClick:()=>g(C),"aria-label":"Edit",children:s.jsx(Sz,{className:"h-4 w-4"})}),s.jsx($,{size:"icon",variant:"ghost",onClick:()=>x(C),"aria-label":"Duplicate",children:s.jsx(pM,{className:"h-4 w-4"})}),s.jsx($,{size:"icon",variant:"ghost",onClick:()=>w(C),"aria-label":"Delete",children:s.jsx(Ab,{className:"h-4 w-4 text-red-500"})})]})]}),s.jsx("pre",{className:"mt-4 max-h-48 overflow-auto rounded bg-muted p-3 text-xs",children:JSON.stringify(C.settings,null,2)})]},C.id))}),s.jsx(vt,{open:u,onOpenChange:d,children:s.jsxs(mt,{className:"max-h-[92vh] max-w-5xl overflow-y-auto",children:[s.jsxs(gt,{children:[s.jsx(xt,{children:o?"Edit template":"New template"}),s.jsx(gr,{children:"Configure shared local cache and Automation Safety settings visually."})]}),s.jsx(pZ,{template:o,busy:f,onCancel:()=>d(!1),onSave:b})]})})]})}const mZ=e=>["chats","findChats",JSON.stringify(e)],gZ=async({instanceName:e})=>(await Ce.post(`/chat/findChats/${e}`,{where:{}})).data,vZ=e=>{const{instanceName:t,...n}=e;return pt({...n,queryKey:mZ({instanceName:t}),queryFn:()=>gZ({instanceName:t}),enabled:!!t})},Ca=Object.create(null);Ca.open="0";Ca.close="1";Ca.ping="2";Ca.pong="3";Ca.message="4";Ca.upgrade="5";Ca.noop="6";const Op=Object.create(null);Object.keys(Ca).forEach(e=>{Op[Ca[e]]=e});const Yx={type:"error",data:"parser error"},GR=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",JR=typeof ArrayBuffer=="function",QR=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Mw=({type:e,data:t},n,r)=>GR&&t instanceof Blob?n?r(t):Vk(t,r):JR&&(t instanceof ArrayBuffer||QR(t))?n?r(t):Vk(new Blob([t]),r):r(Ca[e]+(t||"")),Vk=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function qk(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let my;function yZ(e,t){if(GR&&e.data instanceof Blob)return e.data.arrayBuffer().then(qk).then(t);if(JR&&(e.data instanceof ArrayBuffer||QR(e.data)))return t(qk(e.data));Mw(e,!1,n=>{my||(my=new TextEncoder),t(my.encode(n))})}const Hk="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Gu=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e{let t=e.length*.75,n=e.length,r,a=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[a++]=(l&15)<<4|u>>2,h[a++]=(u&3)<<6|d&63;return f},bZ=typeof ArrayBuffer=="function",_w=(e,t)=>{if(typeof e!="string")return{type:"message",data:YR(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:wZ(e.substring(1),t)}:Op[n]?e.length>1?{type:Op[n],data:e.substring(1)}:{type:Op[n]}:Yx},wZ=(e,t)=>{if(bZ){const n=xZ(e);return YR(n,t)}else return{base64:!0,data:e}},YR=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},ZR="",SZ=(e,t)=>{const n=e.length,r=new Array(n);let a=0;e.forEach((o,l)=>{Mw(o,!1,u=>{r[l]=u,++a===n&&t(r.join(ZR))})})},CZ=(e,t)=>{const n=e.split(ZR),r=[];for(let a=0;a{const r=n.length;let a;if(r<126)a=new Uint8Array(1),new DataView(a.buffer).setUint8(0,r);else if(r<65536){a=new Uint8Array(3);const o=new DataView(a.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{a=new Uint8Array(9);const o=new DataView(a.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(a[0]|=128),t.enqueue(a),t.enqueue(n)})}})}let gy;function np(e){return e.reduce((t,n)=>t+n.length,0)}function rp(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let a=0;aMath.pow(2,21)-1){u.enqueue(Yx);break}a=h*Math.pow(2,32)+f.getUint32(4),r=3}else{if(np(n)e){u.enqueue(Yx);break}}}})}const XR=4;function Xn(e){if(e)return EZ(e)}function EZ(e){for(var t in Xn.prototype)e[t]=Xn.prototype[t];return e}Xn.prototype.on=Xn.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Xn.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Xn.prototype.off=Xn.prototype.removeListener=Xn.prototype.removeAllListeners=Xn.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,a=0;aPromise.resolve().then(t):(t,n)=>n(t,0),_s=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),NZ="arraybuffer";function eI(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const TZ=_s.setTimeout,MZ=_s.clearTimeout;function Sm(e,t){t.useNativeTimers?(e.setTimeoutFn=TZ.bind(_s),e.clearTimeoutFn=MZ.bind(_s)):(e.setTimeoutFn=_s.setTimeout.bind(_s),e.clearTimeoutFn=_s.clearTimeout.bind(_s))}const _Z=1.33;function PZ(e){return typeof e=="string"?RZ(e):Math.ceil((e.byteLength||e.size)*_Z)}function RZ(e){let t=0,n=0;for(let r=0,a=e.length;r=57344?n+=3:(r++,n+=4);return n}function tI(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function IZ(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function OZ(e){let t={},n=e.split("&");for(let r=0,a=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)};CZ(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,SZ(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]=tI()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let nI=!1;try{nI=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const FZ=nI;function LZ(){}class $Z extends DZ{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",(a,o)=>{this.onError("xhr post error",a,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 nc=class Ap extends Xn{constructor(t,n,r){super(),this.createRequest=t,Sm(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=eI(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 a in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(a)&&r.setRequestHeader(a,this._opts.extraHeaders[a])}}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 a;r.readyState===3&&((a=this._opts.cookieJar)===null||a===void 0||a.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(a){this.setTimeoutFn(()=>{this._onError(a)},0);return}typeof document<"u"&&(this._index=Ap.requestsCount++,Ap.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=LZ,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Ap.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()}};nc.requestsCount=0;nc.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Wk);else if(typeof addEventListener=="function"){const e="onpagehide"in _s?"pagehide":"unload";addEventListener(e,Wk,!1)}}function Wk(){for(let e in nc.requests)nc.requests.hasOwnProperty(e)&&nc.requests[e].abort()}const BZ=(function(){const e=rI({xdomain:!1});return e&&e.responseType!==null})();class zZ extends $Z{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=BZ&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new nc(rI,this.uri(),t)}}function rI(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||FZ))return new XMLHttpRequest}catch{}if(!t)try{return new _s[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const sI=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class UZ extends Pw{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=sI?{}:eI(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(a){return this.emitReserved("error",a)}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{}a&&wm(()=>{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]=tI()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const vy=_s.WebSocket||_s.MozWebSocket;class VZ extends UZ{createSocket(t,n,r){return sI?new vy(t,n,r):n?new vy(t,n):new vy(t)}doWrite(t,n){this.ws.send(n)}}class qZ extends Pw{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=kZ(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),a=jZ();a.readable.pipeTo(t.writable),this._writer=a.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{a&&wm(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const HZ={websocket:VZ,webtransport:qZ,polling:zZ},WZ=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,KZ=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Zx(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 a=WZ.exec(e||""),o={},l=14;for(;l--;)o[KZ[l]]=a[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=GZ(o,o.path),o.queryKey=JZ(o,o.query),o}function GZ(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 JZ(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,a,o){a&&(n[a]=o)}),n}const Xx=typeof addEventListener=="function"&&typeof removeEventListener=="function",Dp=[];Xx&&addEventListener("offline",()=>{Dp.forEach(e=>e())},!1);class Lo extends Xn{constructor(t,n){if(super(),this.binaryType=NZ,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=Zx(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=Zx(n.host).host);Sm(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 a=r.prototype.name;this.transports.push(a),this._transportsByName[a]=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=OZ(this.opts.query)),Xx&&(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"})},Dp.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=XR,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&&Lo.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",Lo.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,wm(()=>{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,a){if(typeof n=="function"&&(a=n,n=void 0),typeof r=="function"&&(a=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),a&&this.once("flush",a),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(Lo.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(),Xx&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Dp.indexOf(this._offlineEventListener);r!==-1&&Dp.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Lo.protocol=XR;class QZ extends Lo{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;Lo.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",a),n.removeListener("error",l),n.removeListener("close",u),this.off("close",d),this.off("upgrading",f)};n.once("open",a),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;rHZ[a]).filter(a=>!!a)),super(t,r)}};function ZZ(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=Zx(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 XZ=typeof ArrayBuffer=="function",eX=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,aI=Object.prototype.toString,tX=typeof Blob=="function"||typeof Blob<"u"&&aI.call(Blob)==="[object BlobConstructor]",nX=typeof File=="function"||typeof File<"u"&&aI.call(File)==="[object FileConstructor]";function Rw(e){return XZ&&(e instanceof ArrayBuffer||eX(e))||tX&&e instanceof Blob||nX&&e instanceof File}function Fp(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,a)=>{const o=(l,u)=>l?a(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((a,...o)=>r!==this._queue[0]?void 0:(a!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(a)):(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:Wt.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 Wt.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 Wt.EVENT:case Wt.BINARY_EVENT:this.onevent(t);break;case Wt.ACK:case Wt.BINARY_ACK:this.onack(t);break;case Wt.DISCONNECT:this.ondisconnect();break;case Wt.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(...a){r||(r=!0,n.packet({type:Wt.ACK,id:t,data:a}))}}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:Wt.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}$c.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};$c.prototype.reset=function(){this.attempts=0};$c.prototype.setMin=function(e){this.ms=e};$c.prototype.setMax=function(e){this.max=e};$c.prototype.setJitter=function(e){this.jitter=e};class nb extends Xn{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,Sm(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 $c({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const a=n.parser||cX;this.encoder=new a.Encoder,this.decoder=new a.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 YZ(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const a=Ks(n,"open",function(){r.onopen(),t&&t()}),o=u=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",u),t?t(u):this.maybeReconnectOnOpen()},l=Ks(n,"error",o);if(this._timeout!==!1){const u=this._timeout,d=this.setTimeoutFn(()=>{a(),o(new Error("timeout")),n.close()},u);this.opts.autoUnref&&d.unref(),this.subs.push(()=>{this.clearTimeoutFn(d)})}return this.subs.push(a),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(Ks(t,"ping",this.onping.bind(this)),Ks(t,"data",this.ondata.bind(this)),Ks(t,"error",this.onerror.bind(this)),Ks(t,"close",this.onclose.bind(this)),Ks(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){wm(()=>{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 oI(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(a=>{a?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",a)):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 $u={};function Lp(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=ZZ(e,t.path||"/socket.io"),r=n.source,a=n.id,o=n.path,l=$u[a]&&o in $u[a].nsps,u=t.forceNew||t["force new connection"]||t.multiplex===!1||l;let d;return u?d=new nb(r,t):($u[a]||($u[a]=new nb(r,t)),d=$u[a]),n.query&&!t.query&&(t.query=n.queryKey),d.socket(n.path,t)}Object.assign(Lp,{Manager:nb,Socket:oI,io:Lp,connect:Lp});const Xu=new Map,Ow=e=>{if(Xu.has(e)){const n=Xu.get(e);return Gk(n)}const t=Lp(e,{transports:["websocket","polling"],autoConnect:!1,reconnection:!0,reconnectionAttempts:5,reconnectionDelay:1e3,timeout:2e4});return Xu.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)}),Gk(t)},Aw=e=>{for(const[t,n]of Xu.entries())if(n===e||e._socket===n){console.log(`🔌 Disconnecting socket for ${t}`),n.disconnect(),Xu.delete(t);break}},Gk=e=>({on:(t,n)=>{e.on(t,n)},off:t=>{e.off(t)},connect:()=>{e.connected||e.connect()},disconnect:()=>{e.disconnect()}});function eo(e){const t=o=>typeof window<"u"?window.matchMedia(o).matches:!1,[n,r]=v.useState(t(e));function a(){r(t(e))}return v.useEffect(()=>{const o=window.matchMedia(e);return a(),o.addListener?o.addListener(a):o.addEventListener("change",a),()=>{o.removeListener?o.removeListener(a):o.removeEventListener("change",a)}},[e]),n}const dX=e=>["chats","findChats",JSON.stringify(e)],fX=async({instanceName:e,remoteJid:t})=>{const n=await Ce.post(`/chat/findChats/${e}`,{where:{remoteJid:t}});return Array.isArray(n.data)?n.data[0]:n.data},pX=e=>{const{instanceName:t,remoteJid:n,...r}=e;return pt({...r,queryKey:dX({instanceName:t,remoteJid:n}),queryFn:()=>fX({instanceName:t,remoteJid:n}),enabled:!!t&&!!n})},hX=e=>["chats","findMessages",JSON.stringify(e)],mX=async({instanceName:e,remoteJid:t})=>{const n=await Ce.post(`/chat/findMessages/${e}`,{where:{key:{remoteJid:t}}});return n.data?.messages?.records?n.data.messages.records:n.data},gX=e=>{const{instanceName:t,remoteJid:n,...r}=e;return pt({...r,queryKey:hX({instanceName:t,remoteJid:n}),queryFn:()=>mX({instanceName:t,remoteJid:n}),enabled:!!t&&!!n})},vX=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/message/sendText/${e}`,n,{headers:{apikey:t,"content-type":"application/json"}})).data,yX=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 Ce.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}},xX=async({instanceName:e,token:t,data:n})=>{try{const r={number:n.number,audioMessage:{audio:n.audioMessage.audio},options:n.options};return(await Ce.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 iI(){return{sendText:nt(vX,{invalidateKeys:[["chats","findMessages"],["chats","findChats"]]})}}function lI(){return{sendMedia:nt(yX)}}function bX(){return{sendAudio:nt(xX)}}const cI=v.createContext({backgroundColor:"",textForegroundColor:"",primaryColor:"",fromMeBubbleColor:"",fromMeForegroundColor:"",fromOtherBubbleColor:"",fromOtherForegroundColor:"",fromMeQuotedBubbleColor:"",fromOtherQuotedBubbleColor:"",inputBackgroundColor:"",inputTextForegroundColor:"",inputIconsMainColor:""});function wX({children:e}){const[t]=Sc(),{theme:n}=Zi(),r=t.get("backgroundColor"),a=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"),b=t.get("inputTextForegroundColor"),x=t.get("inputIconsMainColor"),w=()=>n==="dark"?"#0f0f0f":"#faf9fa",C=()=>n==="dark"?"#faf9fa":"#020202",k=()=>n==="dark"?"#0b332a":"#e0f0f0",N=()=>n==="dark"?"#0b332a":"#c8fff2",T=()=>n==="dark"?"#ffffff":"#020202",_=()=>n==="dark"?"#1d2724":"#e0f0f0",P=()=>n==="dark"?"#ffffff":"#020202",M=()=>n==="dark"?"#161616":"#e0f0f0",O=()=>n==="dark"?"#faf9fa":"#020202",D=()=>n==="dark"?"#1f463d":"#aff7e6",F=()=>n==="dark"?"#0f1413":"#d2e2e2",B=()=>n==="dark"?"#0e6451":"#0b332a";return s.jsx(cI.Provider,{value:{backgroundColor:r||w(),textForegroundColor:a||C(),primaryColor:o||k(),fromMeBubbleColor:l||N(),fromMeForegroundColor:u||T(),fromOtherBubbleColor:d||_(),fromOtherForegroundColor:f||P(),fromMeQuotedBubbleColor:h||D(),fromOtherQuotedBubbleColor:m||F(),inputBackgroundColor:g||M(),inputTextForegroundColor:b||O(),inputIconsMainColor:x||B()},children:e})}const oi=()=>v.useContext(cI),uI=({setSelectedMedia:e})=>{const{t}=Le(),{inputIconsMainColor:n}=oi(),r=v.useRef(null),a=v.useRef(null),[o,l]=v.useState(!1),u=m=>{const g=m.target.files?.[0];if(!g){e(null);return}const b=g.type.split("/")[0],x=g.size/(1024*1024);switch(b){case"audio":if(x>16){Q.error(t("chat.media.errors.audioSize"));return}break;case"image":if(x>5){Q.error(t("chat.media.errors.imageSize"));return}break;case"video":if(x>16){Q.error(t("chat.media.errors.videoSize"));return}break;case"application":case"text":if(x>100){Q.error(t("chat.media.errors.documentSize"));return}break;default:Q.error(t("chat.media.errors.unsupportedType"));return}e(g)},d=m=>{m.preventDefault(),r.current&&r.current.click()},f=m=>{m.preventDefault(),a.current&&a.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 s.jsx(s.Fragment,{children:s.jsxs(vs,{open:o,onOpenChange:l,children:[s.jsx(ys,{asChild:!0,children:s.jsxs($,{type:"button",variant:"ghost",size:"icon",className:"rounded-full p-2",children:[s.jsx($r,{className:"h-6 w-6",style:{color:n}}),s.jsx("span",{className:"sr-only",children:t("chat.media.attach")})]})}),s.jsxs(xs,{align:"end",children:[s.jsx("input",{ref:a,type:"file",accept:h.join(", "),onChange:u,className:"hidden"}),s.jsxs(Ct,{onClick:f,children:[s.jsx(az,{className:"mr-2 h-4 w-4"}),t("chat.media.document")]}),s.jsx("input",{ref:r,type:"file",accept:"image/*, video/*",onChange:u,className:"hidden"}),s.jsxs(Ct,{onClick:d,children:[s.jsx(fz,{className:"mr-2 h-4 w-4"}),t("chat.media.photosAndVideos")]})]})]})})},dI=({selectedMedia:e,setSelectedMedia:t})=>{const{t:n}=Le(),r=()=>{t(null)},a=l=>l.type.includes("image")?s.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")?s.jsx("div",{className:"flex items-center justify-center",children:s.jsx("video",{className:"w-80 rounded-lg object-cover",src:URL.createObjectURL(l),controls:!0})}):s.jsx("div",{className:"flex items-center justify-center",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(Ob,{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 s.jsxs("div",{className:"relative flex items-center rounded-lg bg-[#e0f0f0] dark:bg-[#1d2724] dark:text-white",children:[s.jsx("div",{className:"absolute h-full w-1 rounded-l-lg bg-blue-700 dark:bg-blue-300"}),s.jsxs("div",{className:"flex w-full flex-col items-center justify-center gap-6 p-4 pl-4",children:[e&&a(e),s.jsxs("div",{className:"flex flex-col items-center justify-center gap-2",children:[s.jsx("span",{className:"text-sm font-medium",children:e?.name||n("chat.media.selectedMedia.selectedFile")}),s.jsx("span",{className:"text-xs text-gray-500",children:o(e?.size||0)})]})]}),s.jsx($,{size:"icon",variant:"ghost",className:"ml-auto h-10 w-10 rounded-full",onClick:r,children:s.jsx(Hh,{className:"h-6 w-6"})})]})},Jk=(e,t,n)=>{const r=new Date,a=new Date(r);a.setDate(a.getDate()-1);const o=new Date(e);return o.toDateString()===r.toDateString()?t("chat.date.today",{defaultValue:"Hoje"}):o.toDateString()===a.toDateString()?t("chat.date.yesterday",{defaultValue:"Ontem"}):Math.floor((r.getTime()-o.getTime())/(1e3*60*60*24))<7?o.toLocaleDateString(n,{weekday:"long"}):o.toLocaleDateString(n,{day:"2-digit",month:"2-digit",year:"numeric"})},Bu=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}},SX=({date:e})=>s.jsx("div",{className:"flex items-center justify-center py-3",children:s.jsx("div",{className:"rounded-full bg-muted/50 px-3 py-1",children:s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:e})})}),Qk=(e,t)=>e.toLocaleTimeString(t,{hour:"2-digit",minute:"2-digit"}),Yk=["#e91e63","#9c27b0","#3f51b5","#2196f3","#00bcd4","#009688","#4caf50","#ff9800","#f44336","#795548"],CX=e=>{let t=0;for(let n=0;n{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)},Zk=({message:e})=>{const t=e.messageType;switch(t){case"conversation":if(e.message.contactMessage){const d=e.message.contactMessage;return s.jsxs("div",{className:"p-3 bg-muted rounded-lg max-w-xs",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx("div",{className:"text-xl",children:"👤"}),s.jsx("span",{className:"font-medium",children:"Contact"})]}),d.displayName&&s.jsx("p",{className:"text-sm font-medium",children:d.displayName}),d.vcard&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"Contact card"})]})}if(e.message.locationMessage){const d=e.message.locationMessage;return s.jsxs("div",{className:"p-3 bg-muted rounded-lg max-w-xs",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx("div",{className:"text-xl",children:"📍"}),s.jsx("span",{className:"font-medium",children:"Location"})]}),d.name&&s.jsx("p",{className:"text-sm font-medium",children:d.name}),d.address&&s.jsx("p",{className:"text-xs text-muted-foreground",children:d.address}),d.degreesLatitude&&d.degreesLongitude&&s.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 s.jsx("span",{children:jX(e.message)});case"extendedTextMessage":return s.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 s.jsxs("div",{className:"flex flex-col gap-2",children:[r?s.jsx("img",{src:r,alt:"Image",className:"rounded-lg max-w-full h-auto",style:{maxWidth:"400px",maxHeight:"400px",objectFit:"contain"},loading:"lazy"}):s.jsxs("div",{className:"rounded bg-muted p-4 max-w-xs",children:[s.jsx("p",{className:"text-center text-muted-foreground",children:"Image couldn't be loaded"}),s.jsx("p",{className:"text-center text-xs text-muted-foreground mt-1",children:"Missing base64 data and mediaUrl"})]}),e.message.imageMessage?.caption&&s.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 s.jsxs("div",{className:"flex flex-col gap-2",children:[o?s.jsx("video",{src:o,controls:!0,className:"rounded-lg max-w-full h-auto",style:{maxWidth:"400px",maxHeight:"400px"}}):s.jsxs("div",{className:"rounded bg-muted p-4 max-w-xs",children:[s.jsx("p",{className:"text-center text-muted-foreground",children:"Video couldn't be loaded"}),s.jsx("p",{className:"text-center text-xs text-muted-foreground mt-1",children:"Missing base64 data and mediaUrl"})]}),e.message.videoMessage?.caption&&s.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?s.jsxs("audio",{controls:!0,className:"w-full max-w-xs",children:[s.jsx("source",{src:u,type:"audio/mpeg"}),"Your browser does not support the audio element."]}):s.jsxs("div",{className:"rounded bg-muted p-4 max-w-xs",children:[s.jsx("p",{className:"text-center text-muted-foreground",children:"Audio couldn't be loaded"}),s.jsx("p",{className:"text-center text-xs text-muted-foreground mt-1",children:"Missing base64 data and mediaUrl"})]});case"documentMessage":return s.jsxs("div",{className:"flex items-center gap-2 p-3 bg-muted rounded-lg max-w-xs",children:[s.jsx("div",{className:"text-2xl",children:"📄"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"font-medium truncate",children:e.message.documentMessage?.fileName||"Document"}),e.message.documentMessage?.fileLength&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:[(e.message.documentMessage.fileLength/1024/1024).toFixed(2)," MB"]})]})]});case"stickerMessage":return s.jsx("img",{src:e.message.mediaUrl,alt:"Sticker",className:"max-w-32 max-h-32 object-contain"});default:return s.jsx("div",{className:"text-xs text-muted-foreground bg-muted p-2 rounded max-w-xs",children:s.jsxs("details",{children:[s.jsxs("summary",{children:["Unknown message type: ",t]}),s.jsx("pre",{className:"mt-2 whitespace-pre-wrap break-all text-xs",children:JSON.stringify(e.message,null,2)})]})})}};function fI({textareaRef:e,handleTextareaChange:t,textareaHeight:n,lastMessageRef:r,scrollToBottom:a}){const{t:o,i18n:l}=Le(),u=l.language,{instance:d}=ct(),[f,h]=v.useState(""),[m,g]=v.useState(!1),[b,x]=v.useState(null),[w,C]=v.useState([]),{sendText:k}=iI(),{sendMedia:N}=lI(),{remoteJid:T}=Os(),_=async()=>{if(!(!f.trim()||!T||!d?.name||!d?.token||m))try{g(!0),await k({instanceName:d.name,token:d.token,data:{number:T,text:f.trim()}}),h(""),e.current&&(e.current.value="",t())}catch(H){console.error("Error sending message:",H)}finally{g(!1)}},P=async()=>{if(!(!b||!T||!d?.name||!d?.token||m))try{g(!0);const H=await new Promise((W,V)=>{const A=new FileReader;A.readAsDataURL(b),A.onload=()=>{const re=A.result.split(",")[1];W(re)},A.onerror=V});await N({instanceName:d.name,token:d.token,data:{number:T,mediaMessage:{mediatype:b.type.split("/")[0]==="application"?"document":b.type.split("/")[0],mimetype:b.type,caption:f.trim(),media:H,fileName:b.name}}}),x(null),h(""),e.current&&(e.current.value="",t())}catch(H){console.error("Error sending media:",H)}finally{g(!1)}},M=async()=>{b?await P():await _()},O=H=>{H.key==="Enter"&&!H.shiftKey&&(H.preventDefault(),M())},D=H=>{h(H.target.value),t()},{data:F}=pX({remoteJid:T,instanceName:d?.name}),{data:B,isSuccess:te}=gX({remoteJid:T,instanceName:d?.name}),U=v.useMemo(()=>{if(!B)return w;const H=new Map;return B.forEach(W=>H.set(W.key.id,W)),w.forEach(W=>{H.set(W.key.id,W)}),Array.from(H.values())},[B,w]);v.useEffect(()=>{if(!d?.name||!T)return;const H=mr(Fn.API_URL);if(!H){console.error("API URL not found in localStorage");return}const W=Ow(H),V=(K,re)=>{if(!d||re.instance!==d.name||re?.data?.key?.remoteJid!==T)return;const ee=re.data;C(ie=>{const ue=ie.findIndex(j=>j.key.id===ee.key.id);if(ue!==-1){const j=[...ie];return j[ue]=ee,j}else return[...ie,ee]})},A=K=>{d&&K.instance===d.name&&console.log("Received message status update:",K)};return W.on("messages.upsert",K=>{V("messages.upsert",K)}),W.on("send.message",K=>{V("send.message",K)}),W.on("messages.update",K=>{A(K)}),W.connect(),()=>{W.off("messages.upsert"),W.off("send.message"),W.off("messages.update"),Aw(W)}},[d?.name,T]);const ce=v.useMemo(()=>{if(!U)return[];const H=[...U].sort((K,re)=>{const ee=Bu(K).getTime(),ie=Bu(re).getTime();return ee-ie}),W=[];let V="",A=[];return H.forEach(K=>{const ee=Bu(K).toDateString();ee!==V?(A.length>0&&W.push({date:Jk(new Date(V),o,u),messages:A}),V=ee,A=[K]):A.push(K)}),A.length>0&&W.push({date:Jk(new Date(V),o,u),messages:A}),W},[U,o,u]);v.useEffect(()=>{te&&U&&a()},[te,U,a]),v.useEffect(()=>{x(null),h(""),C([]),e.current&&(e.current.value="",t())},[T]);const q=H=>s.jsx("div",{className:"mb-4 flex justify-end",children:s.jsxs("div",{className:"max-w-[70%]",children:[s.jsx("div",{className:"rounded-lg bg-primary px-3 py-2 text-sm text-primary-foreground",children:s.jsx(Zk,{message:H})}),s.jsx("span",{className:"mt-0.5 block px-1 text-right text-[11px] text-muted-foreground",children:Qk(Bu(H),u)})]})},H.id),ne=H=>{const W=!!T?.endsWith("@g.us"),V=H.key.participant,A=V||H.pushName||"",K=H.pushName||(V?V.split("@")[0]:"");return s.jsx("div",{className:"mb-4 flex justify-start",children:s.jsxs("div",{className:"max-w-[70%]",children:[W&&K&&s.jsx("div",{className:"mb-1 text-xs font-semibold",style:{color:CX(A)},children:K}),s.jsx("div",{className:"rounded-lg border bg-muted px-3 py-2 text-sm text-foreground",children:s.jsx(Zk,{message:H})}),s.jsx("span",{className:"mt-0.5 block px-1 text-[11px] text-muted-foreground",children:Qk(Bu(H),u)})]})},H.id)},Y=F?.pushName||F?.remoteJid?.split("@")[0],se=F?.remoteJid?.split("@")[0];return s.jsxs("div",{className:"flex h-full flex-col bg-muted/10",children:[s.jsx("div",{className:"flex-shrink-0 border-b bg-background/95 p-4 backdrop-blur-sm",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs(Dh,{className:"h-10 w-10",children:[s.jsx(Fh,{src:F?.profilePicUrl,alt:Y}),s.jsx(OT,{className:"bg-muted text-muted-foreground",children:s.jsx(Zp,{className:"h-5 w-5"})})]}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("h3",{className:"truncate font-semibold",children:Y}),s.jsx("p",{className:"truncate text-xs text-muted-foreground",children:se})]})]})}),s.jsxs("div",{className:"flex w-full flex-1 flex-col overflow-y-auto px-4 py-4",children:[ce.map((H,W)=>s.jsxs("div",{children:[s.jsx(SX,{date:H.date}),H.messages.map(V=>V.key.fromMe?q(V):ne(V))]},W)),s.jsx("div",{ref:r})]}),s.jsx("div",{className:"flex-shrink-0 border-t bg-background p-3",children:s.jsxs("div",{className:"rounded-lg border border-border bg-card shadow-sm",children:[b&&s.jsx("div",{className:"border-b border-border bg-muted/30 px-3 py-2",children:s.jsx(dI,{selectedMedia:b,setSelectedMedia:x})}),s.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[s.jsx("div",{className:"flex flex-shrink-0 items-center",children:d&&s.jsx(uI,{instance:d,setSelectedMedia:x})}),s.jsx(Is,{placeholder:o("chat.input.placeholder",{defaultValue:"Digite uma mensagem..."}),name:"message",id:"message",rows:1,ref:e,value:f,onChange:D,onKeyDown:O,disabled:m,style:{height:n},className:"min-h-9 flex-1 resize-none border-none bg-transparent px-2 py-1.5 text-sm shadow-none focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-offset-0"}),s.jsxs($,{type:"button",size:"icon",onClick:M,disabled:!f.trim()&&!b||m,className:"h-9 w-9 flex-shrink-0 bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground disabled:opacity-50",children:[s.jsx(Yp,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:o("chat.input.send")})]})]})]})})]})}const yy=e=>e.split("@")[0];function Xk(){const{t:e}=Le(),t=eo("(min-width: 768px)"),n=v.useRef(null),[r]=v.useState("auto"),a=v.useRef(null),{instance:o}=ct(),[l,u]=v.useState([]),[d,f]=v.useState(""),[h,m]=v.useState("contacts"),{data:g}=vZ({instanceName:o?.name}),b=v.useMemo(()=>{if(!g)return l;const D=new Map;return g.forEach(F=>D.set(F.remoteJid,F)),l.forEach(F=>{const B=D.get(F.remoteJid);D.set(F.remoteJid,B?{...B,...F}:F)}),Array.from(D.values())},[g,l]),{instanceId:x,remoteJid:w}=Os(),C=Nn();v.useEffect(()=>{if(!o?.name)return;const D=mr(Fn.API_URL);if(!D)return;const F=Ow(D),B=te=>{if(!o||te.instance!==o.name)return;const U=te?.data?.key?.remoteJid;U&&u(ce=>{const q=ce.findIndex(Y=>Y.remoteJid===U),ne={id:U,remoteJid:U,pushName:te?.data?.pushName||yy(U),profilePicUrl:te?.data?.key?.profilePictureUrl||"",...te?.data,labels:te?.data?.labels??null};if(q!==-1){const Y=[...ce];return Y[q]={...Y[q],...ne},Y}return[...ce,ne]})};return F.on("messages.upsert",B),F.on("send.message",B),F.connect(),()=>{F.off("messages.upsert"),F.off("send.message"),Aw(F)}},[o,o?.name]);const k=v.useCallback(()=>{n.current?.scrollIntoView({})},[]),N=()=>{if(!a.current)return;a.current.style.height="auto";const D=a.current.scrollHeight,B=parseInt(getComputedStyle(a.current).lineHeight)*10;a.current.style.height=`${Math.min(D,B)}px`},T=D=>C(`/manager/instance/${x}/chat/${D}`),_=()=>C(`/manager/instance/${x}/chat`),P=v.useMemo(()=>{const D=h==="contacts",F=b.filter(te=>D?te.remoteJid.includes("@s.whatsapp.net"):te.remoteJid.includes("@g.us"));if(!d.trim())return F;const B=d.toLowerCase();return F.filter(te=>te.pushName&&te.pushName.toLowerCase().includes(B)||te.remoteJid.toLowerCase().includes(B))},[b,h,d]),M=!w||t,O=!!w;return s.jsxs("div",{className:"flex h-full w-full overflow-hidden rounded-lg border",children:[s.jsxs("aside",{className:ln("flex w-full flex-col border-r bg-card/50 md:w-80 md:flex-shrink-0",M?"flex":"hidden md:flex"),children:[s.jsxs("div",{className:"space-y-3 border-b p-4",children:[s.jsxs("div",{className:"relative",children:[s.jsx(gM,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),s.jsx(Z,{type:"search",placeholder:e("chat.search"),value:d,onChange:D=>f(D.target.value),className:"pl-9"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs($,{type:"button",size:"sm",variant:h==="contacts"?"secondary":"ghost",className:"h-8",onClick:()=>m("contacts"),children:[s.jsx(Zp,{className:"mr-1 h-4 w-4"}),e("chat.tabs.contacts")]}),s.jsxs($,{type:"button",size:"sm",variant:h==="groups"?"secondary":"ghost",className:"h-8",onClick:()=>m("groups"),children:[s.jsx(W1,{className:"mr-1 h-4 w-4"}),e("chat.tabs.groups")]})]}),s.jsx("div",{className:"flex items-center justify-between",children:s.jsx("span",{className:"text-xs text-muted-foreground",children:e("chat.count",{count:P.length})})})]}),s.jsx("div",{className:"flex-1 overflow-y-auto",children:P.length===0?s.jsxs("div",{className:"flex h-full flex-col items-center justify-center p-6 text-center",children:[s.jsx(cc,{className:"mb-3 h-10 w-10 text-muted-foreground/50"}),s.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:e(d?"chat.empty.search":"chat.empty.default")}),d&&s.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:e("chat.empty.tryAnother")})]}):P.map(D=>{const F=w===D.remoteJid,B=D.pushName||yy(D.remoteJid);return s.jsx("button",{type:"button",onClick:()=>T(D.remoteJid),className:ln("block w-full cursor-pointer p-4 text-left transition-colors",F?"border-l-2 border-l-primary bg-primary/10":"border-b border-border/50 hover:bg-accent"),children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsxs(Dh,{className:"h-10 w-10 flex-shrink-0",children:[s.jsx(Fh,{src:D.profilePicUrl,alt:B}),s.jsx(OT,{className:"bg-muted text-muted-foreground",children:h==="groups"?s.jsx(W1,{className:"h-5 w-5"}):s.jsx(Zp,{className:"h-5 w-5"})})]}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("div",{className:"mb-0.5 flex items-center justify-between gap-2",children:s.jsx("p",{className:"truncate font-medium",children:B})}),s.jsx("p",{className:"truncate text-sm text-muted-foreground",children:yy(D.remoteJid)})]})]})},D.remoteJid)})})]}),s.jsx("main",{className:ln("flex h-full min-h-0 flex-1 flex-col overflow-hidden",O?"flex":"hidden md:flex"),children:w?s.jsxs(s.Fragment,{children:[!t&&s.jsx("div",{className:"flex items-center border-b bg-background/95 p-2 backdrop-blur-sm",children:s.jsxs($,{variant:"ghost",size:"sm",onClick:_,children:[s.jsx(KB,{className:"mr-1 h-4 w-4"}),e("chat.back")]})}),s.jsx(fI,{textareaRef:a,handleTextareaChange:N,textareaHeight:r,lastMessageRef:n,scrollToBottom:k})]}):s.jsx("div",{className:"flex h-full flex-1 items-center justify-center p-8",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-muted",children:s.jsx(cc,{className:"h-8 w-8 text-muted-foreground"})}),s.jsx("h3",{className:"mb-1 text-lg font-semibold",children:e("chat.empty.selectTitle")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:e("chat.empty.selectDescription")})]})})})]})}function kX({name:e,envVar:t}){return s.jsxs("div",{className:"flex min-h-[40vh] flex-col items-center justify-center rounded-lg border border-dashed border-border p-8 text-center",children:[s.jsx("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-full bg-muted",children:s.jsx(fM,{className:"h-7 w-7 text-muted-foreground"})}),s.jsxs("h3",{className:"mb-2 text-lg font-semibold",children:["Integração ",e," desabilitada"]}),s.jsxs("p",{className:"max-w-md text-sm text-muted-foreground",children:["Esta integração está desativada no servidor. Para habilitá-la, defina"," ",s.jsxs("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs",children:[t,"=true"]})," ","no arquivo ",s.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs",children:".env"})," ","do evolution-api e reinicie o serviço."]})]})}function EX(e){if(!e)return!1;const n=e?.response?.data?.response?.message;return Array.isArray(n)?n.some(r=>typeof r=="string"&&/is disabled/i.test(r)):typeof n=="string"?/is disabled/i.test(n):!1}function ia({error:e,name:t,envVar:n,children:r}){return EX(e)?s.jsx(kX,{name:t,envVar:n}):s.jsx(s.Fragment,{children:r})}const NX=e=>["chatwoot","fetchChatwoot",JSON.stringify(e)],TX=async({instanceName:e,token:t})=>(await Ce.get(`/chatwoot/find/${e}`,{headers:{apiKey:t}})).data,MX=e=>{const{instanceName:t,token:n,...r}=e;return pt({...r,queryKey:NX({instanceName:t,token:n}),queryFn:()=>TX({instanceName:t,token:n}),enabled:!!t})},_X=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/chatwoot/set/${e}`,n,{headers:{apikey:t}})).data;function PX(){return{createChatwoot:nt(_X,{invalidateKeys:[["chatwoot","fetchChatwoot"]]})}}const sp=he().optional().transform(e=>e===""?void 0:e),RX=fn({enabled:Me(),accountId:he(),token:he(),url:he(),signMsg:Me().optional(),signDelimiter:sp,nameInbox:sp,organization:sp,logo:sp,reopenConversation:Me().optional(),conversationPending:Me().optional(),mergeBrazilContacts:Me().optional(),importContacts:Me().optional(),importMessages:Me().optional(),daysLimitImportMessages:ot.number().optional(),autoCreate:Me(),ignoreJids:Ds(he()).default([])});function IX(){const{t:e}=Le(),{instance:t}=ct(),[,n]=v.useState(!1),{createChatwoot:r}=PX(),{data:a,error:o}=MX({instanceName:t?.name,token:t?.token}),l=mn({resolver:gn(RX),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(a){l.setValue("ignoreJids",a.ignoreJids||[]);const d={enabled:a.enabled,accountId:a.accountId,token:a.token,url:a.url,signMsg:a.signMsg||!1,signDelimiter:a.signDelimiter||"\\n",nameInbox:a.nameInbox||"",organization:a.organization||"",logo:a.logo||"",reopenConversation:a.reopenConversation||!1,conversationPending:a.conversationPending||!1,mergeBrazilContacts:a.mergeBrazilContacts||!1,importContacts:a.importContacts||!1,importMessages:a.importMessages||!1,daysLimitImportMessages:a.daysLimitImportMessages||7,autoCreate:a.autoCreate||!1,ignoreJids:a.ignoreJids};l.reset(d)}},[a,l]);const u=async d=>{if(!t)return;n(!0);const f={enabled:d.enabled,accountId:d.accountId,token:d.token,url:d.url,signMsg:d.signMsg||!1,signDelimiter:d.signDelimiter||"\\n",nameInbox:d.nameInbox||"",organization:d.organization||"",logo:d.logo||"",reopenConversation:d.reopenConversation||!1,conversationPending:d.conversationPending||!1,mergeBrazilContacts:d.mergeBrazilContacts||!1,importContacts:d.importContacts||!1,importMessages:d.importMessages||!1,daysLimitImportMessages:d.daysLimitImportMessages||7,autoCreate:d.autoCreate,ignoreJids:d.ignoreJids};await r({instanceName:t.name,token:t.token,data:f},{onSuccess:()=>{Q.success(e("chatwoot.toast.success"))},onError:h=>{console.error(e("chatwoot.toast.error"),h),cT(h)?Q.error(`Error: ${h?.response?.data?.response?.message}`):Q.error(e("chatwoot.toast.error"))},onSettled:()=>{n(!1)}})};return s.jsx(ia,{error:o,name:"Chatwoot",envVar:"CHATWOOT_ENABLED",children:s.jsx(ka,{...l,children:s.jsxs("form",{onSubmit:l.handleSubmit(u),className:"w-full space-y-6",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("chatwoot.title")}),s.jsx(cl,{className:"my-4"}),s.jsxs("div",{className:"mx-4 space-y-2 divide-y [&>*]:px-4 [&>*]:py-2",children:[s.jsx(Re,{name:"enabled",label:e("chatwoot.form.enabled.label"),className:"w-full justify-between",helper:e("chatwoot.form.enabled.description")}),s.jsx(pe,{name:"url",label:e("chatwoot.form.url.label"),children:s.jsx(Z,{})}),s.jsx(pe,{name:"accountId",label:e("chatwoot.form.accountId.label"),children:s.jsx(Z,{})}),s.jsx(pe,{name:"token",label:e("chatwoot.form.token.label"),children:s.jsx(Z,{type:"password"})}),s.jsx(Re,{name:"signMsg",label:e("chatwoot.form.signMsg.label"),className:"w-full justify-between",helper:e("chatwoot.form.signMsg.description")}),s.jsx(pe,{name:"signDelimiter",label:e("chatwoot.form.signDelimiter.label"),children:s.jsx(Z,{})}),s.jsx(pe,{name:"nameInbox",label:e("chatwoot.form.nameInbox.label"),children:s.jsx(Z,{})}),s.jsx(pe,{name:"organization",label:e("chatwoot.form.organization.label"),children:s.jsx(Z,{})}),s.jsx(pe,{name:"logo",label:e("chatwoot.form.logo.label"),children:s.jsx(Z,{})}),s.jsx(Re,{name:"conversationPending",label:e("chatwoot.form.conversationPending.label"),className:"w-full justify-between",helper:e("chatwoot.form.conversationPending.description")}),s.jsx(Re,{name:"reopenConversation",label:e("chatwoot.form.reopenConversation.label"),className:"w-full justify-between",helper:e("chatwoot.form.reopenConversation.description")}),s.jsx(Re,{name:"importContacts",label:e("chatwoot.form.importContacts.label"),className:"w-full justify-between",helper:e("chatwoot.form.importContacts.description")}),s.jsx(Re,{name:"importMessages",label:e("chatwoot.form.importMessages.label"),className:"w-full justify-between",helper:e("chatwoot.form.importMessages.description")}),s.jsx(pe,{name:"daysLimitImportMessages",label:e("chatwoot.form.daysLimitImportMessages.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(ai,{name:"ignoreJids",label:e("chatwoot.form.ignoreJids.label"),placeholder:e("chatwoot.form.ignoreJids.placeholder")}),s.jsx(Re,{name:"autoCreate",label:e("chatwoot.form.autoCreate.label"),className:"w-full justify-between",helper:e("chatwoot.form.autoCreate.description")})]})]}),s.jsx("div",{className:"mx-4 flex justify-end",children:s.jsx($,{type:"submit",children:e("chatwoot.button.save")})})]})})})}var OX=Eb("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function pI({className:e,variant:t,...n}){return s.jsx("div",{"data-slot":"alert",role:"alert",className:Et(OX({variant:t}),e),...n})}function hI({className:e,...t}){return s.jsx("div",{"data-slot":"alert-title",className:Et("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function AX({className:e,...t}){return s.jsx("div",{"data-slot":"alert-description",className:Et("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}var zl={},xy={exports:{}},by,eE;function DX(){if(eE)return by;eE=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return by=e,by}var wy,tE;function FX(){if(tE)return wy;tE=1;var e=DX();function t(){}function n(){}return n.resetWarningCache=t,wy=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 a(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},wy}var nE;function mI(){return nE||(nE=1,xy.exports=FX()()),xy.exports}var Sy,rE;function gI(){return rE||(rE=1,Sy={L:1,M:0,Q:3,H:2}),Sy}var Cy,sE;function vI(){return sE||(sE=1,Cy={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8}),Cy}var jy,aE;function LX(){if(aE)return jy;aE=1;var e=vI();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++}},Ey=e,Ey}var Ny,lE;function yI(){if(lE)return Ny;lE=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^=a.G15<=0;)l^=a.G18<>>=1;return l},getPatternPosition:function(o){return a.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,b=this.moduleCount-1;b>0;b-=2)for(b==6&&b--;;){for(var x=0;x<2;x++)if(this.modules[h][b-x]==null){var w=!1;g>>m&1)==1);var C=r.getMask(d,h,b-x);C&&(w=!w),this.modules[h][b-x]=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;gx*8)throw new Error("code length overflow. ("+m.getLengthInBits()+">"+x*8+")");for(m.getLengthInBits()+4<=x*8&&m.put(0,4);m.getLengthInBits()%8!=0;)m.putBit(!1);for(;!(m.getLengthInBits()>=x*8||(m.put(o.PAD0,8),m.getLengthInBits()>=x*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),b=new Array(d.length),x=0;x=0?_.get(P):0}}for(var M=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,b=f.fgD,x=f.fgColor,w=f.size,C=f.title,k=f.viewBoxSize,N=f.xmlns,T=N===void 0?"http://www.w3.org/2000/svg":N,_=l(f,["bgColor","bgD","fgD","fgColor","size","title","viewBoxSize","xmlns"]);return a.default.createElement("svg",e({},_,{height:w,ref:h,viewBox:"0 0 "+k+" "+k,width:w,xmlns:T}),C?a.default.createElement("title",null,C):null,a.default.createElement("path",{d:g,fill:m}),a.default.createElement("path",{d:b,fill:x}))});return d.displayName="QRCodeSvg",d.propTypes=u,ap.default=d,ap}var pE;function qX(){if(pE)return zl;pE=1,Object.defineProperty(zl,"__esModule",{value:!0}),zl.QRCode=void 0;var e=Object.assign||function(w){for(var C=1;C=0||Object.prototype.hasOwnProperty.call(w,N)&&(k[N]=w[N]);return k}var b={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},x=(0,u.forwardRef)(function(w,C){var k=w.bgColor,N=k===void 0?"#FFFFFF":k,T=w.fgColor,_=T===void 0?"#000000":T,P=w.level,M=P===void 0?"L":P,O=w.size,D=O===void 0?256:O,F=w.value,B=g(w,["bgColor","fgColor","level","size","value"]),te=new l.default(-1,a.default[M]);te.addData(F),te.make();var U=te.modules;return d.default.createElement(h.default,e({},B,{bgColor:N,bgD:U.map(function(ce,q){return ce.map(function(ne,Y){return ne?"":"M "+Y+" "+q+" l 1 0 0 1 -1 0 Z"}).join(" ")}).join(" "),fgColor:_,fgD:U.map(function(ce,q){return ce.map(function(ne,Y){return ne?"M "+Y+" "+q+" l 1 0 0 1 -1 0 Z":""}).join(" ")}).join(" "),ref:C,size:D,viewBoxSize:U.length}))});return zl.QRCode=x,x.displayName="QRCode",x.propTypes=b,zl.default=x,zl}var HX=qX();const WX=yd(HX);function KX({status:e}){const{t}=Le();return e?e==="open"?s.jsx(Ao,{children:t("status.open")}):e==="connecting"?s.jsx(Ao,{variant:"warning",children:t("status.connecting")}):e==="close"||e==="closed"?s.jsx(Ao,{variant:"destructive",children:t("status.closed")}):s.jsx(Ao,{variant:"secondary",children:e}):null}const GX=e=>{navigator.clipboard.writeText(e),Q.success("Copiado para a área de transferência")};function JX({token:e,className:t}){const[n,r]=v.useState(!1);return s.jsxs("div",{className:ln("flex items-center gap-3 truncate rounded-sm bg-primary/20 px-2 py-1",t),children:[s.jsx("pre",{className:"block truncate text-xs",children:n?e:e?.replace(/\w/g,"*")}),s.jsx($,{variant:"ghost",size:"icon",onClick:()=>{GX(e)},children:s.jsx(pM,{size:"15"})}),s.jsx($,{variant:"ghost",size:"icon",onClick:()=>{r(a=>!a)},children:n?s.jsx(rz,{size:"15"}):s.jsx(sz,{size:"15"})})]})}const Hn=({size:e=45,className:t,...n})=>s.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"},children:s.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:ln("animate-spin",t),children:s.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})});function QX({open:e,onOpenChange:t}){const{t:n}=Le(),{instance:r,reloadInstance:a}=ct(),{connect:o}=Tc(),[l,u]=v.useState(""),[d,f]=v.useState(""),[h,m]=v.useState(!1),[g,b]=v.useState(""),[x,w]=v.useState(!1),C=r?.connectionStatus==="open",k=v.useCallback(async()=>{if(r){m(!0);try{const M=await o({instanceName:r.name,token:r.token});u(M?.base64??""),f(M?.pairingCode??""),await a()}catch{}finally{m(!1)}}},[o,r,a]),N=v.useCallback(async()=>{if(!(!r||!g.trim())){w(!0);try{const M=await o({instanceName:r.name,token:r.token,number:g.trim()});u(M?.base64??""),f(M?.pairingCode??""),await a(),Q.success(n("qrCode.toast.pairingSuccess"))}catch(M){console.error("Pairing error:",M),Q.error(n("qrCode.toast.pairingError"))}finally{w(!1)}}},[o,r,g,a,n]),T=v.useCallback(async()=>{await a()},[a]);v.useEffect(()=>{!e||C||k()},[e]),v.useEffect(()=>{if(!e||C)return;const M=setInterval(()=>{T().catch(O=>console.error("Poll failed:",O))},3e3);return()=>clearInterval(M)},[e,C,T]);const _=async()=>{try{await k(),Q.success(n("qrCode.toast.refreshSuccess"))}catch{Q.error(n("qrCode.toast.refreshError"))}},P=()=>{u(""),f(""),b(""),t(!1)};return r?C?s.jsx(vt,{open:e,onOpenChange:t,children:s.jsxs(mt,{className:"sm:max-w-md",children:[s.jsxs(gt,{children:[s.jsxs(xt,{className:"flex items-center gap-2 text-green-500",children:[s.jsx(H1,{className:"h-5 w-5"}),n("qrCode.connected.title")]}),s.jsx(gr,{children:n("qrCode.connected.description",{instanceName:r.name})})]}),s.jsxs("div",{className:"flex flex-col items-center gap-4 py-6",children:[s.jsx("div",{className:"rounded-full bg-green-500/10 p-4",children:s.jsx(H1,{className:"h-12 w-12 text-green-500"})}),r.profileName&&s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:n("qrCode.connected.connectedAs")}),s.jsx("p",{className:"text-lg font-semibold",children:r.profileName})]})]}),s.jsx("div",{className:"flex justify-end",children:s.jsx($,{onClick:P,className:"w-full sm:w-auto",children:n("qrCode.button.close")})})]})}):s.jsx(vt,{open:e,onOpenChange:t,children:s.jsxs(mt,{className:"sm:max-w-md",children:[s.jsxs(gt,{children:[s.jsxs(xt,{className:"flex items-center gap-2",children:[s.jsx(Qp,{className:"h-5 w-5 text-primary"}),n("qrCode.title")]}),s.jsxs(gr,{children:[n("qrCode.description")," ",s.jsx("strong",{children:r.name})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-col items-center gap-4",children:[l?s.jsx("div",{className:"rounded-lg border-2 border-border bg-white p-4",children:s.jsx("img",{src:l,alt:"QR Code",className:"h-64 w-64"})}):s.jsx("div",{className:"flex h-64 w-64 items-center justify-center rounded-lg border-2 border-dashed border-border",children:s.jsxs("div",{className:"text-center",children:[s.jsx(Qp,{className:"mx-auto h-12 w-12 text-muted-foreground/40"}),s.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:n(h?"qrCode.generating":"qrCode.waiting")})]})}),d&&s.jsxs("div",{className:"w-full rounded-lg bg-muted p-3 text-center",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:n("qrCode.pairingCode.label")}),s.jsx("p",{className:"mt-1 font-mono text-lg font-semibold tracking-widest",children:d})]})]}),s.jsxs("div",{className:"rounded-lg bg-muted p-4",children:[s.jsx("p",{className:"text-sm font-medium",children:n("qrCode.howTo.title")}),s.jsxs("ol",{className:"mt-2 space-y-1 text-sm text-muted-foreground",children:[s.jsxs("li",{children:["1. ",n("qrCode.howTo.step1")]}),s.jsxs("li",{children:["2. ",n("qrCode.howTo.step2")]}),s.jsxs("li",{children:["3. ",n("qrCode.howTo.step3")]}),s.jsxs("li",{children:["4. ",n("qrCode.howTo.step4")]}),s.jsxs("li",{children:["5. ",n("qrCode.howTo.step5")]})]})]}),s.jsxs("div",{className:"space-y-2 border-t border-border pt-4",children:[s.jsxs(Ve,{htmlFor:"pairing-phone",className:"flex items-center gap-2 text-sm",children:[s.jsx(hz,{className:"h-4 w-4"}),n("qrCode.pairingCode.title")]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Z,{id:"pairing-phone",type:"tel",placeholder:"5511999999999",value:g,onChange:M=>b(M.target.value),disabled:x}),s.jsx($,{type:"button",variant:"outline",onClick:N,disabled:!g.trim()||x,children:n(x?"qrCode.pairingCode.generating":"qrCode.pairingCode.generate")})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:n("qrCode.pairingCode.hint")})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx($,{variant:"outline",onClick:_,disabled:h,className:"flex-1",children:h?s.jsxs(s.Fragment,{children:[s.jsx(uc,{className:"mr-2 h-4 w-4 animate-spin"}),n("qrCode.button.refreshing")]}):s.jsxs(s.Fragment,{children:[s.jsx(uc,{className:"mr-2 h-4 w-4"}),n("qrCode.button.refresh")]})}),s.jsx($,{variant:"outline",onClick:P,children:s.jsx(Hh,{className:"h-4 w-4"})})]})]})]})}):null}const YX=async({instanceToken:e,number:t,text:n})=>(await qt.post("/send/text",{number:t,text:n},{headers:{apikey:e}})).data;function ZX({open:e,onOpenChange:t}){const{t:n}=Le(),{instance:r}=ct(),a=fn({number:he().min(1,n("sendMessage.validation.numberRequired")),message:he().min(1,n("sendMessage.validation.messageRequired"))}),{register:o,handleSubmit:l,reset:u,formState:{errors:d,isSubmitting:f}}=mn({resolver:gn(a),defaultValues:{number:"",message:""}}),h=async g=>{if(!r?.token){Q.error(n("sendMessage.toast.noToken"));return}try{await YX({instanceToken:r.token,number:g.number,text:g.message}),Q.success(n("sendMessage.toast.success")),u(),t(!1)}catch(b){console.error("Send message error:",b),Q.error(n("sendMessage.toast.error"))}},m=()=>{u(),t(!1)};return r?s.jsx(vt,{open:e,onOpenChange:g=>g?t(!0):m(),children:s.jsxs(mt,{className:"sm:max-w-md",children:[s.jsxs(gt,{children:[s.jsxs(xt,{className:"flex items-center gap-2",children:[s.jsx(Yp,{className:"h-5 w-5 text-primary"}),n("sendMessage.title")]}),s.jsxs(gr,{children:[n("sendMessage.description")," ",s.jsx("strong",{children:r.name})]})]}),s.jsxs("form",{onSubmit:l(h),className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{htmlFor:"number",children:n("sendMessage.form.number.label")}),s.jsx(Z,{id:"number",type:"text",placeholder:"5511999999999",disabled:f,...o("number")}),d.number&&s.jsx("p",{className:"text-sm text-rose-600",children:d.number.message})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{htmlFor:"message",children:n("sendMessage.form.message.label")}),s.jsx(Is,{id:"message",rows:4,placeholder:n("sendMessage.form.message.placeholder"),disabled:f,...o("message")}),d.message&&s.jsx("p",{className:"text-sm text-rose-600",children:d.message.message})]}),s.jsxs(Kt,{className:"flex gap-2 sm:gap-0",children:[s.jsx($,{type:"button",variant:"outline",onClick:m,disabled:f,children:n("button.cancel")}),s.jsx($,{type:"submit",disabled:f,children:f?s.jsxs(s.Fragment,{children:[s.jsx(qh,{className:"mr-2 h-4 w-4 animate-spin"}),n("sendMessage.button.sending")]}):s.jsxs(s.Fragment,{children:[s.jsx(Yp,{className:"mr-2 h-4 w-4"}),n("sendMessage.button.send")]})})]})]})]})}):null}function XX(){const{t:e,i18n:t}=Le(),n=new Intl.NumberFormat(t.language),[r,a]=v.useState(null),[o,l]=v.useState(""),[u,d]=v.useState(!1),[f,h]=v.useState(!1),[m,g]=v.useState(null),b=mr(Fn.TOKEN),x=vr()==="go",{theme:w}=Zi(),{connect:C,logout:k,restart:N}=Tc(),{instance:T,reloadInstance:_}=ct();v.useEffect(()=>{T&&(localStorage.setItem(Fn.INSTANCE_ID,T.id),localStorage.setItem(Fn.INSTANCE_NAME,T.name),localStorage.setItem(Fn.INSTANCE_TOKEN,T.token))},[T]);const P=async()=>{try{g("refresh"),await _(),Q.success("Instance status refreshed")}catch{Q.error("Could not refresh the instance status")}finally{g(null)}},M=async ce=>{try{g("restart"),await N(ce),await _(),Q.success("Instance restart completed")}catch(q){console.error("Error:",q),Q.error("Instance restart failed")}finally{g(null)}},O=async ce=>{try{g("disconnect"),await k(ce),await _(),Q.success("Instance disconnected")}catch(q){console.error("Error:",q),Q.error("Could not disconnect the instance")}finally{g(null)}},D=async(ce,q)=>{try{if(a(null),!b)return console.error("Token not found.");if(q){const ne=await C({instanceName:ce,token:b,number:T?.number});l(ne.pairingCode)}else{const ne=await C({instanceName:ce,token:b});a(ne.code)}}catch(ne){console.error("Error:",ne)}},F=async()=>{a(null),l(""),await _()},B=v.useMemo(()=>({contacts:T?._count?.Contact||0,chats:T?._count?.Chat||0,messages:T?._count?.Message||0}),[T]),te=v.useMemo(()=>w==="dark"?"#fff":w==="light"?"#000":"#189d68",[w]);if(!T)return s.jsx(Hn,{});const U=T.connectionStatus==="open";return s.jsxs("div",{className:"flex flex-col",children:[s.jsx(iw,{title:T.name,subtitle:T.profileName||e("instance.dashboard.subtitle",{defaultValue:"Manage your instance"}),secondaryActions:[{label:m==="refresh"?"Refreshing…":e("button.refresh",{defaultValue:"Refresh"}),icon:s.jsx(uc,{className:`h-4 w-4 ${m==="refresh"?"animate-spin":""}`}),onClick:P,disabled:m!==null},{label:m==="restart"?"Restarting…":e("instance.dashboard.button.restart",{defaultValue:"Restart"}),icon:s.jsx(Cz,{className:"h-4 w-4"}),onClick:()=>M(T.name),disabled:m!==null},...U?[{label:m==="disconnect"?"Disconnecting…":e("instance.dashboard.button.disconnect",{defaultValue:"Disconnect"}),icon:s.jsx(hM,{className:"h-4 w-4"}),onClick:()=>O(T.name),variant:"destructive",disabled:m!==null}]:[],...x&&U?[{label:e("instance.dashboard.button.sendMessage",{defaultValue:"Send message"}),icon:s.jsx(Yp,{className:"h-4 w-4"}),onClick:()=>h(!0),variant:"default"}]:[]]}),s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsxs(Un,{className:"border-sidebar-border bg-sidebar",children:[s.jsx(Yn,{children:s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[T.profilePicUrl&&s.jsx(Dh,{className:"h-12 w-12",children:s.jsx(Fh,{src:T.profilePicUrl,alt:T.name})}),s.jsxs("div",{children:[s.jsx(Zn,{className:"break-all",children:T.profileName||T.name}),T.ownerJid&&s.jsx("p",{className:"mt-1 break-all text-xs text-muted-foreground",children:T.ownerJid.split("@")[0]})]})]}),s.jsx(KX,{status:T.connectionStatus})]})}),s.jsxs(Vn,{className:"flex flex-col items-start space-y-4",children:[s.jsx("div",{className:"w-full",children:s.jsx(JX,{token:T.token})}),!U&&s.jsxs(pI,{variant:"warning",className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsx(hI,{className:"text-lg font-bold tracking-wide",children:e("instance.dashboard.alert")}),x?s.jsxs(s.Fragment,{children:[s.jsxs($,{onClick:()=>d(!0),children:[s.jsx(Qp,{className:"mr-2 h-4 w-4"}),e("instance.dashboard.button.qrcode.label")]}),s.jsx(QX,{open:u,onOpenChange:d})]}):s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsxs(vt,{children:[s.jsx(an,{onClick:()=>D(T.name,!1),asChild:!0,children:s.jsxs($,{children:[s.jsx(Qp,{className:"mr-2 h-4 w-4"}),e("instance.dashboard.button.qrcode.label")]})}),s.jsxs(mt,{onCloseAutoFocus:F,children:[s.jsx(gt,{children:e("instance.dashboard.button.qrcode.title")}),s.jsx("div",{className:"flex items-center justify-center py-4",children:r?s.jsx(WX,{value:r,size:256,bgColor:"transparent",fgColor:te,className:"rounded-sm"}):s.jsx(Hn,{})})]})]}),T.number&&s.jsxs(vt,{children:[s.jsx(an,{asChild:!0,children:s.jsx($,{variant:"outline",onClick:()=>D(T.name,!0),children:e("instance.dashboard.button.pairingCode.label")})}),s.jsx(mt,{onCloseAutoFocus:F,children:s.jsx(gt,{children:s.jsx(gr,{children:o?s.jsxs("div",{className:"py-3",children:[s.jsx("p",{className:"text-center font-semibold",children:e("instance.dashboard.button.pairingCode.title")}),s.jsxs("p",{className:"mt-2 text-center font-mono text-2xl tracking-widest",children:[o.substring(0,4),"-",o.substring(4,8)]})]}):s.jsx(Hn,{})})})})]})]})]})]}),s.jsx(SV,{})]}),x&&s.jsx(ZX,{open:f,onOpenChange:h}),s.jsxs("section",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[s.jsxs(Un,{className:"border-sidebar-border bg-sidebar",children:[s.jsx(Yn,{children:s.jsxs(Zn,{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:[s.jsx(ez,{size:"18"}),e("instance.dashboard.contacts")]})}),s.jsx(Vn,{className:"text-3xl font-bold",children:n.format(B.contacts)})]}),s.jsxs(Un,{className:"border-sidebar-border bg-sidebar",children:[s.jsx(Yn,{children:s.jsxs(Zn,{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:[s.jsx(Rz,{size:"18"}),e("instance.dashboard.chats")]})}),s.jsx(Vn,{className:"text-3xl font-bold",children:n.format(B.chats)})]}),s.jsxs(Un,{className:"border-sidebar-border bg-sidebar",children:[s.jsx(Yn,{children:s.jsxs(Zn,{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:[s.jsx(cc,{size:"18"}),e("instance.dashboard.messages")]})}),s.jsx(Vn,{className:"text-3xl font-bold",children:n.format(B.messages)})]})]})]})]})}const Cm=v.createContext(null);Cm.displayName="PanelGroupContext";const $n={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},Dw=10,$i=v.useLayoutEffect,hE=Ko.useId,eee=typeof hE=="function"?hE:()=>null;let tee=0;function Fw(e=null){const t=eee(),n=v.useRef(e||t||null);return n.current===null&&(n.current=""+tee++),e??n.current}function bI({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:a,forwardedRef:o,id:l,maxSize:u,minSize:d,onCollapse:f,onExpand:h,onResize:m,order:g,style:b,tagName:x="div",...w}){const C=v.useContext(Cm);if(C===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:k,expandPanel:N,getPanelSize:T,getPanelStyle:_,groupId:P,isPanelCollapsed:M,reevaluatePanelConstraints:O,registerPanel:D,resizePanel:F,unregisterPanel:B}=C,te=Fw(l),U=v.useRef({callbacks:{onCollapse:f,onExpand:h,onResize:m},constraints:{collapsedSize:n,collapsible:r,defaultSize:a,maxSize:u,minSize:d},id:te,idIsFromProps:l!==void 0,order:g});v.useRef({didLogMissingDefaultSizeWarning:!1}),$i(()=>{const{callbacks:q,constraints:ne}=U.current,Y={...ne};U.current.id=te,U.current.idIsFromProps=l!==void 0,U.current.order=g,q.onCollapse=f,q.onExpand=h,q.onResize=m,ne.collapsedSize=n,ne.collapsible=r,ne.defaultSize=a,ne.maxSize=u,ne.minSize=d,(Y.collapsedSize!==ne.collapsedSize||Y.collapsible!==ne.collapsible||Y.maxSize!==ne.maxSize||Y.minSize!==ne.minSize)&&O(U.current,Y)}),$i(()=>{const q=U.current;return D(q),()=>{B(q)}},[g,te,D,B]),v.useImperativeHandle(o,()=>({collapse:()=>{k(U.current)},expand:q=>{N(U.current,q)},getId(){return te},getSize(){return T(U.current)},isCollapsed(){return M(U.current)},isExpanded(){return!M(U.current)},resize:q=>{F(U.current,q)}}),[k,N,T,M,te,F]);const ce=_(U.current,a);return v.createElement(x,{...w,children:e,className:t,id:te,style:{...ce,...b},[$n.groupId]:P,[$n.panel]:"",[$n.panelCollapsible]:r||void 0,[$n.panelId]:te,[$n.panelSize]:parseFloat(""+ce.flexGrow).toFixed(1)})}const wI=v.forwardRef((e,t)=>v.createElement(bI,{...e,forwardedRef:t}));bI.displayName="Panel";wI.displayName="forwardRef(Panel)";let rb=null,$p=-1,Ro=null;function nee(e,t,n){const r=(t&EI)!==0,a=(t&NI)!==0,o=(t&TI)!==0,l=(t&MI)!==0;if(t){if(r)return o?"se-resize":l?"ne-resize":"e-resize";if(a)return o?"sw-resize":l?"nw-resize":"w-resize";if(o)return"s-resize";if(l)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function ree(){Ro!==null&&(document.head.removeChild(Ro),rb=null,Ro=null,$p=-1)}function Py(e,t,n){var r,a;const o=nee(e,t);if(rb!==o){if(rb=o,Ro===null&&(Ro=document.createElement("style"),document.head.appendChild(Ro)),$p>=0){var l;(l=Ro.sheet)===null||l===void 0||l.removeRule($p)}$p=(r=(a=Ro.sheet)===null||a===void 0?void 0:a.insertRule(`*{cursor: ${o} !important;}`))!==null&&r!==void 0?r:-1}}function SI(e){return e.type==="keydown"}function CI(e){return e.type.startsWith("pointer")}function jI(e){return e.type.startsWith("mouse")}function jm(e){if(CI(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(jI(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function see(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function aee(e,t,n){return e.xt.x&&e.yt.y}function oee(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:vE(e),b:vE(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;Ft(r,"Stacking order can only be calculated for elements with a common ancestor");const a={a:gE(mE(n.a)),b:gE(mE(n.b))};if(a.a===a.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(a.a-a.b)}const iee=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function lee(e){var t;const n=getComputedStyle((t=kI(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function cee(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||lee(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"||iee.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function mE(e){let t=e.length;for(;t--;){const n=e[t];if(Ft(n,"Missing node"),cee(n))return n}return null}function gE(e){return e&&Number(getComputedStyle(e).zIndex)||0}function vE(e){const t=[];for(;e;)t.push(e),e=kI(e);return t}function kI(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const EI=1,NI=2,TI=4,MI=8,uee=see()==="coarse";let Zs=[],rc=!1,Io=new Map,km=new Map;const md=new Set;function dee(e,t,n,r,a){var o;const{ownerDocument:l}=t,u={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:a},d=(o=Io.get(l))!==null&&o!==void 0?o:0;return Io.set(l,d+1),md.add(u),yh(),function(){var h;km.delete(e),md.delete(u);const m=(h=Io.get(l))!==null&&h!==void 0?h:1;if(Io.set(l,m-1),yh(),m===1&&Io.delete(l),Zs.includes(u)){const g=Zs.indexOf(u);g>=0&&Zs.splice(g,1),Em(),a("up",!0,null)}}}function fee(e){const{target:t}=e,{x:n,y:r}=jm(e);rc=!0,Lw({target:t,x:n,y:r}),yh(),Zs.length>0&&(xh("down",e),Em(),e.preventDefault(),_I(t)||e.stopImmediatePropagation())}function Ry(e){const{x:t,y:n}=jm(e);if(rc&&e.type!=="pointerleave"&&e.buttons===0&&(rc=!1,xh("up",e)),!rc){const{target:r}=e;Lw({target:r,x:t,y:n})}xh("move",e),Em(),Zs.length>0&&e.preventDefault()}function Iy(e){const{target:t}=e,{x:n,y:r}=jm(e);km.clear(),rc=!1,Zs.length>0&&(e.preventDefault(),_I(t)||e.stopImmediatePropagation()),xh("up",e),Lw({target:t,x:n,y:r}),Em(),yh()}function _I(e){let t=e;for(;t;){if(t.hasAttribute($n.resizeHandle))return!0;t=t.parentElement}return!1}function Lw({target:e,x:t,y:n}){Zs.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),md.forEach(a=>{const{element:o,hitAreaMargins:l}=a,u=o.getBoundingClientRect(),{bottom:d,left:f,right:h,top:m}=u,g=uee?l.coarse:l.fine;if(t>=f-g&&t<=h+g&&n>=m-g&&n<=d+g){if(r!==null&&document.contains(r)&&o!==r&&!o.contains(r)&&!r.contains(o)&&oee(r,o)>0){let x=r,w=!1;for(;x&&!x.contains(o);){if(aee(x.getBoundingClientRect(),u)){w=!0;break}x=x.parentElement}if(w)return}Zs.push(a)}})}function Oy(e,t){km.set(e,t)}function Em(){let e=!1,t=!1;Zs.forEach(r=>{const{direction:a}=r;a==="horizontal"?e=!0:t=!0});let n=0;km.forEach(r=>{n|=r}),e&&t?Py("intersection",n):e?Py("horizontal",n):t?Py("vertical",n):ree()}let Ay;function yh(){var e;(e=Ay)===null||e===void 0||e.abort(),Ay=new AbortController;const t={capture:!0,signal:Ay.signal};md.size&&(rc?(Zs.length>0&&Io.forEach((n,r)=>{const{body:a}=r;n>0&&(a.addEventListener("contextmenu",Iy,t),a.addEventListener("pointerleave",Ry,t),a.addEventListener("pointermove",Ry,t))}),Io.forEach((n,r)=>{const{body:a}=r;a.addEventListener("pointerup",Iy,t),a.addEventListener("pointercancel",Iy,t)})):Io.forEach((n,r)=>{const{body:a}=r;n>0&&(a.addEventListener("pointerdown",fee,t),a.addEventListener("pointermove",Ry,t))}))}function xh(e,t){md.forEach(n=>{const{setResizeHandlerState:r}=n,a=Zs.includes(n);r(e,a,t)})}function pee(){const[e,t]=v.useState(0);return v.useCallback(()=>t(n=>n+1),[])}function Ft(e,t){if(!e)throw console.error(t),Error(t)}function Yi(e,t,n=Dw){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function $a(e,t,n=Dw){return Yi(e,t,n)===0}function cs(e,t,n){return Yi(e,t,n)===0}function hee(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];Ft(g,`No panel constraints found for index ${m}`);const{collapsedSize:b=0,collapsible:x,minSize:w=0}=g;if(x){const C=t[m];if(Ft(C!=null,`Previous layout not found for panel index ${m}`),cs(C,w)){const k=C-b;Yi(k,Math.abs(e))>0&&(e=e<0?0-k:k)}}}}{const m=e<0?1:-1;let g=e<0?d:u,b=0;for(;;){const w=t[g];Ft(w!=null,`Previous layout not found for panel index ${g}`);const k=Jl({panelConstraints:n,panelIndex:g,size:100})-w;if(b+=k,g+=m,g<0||g>=n.length)break}const x=Math.min(Math.abs(e),Math.abs(b));e=e<0?0-x:x}{let g=e<0?u:d;for(;g>=0&&g=0))break;e<0?g--:g++}}if(hee(a,l))return a;{const m=e<0?d:u,g=t[m];Ft(g!=null,`Previous layout not found for panel index ${m}`);const b=g+f,x=Jl({panelConstraints:n,panelIndex:m,size:b});if(l[m]=x,!cs(x,b)){let w=b-x,k=e<0?d:u;for(;k>=0&&k0?k--:k++}}}const h=l.reduce((m,g)=>g+m,0);return cs(h,100)?l:a}function mee({layout:e,panelsArray:t,pivotIndices:n}){let r=0,a=100,o=0,l=0;const u=n[0];Ft(u!=null,"No pivot index found"),t.forEach((m,g)=>{const{constraints:b}=m,{maxSize:x=100,minSize:w=0}=b;g===u?(r=w,a=x):(o+=w,l+=x)});const d=Math.min(a,100-o),f=Math.max(r,100-l),h=e[u];return{valueMax:d,valueMin:f,valueNow:h}}function gd(e,t=document){return Array.from(t.querySelectorAll(`[${$n.resizeHandleId}][data-panel-group-id="${e}"]`))}function PI(e,t,n=document){const a=gd(e,n).findIndex(o=>o.getAttribute($n.resizeHandleId)===t);return a??null}function RI(e,t,n){const r=PI(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function gee(e){return e instanceof HTMLElement?!0:typeof e=="object"&&e!==null&&"tagName"in e&&"getAttribute"in e}function II(e,t=document){if(gee(t)&&t.dataset.panelGroupId==e)return t;const n=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return n||null}function Nm(e,t=document){const n=t.querySelector(`[${$n.resizeHandleId}="${e}"]`);return n||null}function vee(e,t,n,r=document){var a,o,l,u;const d=Nm(t,r),f=gd(e,r),h=d?f.indexOf(d):-1,m=(a=(o=n[h])===null||o===void 0?void 0:o.id)!==null&&a!==void 0?a: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 yee({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:a,panelGroupElement:o,setLayout:l}){v.useRef({didWarnAboutMissingResizeHandle:!1}),$i(()=>{if(!o)return;const u=gd(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,a,o]),v.useEffect(()=>{if(!o)return;const u=t.current;Ft(u,"Eager values not found");const{panelDataArray:d}=u,f=II(n,o);Ft(f!=null,`No group found for id "${n}"`);const h=gd(n,o);Ft(h,`No resize handles found for group id "${n}"`);const m=h.map(g=>{const b=g.getAttribute($n.resizeHandleId);Ft(b,"Resize handle element has no handle id attribute");const[x,w]=vee(n,b,d,o);if(x==null||w==null)return()=>{};const C=k=>{if(!k.defaultPrevented)switch(k.key){case"Enter":{k.preventDefault();const N=d.findIndex(T=>T.id===x);if(N>=0){const T=d[N];Ft(T,`No panel data found for index ${N}`);const _=r[N],{collapsedSize:P=0,collapsible:M,minSize:O=0}=T.constraints;if(_!=null&&M){const D=Ju({delta:cs(_,P)?O-P:P-_,initialLayout:r,panelConstraints:d.map(F=>F.constraints),pivotIndices:RI(n,b,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,a,l])}function yE(e,t){if(e.length!==t.length)return!1;for(let n=0;no.constraints);let r=0,a=100;for(let o=0;o{const o=e[a];Ft(o,`Panel data not found for index ${a}`);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:b,onResize:x}=l;x&&x(r,m),h&&(g||b)&&(b&&(m==null||$a(m,f))&&!$a(r,f)&&b(),g&&(m==null||!$a(m,f))&&$a(r,f)&&g())}})}function op(e,t){if(e.length!==t.length)return!1;for(let n=0;n{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...a)},t)}}function xE(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 AI(e){return`react-resizable-panels:${e}`}function DI(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:a,order:o}=t;return a?r:o?`${o}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function FI(e,t){try{const n=AI(e),r=t.getItem(n);if(r){const a=JSON.parse(r);if(typeof a=="object"&&a!=null)return a}}catch{}return null}function jee(e,t,n){var r,a;const o=(r=FI(e,n))!==null&&r!==void 0?r:{},l=DI(t);return(a=o[l])!==null&&a!==void 0?a:null}function kee(e,t,n,r,a){var o;const l=AI(e),u=DI(t),d=(o=FI(e,a))!==null&&o!==void 0?o:{};d[u]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{a.setItem(l,JSON.stringify(d))}catch(f){console.error(f)}}function bE({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(!cs(r,100)&&n.length>0)for(let o=0;o(xE(Qu),Qu.getItem(e)),setItem:(e,t)=>{xE(Qu),Qu.setItem(e,t)}},wE={};function LI({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:a,id:o=null,onLayout:l=null,keyboardResizeBy:u=null,storage:d=Qu,style:f,tagName:h="div",...m}){const g=Fw(o),b=v.useRef(null),[x,w]=v.useState(null),[C,k]=v.useState([]),N=pee(),T=v.useRef({}),_=v.useRef(new Map),P=v.useRef(0),M=v.useRef({autoSaveId:e,direction:r,dragState:x,id:g,keyboardResizeBy:u,onLayout:l,storage:d}),O=v.useRef({layout:C,panelDataArray:[],panelDataArrayChanged:!1});v.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),v.useImperativeHandle(a,()=>({getId:()=>M.current.id,getLayout:()=>{const{layout:re}=O.current;return re},setLayout:re=>{const{onLayout:ee}=M.current,{layout:ie,panelDataArray:ue}=O.current,j=bE({layout:re,panelConstraints:ue.map(I=>I.constraints)});yE(ie,j)||(k(j),O.current.layout=j,ee&&ee(j),Ul(ue,j,T.current))}}),[]),$i(()=>{M.current.autoSaveId=e,M.current.direction=r,M.current.dragState=x,M.current.id=g,M.current.onLayout=l,M.current.storage=d}),yee({committedValuesRef:M,eagerValuesRef:O,groupId:g,layout:C,panelDataArray:O.current.panelDataArray,setLayout:k,panelGroupElement:b.current}),v.useEffect(()=>{const{panelDataArray:re}=O.current;if(e){if(C.length===0||C.length!==re.length)return;let ee=wE[e];ee==null&&(ee=Cee(kee,Eee),wE[e]=ee);const ie=[...re],ue=new Map(_.current);ee(e,ie,ue,C,d)}},[e,C,d]),v.useEffect(()=>{});const D=v.useCallback(re=>{const{onLayout:ee}=M.current,{layout:ie,panelDataArray:ue}=O.current;if(re.constraints.collapsible){const j=ue.map(st=>st.constraints),{collapsedSize:I=0,panelSize:me,pivotIndices:be}=Ti(ue,re,ie);if(Ft(me!=null,`Panel size not found for panel "${re.id}"`),!$a(me,I)){_.current.set(re.id,me);const Je=Wl(ue,re)===ue.length-1?me-I:I-me,rt=Ju({delta:Je,initialLayout:ie,panelConstraints:j,pivotIndices:be,prevLayout:ie,trigger:"imperative-api"});op(ie,rt)||(k(rt),O.current.layout=rt,ee&&ee(rt),Ul(ue,rt,T.current))}}},[]),F=v.useCallback((re,ee)=>{const{onLayout:ie}=M.current,{layout:ue,panelDataArray:j}=O.current;if(re.constraints.collapsible){const I=j.map(Ht=>Ht.constraints),{collapsedSize:me=0,panelSize:be=0,minSize:st=0,pivotIndices:Je}=Ti(j,re,ue),rt=ee??st;if($a(be,me)){const Ht=_.current.get(re.id),Wn=Ht!=null&&Ht>=rt?Ht:rt,tr=Wl(j,re)===j.length-1?be-Wn:Wn-be,Sn=Ju({delta:tr,initialLayout:ue,panelConstraints:I,pivotIndices:Je,prevLayout:ue,trigger:"imperative-api"});op(ue,Sn)||(k(Sn),O.current.layout=Sn,ie&&ie(Sn),Ul(j,Sn,T.current))}}},[]),B=v.useCallback(re=>{const{layout:ee,panelDataArray:ie}=O.current,{panelSize:ue}=Ti(ie,re,ee);return Ft(ue!=null,`Panel size not found for panel "${re.id}"`),ue},[]),te=v.useCallback((re,ee)=>{const{panelDataArray:ie}=O.current,ue=Wl(ie,re);return See({defaultSize:ee,dragState:x,layout:C,panelData:ie,panelIndex:ue})},[x,C]),U=v.useCallback(re=>{const{layout:ee,panelDataArray:ie}=O.current,{collapsedSize:ue=0,collapsible:j,panelSize:I}=Ti(ie,re,ee);return Ft(I!=null,`Panel size not found for panel "${re.id}"`),j===!0&&$a(I,ue)},[]),ce=v.useCallback(re=>{const{layout:ee,panelDataArray:ie}=O.current,{collapsedSize:ue=0,collapsible:j,panelSize:I}=Ti(ie,re,ee);return Ft(I!=null,`Panel size not found for panel "${re.id}"`),!j||Yi(I,ue)>0},[]),q=v.useCallback(re=>{const{panelDataArray:ee}=O.current;ee.push(re),ee.sort((ie,ue)=>{const j=ie.order,I=ue.order;return j==null&&I==null?0:j==null?-1:I==null?1:j-I}),O.current.panelDataArrayChanged=!0,N()},[N]);$i(()=>{if(O.current.panelDataArrayChanged){O.current.panelDataArrayChanged=!1;const{autoSaveId:re,onLayout:ee,storage:ie}=M.current,{layout:ue,panelDataArray:j}=O.current;let I=null;if(re){const be=jee(re,j,ie);be&&(_.current=new Map(Object.entries(be.expandToSizes)),I=be.layout)}I==null&&(I=wee({panelDataArray:j}));const me=bE({layout:I,panelConstraints:j.map(be=>be.constraints)});yE(ue,me)||(k(me),O.current.layout=me,ee&&ee(me),Ul(j,me,T.current))}}),$i(()=>{const re=O.current;return()=>{re.layout=[]}},[]);const ne=v.useCallback(re=>{let ee=!1;const ie=b.current;return ie&&window.getComputedStyle(ie,null).getPropertyValue("direction")==="rtl"&&(ee=!0),function(j){j.preventDefault();const I=b.current;if(!I)return()=>null;const{direction:me,dragState:be,id:st,keyboardResizeBy:Je,onLayout:rt}=M.current,{layout:Ht,panelDataArray:Wn}=O.current,{initialLayout:Pn}=be??{},tr=RI(st,re,I);let Sn=bee(j,re,me,be,Je,I);const zr=me==="horizontal";zr&&ee&&(Sn=-Sn);const Ur=Wn.map(z=>z.constraints),or=Ju({delta:Sn,initialLayout:Pn??Ht,panelConstraints:Ur,pivotIndices:tr,prevLayout:Ht,trigger:SI(j)?"keyboard":"mouse-or-touch"}),_r=!op(Ht,or);(CI(j)||jI(j))&&P.current!=Sn&&(P.current=Sn,!_r&&Sn!==0?zr?Oy(re,Sn<0?EI:NI):Oy(re,Sn<0?TI:MI):Oy(re,0)),_r&&(k(or),O.current.layout=or,rt&&rt(or),Ul(Wn,or,T.current))}},[]),Y=v.useCallback((re,ee)=>{const{onLayout:ie}=M.current,{layout:ue,panelDataArray:j}=O.current,I=j.map(Ht=>Ht.constraints),{panelSize:me,pivotIndices:be}=Ti(j,re,ue);Ft(me!=null,`Panel size not found for panel "${re.id}"`);const Je=Wl(j,re)===j.length-1?me-ee:ee-me,rt=Ju({delta:Je,initialLayout:ue,panelConstraints:I,pivotIndices:be,prevLayout:ue,trigger:"imperative-api"});op(ue,rt)||(k(rt),O.current.layout=rt,ie&&ie(rt),Ul(j,rt,T.current))},[]),se=v.useCallback((re,ee)=>{const{layout:ie,panelDataArray:ue}=O.current,{collapsedSize:j=0,collapsible:I}=ee,{collapsedSize:me=0,collapsible:be,maxSize:st=100,minSize:Je=0}=re.constraints,{panelSize:rt}=Ti(ue,re,ie);rt!=null&&(I&&be&&$a(rt,j)?$a(j,me)||Y(re,me):rtst&&Y(re,st))},[Y]),H=v.useCallback((re,ee)=>{const{direction:ie}=M.current,{layout:ue}=O.current;if(!b.current)return;const j=Nm(re,b.current);Ft(j,`Drag handle element not found for id "${re}"`);const I=OI(ie,ee);w({dragHandleId:re,dragHandleRect:j.getBoundingClientRect(),initialCursorPosition:I,initialLayout:ue})},[]),W=v.useCallback(()=>{w(null)},[]),V=v.useCallback(re=>{const{panelDataArray:ee}=O.current,ie=Wl(ee,re);ie>=0&&(ee.splice(ie,1),delete T.current[re.id],O.current.panelDataArrayChanged=!0,N())},[N]),A=v.useMemo(()=>({collapsePanel:D,direction:r,dragState:x,expandPanel:F,getPanelSize:B,getPanelStyle:te,groupId:g,isPanelCollapsed:U,isPanelExpanded:ce,reevaluatePanelConstraints:se,registerPanel:q,registerResizeHandle:ne,resizePanel:Y,startDragging:H,stopDragging:W,unregisterPanel:V,panelGroupElement:b.current}),[D,x,r,F,B,te,g,U,ce,se,q,ne,Y,H,W,V]),K={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return v.createElement(Cm.Provider,{value:A},v.createElement(h,{...m,children:t,className:n,id:o,ref:b,style:{...K,...f},[$n.group]:"",[$n.groupDirection]:r,[$n.groupId]:g}))}const $I=v.forwardRef((e,t)=>v.createElement(LI,{...e,forwardedRef:t}));LI.displayName="PanelGroup";$I.displayName="forwardRef(PanelGroup)";function Wl(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function Ti(e,t,n){const r=Wl(e,t),o=r===e.length-1?[r-1,r]:[r,r+1],l=n[r];return{...t.constraints,panelSize:l,pivotIndices:o}}function Nee({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){v.useEffect(()=>{if(e||n==null||r==null)return;const a=Nm(t,r);if(a==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=a.getAttribute($n.groupId);Ft(u,`No group element found for id "${u}"`);const d=gd(u,r),f=PI(u,t,r);Ft(f!==null,`No resize element found for id "${t}"`);const h=l.shiftKey?f>0?f-1:d.length-1:f+1{a.removeEventListener("keydown",o)}},[r,e,t,n])}function BI({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:a,onBlur:o,onClick:l,onDragging:u,onFocus:d,onPointerDown:f,onPointerUp:h,style:m={},tabIndex:g=0,tagName:b="div",...x}){var w,C;const k=v.useRef(null),N=v.useRef({onClick:l,onDragging:u,onPointerDown:f,onPointerUp:h});v.useEffect(()=>{N.current.onClick=l,N.current.onDragging=u,N.current.onPointerDown=f,N.current.onPointerUp=h});const T=v.useContext(Cm);if(T===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:_,groupId:P,registerResizeHandle:M,startDragging:O,stopDragging:D,panelGroupElement:F}=T,B=Fw(a),[te,U]=v.useState("inactive"),[ce,q]=v.useState(!1),[ne,Y]=v.useState(null),se=v.useRef({state:te});$i(()=>{se.current.state=te}),v.useEffect(()=>{if(n)Y(null);else{const A=M(B);Y(()=>A)}},[n,B,M]);const H=(w=r?.coarse)!==null&&w!==void 0?w:15,W=(C=r?.fine)!==null&&C!==void 0?C:5;v.useEffect(()=>{if(n||ne==null)return;const A=k.current;Ft(A,"Element ref not attached");let K=!1;return dee(B,A,_,{coarse:H,fine:W},(ee,ie,ue)=>{if(!ie){U("inactive");return}switch(ee){case"down":{U("drag"),K=!1,Ft(ue,'Expected event to be defined for "down" action'),O(B,ue);const{onDragging:j,onPointerDown:I}=N.current;j?.(!0),I?.();break}case"move":{const{state:j}=se.current;K=!0,j!=="drag"&&U("hover"),Ft(ue,'Expected event to be defined for "move" action'),ne(ue);break}case"up":{U("hover"),D();const{onClick:j,onDragging:I,onPointerUp:me}=N.current;I?.(!1),me?.(),K||j?.();break}}})},[H,_,n,W,M,B,ne,O,D]),Nee({disabled:n,handleId:B,resizeHandler:ne,panelGroupElement:F});const V={touchAction:"none",userSelect:"none"};return v.createElement(b,{...x,children:e,className:t,id:a,onBlur:()=>{q(!1),o?.()},onFocus:()=>{q(!0),d?.()},ref:k,role:"separator",style:{...V,...m},tabIndex:g,[$n.groupDirection]:_,[$n.groupId]:P,[$n.resizeHandle]:"",[$n.resizeHandleActive]:te==="drag"?"pointer":ce?"keyboard":void 0,[$n.resizeHandleEnabled]:!n,[$n.resizeHandleId]:B,[$n.resizeHandleState]:te})}BI.displayName="PanelResizeHandle";function ii({className:e,...t}){return s.jsx($I,{"data-slot":"resizable-panel-group",className:Et("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t})}function Mr({...e}){return s.jsx(wI,{"data-slot":"resizable-panel",...e})}function li({withHandle:e,className:t,...n}){return s.jsx(BI,{"data-slot":"resizable-handle",className:Et("bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden 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-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),...n,children:e&&s.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:s.jsx(cV,{className:"size-2.5"})})})}var Tee=Symbol.for("react.lazy"),bh=Ko[" use ".trim().toString()];function Mee(e){return typeof e=="object"&&e!==null&&"then"in e}function zI(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Tee&&"_payload"in e&&Mee(e._payload)}function _ee(e){const t=Pee(e),n=v.forwardRef((r,a)=>{let{children:o,...l}=r;zI(o)&&typeof bh=="function"&&(o=bh(o._payload));const u=v.Children.toArray(o),d=u.find(Iee);if(d){const f=d.props.children,h=u.map(m=>m===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:m);return s.jsx(t,{...l,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...l,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function Pee(e){const t=v.forwardRef((n,r)=>{let{children:a,...o}=n;if(zI(a)&&typeof bh=="function"&&(a=bh(a._payload)),v.isValidElement(a)){const l=Aee(a),u=Oee(o,a.props);return a.type!==v.Fragment&&(u.ref=r?Yo(r,l):l),v.cloneElement(a,u)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ree=Symbol("radix.slottable");function Iee(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ree}function Oee(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...u)=>{const d=o(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function Aee(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 Dee=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Fee=Dee.reduce((e,t)=>{const n=_ee(`Primitive.${t}`),r=v.forwardRef((a,o)=>{const{asChild:l,...u}=a,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...u,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Lee="Separator",SE="horizontal",$ee=["horizontal","vertical"],UI=v.forwardRef((e,t)=>{const{decorative:n,orientation:r=SE,...a}=e,o=Bee(r)?r:SE,u=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return s.jsx(Fee.div,{"data-orientation":o,...u,...a,ref:t})});UI.displayName=Lee;function Bee(e){return $ee.includes(e)}var zee=UI;function Yt({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return s.jsx(zee,{"data-slot":"separator",decorative:n,orientation:t,className:Et("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}const Uee=e=>["dify","fetchDify",JSON.stringify(e)],Vee=async({instanceName:e,token:t})=>(await Ce.get(`/dify/find/${e}`,{headers:{apikey:t}})).data,VI=e=>{const{instanceName:t,token:n,...r}=e;return pt({...r,queryKey:Uee({instanceName:t,token:n}),queryFn:()=>Vee({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},qee=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/dify/create/${e}`,n,{headers:{apikey:t}})).data,Hee=async({instanceName:e,difyId:t,data:n})=>(await Ce.put(`/dify/update/${t}/${e}`,n)).data,Wee=async({instanceName:e,difyId:t})=>(await Ce.delete(`/dify/delete/${t}/${e}`)).data,Kee=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/dify/settings/${e}`,n,{headers:{apikey:t}})).data,Gee=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await Ce.post(`/dify/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function Tm(){const e=nt(Kee,{invalidateKeys:[["dify","fetchDefaultSettings"]]}),t=nt(Gee,{invalidateKeys:[["dify","getDify"],["dify","fetchSessions"]]}),n=nt(Wee,{invalidateKeys:[["dify","getDify"],["dify","fetchDify"],["dify","fetchSessions"]]}),r=nt(Hee,{invalidateKeys:[["dify","getDify"],["dify","fetchDify"],["dify","fetchSessions"]]}),a=nt(qee,{invalidateKeys:[["dify","fetchDify"]]});return{setDefaultSettingsDify:e,changeStatusDify:t,deleteDify:n,updateDify:r,createDify:a}}const Jee=e=>["dify","fetchDefaultSettings",JSON.stringify(e)],Qee=async({instanceName:e,token:t})=>(await Ce.get(`/dify/fetchSettings/${e}`,{headers:{apikey:t}})).data,Yee=e=>{const{instanceName:t,token:n,...r}=e;return pt({...r,queryKey:Jee({instanceName:t,token:n}),queryFn:()=>Qee({instanceName:t,token:n}),enabled:!!t})},Zee=fn({expire:he(),keywordFinish:he(),delayMessage:he(),unknownMessage:he(),listeningFromMe:Me(),stopBotFromMe:Me(),keepOpen:Me(),debounceTime:he(),ignoreJids:Ds(he()).default([]),difyIdFallback:_c([Mc(),he()]).optional(),splitMessages:Me(),timePerChar:he()});function Xee(){const{t:e}=Le(),{instance:t}=ct(),{setDefaultSettingsDify:n}=Tm(),[r,a]=v.useState(!1),{data:o,refetch:l}=VI({instanceName:t?.name,token:t?.token,enabled:r}),{data:u,refetch:d}=Yee({instanceName:t?.name,token:t?.token}),f=mn({resolver:gn(Zee),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(()=>{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 b={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:b}),Q.success(e("dify.toast.defaultSettings.success"))}catch(b){console.error("Error:",b),Q.error(`Error: ${b?.response?.data?.response?.message}`)}};function m(){d(),l()}return s.jsxs(vt,{open:r,onOpenChange:a,children:[s.jsx(an,{asChild:!0,children:s.jsxs($,{variant:"secondary",size:"sm",children:[s.jsx(Zo,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:e("dify.defaultSettings")})]})}),s.jsxs(mt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:m,children:[s.jsx(gt,{children:s.jsx(xt,{children:e("dify.defaultSettings")})}),s.jsx(yr,{...f,children:s.jsxs("form",{className:"w-full space-y-6",onSubmit:f.handleSubmit(h),children:[s.jsx("div",{children:s.jsxs("div",{className:"space-y-4",children:[s.jsx(un,{name:"difyIdFallback",label:e("dify.form.difyIdFallback.label"),options:o?.filter(g=>!!g.id).map(g=>({label:g.description,value:g.id}))??[]}),s.jsx(pe,{name:"expire",label:e("dify.form.expire.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(pe,{name:"keywordFinish",label:e("dify.form.keywordFinish.label"),children:s.jsx(Z,{})}),s.jsx(pe,{name:"delayMessage",label:e("dify.form.delayMessage.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(pe,{name:"unknownMessage",label:e("dify.form.unknownMessage.label"),children:s.jsx(Z,{})}),s.jsx(Re,{name:"listeningFromMe",label:e("dify.form.listeningFromMe.label"),reverse:!0}),s.jsx(Re,{name:"stopBotFromMe",label:e("dify.form.stopBotFromMe.label"),reverse:!0}),s.jsx(Re,{name:"keepOpen",label:e("dify.form.keepOpen.label"),reverse:!0}),s.jsx(pe,{name:"debounceTime",label:e("dify.form.debounceTime.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(Re,{name:"splitMessages",label:e("dify.form.splitMessages.label"),reverse:!0}),s.jsx(pe,{name:"timePerChar",label:e("dify.form.timePerChar.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(ai,{name:"ignoreJids",label:e("dify.form.ignoreJids.label"),placeholder:e("dify.form.ignoreJids.placeholder")})]})}),s.jsx(Kt,{children:s.jsx($,{type:"submit",children:e("dify.button.save")})})]})})]})]})}var Mm="Checkbox",[ete]=sa(Mm),[tte,$w]=ete(Mm);function nte(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:a,disabled:o,form:l,name:u,onCheckedChange:d,required:f,value:h="on",internal_do_not_use_render:m}=e,[g,b]=Ha({prop:n,defaultProp:a??!1,onChange:d,caller:Mm}),[x,w]=v.useState(null),[C,k]=v.useState(null),N=v.useRef(!1),T=x?!!l||!!x.closest("form"):!0,_={checked:g,disabled:o,setChecked:b,control:x,setControl:w,name:u,form:l,value:h,hasConsumerStoppedPropagationRef:N,required:f,defaultChecked:$o(a)?!1:a,isFormControl:T,bubbleInput:C,setBubbleInput:k};return s.jsx(tte,{scope:t,..._,children:rte(m)?m(_):r})}var qI="CheckboxTrigger",HI=v.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},a)=>{const{control:o,value:l,disabled:u,checked:d,required:f,setControl:h,setChecked:m,hasConsumerStoppedPropagationRef:g,isFormControl:b,bubbleInput:x}=$w(qI,e),w=nn(a,h),C=v.useRef(d);return v.useEffect(()=>{const k=o?.form;if(k){const N=()=>m(C.current);return k.addEventListener("reset",N),()=>k.removeEventListener("reset",N)}},[o,m]),s.jsx(wt.button,{type:"button",role:"checkbox","aria-checked":$o(d)?"mixed":d,"aria-required":f,"data-state":YI(d),"data-disabled":u?"":void 0,disabled:u,value:l,...r,ref:w,onKeyDown:Ge(t,k=>{k.key==="Enter"&&k.preventDefault()}),onClick:Ge(n,k=>{m(N=>$o(N)?!0:!N),x&&b&&(g.current=k.isPropagationStopped(),g.current||k.stopPropagation())})})});HI.displayName=qI;var WI=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:a,defaultChecked:o,required:l,disabled:u,value:d,onCheckedChange:f,form:h,...m}=e;return s.jsx(nte,{__scopeCheckbox:n,checked:a,defaultChecked:o,disabled:u,required:l,onCheckedChange:f,name:r,form:h,value:d,internal_do_not_use_render:({isFormControl:g})=>s.jsxs(s.Fragment,{children:[s.jsx(HI,{...m,ref:t,__scopeCheckbox:n}),g&&s.jsx(QI,{__scopeCheckbox:n})]})})});WI.displayName=Mm;var KI="CheckboxIndicator",GI=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,o=$w(KI,n);return s.jsx(aa,{present:r||$o(o.checked)||o.checked===!0,children:s.jsx(wt.span,{"data-state":YI(o.checked),"data-disabled":o.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});GI.displayName=KI;var JI="CheckboxBubbleInput",QI=v.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:a,checked:o,defaultChecked:l,required:u,disabled:d,name:f,value:h,form:m,bubbleInput:g,setBubbleInput:b}=$w(JI,e),x=nn(n,b),w=xw(o),C=qb(r);v.useEffect(()=>{const N=g;if(!N)return;const T=window.HTMLInputElement.prototype,P=Object.getOwnPropertyDescriptor(T,"checked").set,M=!a.current;if(w!==o&&P){const O=new Event("click",{bubbles:M});N.indeterminate=$o(o),P.call(N,$o(o)?!1:o),N.dispatchEvent(O)}},[g,w,o,a]);const k=v.useRef($o(o)?!1:o);return s.jsx(wt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??k.current,required:u,disabled:d,name:f,value:h,form:m,...t,tabIndex:-1,ref:x,style:{...t.style,...C,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});QI.displayName=JI;function rte(e){return typeof e=="function"}function $o(e){return e==="indeterminate"}function YI(e){return $o(e)?"indeterminate":e?"checked":"unchecked"}function ts({className:e,...t}){return s.jsx(WI,{"data-slot":"checkbox",className:Et("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:s.jsx(GI,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:s.jsx(ew,{className:"size-3.5"})})})}/** + * 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 Do(e,t){return typeof e=="function"?e(t):e}function gs(e,t){return n=>{t.setState(r=>({...r,[e]:Do(n,r[e])}))}}function _m(e){return e instanceof Function}function ste(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function ZI(e,t){const n=[],r=a=>{a.forEach(o=>{n.push(o);const l=t(o);l!=null&&l.length&&r(l)})};return r(e),n}function dt(e,t,n){let r=[],a;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 a;r=u;let f;if(n.key&&n.debug&&(f=Date.now()),a=t(...u),n==null||n.onChange==null||n.onChange(a),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,b=(x,w)=>{for(x=String(x);x.length{var a;return(a=e?.debugAll)!=null?a:e[t]},key:!1,onChange:r}}function ate(e,t,n,r){const a=()=>{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:a,getContext:dt(()=>[e,n,t,o],(l,u,d,f)=>({table:l,column:u,row:d,cell:f,getValue:f.getValue,renderValue:f.renderValue}),ft(e.options,"debugCells"))};return e._features.forEach(l=>{l.createCell==null||l.createCell(o,n,t,e)},{}),o}function ote(e,t,n,r){var a,o;const u={...e._getDefaultColumnDef(),...t},d=u.accessorKey;let f=(a=(o=u.id)!=null?o:d?typeof String.prototype.replaceAll=="function"?d.replaceAll(".","_"):d.replace(/\./g,"_"):void 0)!=null?a:typeof u.header=="string"?u.header:void 0,h;if(u.accessorFn?h=u.accessorFn:d&&(d.includes(".")?h=g=>{let b=g;for(const w of d.split(".")){var x;b=(x=b)==null?void 0:x[w]}return b}:h=g=>g[u.accessorKey]),!f)throw new Error;let m={id:`${String(f)}`,accessorFn:h,parent:r,depth:n,columnDef:u,columns:[],getFlatColumns:dt(()=>[!0],()=>{var g;return[m,...(g=m.columns)==null?void 0:g.flatMap(b=>b.getFlatColumns())]},ft(e.options,"debugColumns")),getLeafColumns:dt(()=>[e._getOrderColumnsFn()],g=>{var b;if((b=m.columns)!=null&&b.length){let x=m.columns.flatMap(w=>w.getLeafColumns());return g(x)}return[m]},ft(e.options,"debugColumns"))};for(const g of e._features)g.createColumn==null||g.createColumn(m,e);return m}const Er="debugHeaders";function CE(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 ite={createTable:e=>{e.getHeaderGroups=dt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,a)=>{var o,l;const u=(o=r?.map(m=>n.find(g=>g.id===m)).filter(Boolean))!=null?o:[],d=(l=a?.map(m=>n.find(g=>g.id===m)).filter(Boolean))!=null?l:[],f=n.filter(m=>!(r!=null&&r.includes(m.id))&&!(a!=null&&a.includes(m.id)));return ip(t,[...u,...f,...d],e)},ft(e.options,Er)),e.getCenterHeaderGroups=dt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,a)=>(n=n.filter(o=>!(r!=null&&r.includes(o.id))&&!(a!=null&&a.includes(o.id))),ip(t,n,e,"center")),ft(e.options,Er)),e.getLeftHeaderGroups=dt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var a;const o=(a=r?.map(l=>n.find(u=>u.id===l)).filter(Boolean))!=null?a:[];return ip(t,o,e,"left")},ft(e.options,Er)),e.getRightHeaderGroups=dt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var a;const o=(a=r?.map(l=>n.find(u=>u.id===l)).filter(Boolean))!=null?a:[];return ip(t,o,e,"right")},ft(e.options,Er)),e.getFooterGroups=dt(()=>[e.getHeaderGroups()],t=>[...t].reverse(),ft(e.options,Er)),e.getLeftFooterGroups=dt(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),ft(e.options,Er)),e.getCenterFooterGroups=dt(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),ft(e.options,Er)),e.getRightFooterGroups=dt(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),ft(e.options,Er)),e.getFlatHeaders=dt(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),ft(e.options,Er)),e.getLeftFlatHeaders=dt(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),ft(e.options,Er)),e.getCenterFlatHeaders=dt(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),ft(e.options,Er)),e.getRightFlatHeaders=dt(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),ft(e.options,Er)),e.getCenterLeafHeaders=dt(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ft(e.options,Er)),e.getLeftLeafHeaders=dt(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ft(e.options,Er)),e.getRightLeafHeaders=dt(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ft(e.options,Er)),e.getLeafHeaders=dt(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var a,o,l,u,d,f;return[...(a=(o=t[0])==null?void 0:o.headers)!=null?a:[],...(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()},ft(e.options,Er))}};function ip(e,t,n,r){var a,o;let l=0;const u=function(g,b){b===void 0&&(b=1),l=Math.max(l,b),g.filter(x=>x.getIsVisible()).forEach(x=>{var w;(w=x.columns)!=null&&w.length&&u(x.columns,b+1)},0)};u(e);let d=[];const f=(g,b)=>{const x={depth:b,id:[r,`${b}`].filter(Boolean).join("_"),headers:[]},w=[];g.forEach(C=>{const k=[...w].reverse()[0],N=C.column.depth===x.depth;let T,_=!1;if(N&&C.column.parent?T=C.column.parent:(T=C.column,_=!0),k&&k?.column===T)k.subHeaders.push(C);else{const P=CE(n,T,{id:[r,b,T.id,C?.id].filter(Boolean).join("_"),isPlaceholder:_,placeholderId:_?`${w.filter(M=>M.column===T).length}`:void 0,depth:b,index:w.length});P.subHeaders.push(C),w.push(P)}x.headers.push(C),C.headerGroup=x}),d.push(x),b>0&&f(w,b-1)},h=t.map((g,b)=>CE(n,g,{depth:l,index:b}));f(h,l-1),d.reverse();const m=g=>g.filter(x=>x.column.getIsVisible()).map(x=>{let w=0,C=0,k=[0];x.subHeaders&&x.subHeaders.length?(k=[],m(x.subHeaders).forEach(T=>{let{colSpan:_,rowSpan:P}=T;w+=_,k.push(P)})):w=1;const N=Math.min(...k);return C=C+N,x.colSpan=w,x.rowSpan=C,{colSpan:w,rowSpan:C}});return m((a=(o=d[0])==null?void 0:o.headers)!=null?a:[]),d}const Pm=(e,t,n,r,a,o,l)=>{let u={id:t,index:r,original:n,depth:a,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:()=>ZI(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:dt(()=>[e.getAllLeafColumns()],d=>d.map(f=>ate(e,u,f,f.id)),ft(e.options,"debugRows")),_getAllCellsByColumnId:dt(()=>[u.getAllCells()],d=>d.reduce((f,h)=>(f[h.column.id]=h,f),{}),ft(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()}}},XI=(e,t,n)=>{var r;const a=n.toLowerCase();return!!(!((r=e.getValue(t))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(a))};XI.autoRemove=e=>Xs(e);const eO=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};eO.autoRemove=e=>Xs(e);const tO=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};tO.autoRemove=e=>Xs(e);const nO=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};nO.autoRemove=e=>Xs(e)||!(e!=null&&e.length);const rO=(e,t,n)=>!n.some(r=>{var a;return!((a=e.getValue(t))!=null&&a.includes(r))});rO.autoRemove=e=>Xs(e)||!(e!=null&&e.length);const sO=(e,t,n)=>n.some(r=>{var a;return(a=e.getValue(t))==null?void 0:a.includes(r)});sO.autoRemove=e=>Xs(e)||!(e!=null&&e.length);const aO=(e,t,n)=>e.getValue(t)===n;aO.autoRemove=e=>Xs(e);const oO=(e,t,n)=>e.getValue(t)==n;oO.autoRemove=e=>Xs(e);const Bw=(e,t,n)=>{let[r,a]=n;const o=e.getValue(t);return o>=r&&o<=a};Bw.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,a=typeof n!="number"?parseFloat(n):n,o=t===null||Number.isNaN(r)?-1/0:r,l=n===null||Number.isNaN(a)?1/0:a;if(o>l){const u=o;o=l,l=u}return[o,l]};Bw.autoRemove=e=>Xs(e)||Xs(e[0])&&Xs(e[1]);const La={includesString:XI,includesStringSensitive:eO,equalsString:tO,arrIncludes:nO,arrIncludesAll:rO,arrIncludesSome:sO,equals:aO,weakEquals:oO,inNumberRange:Bw};function Xs(e){return e==null||e===""}const cte={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:gs("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"?La.includesString:typeof r=="number"?La.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?La.equals:Array.isArray(r)?La.arrIncludes:La.weakEquals},e.getFilterFn=()=>{var n,r;return _m(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:La[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,a;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((a=t.options.enableFilters)!=null?a:!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(a=>a.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const a=e.getFilterFn(),o=r?.find(h=>h.id===e.id),l=Do(n,o?o.value:void 0);if(jE(a,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=a=>{var o;return(o=Do(t,a))==null?void 0:o.filter(l=>{const u=n.find(d=>d.id===l.id);if(u){const d=u.getFilterFn();if(jE(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 jE(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const ute=(e,t,n)=>n.reduce((r,a)=>{const o=a.getValue(e);return r+(typeof o=="number"?o:0)},0),dte=(e,t,n)=>{let r;return n.forEach(a=>{const o=a.getValue(e);o!=null&&(r>o||r===void 0&&o>=o)&&(r=o)}),r},fte=(e,t,n)=>{let r;return n.forEach(a=>{const o=a.getValue(e);o!=null&&(r=o)&&(r=o)}),r},pte=(e,t,n)=>{let r,a;return n.forEach(o=>{const l=o.getValue(e);l!=null&&(r===void 0?l>=l&&(r=a=l):(r>l&&(r=l),a{let n=0,r=0;if(t.forEach(a=>{let o=a.getValue(e);o!=null&&(o=+o)>=o&&(++n,r+=o)}),n)return r/n},mte=(e,t)=>{if(!t.length)return;const n=t.map(o=>o.getValue(e));if(!ste(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),a=n.sort((o,l)=>o-l);return n.length%2!==0?a[r]:(a[r-1]+a[r])/2},gte=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),vte=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,yte=(e,t)=>t.length,Dy={sum:ute,min:dte,max:fte,extent:pte,mean:hte,median:mte,unique:gte,uniqueCount:vte,count:yte},xte={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:gs("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 _m(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 a;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((a=n.subRows)!=null&&a.length)}}};function bte(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 wte={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:gs("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=dt(n=>[ed(t,n)],n=>n.findIndex(r=>r.id===e.id),ft(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=ed(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const a=ed(t,n);return((r=a[a.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=dt(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>a=>{let o=[];if(!(t!=null&&t.length))o=a;else{const l=[...t],u=[...a];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 bte(o,n,r)},ft(e.options,"debugTable"))}},Fy=()=>({left:[],right:[]}),Ste={getInitialState:e=>({columnPinning:Fy(),...e}),getDefaultOptions:e=>({onColumnPinningChange:gs("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(a=>a.id).filter(Boolean);t.setColumnPinning(a=>{var o,l;if(n==="right"){var u,d;return{left:((u=a?.left)!=null?u:[]).filter(m=>!(r!=null&&r.includes(m))),right:[...((d=a?.right)!=null?d:[]).filter(m=>!(r!=null&&r.includes(m))),...r]}}if(n==="left"){var f,h;return{left:[...((f=a?.left)!=null?f:[]).filter(m=>!(r!=null&&r.includes(m))),...r],right:((h=a?.right)!=null?h:[]).filter(m=>!(r!=null&&r.includes(m)))}}return{left:((o=a?.left)!=null?o:[]).filter(m=>!(r!=null&&r.includes(m))),right:((l=a?.right)!=null?l:[]).filter(m=>!(r!=null&&r.includes(m)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var a,o,l;return((a=r.columnDef.enablePinning)!=null?a:!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:a}=t.getState().columnPinning,o=n.some(u=>r?.includes(u)),l=n.some(u=>a?.includes(u));return o?"left":l?"right":!1},e.getPinnedIndex=()=>{var n,r;const a=e.getIsPinned();return a?(n=(r=t.getState().columnPinning)==null||(r=r[a])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=dt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,a)=>{const o=[...r??[],...a??[]];return n.filter(l=>!o.includes(l.column.id))},ft(t.options,"debugRows")),e.getLeftVisibleCells=dt(()=>[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"})),ft(t.options,"debugRows")),e.getRightVisibleCells=dt(()=>[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"})),ft(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 a,o;return!!((a=r.left)!=null&&a.length||(o=r.right)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=dt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(a=>a.id===r)).filter(Boolean),ft(e.options,"debugColumns")),e.getRightLeafColumns=dt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(a=>a.id===r)).filter(Boolean),ft(e.options,"debugColumns")),e.getCenterLeafColumns=dt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const a=[...n??[],...r??[]];return t.filter(o=>!a.includes(o.id))},ft(e.options,"debugColumns"))}},lp={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Ly=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Cte={getDefaultColumnDef:()=>lp,getInitialState:e=>({columnSizing:{},columnSizingInfo:Ly(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:gs("columnSizing",e),onColumnSizingInfoChange:gs("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,a;const o=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:lp.minSize,(r=o??e.columnDef.size)!=null?r:lp.size),(a=e.columnDef.maxSize)!=null?a:lp.maxSize)},e.getStart=dt(n=>[n,ed(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((a,o)=>a+o.getSize(),0),ft(t.options,"debugColumns")),e.getAfter=dt(n=>[n,ed(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((a,o)=>a+o.getSize(),0),ft(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...a}=n;return a})},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=a=>{if(a.subHeaders.length)a.subHeaders.forEach(r);else{var o;n+=(o=a.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),a=r?.getCanResize();return o=>{if(!r||!a||(o.persist==null||o.persist(),$y(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=$y(o)?Math.round(o.touches[0].clientX):o.clientX,f={},h=(k,N)=>{typeof N=="number"&&(t.setColumnSizingInfo(T=>{var _,P;const M=t.options.columnResizeDirection==="rtl"?-1:1,O=(N-((_=T?.startOffset)!=null?_:0))*M,D=Math.max(O/((P=T?.startSize)!=null?P:0),-.999999);return T.columnSizingStart.forEach(F=>{let[B,te]=F;f[B]=Math.round(Math.max(te+te*D,0)*100)/100}),{...T,deltaOffset:O,deltaPercentage:D}}),(t.options.columnResizeMode==="onChange"||k==="end")&&t.setColumnSizing(T=>({...T,...f})))},m=k=>h("move",k),g=k=>{h("end",k),t.setColumnSizingInfo(N=>({...N,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},b=n||typeof document<"u"?document:null,x={moveHandler:k=>m(k.clientX),upHandler:k=>{b?.removeEventListener("mousemove",x.moveHandler),b?.removeEventListener("mouseup",x.upHandler),g(k.clientX)}},w={moveHandler:k=>(k.cancelable&&(k.preventDefault(),k.stopPropagation()),m(k.touches[0].clientX),!1),upHandler:k=>{var N;b?.removeEventListener("touchmove",w.moveHandler),b?.removeEventListener("touchend",w.upHandler),k.cancelable&&(k.preventDefault(),k.stopPropagation()),g((N=k.touches[0])==null?void 0:N.clientX)}},C=jte()?{passive:!1}:!1;$y(o)?(b?.addEventListener("touchmove",w.moveHandler,C),b?.addEventListener("touchend",w.upHandler,C)):(b?.addEventListener("mousemove",x.moveHandler,C),b?.addEventListener("mouseup",x.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?Ly():(n=e.initialState.columnSizingInfo)!=null?n:Ly())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,a)=>r+a.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,a)=>r+a.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,a)=>r+a.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,a)=>r+a.getSize(),0))!=null?t:0}}};let cp=null;function jte(){if(typeof cp=="boolean")return cp;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 cp=e,cp}function $y(e){return e.type==="touchstart"}const kte={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:gs("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 a=e.columns;return(n=a.length?a.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=dt(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),ft(t.options,"debugRows")),e.getVisibleCells=dt(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,a)=>[...n,...r,...a],ft(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>dt(()=>[r(),r().filter(a=>a.getIsVisible()).map(a=>a.id).join("_")],a=>a.filter(o=>o.getIsVisible==null?void 0:o.getIsVisible()),ft(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((a,o)=>({...a,[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 ed(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const Ete={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()}}},Nte={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:gs("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,a,o;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((a=t.options.enableFilters)!=null?a:!0)&&((o=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?o:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>La.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return _m(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:La[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},Tte={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:gs("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,a;if(!t){e._queue(()=>{t=!0});return}if((r=(a=e.options.autoResetAll)!=null?a: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 a,o;e.setExpanded(r?{}:(a=(o=e.initialState)==null?void 0:o.expanded)!=null?a:{})},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(a=>!a.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 a;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=(a=n)!=null?a:!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,a;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((a=e.subRows)!=null&&a.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()}}}},sb=0,ab=10,By=()=>({pageIndex:sb,pageSize:ab}),Mte={getInitialState:e=>({...e,pagination:{...By(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:gs("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,a;if(!t){e._queue(()=>{t=!0});return}if((r=(a=e.options.autoResetAll)!=null?a:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const a=o=>Do(r,o);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(a)},e.resetPagination=r=>{var a;e.setPagination(r?By():(a=e.initialState.pagination)!=null?a:By())},e.setPageIndex=r=>{e.setPagination(a=>{let o=Do(r,a.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)),{...a,pageIndex:o}})},e.resetPageIndex=r=>{var a,o;e.setPageIndex(r?sb:(a=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageIndex)!=null?a:sb)},e.resetPageSize=r=>{var a,o;e.setPageSize(r?ab:(a=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageSize)!=null?a:ab)},e.setPageSize=r=>{e.setPagination(a=>{const o=Math.max(1,Do(r,a.pageSize)),l=a.pageSize*a.pageIndex,u=Math.floor(l/o);return{...a,pageIndex:u,pageSize:o}})},e.setPageCount=r=>e.setPagination(a=>{var o;let l=Do(r,(o=e.options.pageCount)!=null?o:-1);return typeof l=="number"&&(l=Math.max(-1,l)),{...a,pageCount:l}}),e.getPageOptions=dt(()=>[e.getPageCount()],r=>{let a=[];return r&&r>0&&(a=[...new Array(r)].fill(null).map((o,l)=>l)),a},ft(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,a=e.getPageCount();return a===-1?!0:a===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}}},zy=()=>({top:[],bottom:[]}),_te={getInitialState:e=>({rowPinning:zy(),...e}),getDefaultOptions:e=>({onRowPinningChange:gs("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,a)=>{const o=r?e.getLeafRows().map(d=>{let{id:f}=d;return f}):[],l=a?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 b,x;return{top:[...((b=d?.top)!=null?b:[]).filter(w=>!(u!=null&&u.has(w))),...Array.from(u)],bottom:((x=d?.bottom)!=null?x:[]).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:a}=t.options;return typeof r=="function"?r(e):(n=r??a)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:a}=t.getState().rowPinning,o=n.some(u=>r?.includes(u)),l=n.some(u=>a?.includes(u));return o?"top":l?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const a=e.getIsPinned();if(!a)return-1;const o=(n=a==="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?zy():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:zy())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var a,o;return!!((a=r.top)!=null&&a.length||(o=r.bottom)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var a;return((a=e.options.keepPinnedRows)==null||a?(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=dt(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),ft(e.options,"debugRows")),e.getBottomRows=dt(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),ft(e.options,"debugRows")),e.getCenterRows=dt(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const a=new Set([...n??[],...r??[]]);return t.filter(o=>!a.has(o.id))},ft(e.options,"debugRows"))}},Pte={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:gs("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},a=e.getPreGroupedRowModel().flatRows;return t?a.forEach(o=>{o.getCanSelect()&&(r[o.id]=!0)}):a.forEach(o=>{delete r[o.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),a={...n};return e.getRowModel().rows.forEach(o=>{ob(a,o.id,r,!0,e)}),a}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=dt(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Uy(e,n):{rows:[],flatRows:[],rowsById:{}},ft(e.options,"debugTable")),e.getFilteredSelectedRowModel=dt(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Uy(e,n):{rows:[],flatRows:[],rowsById:{}},ft(e.options,"debugTable")),e.getGroupedSelectedRowModel=dt(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Uy(e,n):{rows:[],flatRows:[],rowsById:{}},ft(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(a=>a.getCanSelect()&&!n[a.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(a=>a.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(a=>!n[a.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 a=e.getIsSelected();t.setRowSelection(o=>{var l;if(n=typeof n<"u"?n:!a,e.getCanSelect()&&a===n)return o;const u={...o};return ob(u,e.id,n,(l=r?.selectChildren)!=null?l:!0,t),u})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return zw(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return ib(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return ib(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 a;n&&e.toggleSelected((a=r.target)==null?void 0:a.checked)}}}},ob=(e,t,n,r,a)=>{var o;const l=a.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=>ob(e,u.id,n,r,a))};function Uy(e,t){const n=e.getState().rowSelection,r=[],a={},o=function(l,u){return l.map(d=>{var f;const h=zw(d,n);if(h&&(r.push(d),a[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:a}}function zw(e,t){var n;return(n=t[e.id])!=null?n:!1}function ib(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let a=!0,o=!1;return e.subRows.forEach(l=>{if(!(o&&!a)&&(l.getCanSelect()&&(zw(l,t)?o=!0:a=!1),l.subRows&&l.subRows.length)){const u=ib(l,t);u==="all"?o=!0:(u==="some"&&(o=!0),a=!1)}}),a?"all":o?"some":!1}const lb=/([0-9]+)/gm,Rte=(e,t,n)=>iO(Wo(e.getValue(n)).toLowerCase(),Wo(t.getValue(n)).toLowerCase()),Ite=(e,t,n)=>iO(Wo(e.getValue(n)),Wo(t.getValue(n))),Ote=(e,t,n)=>Uw(Wo(e.getValue(n)).toLowerCase(),Wo(t.getValue(n)).toLowerCase()),Ate=(e,t,n)=>Uw(Wo(e.getValue(n)),Wo(t.getValue(n))),Dte=(e,t,n)=>{const r=e.getValue(n),a=t.getValue(n);return r>a?1:rUw(e.getValue(n),t.getValue(n));function Uw(e,t){return e===t?0:e>t?1:-1}function Wo(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function iO(e,t){const n=e.split(lb).filter(Boolean),r=t.split(lb).filter(Boolean);for(;n.length&&r.length;){const a=n.shift(),o=r.shift(),l=parseInt(a,10),u=parseInt(o,10),d=[l,u].sort();if(isNaN(d[0])){if(a>o)return 1;if(o>a)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 zu={alphanumeric:Rte,alphanumericCaseSensitive:Ite,text:Ote,textCaseSensitive:Ate,datetime:Dte,basic:Fte},Lte={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:gs("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const a of n){const o=a?.getValue(e.id);if(Object.prototype.toString.call(o)==="[object Date]")return zu.datetime;if(typeof o=="string"&&(r=!0,o.split(lb).length>1))return zu.alphanumeric}return r?zu.text:zu.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 _m(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:zu[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const a=e.getNextSortingOrder(),o=typeof n<"u"&&n!==null;t.setSorting(l=>{const u=l?.find(b=>b.id===e.id),d=l?.findIndex(b=>b.id===e.id);let f=[],h,m=o?n:a==="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||a||(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(b=>b.id===e.id?{...b,desc:m}:b):h==="remove"?f=l.filter(b=>b.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,a;const o=e.getFirstSortDir(),l=e.getIsSorted();return l?l!==o&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(a=t.options.enableMultiRemove)!=null)||a)?!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(a=>a.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(a=>a.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())}},$te=[ite,kte,wte,Ste,lte,cte,Ete,Nte,Lte,xte,Tte,Mte,_te,Pte,Cte];function Bte(e){var t,n;const r=[...$te,...(t=e._features)!=null?t:[]];let a={_features:r};const o=a._features.reduce((g,b)=>Object.assign(g,b.getDefaultOptions==null?void 0:b.getDefaultOptions(a)),{}),l=g=>a.options.mergeOptions?a.options.mergeOptions(o,g):{...o,...g};let d={...{},...(n=e.initialState)!=null?n:{}};a._features.forEach(g=>{var b;d=(b=g.getInitialState==null?void 0:g.getInitialState(d))!=null?b: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(b=>setTimeout(()=>{throw b})))},reset:()=>{a.setState(a.initialState)},setOptions:g=>{const b=Do(g,a.options);a.options=l(b)},getState:()=>a.options.state,setState:g=>{a.options.onStateChange==null||a.options.onStateChange(g)},_getRowId:(g,b,x)=>{var w;return(w=a.options.getRowId==null?void 0:a.options.getRowId(g,b,x))!=null?w:`${x?[x.id,b].join("."):b}`},getCoreRowModel:()=>(a._getCoreRowModel||(a._getCoreRowModel=a.options.getCoreRowModel(a)),a._getCoreRowModel()),getRowModel:()=>a.getPaginationRowModel(),getRow:(g,b)=>{let x=(b?a.getPrePaginationRowModel():a.getRowModel()).rowsById[g];if(!x&&(x=a.getCoreRowModel().rowsById[g],!x))throw new Error;return x},_getDefaultColumnDef:dt(()=>[a.options.defaultColumn],g=>{var b;return g=(b=g)!=null?b:{},{header:x=>{const w=x.header.column.columnDef;return w.accessorKey?w.accessorKey:w.accessorFn?w.id:null},cell:x=>{var w,C;return(w=(C=x.renderValue())==null||C.toString==null?void 0:C.toString())!=null?w:null},...a._features.reduce((x,w)=>Object.assign(x,w.getDefaultColumnDef==null?void 0:w.getDefaultColumnDef()),{}),...g}},ft(e,"debugColumns")),_getColumnDefs:()=>a.options.columns,getAllColumns:dt(()=>[a._getColumnDefs()],g=>{const b=function(x,w,C){return C===void 0&&(C=0),x.map(k=>{const N=ote(a,k,C,w),T=k;return N.columns=T.columns?b(T.columns,N,C+1):[],N})};return b(g)},ft(e,"debugColumns")),getAllFlatColumns:dt(()=>[a.getAllColumns()],g=>g.flatMap(b=>b.getFlatColumns()),ft(e,"debugColumns")),_getAllFlatColumnsById:dt(()=>[a.getAllFlatColumns()],g=>g.reduce((b,x)=>(b[x.id]=x,b),{}),ft(e,"debugColumns")),getAllLeafColumns:dt(()=>[a.getAllColumns(),a._getOrderColumnsFn()],(g,b)=>{let x=g.flatMap(w=>w.getLeafColumns());return b(x)},ft(e,"debugColumns")),getColumn:g=>a._getAllFlatColumnsById()[g]};Object.assign(a,m);for(let g=0;gdt(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(a,o,l){o===void 0&&(o=0);const u=[];for(let f=0;fe._autoResetPageIndex()))}function Ute(e,t,n){return n.options.filterFromLeafRows?Vte(e,t,n):qte(e,t,n)}function Vte(e,t,n){var r;const a=[],o={},l=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,u=function(d,f){f===void 0&&(f=0);const h=[];for(let g=0;gdt(()=>[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 b;const x=e.getColumn(g.id);if(!x)return;const w=x.getFilterFn();w&&a.push({id:g.id,filterFn:w,resolvedValue:(b=w.resolveFilterValue==null?void 0:w.resolveFilterValue(g.value))!=null?b: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 b;o.push({id:g.id,filterFn:u,resolvedValue:(b=u.resolveFilterValue==null?void 0:u.resolveFilterValue(r))!=null?b:r})}));let f,h;for(let g=0;g{b.columnFiltersMeta[w]=C})}if(o.length){for(let x=0;x{b.columnFiltersMeta[w]=C})){b.columnFilters.__global__=!0;break}}b.columnFilters.__global__!==!0&&(b.columnFilters.__global__=!1)}}const m=g=>{for(let b=0;be._autoResetPageIndex()))}function Wte(){return e=>dt(()=>[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)),a=[],o={},l=function(d,f,h){if(f===void 0&&(f=0),f>=r.length)return d.map(x=>(x.depth=f,a.push(x),o[x.id]=x,x.subRows&&(x.subRows=l(x.subRows,f+1,x.id)),x));const m=r[f],g=Kte(d,m);return Array.from(g.entries()).map((x,w)=>{let[C,k]=x,N=`${m}:${C}`;N=h?`${h}>${N}`:N;const T=l(k,f+1,N);T.forEach(M=>{M.parentId=N});const _=f?ZI(k,M=>M.subRows):k,P=Pm(e,N,_[0].original,w,f,void 0,h);return Object.assign(P,{groupingColumnId:m,groupingValue:C,subRows:T,leafRows:_,getValue:M=>{if(r.includes(M)){if(P._valuesCache.hasOwnProperty(M))return P._valuesCache[M];if(k[0]){var O;P._valuesCache[M]=(O=k[0].getValue(M))!=null?O:void 0}return P._valuesCache[M]}if(P._groupingValuesCache.hasOwnProperty(M))return P._groupingValuesCache[M];const D=e.getColumn(M),F=D?.getAggregationFn();if(F)return P._groupingValuesCache[M]=F(M,_,k),P._groupingValuesCache[M]}}),T.forEach(M=>{a.push(M),o[M.id]=M}),P})},u=l(n.rows,0);return u.forEach(d=>{a.push(d),o[d.id]=d}),{rows:u,flatRows:a,rowsById:o}},ft(e.options,"debugTable","getGroupedRowModel",()=>{e._queue(()=>{e._autoResetExpanded(),e._autoResetPageIndex()})}))}function Kte(e,t){const n=new Map;return e.reduce((r,a)=>{const o=`${a.getGroupingValue(t)}`,l=r.get(o);return l?l.push(a):r.set(o,[a]),r},n)}function Gte(){return e=>dt(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,a=[],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 b=0;b{var m;a.push(h),(m=h.subRows)!=null&&m.length&&(h.subRows=u(h.subRows))}),f};return{rows:u(n.rows),flatRows:a,rowsById:n.rowsById}},ft(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 kE(e,t){return e?Jte(e)?v.createElement(e,t):e:null}function Jte(e){return Qte(e)||typeof e=="function"||Yte(e)}function Qte(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Yte(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Zte(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=v.useState(()=>({current:Bte(t)})),[r,a]=v.useState(()=>n.current.initialState);return n.current.setOptions(o=>({...o,...e,state:{...r,...e.state},onStateChange:l=>{a(l),e.onStateChange==null||e.onStateChange(l)}})),n.current}function Xte({className:e,...t}){return s.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:s.jsx("table",{"data-slot":"table",className:Et("w-full caption-bottom text-sm",e),...t})})}function ene({className:e,...t}){return s.jsx("thead",{"data-slot":"table-header",className:Et("[&_tr]:border-b",e),...t})}function tne({className:e,...t}){return s.jsx("tbody",{"data-slot":"table-body",className:Et("[&_tr:last-child]:border-0",e),...t})}function up({className:e,...t}){return s.jsx("tr",{"data-slot":"table-row",className:Et("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function nne({className:e,...t}){return s.jsx("th",{"data-slot":"table-head",className:Et("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function Vy({className:e,...t}){return s.jsx("td",{"data-slot":"table-cell",className:Et("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function ci({columns:e,data:t,isLoading:n,loadingMessage:r,noResultsMessage:a,enableHeaders:o=!0,className:l,highlightedRows:u,...d}){const{t:f}=Le(),h=Zte({...d,data:t,columns:e,getCoreRowModel:zte(),getFilteredRowModel:Hte(),getGroupedRowModel:Wte(),getSortedRowModel:Gte()});return s.jsx("div",{className:ln("rounded-md border",l),children:s.jsxs(Xte,{children:[o&&s.jsx(ene,{children:h.getHeaderGroups().map(m=>s.jsx(up,{children:m.headers.map(g=>s.jsx(nne,{children:g.isPlaceholder?null:kE(g.column.columnDef.header,g.getContext())},g.id))},m.id))}),s.jsx(tne,{children:n?s.jsx(up,{children:s.jsx(Vy,{colSpan:e.length,className:"h-24 text-center text-muted-foreground",children:r??f("table.loading")})}):s.jsx(s.Fragment,{children:h.getRowModel().rows?.length?h.getRowModel().rows.map(m=>s.jsx(up,{"data-state":m.getIsSelected()?"selected":u?.includes(m.id)?"highlighted":"",children:m.getVisibleCells().map(g=>s.jsx(Vy,{children:kE(g.column.columnDef.cell,g.getContext())},g.id))},m.id)):s.jsx(up,{children:s.jsx(Vy,{colSpan:e.length,className:"h-24 text-center",children:a??f("table.noResults")})})})})]})})}const rne=e=>["dify","fetchSessions",JSON.stringify(e)],sne=async({difyId:e,instanceName:t})=>(await Ce.get(`/dify/fetchSessions/${e}/${t}`)).data,ane=e=>{const{difyId:t,instanceName:n,...r}=e;return pt({...r,queryKey:rne({difyId:t,instanceName:n}),queryFn:()=>sne({difyId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0),staleTime:1e3*10})},dp={name:"",number:"",status:"all",time:"all",customCondition:"more",customValue:"",customUnit:"minutes"};function one(e,t){const n=parseInt(e);return!n||isNaN(n)||n<=0?null:t==="hours"?n*60:t==="days"?n*1440:n}function ine(e,t){if(t.time==="all")return!0;const n=(Date.now()-new Date(e).getTime())/6e4;if(t.time==="custom"){const r=one(t.customValue,t.customUnit);return r===null?!0:t.customCondition==="more"?n>r:n<=r}if(t.time.startsWith(">")){const r=parseInt(t.time.slice(1));return n>r}return n<=parseInt(t.time)}function lO({difyId:e}){const{t}=Le(),{instance:n}=ct(),{changeStatusDify:r}=Tm(),[a,o]=v.useState(!1),[l,u]=v.useState([]),[d,f]=v.useState({}),[h,m]=v.useState(dp),[g,b]=v.useState(dp),[x,w]=v.useState(9),[C,k]=v.useState(9),[N,T]=v.useState("opened"),[_,P]=v.useState(!1),[M,O]=v.useState(""),[D,F]=v.useState(""),[B,te]=v.useState(!1),{data:U,refetch:ce}=ane({instanceName:n?.name,difyId:e,enabled:a}),q=v.useMemo(()=>{const j=U??[],I=g.name.trim().toLowerCase(),me=g.number.trim();return j.filter(be=>!(I&&!be.pushName?.toLowerCase().includes(I)||me&&!be.remoteJid.includes(me)||g.status!=="all"&&be.status!==g.status||!ine(be.updatedAt,g)))},[U,g]),ne=q.slice(0,C),Y=v.useMemo(()=>Object.keys(d).filter(j=>d[j]).map(j=>ne[Number(j)]?.remoteJid).filter(Boolean),[d,ne]);v.useEffect(()=>{k(x),f({})},[g,x]);const se=()=>{ce()},H=()=>{b(h)},W=()=>{m(dp),b(dp)},V=async(j,I)=>{try{if(!n)return;await r({instanceName:n.name,token:n.token,remoteJid:j,status:I}),Q.success(t("dify.toast.success.status")),se()}catch(me){console.error("Error:",me),Q.error(`Error : ${me?.response?.data?.response?.message}`)}},A=async()=>{if(Y.length===0){Q.error(t("sessions.mass.noneSelected"));return}try{if(!n)return;await Promise.all(Y.map(j=>r({instanceName:n.name,token:n.token,remoteJid:j,status:N}))),Q.success(t("sessions.mass.success")),f({}),se()}catch(j){console.error(j),Q.error(j?.response?.data?.response?.message??t("sessions.mass.error"))}},K=j=>{O(j),F(""),P(!0)},re=async()=>{if(!D.trim()){Q.error(t("sessions.send.empty"));return}try{if(!n)return;te(!0),await Ce.post(`/message/sendText/${n.name}`,{number:M,text:D},{headers:{apikey:n.token}}),Q.success(t("sessions.send.success")),P(!1),F(""),O("")}catch(j){console.error("Error:",j),Q.error(j?.response?.data?.response?.message??j?.message??t("sessions.send.error"))}finally{te(!1)}},ee=[{id:"select",header:({table:j})=>s.jsx(ts,{checked:j.getIsAllPageRowsSelected()||j.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:I=>j.toggleAllPageRowsSelected(!!I),"aria-label":t("sessions.mass.selectAll")}),cell:({row:j})=>s.jsx(ts,{checked:j.getIsSelected(),onCheckedChange:I=>j.toggleSelected(!!I),"aria-label":t("sessions.mass.selectAll")}),enableSorting:!1},{accessorKey:"remoteJid",header:()=>s.jsx("div",{className:"text-center",children:t("dify.sessions.table.remoteJid")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>s.jsx("div",{className:"text-center",children:t("dify.sessions.table.pushName")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("pushName")})},{accessorKey:"sessionId",header:()=>s.jsx("div",{className:"text-center",children:t("dify.sessions.table.sessionId")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("sessionId")})},{accessorKey:"status",header:()=>s.jsx("div",{className:"text-center",children:t("dify.sessions.table.status")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:j})=>{const I=j.original;return s.jsxs(vs,{children:[s.jsx(ys,{asChild:!0,children:s.jsxs($,{variant:"ghost",size:"icon",children:[s.jsx("span",{className:"sr-only",children:t("dify.sessions.table.actions.title")}),s.jsx(Xo,{className:"h-4 w-4"})]})}),s.jsxs(xs,{align:"end",children:[s.jsx(ei,{children:t("dify.sessions.table.actions.title")}),s.jsx(ti,{}),I.status!=="opened"&&s.jsxs(Ct,{onClick:()=>V(I.remoteJid,"opened"),children:[s.jsx(al,{className:"mr-2 h-4 w-4"}),t("dify.sessions.table.actions.open")]}),I.status!=="paused"&&I.status!=="closed"&&s.jsxs(Ct,{onClick:()=>V(I.remoteJid,"paused"),children:[s.jsx(sl,{className:"mr-2 h-4 w-4"}),t("dify.sessions.table.actions.pause")]}),I.status!=="closed"&&s.jsxs(Ct,{onClick:()=>V(I.remoteJid,"closed"),children:[s.jsx(el,{className:"mr-2 h-4 w-4"}),t("dify.sessions.table.actions.close")]}),s.jsxs(Ct,{onClick:()=>K(I.remoteJid),children:[s.jsx(rl,{className:"mr-2 h-4 w-4"}),t("sessions.actions.sendMessage")]}),s.jsxs(Ct,{onClick:()=>V(I.remoteJid,"delete"),children:[s.jsx(tl,{className:"mr-2 h-4 w-4"}),t("dify.sessions.table.actions.delete")]})]})]})}}],ie=["all","5","10","15","20","30","60",">60",">120",">300",">1440","custom"],ue=["all","opened","paused","closed"];return s.jsxs(vt,{open:a,onOpenChange:o,children:[s.jsx(an,{asChild:!0,children:s.jsxs($,{variant:"secondary",size:"sm",children:[s.jsx(nl,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden md:inline",children:t("dify.sessions.label")})]})}),s.jsxs(mt,{className:"max-w-7xl h-[85vh] flex flex-col overflow-hidden",children:[s.jsx(gt,{children:s.jsx(xt,{children:t("dify.sessions.label")})}),s.jsxs("div",{className:"flex-1 space-y-4 overflow-y-auto pr-2",children:[s.jsxs(Un,{children:[s.jsx(Yn,{children:s.jsx(Zn,{className:"text-base",children:t("sessions.filters.title")})}),s.jsxs(Vn,{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.name")}),s.jsx(Z,{placeholder:t("sessions.filters.namePlaceholder"),value:h.name,onChange:j=>m(I=>({...I,name:j.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.number")}),s.jsx(Z,{placeholder:t("sessions.filters.numberPlaceholder"),value:h.number,onChange:j=>m(I=>({...I,number:j.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.status")}),s.jsxs(_t,{value:h.status,onValueChange:j=>m(I=>({...I,status:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsx(It,{children:ue.map(j=>s.jsx(we,{value:j,children:t(`sessions.filters.statusOptions.${j}`)},j))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.time")}),s.jsxs(_t,{value:h.time,onValueChange:j=>m(I=>({...I,time:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsx(It,{children:ie.map(j=>s.jsx(we,{value:j,children:t(`sessions.filters.timeOptions.${j}`)},j))})]})]})]}),h.time==="custom"&&s.jsxs("div",{className:"grid grid-cols-1 gap-2 md:grid-cols-3",children:[s.jsxs(_t,{value:h.customCondition,onValueChange:j=>m(I=>({...I,customCondition:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"more",children:t("sessions.filters.custom.more")}),s.jsx(we,{value:"less",children:t("sessions.filters.custom.less")})]})]}),s.jsx(Z,{type:"number",min:1,placeholder:t("sessions.filters.custom.valuePlaceholder"),value:h.customValue,onChange:j=>m(I=>({...I,customValue:j.target.value}))}),s.jsxs(_t,{value:h.customUnit,onValueChange:j=>m(I=>({...I,customUnit:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"minutes",children:t("sessions.filters.custom.minutes")}),s.jsx(we,{value:"hours",children:t("sessions.filters.custom.hours")}),s.jsx(we,{value:"days",children:t("sessions.filters.custom.days")})]})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx($,{onClick:H,size:"sm",children:t("sessions.filters.apply")}),s.jsx($,{onClick:W,size:"sm",variant:"outline",children:t("sessions.filters.clear")}),s.jsxs($,{onClick:se,size:"sm",variant:"outline",children:[s.jsx(ol,{size:14,className:"mr-1"}),t("button.refresh")]})]})]})]}),Y.length>0&&s.jsxs(Un,{children:[s.jsx(Yn,{children:s.jsx(Zn,{className:"text-base",children:t("sessions.mass.title")})}),s.jsx(Vn,{children:s.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:t("sessions.mass.selected",{count:Y.length})}),s.jsxs("div",{className:"flex-1 min-w-[180px] space-y-1",children:[s.jsx(Ve,{children:t("sessions.mass.newStatus")}),s.jsxs(_t,{value:N,onValueChange:T,children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"opened",children:t("dify.sessions.table.actions.open")}),s.jsx(we,{value:"paused",children:t("dify.sessions.table.actions.pause")}),s.jsx(we,{value:"closed",children:t("dify.sessions.table.actions.close")}),s.jsx(we,{value:"delete",children:t("dify.sessions.table.actions.delete")})]})]})]}),s.jsx($,{onClick:A,size:"sm",children:t("sessions.mass.apply")})]})})]}),s.jsx(ci,{columns:ee,data:ne,onSortingChange:u,state:{sorting:l,rowSelection:d},onRowSelectionChange:f,enableRowSelection:!0,getRowId:(j,I)=>String(I),noResultsMessage:t("sessions.empty")}),s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 px-1 text-sm text-muted-foreground",children:[s.jsx("span",{children:t("sessions.pagination.showing",{shown:ne.length,total:q.length})}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(Ve,{htmlFor:"per-page",className:"text-xs",children:t("sessions.pagination.perPage")}),s.jsxs(_t,{value:String(x),onValueChange:j=>w(parseInt(j)),children:[s.jsx(Rt,{id:"per-page",className:"h-8 w-20",children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"9",children:"9"}),s.jsx(we,{value:"25",children:"25"}),s.jsx(we,{value:"50",children:"50"}),s.jsx(we,{value:"100",children:"100"})]})]}),Ck(j=>Math.min(j+x,q.length)),children:t("sessions.pagination.showMore")}),Ck(q.length),children:t("sessions.pagination.showAll")}),C>x&&s.jsx($,{size:"sm",variant:"outline",onClick:()=>k(x),children:t("sessions.pagination.showLess")})]})]})]}),s.jsx(vt,{open:_,onOpenChange:j=>!B&&P(j),children:s.jsxs(mt,{className:"sm:max-w-md",children:[s.jsx(gt,{children:s.jsx(xt,{children:t("sessions.send.title")})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{children:t("sessions.send.to")}),s.jsx(Z,{value:M,disabled:!0})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{children:t("sessions.send.messagePlaceholder")}),s.jsx(ni,{rows:4,placeholder:t("sessions.send.messagePlaceholder"),value:D,onChange:j=>F(j.target.value)})]})]}),s.jsxs(Kt,{children:[s.jsx($,{variant:"outline",onClick:()=>P(!1),disabled:B,children:t("button.cancel")}),s.jsx($,{onClick:re,disabled:B,children:t(B?"sessions.send.sending":"sessions.send.send")})]})]})})]})]})}const lne=fn({enabled:Me(),description:he(),botType:he(),apiUrl:he(),apiKey:he(),triggerType:he(),triggerOperator:he().optional(),triggerValue:he().optional(),expire:ot.number().optional(),keywordFinish:he().optional(),delayMessage:ot.number().optional(),unknownMessage:he().optional(),listeningFromMe:Me().optional(),stopBotFromMe:Me().optional(),keepOpen:Me().optional(),debounceTime:ot.number().optional(),splitMessages:Me().optional(),timePerChar:ot.number().optional()});function cO({initialData:e,onSubmit:t,handleDelete:n,difyId:r,isModal:a=!1,isLoading:o=!1,openDeletionDialog:l=!1,setOpenDeletionDialog:u=()=>{}}){const{t:d}=Le(),f=mn({resolver:gn(lne),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 s.jsx(yr,{...f,children:s.jsxs("form",{onSubmit:f.handleSubmit(t),className:"w-full space-y-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsx(Re,{name:"enabled",label:d("dify.form.enabled.label"),reverse:!0}),s.jsx(pe,{name:"description",label:d("dify.form.description.label"),required:!0,children:s.jsx(Z,{})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("dify.form.difySettings.label")}),s.jsx(Yt,{})]}),s.jsx(un,{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"}]}),s.jsx(pe,{name:"apiUrl",label:d("dify.form.apiUrl.label"),required:!0,children:s.jsx(Z,{})}),s.jsx(pe,{name:"apiKey",label:d("dify.form.apiKey.label"),required:!0,children:s.jsx(Z,{type:"password"})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("dify.form.triggerSettings.label")}),s.jsx(Yt,{})]}),s.jsx(un,{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"&&s.jsxs(s.Fragment,{children:[s.jsx(un,{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"}]}),s.jsx(pe,{name:"triggerValue",label:d("dify.form.triggerValue.label"),children:s.jsx(Z,{})})]}),h==="advanced"&&s.jsx(pe,{name:"triggerValue",label:d("dify.form.triggerConditions.label"),children:s.jsx(Z,{})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("dify.form.generalSettings.label")}),s.jsx(Yt,{})]}),s.jsx(pe,{name:"expire",label:d("dify.form.expire.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(pe,{name:"keywordFinish",label:d("dify.form.keywordFinish.label"),children:s.jsx(Z,{})}),s.jsx(pe,{name:"delayMessage",label:d("dify.form.delayMessage.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(pe,{name:"unknownMessage",label:d("dify.form.unknownMessage.label"),children:s.jsx(Z,{})}),s.jsx(Re,{name:"listeningFromMe",label:d("dify.form.listeningFromMe.label"),reverse:!0}),s.jsx(Re,{name:"stopBotFromMe",label:d("dify.form.stopBotFromMe.label"),reverse:!0}),s.jsx(Re,{name:"keepOpen",label:d("dify.form.keepOpen.label"),reverse:!0}),s.jsx(pe,{name:"debounceTime",label:d("dify.form.debounceTime.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(Re,{name:"splitMessages",label:d("dify.form.splitMessages.label"),reverse:!0}),f.watch("splitMessages")&&s.jsx(pe,{name:"timePerChar",label:d("dify.form.timePerChar.label"),children:s.jsx(Z,{type:"number"})})]}),a&&s.jsx(Kt,{children:s.jsx($,{disabled:o,type:"submit",children:d(o?"dify.button.saving":"dify.button.save")})}),!a&&s.jsxs("div",{children:[s.jsx(lO,{difyId:r}),s.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[s.jsxs(vt,{open:l,onOpenChange:u,children:[s.jsx(an,{asChild:!0,children:s.jsx($,{variant:"destructive",size:"sm",children:d("dify.button.delete")})}),s.jsx(mt,{children:s.jsxs(gt,{children:[s.jsx(xt,{children:d("modal.delete.title")}),s.jsx(gr,{children:d("modal.delete.messageSingle")}),s.jsxs(Kt,{children:[s.jsx($,{size:"sm",variant:"outline",onClick:()=>u(!1),children:d("button.cancel")}),s.jsx($,{variant:"destructive",onClick:n,children:d("button.delete")})]})]})})]}),s.jsx($,{disabled:o,type:"submit",children:d(o?"dify.button.saving":"dify.button.update")})]})]})]})})}function cne({resetTable:e}){const{t}=Le(),{instance:n}=ct(),[r,a]=v.useState(!1),[o,l]=v.useState(!1),{createDify:u}=Tm(),d=async f=>{try{if(!n||!n.name)throw new Error("instance not found");a(!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}),Q.success(t("dify.toast.success.create")),l(!1),e()}catch(h){console.error("Error:",h),Q.error(`Error: ${h?.response?.data?.response?.message}`)}finally{a(!1)}};return s.jsxs(vt,{open:o,onOpenChange:l,children:[s.jsx(an,{asChild:!0,children:s.jsxs($,{size:"sm",children:[s.jsx($r,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:t("dify.button.create")})]})}),s.jsxs(mt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[s.jsx(gt,{children:s.jsx(xt,{children:t("dify.form.title")})}),s.jsx(cO,{onSubmit:d,isModal:!0,isLoading:r})]})]})}const une=e=>["dify","getDify",JSON.stringify(e)],dne=async({difyId:e,instanceName:t})=>(await Ce.get(`/dify/fetch/${e}/${t}`)).data,fne=e=>{const{difyId:t,instanceName:n,...r}=e;return pt({...r,queryKey:une({difyId:t,instanceName:n}),queryFn:()=>dne({difyId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0)})};function pne({difyId:e,resetTable:t}){const{t:n}=Le(),{instance:r}=ct(),a=Nn(),[o,l]=v.useState(!1),{deleteDify:u,updateDify:d}=Tm(),{data:f,isLoading:h}=fne({difyId:e,instanceName:r?.name}),m=v.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 x=>{try{if(r&&r.name&&e){const w={enabled:x.enabled,description:x.description,botType:x.botType,apiUrl:x.apiUrl,apiKey:x.apiKey,triggerType:x.triggerType,triggerOperator:x.triggerOperator||"",triggerValue:x.triggerValue||"",expire:x.expire||0,keywordFinish:x.keywordFinish||"",delayMessage:x.delayMessage||1e3,unknownMessage:x.unknownMessage||"",listeningFromMe:x.listeningFromMe||!1,stopBotFromMe:x.stopBotFromMe||!1,keepOpen:x.keepOpen||!1,debounceTime:x.debounceTime||0,splitMessages:x.splitMessages||!1,timePerChar:x.timePerChar||0};await d({instanceName:r.name,difyId:e,data:w}),Q.success(n("dify.toast.success.update")),t(),a(`/manager/instance/${r.id}/dify/${e}`)}else console.error("Token not found")}catch(w){console.error("Error:",w),Q.error(`Error: ${w?.response?.data?.response?.message}`)}},b=async()=>{try{r&&r.name&&e?(await u({instanceName:r.name,difyId:e}),Q.success(n("dify.toast.success.delete")),l(!1),t(),a(`/manager/instance/${r.id}/dify`)):console.error("instance not found")}catch(x){console.error("Erro ao excluir dify:",x)}};return h?s.jsx(Hn,{}):s.jsx("div",{className:"m-4",children:s.jsx(cO,{initialData:m,onSubmit:g,difyId:e,handleDelete:b,isModal:!1,isLoading:h,openDeletionDialog:o,setOpenDeletionDialog:l})})}function EE(){const{t:e}=Le(),t=eo("(min-width: 768px)"),{instance:n}=ct(),{difyId:r}=Os(),{data:a,refetch:o,isLoading:l,error:u}=VI({instanceName:n?.name}),d=Nn(),f=m=>{n&&d(`/manager/instance/${n.id}/dify/${m}`)},h=()=>{o()};return s.jsx("main",{className:"pt-5",children:s.jsxs(ia,{error:u,name:"Dify",envVar:"DIFY_ENABLED",children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[s.jsx("h3",{className:"text-lg font-medium",children:e("dify.title")}),s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsx(lO,{}),s.jsx(Xee,{}),s.jsx(cne,{resetTable:h})]})]}),s.jsx(Yt,{className:"my-4"}),s.jsxs(ii,{direction:t?"horizontal":"vertical",children:[s.jsx(Mr,{defaultSize:r?35:100,className:"pr-4",children:s.jsx("div",{className:"flex flex-col gap-3",children:l?s.jsx(Hn,{}):s.jsx(s.Fragment,{children:a&&a.length>0&&Array.isArray(a)?a.map(m=>s.jsxs($,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>f(`${m.id}`),variant:r===m.id?"secondary":"outline",children:[s.jsx("h4",{className:"text-base",children:m.description||m.id}),s.jsx("p",{className:"text-sm font-normal text-muted-foreground",children:m.botType})]},m.id)):s.jsx($,{variant:"link",children:e("dify.table.none")})})})}),r&&s.jsxs(s.Fragment,{children:[s.jsx(li,{withHandle:!0,className:"border border-border"}),s.jsx(Mr,{children:s.jsx(pne,{difyId:r,resetTable:h})})]})]})]})})}const uO=v.createContext({instance:null,isLoading:!0,error:null});function hne({children:e}){const[t]=Sc(),[n,r]=v.useState(null),[a,o]=v.useState(!0),[l,u]=v.useState(null);return v.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(Fn.API_URL,g),localStorage.setItem(Fn.INSTANCE_TOKEN,f);const{data:b}=await dn.get(`${g}/instance/fetchInstances?instanceName=${h}`,{headers:{apikey:f}});console.log("API Response:",b),b&&Array.isArray(b)&&b.length>0?r(b[0]):u("Instância não encontrada")}catch{u("Erro ao validar token ou buscar instância")}finally{o(!1)}})()},[t]),s.jsx(uO.Provider,{value:{instance:n,isLoading:a,error:l},children:e})}const Vw=()=>v.useContext(uO),qw=v.createContext({}),mne=({children:e})=>{const[t,n]=v.useState(null);return s.jsx(qw.Provider,{value:{replyingMessage:t,setReplyingMessage:n},children:e})},gne=e=>{const t=Math.floor(e/60),n=e%60,r=t<10?`${t}`:t,a=n<10?`0${n}`:n;return`${r}:${a}`},NE=200,vne=({imageMessage:e})=>s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("img",{src:e?.mediaUrl,alt:"Quoted message",width:100,height:100}),s.jsx(dz,{className:"mr-2 h-4 w-4 text-muted-foreground"})]}),s.jsx("span",{className:"inline-block max-w-40 overflow-hidden overflow-ellipsis whitespace-nowrap text-sm text-muted-foreground",children:e.caption})]}),yne=({videoMessage:e})=>s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("img",{src:e?.mediaUrl,alt:"Quoted message",width:100,height:100}),s.jsx(Iz,{className:"mr-2 h-4 w-4 text-muted-foreground"})]}),s.jsx("span",{className:"inline-block max-w-40 overflow-hidden overflow-ellipsis whitespace-nowrap text-sm text-muted-foreground",children:e.caption})]}),xne=({audioMessage:e})=>s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(mM,{className:"h-6 w-6 text-muted-foreground"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:gne(e.seconds)})]}),s.jsx("span",{className:"inline-block max-w-40 overflow-hidden overflow-ellipsis whitespace-nowrap text-sm text-muted-foreground",children:e.fileName})]}),bne=({stickerMessage:e})=>s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("img",{src:e.mediaUrl,alt:"Sticker",width:100,height:100}),s.jsx(Mz,{className:"h-6 w-6 text-muted-foreground"})]}),wne=({documentMessage:e})=>s.jsx("div",{className:"flex flex-col gap-2",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ob,{className:"h-6 w-6 text-muted-foreground"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:e.fileName})]})}),Sne=({documentMessage:e})=>s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ob,{className:"h-6 w-6 text-muted-foreground"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:e.fileName})]}),s.jsx("span",{className:"inline-block max-w-40 overflow-hidden overflow-ellipsis whitespace-nowrap text-sm text-muted-foreground",children:e.caption})]}),Cne=({contactMessage:e})=>s.jsx("div",{className:"flex flex-col gap-2",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Zp,{className:"h-6 w-6 text-muted-foreground"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:e.displayName})]})}),jne=({locationMessage:e})=>s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(bz,{className:"h-6 w-6 text-muted-foreground"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:e.name})]}),s.jsx("span",{className:"inline-block max-w-40 text-sm text-muted-foreground",children:e.address})]}),kne=({conversation:e})=>s.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap text-sm text-muted-foreground",children:e.length>NE?`${e.substring(0,NE)}...`:e}),Ene=({chat:e})=>{const{replyingMessage:t,setReplyingMessage:n}=v.useContext(qw),r=()=>{n(null)},a=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 s.jsx(vne,{imageMessage:{caption:t?.message.imageMessage.caption,mediaUrl:t?.message.mediaUrl}});if(t?.messageType==="videoMessage")return s.jsx(yne,{videoMessage:{caption:t?.message.videoMessage.caption,mediaUrl:t?.message.mediaUrl}});if(t?.messageType==="audioMessage")return s.jsx(xne,{audioMessage:t?.message.audioMessage});if(t?.messageType==="stickerMessage")return s.jsx(bne,{stickerMessage:t?.message});if(t?.messageType==="documentMessage")return s.jsx(wne,{documentMessage:{name:t?.message.documentMessage.name,mediaUrl:t?.message.mediaUrl}});if(t?.messageType==="documentWithCaptionMessage")return s.jsx(Sne,{documentMessage:{name:t?.message.documentWithCaptionMessage.message.documentMessage.name,caption:t?.message.documentWithCaptionMessage.message.documentMessage.caption,mediaUrl:t?.message.mediaUrl}});if(t?.messageType==="contactMessage")return s.jsx(Cne,{contactMessage:t?.message.contactMessage});if(t?.messageType==="locationMessage")return s.jsx(jne,{locationMessage:t?.message.locationMessage});if(t?.messageType==="conversation"||t?.messageType==="interactiveMessage"||t?.messageType==="extendedTextMessage")return s.jsx(kne,{conversation:a(t?.message)})},{inputIconsMainColor:u,inputBackgroundColor:d}=oi();return s.jsxs("div",{className:"relative flex items-center overflow-hidden rounded-lg dark:text-white",style:{backgroundColor:d},children:[s.jsx("div",{className:`absolute h-full w-1 rounded-l-lg ${t?.key.fromMe?"bg-blue-700 dark:bg-blue-300":"bg-blue-100"}`}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2 p-2 pl-4",children:[s.jsx("span",{className:`text-sm font-bold ${t?.key.fromMe?"text-blue-700 dark:text-blue-300":"text-blue-600"}`,children:o()}),l()]}),s.jsx($,{size:"icon",variant:"ghost",className:"ml-auto h-10 w-10 shrink-0 rounded-full",onClick:r,style:{backgroundColor:d,color:u},children:s.jsx(Hh,{className:"h-6 w-6"})})]})},qy=[{name:"Smileys",icon:vM,emojis:["😀","😃","😄","😁","😆","😅","😂","🤣","😊","😇"]},{name:"Natureza",icon:q1,emojis:["🌿","🌱","🌳","🌴","🌵","🌷","🌸","🌹","🌺","🌻"]},{name:"Comida",icon:q1,emojis:["🍎","🍐","🍊","🍋","🍌","🍉","🍇","🍓","🍒","🍑"]},{name:"Atividades",icon:nz,emojis:["⚽️","🏀","🏈","⚾️","🎾","🏐","🏉","🎱","🏓","🏸"]},{name:"Viagem",icon:JB,emojis:["🚗","🚕","🚙","🚌","🚎","🏎","🚓","🚑","🚒","🚐"]},{name:"Objetos",icon:vz,emojis:["💡","🔦","🕯","🧳","⌛️","⏳","🌡","🧪","🧬","🔬"]},{name:"Símbolos",icon:iz,emojis:["❤️","🧡","💛","💚","💙","💜","🖤","🤍","🤎","💔"]}];function Nne({handleEmojiClick:e}){const{inputIconsMainColor:t}=oi(),n=r=>qy.find(o=>o.name===r)?.emojis||[];return s.jsxs(vs,{children:[s.jsx(ys,{asChild:!0,children:s.jsxs($,{type:"button",variant:"ghost",size:"icon",className:"rounded-full p-2",children:[s.jsx(vM,{className:"h-6 w-6",style:{color:t}}),s.jsx("span",{className:"sr-only",children:"Emojis"})]})}),s.jsx(xs,{className:"bg-background p-2",align:"end",children:s.jsxs(cw,{defaultValue:"Smileys",className:"w-full",children:[s.jsx(uw,{className:"grid grid-cols-8 gap-2",children:qy.map(r=>s.jsx(oh,{value:r.name,children:s.jsx(r.icon,{className:"h-5 w-5"})},r.name))}),qy.map(r=>s.jsx(ih,{value:r.name,children:s.jsx("div",{className:"grid grid-cols-8 gap-2",children:n(r.name).map((a,o)=>s.jsx($,{variant:"ghost",className:"h-12 p-2 text-2xl",onClick:()=>e(a),children:a},o))})},r.name))]})})]})}const Tne=({isSendingMessage:e,isRecording:t,audioBlob:n,elapsedTime:r,startRecording:a,stopRecording:o,clearRecording:l,sendAudioMessage:u,disabled:d})=>{const{inputIconsMainColor:f}=oi();return s.jsxs("div",{className:"flex items-center gap-2",children:[t&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx($,{type:"button",size:"icon",variant:"ghost",className:"rounded-full p-2",onClick:o,children:s.jsx(Tz,{className:"h-6 w-6 text-[#b03f3f]"})}),s.jsxs("span",{children:[r,"s"]})]}),n&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx($,{type:"button",size:"icon",variant:"ghost",className:"rounded-full p-2",disabled:e,onClick:l,children:s.jsx(Pz,{className:"h-6 w-6 text-[#b03f3f]"})}),s.jsx("audio",{controls:!0,src:URL.createObjectURL(n)})]}),s.jsx($,{type:"button",size:"icon",variant:"ghost",className:"rounded-full p-2",disabled:e||t||d,onClick:n?u:a,children:e?s.jsx(Hn,{className:"h-6 w-6",style:{color:f}}):n?s.jsx(Rb,{className:"h-6 w-6",style:{color:f}}):s.jsx(mM,{className:"h-6 w-6",style:{color:f}})})]})},Mne=({isSendingMessage:e,sendMessage:t,disabled:n})=>{const{inputIconsMainColor:r}=oi();return s.jsx($,{type:"button",size:"icon",variant:"ghost",className:"rounded-full p-2",onClick:t,disabled:e||n,children:e?s.jsx(Hn,{className:"h-6 w-6",style:{color:r}}):s.jsx(Rb,{className:"h-6 w-6",style:{color:r}})})},_ne=({chat:e})=>{const[t]=Sc(),{inputBackgroundColor:n,inputTextForegroundColor:r}=oi(),a=t.get("remoteJid"),{instance:o}=Vw(),{sendText:l}=iI(),{sendMedia:u}=lI(),{sendAudio:d}=bX(),{replyingMessage:f,setReplyingMessage:h}=v.useContext(qw),m=v.useRef(null),g=v.useRef(null),b=v.useRef(null),[x,w]=v.useState(""),[C,k]=v.useState(!1),[N,T]=v.useState(null),[_,P]=v.useState(!1),[M,O]=v.useState(null),[D,F]=v.useState(0),{t:B}=Le();v.useEffect(()=>{h(null),T(null)},[a,h,T]);const te=ee=>{if(w(ee.target.value),m.current){m.current.style.height="auto";const ie=m.current.scrollHeight,j=parseInt(getComputedStyle(m.current).lineHeight)*10;m.current.style.height=`${Math.min(ie,j)}px`}},U=ee=>{if(w(ie=>ie+ee),m.current){m.current.style.height="auto";const ie=m.current.scrollHeight,j=parseInt(getComputedStyle(m.current).lineHeight)*10;m.current.style.height=`${Math.min(ie,j)}px`}},ce=async()=>{try{P(!0);const ee=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:44100,echoCancellation:!0,noiseSuppression:!0}});let ie="";const ue=["audio/aac","audio/mp4","audio/mpeg","audio/amr","audio/ogg","audio/opus"];for(const me of ue)if(MediaRecorder.isTypeSupported(me)){ie=me;break}if(!ie)throw new Error("Nenhum formato aceito pela Meta disponível");const j=new MediaRecorder(ee,{mimeType:ie,audioBitsPerSecond:128e3});b.current=j;const I=[];j.ondataavailable=me=>{me.data.size>0&&I.push(me.data)},j.onstop=()=>{const me=new Blob(I,{type:ie}),be=new File([me],`audio.${ie.split("/")[1]}`,{type:ie,lastModified:Date.now()});O(be)},j.start(),g.current=setInterval(()=>{F(me=>me+1)},1e3)}catch(ee){console.error("Erro ao iniciar gravação:",ee),Q.error(B("chat.toast.recordingError")),P(!1)}},q=()=>{b.current&&(b.current.stop(),g.current&&clearInterval(g.current),P(!1))},ne=()=>{O(null),F(0)},Y=ee=>{console.error("Error to send message",ee),Q.error(cT(ee)?`${B("chat.toast.error")}: ${ee?.response?.data?.response?.message}`:B("chat.toast.sendError"))},se=()=>{k(!1),h(null)},H=async()=>{if(!o?.name||!o?.token||!a)return;const ee={instanceName:o.name,token:o.token,data:{number:a,text:x}};await l(ee,{onSuccess:()=>{w(""),m.current&&(m.current.style.height="auto")},onError:Y,onSettled:se})},W=async()=>{if(!(!o?.name||!o?.token||!N||!a)){k(!0);try{const ee=await new Promise((ue,j)=>{const I=new FileReader;I.readAsDataURL(N),I.onload=()=>{const be=I.result.split(",")[1];ue(be)},I.onerror=j}),ie={instanceName:o.name,token:o.token,data:{number:a,mediaMessage:{mediatype:N.type.split("/")[0]==="application"?"document":N.type.split("/")[0],mimetype:N.type,caption:x,media:ee,fileName:N.name}}};await u(ie,{onSuccess:()=>{T(null),w(""),m.current&&(m.current.style.height="auto")},onError:Y,onSettled:se})}catch(ee){console.error("Error converting media to base64:",ee),Y(ee),k(!1)}}},V=async()=>{if(!(!o?.name||!o?.token||!M||!a)){k(!0);try{const ee=await new Promise((ue,j)=>{const I=new FileReader;I.readAsDataURL(M),I.onload=()=>{const be=I.result.split(",")[1];ue(be)},I.onerror=j}),ie={instanceName:o.name,token:o.token,data:{number:a,audioMessage:{audio:ee}}};await d(ie,{onSuccess:()=>{O(null),F(0)},onError:Y,onSettled:se})}catch(ee){console.error("Error converting audio to base64:",ee),Y(ee),k(!1)}}},A=async()=>{k(!0),N?await W():await H()},K=()=>!x&&!N?s.jsx(Tne,{isSendingMessage:C,isRecording:_,audioBlob:M,elapsedTime:D,startRecording:ce,stopRecording:q,clearRecording:ne,sendAudioMessage:V}):s.jsx(Mne,{isSendingMessage:C,sendMessage:A}),re=()=>_||M?K():s.jsxs(s.Fragment,{children:[s.jsx(Nne,{handleEmojiClick:U}),s.jsx(uI,{instance:o,setSelectedMedia:T}),s.jsx(Is,{placeholder:B("chat.message.placeholder"),name:"message",id:"message",rows:1,ref:m,value:x,onChange:te,onKeyDown:ee=>{!ee.shiftKey&&ee.key==="Enter"&&!C&&(ee.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}}),K()]});return o?s.jsxs("div",{className:"input-container",children:[N&&s.jsx(dI,{selectedMedia:N,setSelectedMedia:T}),f&&s.jsx(Ene,{chat:e}),s.jsx("div",{className:`flex items-end ${(_||M)&&"justify-end"} rounded-3xl px-4 py-1`,style:{backgroundColor:n,color:r},children:re()})]}):s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx("p",{className:"text-muted-foreground",children:B("chat.noInstance")||"Nenhuma instância selecionada"})})},Pne=fn({remoteJid:he().min(1)});function Rne({onSuccess:e}){const{t}=Le(),{primaryColor:n}=oi(),r=mn({resolver:gn(Pne),defaultValues:{remoteJid:""}}),a=o=>{e(o)};return s.jsx(ka,{...r,children:s.jsxs("form",{onSubmit:r.handleSubmit(a),children:[s.jsx(Xa,{control:r.control,name:"remoteJid",render:({field:o})=>s.jsxs(Ea,{children:[s.jsx(es,{children:t("chat.newChat.contact")}),s.jsx(na,{children:s.jsx(Z,{type:"text",placeholder:t("chat.newChat.placeholder"),...o})})]})}),s.jsx("div",{className:"flex justify-end",children:s.jsx($,{type:"submit",className:"mt-4",style:{backgroundColor:n},children:t("chat.newChat.submit")})})]})})}function Ine({isOpen:e,setIsOpen:t}){const[n]=Sc(),{t:r}=Le(),a=Nn(),o=l=>{const u=new URLSearchParams(n);u.set("remoteJid",l.remoteJid),a(`/manager/embed-chat?${u.toString()}`),t(!1)};return s.jsx(vt,{open:e,onOpenChange:t,children:s.jsxs(mt,{className:"max-w-2xl",children:[s.jsxs(gt,{children:[s.jsx(xt,{children:r("chat.newChat.title")}),s.jsx(gr,{children:r("chat.newChat.description")})]}),s.jsx(Rne,{onSuccess:o})]})})}const Hy=e=>e?e.replace("@s.whatsapp.net","").replace("@g.us",""):"";function One(){const[e]=Sc(),{backgroundColor:t,textForegroundColor:n,primaryColor:r}=oi(),a=eo("(min-width: 768px)"),{t:o}=Le(),l=Nn(),u=e.get("token"),{remoteJid:d}=Os(),f=d||e.get("remoteJid"),[h,m]=v.useState([]),g=v.useRef(null),b=v.useRef(null),[x,w]=v.useState(null),[C,k]=v.useState(!1),{instance:N}=Vw(),T=P=>{const M=new URLSearchParams(e);l(`/manager/embed-chat/${encodeURIComponent(P.remoteJid||P.id)}?${M.toString()}`)};v.useEffect(()=>{if(!N?.name)return;let P=!0;return(async()=>{try{const{data:O}=await Ce.post(`/chat/findChats/${N.name}`,{where:{}},{headers:{apikey:u||N.token}});P&&m(O||[])}catch(O){P&&(console.error("Erro ao buscar chats:",O),Q.error("Erro ao buscar chats"))}})(),()=>{P=!1}},[N?.name,u]),v.useEffect(()=>{if(!N)return;const P=mr(Fn.API_URL);if(!P){console.error("API URL not found in localStorage");return}const M=localStorage.getItem("accessToken");u&&localStorage.setItem("accessToken",u);const O=Ow(P);function D(F,B){N&&B.instance===N.name&&m(te=>{const U=B?.data?.key?.remoteJid,ce=te.findIndex(Y=>Y.remoteJid&&Y.remoteJid===U||Y.id&&Y.id===U),q=ce!==-1?te[ce]:null,ne={id:U,remoteJid:U,pushName:q?.pushName||B?.data?.pushName||Hy(U),profilePicUrl:q?.profilePicUrl||B?.data?.key?.profilePictureUrl||"https://as2.ftcdn.net/jpg/05/89/93/27/1000_F_589932782_vQAEAZhHnq1QCGu5ikwrYaQD0Mmurm0N.jpg",updatedAt:new Date().toISOString(),labels:q?.labels||[],createdAt:q?.createdAt||new Date().toISOString(),instanceId:N.id};if(ce!==-1){const Y=[...te];return Y[ce]={...q,updatedAt:ne.updatedAt},Y}else return[...te,ne]})}return O.on("messages.upsert",F=>{D("messages.upsert",F)}),O.on("send.message",F=>{D("send.message",F)}),O.on("messages.update",F=>{}),O.connect(),()=>{O.off("messages.upsert"),O.off("send.message"),O.off("messages.update"),Aw(O),u?localStorage.setItem("accessToken",M||""):localStorage.removeItem("accessToken")}},[N,f,u]),v.useEffect(()=>{if(f){const P=h.find(M=>M.id===f);w(P||null)}},[f,h]);const _={backgroundColor:t,color:n};return s.jsx("div",{className:"relative h-full",style:_,children:s.jsxs(ii,{direction:a?"horizontal":"vertical",children:[s.jsx(Mr,{defaultSize:30,minSize:20,maxSize:60,children:s.jsxs("div",{className:"hidden flex-col gap-2 text-foreground md:flex",style:_,children:[s.jsx("div",{className:"sticky top-0 p-2",children:s.jsxs($,{variant:"ghost",className:"w-full justify-start gap-2 px-2 text-left",onClick:()=>k(!0),style:{backgroundColor:r,color:n},children:[s.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-full",children:s.jsx(cc,{className:"h-4 w-4"})}),s.jsx("div",{className:"grow overflow-hidden text-ellipsis whitespace-nowrap text-sm",children:o("chat.title")}),s.jsx($r,{className:"h-4 w-4"})]})}),s.jsxs(cw,{defaultValue:"contacts",children:[s.jsxs(uw,{className:"tabs-chat",children:[s.jsx(oh,{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")}),s.jsx(oh,{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")})]}),s.jsx(ih,{value:"contacts",children:s.jsx("div",{className:"contacts-container",children:s.jsxs("div",{className:"grid gap-1 p-2 text-foreground",children:[s.jsx("div",{className:"px-2 text-xs font-medium text-muted-foreground",children:o("chat.contacts")}),h?.sort((P,M)=>new Date(M.lastMessage.messageTimestamp).getTime()-new Date(P.lastMessage.messageTimestamp).getTime()).map(P=>P?.id&&!P.id.includes("@g.us")&&s.jsxs("div",{onClick:()=>T(P),className:"chat-item flex cursor-pointer items-center overflow-hidden rounded-md p-2 text-sm transition-colors",style:{backgroundColor:f===P.id?r:""},children:[s.jsx("span",{className:"chat-avatar mr-2",children:s.jsx("img",{src:P.profilePicUrl||"https://as2.ftcdn.net/jpg/05/89/93/27/1000_F_589932782_vQAEAZhHnq1QCGu5ikwrYaQD0Mmurm0N.jpg",alt:"Avatar",className:"h-12 w-12 rounded-full"})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"chat-title font-medium",style:{color:n},children:P.pushName||Hy(P.id)}),s.jsx("span",{className:"text-xs",style:{color:n}})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsxs("span",{className:"text-xs font-bold",style:{color:n},children:[o("chat.recent"),":"," "]}),s.jsx("span",{className:"block truncate text-xs",style:{color:n}})]})]})]},P.id))]})})}),s.jsx(ih,{value:"groups",children:s.jsx("div",{className:"contacts-container",children:s.jsxs("div",{className:"grid gap-1 p-2 text-foreground",children:[s.jsx("div",{className:"px-2 text-xs font-medium text-muted-foreground",children:o("chat.groups")}),h?.sort((P,M)=>new Date(M.lastMessage.messageTimestamp).getTime()-new Date(P.lastMessage.messageTimestamp).getTime()).map(P=>P?.id&&P.id.includes("@g.us")&&s.jsxs("div",{onClick:()=>T(P),className:"chat-item flex cursor-pointer items-center overflow-hidden rounded-md p-2 text-sm transition-colors",style:{backgroundColor:f===P.id?r:""},children:[s.jsx("span",{className:"chat-avatar mr-2",children:s.jsx("img",{src:P.profilePicUrl||"https://as2.ftcdn.net/jpg/05/89/93/27/1000_F_589932782_vQAEAZhHnq1QCGu5ikwrYaQD0Mmurm0N.jpg",alt:"Avatar",className:"h-12 w-12 rounded-full"})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"chat-title font-medium",children:P.pushName}),s.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400"})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsxs("span",{className:"text-xs font-bold text-gray-500 dark:text-gray-400",children:[o("chat.recent")," "]}),s.jsx("span",{className:"block truncate text-xs text-gray-500"})]})]})]},P.id))]})})})]})]})}),s.jsx(li,{withHandle:!0}),s.jsxs(Mr,{style:_,children:[f&&s.jsx(mne,{children:s.jsxs("div",{className:"flex h-full flex-col justify-between",style:_,children:[s.jsx("div",{className:"flex items-center gap-3 p-3",children:s.jsxs("div",{className:"flex flex-1 items-center gap-3",children:[s.jsx("img",{src:x?.profilePicUrl||"https://as2.ftcdn.net/jpg/05/89/93/27/1000_F_589932782_vQAEAZhHnq1QCGu5ikwrYaQD0Mmurm0N.jpg",alt:"Avatar",className:"h-10 w-10 rounded-full"}),s.jsx("div",{className:"flex flex-col",children:s.jsx("span",{className:"font-medium",children:x?.pushName||Hy(f)})})]})}),s.jsx(fI,{textareaRef:g,handleTextareaChange:()=>{},textareaHeight:"auto",lastMessageRef:b,scrollToBottom:()=>{b.current&&b.current.scrollIntoView({behavior:"smooth"})}}),s.jsx(_ne,{chat:x})]})}),s.jsx(Ine,{isOpen:C,setIsOpen:k})]})]})})}function Ane(){const{instance:e,isLoading:t,error:n}=Vw();return t?s.jsx("div",{className:"flex h-screen items-center justify-center",children:s.jsx(Hn,{})}):n?s.jsx("div",{className:"flex h-screen items-center justify-center",children:s.jsx("div",{className:"rounded-md bg-red-50 p-4 dark:bg-red-900",children:s.jsx("span",{className:"text-red-800 dark:text-red-200",children:n})})}):e?s.jsx("div",{className:"h-screen",children:s.jsx(One,{})}):null}function TE(){return s.jsx(aN,{client:uT,children:s.jsx(K_,{children:s.jsx(hne,{children:s.jsx(wX,{children:s.jsx(Ane,{})})})})})}const Dne=e=>["evoai","fetchEvoai",JSON.stringify(e)],Fne=async({instanceName:e,token:t})=>(await Ce.get(`/evoai/find/${e}`,{headers:{apikey:t}})).data,dO=e=>{const{instanceName:t,token:n,...r}=e;return pt({...r,queryKey:Dne({instanceName:t,token:n}),queryFn:()=>Fne({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},Lne=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/evoai/create/${e}`,n,{headers:{apikey:t}})).data,$ne=async({instanceName:e,evoaiId:t,data:n})=>(await Ce.put(`/evoai/update/${t}/${e}`,n)).data,Bne=async({instanceName:e,evoaiId:t})=>(await Ce.delete(`/evoai/delete/${t}/${e}`)).data,zne=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/evoai/settings/${e}`,n,{headers:{apikey:t}})).data,Une=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await Ce.post(`/evoai/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function Rm(){const e=nt(zne,{invalidateKeys:[["evoai","fetchDefaultSettings"]]}),t=nt(Une,{invalidateKeys:[["evoai","getEvoai"],["evoai","fetchSessions"]]}),n=nt(Bne,{invalidateKeys:[["evoai","getEvoai"],["evoai","fetchEvoai"],["evoai","fetchSessions"]]}),r=nt($ne,{invalidateKeys:[["evoai","getEvoai"],["evoai","fetchEvoai"],["evoai","fetchSessions"]]}),a=nt(Lne,{invalidateKeys:[["evoai","fetchEvoai"]]});return{setDefaultSettingsEvoai:e,changeStatusEvoai:t,deleteEvoai:n,updateEvoai:r,createEvoai:a}}const Vne=e=>["evoai","fetchDefaultSettings",JSON.stringify(e)],qne=async({instanceName:e,token:t})=>(await Ce.get(`/evoai/fetchSettings/${e}`,{headers:{apikey:t}})).data,Hne=e=>{const{instanceName:t,token:n,...r}=e;return pt({...r,queryKey:Vne({instanceName:t,token:n}),queryFn:()=>qne({instanceName:t,token:n}),enabled:!!t})},Wne=fn({expire:he(),keywordFinish:he(),delayMessage:he(),unknownMessage:he(),listeningFromMe:Me(),stopBotFromMe:Me(),keepOpen:Me(),debounceTime:he(),ignoreJids:Ds(he()).default([]),evoaiIdFallback:_c([Mc(),he()]).optional(),splitMessages:Me(),timePerChar:he()});function Kne(){const{t:e}=Le(),{instance:t}=ct(),{setDefaultSettingsEvoai:n}=Rm(),[r,a]=v.useState(!1),{data:o,refetch:l}=dO({instanceName:t?.name,token:t?.token,enabled:r}),{data:u,refetch:d}=Hne({instanceName:t?.name,token:t?.token}),f=mn({resolver:gn(Wne),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(()=>{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 b={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:b}),Q.success(e("evoai.toast.defaultSettings.success"))}catch(b){console.error("Error:",b),Q.error(`Error: ${b?.response?.data?.response?.message}`)}};function m(){d(),l()}return s.jsxs(vt,{open:r,onOpenChange:a,children:[s.jsx(an,{asChild:!0,children:s.jsxs($,{variant:"secondary",size:"sm",children:[s.jsx(Zo,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:e("evoai.defaultSettings")})]})}),s.jsxs(mt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:m,children:[s.jsx(gt,{children:s.jsx(xt,{children:e("evoai.defaultSettings")})}),s.jsx(yr,{...f,children:s.jsxs("form",{className:"w-full space-y-6",onSubmit:f.handleSubmit(h),children:[s.jsx("div",{children:s.jsxs("div",{className:"space-y-4",children:[s.jsx(un,{name:"evoaiIdFallback",label:e("evoai.form.evoaiIdFallback.label"),options:o?.filter(g=>!!g.id).map(g=>({label:g.description,value:g.id}))??[]}),s.jsx(pe,{name:"expire",label:e("evoai.form.expire.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(pe,{name:"keywordFinish",label:e("evoai.form.keywordFinish.label"),children:s.jsx(Z,{})}),s.jsx(pe,{name:"delayMessage",label:e("evoai.form.delayMessage.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(pe,{name:"unknownMessage",label:e("evoai.form.unknownMessage.label"),children:s.jsx(Z,{})}),s.jsx(Re,{name:"listeningFromMe",label:e("evoai.form.listeningFromMe.label"),reverse:!0}),s.jsx(Re,{name:"stopBotFromMe",label:e("evoai.form.stopBotFromMe.label"),reverse:!0}),s.jsx(Re,{name:"keepOpen",label:e("evoai.form.keepOpen.label"),reverse:!0}),s.jsx(pe,{name:"debounceTime",label:e("evoai.form.debounceTime.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(Re,{name:"splitMessages",label:e("evoai.form.splitMessages.label"),reverse:!0}),s.jsx(pe,{name:"timePerChar",label:e("evoai.form.timePerChar.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(ai,{name:"ignoreJids",label:e("evoai.form.ignoreJids.label"),placeholder:e("evoai.form.ignoreJids.placeholder")})]})}),s.jsx(Kt,{children:s.jsx($,{type:"submit",children:e("evoai.button.save")})})]})})]})]})}const Gne=e=>["evoai","fetchSessions",JSON.stringify(e)],Jne=async({evoaiId:e,instanceName:t})=>(await Ce.get(`/evoai/fetchSessions/${e}/${t}`)).data,Qne=e=>{const{evoaiId:t,instanceName:n,...r}=e;return pt({...r,queryKey:Gne({evoaiId:t,instanceName:n}),queryFn:()=>Jne({evoaiId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0),staleTime:1e3*10})},fp={name:"",number:"",status:"all",time:"all",customCondition:"more",customValue:"",customUnit:"minutes"};function Yne(e,t){const n=parseInt(e);return!n||isNaN(n)||n<=0?null:t==="hours"?n*60:t==="days"?n*1440:n}function Zne(e,t){if(t.time==="all")return!0;const n=(Date.now()-new Date(e).getTime())/6e4;if(t.time==="custom"){const r=Yne(t.customValue,t.customUnit);return r===null?!0:t.customCondition==="more"?n>r:n<=r}if(t.time.startsWith(">")){const r=parseInt(t.time.slice(1));return n>r}return n<=parseInt(t.time)}function fO({evoaiId:e}){const{t}=Le(),{instance:n}=ct(),{changeStatusEvoai:r}=Rm(),[a,o]=v.useState(!1),[l,u]=v.useState([]),[d,f]=v.useState({}),[h,m]=v.useState(fp),[g,b]=v.useState(fp),[x,w]=v.useState(9),[C,k]=v.useState(9),[N,T]=v.useState("opened"),[_,P]=v.useState(!1),[M,O]=v.useState(""),[D,F]=v.useState(""),[B,te]=v.useState(!1),{data:U,refetch:ce}=Qne({instanceName:n?.name,evoaiId:e,enabled:a}),q=v.useMemo(()=>{const j=U??[],I=g.name.trim().toLowerCase(),me=g.number.trim();return j.filter(be=>!(I&&!be.pushName?.toLowerCase().includes(I)||me&&!be.remoteJid.includes(me)||g.status!=="all"&&be.status!==g.status||!Zne(be.updatedAt,g)))},[U,g]),ne=q.slice(0,C),Y=v.useMemo(()=>Object.keys(d).filter(j=>d[j]).map(j=>ne[Number(j)]?.remoteJid).filter(Boolean),[d,ne]);v.useEffect(()=>{k(x),f({})},[g,x]);const se=()=>{ce()},H=()=>{b(h)},W=()=>{m(fp),b(fp)},V=async(j,I)=>{try{if(!n)return;await r({instanceName:n.name,token:n.token,remoteJid:j,status:I}),Q.success(t("evoai.toast.success.status")),se()}catch(me){console.error("Error:",me),Q.error(`Error : ${me?.response?.data?.response?.message}`)}},A=async()=>{if(Y.length===0){Q.error(t("sessions.mass.noneSelected"));return}try{if(!n)return;await Promise.all(Y.map(j=>r({instanceName:n.name,token:n.token,remoteJid:j,status:N}))),Q.success(t("sessions.mass.success")),f({}),se()}catch(j){console.error(j),Q.error(j?.response?.data?.response?.message??t("sessions.mass.error"))}},K=j=>{O(j),F(""),P(!0)},re=async()=>{if(!D.trim()){Q.error(t("sessions.send.empty"));return}try{if(!n)return;te(!0),await Ce.post(`/message/sendText/${n.name}`,{number:M,text:D},{headers:{apikey:n.token}}),Q.success(t("sessions.send.success")),P(!1),F(""),O("")}catch(j){console.error("Error:",j),Q.error(j?.response?.data?.response?.message??j?.message??t("sessions.send.error"))}finally{te(!1)}},ee=[{id:"select",header:({table:j})=>s.jsx(ts,{checked:j.getIsAllPageRowsSelected()||j.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:I=>j.toggleAllPageRowsSelected(!!I),"aria-label":t("sessions.mass.selectAll")}),cell:({row:j})=>s.jsx(ts,{checked:j.getIsSelected(),onCheckedChange:I=>j.toggleSelected(!!I),"aria-label":t("sessions.mass.selectAll")}),enableSorting:!1},{accessorKey:"remoteJid",header:()=>s.jsx("div",{className:"text-center",children:t("evoai.sessions.table.remoteJid")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>s.jsx("div",{className:"text-center",children:t("evoai.sessions.table.pushName")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("pushName")})},{accessorKey:"sessionId",header:()=>s.jsx("div",{className:"text-center",children:t("evoai.sessions.table.sessionId")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("sessionId")})},{accessorKey:"status",header:()=>s.jsx("div",{className:"text-center",children:t("evoai.sessions.table.status")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:j})=>{const I=j.original;return s.jsxs(vs,{children:[s.jsx(ys,{asChild:!0,children:s.jsxs($,{variant:"ghost",size:"icon",children:[s.jsx("span",{className:"sr-only",children:t("evoai.sessions.table.actions.title")}),s.jsx(Xo,{className:"h-4 w-4"})]})}),s.jsxs(xs,{align:"end",children:[s.jsx(ei,{children:t("evoai.sessions.table.actions.title")}),s.jsx(ti,{}),I.status!=="opened"&&s.jsxs(Ct,{onClick:()=>V(I.remoteJid,"opened"),children:[s.jsx(al,{className:"mr-2 h-4 w-4"}),t("evoai.sessions.table.actions.open")]}),I.status!=="paused"&&I.status!=="closed"&&s.jsxs(Ct,{onClick:()=>V(I.remoteJid,"paused"),children:[s.jsx(sl,{className:"mr-2 h-4 w-4"}),t("evoai.sessions.table.actions.pause")]}),I.status!=="closed"&&s.jsxs(Ct,{onClick:()=>V(I.remoteJid,"closed"),children:[s.jsx(el,{className:"mr-2 h-4 w-4"}),t("evoai.sessions.table.actions.close")]}),s.jsxs(Ct,{onClick:()=>K(I.remoteJid),children:[s.jsx(rl,{className:"mr-2 h-4 w-4"}),t("sessions.actions.sendMessage")]}),s.jsxs(Ct,{onClick:()=>V(I.remoteJid,"delete"),children:[s.jsx(tl,{className:"mr-2 h-4 w-4"}),t("evoai.sessions.table.actions.delete")]})]})]})}}],ie=["all","5","10","15","20","30","60",">60",">120",">300",">1440","custom"],ue=["all","opened","paused","closed"];return s.jsxs(vt,{open:a,onOpenChange:o,children:[s.jsx(an,{asChild:!0,children:s.jsxs($,{variant:"secondary",size:"sm",children:[s.jsx(nl,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden md:inline",children:t("evoai.sessions.label")})]})}),s.jsxs(mt,{className:"max-w-7xl h-[85vh] flex flex-col overflow-hidden",children:[s.jsx(gt,{children:s.jsx(xt,{children:t("evoai.sessions.label")})}),s.jsxs("div",{className:"flex-1 space-y-4 overflow-y-auto pr-2",children:[s.jsxs(Un,{children:[s.jsx(Yn,{children:s.jsx(Zn,{className:"text-base",children:t("sessions.filters.title")})}),s.jsxs(Vn,{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.name")}),s.jsx(Z,{placeholder:t("sessions.filters.namePlaceholder"),value:h.name,onChange:j=>m(I=>({...I,name:j.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.number")}),s.jsx(Z,{placeholder:t("sessions.filters.numberPlaceholder"),value:h.number,onChange:j=>m(I=>({...I,number:j.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.status")}),s.jsxs(_t,{value:h.status,onValueChange:j=>m(I=>({...I,status:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsx(It,{children:ue.map(j=>s.jsx(we,{value:j,children:t(`sessions.filters.statusOptions.${j}`)},j))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.time")}),s.jsxs(_t,{value:h.time,onValueChange:j=>m(I=>({...I,time:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsx(It,{children:ie.map(j=>s.jsx(we,{value:j,children:t(`sessions.filters.timeOptions.${j}`)},j))})]})]})]}),h.time==="custom"&&s.jsxs("div",{className:"grid grid-cols-1 gap-2 md:grid-cols-3",children:[s.jsxs(_t,{value:h.customCondition,onValueChange:j=>m(I=>({...I,customCondition:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"more",children:t("sessions.filters.custom.more")}),s.jsx(we,{value:"less",children:t("sessions.filters.custom.less")})]})]}),s.jsx(Z,{type:"number",min:1,placeholder:t("sessions.filters.custom.valuePlaceholder"),value:h.customValue,onChange:j=>m(I=>({...I,customValue:j.target.value}))}),s.jsxs(_t,{value:h.customUnit,onValueChange:j=>m(I=>({...I,customUnit:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"minutes",children:t("sessions.filters.custom.minutes")}),s.jsx(we,{value:"hours",children:t("sessions.filters.custom.hours")}),s.jsx(we,{value:"days",children:t("sessions.filters.custom.days")})]})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx($,{onClick:H,size:"sm",children:t("sessions.filters.apply")}),s.jsx($,{onClick:W,size:"sm",variant:"outline",children:t("sessions.filters.clear")}),s.jsxs($,{onClick:se,size:"sm",variant:"outline",children:[s.jsx(ol,{size:14,className:"mr-1"}),t("button.refresh")]})]})]})]}),Y.length>0&&s.jsxs(Un,{children:[s.jsx(Yn,{children:s.jsx(Zn,{className:"text-base",children:t("sessions.mass.title")})}),s.jsx(Vn,{children:s.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:t("sessions.mass.selected",{count:Y.length})}),s.jsxs("div",{className:"flex-1 min-w-[180px] space-y-1",children:[s.jsx(Ve,{children:t("sessions.mass.newStatus")}),s.jsxs(_t,{value:N,onValueChange:T,children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"opened",children:t("evoai.sessions.table.actions.open")}),s.jsx(we,{value:"paused",children:t("evoai.sessions.table.actions.pause")}),s.jsx(we,{value:"closed",children:t("evoai.sessions.table.actions.close")}),s.jsx(we,{value:"delete",children:t("evoai.sessions.table.actions.delete")})]})]})]}),s.jsx($,{onClick:A,size:"sm",children:t("sessions.mass.apply")})]})})]}),s.jsx(ci,{columns:ee,data:ne,onSortingChange:u,state:{sorting:l,rowSelection:d},onRowSelectionChange:f,enableRowSelection:!0,getRowId:(j,I)=>String(I),noResultsMessage:t("sessions.empty")}),s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 px-1 text-sm text-muted-foreground",children:[s.jsx("span",{children:t("sessions.pagination.showing",{shown:ne.length,total:q.length})}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(Ve,{htmlFor:"per-page",className:"text-xs",children:t("sessions.pagination.perPage")}),s.jsxs(_t,{value:String(x),onValueChange:j=>w(parseInt(j)),children:[s.jsx(Rt,{id:"per-page",className:"h-8 w-20",children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"9",children:"9"}),s.jsx(we,{value:"25",children:"25"}),s.jsx(we,{value:"50",children:"50"}),s.jsx(we,{value:"100",children:"100"})]})]}),Ck(j=>Math.min(j+x,q.length)),children:t("sessions.pagination.showMore")}),Ck(q.length),children:t("sessions.pagination.showAll")}),C>x&&s.jsx($,{size:"sm",variant:"outline",onClick:()=>k(x),children:t("sessions.pagination.showLess")})]})]})]}),s.jsx(vt,{open:_,onOpenChange:j=>!B&&P(j),children:s.jsxs(mt,{className:"sm:max-w-md",children:[s.jsx(gt,{children:s.jsx(xt,{children:t("sessions.send.title")})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{children:t("sessions.send.to")}),s.jsx(Z,{value:M,disabled:!0})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{children:t("sessions.send.messagePlaceholder")}),s.jsx(ni,{rows:4,placeholder:t("sessions.send.messagePlaceholder"),value:D,onChange:j=>F(j.target.value)})]})]}),s.jsxs(Kt,{children:[s.jsx($,{variant:"outline",onClick:()=>P(!1),disabled:B,children:t("button.cancel")}),s.jsx($,{onClick:re,disabled:B,children:t(B?"sessions.send.sending":"sessions.send.send")})]})]})})]})]})}const Xne=fn({enabled:Me(),description:he(),agentUrl:he(),apiKey:he(),triggerType:he(),triggerOperator:he().optional(),triggerValue:he().optional(),expire:ot.number().optional(),keywordFinish:he().optional(),delayMessage:ot.number().optional(),unknownMessage:he().optional(),listeningFromMe:Me().optional(),stopBotFromMe:Me().optional(),keepOpen:Me().optional(),debounceTime:ot.number().optional(),splitMessages:Me().optional(),timePerChar:ot.number().optional()});function pO({initialData:e,onSubmit:t,handleDelete:n,evoaiId:r,isModal:a=!1,isLoading:o=!1,openDeletionDialog:l=!1,setOpenDeletionDialog:u=()=>{}}){const{t:d}=Le(),f=mn({resolver:gn(Xne),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 s.jsx(yr,{...f,children:s.jsxs("form",{onSubmit:f.handleSubmit(t),className:"w-full space-y-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsx(Re,{name:"enabled",label:d("evoai.form.enabled.label"),reverse:!0}),s.jsx(pe,{name:"description",label:d("evoai.form.description.label"),children:s.jsx(Z,{})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("evoai.form.evoaiSettings.label")}),s.jsx(Yt,{})]}),s.jsx(pe,{name:"agentUrl",label:d("evoai.form.agentUrl.label"),required:!0,children:s.jsx(Z,{})}),s.jsx(pe,{name:"apiKey",label:d("evoai.form.apiKey.label"),className:"flex-1",children:s.jsx(Z,{type:"password"})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("evoai.form.triggerSettings.label")}),s.jsx(Yt,{})]}),s.jsx(un,{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"&&s.jsxs(s.Fragment,{children:[s.jsx(un,{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"}]}),s.jsx(pe,{name:"triggerValue",label:d("evoai.form.triggerValue.label"),children:s.jsx(Z,{})})]}),h==="advanced"&&s.jsx(pe,{name:"triggerValue",label:d("evoai.form.triggerConditions.label"),children:s.jsx(Z,{})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("evoai.form.generalSettings.label")}),s.jsx(Yt,{})]}),s.jsx(pe,{name:"expire",label:d("evoai.form.expire.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(pe,{name:"keywordFinish",label:d("evoai.form.keywordFinish.label"),children:s.jsx(Z,{})}),s.jsx(pe,{name:"delayMessage",label:d("evoai.form.delayMessage.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(pe,{name:"unknownMessage",label:d("evoai.form.unknownMessage.label"),children:s.jsx(Z,{})}),s.jsx(Re,{name:"listeningFromMe",label:d("evoai.form.listeningFromMe.label"),reverse:!0}),s.jsx(Re,{name:"stopBotFromMe",label:d("evoai.form.stopBotFromMe.label"),reverse:!0}),s.jsx(Re,{name:"keepOpen",label:d("evoai.form.keepOpen.label"),reverse:!0}),s.jsx(pe,{name:"debounceTime",label:d("evoai.form.debounceTime.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(Re,{name:"splitMessages",label:d("evoai.form.splitMessages.label"),reverse:!0}),f.watch("splitMessages")&&s.jsx(pe,{name:"timePerChar",label:d("evoai.form.timePerChar.label"),children:s.jsx(Z,{type:"number"})})]}),a&&s.jsx(Kt,{children:s.jsx($,{disabled:o,type:"submit",children:d(o?"evoai.button.saving":"evoai.button.save")})}),!a&&s.jsxs("div",{children:[s.jsx(fO,{evoaiId:r}),s.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[s.jsxs(vt,{open:l,onOpenChange:u,children:[s.jsx(an,{asChild:!0,children:s.jsx($,{variant:"destructive",size:"sm",children:d("evoai.button.delete")})}),s.jsx(mt,{children:s.jsxs(gt,{children:[s.jsx(xt,{children:d("modal.delete.title")}),s.jsx(gr,{children:d("modal.delete.messageSingle")}),s.jsxs(Kt,{children:[s.jsx($,{size:"sm",variant:"outline",onClick:()=>u(!1),children:d("button.cancel")}),s.jsx($,{variant:"destructive",onClick:n,children:d("button.delete")})]})]})})]}),s.jsx($,{disabled:o,type:"submit",children:d(o?"evoai.button.saving":"evoai.button.update")})]})]})]})})}function ere({resetTable:e}){const{t}=Le(),{instance:n}=ct(),[r,a]=v.useState(!1),[o,l]=v.useState(!1),{createEvoai:u}=Rm(),d=async f=>{try{if(!n||!n.name)throw new Error("instance not found");a(!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}),Q.success(t("evoai.toast.success.create")),l(!1),e()}catch(h){console.error("Error:",h),Q.error(`Error: ${h?.response?.data?.response?.message}`)}finally{a(!1)}};return s.jsxs(vt,{open:o,onOpenChange:l,children:[s.jsx(an,{asChild:!0,children:s.jsxs($,{size:"sm",children:[s.jsx($r,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:t("evoai.button.create")})]})}),s.jsxs(mt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[s.jsx(gt,{children:s.jsx(xt,{children:t("evoai.form.title")})}),s.jsx(pO,{onSubmit:d,isModal:!0,isLoading:r})]})]})}const tre=e=>["evoai","getEvoai",JSON.stringify(e)],nre=async({evoaiId:e,instanceName:t})=>(await Ce.get(`/evoai/fetch/${e}/${t}`)).data,rre=e=>{const{evoaiId:t,instanceName:n,...r}=e;return pt({...r,queryKey:tre({evoaiId:t,instanceName:n}),queryFn:()=>nre({evoaiId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0)})};function sre({evoaiId:e,resetTable:t}){const{t:n}=Le(),{instance:r}=ct(),a=Nn(),[o,l]=v.useState(!1),{deleteEvoai:u,updateEvoai:d}=Rm(),{data:f,isLoading:h}=rre({evoaiId:e,instanceName:r?.name}),m=v.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 x=>{try{if(r&&r.name&&e){const w={enabled:x.enabled,description:x.description,agentUrl:x.agentUrl,apiKey:x.apiKey,triggerType:x.triggerType,triggerOperator:x.triggerOperator||"",triggerValue:x.triggerValue||"",expire:x.expire||0,keywordFinish:x.keywordFinish||"",delayMessage:x.delayMessage||1e3,unknownMessage:x.unknownMessage||"",listeningFromMe:x.listeningFromMe||!1,stopBotFromMe:x.stopBotFromMe||!1,keepOpen:x.keepOpen||!1,debounceTime:x.debounceTime||0,splitMessages:x.splitMessages||!1,timePerChar:x.timePerChar||0};await d({instanceName:r.name,evoaiId:e,data:w}),Q.success(n("evoai.toast.success.update")),t(),a(`/manager/instance/${r.id}/evoai/${e}`)}else console.error("Token not found")}catch(w){console.error("Error:",w),Q.error(`Error: ${w?.response?.data?.response?.message}`)}},b=async()=>{try{r&&r.name&&e?(await u({instanceName:r.name,evoaiId:e}),Q.success(n("evoai.toast.success.delete")),l(!1),t(),a(`/manager/instance/${r.id}/evoai`)):console.error("instance not found")}catch(x){console.error("Erro ao excluir evoai:",x)}};return h?s.jsx(Hn,{}):s.jsx("div",{className:"m-4",children:s.jsx(pO,{initialData:m,onSubmit:g,evoaiId:e,handleDelete:b,isModal:!1,isLoading:h,openDeletionDialog:o,setOpenDeletionDialog:l})})}function ME(){const{t:e}=Le(),t=eo("(min-width: 768px)"),{instance:n}=ct(),{evoaiId:r}=Os(),{data:a,refetch:o,isLoading:l,error:u}=dO({instanceName:n?.name}),d=Nn(),f=m=>{n&&d(`/manager/instance/${n.id}/evoai/${m}`)},h=()=>{o()};return s.jsx("main",{className:"pt-5",children:s.jsxs(ia,{error:u,name:"Evoai",envVar:"EVOAI_ENABLED",children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[s.jsx("h3",{className:"text-lg font-medium",children:e("evoai.title")}),s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsx(fO,{}),s.jsx(Kne,{}),s.jsx(ere,{resetTable:h})]})]}),s.jsx(Yt,{className:"my-4"}),s.jsxs(ii,{direction:t?"horizontal":"vertical",children:[s.jsx(Mr,{defaultSize:r?35:100,className:"pr-4",children:s.jsx("div",{className:"flex flex-col gap-3",children:l?s.jsx(Hn,{}):s.jsx(s.Fragment,{children:a&&a.length>0&&Array.isArray(a)?a.map(m=>s.jsx($,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>f(`${m.id}`),variant:r===m.id?"secondary":"outline",children:s.jsx("h4",{className:"text-base",children:m.description||m.id})},m.id)):s.jsx($,{variant:"link",children:e("evoai.table.none")})})})}),r&&s.jsxs(s.Fragment,{children:[s.jsx(li,{withHandle:!0,className:"border border-border"}),s.jsx(Mr,{children:s.jsx(sre,{evoaiId:r,resetTable:h})})]})]})]})})}const are=e=>["evolutionBot","findEvolutionBot",JSON.stringify(e)],ore=async({instanceName:e,token:t})=>(await Ce.get(`/evolutionBot/find/${e}`,{headers:{apiKey:t}})).data,hO=e=>{const{instanceName:t,token:n,...r}=e;return pt({...r,queryKey:are({instanceName:t}),queryFn:()=>ore({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},ire=e=>["evolutionBot","fetchDefaultSettings",JSON.stringify(e)],lre=async({instanceName:e,token:t})=>{const n=await Ce.get(`/evolutionBot/fetchSettings/${e}`,{headers:{apiKey:t}});return Array.isArray(n.data)?n.data[0]:n.data},cre=e=>{const{instanceName:t,token:n,...r}=e;return pt({...r,queryKey:ire({instanceName:t}),queryFn:()=>lre({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},ure=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/evolutionBot/create/${e}`,n,{headers:{apikey:t}})).data,dre=async({instanceName:e,token:t,evolutionBotId:n,data:r})=>(await Ce.put(`/evolutionBot/update/${n}/${e}`,r,{headers:{apikey:t}})).data,fre=async({instanceName:e,evolutionBotId:t})=>(await Ce.delete(`/evolutionBot/delete/${t}/${e}`)).data,pre=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/evolutionBot/settings/${e}`,n,{headers:{apikey:t}})).data,hre=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await Ce.post(`/evolutionBot/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function Im(){const e=nt(pre,{invalidateKeys:[["evolutionBot","fetchDefaultSettings"]]}),t=nt(hre,{invalidateKeys:[["evolutionBot","getEvolutionBot"],["evolutionBot","fetchSessions"]]}),n=nt(fre,{invalidateKeys:[["evolutionBot","getEvolutionBot"],["evolutionBot","findEvolutionBot"],["evolutionBot","fetchSessions"]]}),r=nt(dre,{invalidateKeys:[["evolutionBot","getEvolutionBot"],["evolutionBot","findEvolutionBot"],["evolutionBot","fetchSessions"]]}),a=nt(ure,{invalidateKeys:[["evolutionBot","findEvolutionBot"]]});return{setDefaultSettingsEvolutionBot:e,changeStatusEvolutionBot:t,deleteEvolutionBot:n,updateEvolutionBot:r,createEvolutionBot:a}}const mre=fn({expire:he(),keywordFinish:he(),delayMessage:he(),unknownMessage:he(),listeningFromMe:Me(),stopBotFromMe:Me(),keepOpen:Me(),debounceTime:he(),ignoreJids:Ds(he()).default([]),botIdFallback:_c([Mc(),he()]).optional(),splitMessages:Me(),timePerChar:he()});function gre(){const{t:e}=Le(),{instance:t}=ct(),[n,r]=v.useState(!1),{data:a,refetch:o}=cre({instanceName:t?.name,enabled:n}),{data:l,refetch:u}=hO({instanceName:t?.name,enabled:n}),{setDefaultSettingsEvolutionBot:d}=Im(),f=mn({resolver:gn(mre),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(()=>{a&&f.reset({expire:a?.expire?a.expire.toString():"0",keywordFinish:a.keywordFinish,delayMessage:a.delayMessage?a.delayMessage.toString():"0",unknownMessage:a.unknownMessage,listeningFromMe:a.listeningFromMe,stopBotFromMe:a.stopBotFromMe,keepOpen:a.keepOpen,debounceTime:a.debounceTime?a.debounceTime.toString():"0",ignoreJids:a.ignoreJids,botIdFallback:a.botIdFallback,splitMessages:a.splitMessages,timePerChar:a.timePerChar?a.timePerChar.toString():"0"})},[a]);const h=async g=>{try{if(!t||!t.name)throw new Error("instance not found.");const b={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:b}),Q.success(e("evolutionBot.toast.defaultSettings.success"))}catch(b){console.error("Error:",b),Q.error(`Error: ${b?.response?.data?.response?.message}`)}};function m(){o(),u()}return s.jsxs(vt,{open:n,onOpenChange:r,children:[s.jsx(an,{asChild:!0,children:s.jsxs($,{variant:"secondary",size:"sm",children:[s.jsx(Zo,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:e("evolutionBot.defaultSettings")})]})}),s.jsxs(mt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:m,children:[s.jsx(gt,{children:s.jsx(xt,{children:e("evolutionBot.defaultSettings")})}),s.jsx(yr,{...f,children:s.jsxs("form",{className:"w-full space-y-6",onSubmit:f.handleSubmit(h),children:[s.jsx("div",{children:s.jsxs("div",{className:"space-y-4",children:[s.jsx(un,{name:"botIdFallback",label:e("evolutionBot.form.botIdFallback.label"),options:l?.filter(g=>!!g.id).map(g=>({label:g.description,value:g.id}))??[]}),s.jsx(pe,{name:"expire",label:e("evolutionBot.form.expire.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(pe,{name:"keywordFinish",label:e("evolutionBot.form.keywordFinish.label"),children:s.jsx(Z,{})}),s.jsx(pe,{name:"delayMessage",label:e("evolutionBot.form.delayMessage.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(pe,{name:"unknownMessage",label:e("evolutionBot.form.unknownMessage.label"),children:s.jsx(Z,{})}),s.jsx(Re,{name:"listeningFromMe",label:e("evolutionBot.form.listeningFromMe.label"),reverse:!0}),s.jsx(Re,{name:"stopBotFromMe",label:e("evolutionBot.form.stopBotFromMe.label"),reverse:!0}),s.jsx(Re,{name:"keepOpen",label:e("evolutionBot.form.keepOpen.label"),reverse:!0}),s.jsx(pe,{name:"debounceTime",label:e("evolutionBot.form.debounceTime.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(Re,{name:"splitMessages",label:e("evolutionBot.form.splitMessages.label"),reverse:!0}),f.watch("splitMessages")&&s.jsx(pe,{name:"timePerChar",label:e("evolutionBot.form.timePerChar.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(ai,{name:"ignoreJids",label:e("evolutionBot.form.ignoreJids.label"),placeholder:e("evolutionBot.form.ignoreJids.placeholder")})]})}),s.jsx(Kt,{children:s.jsx($,{type:"submit",children:e("evolutionBot.button.save")})})]})})]})]})}const vre=e=>["evolutionBot","fetchSessions",JSON.stringify(e)],yre=async({instanceName:e,evolutionBotId:t,token:n})=>(await Ce.get(`/evolutionBot/fetchSessions/${t}/${e}`,{headers:{apiKey:n}})).data,xre=e=>{const{instanceName:t,token:n,evolutionBotId:r,...a}=e;return pt({...a,queryKey:vre({instanceName:t}),queryFn:()=>yre({instanceName:t,token:n,evolutionBotId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})},pp={name:"",number:"",status:"all",time:"all",customCondition:"more",customValue:"",customUnit:"minutes"};function bre(e,t){const n=parseInt(e);return!n||isNaN(n)||n<=0?null:t==="hours"?n*60:t==="days"?n*1440:n}function wre(e,t){if(t.time==="all")return!0;const n=(Date.now()-new Date(e).getTime())/6e4;if(t.time==="custom"){const r=bre(t.customValue,t.customUnit);return r===null?!0:t.customCondition==="more"?n>r:n<=r}if(t.time.startsWith(">")){const r=parseInt(t.time.slice(1));return n>r}return n<=parseInt(t.time)}function mO({evolutionBotId:e}){const{t}=Le(),{instance:n}=ct(),{changeStatusEvolutionBot:r}=Im(),[a,o]=v.useState(!1),[l,u]=v.useState([]),[d,f]=v.useState({}),[h,m]=v.useState(pp),[g,b]=v.useState(pp),[x,w]=v.useState(9),[C,k]=v.useState(9),[N,T]=v.useState("opened"),[_,P]=v.useState(!1),[M,O]=v.useState(""),[D,F]=v.useState(""),[B,te]=v.useState(!1),{data:U,refetch:ce}=xre({instanceName:n?.name,evolutionBotId:e,enabled:a}),q=v.useMemo(()=>{const j=U??[],I=g.name.trim().toLowerCase(),me=g.number.trim();return j.filter(be=>!(I&&!be.pushName?.toLowerCase().includes(I)||me&&!be.remoteJid.includes(me)||g.status!=="all"&&be.status!==g.status||!wre(be.updatedAt,g)))},[U,g]),ne=q.slice(0,C),Y=v.useMemo(()=>Object.keys(d).filter(j=>d[j]).map(j=>ne[Number(j)]?.remoteJid).filter(Boolean),[d,ne]);v.useEffect(()=>{k(x),f({})},[g,x]);const se=()=>{ce()},H=()=>{b(h)},W=()=>{m(pp),b(pp)},V=async(j,I)=>{try{if(!n)return;await r({instanceName:n.name,token:n.token,remoteJid:j,status:I}),Q.success(t("evolutionBot.toast.success.status")),se()}catch(me){console.error("Error:",me),Q.error(`Error : ${me?.response?.data?.response?.message}`)}},A=async()=>{if(Y.length===0){Q.error(t("sessions.mass.noneSelected"));return}try{if(!n)return;await Promise.all(Y.map(j=>r({instanceName:n.name,token:n.token,remoteJid:j,status:N}))),Q.success(t("sessions.mass.success")),f({}),se()}catch(j){console.error(j),Q.error(j?.response?.data?.response?.message??t("sessions.mass.error"))}},K=j=>{O(j),F(""),P(!0)},re=async()=>{if(!D.trim()){Q.error(t("sessions.send.empty"));return}try{if(!n)return;te(!0),await Ce.post(`/message/sendText/${n.name}`,{number:M,text:D},{headers:{apikey:n.token}}),Q.success(t("sessions.send.success")),P(!1),F(""),O("")}catch(j){console.error("Error:",j),Q.error(j?.response?.data?.response?.message??j?.message??t("sessions.send.error"))}finally{te(!1)}},ee=[{id:"select",header:({table:j})=>s.jsx(ts,{checked:j.getIsAllPageRowsSelected()||j.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:I=>j.toggleAllPageRowsSelected(!!I),"aria-label":t("sessions.mass.selectAll")}),cell:({row:j})=>s.jsx(ts,{checked:j.getIsSelected(),onCheckedChange:I=>j.toggleSelected(!!I),"aria-label":t("sessions.mass.selectAll")}),enableSorting:!1},{accessorKey:"remoteJid",header:()=>s.jsx("div",{className:"text-center",children:t("evolutionBot.sessions.table.remoteJid")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>s.jsx("div",{className:"text-center",children:t("evolutionBot.sessions.table.pushName")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("pushName")})},{accessorKey:"sessionId",header:()=>s.jsx("div",{className:"text-center",children:t("evolutionBot.sessions.table.sessionId")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("sessionId")})},{accessorKey:"status",header:()=>s.jsx("div",{className:"text-center",children:t("evolutionBot.sessions.table.status")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:j})=>{const I=j.original;return s.jsxs(vs,{children:[s.jsx(ys,{asChild:!0,children:s.jsxs($,{variant:"ghost",size:"icon",children:[s.jsx("span",{className:"sr-only",children:t("evolutionBot.sessions.table.actions.title")}),s.jsx(Xo,{className:"h-4 w-4"})]})}),s.jsxs(xs,{align:"end",children:[s.jsx(ei,{children:t("evolutionBot.sessions.table.actions.title")}),s.jsx(ti,{}),I.status!=="opened"&&s.jsxs(Ct,{onClick:()=>V(I.remoteJid,"opened"),children:[s.jsx(al,{className:"mr-2 h-4 w-4"}),t("evolutionBot.sessions.table.actions.open")]}),I.status!=="paused"&&I.status!=="closed"&&s.jsxs(Ct,{onClick:()=>V(I.remoteJid,"paused"),children:[s.jsx(sl,{className:"mr-2 h-4 w-4"}),t("evolutionBot.sessions.table.actions.pause")]}),I.status!=="closed"&&s.jsxs(Ct,{onClick:()=>V(I.remoteJid,"closed"),children:[s.jsx(el,{className:"mr-2 h-4 w-4"}),t("evolutionBot.sessions.table.actions.close")]}),s.jsxs(Ct,{onClick:()=>K(I.remoteJid),children:[s.jsx(rl,{className:"mr-2 h-4 w-4"}),t("sessions.actions.sendMessage")]}),s.jsxs(Ct,{onClick:()=>V(I.remoteJid,"delete"),children:[s.jsx(tl,{className:"mr-2 h-4 w-4"}),t("evolutionBot.sessions.table.actions.delete")]})]})]})}}],ie=["all","5","10","15","20","30","60",">60",">120",">300",">1440","custom"],ue=["all","opened","paused","closed"];return s.jsxs(vt,{open:a,onOpenChange:o,children:[s.jsx(an,{asChild:!0,children:s.jsxs($,{variant:"secondary",size:"sm",children:[s.jsx(nl,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden md:inline",children:t("evolutionBot.sessions.label")})]})}),s.jsxs(mt,{className:"max-w-7xl h-[85vh] flex flex-col overflow-hidden",children:[s.jsx(gt,{children:s.jsx(xt,{children:t("evolutionBot.sessions.label")})}),s.jsxs("div",{className:"flex-1 space-y-4 overflow-y-auto pr-2",children:[s.jsxs(Un,{children:[s.jsx(Yn,{children:s.jsx(Zn,{className:"text-base",children:t("sessions.filters.title")})}),s.jsxs(Vn,{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.name")}),s.jsx(Z,{placeholder:t("sessions.filters.namePlaceholder"),value:h.name,onChange:j=>m(I=>({...I,name:j.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.number")}),s.jsx(Z,{placeholder:t("sessions.filters.numberPlaceholder"),value:h.number,onChange:j=>m(I=>({...I,number:j.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.status")}),s.jsxs(_t,{value:h.status,onValueChange:j=>m(I=>({...I,status:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsx(It,{children:ue.map(j=>s.jsx(we,{value:j,children:t(`sessions.filters.statusOptions.${j}`)},j))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.time")}),s.jsxs(_t,{value:h.time,onValueChange:j=>m(I=>({...I,time:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsx(It,{children:ie.map(j=>s.jsx(we,{value:j,children:t(`sessions.filters.timeOptions.${j}`)},j))})]})]})]}),h.time==="custom"&&s.jsxs("div",{className:"grid grid-cols-1 gap-2 md:grid-cols-3",children:[s.jsxs(_t,{value:h.customCondition,onValueChange:j=>m(I=>({...I,customCondition:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"more",children:t("sessions.filters.custom.more")}),s.jsx(we,{value:"less",children:t("sessions.filters.custom.less")})]})]}),s.jsx(Z,{type:"number",min:1,placeholder:t("sessions.filters.custom.valuePlaceholder"),value:h.customValue,onChange:j=>m(I=>({...I,customValue:j.target.value}))}),s.jsxs(_t,{value:h.customUnit,onValueChange:j=>m(I=>({...I,customUnit:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"minutes",children:t("sessions.filters.custom.minutes")}),s.jsx(we,{value:"hours",children:t("sessions.filters.custom.hours")}),s.jsx(we,{value:"days",children:t("sessions.filters.custom.days")})]})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx($,{onClick:H,size:"sm",children:t("sessions.filters.apply")}),s.jsx($,{onClick:W,size:"sm",variant:"outline",children:t("sessions.filters.clear")}),s.jsxs($,{onClick:se,size:"sm",variant:"outline",children:[s.jsx(ol,{size:14,className:"mr-1"}),t("button.refresh")]})]})]})]}),Y.length>0&&s.jsxs(Un,{children:[s.jsx(Yn,{children:s.jsx(Zn,{className:"text-base",children:t("sessions.mass.title")})}),s.jsx(Vn,{children:s.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:t("sessions.mass.selected",{count:Y.length})}),s.jsxs("div",{className:"flex-1 min-w-[180px] space-y-1",children:[s.jsx(Ve,{children:t("sessions.mass.newStatus")}),s.jsxs(_t,{value:N,onValueChange:T,children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"opened",children:t("evolutionBot.sessions.table.actions.open")}),s.jsx(we,{value:"paused",children:t("evolutionBot.sessions.table.actions.pause")}),s.jsx(we,{value:"closed",children:t("evolutionBot.sessions.table.actions.close")}),s.jsx(we,{value:"delete",children:t("evolutionBot.sessions.table.actions.delete")})]})]})]}),s.jsx($,{onClick:A,size:"sm",children:t("sessions.mass.apply")})]})})]}),s.jsx(ci,{columns:ee,data:ne,onSortingChange:u,state:{sorting:l,rowSelection:d},onRowSelectionChange:f,enableRowSelection:!0,getRowId:(j,I)=>String(I),noResultsMessage:t("sessions.empty")}),s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 px-1 text-sm text-muted-foreground",children:[s.jsx("span",{children:t("sessions.pagination.showing",{shown:ne.length,total:q.length})}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(Ve,{htmlFor:"per-page",className:"text-xs",children:t("sessions.pagination.perPage")}),s.jsxs(_t,{value:String(x),onValueChange:j=>w(parseInt(j)),children:[s.jsx(Rt,{id:"per-page",className:"h-8 w-20",children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"9",children:"9"}),s.jsx(we,{value:"25",children:"25"}),s.jsx(we,{value:"50",children:"50"}),s.jsx(we,{value:"100",children:"100"})]})]}),Ck(j=>Math.min(j+x,q.length)),children:t("sessions.pagination.showMore")}),Ck(q.length),children:t("sessions.pagination.showAll")}),C>x&&s.jsx($,{size:"sm",variant:"outline",onClick:()=>k(x),children:t("sessions.pagination.showLess")})]})]})]}),s.jsx(vt,{open:_,onOpenChange:j=>!B&&P(j),children:s.jsxs(mt,{className:"sm:max-w-md",children:[s.jsx(gt,{children:s.jsx(xt,{children:t("sessions.send.title")})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{children:t("sessions.send.to")}),s.jsx(Z,{value:M,disabled:!0})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{children:t("sessions.send.messagePlaceholder")}),s.jsx(ni,{rows:4,placeholder:t("sessions.send.messagePlaceholder"),value:D,onChange:j=>F(j.target.value)})]})]}),s.jsxs(Kt,{children:[s.jsx($,{variant:"outline",onClick:()=>P(!1),disabled:B,children:t("button.cancel")}),s.jsx($,{onClick:re,disabled:B,children:t(B?"sessions.send.sending":"sessions.send.send")})]})]})})]})]})}const Sre=fn({enabled:Me(),description:he(),apiUrl:he(),apiKey:he().optional(),triggerType:he(),triggerOperator:he().optional(),triggerValue:he().optional(),expire:ot.number().optional(),keywordFinish:he().optional(),delayMessage:ot.number().optional(),unknownMessage:he().optional(),listeningFromMe:Me().optional(),stopBotFromMe:Me().optional(),keepOpen:Me().optional(),debounceTime:ot.number().optional(),splitMessages:Me().optional(),timePerChar:ot.number().optional()});function gO({initialData:e,onSubmit:t,handleDelete:n,evolutionBotId:r,isModal:a=!1,isLoading:o=!1,openDeletionDialog:l=!1,setOpenDeletionDialog:u=()=>{}}){const{t:d}=Le(),f=mn({resolver:gn(Sre),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 s.jsx(yr,{...f,children:s.jsxs("form",{onSubmit:f.handleSubmit(t),className:"w-full space-y-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsx(Re,{name:"enabled",label:d("evolutionBot.form.enabled.label"),reverse:!0}),s.jsx(pe,{name:"description",label:d("evolutionBot.form.description.label"),required:!0,children:s.jsx(Z,{})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("evolutionBot.form.evolutionBotSettings.label")}),s.jsx(Yt,{})]}),s.jsx(pe,{name:"apiUrl",label:d("evolutionBot.form.apiUrl.label"),required:!0,children:s.jsx(Z,{})}),s.jsx(pe,{name:"apiKey",label:d("evolutionBot.form.apiKey.label"),children:s.jsx(Z,{type:"password"})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("evolutionBot.form.triggerSettings.label")}),s.jsx(Yt,{})]}),s.jsx(un,{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"&&s.jsxs(s.Fragment,{children:[s.jsx(un,{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"}]}),s.jsx(pe,{name:"triggerValue",label:d("evolutionBot.form.triggerValue.label"),children:s.jsx(Z,{})})]}),h==="advanced"&&s.jsx(pe,{name:"triggerValue",label:d("evolutionBot.form.triggerConditions.label"),children:s.jsx(Z,{})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("evolutionBot.form.generalSettings.label")}),s.jsx(Yt,{})]}),s.jsx(pe,{name:"expire",label:d("evolutionBot.form.expire.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(pe,{name:"keywordFinish",label:d("evolutionBot.form.keywordFinish.label"),children:s.jsx(Z,{})}),s.jsx(pe,{name:"delayMessage",label:d("evolutionBot.form.delayMessage.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(pe,{name:"unknownMessage",label:d("evolutionBot.form.unknownMessage.label"),children:s.jsx(Z,{})}),s.jsx(Re,{name:"listeningFromMe",label:d("evolutionBot.form.listeningFromMe.label"),reverse:!0}),s.jsx(Re,{name:"stopBotFromMe",label:d("evolutionBot.form.stopBotFromMe.label"),reverse:!0}),s.jsx(Re,{name:"keepOpen",label:d("evolutionBot.form.keepOpen.label"),reverse:!0}),s.jsx(pe,{name:"debounceTime",label:d("evolutionBot.form.debounceTime.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(Re,{name:"splitMessages",label:d("evolutionBot.form.splitMessages.label"),reverse:!0}),f.watch("splitMessages")&&s.jsx(pe,{name:"timePerChar",label:d("evolutionBot.form.timePerChar.label"),children:s.jsx(Z,{type:"number"})})]}),a&&s.jsx(Kt,{children:s.jsx($,{disabled:o,type:"submit",children:d(o?"evolutionBot.button.saving":"evolutionBot.button.save")})}),!a&&s.jsxs("div",{children:[s.jsx(mO,{evolutionBotId:r}),s.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[s.jsxs(vt,{open:l,onOpenChange:u,children:[s.jsx(an,{asChild:!0,children:s.jsx($,{variant:"destructive",size:"sm",children:d("dify.button.delete")})}),s.jsx(mt,{children:s.jsxs(gt,{children:[s.jsx(xt,{children:d("modal.delete.title")}),s.jsx(gr,{children:d("modal.delete.messageSingle")}),s.jsxs(Kt,{children:[s.jsx($,{size:"sm",variant:"outline",onClick:()=>u(!1),children:d("button.cancel")}),s.jsx($,{variant:"destructive",onClick:n,children:d("button.delete")})]})]})})]}),s.jsx($,{disabled:o,type:"submit",children:d(o?"evolutionBot.button.saving":"evolutionBot.button.update")})]})]})]})})}function Cre({resetTable:e}){const{t}=Le(),{instance:n}=ct(),[r,a]=v.useState(!1),[o,l]=v.useState(!1),{createEvolutionBot:u}=Im(),d=async f=>{try{if(!n||!n.name)throw new Error("instance not found");a(!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}),Q.success(t("evolutionBot.toast.success.create")),l(!1),e()}catch(h){console.error("Error:",h),Q.error(`Error: ${h?.response?.data?.response?.message}`)}finally{a(!1)}};return s.jsxs(vt,{open:o,onOpenChange:l,children:[s.jsx(an,{asChild:!0,children:s.jsxs($,{size:"sm",children:[s.jsx($r,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:t("evolutionBot.button.create")})]})}),s.jsxs(mt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[s.jsx(gt,{children:s.jsx(xt,{children:t("evolutionBot.form.title")})}),s.jsx(gO,{onSubmit:d,isModal:!0,isLoading:r})]})]})}const jre=e=>["evolutionBot","getEvolutionBot",JSON.stringify(e)],kre=async({instanceName:e,token:t,evolutionBotId:n})=>{const r=await Ce.get(`/evolutionBot/fetch/${n}/${e}`,{headers:{apiKey:t}});return Array.isArray(r.data)?r.data[0]:r.data},Ere=e=>{const{instanceName:t,token:n,evolutionBotId:r,...a}=e;return pt({...a,queryKey:jre({instanceName:t}),queryFn:()=>kre({instanceName:t,token:n,evolutionBotId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function Nre({evolutionBotId:e,resetTable:t}){const{t:n}=Le(),{instance:r}=ct(),a=Nn(),[o,l]=v.useState(!1),{deleteEvolutionBot:u,updateEvolutionBot:d}=Im(),{data:f,isLoading:h}=Ere({instanceName:r?.name,evolutionBotId:e}),m=v.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 x=>{try{if(r&&r.name&&e){const w={enabled:x.enabled,description:x.description,apiUrl:x.apiUrl,apiKey:x.apiKey,triggerType:x.triggerType,triggerOperator:x.triggerOperator||"",triggerValue:x.triggerValue||"",expire:x.expire||0,keywordFinish:x.keywordFinish||"",delayMessage:x.delayMessage||1e3,unknownMessage:x.unknownMessage||"",listeningFromMe:x.listeningFromMe||!1,stopBotFromMe:x.stopBotFromMe||!1,keepOpen:x.keepOpen||!1,debounceTime:x.debounceTime||0,splitMessages:x.splitMessages||!1,timePerChar:x.timePerChar?x.timePerChar:0};await d({instanceName:r.name,evolutionBotId:e,data:w}),Q.success(n("evolutionBot.toast.success.update")),t(),a(`/manager/instance/${r.id}/evolutionBot/${e}`)}else console.error("Token not found")}catch(w){console.error("Error:",w),Q.error(`Error: ${w?.response?.data?.response?.message}`)}},b=async()=>{try{r&&r.name&&e?(await u({instanceName:r.name,evolutionBotId:e}),Q.success(n("evolutionBot.toast.success.delete")),l(!1),t(),a(`/manager/instance/${r.id}/evolutionBot`)):console.error("instance not found")}catch(x){console.error("Erro ao excluir evolutionBot:",x)}};return h?s.jsx(Hn,{}):s.jsx("div",{className:"m-4",children:s.jsx(gO,{initialData:m,onSubmit:g,evolutionBotId:e,handleDelete:b,isModal:!1,openDeletionDialog:o,setOpenDeletionDialog:l})})}function _E(){const{t:e}=Le(),t=eo("(min-width: 768px)"),{instance:n}=ct(),{evolutionBotId:r}=Os(),{data:a,isLoading:o,refetch:l,error:u}=hO({instanceName:n?.name}),d=Nn(),f=m=>{n&&d(`/manager/instance/${n.id}/evolutionBot/${m}`)},h=()=>{l()};return s.jsx("main",{className:"pt-5",children:s.jsxs(ia,{error:u,name:"Evolution Bot",envVar:"EVOLUTION_BOT_ENABLED",children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[s.jsx("h3",{className:"text-lg font-medium",children:e("evolutionBot.title")}),s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsx(mO,{}),s.jsx(gre,{}),s.jsx(Cre,{resetTable:h})]})]}),s.jsx(Yt,{className:"my-4"}),s.jsxs(ii,{direction:t?"horizontal":"vertical",children:[s.jsx(Mr,{defaultSize:r?35:100,className:"pr-4",children:s.jsx("div",{className:"flex flex-col gap-3",children:o?s.jsx(Hn,{}):s.jsx(s.Fragment,{children:a&&a.length>0&&Array.isArray(a)?a.map(m=>s.jsx($,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>f(`${m.id}`),variant:r===m.id?"secondary":"outline",children:s.jsx("h4",{className:"text-base",children:m.description||m.id})},m.id)):s.jsx($,{variant:"link",children:e("evolutionBot.table.none")})})})}),r&&s.jsxs(s.Fragment,{children:[s.jsx(li,{withHandle:!0,className:"border border-border"}),s.jsx(Mr,{children:s.jsx(Nre,{evolutionBotId:r,resetTable:h})})]})]})]})})}const Tre=e=>["flowise","findFlowise",JSON.stringify(e)],Mre=async({instanceName:e,token:t})=>(await Ce.get(`/flowise/find/${e}`,{headers:{apiKey:t}})).data,vO=e=>{const{instanceName:t,token:n,...r}=e;return pt({...r,queryKey:Tre({instanceName:t}),queryFn:()=>Mre({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},_re=e=>["flowise","fetchDefaultSettings",JSON.stringify(e)],Pre=async({instanceName:e,token:t})=>{const n=await Ce.get(`/flowise/fetchSettings/${e}`,{headers:{apiKey:t}});return Array.isArray(n.data)?n.data[0]:n.data},Rre=e=>{const{instanceName:t,token:n,...r}=e;return pt({...r,queryKey:_re({instanceName:t}),queryFn:()=>Pre({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},Ire=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/flowise/create/${e}`,n,{headers:{apikey:t}})).data,Ore=async({instanceName:e,flowiseId:t,data:n})=>(await Ce.put(`/flowise/update/${t}/${e}`,n)).data,Are=async({instanceName:e,flowiseId:t})=>(await Ce.delete(`/flowise/delete/${t}/${e}`)).data,Dre=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await Ce.post(`/flowise/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data,Fre=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/flowise/settings/${e}`,n,{headers:{apikey:t}})).data;function Om(){const e=nt(Fre,{invalidateKeys:[["flowise","fetchDefaultSettings"]]}),t=nt(Dre,{invalidateKeys:[["flowise","getFlowise"],["flowise","fetchSessions"]]}),n=nt(Are,{invalidateKeys:[["flowise","getFlowise"],["flowise","findFlowise"],["flowise","fetchSessions"]]}),r=nt(Ore,{invalidateKeys:[["flowise","getFlowise"],["flowise","findFlowise"],["flowise","fetchSessions"]]}),a=nt(Ire,{invalidateKeys:[["flowise","findFlowise"]]});return{setDefaultSettingsFlowise:e,changeStatusFlowise:t,deleteFlowise:n,updateFlowise:r,createFlowise:a}}const Lre=fn({expire:he(),keywordFinish:he(),delayMessage:he(),unknownMessage:he(),listeningFromMe:Me(),stopBotFromMe:Me(),keepOpen:Me(),debounceTime:he(),ignoreJids:Ds(he()).default([]),flowiseIdFallback:_c([Mc(),he()]).optional(),splitMessages:Me(),timePerChar:he()});function $re(){const{t:e}=Le(),{instance:t}=ct(),{setDefaultSettingsFlowise:n}=Om(),[r,a]=v.useState(!1),{data:o,refetch:l}=Rre({instanceName:t?.name,enabled:r}),{data:u,refetch:d}=vO({instanceName:t?.name,enabled:r}),f=mn({resolver:gn(Lre),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&&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 b={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:b}),Q.success(e("flowise.toast.defaultSettings.success"))}catch(b){console.error("Error:",b),Q.error(`Error: ${b?.response?.data?.response?.message}`)}};function m(){l(),d()}return s.jsxs(vt,{open:r,onOpenChange:a,children:[s.jsx(an,{asChild:!0,children:s.jsxs($,{variant:"secondary",size:"sm",children:[s.jsx(Zo,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:e("flowise.defaultSettings")})]})}),s.jsxs(mt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:m,children:[s.jsx(gt,{children:s.jsx(xt,{children:e("flowise.defaultSettings")})}),s.jsx(yr,{...f,children:s.jsxs("form",{className:"w-full space-y-6",onSubmit:f.handleSubmit(h),children:[s.jsx("div",{children:s.jsxs("div",{className:"space-y-4",children:[s.jsx(un,{name:"flowiseIdFallback",label:e("flowise.form.flowiseIdFallback.label"),options:u?.filter(g=>!!g.id).map(g=>({label:g.description,value:g.id}))??[]}),s.jsx(pe,{name:"expire",label:e("flowise.form.expire.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(pe,{name:"keywordFinish",label:e("flowise.form.keywordFinish.label"),children:s.jsx(Z,{})}),s.jsx(pe,{name:"delayMessage",label:e("flowise.form.delayMessage.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(pe,{name:"unknownMessage",label:e("flowise.form.unknownMessage.label"),children:s.jsx(Z,{})}),s.jsx(Re,{name:"listeningFromMe",label:e("flowise.form.listeningFromMe.label"),reverse:!0}),s.jsx(Re,{name:"stopBotFromMe",label:e("flowise.form.stopBotFromMe.label"),reverse:!0}),s.jsx(Re,{name:"keepOpen",label:e("flowise.form.keepOpen.label"),reverse:!0}),s.jsx(pe,{name:"debounceTime",label:e("flowise.form.debounceTime.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(Re,{name:"splitMessages",label:e("flowise.form.splitMessages.label"),reverse:!0}),f.watch("splitMessages")&&s.jsx(pe,{name:"timePerChar",label:e("flowise.form.timePerChar.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(ai,{name:"ignoreJids",label:e("flowise.form.ignoreJids.label"),placeholder:e("flowise.form.ignoreJids.placeholder")})]})}),s.jsx(Kt,{children:s.jsx($,{type:"submit",children:e("flowise.button.save")})})]})})]})]})}const Bre=e=>["flowise","fetchSessions",JSON.stringify(e)],zre=async({instanceName:e,flowiseId:t,token:n})=>(await Ce.get(`/flowise/fetchSessions/${t}/${e}`,{headers:{apiKey:n}})).data,Ure=e=>{const{instanceName:t,token:n,flowiseId:r,...a}=e;return pt({...a,queryKey:Bre({instanceName:t}),queryFn:()=>zre({instanceName:t,token:n,flowiseId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})},hp={name:"",number:"",status:"all",time:"all",customCondition:"more",customValue:"",customUnit:"minutes"};function Vre(e,t){const n=parseInt(e);return!n||isNaN(n)||n<=0?null:t==="hours"?n*60:t==="days"?n*1440:n}function qre(e,t){if(t.time==="all")return!0;const n=(Date.now()-new Date(e).getTime())/6e4;if(t.time==="custom"){const r=Vre(t.customValue,t.customUnit);return r===null?!0:t.customCondition==="more"?n>r:n<=r}if(t.time.startsWith(">")){const r=parseInt(t.time.slice(1));return n>r}return n<=parseInt(t.time)}function yO({flowiseId:e}){const{t}=Le(),{instance:n}=ct(),{changeStatusFlowise:r}=Om(),[a,o]=v.useState(!1),[l,u]=v.useState([]),[d,f]=v.useState({}),[h,m]=v.useState(hp),[g,b]=v.useState(hp),[x,w]=v.useState(9),[C,k]=v.useState(9),[N,T]=v.useState("opened"),[_,P]=v.useState(!1),[M,O]=v.useState(""),[D,F]=v.useState(""),[B,te]=v.useState(!1),{data:U,refetch:ce}=Ure({instanceName:n?.name,flowiseId:e,enabled:a}),q=v.useMemo(()=>{const j=U??[],I=g.name.trim().toLowerCase(),me=g.number.trim();return j.filter(be=>!(I&&!be.pushName?.toLowerCase().includes(I)||me&&!be.remoteJid.includes(me)||g.status!=="all"&&be.status!==g.status||!qre(be.updatedAt,g)))},[U,g]),ne=q.slice(0,C),Y=v.useMemo(()=>Object.keys(d).filter(j=>d[j]).map(j=>ne[Number(j)]?.remoteJid).filter(Boolean),[d,ne]);v.useEffect(()=>{k(x),f({})},[g,x]);const se=()=>{ce()},H=()=>{b(h)},W=()=>{m(hp),b(hp)},V=async(j,I)=>{try{if(!n)return;await r({instanceName:n.name,token:n.token,remoteJid:j,status:I}),Q.success(t("flowise.toast.success.status")),se()}catch(me){console.error("Error:",me),Q.error(`Error : ${me?.response?.data?.response?.message}`)}},A=async()=>{if(Y.length===0){Q.error(t("sessions.mass.noneSelected"));return}try{if(!n)return;await Promise.all(Y.map(j=>r({instanceName:n.name,token:n.token,remoteJid:j,status:N}))),Q.success(t("sessions.mass.success")),f({}),se()}catch(j){console.error(j),Q.error(j?.response?.data?.response?.message??t("sessions.mass.error"))}},K=j=>{O(j),F(""),P(!0)},re=async()=>{if(!D.trim()){Q.error(t("sessions.send.empty"));return}try{if(!n)return;te(!0),await Ce.post(`/message/sendText/${n.name}`,{number:M,text:D},{headers:{apikey:n.token}}),Q.success(t("sessions.send.success")),P(!1),F(""),O("")}catch(j){console.error("Error:",j),Q.error(j?.response?.data?.response?.message??j?.message??t("sessions.send.error"))}finally{te(!1)}},ee=[{id:"select",header:({table:j})=>s.jsx(ts,{checked:j.getIsAllPageRowsSelected()||j.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:I=>j.toggleAllPageRowsSelected(!!I),"aria-label":t("sessions.mass.selectAll")}),cell:({row:j})=>s.jsx(ts,{checked:j.getIsSelected(),onCheckedChange:I=>j.toggleSelected(!!I),"aria-label":t("sessions.mass.selectAll")}),enableSorting:!1},{accessorKey:"remoteJid",header:()=>s.jsx("div",{className:"text-center",children:t("flowise.sessions.table.remoteJid")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>s.jsx("div",{className:"text-center",children:t("flowise.sessions.table.pushName")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("pushName")})},{accessorKey:"sessionId",header:()=>s.jsx("div",{className:"text-center",children:t("flowise.sessions.table.sessionId")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("sessionId")})},{accessorKey:"status",header:()=>s.jsx("div",{className:"text-center",children:t("flowise.sessions.table.status")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:j})=>{const I=j.original;return s.jsxs(vs,{children:[s.jsx(ys,{asChild:!0,children:s.jsxs($,{variant:"ghost",size:"icon",children:[s.jsx("span",{className:"sr-only",children:t("flowise.sessions.table.actions.title")}),s.jsx(Xo,{className:"h-4 w-4"})]})}),s.jsxs(xs,{align:"end",children:[s.jsx(ei,{children:t("flowise.sessions.table.actions.title")}),s.jsx(ti,{}),I.status!=="opened"&&s.jsxs(Ct,{onClick:()=>V(I.remoteJid,"opened"),children:[s.jsx(al,{className:"mr-2 h-4 w-4"}),t("flowise.sessions.table.actions.open")]}),I.status!=="paused"&&I.status!=="closed"&&s.jsxs(Ct,{onClick:()=>V(I.remoteJid,"paused"),children:[s.jsx(sl,{className:"mr-2 h-4 w-4"}),t("flowise.sessions.table.actions.pause")]}),I.status!=="closed"&&s.jsxs(Ct,{onClick:()=>V(I.remoteJid,"closed"),children:[s.jsx(el,{className:"mr-2 h-4 w-4"}),t("flowise.sessions.table.actions.close")]}),s.jsxs(Ct,{onClick:()=>K(I.remoteJid),children:[s.jsx(rl,{className:"mr-2 h-4 w-4"}),t("sessions.actions.sendMessage")]}),s.jsxs(Ct,{onClick:()=>V(I.remoteJid,"delete"),children:[s.jsx(tl,{className:"mr-2 h-4 w-4"}),t("flowise.sessions.table.actions.delete")]})]})]})}}],ie=["all","5","10","15","20","30","60",">60",">120",">300",">1440","custom"],ue=["all","opened","paused","closed"];return s.jsxs(vt,{open:a,onOpenChange:o,children:[s.jsx(an,{asChild:!0,children:s.jsxs($,{variant:"secondary",size:"sm",children:[s.jsx(nl,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden md:inline",children:t("flowise.sessions.label")})]})}),s.jsxs(mt,{className:"max-w-7xl h-[85vh] flex flex-col overflow-hidden",children:[s.jsx(gt,{children:s.jsx(xt,{children:t("flowise.sessions.label")})}),s.jsxs("div",{className:"flex-1 space-y-4 overflow-y-auto pr-2",children:[s.jsxs(Un,{children:[s.jsx(Yn,{children:s.jsx(Zn,{className:"text-base",children:t("sessions.filters.title")})}),s.jsxs(Vn,{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.name")}),s.jsx(Z,{placeholder:t("sessions.filters.namePlaceholder"),value:h.name,onChange:j=>m(I=>({...I,name:j.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.number")}),s.jsx(Z,{placeholder:t("sessions.filters.numberPlaceholder"),value:h.number,onChange:j=>m(I=>({...I,number:j.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.status")}),s.jsxs(_t,{value:h.status,onValueChange:j=>m(I=>({...I,status:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsx(It,{children:ue.map(j=>s.jsx(we,{value:j,children:t(`sessions.filters.statusOptions.${j}`)},j))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.time")}),s.jsxs(_t,{value:h.time,onValueChange:j=>m(I=>({...I,time:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsx(It,{children:ie.map(j=>s.jsx(we,{value:j,children:t(`sessions.filters.timeOptions.${j}`)},j))})]})]})]}),h.time==="custom"&&s.jsxs("div",{className:"grid grid-cols-1 gap-2 md:grid-cols-3",children:[s.jsxs(_t,{value:h.customCondition,onValueChange:j=>m(I=>({...I,customCondition:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"more",children:t("sessions.filters.custom.more")}),s.jsx(we,{value:"less",children:t("sessions.filters.custom.less")})]})]}),s.jsx(Z,{type:"number",min:1,placeholder:t("sessions.filters.custom.valuePlaceholder"),value:h.customValue,onChange:j=>m(I=>({...I,customValue:j.target.value}))}),s.jsxs(_t,{value:h.customUnit,onValueChange:j=>m(I=>({...I,customUnit:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"minutes",children:t("sessions.filters.custom.minutes")}),s.jsx(we,{value:"hours",children:t("sessions.filters.custom.hours")}),s.jsx(we,{value:"days",children:t("sessions.filters.custom.days")})]})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx($,{onClick:H,size:"sm",children:t("sessions.filters.apply")}),s.jsx($,{onClick:W,size:"sm",variant:"outline",children:t("sessions.filters.clear")}),s.jsxs($,{onClick:se,size:"sm",variant:"outline",children:[s.jsx(ol,{size:14,className:"mr-1"}),t("button.refresh")]})]})]})]}),Y.length>0&&s.jsxs(Un,{children:[s.jsx(Yn,{children:s.jsx(Zn,{className:"text-base",children:t("sessions.mass.title")})}),s.jsx(Vn,{children:s.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:t("sessions.mass.selected",{count:Y.length})}),s.jsxs("div",{className:"flex-1 min-w-[180px] space-y-1",children:[s.jsx(Ve,{children:t("sessions.mass.newStatus")}),s.jsxs(_t,{value:N,onValueChange:T,children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"opened",children:t("flowise.sessions.table.actions.open")}),s.jsx(we,{value:"paused",children:t("flowise.sessions.table.actions.pause")}),s.jsx(we,{value:"closed",children:t("flowise.sessions.table.actions.close")}),s.jsx(we,{value:"delete",children:t("flowise.sessions.table.actions.delete")})]})]})]}),s.jsx($,{onClick:A,size:"sm",children:t("sessions.mass.apply")})]})})]}),s.jsx(ci,{columns:ee,data:ne,onSortingChange:u,state:{sorting:l,rowSelection:d},onRowSelectionChange:f,enableRowSelection:!0,getRowId:(j,I)=>String(I),noResultsMessage:t("sessions.empty")}),s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 px-1 text-sm text-muted-foreground",children:[s.jsx("span",{children:t("sessions.pagination.showing",{shown:ne.length,total:q.length})}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(Ve,{htmlFor:"per-page",className:"text-xs",children:t("sessions.pagination.perPage")}),s.jsxs(_t,{value:String(x),onValueChange:j=>w(parseInt(j)),children:[s.jsx(Rt,{id:"per-page",className:"h-8 w-20",children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"9",children:"9"}),s.jsx(we,{value:"25",children:"25"}),s.jsx(we,{value:"50",children:"50"}),s.jsx(we,{value:"100",children:"100"})]})]}),Ck(j=>Math.min(j+x,q.length)),children:t("sessions.pagination.showMore")}),Ck(q.length),children:t("sessions.pagination.showAll")}),C>x&&s.jsx($,{size:"sm",variant:"outline",onClick:()=>k(x),children:t("sessions.pagination.showLess")})]})]})]}),s.jsx(vt,{open:_,onOpenChange:j=>!B&&P(j),children:s.jsxs(mt,{className:"sm:max-w-md",children:[s.jsx(gt,{children:s.jsx(xt,{children:t("sessions.send.title")})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{children:t("sessions.send.to")}),s.jsx(Z,{value:M,disabled:!0})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{children:t("sessions.send.messagePlaceholder")}),s.jsx(ni,{rows:4,placeholder:t("sessions.send.messagePlaceholder"),value:D,onChange:j=>F(j.target.value)})]})]}),s.jsxs(Kt,{children:[s.jsx($,{variant:"outline",onClick:()=>P(!1),disabled:B,children:t("button.cancel")}),s.jsx($,{onClick:re,disabled:B,children:t(B?"sessions.send.sending":"sessions.send.send")})]})]})})]})]})}const Hre=fn({enabled:Me(),description:he(),apiUrl:he(),apiKey:he().optional(),triggerType:he(),triggerOperator:he().optional(),triggerValue:he().optional(),expire:ot.number().optional(),keywordFinish:he().optional(),delayMessage:ot.number().optional(),unknownMessage:he().optional(),listeningFromMe:Me().optional(),stopBotFromMe:Me().optional(),keepOpen:Me().optional(),debounceTime:ot.number().optional(),splitMessages:Me().optional(),timePerChar:ot.number().optional()});function xO({initialData:e,onSubmit:t,handleDelete:n,flowiseId:r,isModal:a=!1,isLoading:o=!1,openDeletionDialog:l=!1,setOpenDeletionDialog:u=()=>{}}){const{t:d}=Le(),f=mn({resolver:gn(Hre),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 s.jsx(yr,{...f,children:s.jsxs("form",{onSubmit:f.handleSubmit(t),className:"w-full space-y-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsx(Re,{name:"enabled",label:d("flowise.form.enabled.label"),reverse:!0}),s.jsx(pe,{name:"description",label:d("flowise.form.description.label"),required:!0,children:s.jsx(Z,{})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("flowise.form.flowiseSettings.label")}),s.jsx(Yt,{})]}),s.jsx(pe,{name:"apiUrl",label:d("flowise.form.apiUrl.label"),required:!0,children:s.jsx(Z,{})}),s.jsx(pe,{name:"apiKey",label:d("flowise.form.apiKey.label"),children:s.jsx(Z,{type:"password"})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("flowise.form.triggerSettings.label")}),s.jsx(Yt,{})]}),s.jsx(un,{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"&&s.jsxs(s.Fragment,{children:[s.jsx(un,{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"}]}),s.jsx(pe,{name:"triggerValue",label:d("flowise.form.triggerValue.label"),children:s.jsx(Z,{})})]}),h==="advanced"&&s.jsx(pe,{name:"triggerValue",label:d("flowise.form.triggerConditions.label"),children:s.jsx(Z,{})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("flowise.form.generalSettings.label")}),s.jsx(Yt,{})]}),s.jsx(pe,{name:"expire",label:d("flowise.form.expire.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(pe,{name:"keywordFinish",label:d("flowise.form.keywordFinish.label"),children:s.jsx(Z,{})}),s.jsx(pe,{name:"delayMessage",label:d("flowise.form.delayMessage.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(pe,{name:"unknownMessage",label:d("flowise.form.unknownMessage.label"),children:s.jsx(Z,{})}),s.jsx(Re,{name:"listeningFromMe",label:d("flowise.form.listeningFromMe.label"),reverse:!0}),s.jsx(Re,{name:"stopBotFromMe",label:d("flowise.form.stopBotFromMe.label"),reverse:!0}),s.jsx(Re,{name:"keepOpen",label:d("flowise.form.keepOpen.label"),reverse:!0}),s.jsx(pe,{name:"debounceTime",label:d("flowise.form.debounceTime.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(Re,{name:"splitMessages",label:d("flowise.form.splitMessages.label"),reverse:!0}),f.watch("splitMessages")&&s.jsx(pe,{name:"timePerChar",label:d("flowise.form.timePerChar.label"),children:s.jsx(Z,{type:"number"})})]}),a&&s.jsx(Kt,{children:s.jsx($,{disabled:o,type:"submit",children:d(o?"flowise.button.saving":"flowise.button.save")})}),!a&&s.jsxs("div",{children:[s.jsx(yO,{flowiseId:r}),s.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[s.jsxs(vt,{open:l,onOpenChange:u,children:[s.jsx(an,{asChild:!0,children:s.jsx($,{variant:"destructive",size:"sm",children:d("dify.button.delete")})}),s.jsx(mt,{children:s.jsxs(gt,{children:[s.jsx(xt,{children:d("modal.delete.title")}),s.jsx(gr,{children:d("modal.delete.messageSingle")}),s.jsxs(Kt,{children:[s.jsx($,{size:"sm",variant:"outline",onClick:()=>u(!1),children:d("button.cancel")}),s.jsx($,{variant:"destructive",onClick:n,children:d("button.delete")})]})]})})]}),s.jsx($,{disabled:o,type:"submit",children:d(o?"flowise.button.saving":"flowise.button.update")})]})]})]})})}function Wre({resetTable:e}){const{t}=Le(),{instance:n}=ct(),{createFlowise:r}=Om(),[a,o]=v.useState(!1),[l,u]=v.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}),Q.success(t("flowise.toast.success.create")),u(!1),e()}catch(h){console.error("Error:",h),Q.error(`Error: ${h?.response?.data?.response?.message}`)}finally{o(!1)}};return s.jsxs(vt,{open:l,onOpenChange:u,children:[s.jsx(an,{asChild:!0,children:s.jsxs($,{size:"sm",children:[s.jsx($r,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:t("flowise.button.create")})]})}),s.jsxs(mt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[s.jsx(gt,{children:s.jsx(xt,{children:t("flowise.form.title")})}),s.jsx(xO,{onSubmit:d,isModal:!0,isLoading:a})]})]})}const Kre=e=>["flowise","getFlowise",JSON.stringify(e)],Gre=async({instanceName:e,token:t,flowiseId:n})=>{const r=await Ce.get(`/flowise/fetch/${n}/${e}`,{headers:{apiKey:t}});return Array.isArray(r.data)?r.data[0]:r.data},Jre=e=>{const{instanceName:t,token:n,flowiseId:r,...a}=e;return pt({...a,queryKey:Kre({instanceName:t}),queryFn:()=>Gre({instanceName:t,token:n,flowiseId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function Qre({flowiseId:e,resetTable:t}){const{t:n}=Le(),{instance:r}=ct(),a=Nn(),[o,l]=v.useState(!1),{deleteFlowise:u,updateFlowise:d}=Om(),{data:f,isLoading:h}=Jre({instanceName:r?.name,flowiseId:e}),m=v.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 x=>{try{if(r&&r.name&&e){const w={enabled:x.enabled,description:x.description,apiUrl:x.apiUrl,apiKey:x.apiKey,triggerType:x.triggerType,triggerOperator:x.triggerOperator||"",triggerValue:x.triggerValue||"",expire:x.expire||0,keywordFinish:x.keywordFinish||"",delayMessage:x.delayMessage||1e3,unknownMessage:x.unknownMessage||"",listeningFromMe:x.listeningFromMe||!1,stopBotFromMe:x.stopBotFromMe||!1,keepOpen:x.keepOpen||!1,debounceTime:x.debounceTime||0,splitMessages:x.splitMessages||!1,timePerChar:x.timePerChar||0};await d({instanceName:r.name,flowiseId:e,data:w}),Q.success(n("flowise.toast.success.update")),t(),a(`/manager/instance/${r.id}/flowise/${e}`)}else console.error("Token not found")}catch(w){console.error("Error:",w),Q.error(`Error: ${w?.response?.data?.response?.message}`)}},b=async()=>{try{r&&r.name&&e?(await u({instanceName:r.name,flowiseId:e}),Q.success(n("flowise.toast.success.delete")),l(!1),t(),a(`/manager/instance/${r.id}/flowise`)):console.error("instance not found")}catch(x){console.error("Erro ao excluir dify:",x)}};return h?s.jsx(Hn,{}):s.jsx("div",{className:"m-4",children:s.jsx(xO,{initialData:m,onSubmit:g,flowiseId:e,handleDelete:b,isModal:!1,isLoading:h,openDeletionDialog:o,setOpenDeletionDialog:l})})}function PE(){const{t:e}=Le(),t=eo("(min-width: 768px)"),{instance:n}=ct(),{flowiseId:r}=Os(),{data:a,isLoading:o,refetch:l,error:u}=vO({instanceName:n?.name}),d=Nn(),f=m=>{n&&d(`/manager/instance/${n.id}/flowise/${m}`)},h=()=>{l()};return s.jsx("main",{className:"pt-5",children:s.jsxs(ia,{error:u,name:"Flowise",envVar:"FLOWISE_ENABLED",children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[s.jsx("h3",{className:"text-lg font-medium",children:e("flowise.title")}),s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsx(yO,{}),s.jsx($re,{}),s.jsx(Wre,{resetTable:h})]})]}),s.jsx(Yt,{className:"my-4"}),s.jsxs(ii,{direction:t?"horizontal":"vertical",children:[s.jsx(Mr,{defaultSize:r?35:100,className:"pr-4",children:s.jsx("div",{className:"flex flex-col gap-3",children:o?s.jsx(Hn,{}):s.jsx(s.Fragment,{children:a&&a.length>0&&Array.isArray(a)?a.map(m=>s.jsx($,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>f(`${m.id}`),variant:r===m.id?"secondary":"outline",children:s.jsx("h4",{className:"text-base",children:m.description||m.id})},m.id)):s.jsx($,{variant:"link",children:e("flowise.table.none")})})})}),r&&s.jsxs(s.Fragment,{children:[s.jsx(li,{withHandle:!0,className:"border border-border"}),s.jsx(Mr,{children:s.jsx(Qre,{flowiseId:r,resetTable:h})})]})]})]})})}const Yre=e=>["n8n","fetchN8n",JSON.stringify(e)],Zre=async({instanceName:e,token:t})=>(await Ce.get(`/n8n/find/${e}`,{headers:{apikey:t}})).data,bO=e=>{const{instanceName:t,token:n,...r}=e;return pt({...r,queryKey:Yre({instanceName:t,token:n}),queryFn:()=>Zre({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},Xre=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/n8n/create/${e}`,n,{headers:{apikey:t}})).data,ese=async({instanceName:e,n8nId:t,data:n})=>(await Ce.put(`/n8n/update/${t}/${e}`,n)).data,tse=async({instanceName:e,n8nId:t})=>(await Ce.delete(`/n8n/delete/${t}/${e}`)).data,nse=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/n8n/settings/${e}`,n,{headers:{apikey:t}})).data,rse=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await Ce.post(`/n8n/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function Am(){const e=nt(nse,{invalidateKeys:[["n8n","fetchDefaultSettings"]]}),t=nt(rse,{invalidateKeys:[["n8n","getN8n"],["n8n","fetchSessions"]]}),n=nt(tse,{invalidateKeys:[["n8n","getN8n"],["n8n","fetchN8n"],["n8n","fetchSessions"]]}),r=nt(ese,{invalidateKeys:[["n8n","getN8n"],["n8n","fetchN8n"],["n8n","fetchSessions"]]}),a=nt(Xre,{invalidateKeys:[["n8n","fetchN8n"]]});return{setDefaultSettingsN8n:e,changeStatusN8n:t,deleteN8n:n,updateN8n:r,createN8n:a}}const sse=e=>["n8n","fetchDefaultSettings",JSON.stringify(e)],ase=async({instanceName:e,token:t})=>(await Ce.get(`/n8n/fetchSettings/${e}`,{headers:{apikey:t}})).data,ose=e=>{const{instanceName:t,token:n,...r}=e;return pt({...r,queryKey:sse({instanceName:t,token:n}),queryFn:()=>ase({instanceName:t,token:n}),enabled:!!t})},ise=fn({expire:he(),keywordFinish:he(),delayMessage:he(),unknownMessage:he(),listeningFromMe:Me(),stopBotFromMe:Me(),keepOpen:Me(),debounceTime:he(),ignoreJids:Ds(he()).default([]),n8nIdFallback:_c([Mc(),he()]).optional(),splitMessages:Me(),timePerChar:he()});function lse(){const{t:e}=Le(),{instance:t}=ct(),{setDefaultSettingsN8n:n}=Am(),[r,a]=v.useState(!1),{data:o,refetch:l}=bO({instanceName:t?.name,token:t?.token,enabled:r}),{data:u,refetch:d}=ose({instanceName:t?.name,token:t?.token}),f=mn({resolver:gn(ise),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(()=>{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 b={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:b}),Q.success(e("n8n.toast.defaultSettings.success"))}catch(b){console.error("Error:",b),Q.error(`Error: ${b?.response?.data?.response?.message}`)}};function m(){d(),l()}return s.jsxs(vt,{open:r,onOpenChange:a,children:[s.jsx(an,{asChild:!0,children:s.jsxs($,{variant:"secondary",size:"sm",children:[s.jsx(Zo,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:e("n8n.defaultSettings")})]})}),s.jsxs(mt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:m,children:[s.jsx(gt,{children:s.jsx(xt,{children:e("n8n.defaultSettings")})}),s.jsx(yr,{...f,children:s.jsxs("form",{className:"w-full space-y-6",onSubmit:f.handleSubmit(h),children:[s.jsx("div",{children:s.jsxs("div",{className:"space-y-4",children:[s.jsx(un,{name:"n8nIdFallback",label:e("n8n.form.n8nIdFallback.label"),options:o?.filter(g=>!!g.id).map(g=>({label:g.description,value:g.id}))??[]}),s.jsx(pe,{name:"expire",label:e("n8n.form.expire.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(pe,{name:"keywordFinish",label:e("n8n.form.keywordFinish.label"),children:s.jsx(Z,{})}),s.jsx(pe,{name:"delayMessage",label:e("n8n.form.delayMessage.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(pe,{name:"unknownMessage",label:e("n8n.form.unknownMessage.label"),children:s.jsx(Z,{})}),s.jsx(Re,{name:"listeningFromMe",label:e("n8n.form.listeningFromMe.label"),reverse:!0}),s.jsx(Re,{name:"stopBotFromMe",label:e("n8n.form.stopBotFromMe.label"),reverse:!0}),s.jsx(Re,{name:"keepOpen",label:e("n8n.form.keepOpen.label"),reverse:!0}),s.jsx(pe,{name:"debounceTime",label:e("n8n.form.debounceTime.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(Re,{name:"splitMessages",label:e("n8n.form.splitMessages.label"),reverse:!0}),s.jsx(pe,{name:"timePerChar",label:e("n8n.form.timePerChar.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(ai,{name:"ignoreJids",label:e("n8n.form.ignoreJids.label"),placeholder:e("n8n.form.ignoreJids.placeholder")})]})}),s.jsx(Kt,{children:s.jsx($,{type:"submit",children:e("n8n.button.save")})})]})})]})]})}const cse=e=>["n8n","fetchSessions",JSON.stringify(e)],use=async({n8nId:e,instanceName:t})=>(await Ce.get(`/n8n/fetchSessions/${e}/${t}`)).data,dse=e=>{const{n8nId:t,instanceName:n,...r}=e;return pt({...r,queryKey:cse({n8nId:t,instanceName:n}),queryFn:()=>use({n8nId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0),staleTime:1e3*10})},mp={name:"",number:"",status:"all",time:"all",customCondition:"more",customValue:"",customUnit:"minutes"};function fse(e,t){const n=parseInt(e);return!n||isNaN(n)||n<=0?null:t==="hours"?n*60:t==="days"?n*1440:n}function pse(e,t){if(t.time==="all")return!0;const n=(Date.now()-new Date(e).getTime())/6e4;if(t.time==="custom"){const r=fse(t.customValue,t.customUnit);return r===null?!0:t.customCondition==="more"?n>r:n<=r}if(t.time.startsWith(">")){const r=parseInt(t.time.slice(1));return n>r}return n<=parseInt(t.time)}function wO({n8nId:e}){const{t}=Le(),{instance:n}=ct(),{changeStatusN8n:r}=Am(),[a,o]=v.useState(!1),[l,u]=v.useState([]),[d,f]=v.useState({}),[h,m]=v.useState(mp),[g,b]=v.useState(mp),[x,w]=v.useState(9),[C,k]=v.useState(9),[N,T]=v.useState("opened"),[_,P]=v.useState(!1),[M,O]=v.useState(""),[D,F]=v.useState(""),[B,te]=v.useState(!1),{data:U,refetch:ce}=dse({instanceName:n?.name,n8nId:e,enabled:a}),q=v.useMemo(()=>{const j=U??[],I=g.name.trim().toLowerCase(),me=g.number.trim();return j.filter(be=>!(I&&!be.pushName?.toLowerCase().includes(I)||me&&!be.remoteJid.includes(me)||g.status!=="all"&&be.status!==g.status||!pse(be.updatedAt,g)))},[U,g]),ne=q.slice(0,C),Y=v.useMemo(()=>Object.keys(d).filter(j=>d[j]).map(j=>ne[Number(j)]?.remoteJid).filter(Boolean),[d,ne]);v.useEffect(()=>{k(x),f({})},[g,x]);const se=()=>{ce()},H=()=>{b(h)},W=()=>{m(mp),b(mp)},V=async(j,I)=>{try{if(!n)return;await r({instanceName:n.name,token:n.token,remoteJid:j,status:I}),Q.success(t("n8n.toast.success.status")),se()}catch(me){console.error("Error:",me),Q.error(`Error : ${me?.response?.data?.response?.message}`)}},A=async()=>{if(Y.length===0){Q.error(t("sessions.mass.noneSelected"));return}try{if(!n)return;await Promise.all(Y.map(j=>r({instanceName:n.name,token:n.token,remoteJid:j,status:N}))),Q.success(t("sessions.mass.success")),f({}),se()}catch(j){console.error(j),Q.error(j?.response?.data?.response?.message??t("sessions.mass.error"))}},K=j=>{O(j),F(""),P(!0)},re=async()=>{if(!D.trim()){Q.error(t("sessions.send.empty"));return}try{if(!n)return;te(!0),await Ce.post(`/message/sendText/${n.name}`,{number:M,text:D},{headers:{apikey:n.token}}),Q.success(t("sessions.send.success")),P(!1),F(""),O("")}catch(j){console.error("Error:",j),Q.error(j?.response?.data?.response?.message??j?.message??t("sessions.send.error"))}finally{te(!1)}},ee=[{id:"select",header:({table:j})=>s.jsx(ts,{checked:j.getIsAllPageRowsSelected()||j.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:I=>j.toggleAllPageRowsSelected(!!I),"aria-label":t("sessions.mass.selectAll")}),cell:({row:j})=>s.jsx(ts,{checked:j.getIsSelected(),onCheckedChange:I=>j.toggleSelected(!!I),"aria-label":t("sessions.mass.selectAll")}),enableSorting:!1},{accessorKey:"remoteJid",header:()=>s.jsx("div",{className:"text-center",children:t("n8n.sessions.table.remoteJid")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>s.jsx("div",{className:"text-center",children:t("n8n.sessions.table.pushName")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("pushName")})},{accessorKey:"sessionId",header:()=>s.jsx("div",{className:"text-center",children:t("n8n.sessions.table.sessionId")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("sessionId")})},{accessorKey:"status",header:()=>s.jsx("div",{className:"text-center",children:t("n8n.sessions.table.status")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:j})=>{const I=j.original;return s.jsxs(vs,{children:[s.jsx(ys,{asChild:!0,children:s.jsxs($,{variant:"ghost",size:"icon",children:[s.jsx("span",{className:"sr-only",children:t("n8n.sessions.table.actions.title")}),s.jsx(Xo,{className:"h-4 w-4"})]})}),s.jsxs(xs,{align:"end",children:[s.jsx(ei,{children:t("n8n.sessions.table.actions.title")}),s.jsx(ti,{}),I.status!=="opened"&&s.jsxs(Ct,{onClick:()=>V(I.remoteJid,"opened"),children:[s.jsx(al,{className:"mr-2 h-4 w-4"}),t("n8n.sessions.table.actions.open")]}),I.status!=="paused"&&I.status!=="closed"&&s.jsxs(Ct,{onClick:()=>V(I.remoteJid,"paused"),children:[s.jsx(sl,{className:"mr-2 h-4 w-4"}),t("n8n.sessions.table.actions.pause")]}),I.status!=="closed"&&s.jsxs(Ct,{onClick:()=>V(I.remoteJid,"closed"),children:[s.jsx(el,{className:"mr-2 h-4 w-4"}),t("n8n.sessions.table.actions.close")]}),s.jsxs(Ct,{onClick:()=>K(I.remoteJid),children:[s.jsx(rl,{className:"mr-2 h-4 w-4"}),t("sessions.actions.sendMessage")]}),s.jsxs(Ct,{onClick:()=>V(I.remoteJid,"delete"),children:[s.jsx(tl,{className:"mr-2 h-4 w-4"}),t("n8n.sessions.table.actions.delete")]})]})]})}}],ie=["all","5","10","15","20","30","60",">60",">120",">300",">1440","custom"],ue=["all","opened","paused","closed"];return s.jsxs(vt,{open:a,onOpenChange:o,children:[s.jsx(an,{asChild:!0,children:s.jsxs($,{variant:"secondary",size:"sm",children:[s.jsx(nl,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden md:inline",children:t("n8n.sessions.label")})]})}),s.jsxs(mt,{className:"max-w-7xl h-[85vh] flex flex-col overflow-hidden",children:[s.jsx(gt,{children:s.jsx(xt,{children:t("n8n.sessions.label")})}),s.jsxs("div",{className:"flex-1 space-y-4 overflow-y-auto pr-2",children:[s.jsxs(Un,{children:[s.jsx(Yn,{children:s.jsx(Zn,{className:"text-base",children:t("sessions.filters.title")})}),s.jsxs(Vn,{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.name")}),s.jsx(Z,{placeholder:t("sessions.filters.namePlaceholder"),value:h.name,onChange:j=>m(I=>({...I,name:j.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.number")}),s.jsx(Z,{placeholder:t("sessions.filters.numberPlaceholder"),value:h.number,onChange:j=>m(I=>({...I,number:j.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.status")}),s.jsxs(_t,{value:h.status,onValueChange:j=>m(I=>({...I,status:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsx(It,{children:ue.map(j=>s.jsx(we,{value:j,children:t(`sessions.filters.statusOptions.${j}`)},j))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.time")}),s.jsxs(_t,{value:h.time,onValueChange:j=>m(I=>({...I,time:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsx(It,{children:ie.map(j=>s.jsx(we,{value:j,children:t(`sessions.filters.timeOptions.${j}`)},j))})]})]})]}),h.time==="custom"&&s.jsxs("div",{className:"grid grid-cols-1 gap-2 md:grid-cols-3",children:[s.jsxs(_t,{value:h.customCondition,onValueChange:j=>m(I=>({...I,customCondition:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"more",children:t("sessions.filters.custom.more")}),s.jsx(we,{value:"less",children:t("sessions.filters.custom.less")})]})]}),s.jsx(Z,{type:"number",min:1,placeholder:t("sessions.filters.custom.valuePlaceholder"),value:h.customValue,onChange:j=>m(I=>({...I,customValue:j.target.value}))}),s.jsxs(_t,{value:h.customUnit,onValueChange:j=>m(I=>({...I,customUnit:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"minutes",children:t("sessions.filters.custom.minutes")}),s.jsx(we,{value:"hours",children:t("sessions.filters.custom.hours")}),s.jsx(we,{value:"days",children:t("sessions.filters.custom.days")})]})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx($,{onClick:H,size:"sm",children:t("sessions.filters.apply")}),s.jsx($,{onClick:W,size:"sm",variant:"outline",children:t("sessions.filters.clear")}),s.jsxs($,{onClick:se,size:"sm",variant:"outline",children:[s.jsx(ol,{size:14,className:"mr-1"}),t("button.refresh")]})]})]})]}),Y.length>0&&s.jsxs(Un,{children:[s.jsx(Yn,{children:s.jsx(Zn,{className:"text-base",children:t("sessions.mass.title")})}),s.jsx(Vn,{children:s.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:t("sessions.mass.selected",{count:Y.length})}),s.jsxs("div",{className:"flex-1 min-w-[180px] space-y-1",children:[s.jsx(Ve,{children:t("sessions.mass.newStatus")}),s.jsxs(_t,{value:N,onValueChange:T,children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"opened",children:t("n8n.sessions.table.actions.open")}),s.jsx(we,{value:"paused",children:t("n8n.sessions.table.actions.pause")}),s.jsx(we,{value:"closed",children:t("n8n.sessions.table.actions.close")}),s.jsx(we,{value:"delete",children:t("n8n.sessions.table.actions.delete")})]})]})]}),s.jsx($,{onClick:A,size:"sm",children:t("sessions.mass.apply")})]})})]}),s.jsx(ci,{columns:ee,data:ne,onSortingChange:u,state:{sorting:l,rowSelection:d},onRowSelectionChange:f,enableRowSelection:!0,getRowId:(j,I)=>String(I),noResultsMessage:t("sessions.empty")}),s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 px-1 text-sm text-muted-foreground",children:[s.jsx("span",{children:t("sessions.pagination.showing",{shown:ne.length,total:q.length})}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(Ve,{htmlFor:"per-page",className:"text-xs",children:t("sessions.pagination.perPage")}),s.jsxs(_t,{value:String(x),onValueChange:j=>w(parseInt(j)),children:[s.jsx(Rt,{id:"per-page",className:"h-8 w-20",children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"9",children:"9"}),s.jsx(we,{value:"25",children:"25"}),s.jsx(we,{value:"50",children:"50"}),s.jsx(we,{value:"100",children:"100"})]})]}),Ck(j=>Math.min(j+x,q.length)),children:t("sessions.pagination.showMore")}),Ck(q.length),children:t("sessions.pagination.showAll")}),C>x&&s.jsx($,{size:"sm",variant:"outline",onClick:()=>k(x),children:t("sessions.pagination.showLess")})]})]})]}),s.jsx(vt,{open:_,onOpenChange:j=>!B&&P(j),children:s.jsxs(mt,{className:"sm:max-w-md",children:[s.jsx(gt,{children:s.jsx(xt,{children:t("sessions.send.title")})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{children:t("sessions.send.to")}),s.jsx(Z,{value:M,disabled:!0})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{children:t("sessions.send.messagePlaceholder")}),s.jsx(ni,{rows:4,placeholder:t("sessions.send.messagePlaceholder"),value:D,onChange:j=>F(j.target.value)})]})]}),s.jsxs(Kt,{children:[s.jsx($,{variant:"outline",onClick:()=>P(!1),disabled:B,children:t("button.cancel")}),s.jsx($,{onClick:re,disabled:B,children:t(B?"sessions.send.sending":"sessions.send.send")})]})]})})]})]})}const hse=fn({enabled:Me(),description:he(),webhookUrl:he(),basicAuthUser:he(),basicAuthPass:he(),triggerType:he(),triggerOperator:he().optional(),triggerValue:he().optional(),expire:ot.number().optional(),keywordFinish:he().optional(),delayMessage:ot.number().optional(),unknownMessage:he().optional(),listeningFromMe:Me().optional(),stopBotFromMe:Me().optional(),keepOpen:Me().optional(),debounceTime:ot.number().optional(),splitMessages:Me().optional(),timePerChar:ot.number().optional()});function SO({initialData:e,onSubmit:t,handleDelete:n,n8nId:r,isModal:a=!1,isLoading:o=!1,openDeletionDialog:l=!1,setOpenDeletionDialog:u=()=>{}}){const{t:d}=Le(),f=mn({resolver:gn(hse),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 s.jsx(yr,{...f,children:s.jsxs("form",{onSubmit:f.handleSubmit(t),className:"w-full space-y-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsx(Re,{name:"enabled",label:d("n8n.form.enabled.label"),reverse:!0}),s.jsx(pe,{name:"description",label:d("n8n.form.description.label"),children:s.jsx(Z,{})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("n8n.form.n8nSettings.label")}),s.jsx(Yt,{})]}),s.jsx(pe,{name:"webhookUrl",label:d("n8n.form.webhookUrl.label"),required:!0,children:s.jsx(Z,{})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("n8n.form.basicAuth.label")}),s.jsx(Yt,{})]}),s.jsxs("div",{className:"flex w-full flex-row gap-4",children:[s.jsx(pe,{name:"basicAuthUser",label:d("n8n.form.basicAuthUser.label"),className:"flex-1",children:s.jsx(Z,{})}),s.jsx(pe,{name:"basicAuthPass",label:d("n8n.form.basicAuthPass.label"),className:"flex-1",children:s.jsx(Z,{type:"password"})})]}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("n8n.form.triggerSettings.label")}),s.jsx(Yt,{})]}),s.jsx(un,{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"&&s.jsxs(s.Fragment,{children:[s.jsx(un,{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"}]}),s.jsx(pe,{name:"triggerValue",label:d("n8n.form.triggerValue.label"),children:s.jsx(Z,{})})]}),h==="advanced"&&s.jsx(pe,{name:"triggerValue",label:d("n8n.form.triggerConditions.label"),children:s.jsx(Z,{})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("n8n.form.generalSettings.label")}),s.jsx(Yt,{})]}),s.jsx(pe,{name:"expire",label:d("n8n.form.expire.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(pe,{name:"keywordFinish",label:d("n8n.form.keywordFinish.label"),children:s.jsx(Z,{})}),s.jsx(pe,{name:"delayMessage",label:d("n8n.form.delayMessage.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(pe,{name:"unknownMessage",label:d("n8n.form.unknownMessage.label"),children:s.jsx(Z,{})}),s.jsx(Re,{name:"listeningFromMe",label:d("n8n.form.listeningFromMe.label"),reverse:!0}),s.jsx(Re,{name:"stopBotFromMe",label:d("n8n.form.stopBotFromMe.label"),reverse:!0}),s.jsx(Re,{name:"keepOpen",label:d("n8n.form.keepOpen.label"),reverse:!0}),s.jsx(pe,{name:"debounceTime",label:d("n8n.form.debounceTime.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(Re,{name:"splitMessages",label:d("n8n.form.splitMessages.label"),reverse:!0}),f.watch("splitMessages")&&s.jsx(pe,{name:"timePerChar",label:d("n8n.form.timePerChar.label"),children:s.jsx(Z,{type:"number"})})]}),a&&s.jsx(Kt,{children:s.jsx($,{disabled:o,type:"submit",children:d(o?"n8n.button.saving":"n8n.button.save")})}),!a&&s.jsxs("div",{children:[s.jsx(wO,{n8nId:r}),s.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[s.jsxs(vt,{open:l,onOpenChange:u,children:[s.jsx(an,{asChild:!0,children:s.jsx($,{variant:"destructive",size:"sm",children:d("n8n.button.delete")})}),s.jsx(mt,{children:s.jsxs(gt,{children:[s.jsx(xt,{children:d("modal.delete.title")}),s.jsx(gr,{children:d("modal.delete.messageSingle")}),s.jsxs(Kt,{children:[s.jsx($,{size:"sm",variant:"outline",onClick:()=>u(!1),children:d("button.cancel")}),s.jsx($,{variant:"destructive",onClick:n,children:d("button.delete")})]})]})})]}),s.jsx($,{disabled:o,type:"submit",children:d(o?"n8n.button.saving":"n8n.button.update")})]})]})]})})}function mse({resetTable:e}){const{t}=Le(),{instance:n}=ct(),[r,a]=v.useState(!1),[o,l]=v.useState(!1),{createN8n:u}=Am(),d=async f=>{try{if(!n||!n.name)throw new Error("instance not found");a(!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}),Q.success(t("n8n.toast.success.create")),l(!1),e()}catch(h){console.error("Error:",h),Q.error(`Error: ${h?.response?.data?.response?.message}`)}finally{a(!1)}};return s.jsxs(vt,{open:o,onOpenChange:l,children:[s.jsx(an,{asChild:!0,children:s.jsxs($,{size:"sm",children:[s.jsx($r,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:t("n8n.button.create")})]})}),s.jsxs(mt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[s.jsx(gt,{children:s.jsx(xt,{children:t("n8n.form.title")})}),s.jsx(SO,{onSubmit:d,isModal:!0,isLoading:r})]})]})}const gse=e=>["n8n","getN8n",JSON.stringify(e)],vse=async({n8nId:e,instanceName:t})=>(await Ce.get(`/n8n/fetch/${e}/${t}`)).data,yse=e=>{const{n8nId:t,instanceName:n,...r}=e;return pt({...r,queryKey:gse({n8nId:t,instanceName:n}),queryFn:()=>vse({n8nId:t,instanceName:n}),enabled:!!n&&!!t&&(e.enabled??!0)})};function xse({n8nId:e,resetTable:t}){const{t:n}=Le(),{instance:r}=ct(),a=Nn(),[o,l]=v.useState(!1),{deleteN8n:u,updateN8n:d}=Am(),{data:f,isLoading:h}=yse({n8nId:e,instanceName:r?.name}),m=v.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 x=>{try{if(r&&r.name&&e){const w={enabled:x.enabled,description:x.description,webhookUrl:x.webhookUrl,basicAuthUser:x.basicAuthUser,basicAuthPass:x.basicAuthPass,triggerType:x.triggerType,triggerOperator:x.triggerOperator||"",triggerValue:x.triggerValue||"",expire:x.expire||0,keywordFinish:x.keywordFinish||"",delayMessage:x.delayMessage||1e3,unknownMessage:x.unknownMessage||"",listeningFromMe:x.listeningFromMe||!1,stopBotFromMe:x.stopBotFromMe||!1,keepOpen:x.keepOpen||!1,debounceTime:x.debounceTime||0,splitMessages:x.splitMessages||!1,timePerChar:x.timePerChar||0};await d({instanceName:r.name,n8nId:e,data:w}),Q.success(n("n8n.toast.success.update")),t(),a(`/manager/instance/${r.id}/n8n/${e}`)}else console.error("Token not found")}catch(w){console.error("Error:",w),Q.error(`Error: ${w?.response?.data?.response?.message}`)}},b=async()=>{try{r&&r.name&&e?(await u({instanceName:r.name,n8nId:e}),Q.success(n("n8n.toast.success.delete")),l(!1),t(),a(`/manager/instance/${r.id}/n8n`)):console.error("instance not found")}catch(x){console.error("Erro ao excluir n8n:",x)}};return h?s.jsx(Hn,{}):s.jsx("div",{className:"m-4",children:s.jsx(SO,{initialData:m,onSubmit:g,n8nId:e,handleDelete:b,isModal:!1,isLoading:h,openDeletionDialog:o,setOpenDeletionDialog:l})})}function RE(){const{t:e}=Le(),t=eo("(min-width: 768px)"),{instance:n}=ct(),{n8nId:r}=Os(),{data:a,refetch:o,isLoading:l,error:u}=bO({instanceName:n?.name}),d=Nn(),f=m=>{n&&d(`/manager/instance/${n.id}/n8n/${m}`)},h=()=>{o()};return s.jsx("main",{className:"pt-5",children:s.jsxs(ia,{error:u,name:"n8n",envVar:"N8N_ENABLED",children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[s.jsx("h3",{className:"text-lg font-medium",children:e("n8n.title")}),s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsx(wO,{}),s.jsx(lse,{}),s.jsx(mse,{resetTable:h})]})]}),s.jsx(Yt,{className:"my-4"}),s.jsxs(ii,{direction:t?"horizontal":"vertical",children:[s.jsx(Mr,{defaultSize:r?35:100,className:"pr-4",children:s.jsx("div",{className:"flex flex-col gap-3",children:l?s.jsx(Hn,{}):s.jsx(s.Fragment,{children:a&&a.length>0&&Array.isArray(a)?a.map(m=>s.jsx($,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>f(`${m.id}`),variant:r===m.id?"secondary":"outline",children:s.jsx("h4",{className:"text-base",children:m.description||m.id})},m.id)):s.jsx($,{variant:"link",children:e("n8n.table.none")})})})}),r&&s.jsxs(s.Fragment,{children:[s.jsx(li,{withHandle:!0,className:"border border-border"}),s.jsx(Mr,{children:s.jsx(xse,{n8nId:r,resetTable:h})})]})]})]})})}const bse=e=>["openai","findOpenai",JSON.stringify(e)],wse=async({instanceName:e,token:t})=>(await Ce.get(`/openai/find/${e}`,{headers:{apiKey:t}})).data,CO=e=>{const{instanceName:t,token:n,...r}=e;return pt({...r,queryKey:bse({instanceName:t}),queryFn:()=>wse({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},Sse=e=>["openai","findOpenaiCreds",JSON.stringify(e)],Cse=async({instanceName:e,token:t})=>(await Ce.get(`/openai/creds/${e}`,{headers:{apiKey:t}})).data,Hw=e=>{const{instanceName:t,token:n,...r}=e;return pt({staleTime:1e3*60*60*6,...r,queryKey:Sse({instanceName:t}),queryFn:()=>Cse({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},jse=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/openai/creds/${e}`,n,{headers:{apikey:t}})).data,kse=async({openaiCredsId:e,instanceName:t})=>(await Ce.delete(`/openai/creds/${e}/${t}`)).data,Ese=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/openai/create/${e}`,n,{headers:{apikey:t}})).data,Nse=async({instanceName:e,token:t,openaiId:n,data:r})=>(await Ce.put(`/openai/update/${n}/${e}`,r,{headers:{apikey:t}})).data,Tse=async({instanceName:e,token:t,openaiId:n})=>(await Ce.delete(`/openai/delete/${n}/${e}`,{headers:{apikey:t}})).data,Mse=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/openai/settings/${e}`,n,{headers:{apikey:t}})).data,_se=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await Ce.post(`/openai/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function Pd(){const e=nt(Mse,{invalidateKeys:[["openai","fetchDefaultSettings"]]}),t=nt(_se,{invalidateKeys:[["openai","getOpenai"],["openai","fetchSessions"]]}),n=nt(Tse,{invalidateKeys:[["openai","getOpenai"],["openai","findOpenai"],["openai","fetchSessions"]]}),r=nt(Nse,{invalidateKeys:[["openai","getOpenai"],["openai","findOpenai"],["openai","fetchSessions"]]}),a=nt(Ese,{invalidateKeys:[["openai","findOpenai"]]}),o=nt(jse,{invalidateKeys:[["openai","findOpenaiCreds"]]}),l=nt(kse,{invalidateKeys:[["openai","findOpenaiCreds"]]});return{setDefaultSettingsOpenai:e,changeStatusOpenai:t,deleteOpenai:n,updateOpenai:r,createOpenai:a,createOpenaiCreds:o,deleteOpenaiCreds:l}}const Pse=fn({name:he(),apiKey:he()});function jO({onCredentialsUpdate:e,showText:t=!0}){const{t:n}=Le(),{instance:r}=ct(),{createOpenaiCreds:a,deleteOpenaiCreds:o}=Pd(),[l,u]=v.useState(!1),[d,f]=v.useState([]),{data:h}=Hw({instanceName:r?.name,enabled:l}),m=mn({resolver:gn(Pse),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 a({instanceName:r.name,token:r.token,data:C}),Q.success(n("openai.toast.success.credentialsCreate")),m.reset(),e&&e()}catch(C){console.error("Error:",C),Q.error(`Error: ${C?.response?.data?.response?.message}`)}},b=async w=>{if(!r?.name){Q.error("Instance not found.");return}try{await o({openaiCredsId:w,instanceName:r?.name}),Q.success(n("openai.toast.success.credentialsDelete")),e&&e()}catch(C){console.error("Error:",C),Q.error(`Error: ${C?.response?.data?.response?.message}`)}},x=[{accessorKey:"name",header:({column:w})=>s.jsxs($,{variant:"ghost",onClick:()=>w.toggleSorting(w.getIsSorted()==="asc"),children:[n("openai.credentials.table.name"),s.jsx(GB,{className:"ml-2 h-4 w-4"})]}),cell:({row:w})=>s.jsx("div",{children:w.getValue("name")})},{accessorKey:"apiKey",header:()=>s.jsx("div",{className:"text-right",children:n("openai.credentials.table.apiKey")}),cell:({row:w})=>s.jsxs("div",{children:[`${w.getValue("apiKey")}`.slice(0,20),"..."]})},{id:"actions",enableHiding:!1,cell:({row:w})=>{const C=w.original;return s.jsxs(vs,{children:[s.jsx(ys,{asChild:!0,children:s.jsxs($,{variant:"ghost",className:"h-8 w-8 p-0",children:[s.jsx("span",{className:"sr-only",children:n("openai.credentials.table.actions.title")}),s.jsx(Xo,{className:"h-4 w-4"})]})}),s.jsxs(xs,{align:"end",children:[s.jsx(ei,{children:n("openai.credentials.table.actions.title")}),s.jsx(ti,{}),s.jsx(Ct,{onClick:()=>b(C.id),children:n("openai.credentials.table.actions.delete")})]})]})}}];return s.jsxs(vt,{open:l,onOpenChange:u,children:[s.jsx(an,{asChild:!0,children:s.jsx($,{variant:"secondary",size:"sm",type:"button",children:t?s.jsxs(s.Fragment,{children:[s.jsx(yz,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden md:inline",children:n("openai.credentials.title")})]}):s.jsx($r,{size:16})})}),s.jsxs(mt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[s.jsx(gt,{children:s.jsx(xt,{children:n("openai.credentials.title")})}),s.jsx(yr,{...m,children:s.jsx("div",{onClick:w=>w.stopPropagation(),onSubmit:w=>w.stopPropagation(),onKeyDown:w=>w.stopPropagation(),children:s.jsxs("form",{onSubmit:w=>{w.preventDefault(),w.stopPropagation(),m.handleSubmit(g)(w)},className:"w-full space-y-6",children:[s.jsx("div",{children:s.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[s.jsx(pe,{name:"name",label:n("openai.credentials.table.name"),children:s.jsx(Z,{})}),s.jsx(pe,{name:"apiKey",label:n("openai.credentials.table.apiKey"),children:s.jsx(Z,{type:"password"})})]})}),s.jsx(Kt,{children:s.jsx($,{type:"submit",children:n("openai.button.save")})})]})})}),s.jsx(Yt,{}),s.jsx("div",{children:s.jsx(ci,{columns:x,data:h??[],onSortingChange:f,state:{sorting:d},noResultsMessage:n("openai.credentials.table.none")})})]})]})}const Rse=e=>["openai","fetchDefaultSettings",JSON.stringify(e)],Ise=async({instanceName:e,token:t})=>{const n=await Ce.get(`/openai/fetchSettings/${e}`,{headers:{apiKey:t}});return Array.isArray(n.data)?n.data[0]:n.data},Ose=e=>{const{instanceName:t,token:n,...r}=e;return pt({...r,queryKey:Rse({instanceName:t}),queryFn:()=>Ise({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},Ase=fn({openaiCredsId:he(),expire:ot.number(),keywordFinish:he(),delayMessage:ot.number().default(0),unknownMessage:he(),listeningFromMe:Me(),stopBotFromMe:Me(),keepOpen:Me(),debounceTime:ot.number(),speechToText:Me(),ignoreJids:Ds(he()).default([]),openaiIdFallback:_c([Mc(),he()]).optional(),splitMessages:Me().optional(),timePerChar:ot.number().optional()});function Dse(){const{t:e}=Le(),{instance:t}=ct(),{setDefaultSettingsOpenai:n}=Pd(),[r,a]=v.useState(!1),{data:o,refetch:l}=Ose({instanceName:t?.name,enabled:r}),{data:u,refetch:d}=CO({instanceName:t?.name,enabled:r}),{data:f}=Hw({instanceName:t?.name,enabled:r}),h=mn({resolver:gn(Ase),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&&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 b=>{try{if(!t||!t.name)throw new Error("instance not found.");const x={openaiCredsId:b.openaiCredsId,expire:b.expire,keywordFinish:b.keywordFinish,delayMessage:b.delayMessage,unknownMessage:b.unknownMessage,listeningFromMe:b.listeningFromMe,stopBotFromMe:b.stopBotFromMe,keepOpen:b.keepOpen,debounceTime:b.debounceTime,speechToText:b.speechToText,openaiIdFallback:b.openaiIdFallback||void 0,ignoreJids:b.ignoreJids,splitMessages:b.splitMessages,timePerChar:b.timePerChar};await n({instanceName:t.name,token:t.token,data:x}),Q.success(e("openai.toast.defaultSettings.success"))}catch(x){console.error("Error:",x),Q.error(`Error: ${x?.response?.data?.response?.message}`)}};function g(){l(),d()}return s.jsxs(vt,{open:r,onOpenChange:a,children:[s.jsx(an,{asChild:!0,children:s.jsxs($,{variant:"secondary",size:"sm",children:[s.jsx(Zo,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden md:inline",children:e("openai.defaultSettings")})]})}),s.jsxs(mt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:g,children:[s.jsx(gt,{children:s.jsx(xt,{children:e("openai.defaultSettings")})}),s.jsx(yr,{...h,children:s.jsxs("form",{className:"w-full space-y-6",onSubmit:h.handleSubmit(m),children:[s.jsx("div",{children:s.jsxs("div",{className:"space-y-4",children:[s.jsx(un,{name:"openaiCredsId",label:e("openai.form.openaiCredsId.label"),options:f?.filter(b=>!!b.id).map(b=>({label:b.name?b.name:b.apiKey.substring(0,15)+"...",value:b.id}))||[]}),s.jsx(un,{name:"openaiIdFallback",label:e("openai.form.openaiIdFallback.label"),options:u?.filter(b=>!!b.id).map(b=>({label:b.description,value:b.id}))??[]}),s.jsx(pe,{name:"expire",label:e("openai.form.expire.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(pe,{name:"keywordFinish",label:e("openai.form.keywordFinish.label"),children:s.jsx(Z,{})}),s.jsx(pe,{name:"delayMessage",label:e("openai.form.delayMessage.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(pe,{name:"unknownMessage",label:e("openai.form.unknownMessage.label"),children:s.jsx(Z,{})}),s.jsx(Re,{name:"listeningFromMe",label:e("openai.form.listeningFromMe.label"),reverse:!0}),s.jsx(Re,{name:"stopBotFromMe",label:e("openai.form.stopBotFromMe.label"),reverse:!0}),s.jsx(Re,{name:"keepOpen",label:e("openai.form.keepOpen.label"),reverse:!0}),s.jsx(Re,{name:"speechToText",label:e("openai.form.speechToText.label"),reverse:!0}),s.jsx(pe,{name:"debounceTime",label:e("openai.form.debounceTime.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(Re,{name:"splitMessages",label:e("openai.form.splitMessages.label"),reverse:!0}),h.watch("splitMessages")&&s.jsx(pe,{name:"timePerChar",label:e("openai.form.timePerChar.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(ai,{name:"ignoreJids",label:e("openai.form.ignoreJids.label"),placeholder:e("openai.form.ignoreJids.placeholder")})]})}),s.jsx(Kt,{children:s.jsx($,{type:"submit",children:e("openai.button.save")})})]})})]})]})}const Fse=e=>["openai","getModels",JSON.stringify(e)],Lse=async({instanceName:e,openaiCredsId:t,token:n})=>{const r=t?{openaiCredsId:t}:{};return(await Ce.get(`/openai/getModels/${e}`,{headers:{apiKey:n},params:r})).data},$se=e=>{const{instanceName:t,openaiCredsId:n,token:r,...a}=e;return pt({staleTime:1e3*60*60*6,...a,queryKey:Fse({instanceName:t,openaiCredsId:n}),queryFn:()=>Lse({instanceName:t,openaiCredsId:n,token:r}),enabled:!!t&&!!n&&(e.enabled??!0)})},Bse=e=>["openai","fetchSessions",JSON.stringify(e)],zse=async({instanceName:e,openaiId:t,token:n})=>(await Ce.get(`/openai/fetchSessions/${t}/${e}`,{headers:{apiKey:n}})).data,Use=e=>{const{instanceName:t,token:n,openaiId:r,...a}=e;return pt({...a,queryKey:Bse({instanceName:t}),queryFn:()=>zse({instanceName:t,token:n,openaiId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})},gp={name:"",number:"",status:"all",time:"all",customCondition:"more",customValue:"",customUnit:"minutes"};function Vse(e,t){const n=parseInt(e);return!n||isNaN(n)||n<=0?null:t==="hours"?n*60:t==="days"?n*1440:n}function qse(e,t){if(t.time==="all")return!0;const n=(Date.now()-new Date(e).getTime())/6e4;if(t.time==="custom"){const r=Vse(t.customValue,t.customUnit);return r===null?!0:t.customCondition==="more"?n>r:n<=r}if(t.time.startsWith(">")){const r=parseInt(t.time.slice(1));return n>r}return n<=parseInt(t.time)}function kO({openaiId:e}){const{t}=Le(),{instance:n}=ct(),{changeStatusOpenai:r}=Pd(),[a,o]=v.useState(!1),[l,u]=v.useState([]),[d,f]=v.useState({}),[h,m]=v.useState(gp),[g,b]=v.useState(gp),[x,w]=v.useState(9),[C,k]=v.useState(9),[N,T]=v.useState("opened"),[_,P]=v.useState(!1),[M,O]=v.useState(""),[D,F]=v.useState(""),[B,te]=v.useState(!1),{data:U,refetch:ce}=Use({instanceName:n?.name,openaiId:e,enabled:a}),q=v.useMemo(()=>{const j=U??[],I=g.name.trim().toLowerCase(),me=g.number.trim();return j.filter(be=>!(I&&!be.pushName?.toLowerCase().includes(I)||me&&!be.remoteJid.includes(me)||g.status!=="all"&&be.status!==g.status||!qse(be.updatedAt,g)))},[U,g]),ne=q.slice(0,C),Y=v.useMemo(()=>Object.keys(d).filter(j=>d[j]).map(j=>ne[Number(j)]?.remoteJid).filter(Boolean),[d,ne]);v.useEffect(()=>{k(x),f({})},[g,x]);const se=()=>{ce()},H=()=>{b(h)},W=()=>{m(gp),b(gp)},V=async(j,I)=>{try{if(!n)return;await r({instanceName:n.name,token:n.token,remoteJid:j,status:I}),Q.success(t("openai.toast.success.status")),se()}catch(me){console.error("Error:",me),Q.error(`Error : ${me?.response?.data?.response?.message}`)}},A=async()=>{if(Y.length===0){Q.error(t("sessions.mass.noneSelected"));return}try{if(!n)return;await Promise.all(Y.map(j=>r({instanceName:n.name,token:n.token,remoteJid:j,status:N}))),Q.success(t("sessions.mass.success")),f({}),se()}catch(j){console.error(j),Q.error(j?.response?.data?.response?.message??t("sessions.mass.error"))}},K=j=>{O(j),F(""),P(!0)},re=async()=>{if(!D.trim()){Q.error(t("sessions.send.empty"));return}try{if(!n)return;te(!0),await Ce.post(`/message/sendText/${n.name}`,{number:M,text:D},{headers:{apikey:n.token}}),Q.success(t("sessions.send.success")),P(!1),F(""),O("")}catch(j){console.error("Error:",j),Q.error(j?.response?.data?.response?.message??j?.message??t("sessions.send.error"))}finally{te(!1)}},ee=[{id:"select",header:({table:j})=>s.jsx(ts,{checked:j.getIsAllPageRowsSelected()||j.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:I=>j.toggleAllPageRowsSelected(!!I),"aria-label":t("sessions.mass.selectAll")}),cell:({row:j})=>s.jsx(ts,{checked:j.getIsSelected(),onCheckedChange:I=>j.toggleSelected(!!I),"aria-label":t("sessions.mass.selectAll")}),enableSorting:!1},{accessorKey:"remoteJid",header:()=>s.jsx("div",{className:"text-center",children:t("openai.sessions.table.remoteJid")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>s.jsx("div",{className:"text-center",children:t("openai.sessions.table.pushName")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("pushName")})},{accessorKey:"sessionId",header:()=>s.jsx("div",{className:"text-center",children:t("openai.sessions.table.sessionId")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("sessionId")})},{accessorKey:"status",header:()=>s.jsx("div",{className:"text-center",children:t("openai.sessions.table.status")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:j})=>{const I=j.original;return s.jsxs(vs,{children:[s.jsx(ys,{asChild:!0,children:s.jsxs($,{variant:"ghost",size:"icon",children:[s.jsx("span",{className:"sr-only",children:t("openai.sessions.table.actions.title")}),s.jsx(Xo,{className:"h-4 w-4"})]})}),s.jsxs(xs,{align:"end",children:[s.jsx(ei,{children:t("openai.sessions.table.actions.title")}),s.jsx(ti,{}),I.status!=="opened"&&s.jsxs(Ct,{onClick:()=>V(I.remoteJid,"opened"),children:[s.jsx(al,{className:"mr-2 h-4 w-4"}),t("openai.sessions.table.actions.open")]}),I.status!=="paused"&&I.status!=="closed"&&s.jsxs(Ct,{onClick:()=>V(I.remoteJid,"paused"),children:[s.jsx(sl,{className:"mr-2 h-4 w-4"}),t("openai.sessions.table.actions.pause")]}),I.status!=="closed"&&s.jsxs(Ct,{onClick:()=>V(I.remoteJid,"closed"),children:[s.jsx(el,{className:"mr-2 h-4 w-4"}),t("openai.sessions.table.actions.close")]}),s.jsxs(Ct,{onClick:()=>K(I.remoteJid),children:[s.jsx(rl,{className:"mr-2 h-4 w-4"}),t("sessions.actions.sendMessage")]}),s.jsxs(Ct,{onClick:()=>V(I.remoteJid,"delete"),children:[s.jsx(tl,{className:"mr-2 h-4 w-4"}),t("openai.sessions.table.actions.delete")]})]})]})}}],ie=["all","5","10","15","20","30","60",">60",">120",">300",">1440","custom"],ue=["all","opened","paused","closed"];return s.jsxs(vt,{open:a,onOpenChange:o,children:[s.jsx(an,{asChild:!0,children:s.jsxs($,{variant:"secondary",size:"sm",children:[s.jsx(nl,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden md:inline",children:t("openai.sessions.label")})]})}),s.jsxs(mt,{className:"max-w-7xl h-[85vh] flex flex-col overflow-hidden",children:[s.jsx(gt,{children:s.jsx(xt,{children:t("openai.sessions.label")})}),s.jsxs("div",{className:"flex-1 space-y-4 overflow-y-auto pr-2",children:[s.jsxs(Un,{children:[s.jsx(Yn,{children:s.jsx(Zn,{className:"text-base",children:t("sessions.filters.title")})}),s.jsxs(Vn,{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.name")}),s.jsx(Z,{placeholder:t("sessions.filters.namePlaceholder"),value:h.name,onChange:j=>m(I=>({...I,name:j.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.number")}),s.jsx(Z,{placeholder:t("sessions.filters.numberPlaceholder"),value:h.number,onChange:j=>m(I=>({...I,number:j.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.status")}),s.jsxs(_t,{value:h.status,onValueChange:j=>m(I=>({...I,status:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsx(It,{children:ue.map(j=>s.jsx(we,{value:j,children:t(`sessions.filters.statusOptions.${j}`)},j))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.time")}),s.jsxs(_t,{value:h.time,onValueChange:j=>m(I=>({...I,time:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsx(It,{children:ie.map(j=>s.jsx(we,{value:j,children:t(`sessions.filters.timeOptions.${j}`)},j))})]})]})]}),h.time==="custom"&&s.jsxs("div",{className:"grid grid-cols-1 gap-2 md:grid-cols-3",children:[s.jsxs(_t,{value:h.customCondition,onValueChange:j=>m(I=>({...I,customCondition:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"more",children:t("sessions.filters.custom.more")}),s.jsx(we,{value:"less",children:t("sessions.filters.custom.less")})]})]}),s.jsx(Z,{type:"number",min:1,placeholder:t("sessions.filters.custom.valuePlaceholder"),value:h.customValue,onChange:j=>m(I=>({...I,customValue:j.target.value}))}),s.jsxs(_t,{value:h.customUnit,onValueChange:j=>m(I=>({...I,customUnit:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"minutes",children:t("sessions.filters.custom.minutes")}),s.jsx(we,{value:"hours",children:t("sessions.filters.custom.hours")}),s.jsx(we,{value:"days",children:t("sessions.filters.custom.days")})]})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx($,{onClick:H,size:"sm",children:t("sessions.filters.apply")}),s.jsx($,{onClick:W,size:"sm",variant:"outline",children:t("sessions.filters.clear")}),s.jsxs($,{onClick:se,size:"sm",variant:"outline",children:[s.jsx(ol,{size:14,className:"mr-1"}),t("button.refresh")]})]})]})]}),Y.length>0&&s.jsxs(Un,{children:[s.jsx(Yn,{children:s.jsx(Zn,{className:"text-base",children:t("sessions.mass.title")})}),s.jsx(Vn,{children:s.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:t("sessions.mass.selected",{count:Y.length})}),s.jsxs("div",{className:"flex-1 min-w-[180px] space-y-1",children:[s.jsx(Ve,{children:t("sessions.mass.newStatus")}),s.jsxs(_t,{value:N,onValueChange:T,children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"opened",children:t("openai.sessions.table.actions.open")}),s.jsx(we,{value:"paused",children:t("openai.sessions.table.actions.pause")}),s.jsx(we,{value:"closed",children:t("openai.sessions.table.actions.close")}),s.jsx(we,{value:"delete",children:t("openai.sessions.table.actions.delete")})]})]})]}),s.jsx($,{onClick:A,size:"sm",children:t("sessions.mass.apply")})]})})]}),s.jsx(ci,{columns:ee,data:ne,onSortingChange:u,state:{sorting:l,rowSelection:d},onRowSelectionChange:f,enableRowSelection:!0,getRowId:(j,I)=>String(I),noResultsMessage:t("sessions.empty")}),s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 px-1 text-sm text-muted-foreground",children:[s.jsx("span",{children:t("sessions.pagination.showing",{shown:ne.length,total:q.length})}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(Ve,{htmlFor:"per-page",className:"text-xs",children:t("sessions.pagination.perPage")}),s.jsxs(_t,{value:String(x),onValueChange:j=>w(parseInt(j)),children:[s.jsx(Rt,{id:"per-page",className:"h-8 w-20",children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"9",children:"9"}),s.jsx(we,{value:"25",children:"25"}),s.jsx(we,{value:"50",children:"50"}),s.jsx(we,{value:"100",children:"100"})]})]}),Ck(j=>Math.min(j+x,q.length)),children:t("sessions.pagination.showMore")}),Ck(q.length),children:t("sessions.pagination.showAll")}),C>x&&s.jsx($,{size:"sm",variant:"outline",onClick:()=>k(x),children:t("sessions.pagination.showLess")})]})]})]}),s.jsx(vt,{open:_,onOpenChange:j=>!B&&P(j),children:s.jsxs(mt,{className:"sm:max-w-md",children:[s.jsx(gt,{children:s.jsx(xt,{children:t("sessions.send.title")})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{children:t("sessions.send.to")}),s.jsx(Z,{value:M,disabled:!0})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{children:t("sessions.send.messagePlaceholder")}),s.jsx(ni,{rows:4,placeholder:t("sessions.send.messagePlaceholder"),value:D,onChange:j=>F(j.target.value)})]})]}),s.jsxs(Kt,{children:[s.jsx($,{variant:"outline",onClick:()=>P(!1),disabled:B,children:t("button.cancel")}),s.jsx($,{onClick:re,disabled:B,children:t(B?"sessions.send.sending":"sessions.send.send")})]})]})})]})]})}const Hse=fn({enabled:Me(),description:he(),openaiCredsId:he(),botType:he(),assistantId:he().optional(),functionUrl:he().optional(),model:he().optional(),systemMessages:he().optional(),assistantMessages:he().optional(),userMessages:he().optional(),maxTokens:ot.number().optional(),triggerType:he(),triggerOperator:he().optional(),triggerValue:he().optional(),expire:ot.number().optional(),keywordFinish:he().optional(),delayMessage:ot.number().optional(),unknownMessage:he().optional(),listeningFromMe:Me().optional(),stopBotFromMe:Me().optional(),keepOpen:Me().optional(),debounceTime:ot.number().optional(),splitMessages:Me().optional(),timePerChar:ot.number().optional()});function EO({initialData:e,onSubmit:t,handleDelete:n,openaiId:r,isModal:a=!1,isLoading:o=!1,openDeletionDialog:l=!1,setOpenDeletionDialog:u=()=>{},open:d}){const{t:f}=Le(),{instance:h}=ct(),[m,g]=v.useState(!1),{data:b,refetch:x}=Hw({instanceName:h?.name,enabled:d}),w=mn({resolver:gn(Hse),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"),N=w.watch("openaiCredsId"),{data:T,isLoading:_,refetch:P}=$se({instanceName:h?.name,openaiCredsId:N,token:h?.token,enabled:m&&!!N}),M=()=>{N&&(g(!0),P())},O=()=>{x()};return s.jsx(yr,{...w,children:s.jsxs("form",{onSubmit:w.handleSubmit(t),className:"w-full space-y-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsx(Re,{name:"enabled",label:f("openai.form.enabled.label"),reverse:!0}),s.jsx(pe,{name:"description",label:f("openai.form.description.label"),required:!0,children:s.jsx(Z,{})}),s.jsx("div",{className:"space-y-2",children:s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsx("div",{className:"flex-1",children:s.jsx(un,{name:"openaiCredsId",label:f("openai.form.openaiCredsId.label"),required:!0,options:b?.filter(D=>!!D.id).map(D=>({label:D.name?D.name:D.apiKey.substring(0,15)+"...",value:D.id}))??[]})}),s.jsx(jO,{onCredentialsUpdate:O,showText:!1})]})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:f("openai.form.openaiSettings.label")}),s.jsx(Yt,{})]}),s.jsx(un,{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"&&s.jsxs(s.Fragment,{children:[s.jsx(pe,{name:"assistantId",label:f("openai.form.assistantId.label"),required:!0,children:s.jsx(Z,{})}),s.jsx(pe,{name:"functionUrl",label:f("openai.form.functionUrl.label"),required:!0,children:s.jsx(Z,{})})]}),C==="chatCompletion"&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"space-y-2",children:s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsx("div",{className:"flex-1",children:s.jsx(un,{name:"model",label:f("openai.form.model.label"),required:!0,disabled:!T||T.length===0,options:T?.map(D=>({label:D.id,value:D.id}))??[]})}),s.jsx($,{type:"button",variant:"outline",size:"sm",disabled:!N||_,onClick:M,className:"mb-2",children:_?s.jsxs(s.Fragment,{children:[s.jsx(uc,{className:"mr-2 h-4 w-4 animate-spin"}),f("openai.button.loading")]}):s.jsxs(s.Fragment,{children:[s.jsx(uc,{className:"mr-2 h-4 w-4"}),f("openai.button.loadModels")]})})]})}),s.jsx(pe,{name:"systemMessages",label:f("openai.form.systemMessages.label"),children:s.jsx(Is,{})}),s.jsx(pe,{name:"assistantMessages",label:f("openai.form.assistantMessages.label"),children:s.jsx(Is,{})}),s.jsx(pe,{name:"userMessages",label:f("openai.form.userMessages.label"),children:s.jsx(Is,{})}),s.jsx(pe,{name:"maxTokens",label:f("openai.form.maxTokens.label"),children:s.jsx(Z,{type:"number"})})]}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:f("openai.form.triggerSettings.label")}),s.jsx(Yt,{})]}),s.jsx(un,{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"&&s.jsxs(s.Fragment,{children:[s.jsx(un,{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"}]}),s.jsx(pe,{name:"triggerValue",label:f("openai.form.triggerValue.label"),required:!0,children:s.jsx(Z,{})})]}),k==="advanced"&&s.jsx(pe,{name:"triggerValue",label:f("openai.form.triggerConditions.label"),required:!0,children:s.jsx(Z,{})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:f("openai.form.generalSettings.label")}),s.jsx(Yt,{})]}),s.jsx(pe,{name:"expire",label:f("openai.form.expire.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(pe,{name:"keywordFinish",label:f("openai.form.keywordFinish.label"),children:s.jsx(Z,{})}),s.jsx(pe,{name:"delayMessage",label:f("openai.form.delayMessage.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(pe,{name:"unknownMessage",label:f("openai.form.unknownMessage.label"),children:s.jsx(Z,{})}),s.jsx(Re,{name:"listeningFromMe",label:f("openai.form.listeningFromMe.label"),reverse:!0}),s.jsx(Re,{name:"stopBotFromMe",label:f("openai.form.stopBotFromMe.label"),reverse:!0}),s.jsx(Re,{name:"keepOpen",label:f("openai.form.keepOpen.label"),reverse:!0}),s.jsx(pe,{name:"debounceTime",label:f("openai.form.debounceTime.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(Re,{name:"splitMessages",label:f("openai.form.splitMessages.label"),reverse:!0}),w.watch("splitMessages")&&s.jsx(pe,{name:"timePerChar",label:f("openai.form.timePerChar.label"),children:s.jsx(Z,{type:"number"})})]}),a&&s.jsx(Kt,{children:s.jsx($,{disabled:o,type:"submit",children:f(o?"openai.button.saving":"openai.button.save")})}),!a&&s.jsxs("div",{children:[s.jsx(kO,{openaiId:r}),s.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[s.jsxs(vt,{open:l,onOpenChange:u,children:[s.jsx(an,{asChild:!0,children:s.jsx($,{variant:"destructive",size:"sm",children:f("dify.button.delete")})}),s.jsx(mt,{children:s.jsxs(gt,{children:[s.jsx(xt,{children:f("modal.delete.title")}),s.jsx(gr,{children:f("modal.delete.messageSingle")}),s.jsxs(Kt,{children:[s.jsx($,{size:"sm",variant:"outline",onClick:()=>u(!1),children:f("button.cancel")}),s.jsx($,{variant:"destructive",onClick:n,children:f("button.delete")})]})]})})]}),s.jsx($,{disabled:o,type:"submit",children:f(o?"openai.button.saving":"openai.button.update")})]})]})]})})}function Wse({resetTable:e}){const{t}=Le(),{instance:n}=ct(),{createOpenai:r}=Pd(),[a,o]=v.useState(!1),[l,u]=v.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}),Q.success(t("openai.toast.success.create")),u(!1),e()}catch(h){console.error("Error:",h),Q.error(`Error: ${h?.response?.data?.response?.message}`)}finally{o(!1)}};return s.jsxs(vt,{open:l,onOpenChange:u,children:[s.jsx(an,{asChild:!0,children:s.jsxs($,{size:"sm",children:[s.jsx($r,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:t("openai.button.create")})]})}),s.jsxs(mt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[s.jsx(gt,{children:s.jsx(xt,{children:t("openai.form.title")})}),s.jsx(EO,{onSubmit:d,isModal:!0,isLoading:a,open:l})]})]})}const Kse=e=>["openai","getOpenai",JSON.stringify(e)],Gse=async({instanceName:e,token:t,openaiId:n})=>{const r=await Ce.get(`/openai/fetch/${n}/${e}`,{headers:{apiKey:t}});return Array.isArray(r.data)?r.data[0]:r.data},Jse=e=>{const{instanceName:t,token:n,openaiId:r,...a}=e;return pt({...a,queryKey:Kse({instanceName:t}),queryFn:()=>Gse({instanceName:t,token:n,openaiId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function Qse({openaiId:e,resetTable:t}){const{t:n}=Le(),{instance:r}=ct(),a=Nn(),[o,l]=v.useState(!1),{deleteOpenai:u,updateOpenai:d}=Pd(),{data:f,isLoading:h}=Jse({instanceName:r?.name,openaiId:e}),m=v.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 x=>{try{if(r&&r.name&&e){const w={enabled:x.enabled,description:x.description,openaiCredsId:x.openaiCredsId,botType:x.botType,assistantId:x.assistantId||"",functionUrl:x.functionUrl||"",model:x.model||"",systemMessages:[x.systemMessages||""],assistantMessages:[x.assistantMessages||""],userMessages:[x.userMessages||""],maxTokens:x.maxTokens||0,triggerType:x.triggerType,triggerOperator:x.triggerOperator||"",triggerValue:x.triggerValue||"",expire:x.expire||0,keywordFinish:x.keywordFinish||"",delayMessage:x.delayMessage||1e3,unknownMessage:x.unknownMessage||"",listeningFromMe:x.listeningFromMe||!1,stopBotFromMe:x.stopBotFromMe||!1,keepOpen:x.keepOpen||!1,debounceTime:x.debounceTime||0,splitMessages:x.splitMessages||!1,timePerChar:x.timePerChar||0};await d({instanceName:r.name,openaiId:e,data:w}),Q.success(n("openai.toast.success.update")),t(),a(`/manager/instance/${r.id}/openai/${e}`)}else console.error("Token not found")}catch(w){console.error("Error:",w),Q.error(`Error: ${w?.response?.data?.response?.message}`)}},b=async()=>{try{r&&r.name&&e?(await u({instanceName:r.name,openaiId:e}),Q.success(n("openai.toast.success.delete")),l(!1),t(),a(`/manager/instance/${r.id}/openai`)):console.error("instance not found")}catch(x){console.error("Erro ao excluir dify:",x)}};return h?s.jsx(Hn,{}):s.jsx("div",{className:"m-4",children:s.jsx(EO,{initialData:m,onSubmit:g,openaiId:e,handleDelete:b,isModal:!1,isLoading:h,openDeletionDialog:o,setOpenDeletionDialog:l})})}function IE(){const{t:e}=Le(),t=eo("(min-width: 768px)"),{instance:n}=ct(),{botId:r}=Os(),{data:a,isLoading:o,refetch:l,error:u}=CO({instanceName:n?.name}),d=Nn(),f=m=>{n&&d(`/manager/instance/${n.id}/openai/${m}`)},h=()=>{l()};return s.jsx("main",{className:"pt-5",children:s.jsxs(ia,{error:u,name:"OpenAI",envVar:"OPENAI_ENABLED",children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[s.jsx("h3",{className:"text-lg font-medium",children:e("openai.title")}),s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsx(kO,{}),s.jsx(Dse,{}),s.jsx(jO,{}),s.jsx(Wse,{resetTable:h})]})]}),s.jsx(Yt,{className:"my-4"}),s.jsxs(ii,{direction:t?"horizontal":"vertical",children:[s.jsx(Mr,{defaultSize:r?35:100,className:"pr-4",children:s.jsx("div",{className:"flex flex-col gap-3",children:o?s.jsx(Hn,{}):s.jsx(s.Fragment,{children:a&&a.length>0&&Array.isArray(a)?a.map(m=>s.jsxs($,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>f(`${m.id}`),variant:r===m.id?"secondary":"outline",children:[s.jsx("h4",{className:"text-base",children:m.description||m.id}),s.jsx("p",{className:"text-sm font-normal text-muted-foreground",children:m.botType})]},m.id)):s.jsx($,{variant:"link",children:e("openai.table.none")})})})}),r&&s.jsxs(s.Fragment,{children:[s.jsx(li,{withHandle:!0,className:"border border-border"}),s.jsx(Mr,{children:s.jsx(Qse,{openaiId:r,resetTable:h})})]})]})]})})}const Yse=e=>{if(!e||e==="")return{enabled:!1,host:"",port:"",protocol:"",username:"",password:""};try{const t=JSON.parse(e);return{enabled:!0,host:t.host??"",port:t.port??"",protocol:"http",username:t.username??"",password:t.password??""}}catch{return{enabled:!1,host:"",port:"",protocol:"",username:"",password:""}}},Zse=e=>["proxy","fetchProxy","go",JSON.stringify(e)],Xse=e=>{const t=ja(),{instanceName:n,token:r,enabled:a,...o}=e;return pt({...o,queryKey:Zse({instanceName:n,token:r}),queryFn:async()=>{let u=t.getQueryData(["instance","fetchInstances","go"])?.find(f=>f.name===n)?.id;if(!u){const f=t.getQueriesData({queryKey:["instance","fetchInstance","go"]});for(const[,h]of f)if(h&&h.name===n){u=h.id;break}}if(!u)throw new Error(`Instance "${n}" not found in cache`);const d=await qt.get(`/instance/info/${u}`);return Yse(d.data?.data?.proxy)},enabled:!!n&&(a??!0),retry:!1})},eae=e=>["proxy","fetchProxy",JSON.stringify(e)],tae=async({instanceName:e,token:t})=>(await Ce.get(`/proxy/find/${e}`,{headers:{apiKey:t}})).data,nae=e=>{const{instanceName:t,token:n,enabled:r,...a}=e;return pt({...a,queryKey:eae({instanceName:t,token:n}),queryFn:()=>tae({instanceName:t,token:n}),enabled:!!t&&(r??!0)})},rae=e=>{const t=vr(),n=nae({...e,enabled:(e.enabled??!0)&&t==="api"}),r=Xse({...e,enabled:(e.enabled??!0)&&t==="go"});return t==="go"?r:n},sae=e=>{const t=r=>e.getQueryData(["instance","fetchInstances","go"])?.find(o=>o.name===r)?.id;return{createProxy:async({instanceName:r,data:a})=>{const o=t(r);if(!o)throw new Error(`Instance "${r}" not found in cache`);if(!(!!a.host&&!!a.port))return(await qt.delete(`/instance/proxy/${o}`)).data;const u={host:a.host,port:a.port,username:a.username??"",password:a.password??""};return(await qt.post(`/instance/proxy/${o}`,u)).data}}},aae=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/proxy/set/${e}`,n,{headers:{apikey:t}})).data;function oae(){const e=ja(),n=vr()==="go"?sae(e):null;return{createProxy:nt(n?n.createProxy:aae,{invalidateKeys:[["proxy","fetchProxy"]]})}}const iae=fn({enabled:Me(),host:he(),port:he(),protocol:he(),username:he(),password:he()});function lae(){const{t:e}=Le(),{instance:t}=ct(),[n,r]=v.useState(!1),a=vr()==="go",{createProxy:o}=oae(),{data:l}=rae({instanceName:t?.name}),u=mn({resolver:gn(iae),defaultValues:{enabled:!1,host:"",port:"",protocol:"http",username:"",password:""}});v.useEffect(()=>{l&&u.reset({enabled:l.enabled,host:l.host,port:l.port,protocol:l.protocol,username:l.username,password:l.password})},[l]);const d=async f=>{if(t){r(!0);try{const h={enabled:f.enabled,host:f.host,port:f.port,protocol:f.protocol,username:f.username,password:f.password};await o({instanceName:t.name,token:t.token,data:h}),Q.success(e("proxy.toast.success"))}catch(h){console.error(e("proxy.toast.error"),h),Q.error(`Error : ${h?.response?.data?.response?.message}`)}finally{r(!1)}}};return s.jsx(s.Fragment,{children:s.jsx(ka,{...u,children:s.jsx("form",{onSubmit:u.handleSubmit(d),className:"w-full space-y-6",children:s.jsxs("div",{children:[s.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("proxy.title")}),s.jsx(cl,{className:"my-4"}),s.jsxs("div",{className:"mx-4 space-y-2 divide-y [&>*]:p-4",children:[!a&&s.jsx(Re,{name:"enabled",label:e("proxy.form.enabled.label"),className:"w-full justify-between",helper:e("proxy.form.enabled.description")}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-[10rem_1fr_10rem] md:gap-8",children:[s.jsx(pe,{name:"protocol",label:e("proxy.form.protocol.label"),children:s.jsx(Z,{})}),s.jsx(pe,{name:"host",label:e("proxy.form.host.label"),children:s.jsx(Z,{})}),s.jsx(pe,{name:"port",label:e("proxy.form.port.label"),children:s.jsx(Z,{type:"number"})})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 md:gap-8",children:[s.jsx(pe,{name:"username",label:e("proxy.form.username.label"),children:s.jsx(Z,{})}),s.jsx(pe,{name:"password",label:e("proxy.form.password.label"),children:s.jsx(Z,{type:"password"})})]}),s.jsx("div",{className:"flex justify-end px-4 pt-6",children:s.jsx($,{type:"submit",disabled:n,children:e(n?"proxy.button.saving":"proxy.button.save")})})]})]})})})})}const cae=e=>["rabbitmq","fetchRabbitmq",JSON.stringify(e)],uae=async({instanceName:e,token:t})=>(await Ce.get(`/rabbitmq/find/${e}`,{headers:{apiKey:t}})).data,dae=e=>{const{instanceName:t,token:n,...r}=e;return pt({...r,queryKey:cae({instanceName:t,token:n}),queryFn:()=>uae({instanceName:t,token:n}),enabled:!!t})},fae=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/rabbitmq/set/${e}`,{rabbitmq:n},{headers:{apikey:t}})).data;function pae(){return{createRabbitmq:nt(fae,{invalidateKeys:[["rabbitmq","fetchRabbitmq"]]})}}const hae=fn({enabled:Me(),events:Ds(he())});function mae(){const{t:e}=Le(),{instance:t}=ct(),[n,r]=v.useState(!1),{createRabbitmq:a}=pae(),{data:o,error:l}=dae({instanceName:t?.name,token:t?.token}),u=mn({resolver:gn(hae),defaultValues:{enabled:!1,events:[]}});v.useEffect(()=>{o&&u.reset({enabled:o.enabled,events:o.events})},[o]);const d=async g=>{if(t){r(!0);try{const b={enabled:g.enabled,events:g.events};await a({instanceName:t.name,token:t.token,data:b}),Q.success(e("rabbitmq.toast.success"))}catch(b){console.error(e("rabbitmq.toast.error"),b),Q.error(`Error: ${b?.response?.data?.response?.message}`)}finally{r(!1)}}},f=["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"],h=()=>{u.setValue("events",f)},m=()=>{u.setValue("events",[])};return s.jsx(ia,{error:l,name:"RabbitMQ",envVar:"RABBITMQ_ENABLED",children:s.jsx(ka,{...u,children:s.jsx("form",{onSubmit:u.handleSubmit(d),className:"w-full space-y-6",children:s.jsxs("div",{children:[s.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("rabbitmq.title")}),s.jsx(cl,{className:"my-4"}),s.jsxs("div",{className:"mx-4 space-y-2 divide-y [&>*]:p-4",children:[s.jsx(Re,{name:"enabled",label:e("rabbitmq.form.enabled.label"),className:"w-full justify-between",helper:e("rabbitmq.form.enabled.description")}),s.jsxs("div",{className:"mb-4 flex justify-between",children:[s.jsx($,{variant:"outline",type:"button",onClick:h,children:e("button.markAll")}),s.jsx($,{variant:"outline",type:"button",onClick:m,children:e("button.unMarkAll")})]}),s.jsx(Xa,{control:u.control,name:"events",render:({field:g})=>s.jsxs(Ea,{className:"flex flex-col",children:[s.jsx(es,{className:"my-2 text-lg",children:e("rabbitmq.form.events.label")}),s.jsx(na,{children:s.jsx("div",{className:"flex flex-col gap-2 space-y-1 divide-y",children:f.sort((b,x)=>b.localeCompare(x)).map(b=>s.jsxs("div",{className:"flex items-center justify-between gap-3 pt-3",children:[s.jsx(es,{className:ln("break-all",g.value.includes(b)?"text-foreground":"text-muted-foreground"),children:b}),s.jsx(Md,{checked:g.value.includes(b),onCheckedChange:x=>{x?g.onChange([...g.value,b]):g.onChange(g.value.filter(w=>w!==b))}})]},b))})})]})})]}),s.jsx("div",{className:"mx-4 flex justify-end pt-6",children:s.jsx($,{type:"submit",disabled:n,children:e(n?"rabbitmq.button.saving":"rabbitmq.button.save")})})]})})})})}const NO=["events","messages","contacts","chats","groups","calls","receipts","reactions"],gae=["image","video","audio","document","sticker"],vp={capture:Object.fromEntries(NO.map(e=>[e,!0])),media:{mode:"all",types:[]},directions:["incoming","outgoing"],retentionDays:null};function vae({instanceName:e}){const[t,n]=v.useState(""),[r,a]=v.useState(),[o,l]=v.useState(vp),[u,d]=v.useState(null),[f,h]=v.useState([]),[m,g]=v.useState(!1),[b,x]=v.useState(""),[w,C]=v.useState(""),[k,N]=v.useState(""),[T,_]=v.useState(""),[P,M]=v.useState(!1),[O,D]=v.useState(null),[F,B]=v.useState(""),[te,U]=v.useState("all"),[ce,q]=v.useState(!0),ne=v.useMemo(()=>({"x-archive-key":t}),[t]),Y=async()=>{if(!t)return Q.error("Enter the archive API key first");g(!0);try{const[A,K]=await Promise.all([qt.get("/archive/status",{headers:ne,params:{instanceName:e}}),qt.get("/archive/policies",{headers:ne})]);d(A.data),h(K.data.filter(ee=>ee.enabled&&ee.scope==="jid"&&ee.selector?.instanceName===e));const re=[...K.data].filter(ee=>ee.enabled&&ee.scope==="account"&&ee.selector?.instanceName===e).sort((ee,ie)=>ie.version-ee.version)[0];re&&(a(re.id),l({...vp,...re.policy,capture:{...vp.capture,...re.policy.capture},media:{...vp.media,...re.policy.media}}))}catch(A){Q.error(A.response?.data?.response?.message||"Unable to load archive settings")}finally{g(!1)}},se=async()=>{if(!F.trim())return Q.error("Enter a group or contact JID");g(!0);try{await qt.put("/archive/policies",{scope:"jid",selector:{instanceName:e,jid:F.trim()},policy:{capture:{messages:ce},media:{mode:te}}},{headers:ne}),B(""),Q.success("JID-specific archive rule saved"),await Y()}catch(A){Q.error(A.response?.data?.response?.message||"Unable to save JID rule")}finally{g(!1)}},H=async()=>{g(!0);try{const A=await qt.put("/archive/policies",{id:r,scope:"account",selector:{instanceName:e},policy:o},{headers:ne});a(A.data.id),Q.success("Archive policy saved. It applies to new events.")}catch(A){Q.error(A.response?.data?.response?.message||"Unable to save archive policy")}finally{g(!1)}},W=async()=>{const A={...b?{before:new Date(b).toISOString()}:{},...w.trim()?{groupJid:w.trim()}:{},...k.trim()?{entityJid:k.trim()}:{},...T.trim()?{eventTypes:T.split(",").map(K=>K.trim()).filter(Boolean)}:{},mediaOnly:P};g(!0);try{const K=await qt.post(`/archive/purges/preview/${e}`,A,{headers:ne});D(K.data)}catch(K){Q.error(K.response?.data?.response?.message||"Unable to preview purge")}finally{g(!1)}},V=async()=>{if(!(!O||!window.confirm(`Permanently delete ${O.summary.events} events and ${O.summary.media} media objects?`))){g(!0);try{await qt.post("/archive/purges/confirm",{previewId:O.previewId,confirmationToken:O.confirmationToken},{headers:ne}),D(null),Q.success("Archive purge completed and a signed tombstone was recorded."),await Y()}catch(A){Q.error(A.response?.data?.response?.message||"Unable to confirm purge")}finally{g(!1)}}};return s.jsxs("section",{className:"mt-10 space-y-6",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-medium",children:"WhatsApp archive"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure durable capture, media retention, and irreversible purge for this instance."})]}),s.jsx(Yt,{}),s.jsxs("div",{className:"mx-4 space-y-6",children:[s.jsxs("div",{className:"grid gap-3 md:grid-cols-[1fr_auto]",children:[s.jsxs("div",{children:[s.jsx("label",{className:"text-sm font-medium",children:"Archive API key"}),s.jsx(Z,{type:"password",value:t,onChange:A=>n(A.target.value),placeholder:"Required for archive administration"}),s.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Requires a global-admin manager session. Held only in this page's memory; it is not saved in browser storage."})]}),s.jsx($,{type:"button",className:"self-end",onClick:Y,disabled:m||!t,children:"Load archive"})]}),u&&s.jsxs("div",{className:"rounded border p-3 text-sm",children:["Archive: ",s.jsx("strong",{children:u.enabled?"enabled":"disabled"})," · events: ",u.accounts?.[0]?.events??0," · media: ",u.accounts?.[0]?.media??0," · last sequence:"," ",u.accounts?.[0]?.lastSequence??0]}),s.jsxs("div",{className:"space-y-3",children:[s.jsx("h4",{className:"font-medium",children:"What to keep"}),s.jsx("div",{className:"grid grid-cols-2 gap-2 md:grid-cols-4",children:NO.map(A=>s.jsxs("label",{className:"flex gap-2 text-sm",children:[s.jsx("input",{type:"checkbox",checked:o.capture[A],onChange:K=>l({...o,capture:{...o.capture,[A]:K.target.checked}})}),A]},A))}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[s.jsxs("label",{className:"text-sm",children:["Media mode",s.jsxs("select",{className:"mt-1 w-full rounded border bg-background p-2",value:o.media.mode,onChange:A=>l({...o,media:{...o.media,mode:A.target.value}}),children:[s.jsx("option",{value:"all",children:"Keep all media"}),s.jsx("option",{value:"images",children:"Images only"}),s.jsx("option",{value:"metadata",children:"Metadata only"}),s.jsx("option",{value:"none",children:"No media"})]})]}),s.jsxs("label",{className:"text-sm",children:["Retention target (days; purge stays explicit)",s.jsx(Z,{type:"number",min:1,value:o.retentionDays??"",onChange:A=>l({...o,retentionDays:A.target.value?Number(A.target.value):null}),placeholder:"Blank = forever"})]}),s.jsxs("div",{className:"text-sm",children:["Directions",s.jsx("div",{className:"mt-2 flex gap-4",children:["incoming","outgoing"].map(A=>s.jsxs("label",{className:"flex gap-2",children:[s.jsx("input",{type:"checkbox",checked:o.directions.includes(A),onChange:K=>l({...o,directions:K.target.checked?[...o.directions,A]:o.directions.filter(re=>re!==A)})}),A]},A))})]})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-sm",children:"Additional media types"}),s.jsx("div",{className:"mt-2 flex flex-wrap gap-4",children:gae.map(A=>s.jsxs("label",{className:"flex gap-2 text-sm",children:[s.jsx("input",{type:"checkbox",checked:o.media.types.includes(A),onChange:K=>l({...o,media:{...o.media,types:K.target.checked?[...o.media.types,A]:o.media.types.filter(re=>re!==A)}})}),A]},A))})]}),s.jsx($,{type:"button",onClick:H,disabled:m||!t,children:"Save archive policy"})]}),s.jsxs("div",{className:"space-y-3 rounded border p-4",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium",children:"Group or contact override"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Add a more-specific rule, for example images only for one group or no message history for one chat."})]}),s.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[s.jsxs("label",{className:"text-sm",children:["Group/contact JID",s.jsx(Z,{value:F,onChange:A=>B(A.target.value),placeholder:"120363...@g.us"})]}),s.jsxs("label",{className:"text-sm",children:["Media mode",s.jsxs("select",{className:"mt-1 w-full rounded border bg-background p-2",value:te,onChange:A=>U(A.target.value),children:[s.jsx("option",{value:"all",children:"Keep all media"}),s.jsx("option",{value:"images",children:"Images only"}),s.jsx("option",{value:"metadata",children:"Metadata only"}),s.jsx("option",{value:"none",children:"No media"})]})]}),s.jsxs("label",{className:"flex items-center gap-2 self-end pb-2 text-sm",children:[s.jsx("input",{type:"checkbox",checked:ce,onChange:A=>q(A.target.checked)}),"Keep message history"]})]}),s.jsx($,{type:"button",onClick:se,disabled:m||!t||!F.trim(),children:"Add override"}),f.length>0&&s.jsx("div",{className:"space-y-1 text-xs text-muted-foreground",children:f.map(A=>s.jsxs("div",{children:[A.selector.jid,": messages ",A.policy.capture?.messages===!1?"off":"on",", media ",A.policy.media?.mode??"inherited"," (version ",A.version,")"]},A.id))})]}),s.jsx(Yt,{}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium",children:"Purge archive data"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Preview first. Confirmation permanently removes matching database rows and media objects, then records a signed tombstone."})]}),s.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("label",{className:"text-sm",children:["Delete history before",s.jsx(Z,{type:"datetime-local",value:b,onChange:A=>x(A.target.value)})]}),s.jsxs("label",{className:"text-sm",children:["Specific group JID",s.jsx(Z,{value:w,onChange:A=>C(A.target.value),placeholder:"120363...@g.us"})]}),s.jsxs("label",{className:"text-sm",children:["Specific chat/contact JID",s.jsx(Z,{value:k,onChange:A=>N(A.target.value)})]}),s.jsxs("label",{className:"text-sm",children:["Event types (comma-separated)",s.jsx(Is,{value:T,onChange:A=>_(A.target.value),placeholder:"messages.upsert, messages.update"})]})]}),s.jsxs("label",{className:"flex gap-2 text-sm",children:[s.jsx("input",{type:"checkbox",checked:P,onChange:A=>M(A.target.checked)}),"Delete matching media only; keep event history"]}),s.jsx($,{type:"button",onClick:W,disabled:m||!t,children:"Preview purge"}),O&&s.jsxs("div",{className:"rounded border border-destructive p-4",children:[s.jsxs("p",{className:"font-medium",children:["Preview: ",O.summary.events," events and ",O.summary.media," media objects"]}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Expires ",new Date(O.expiresAt).toLocaleString()]}),s.jsx($,{type:"button",className:"mt-3",onClick:V,disabled:m,children:"Permanently purge this preview"})]})]})]})]})}function yae(){const e=vr(),{instance:t}=ct(),{data:n=[]}=WR(),{data:r=[],refetch:a}=uZ(t?.name),o=KR(),[l,u]=v.useState(""),[d,f]=v.useState("instance"),[h,m]=v.useState(""),g=async()=>{if(!(!t||!l))try{await o.assign({instanceName:t.name,templateId:l,scope:d,target:d==="instance"?void 0:h}),await a(),Q.success("Template assigned")}catch(x){Q.error(x instanceof Error?x.message:"Assignment failed")}},b=async x=>{if(t)try{await o.unassign({instanceName:t.name,scope:x.scope,target:x.target||void 0}),await a(),Q.success("Assignment removed")}catch(w){Q.error(w instanceof Error?w.message:"Could not remove assignment")}};return e!=="api"?null:s.jsxs("div",{className:"space-y-4 rounded-md border p-4",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx("h4",{className:"font-medium",children:"Settings template assignments"}),s.jsx(PN,{className:"text-sm text-primary hover:underline",to:"/manager/settings-templates",children:"Manage templates"})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Instance default < exact group/contact < per-request override. Template edits propagate live."})]}),s.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[s.jsxs("select",{className:"h-10 rounded-md border bg-background px-3",value:l,onChange:x=>u(x.target.value),children:[s.jsx("option",{value:"",children:"Choose template"}),n.map(x=>s.jsx("option",{value:x.id,children:x.name},x.id))]}),s.jsxs("select",{className:"h-10 rounded-md border bg-background px-3",value:d,onChange:x=>f(x.target.value),children:[s.jsx("option",{value:"instance",children:"Instance default"}),s.jsx("option",{value:"group",children:"Group"}),s.jsx("option",{value:"contact",children:"Contact"})]}),d==="instance"?s.jsx("div",{}):s.jsx(Z,{value:h,onChange:x=>m(x.target.value),placeholder:d==="group"?"120363…@g.us":"…@s.whatsapp.net or …@lid"})]}),s.jsx($,{type:"button",onClick:g,disabled:!l||d!=="instance"&&!h.trim(),children:"Assign template"}),s.jsx("div",{className:"space-y-2",children:r.map(x=>s.jsxs("div",{className:"flex items-center justify-between rounded bg-muted p-3 text-sm",children:[s.jsxs("span",{children:[s.jsx("strong",{children:x.Template?.name??x.templateId})," · ",x.scope,x.target?` · ${x.target}`:""]}),s.jsx($,{type:"button",size:"sm",variant:"outline",onClick:()=>b(x),children:"Unassign"})]},x.id))})]})}const xae=e=>["instance","fetchSettings",JSON.stringify(e)],bae=async({instanceName:e,token:t})=>(await Ce.get(`/settings/find/${e}`,{headers:{apikey:t}})).data,wae=e=>{const{instanceName:t,token:n,enabled:r,...a}=e;return pt({...a,queryKey:xae({instanceName:t,token:n}),queryFn:()=>bae({instanceName:t,token:n}),enabled:!!t&&(r??!0)})},Sae=e=>{const t=vr(),n=wae({...e,enabled:(e.enabled??!0)&&t==="api"}),r=n8({...e,enabled:(e.enabled??!0)&&t==="go"});return t==="go"?r:n},Cae=fn({rejectCall:Me(),msgCall:he().optional(),groupsIgnore:Me(),alwaysOnline:Me(),readMessages:Me(),syncFullHistory:Me(),readStatus:Me()});function jae(){const{t:e}=Le(),[t,n]=v.useState(!1),{instance:r}=ct(),{updateSettings:a}=Tc(),{data:o,isLoading:l}=Sae({instanceName:r?.name,token:r?.token}),u=mn({resolver:gn(Cae),defaultValues:{rejectCall:!1,msgCall:"",groupsIgnore:!1,alwaysOnline:!1,readMessages:!1,syncFullHistory:!1,readStatus:!1}});v.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 a({instanceName:r.name,token:r.token,data:g}),Q.success(e("settings.toast.success"))}catch(g){console.error(e("settings.toast.success"),g),Q.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?s.jsx(Hn,{}):s.jsxs(s.Fragment,{children:[s.jsx(yae,{}),s.jsx("div",{className:"h-6"}),s.jsx(ka,{...u,children:s.jsx("form",{onSubmit:u.handleSubmit(d),className:"w-full space-y-6",children:s.jsxs("div",{children:[s.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("settings.title")}),s.jsx(Yt,{className:"my-4"}),s.jsxs("div",{className:"mx-4 space-y-2 divide-y",children:[s.jsxs("div",{className:"flex flex-col p-4",children:[s.jsx(Re,{name:"rejectCall",label:e("settings.form.rejectCall.label"),className:"w-full justify-between",helper:e("settings.form.rejectCall.description")}),h&&s.jsx("div",{className:"mr-16 mt-2",children:s.jsx(pe,{name:"msgCall",children:s.jsx(Is,{placeholder:e("settings.form.msgCall.description")})})})]}),f.map(m=>s.jsx("div",{className:"flex p-4",children:s.jsx(Re,{name:m.name,label:m.label,className:"w-full justify-between",helper:m.description})},m.name)),s.jsx("div",{className:"flex justify-end pt-6",children:s.jsx($,{type:"submit",disabled:t,children:e(t?"settings.button.saving":"settings.button.save")})})]})]})})}),r?.name&&s.jsx(vae,{instanceName:r.name})]})}const kae=e=>["sqs","fetchSqs",JSON.stringify(e)],Eae=async({instanceName:e,token:t})=>(await Ce.get(`/sqs/find/${e}`,{headers:{apiKey:t}})).data,Nae=e=>{const{instanceName:t,token:n,...r}=e;return pt({...r,queryKey:kae({instanceName:t,token:n}),queryFn:()=>Eae({instanceName:t,token:n}),enabled:!!t})},Tae=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/sqs/set/${e}`,{sqs:n},{headers:{apikey:t}})).data;function Mae(){return{createSqs:nt(Tae,{invalidateKeys:[["sqs","fetchSqs"]]})}}const _ae=fn({enabled:Me(),events:Ds(he())});function Pae(){const{t:e}=Le(),{instance:t}=ct(),[n,r]=v.useState(!1),{createSqs:a}=Mae(),{data:o,error:l}=Nae({instanceName:t?.name,token:t?.token}),u=mn({resolver:gn(_ae),defaultValues:{enabled:!1,events:[]}});v.useEffect(()=>{o&&u.reset({enabled:o.enabled,events:o.events})},[o]);const d=async g=>{if(t){r(!0);try{const b={enabled:g.enabled,events:g.events};await a({instanceName:t.name,token:t.token,data:b}),Q.success(e("sqs.toast.success"))}catch(b){console.error(e("sqs.toast.error"),b),Q.error(`Error: ${b?.response?.data?.response?.message}`)}finally{r(!1)}}},f=["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"],h=()=>{u.setValue("events",f)},m=()=>{u.setValue("events",[])};return s.jsx(ia,{error:l,name:"SQS",envVar:"SQS_ENABLED",children:s.jsx(ka,{...u,children:s.jsx("form",{onSubmit:u.handleSubmit(d),className:"w-full space-y-6",children:s.jsxs("div",{children:[s.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("sqs.title")}),s.jsx(cl,{className:"my-4"}),s.jsxs("div",{className:"mx-4 space-y-2 divide-y [&>*]:p-4",children:[s.jsx(Re,{name:"enabled",label:e("sqs.form.enabled.label"),className:"w-full justify-between",helper:e("sqs.form.enabled.description")}),s.jsxs("div",{className:"mb-4 flex justify-between",children:[s.jsx($,{variant:"outline",type:"button",onClick:h,children:e("button.markAll")}),s.jsx($,{variant:"outline",type:"button",onClick:m,children:e("button.unMarkAll")})]}),s.jsx(Xa,{control:u.control,name:"events",render:({field:g})=>s.jsxs(Ea,{className:"flex flex-col",children:[s.jsx(es,{className:"my-2 text-lg",children:e("sqs.form.events.label")}),s.jsx(na,{children:s.jsx("div",{className:"flex flex-col gap-2 space-y-1 divide-y",children:f.sort((b,x)=>b.localeCompare(x)).map(b=>s.jsxs("div",{className:"flex items-center justify-between gap-3 pt-3",children:[s.jsx(es,{className:ln("break-all",g.value.includes(b)?"text-foreground":"text-muted-foreground"),children:b}),s.jsx(Md,{checked:g.value.includes(b),onCheckedChange:x=>{x?g.onChange([...g.value,b]):g.onChange(g.value.filter(w=>w!==b))}})]},b))})})]})})]}),s.jsx("div",{className:"mx-4 flex justify-end pt-6",children:s.jsx($,{type:"submit",disabled:n,children:e(n?"sqs.button.saving":"sqs.button.save")})})]})})})})}const Rae=e=>["typebot","findTypebot",JSON.stringify(e)],Iae=async({instanceName:e,token:t})=>(await Ce.get(`/typebot/find/${e}`,{headers:{apiKey:t}})).data,TO=e=>{const{instanceName:t,token:n,...r}=e;return pt({...r,queryKey:Rae({instanceName:t}),queryFn:()=>Iae({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},Oae=e=>["typebot","fetchDefaultSettings",JSON.stringify(e)],Aae=async({instanceName:e,token:t})=>{const n=await Ce.get(`/typebot/fetchSettings/${e}`,{headers:{apiKey:t}});return Array.isArray(n.data)?n.data[0]:n.data},Dae=e=>{const{instanceName:t,token:n,...r}=e;return pt({...r,queryKey:Oae({instanceName:t}),queryFn:()=>Aae({instanceName:t,token:n}),enabled:!!t&&(e.enabled??!0)})},Fae=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/typebot/create/${e}`,n,{headers:{apikey:t}})).data,Lae=async({instanceName:e,token:t,typebotId:n,data:r})=>(await Ce.put(`/typebot/update/${n}/${e}`,r,{headers:{apikey:t}})).data,$ae=async({instanceName:e,typebotId:t})=>(await Ce.delete(`/typebot/delete/${t}/${e}`)).data,Bae=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/typebot/settings/${e}`,n,{headers:{apikey:t}})).data,zae=async({instanceName:e,token:t,remoteJid:n,status:r})=>(await Ce.post(`/typebot/changeStatus/${e}`,{remoteJid:n,status:r},{headers:{apikey:t}})).data;function Dm(){const e=nt(Bae,{invalidateKeys:[["typebot","fetchDefaultSettings"]]}),t=nt(zae,{invalidateKeys:[["typebot","getTypebot"],["typebot","fetchSessions"]]}),n=nt($ae,{invalidateKeys:[["typebot","getTypebot"],["typebot","findTypebot"],["typebot","fetchSessions"]]}),r=nt(Lae,{invalidateKeys:[["typebot","getTypebot"],["typebot","findTypebot"],["typebot","fetchSessions"]]}),a=nt(Fae,{invalidateKeys:[["typebot","findTypebot"]]});return{setDefaultSettingsTypebot:e,changeStatusTypebot:t,deleteTypebot:n,updateTypebot:r,createTypebot:a}}const Uae=fn({expire:ot.number(),keywordFinish:he(),delayMessage:ot.number(),unknownMessage:he(),listeningFromMe:Me(),stopBotFromMe:Me(),keepOpen:Me(),debounceTime:ot.number()});function Vae(){const{t:e}=Le(),{instance:t}=ct(),[n,r]=v.useState(!1),{setDefaultSettingsTypebot:a}=Dm(),{data:o,refetch:l}=Dae({instanceName:t?.name,token:t?.token,enabled:n}),{data:u,refetch:d}=TO({instanceName:t?.name,token:t?.token,enabled:n}),f=mn({resolver:gn(Uae),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&&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 b={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 a({instanceName:t.name,token:t.token,data:b}),Q.success(e("typebot.toast.defaultSettings.success"))}catch(b){console.error(e("typebot.toast.defaultSettings.error"),b),Q.error(`Error: ${b?.response?.data?.response?.message}`)}};function m(){l(),d()}return s.jsxs(vt,{open:n,onOpenChange:r,children:[s.jsx(an,{asChild:!0,children:s.jsxs($,{variant:"secondary",size:"sm",children:[s.jsx(Zo,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:e("typebot.button.defaultSettings")})]})}),s.jsxs(mt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",onCloseAutoFocus:m,children:[s.jsx(gt,{children:s.jsx(xt,{children:e("typebot.modal.defaultSettings.title")})}),s.jsx(yr,{...f,children:s.jsxs("form",{className:"w-full space-y-6",onSubmit:f.handleSubmit(h),children:[s.jsx("div",{children:s.jsxs("div",{className:"space-y-4",children:[s.jsx(un,{name:"typebotIdFallback",label:e("typebot.form.typebotIdFallback.label"),options:u?.filter(g=>!!g.id).map(g=>({label:g.typebot,value:g.description}))??[]}),s.jsx(pe,{name:"expire",label:e("typebot.form.expire.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(pe,{name:"keywordFinish",label:e("typebot.form.keywordFinish.label"),children:s.jsx(Z,{})}),s.jsx(pe,{name:"delayMessage",label:e("typebot.form.delayMessage.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(pe,{name:"unknownMessage",label:e("typebot.form.unknownMessage.label"),children:s.jsx(Z,{})}),s.jsx(Re,{name:"listeningFromMe",label:e("typebot.form.listeningFromMe.label"),reverse:!0}),s.jsx(Re,{name:"stopBotFromMe",label:e("typebot.form.stopBotFromMe.label"),reverse:!0}),s.jsx(Re,{name:"keepOpen",label:e("typebot.form.keepOpen.label"),reverse:!0}),s.jsx(pe,{name:"debounceTime",label:e("typebot.form.debounceTime.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(ai,{name:"ignoreJids",label:e("typebot.form.ignoreJids.label"),placeholder:e("typebot.form.ignoreJids.placeholder")})]})}),s.jsx(Kt,{children:s.jsx($,{type:"submit",children:e("typebot.button.save")})})]})})]})]})}const qae=e=>["typebot","fetchSessions",JSON.stringify(e)],Hae=async({instanceName:e,typebotId:t,token:n})=>(await Ce.get(`/typebot/fetchSessions/${t}/${e}`,{headers:{apiKey:n}})).data,Wae=e=>{const{instanceName:t,token:n,typebotId:r,...a}=e;return pt({...a,queryKey:qae({instanceName:t}),queryFn:()=>Hae({instanceName:t,token:n,typebotId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})},yp={name:"",number:"",status:"all",time:"all",customCondition:"more",customValue:"",customUnit:"minutes"};function Kae(e,t){const n=parseInt(e);return!n||isNaN(n)||n<=0?null:t==="hours"?n*60:t==="days"?n*1440:n}function Gae(e,t){if(t.time==="all")return!0;const n=(Date.now()-new Date(e).getTime())/6e4;if(t.time==="custom"){const r=Kae(t.customValue,t.customUnit);return r===null?!0:t.customCondition==="more"?n>r:n<=r}if(t.time.startsWith(">")){const r=parseInt(t.time.slice(1));return n>r}return n<=parseInt(t.time)}function MO({typebotId:e}){const{t}=Le(),{instance:n}=ct(),{changeStatusTypebot:r}=Dm(),[a,o]=v.useState(!1),[l,u]=v.useState([]),[d,f]=v.useState({}),[h,m]=v.useState(yp),[g,b]=v.useState(yp),[x,w]=v.useState(9),[C,k]=v.useState(9),[N,T]=v.useState("opened"),[_,P]=v.useState(!1),[M,O]=v.useState(""),[D,F]=v.useState(""),[B,te]=v.useState(!1),{data:U,refetch:ce}=Wae({instanceName:n?.name,typebotId:e,enabled:a}),q=v.useMemo(()=>{const j=U??[],I=g.name.trim().toLowerCase(),me=g.number.trim();return j.filter(be=>!(I&&!be.pushName?.toLowerCase().includes(I)||me&&!be.remoteJid.includes(me)||g.status!=="all"&&be.status!==g.status||!Gae(be.updatedAt,g)))},[U,g]),ne=q.slice(0,C),Y=v.useMemo(()=>Object.keys(d).filter(j=>d[j]).map(j=>ne[Number(j)]?.remoteJid).filter(Boolean),[d,ne]);v.useEffect(()=>{k(x),f({})},[g,x]);const se=()=>{ce()},H=()=>{b(h)},W=()=>{m(yp),b(yp)},V=async(j,I)=>{try{if(!n)return;await r({instanceName:n.name,token:n.token,remoteJid:j,status:I}),Q.success(t("typebot.toast.success.status")),se()}catch(me){console.error("Error:",me),Q.error(`Error : ${me?.response?.data?.response?.message}`)}},A=async()=>{if(Y.length===0){Q.error(t("sessions.mass.noneSelected"));return}try{if(!n)return;await Promise.all(Y.map(j=>r({instanceName:n.name,token:n.token,remoteJid:j,status:N}))),Q.success(t("sessions.mass.success")),f({}),se()}catch(j){console.error(j),Q.error(j?.response?.data?.response?.message??t("sessions.mass.error"))}},K=j=>{O(j),F(""),P(!0)},re=async()=>{if(!D.trim()){Q.error(t("sessions.send.empty"));return}try{if(!n)return;te(!0),await Ce.post(`/message/sendText/${n.name}`,{number:M,text:D},{headers:{apikey:n.token}}),Q.success(t("sessions.send.success")),P(!1),F(""),O("")}catch(j){console.error("Error:",j),Q.error(j?.response?.data?.response?.message??j?.message??t("sessions.send.error"))}finally{te(!1)}},ee=[{id:"select",header:({table:j})=>s.jsx(ts,{checked:j.getIsAllPageRowsSelected()||j.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:I=>j.toggleAllPageRowsSelected(!!I),"aria-label":t("sessions.mass.selectAll")}),cell:({row:j})=>s.jsx(ts,{checked:j.getIsSelected(),onCheckedChange:I=>j.toggleSelected(!!I),"aria-label":t("sessions.mass.selectAll")}),enableSorting:!1},{accessorKey:"remoteJid",header:()=>s.jsx("div",{className:"text-center",children:t("typebot.sessions.table.remoteJid")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("remoteJid")})},{accessorKey:"pushName",header:()=>s.jsx("div",{className:"text-center",children:t("typebot.sessions.table.pushName")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("pushName")})},{accessorKey:"sessionId",header:()=>s.jsx("div",{className:"text-center",children:t("typebot.sessions.table.sessionId")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("sessionId")})},{accessorKey:"status",header:()=>s.jsx("div",{className:"text-center",children:t("typebot.sessions.table.status")}),cell:({row:j})=>s.jsx("div",{children:j.getValue("status")})},{id:"actions",enableHiding:!1,cell:({row:j})=>{const I=j.original;return s.jsxs(vs,{children:[s.jsx(ys,{asChild:!0,children:s.jsxs($,{variant:"ghost",size:"icon",children:[s.jsx("span",{className:"sr-only",children:t("typebot.sessions.table.actions.title")}),s.jsx(Xo,{className:"h-4 w-4"})]})}),s.jsxs(xs,{align:"end",children:[s.jsx(ei,{children:t("typebot.sessions.table.actions.title")}),s.jsx(ti,{}),I.status!=="opened"&&s.jsxs(Ct,{onClick:()=>V(I.remoteJid,"opened"),children:[s.jsx(al,{className:"mr-2 h-4 w-4"}),t("typebot.sessions.table.actions.open")]}),I.status!=="paused"&&I.status!=="closed"&&s.jsxs(Ct,{onClick:()=>V(I.remoteJid,"paused"),children:[s.jsx(sl,{className:"mr-2 h-4 w-4"}),t("typebot.sessions.table.actions.pause")]}),I.status!=="closed"&&s.jsxs(Ct,{onClick:()=>V(I.remoteJid,"closed"),children:[s.jsx(el,{className:"mr-2 h-4 w-4"}),t("typebot.sessions.table.actions.close")]}),s.jsxs(Ct,{onClick:()=>K(I.remoteJid),children:[s.jsx(rl,{className:"mr-2 h-4 w-4"}),t("sessions.actions.sendMessage")]}),s.jsxs(Ct,{onClick:()=>V(I.remoteJid,"delete"),children:[s.jsx(tl,{className:"mr-2 h-4 w-4"}),t("typebot.sessions.table.actions.delete")]})]})]})}}],ie=["all","5","10","15","20","30","60",">60",">120",">300",">1440","custom"],ue=["all","opened","paused","closed"];return s.jsxs(vt,{open:a,onOpenChange:o,children:[s.jsx(an,{asChild:!0,children:s.jsxs($,{variant:"secondary",size:"sm",children:[s.jsx(nl,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden md:inline",children:t("typebot.sessions.label")})]})}),s.jsxs(mt,{className:"max-w-7xl h-[85vh] flex flex-col overflow-hidden",children:[s.jsx(gt,{children:s.jsx(xt,{children:t("typebot.sessions.label")})}),s.jsxs("div",{className:"flex-1 space-y-4 overflow-y-auto pr-2",children:[s.jsxs(Un,{children:[s.jsx(Yn,{children:s.jsx(Zn,{className:"text-base",children:t("sessions.filters.title")})}),s.jsxs(Vn,{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.name")}),s.jsx(Z,{placeholder:t("sessions.filters.namePlaceholder"),value:h.name,onChange:j=>m(I=>({...I,name:j.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.number")}),s.jsx(Z,{placeholder:t("sessions.filters.numberPlaceholder"),value:h.number,onChange:j=>m(I=>({...I,number:j.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.status")}),s.jsxs(_t,{value:h.status,onValueChange:j=>m(I=>({...I,status:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsx(It,{children:ue.map(j=>s.jsx(we,{value:j,children:t(`sessions.filters.statusOptions.${j}`)},j))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ve,{children:t("sessions.filters.time")}),s.jsxs(_t,{value:h.time,onValueChange:j=>m(I=>({...I,time:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsx(It,{children:ie.map(j=>s.jsx(we,{value:j,children:t(`sessions.filters.timeOptions.${j}`)},j))})]})]})]}),h.time==="custom"&&s.jsxs("div",{className:"grid grid-cols-1 gap-2 md:grid-cols-3",children:[s.jsxs(_t,{value:h.customCondition,onValueChange:j=>m(I=>({...I,customCondition:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"more",children:t("sessions.filters.custom.more")}),s.jsx(we,{value:"less",children:t("sessions.filters.custom.less")})]})]}),s.jsx(Z,{type:"number",min:1,placeholder:t("sessions.filters.custom.valuePlaceholder"),value:h.customValue,onChange:j=>m(I=>({...I,customValue:j.target.value}))}),s.jsxs(_t,{value:h.customUnit,onValueChange:j=>m(I=>({...I,customUnit:j})),children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"minutes",children:t("sessions.filters.custom.minutes")}),s.jsx(we,{value:"hours",children:t("sessions.filters.custom.hours")}),s.jsx(we,{value:"days",children:t("sessions.filters.custom.days")})]})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx($,{onClick:H,size:"sm",children:t("sessions.filters.apply")}),s.jsx($,{onClick:W,size:"sm",variant:"outline",children:t("sessions.filters.clear")}),s.jsxs($,{onClick:se,size:"sm",variant:"outline",children:[s.jsx(ol,{size:14,className:"mr-1"}),t("button.refresh")]})]})]})]}),Y.length>0&&s.jsxs(Un,{children:[s.jsx(Yn,{children:s.jsx(Zn,{className:"text-base",children:t("sessions.mass.title")})}),s.jsx(Vn,{children:s.jsxs("div",{className:"flex flex-wrap items-end gap-3",children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:t("sessions.mass.selected",{count:Y.length})}),s.jsxs("div",{className:"flex-1 min-w-[180px] space-y-1",children:[s.jsx(Ve,{children:t("sessions.mass.newStatus")}),s.jsxs(_t,{value:N,onValueChange:T,children:[s.jsx(Rt,{children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"opened",children:t("typebot.sessions.table.actions.open")}),s.jsx(we,{value:"paused",children:t("typebot.sessions.table.actions.pause")}),s.jsx(we,{value:"closed",children:t("typebot.sessions.table.actions.close")}),s.jsx(we,{value:"delete",children:t("typebot.sessions.table.actions.delete")})]})]})]}),s.jsx($,{onClick:A,size:"sm",children:t("sessions.mass.apply")})]})})]}),s.jsx(ci,{columns:ee,data:ne,onSortingChange:u,state:{sorting:l,rowSelection:d},onRowSelectionChange:f,enableRowSelection:!0,getRowId:(j,I)=>String(I),noResultsMessage:t("sessions.empty")}),s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 px-1 text-sm text-muted-foreground",children:[s.jsx("span",{children:t("sessions.pagination.showing",{shown:ne.length,total:q.length})}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(Ve,{htmlFor:"per-page",className:"text-xs",children:t("sessions.pagination.perPage")}),s.jsxs(_t,{value:String(x),onValueChange:j=>w(parseInt(j)),children:[s.jsx(Rt,{id:"per-page",className:"h-8 w-20",children:s.jsx(Pt,{})}),s.jsxs(It,{children:[s.jsx(we,{value:"9",children:"9"}),s.jsx(we,{value:"25",children:"25"}),s.jsx(we,{value:"50",children:"50"}),s.jsx(we,{value:"100",children:"100"})]})]}),Ck(j=>Math.min(j+x,q.length)),children:t("sessions.pagination.showMore")}),Ck(q.length),children:t("sessions.pagination.showAll")}),C>x&&s.jsx($,{size:"sm",variant:"outline",onClick:()=>k(x),children:t("sessions.pagination.showLess")})]})]})]}),s.jsx(vt,{open:_,onOpenChange:j=>!B&&P(j),children:s.jsxs(mt,{className:"sm:max-w-md",children:[s.jsx(gt,{children:s.jsx(xt,{children:t("sessions.send.title")})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{children:t("sessions.send.to")}),s.jsx(Z,{value:M,disabled:!0})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ve,{children:t("sessions.send.messagePlaceholder")}),s.jsx(ni,{rows:4,placeholder:t("sessions.send.messagePlaceholder"),value:D,onChange:j=>F(j.target.value)})]})]}),s.jsxs(Kt,{children:[s.jsx($,{variant:"outline",onClick:()=>P(!1),disabled:B,children:t("button.cancel")}),s.jsx($,{onClick:re,disabled:B,children:t(B?"sessions.send.sending":"sessions.send.send")})]})]})})]})]})}const Jae=fn({enabled:Me(),description:he(),url:he(),typebot:he().optional(),triggerType:he(),triggerOperator:he().optional(),triggerValue:he().optional(),expire:ot.number().optional(),keywordFinish:he().optional(),delayMessage:ot.number().optional(),unknownMessage:he().optional(),listeningFromMe:Me().optional(),stopBotFromMe:Me().optional(),keepOpen:Me().optional(),debounceTime:ot.number().optional()});function _O({initialData:e,onSubmit:t,handleDelete:n,typebotId:r,isModal:a=!1,isLoading:o=!1,openDeletionDialog:l=!1,setOpenDeletionDialog:u=()=>{}}){const{t:d}=Le(),f=mn({resolver:gn(Jae),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 s.jsx(yr,{...f,children:s.jsxs("form",{onSubmit:f.handleSubmit(t),className:"w-full space-y-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsx(Re,{name:"enabled",label:d("typebot.form.enabled.label"),reverse:!0}),s.jsx(pe,{name:"description",label:d("typebot.form.description.label"),required:!0,children:s.jsx(Z,{})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("typebot.form.typebotSettings.label")}),s.jsx(Yt,{})]}),s.jsx(pe,{name:"url",label:d("typebot.form.url.label"),required:!0,children:s.jsx(Z,{})}),s.jsx(pe,{name:"typebot",label:d("typebot.form.typebot.label"),children:s.jsx(Z,{})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("typebot.form.triggerSettings.label")}),s.jsx(Yt,{})]}),s.jsx(un,{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"&&s.jsxs(s.Fragment,{children:[s.jsx(un,{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"}]}),s.jsx(pe,{name:"triggerValue",label:d("typebot.form.triggerValue.label"),children:s.jsx(Z,{})})]}),h==="advanced"&&s.jsx(pe,{name:"triggerValue",label:d("typebot.form.triggerConditions.label"),children:s.jsx(Z,{})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("h3",{className:"my-4 text-lg font-medium",children:d("typebot.form.generalSettings.label")}),s.jsx(Yt,{})]}),s.jsx(pe,{name:"expire",label:d("typebot.form.expire.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(pe,{name:"keywordFinish",label:d("typebot.form.keywordFinish.label"),children:s.jsx(Z,{})}),s.jsx(pe,{name:"delayMessage",label:d("typebot.form.delayMessage.label"),children:s.jsx(Z,{type:"number"})}),s.jsx(pe,{name:"unknownMessage",label:d("typebot.form.unknownMessage.label"),children:s.jsx(Z,{})}),s.jsx(Re,{name:"listeningFromMe",label:d("typebot.form.listeningFromMe.label"),reverse:!0}),s.jsx(Re,{name:"stopBotFromMe",label:d("typebot.form.stopBotFromMe.label"),reverse:!0}),s.jsx(Re,{name:"keepOpen",label:d("typebot.form.keepOpen.label"),reverse:!0}),s.jsx(pe,{name:"debounceTime",label:d("typebot.form.debounceTime.label"),children:s.jsx(Z,{type:"number"})})]}),a&&s.jsx(Kt,{children:s.jsx($,{disabled:o,type:"submit",children:d(o?"typebot.button.saving":"typebot.button.save")})}),!a&&s.jsxs("div",{children:[s.jsx(MO,{typebotId:r}),s.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[s.jsxs(vt,{open:l,onOpenChange:u,children:[s.jsx(an,{asChild:!0,children:s.jsx($,{variant:"destructive",size:"sm",children:d("dify.button.delete")})}),s.jsx(mt,{children:s.jsxs(gt,{children:[s.jsx(xt,{children:d("modal.delete.title")}),s.jsx(gr,{children:d("modal.delete.messageSingle")}),s.jsxs(Kt,{children:[s.jsx($,{size:"sm",variant:"outline",onClick:()=>u(!1),children:d("button.cancel")}),s.jsx($,{variant:"destructive",onClick:n,children:d("button.delete")})]})]})})]}),s.jsx($,{disabled:o,type:"submit",children:d(o?"typebot.button.saving":"typebot.button.update")})]})]})]})})}function Qae({resetTable:e}){const{t}=Le(),{instance:n}=ct(),{createTypebot:r}=Dm(),[a,o]=v.useState(!1),[l,u]=v.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}),Q.success(t("typebot.toast.success.create")),u(!1),e()}catch(h){console.error("Error:",h),Q.error(`Error: ${h?.response?.data?.response?.message}`)}finally{o(!1)}};return s.jsxs(vt,{open:l,onOpenChange:u,children:[s.jsx(an,{asChild:!0,children:s.jsxs($,{size:"sm",children:[s.jsx($r,{size:16,className:"mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:t("typebot.button.create")})]})}),s.jsxs(mt,{className:"overflow-y-auto sm:max-h-[600px] sm:max-w-[740px]",children:[s.jsx(gt,{children:s.jsx(xt,{children:t("typebot.form.title")})}),s.jsx(_O,{onSubmit:d,isModal:!0,isLoading:a})]})]})}const Yae=e=>["typebot","getTypebot",JSON.stringify(e)],Zae=async({instanceName:e,token:t,typebotId:n})=>{const r=await Ce.get(`/typebot/fetch/${n}/${e}`,{headers:{apiKey:t}});return Array.isArray(r.data)?r.data[0]:r.data},Xae=e=>{const{instanceName:t,token:n,typebotId:r,...a}=e;return pt({...a,queryKey:Yae({instanceName:t}),queryFn:()=>Zae({instanceName:t,token:n,typebotId:r}),enabled:!!t&&!!r&&(e.enabled??!0)})};function eoe({typebotId:e,resetTable:t}){const{t:n}=Le(),{instance:r}=ct(),a=Nn(),[o,l]=v.useState(!1),{deleteTypebot:u,updateTypebot:d}=Dm(),{data:f,isLoading:h}=Xae({instanceName:r?.name,typebotId:e}),m=v.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 x=>{try{if(r&&r.name&&e){const w={enabled:x.enabled,description:x.description,url:x.url,typebot:x.typebot||"",triggerType:x.triggerType,triggerOperator:x.triggerOperator||"",triggerValue:x.triggerValue||"",expire:x.expire||0,keywordFinish:x.keywordFinish||"",delayMessage:x.delayMessage||1e3,unknownMessage:x.unknownMessage||"",listeningFromMe:x.listeningFromMe||!1,stopBotFromMe:x.stopBotFromMe||!1,keepOpen:x.keepOpen||!1,debounceTime:x.debounceTime||0};await d({instanceName:r.name,typebotId:e,data:w}),Q.success(n("typebot.toast.success.update")),t(),a(`/manager/instance/${r.id}/typebot/${e}`)}else console.error("Token not found")}catch(w){console.error("Error:",w),Q.error(`Error: ${w?.response?.data?.response?.message}`)}},b=async()=>{try{r&&r.name&&e?(await u({instanceName:r.name,typebotId:e}),Q.success(n("typebot.toast.success.delete")),l(!1),t(),a(`/manager/instance/${r.id}/typebot`)):console.error("instance not found")}catch(x){console.error("Erro ao excluir dify:",x)}};return h?s.jsx(Hn,{}):s.jsx("div",{className:"m-4",children:s.jsx(_O,{initialData:m,onSubmit:g,typebotId:e,handleDelete:b,isModal:!1,isLoading:h,openDeletionDialog:o,setOpenDeletionDialog:l})})}function OE(){const{t:e}=Le(),t=eo("(min-width: 768px)"),{instance:n}=ct(),{typebotId:r}=Os(),{data:a,isLoading:o,refetch:l,error:u}=TO({instanceName:n?.name,token:n?.token}),d=Nn(),f=m=>{n&&d(`/manager/instance/${n.id}/typebot/${m}`)},h=()=>{l()};return s.jsx("main",{className:"pt-5",children:s.jsxs(ia,{error:u,name:"Typebot",envVar:"TYPEBOT_ENABLED",children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[s.jsx("h3",{className:"text-lg font-medium",children:e("typebot.title")}),s.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[s.jsx(MO,{}),s.jsx(Vae,{}),s.jsx(Qae,{resetTable:h})]})]}),s.jsx(Yt,{className:"my-4"}),s.jsxs(ii,{direction:t?"horizontal":"vertical",children:[s.jsx(Mr,{defaultSize:r?35:100,className:"pr-4",children:s.jsx("div",{className:"flex flex-col gap-3",children:o?s.jsx(Hn,{}):s.jsx(s.Fragment,{children:a&&a.length>0&&Array.isArray(a)?a.map(m=>s.jsx($,{className:"flex h-auto flex-col items-start justify-start",onClick:()=>f(`${m.id}`),variant:r===m.id?"secondary":"outline",children:m.description?s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"text-base",children:m.description}),s.jsxs("p",{className:"text-wrap text-sm font-normal text-muted-foreground",children:[m.url," - ",m.typebot]})]}):s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"text-base",children:m.url}),s.jsx("p",{className:"text-wrap text-sm font-normal text-muted-foreground",children:m.typebot})]})},m.id)):s.jsx($,{variant:"link",children:e("typebot.table.none")})})})}),r&&s.jsxs(s.Fragment,{children:[s.jsx(li,{withHandle:!0,className:"border border-black"}),s.jsx(Mr,{children:s.jsx(eoe,{typebotId:r,resetTable:h})})]})]})]})})}const toe=e=>["webhook","fetchWebhook","go",JSON.stringify(e)],noe=(e,t)=>{const r=e.getQueryData(["instance","fetchInstances","go"])?.find(o=>o.name===t);if(r)return r.id;const a=e.getQueriesData({queryKey:["instance","fetchInstance","go"]});for(const[,o]of a)if(o?.name===t)return o.id},roe=e=>{const t=ja(),{instanceName:n,token:r,enabled:a,...o}=e;return pt({...o,queryKey:toe({instanceName:n,token:r}),queryFn:async()=>{const l=noe(t,n);if(!l)throw new Error(`Instance "${n}" not found in cache`);const d=(await qt.get(`/instance/info/${l}`)).data?.data,f=d?.webhook??"",h=d?.events??"",m=h?h.split(",").map(g=>g.trim()).filter(Boolean):[];return{enabled:!!f,url:f,events:m,webhookBase64:!1,webhookByEvents:!1}},enabled:!!n&&(a??!0),retry:!1})},soe=e=>["webhook","fetchWebhook",JSON.stringify(e)],aoe=async({instanceName:e,token:t})=>(await Ce.get(`/webhook/find/${e}`,{headers:{apiKey:t}})).data,ooe=async({instanceName:e,token:t})=>(await Ce.get(`/webhook/find-all/${e}`,{headers:{apiKey:t}})).data,ioe=e=>{const{instanceName:t,token:n,enabled:r,...a}=e;return pt({...a,queryKey:soe({instanceName:t,token:n}),queryFn:()=>aoe({instanceName:t,token:n}),enabled:!!t&&(r??!0)})},loe=e=>{const t=vr(),n=ioe({...e,enabled:(e.enabled??!0)&&t==="api"}),r=roe({...e,enabled:(e.enabled??!0)&&t==="go"});return t==="go"?r:n},coe=e=>{const{instanceName:t,token:n,enabled:r,...a}=e;return pt({...a,queryKey:["webhook","fetchWebhooks",JSON.stringify({instanceName:t,token:n})],queryFn:()=>ooe({instanceName:t,token:n}),enabled:!!t&&(r??!0)&&vr()==="api"})},uoe=e=>{const t=r=>{const o=e.getQueryData(["instance","fetchInstances","go"])?.find(u=>u.name===r);if(o)return o;const l=e.getQueriesData({queryKey:["instance","fetchInstance","go"]});for(const[,u]of l)if(u?.name===r)return u};return{createWebhook:async({instanceName:r,data:a})=>{const o=t(r);if(!o)throw new Error(`Instance "${r}" not found in cache`);const l={webhookUrl:a.url??"",subscribe:a.events??[],rabbitmqEnable:"",websocketEnable:"",natsEnable:""};return(await qt.post("/instance/connect",l,{headers:{apikey:o.token}})).data}}},doe=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/webhook/set/${e}`,{webhook:n},{headers:{apikey:t}})).data,foe=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/webhook/set-many/${e}`,{webhooks:n},{headers:{apikey:t}})).data;function poe(){const e=ja(),n=vr()==="go"?uoe(e):null,r=nt(n?n.createWebhook:doe,{invalidateKeys:[["webhook","fetchWebhook"],["webhook","fetchWebhooks"]]}),a=nt(foe,{invalidateKeys:[["webhook","fetchWebhook"],["webhook","fetchWebhooks"]]});return{createWebhook:r,saveWebhooks:a}}const hoe=fn({name:he().trim().min(1,"Enter a webhook name").max(100),enabled:Me(),url:he().url("Enter a valid HTTP or HTTPS URL"),events:Ds(he()),base64:Me(),byEvents:Me()}),moe=fn({webhooks:Ds(hoe).min(1)}),AE=(e=1)=>({name:`Webhook ${e}`,enabled:!0,url:"",events:[],base64:!1,byEvents:!1}),goe=["ALL","MESSAGE","SEND_MESSAGE","READ_RECEIPT","PRESENCE","HISTORY_SYNC","CHAT_PRESENCE","CALL","CONNECTION","QRCODE","LABEL","CONTACT","GROUP","NEWSLETTER"],voe=["APPLICATION_STARTUP","QRCODE_UPDATED","MESSAGES_SET","MESSAGES_UPSERT","MESSAGES_EDITED","MESSAGES_UPDATE","MESSAGES_DELETE","MESSAGES_MEDIA_UPDATE","MESSAGES_REACTION","MESSAGE_RECEIPT_UPDATE","SEND_MESSAGE","SEND_MESSAGE_UPDATE","CONTACTS_SET","CONTACTS_UPSERT","CONTACTS_UPDATE","PRESENCE_UPDATE","CHATS_SET","CHATS_UPSERT","CHATS_UPDATE","CHATS_DELETE","CHATS_LOCK","GROUPS_UPSERT","GROUPS_UPDATE","GROUP_PARTICIPANTS_UPDATE","GROUP_JOIN_REQUEST","GROUP_MEMBER_TAG_UPDATE","CONNECTION_UPDATE","CREDS_UPDATE","MESSAGING_HISTORY_SET","MESSAGING_HISTORY_STATUS","LID_MAPPING_UPDATE","BLOCKLIST_SET","BLOCKLIST_UPDATE","NEWSLETTER_REACTION","NEWSLETTER_VIEW","NEWSLETTER_PARTICIPANTS_UPDATE","NEWSLETTER_SETTINGS_UPDATE","MESSAGE_CAPPING_UPDATE","SETTINGS_UPDATE","LABELS_EDIT","LABELS_ASSOCIATION","CALL","TYPEBOT_START","TYPEBOT_CHANGE_STATUS","REMOVE_INSTANCE","LOGOUT_INSTANCE","INSTANCE_CREATE","INSTANCE_DELETE","STATUS_INSTANCE"].sort((e,t)=>e.localeCompare(t));function yoe(){const{t:e}=Le(),{instance:t}=ct(),[n,r]=v.useState(!1),[a,o]=v.useState(null),l=vr()==="go",{createWebhook:u,saveWebhooks:d}=poe(),{data:f}=loe({instanceName:t?.name,token:t?.token,enabled:l}),{data:h}=coe({instanceName:t?.name,token:t?.token,enabled:!l}),m=mn({resolver:gn(moe),defaultValues:{webhooks:[AE()]}}),g=P8({control:m.control,name:"webhooks"}),b=m.watch("webhooks");v.useEffect(()=>{const C=l?f?[f]:[]:h??[];C.length&&m.reset({webhooks:C.map((k,N)=>({name:k.name?.trim()||`Webhook ${N+1}`,enabled:k.enabled,url:k.url,events:k.events??[],base64:k.webhookBase64,byEvents:k.webhookByEvents}))})},[m,l,f,h]);const x=async({webhooks:C})=>{if(t){r(!0);try{const k=C.map(N=>({...N}));l?await u({instanceName:t.name,token:t.token,data:k[0]}):await d({instanceName:t.name,token:t.token,data:k}),Q.success(e("webhook.toast.success"))}catch(k){console.error(e("webhook.toast.error"),k),Q.error(`Error: ${k?.response?.data?.response?.message??k?.message??"Unable to save webhooks"}`)}finally{r(!1)}}},w=l?goe:voe;return s.jsx(ka,{...m,children:s.jsxs("form",{onSubmit:m.handleSubmit(x),className:"w-full space-y-6",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("webhook.title")}),!l&&s.jsx("p",{className:"text-sm text-muted-foreground",children:e("webhook.description")})]}),!l&&s.jsx($,{variant:"outline",type:"button",onClick:()=>g.append(AE(g.fields.length+1)),children:e("webhook.button.add")})]}),s.jsx(cl,{className:"my-4"}),s.jsx("div",{className:"space-y-6",children:g.fields.map((C,k)=>{const N=b[k],T=(N?.events[0]??"messages-upsert").toLowerCase().replace(/_/g,"-"),_=`${(N?.url??"https://automation.example/webhook/whatsapp").replace(/\/+$/,"")}/${T}`;return s.jsx(sw,{open:a===k,onOpenChange:P=>o(P?k:null),children:s.jsxs("section",{className:"rounded-lg border shadow-sm",children:[s.jsxs("div",{className:"flex items-center gap-2 p-4",children:[s.jsx(aw,{asChild:!0,children:s.jsxs("button",{type:"button",className:"flex min-w-0 flex-1 items-center justify-between gap-3 text-left",children:[s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:"block truncate font-medium",children:N?.name||`Webhook ${k+1}`}),s.jsxs("span",{className:"block truncate text-xs text-muted-foreground",children:[N?.enabled?e("webhook.status.enabled"):e("webhook.status.disabled")," · ",N?.events.length??0," ",e("webhook.status.events")]})]}),s.jsx(Ib,{className:ln("size-4 shrink-0 transition-transform",a===k&&"rotate-180")})]})}),!l&&g.fields.length>1&&s.jsx($,{variant:"outline",type:"button",onClick:()=>{g.remove(k),o(null)},children:e("webhook.button.remove")})]}),s.jsx(ow,{children:s.jsxs("div",{className:"space-y-3 border-t p-4",children:[!l&&s.jsx(pe,{name:`webhooks.${k}.name`,label:e("webhook.form.name.label"),children:s.jsx(Z,{placeholder:"Community join requests"})}),!l&&s.jsx(Re,{name:`webhooks.${k}.enabled`,label:e("webhook.form.enabled.label"),className:"w-full justify-between",helper:e("webhook.form.enabled.description")}),s.jsx(pe,{name:`webhooks.${k}.url`,label:e("webhook.form.url.label"),children:s.jsx(Z,{placeholder:"https://automation.example/webhook/whatsapp"})}),N?.url.includes("/webhook-test/")&&s.jsx("div",{className:"rounded-md border border-amber-500/40 bg-amber-500/10 p-3 text-xs",children:e("webhook.form.url.n8nTestWarning")}),!l&&s.jsx(Re,{name:`webhooks.${k}.byEvents`,label:e("webhook.form.byEvents.label"),className:"w-full justify-between",helper:e("webhook.form.byEvents.description")}),!l&&N?.byEvents&&s.jsxs("div",{className:"rounded-md border border-amber-500/40 bg-amber-500/10 p-3 text-xs",children:[s.jsx("p",{children:e("webhook.form.byEvents.n8nWarning")}),s.jsx("p",{className:"mt-2 break-all font-mono",children:_})]}),!l&&s.jsx(Re,{name:`webhooks.${k}.base64`,label:e("webhook.form.base64.label"),className:"w-full justify-between",helper:e("webhook.form.base64.description")}),s.jsxs("div",{className:"flex flex-wrap justify-between gap-2 pt-3",children:[s.jsx($,{variant:"outline",type:"button",onClick:()=>m.setValue(`webhooks.${k}.events`,w),children:e("button.markAll")}),s.jsx($,{variant:"outline",type:"button",onClick:()=>m.setValue(`webhooks.${k}.events`,[]),children:e("button.unMarkAll")})]}),s.jsx(Xa,{control:m.control,name:`webhooks.${k}.events`,render:({field:P})=>s.jsxs(Ea,{className:"flex flex-col",children:[s.jsxs(es,{className:"my-2 text-lg",children:[e("webhook.form.events.label")," (",P.value.length," selected)"]}),s.jsx(na,{children:s.jsx("div",{className:"grid gap-x-8 gap-y-2 md:grid-cols-2",children:w.map(M=>s.jsxs("div",{className:"flex items-center justify-between gap-3 border-t pt-3",children:[s.jsx(es,{className:ln("break-all text-xs",P.value.includes(M)?"text-foreground":"text-muted-foreground"),children:M}),s.jsx(Md,{checked:P.value.includes(M),onCheckedChange:O=>P.onChange(O?[...P.value,M]:P.value.filter(D=>D!==M))})]},M))})})]})})]})})]})},C.id)})}),s.jsx("div",{className:"flex justify-end pt-2",children:s.jsx($,{type:"submit",disabled:n,children:e(n?"webhook.button.saving":"webhook.button.save")})})]})})}const xoe=e=>["websocket","fetchWebsocket",JSON.stringify(e)],boe=async({instanceName:e,token:t})=>(await Ce.get(`/websocket/find/${e}`,{headers:{apiKey:t}})).data,woe=e=>{const{instanceName:t,token:n,...r}=e;return pt({...r,queryKey:xoe({instanceName:t,token:n}),queryFn:()=>boe({instanceName:t,token:n}),enabled:!!t})},Soe=async({instanceName:e,token:t,data:n})=>(await Ce.post(`/websocket/set/${e}`,{websocket:n},{headers:{apikey:t}})).data;function Coe(){return{createWebsocket:nt(Soe,{invalidateKeys:[["websocket","fetchWebsocket"]]})}}const joe=fn({enabled:Me(),events:Ds(he())});function koe(){const{t:e}=Le(),{instance:t}=ct(),[n,r]=v.useState(!1),{createWebsocket:a}=Coe(),{data:o,error:l}=woe({instanceName:t?.name,token:t?.token}),u=mn({resolver:gn(joe),defaultValues:{enabled:!1,events:[]}});v.useEffect(()=>{o&&u.reset({enabled:o.enabled,events:o.events})},[o]);const d=async g=>{if(t){r(!0);try{const b={enabled:g.enabled,events:g.events};await a({instanceName:t.name,token:t.token,data:b}),Q.success(e("websocket.toast.success"))}catch(b){console.error(e("websocket.toast.error"),b),Q.error(`Error: ${b?.response?.data?.response?.message}`)}finally{r(!1)}}},f=["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"],h=()=>{u.setValue("events",f)},m=()=>{u.setValue("events",[])};return s.jsx(ia,{error:l,name:"Websocket",envVar:"WEBSOCKET_ENABLED",children:s.jsx(ka,{...u,children:s.jsx("form",{onSubmit:u.handleSubmit(d),className:"w-full space-y-6",children:s.jsxs("div",{children:[s.jsx("h3",{className:"mb-1 text-lg font-medium",children:e("websocket.title")}),s.jsx(cl,{className:"my-4"}),s.jsxs("div",{className:"mx-4 space-y-2 divide-y [&>*]:p-4",children:[s.jsx(Re,{name:"enabled",label:e("websocket.form.enabled.label"),className:"w-full justify-between",helper:e("websocket.form.enabled.description")}),s.jsxs("div",{className:"mb-4 flex justify-between",children:[s.jsx($,{variant:"outline",type:"button",onClick:h,children:e("button.markAll")}),s.jsx($,{variant:"outline",type:"button",onClick:m,children:e("button.unMarkAll")})]}),s.jsx(Xa,{control:u.control,name:"events",render:({field:g})=>s.jsxs(Ea,{className:"flex flex-col",children:[s.jsx(es,{className:"my-2 text-lg",children:e("websocket.form.events.label")}),s.jsx(na,{children:s.jsx("div",{className:"flex flex-col gap-2 space-y-1 divide-y",children:f.sort((b,x)=>b.localeCompare(x)).map(b=>s.jsxs("div",{className:"flex items-center justify-between gap-3 pt-3",children:[s.jsx(es,{className:ln("break-all",g.value.includes(b)?"text-foreground":"text-muted-foreground"),children:b}),s.jsx(Md,{checked:g.value.includes(b),onCheckedChange:x=>{x?g.onChange([...g.value,b]):g.onChange(g.value.filter(w=>w!==b))}})]},b))})})]})})]}),s.jsx("div",{className:"mx-4 flex justify-end pt-6",children:s.jsx($,{type:"submit",disabled:n,children:e(n?"websocket.button.saving":"websocket.button.save")})})]})})})})}const Ww=15e3;function Kw(e,t){return`${e.replace(/\/+$/,"")}${t}`}async function Eoe(e,t){const n={};return t&&(n.apikey=t),(await dn.get(Kw(e,"/license/status"),{headers:n,timeout:Ww})).data}async function Noe(e,t,n){const r={};return n&&(r.apikey=n),(await dn.get(Kw(t,"/license/register"),{headers:r,params:{redirect_uri:e},timeout:Ww})).data}async function Toe(e,t,n){const r={};return n&&(r.apikey=n),(await dn.get(Kw(t,"/license/activate"),{headers:r,params:{code:e},timeout:Ww})).data}function Moe(){const{t:e}=Le(),{theme:t}=Zi(),n=Nn(),[r]=Sc(),a=r.get("code")??"",[o,l]=v.useState("activating"),[u,d]=v.useState(""),f=t==="dark"?"https://evolution-api.com/files/evo/evolution-logo-white.svg":"https://evolution-api.com/files/evo/evolution-logo.svg",h=v.useCallback(async()=>{if(l("activating"),d(""),!a){l("error"),d(e("license.callback.missingCode"));return}const m=mr(Fn.API_URL),g=mr(Fn.TOKEN);if(!m||!g){l("error"),d(e("license.callback.missingCredentials"));return}try{const b=await Toe(a,m,g);if(b.status==="active"){l("success"),setTimeout(()=>n("/manager",{replace:!0}),1500);return}l("error"),d(b.message||b.error||e("license.callback.genericError"))}catch(b){l("error");const x=b?.response?.data?.details??b?.response?.data?.message??b?.message??e("license.callback.genericError");d(typeof x=="string"?x:e("license.callback.genericError"))}},[a,n,e]);return v.useEffect(()=>{h()},[h]),s.jsx("div",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-t from-primary/20 via-background/95 to-background p-4",children:s.jsxs("div",{className:"w-full max-w-md space-y-6",children:[s.jsxs("div",{className:"flex flex-col items-center text-center",children:[s.jsx("img",{src:f,alt:"Evolution API",className:"mb-3 h-10"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:e("license.callback.title")})]}),s.jsxs("div",{className:"space-y-4 rounded-lg border bg-background/80 p-8 text-center shadow-lg backdrop-blur-sm",children:[o==="activating"&&s.jsxs(s.Fragment,{children:[s.jsx(qh,{className:"mx-auto h-12 w-12 animate-spin text-primary"}),s.jsx("h2",{className:"text-xl font-semibold",children:e("license.callback.title")}),s.jsx("p",{className:"text-muted-foreground",children:e("license.callback.activating")})]}),o==="success"&&s.jsxs(s.Fragment,{children:[s.jsx(ZB,{className:"mx-auto h-12 w-12 text-green-500"}),s.jsx("h2",{className:"text-xl font-semibold",children:e("license.callback.successTitle")}),s.jsx("p",{className:"text-muted-foreground",children:e("license.callback.successDescription")})]}),o==="error"&&s.jsxs(s.Fragment,{children:[s.jsx(tz,{className:"mx-auto h-12 w-12 text-destructive"}),s.jsx("h2",{className:"text-xl font-semibold",children:e("license.callback.errorTitle")}),s.jsx("p",{className:"text-muted-foreground",children:u}),s.jsxs("div",{className:"flex justify-center gap-2 pt-2",children:[s.jsx($,{variant:"outline",onClick:()=>n("/manager/login",{replace:!0}),children:e("license.callback.back")}),s.jsx($,{onClick:h,children:e("license.callback.retry")})]})]})]})]})})}const _oe=async({url:e,token:t})=>{try{const{data:n}=await dn.post(`${e}/verify-creds`,{},{headers:{apikey:t}});return kp({facebookAppId:n.facebookAppId,facebookConfigId:n.facebookConfigId,facebookUserToken:n.facebookUserToken}),n}catch{return null}},Poe=async({url:e,token:t})=>{try{const{data:n}=await dn.get(`${e}/server/ok`,{headers:{apikey:t,"Cache-Control":"no-cache"},params:{t:Date.now()}});return n?.status==="ok"}catch{return!1}},Roe=async({url:e})=>(await dn.get(`${e}/`)).data,Ioe=fn({provider:yw(["api","go"]).default(wb),serverUrl:he({required_error:"serverUrl is required"}).url("URL inválida"),apiKey:he({required_error:"ApiKey is required"}).min(1,"API Key é obrigatória")});function Ooe(){const{t:e}=Le(),t=Nn(),{theme:n}=Zi(),[r,a]=v.useState(""),[o,l]=v.useState(!1),u=n==="dark"?"https://evolution-api.com/files/evo/evolution-logo-white.svg":"https://evolution-api.com/files/evo/evolution-logo.svg",d=mn({resolver:gn(Ioe),defaultValues:{provider:wb,serverUrl:window.location.protocol+"//"+window.location.host,apiKey:""}}),f=async m=>{l(!0),a("");try{const g=m.serverUrl.replace(/\/+$/,"");if(m.provider==="api")try{if((await Eoe(g,m.apiKey)).status!=="active"){const C=`${window.location.origin}/manager/license/callback`,k=await Noe(C,g,m.apiKey);if(!k.register_url){const N=k.message||e("license.registerFailed");a(N);return}kp({url:g,token:m.apiKey,provider:"api"}),window.location.href=k.register_url;return}}catch(w){console.warn("[license] status check skipped:",w)}if(m.provider==="go"){if(!await Poe({url:g,token:m.apiKey})){fx();const C=e("login.message.invalidCredentials");d.setError("apiKey",{type:"manual",message:C}),a(C);return}kp({url:g,token:m.apiKey,provider:"go"}),t("/manager/");return}const b=await Roe({url:m.serverUrl});if(!b||!b.version){fx();const w=e("login.message.invalidServer");d.setError("serverUrl",{type:"manual",message:w}),a(w);return}if(!await _oe({token:m.apiKey,url:m.serverUrl})){const w=e("login.message.invalidCredentials");d.setError("apiKey",{type:"manual",message:w}),a(w);return}kp({version:b.version,clientName:b.clientName,url:m.serverUrl,token:m.apiKey,provider:"api"}),t("/manager/")}finally{l(!1)}},h=d.formState.errors;return s.jsx("div",{className:"relative flex min-h-screen items-center justify-center bg-gradient-to-t from-primary/20 via-background/95 to-background p-4",children:s.jsxs("div",{className:"w-full max-w-md space-y-6",children:[s.jsxs("div",{className:"flex flex-col items-center text-center",children:[s.jsx("img",{src:u,alt:"Evolution API",className:"mb-3 h-10"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:e("login.description")})]}),s.jsxs("div",{className:"rounded-lg border bg-background/80 p-6 shadow-lg backdrop-blur-sm",children:[s.jsxs("div",{className:"mb-6 space-y-2",children:[s.jsx("h2",{className:"text-2xl font-bold",children:e("login.title")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:e("login.subtitle",{defaultValue:"Digite suas credenciais para acessar o sistema"})})]}),r&&s.jsxs(pI,{variant:"destructive",className:"mb-4",children:[s.jsx(fM,{className:"h-4 w-4"}),s.jsx(hI,{children:"Erro"}),s.jsx(AX,{children:r})]}),s.jsx(ka,{...d,children:s.jsxs("form",{onSubmit:d.handleSubmit(f),className:"space-y-4",children:[s.jsx("div",{className:"hidden","aria-hidden":"true",children:s.jsx(un,{required:!0,name:"provider",label:"Provider",options:[{value:"api",label:"Evolution API"},{value:"go",label:"Evolution GO"}]})}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs(Ve,{htmlFor:"login-serverUrl",children:[e("login.form.serverUrl")," ",s.jsx("span",{className:"text-rose-600",children:"*"})]}),s.jsx(Z,{id:"login-serverUrl",type:"text",placeholder:window.location.origin,disabled:o,...d.register("serverUrl")}),h.serverUrl&&s.jsx("p",{className:"text-sm text-destructive",children:h.serverUrl.message})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs(Ve,{htmlFor:"login-apiKey",children:[e("login.form.apiKey")," ",s.jsx("span",{className:"text-rose-600",children:"*"})]}),s.jsx(Z,{id:"login-apiKey",type:"password",placeholder:"Sua chave de API",disabled:o,...d.register("apiKey")}),h.apiKey&&s.jsx("p",{className:"text-sm text-destructive",children:h.apiKey.message})]}),s.jsx($,{type:"submit",disabled:o,className:"w-full",children:o?s.jsxs(s.Fragment,{children:[s.jsx(qh,{className:"mr-2 h-4 w-4 animate-spin"}),e("login.button.connecting",{defaultValue:"Conectando..."})]}):e("login.button.login")})]})})]}),s.jsx("div",{className:"text-center text-xs text-muted-foreground",children:s.jsxs("p",{children:["© ",new Date().getFullYear()," Evolution API ·"," ",s.jsx("a",{href:"https://github.com/Neup123/evolution-api/tree/main/docs",target:"_blank",rel:"noreferrer",className:"underline hover:text-primary",children:"Documentation"})]})})]})})}function Aoe(){const e=Nn(),{theme:t}=Zi(),n=()=>{e("/manager")};return s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsxs("header",{className:"flex items-center justify-between px-4 py-2",children:[s.jsx("div",{className:"flex items-center",children:s.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"})}),s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx($_,{}),s.jsx(B_,{})]})]}),s.jsx("div",{className:"container mx-auto px-4 py-16",children:s.jsxs("div",{className:"max-w-4xl mx-auto",children:[s.jsxs("div",{className:"text-center mb-12",children:[s.jsx("div",{className:"flex items-center justify-center mb-6",children:s.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"})}),s.jsx("h1",{className:"text-4xl font-bold text-foreground mb-4",children:"Evolution Manager v2"}),s.jsx("p",{className:"text-xl text-muted-foreground mb-6",children:"Modern web interface for Evolution API management"}),s.jsx(Ao,{variant:"secondary",className:"text-sm px-3 py-1",children:"Version 2.0.0"})]}),s.jsxs(Un,{className:"mb-8",children:[s.jsxs(Yn,{children:[s.jsxs(Zn,{className:"flex items-center gap-2",children:[s.jsx(Ez,{className:"w-5 h-5 text-primary"}),"Welcome to Evolution Manager"]}),s.jsx(ij,{children:"A powerful, modern dashboard for managing your WhatsApp API instances with Evolution API"})]}),s.jsx(Vn,{className:"space-y-6",children:s.jsx("div",{className:"pt-6 border-t border-border",children:s.jsx("div",{className:"flex flex-col sm:flex-row gap-4 justify-center items-center",children:s.jsxs($,{onClick:n,size:"lg",className:"px-8 py-3",children:["Access Manager Dashboard",s.jsx(Rb,{className:"w-4 h-4 ml-2"})]})})})})]}),s.jsxs(Un,{children:[s.jsxs(Yn,{children:[s.jsx(Zn,{children:"Resources & Support"}),s.jsx(ij,{children:"Get help, contribute, or learn more about Evolution API"})]}),s.jsx(Vn,{children:s.jsxs("div",{className:"grid md:grid-cols-3 gap-4",children:[s.jsxs("a",{href:"https://github.com/evolution-foundation/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:[s.jsx(cz,{className:"w-5 h-5 text-muted-foreground"}),s.jsxs("div",{children:[s.jsx("div",{className:"font-medium text-foreground",children:"GitHub"}),s.jsx("div",{className:"text-sm text-muted-foreground",children:"Source code"})]})]}),s.jsxs("a",{href:"https://evolutionfoundation.com.br",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 p-4 rounded-lg border border-border hover:bg-accent transition-colors",children:[s.jsx(uz,{className:"w-5 h-5 text-muted-foreground"}),s.jsxs("div",{children:[s.jsx("div",{className:"font-medium text-foreground",children:"Website"}),s.jsx("div",{className:"text-sm text-muted-foreground",children:"Official site"})]})]}),s.jsxs("a",{href:"mailto:suporte@evofoundation.com.br",className:"flex items-center gap-3 p-4 rounded-lg border border-border hover:bg-accent transition-colors",children:[s.jsx(xz,{className:"w-5 h-5 text-muted-foreground"}),s.jsxs("div",{children:[s.jsx("div",{className:"font-medium text-foreground",children:"Contact"}),s.jsx("div",{className:"text-sm text-muted-foreground",children:"Get support"})]})]})]})})]}),s.jsx("div",{className:"text-center mt-12 text-sm text-muted-foreground",children:s.jsx("p",{children:"© 2025 Evolution API. Licensed under Apache 2.0 with Evolution API custom conditions."})})]})})]})}const Doe=LF([{path:"/",element:s.jsx(Aoe,{})},{path:"/manager/login",element:s.jsx(VL,{children:s.jsx(Ooe,{})})},{path:"/manager/license/callback",element:s.jsx(Moe,{})},{path:"/manager/",element:s.jsx(xn,{children:s.jsx(oj,{children:s.jsx(cZ,{})})})},{path:"/manager/settings-templates",element:s.jsx(xn,{feature:"settingsTemplates",children:s.jsx(oj,{children:s.jsx(hZ,{})})})},{path:"/manager/instance/:instanceId/dashboard",element:s.jsx(xn,{children:s.jsx(_n,{children:s.jsx(XX,{})})})},{path:"/manager/instance/:instanceId/chat",element:s.jsx(xn,{feature:"chat",children:s.jsx(_n,{children:s.jsx(Xk,{})})})},{path:"/manager/instance/:instanceId/chat/:remoteJid",element:s.jsx(xn,{feature:"chat",children:s.jsx(_n,{children:s.jsx(Xk,{})})})},{path:"/manager/instance/:instanceId/settings",element:s.jsx(xn,{feature:"settings",children:s.jsx(_n,{children:s.jsx(jae,{})})})},{path:"/manager/instance/:instanceId/openai",element:s.jsx(xn,{feature:"openai",children:s.jsx(_n,{children:s.jsx(IE,{})})})},{path:"/manager/instance/:instanceId/openai/:botId",element:s.jsx(xn,{feature:"openai",children:s.jsx(_n,{children:s.jsx(IE,{})})})},{path:"/manager/instance/:instanceId/webhook",element:s.jsx(xn,{feature:"webhook",children:s.jsx(_n,{children:s.jsx(yoe,{})})})},{path:"/manager/instance/:instanceId/websocket",element:s.jsx(xn,{feature:"websocket",children:s.jsx(_n,{children:s.jsx(koe,{})})})},{path:"/manager/instance/:instanceId/rabbitmq",element:s.jsx(xn,{feature:"rabbitmq",children:s.jsx(_n,{children:s.jsx(mae,{})})})},{path:"/manager/instance/:instanceId/sqs",element:s.jsx(xn,{feature:"sqs",children:s.jsx(_n,{children:s.jsx(Pae,{})})})},{path:"/manager/instance/:instanceId/chatwoot",element:s.jsx(xn,{feature:"chatwoot",children:s.jsx(_n,{children:s.jsx(IX,{})})})},{path:"/manager/instance/:instanceId/typebot",element:s.jsx(xn,{feature:"typebot",children:s.jsx(_n,{children:s.jsx(OE,{})})})},{path:"/manager/instance/:instanceId/typebot/:typebotId",element:s.jsx(xn,{feature:"typebot",children:s.jsx(_n,{children:s.jsx(OE,{})})})},{path:"/manager/instance/:instanceId/dify",element:s.jsx(xn,{feature:"dify",children:s.jsx(_n,{children:s.jsx(EE,{})})})},{path:"/manager/instance/:instanceId/dify/:difyId",element:s.jsx(xn,{feature:"dify",children:s.jsx(_n,{children:s.jsx(EE,{})})})},{path:"/manager/instance/:instanceId/n8n",element:s.jsx(xn,{feature:"n8n",children:s.jsx(_n,{children:s.jsx(RE,{})})})},{path:"/manager/instance/:instanceId/n8n/:n8nId",element:s.jsx(xn,{feature:"n8n",children:s.jsx(_n,{children:s.jsx(RE,{})})})},{path:"/manager/instance/:instanceId/evoai",element:s.jsx(xn,{feature:"evoai",children:s.jsx(_n,{children:s.jsx(ME,{})})})},{path:"/manager/instance/:instanceId/evoai/:evoaiId",element:s.jsx(xn,{feature:"evoai",children:s.jsx(_n,{children:s.jsx(ME,{})})})},{path:"/manager/instance/:instanceId/evolutionBot",element:s.jsx(xn,{feature:"evolutionBot",children:s.jsx(_n,{children:s.jsx(_E,{})})})},{path:"/manager/instance/:instanceId/evolutionBot/:evolutionBotId",element:s.jsx(xn,{feature:"evolutionBot",children:s.jsx(_n,{children:s.jsx(_E,{})})})},{path:"/manager/instance/:instanceId/flowise",element:s.jsx(xn,{feature:"flowise",children:s.jsx(_n,{children:s.jsx(PE,{})})})},{path:"/manager/instance/:instanceId/flowise/:flowiseId",element:s.jsx(xn,{feature:"flowise",children:s.jsx(_n,{children:s.jsx(PE,{})})})},{path:"/manager/instance/:instanceId/proxy",element:s.jsx(xn,{feature:"proxy",children:s.jsx(_n,{children:s.jsx(lae,{})})})},{path:"/manager/embed-chat",element:s.jsx(TE,{})},{path:"/manager/embed-chat/:remoteJid",element:s.jsx(TE,{})}]),Foe={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 wh{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||Foe,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 a=this.observers[r].get(n)||0;this.observers[r].set(n,a+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),a=1;a{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,a)=>{e=r,t=a});return n.resolve=e,n.reject=t,n},DE=e=>e==null?"":""+e,Loe=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},$oe=/###/g,FE=e=>e&&e.indexOf("###")>-1?e.replace($oe,"."):e,LE=e=>!e||typeof e=="string",td=(e,t,n)=>{const r=typeof t!="string"?t:t.split(".");let a=0;for(;a{const{obj:r,k:a}=td(e,t,Object);if(r!==void 0||t.length===1){r[a]=n;return}let o=t[t.length-1],l=t.slice(0,t.length-1),u=td(e,l,Object);for(;u.obj===void 0&&l.length;)o=`${l[l.length-1]}.${o}`,l=l.slice(0,l.length-1),u=td(e,l,Object),u&&u.obj&&typeof u.obj[`${u.k}.${o}`]<"u"&&(u.obj=void 0);u.obj[`${u.k}.${o}`]=n},Boe=(e,t,n,r)=>{const{obj:a,k:o}=td(e,t,Object);a[o]=a[o]||[],a[o].push(n)},Sh=(e,t)=>{const{obj:n,k:r}=td(e,t);if(n)return n[r]},zoe=(e,t,n)=>{const r=Sh(e,n);return r!==void 0?r:Sh(t,n)},PO=(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]):PO(e[r],t[r],n):e[r]=t[r]);return e},Vl=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Uoe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const Voe=e=>typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>Uoe[t]):e;class qoe{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 Hoe=[" ",",","?","!",";"],Woe=new qoe(20),Koe=(e,t,n)=>{t=t||"",n=n||"";const r=Hoe.filter(l=>t.indexOf(l)<0&&n.indexOf(l)<0);if(r.length===0)return!0;const a=Woe.getRegExp(`(${r.map(l=>l==="?"?"\\?":l).join("|")})`);let o=!a.test(e);if(!o){const l=e.indexOf(n);l>0&&!a.test(e.substring(0,l))&&(o=!0)}return o},cb=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 a=e;for(let o=0;o-1&&de&&e.indexOf("_")>0?e.replace("_","-"):e;class BE extends Fm{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 a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,l=a.ignoreJSONStructure!==void 0?a.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=Sh(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:cb(this.data&&this.data[t]&&this.data[t][n],r,o)}addResource(t,n,r,a){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("."),a=n,n=u[1]),this.addNamespaces(n),$E(this.data,u,a),o.silent||this.emit("added",t,n,r,a)}addResources(t,n,r){let a=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});a.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,a,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("."),a=r,r=n,n=u[1]),this.addNamespaces(n);let d=Sh(this.data,u)||{};l.skipCopy||(r=JSON.parse(JSON.stringify(r))),a?PO(d,r,o):d={...d,...r},$E(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(a=>n[a]&&Object.keys(n[a]).length>0)}toJSON(){return this.data}}var RO={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,a){return e.forEach(o=>{this.processors[o]&&(t=this.processors[o].process(t,n,r,a))}),t}};const zE={};class jh extends Fm{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Loe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=xa.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 a=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&&!Koe(t,r,a);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!==a||r===a&&this.options.ns.indexOf(f[0])>-1)&&(o=f.shift()),t=f.join(a)}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 a=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 a?{res:`${d}${_}${l}`,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:d,usedParams:this.getUsedParamsDetails(n)}:`${d}${_}${l}`}return a?{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 b=m&&m.usedKey||l,x=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,N=!this.i18nFormat||this.i18nFormat.handleAsObject;if(N&&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(b,g,{...n,ns:u}):`key '${l} (${this.language})' returned an object instead of string.`;return a?(m.res=_,m.usedParams=this.getUsedParamsDetails(n),m):_}if(o){const _=Array.isArray(g),P=_?[]:{},M=_?x:b;for(const O in g)if(Object.prototype.hasOwnProperty.call(g,O)){const D=`${M}${o}${O}`;P[O]=this.translate(D,{...n,joinArrays:!1,ns:u}),P[O]===D&&(P[O]=g[O])}g=P}}else if(N&&typeof k=="string"&&Array.isArray(g))g=g.join(k),g&&(g=this.extendTranslation(g,t,n,r));else{let _=!1,P=!1;const M=n.count!==void 0&&typeof n.count!="string",O=jh.hasDefaultValue(n),D=M?this.pluralResolver.getSuffix(f,n.count,n):"",F=n.ordinal&&M?this.pluralResolver.getSuffix(f,n.count,{ordinal:!1}):"",B=M&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),te=B&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${D}`]||n[`defaultValue${F}`]||n.defaultValue;!this.isValidLookup(g)&&O&&(_=!0,g=te),this.isValidLookup(g)||(P=!0,g=l);const ce=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&P?void 0:g,q=O&&te!==g&&this.options.updateMissing;if(P||_||q){if(this.logger.log(q?"updateKey":"missingKey",f,d,l,q?te: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 ne=[];const Y=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Y&&Y[0])for(let H=0;H{const A=O&&V!==g?V:ce;this.options.missingKeyHandler?this.options.missingKeyHandler(H,d,W,A,q,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(H,d,W,A,q,n),this.emit("missingKey",H,d,W,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&M?ne.forEach(H=>{const W=this.pluralResolver.getSuffixes(H,n);B&&n[`defaultValue${this.options.pluralSeparator}zero`]&&W.indexOf(`${this.options.pluralSeparator}zero`)<0&&W.push(`${this.options.pluralSeparator}zero`),W.forEach(V=>{se([H],l+V,n[`defaultValue${V}`]||te)})}):se(ne,l,te))}g=this.extendTranslation(g,t,n,m,r),P&&g===l&&this.options.appendNamespaceToMissingKey&&(g=`${d}:${l}`),(P||_)&&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 a?(m.res=g,m.usedParams=this.getUsedParamsDetails(n),m):g}extendTranslation(t,n,r,a,o){var l=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||a.usedLng,a.usedNS,a.usedKey,{resolved:a});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||a.usedLng,r),f){const g=t.match(this.interpolator.nestingRegexp),b=g&&g.length;h1&&arguments[1]!==void 0?arguments[1]:{},r,a,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;a=h;let m=f.namespaces;this.options.fallbackNS&&(m=m.concat(this.options.fallbackNS));const g=n.count!==void 0&&typeof n.count!="string",b=g&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),x=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,!zE[`${w[0]}-${C}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(u)&&(zE[`${w[0]}-${C}`]=!0,this.logger.warn(`key "${a}" 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 N=[h];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(N,h,k,C,n);else{let _;g&&(_=this.pluralResolver.getSuffix(k,n.count,n));const P=`${this.options.pluralSeparator}zero`,M=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(g&&(N.push(h+_),n.ordinal&&_.indexOf(M)===0&&N.push(h+_.replace(M,this.options.pluralSeparator)),b&&N.push(h+P)),x){const O=`${h}${this.options.contextSeparator}${n.context}`;N.push(O),g&&(N.push(O+_),n.ordinal&&_.indexOf(M)===0&&N.push(O+_.replace(M,this.options.pluralSeparator)),b&&N.push(O+P))}}let T;for(;T=N.pop();)this.isValidLookup(r)||(o=T,r=this.getResource(k,C,T,n))}))})}),{res:r,usedKey:a,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 a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,a):this.resourceStore.getResource(t,n,r,a)}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 a=r?t.replace:t;if(r&&typeof t.count<"u"&&(a.count=t.count),this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),!r){a={...a};for(const o of n)delete a[o]}return a}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 Wy=e=>e.charAt(0).toUpperCase()+e.slice(1);class UE{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=xa.create("languageUtils")}getScriptPartFromCode(t){if(t=Ch(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=Ch(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(a=>a.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=Wy(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]=Wy(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=Wy(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 a=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(a))&&(n=a)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const a=this.getLanguagePartFromCode(r);if(this.isSupportedCode(a))return n=a;n=this.options.supportedLngs.find(o=>{if(o===a)return o;if(!(o.indexOf("-")<0&&a.indexOf("-")<0)&&(o.indexOf("-")>0&&a.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===a||o.indexOf(a)===0&&a.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),a=[],o=l=>{l&&(this.isSupportedCode(l)?a.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=>{a.indexOf(l)<0&&o(this.formatLanguageCode(l))}),a}}let Goe=[{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}],Joe={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 Qoe=["v1","v2","v3"],Yoe=["v4"],VE={zero:0,one:1,two:2,few:3,many:4,other:5},Zoe=()=>{const e={};return Goe.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:Joe[t.fc]}})}),e};class Xoe{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=xa.create("pluralResolver"),(!this.options.compatibilityJSON||Yoe.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=Zoe(),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=Ch(t==="dev"?"en":t),a=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:a});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];const l=new Intl.PluralRules(r,{type:a});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(a=>`${n}${a}`)}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((a,o)=>VE[a]-VE[o]).map(a=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${a}`):r.numbers.map(a=>this.getSuffix(t,a,n)):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const a=this.getRule(t,r);return a?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${a.select(n)}`:this.getSuffixRetroCompatible(a,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 a=t.numbers[r];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(a===2?a="plural":a===1&&(a=""));const o=()=>this.options.prepend&&a.toString()?this.options.prepend+a.toString():a.toString();return this.options.compatibilityJSON==="v1"?a===1?"":typeof a=="number"?`_plural_${a.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!Qoe.includes(this.options.compatibilityJSON)}}const qE=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=zoe(e,t,n);return!o&&a&&typeof n=="string"&&(o=cb(e,n,r),o===void 0&&(o=cb(t,n,r))),o},Ky=e=>e.replace(/\$/g,"$$$$");class eie{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=xa.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:a,prefix:o,prefixEscaped:l,suffix:u,suffixEscaped:d,formatSeparator:f,unescapeSuffix:h,unescapePrefix:m,nestingPrefix:g,nestingPrefixEscaped:b,nestingSuffix:x,nestingSuffixEscaped:w,nestingOptionsSeparator:C,maxReplaces:k,alwaysFormat:N}=t.interpolation;this.escape=n!==void 0?n:Voe,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=a!==void 0?a:!1,this.prefix=o?Vl(o):l||"{{",this.suffix=u?Vl(u):d||"}}",this.formatSeparator=f||",",this.unescapePrefix=h?"":m||"-",this.unescapeSuffix=this.unescapePrefix?"":h||"",this.nestingPrefix=g?Vl(g):b||Vl("$t("),this.nestingSuffix=x?Vl(x):w||Vl(")"),this.nestingOptionsSeparator=C||",",this.maxReplaces=k||1e3,this.alwaysFormat=N!==void 0?N:!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,a){let o,l,u;const d=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},f=b=>{if(b.indexOf(this.formatSeparator)<0){const k=qE(n,d,b,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(k,void 0,r,{...a,...n,interpolationkey:b}):k}const x=b.split(this.formatSeparator),w=x.shift().trim(),C=x.join(this.formatSeparator).trim();return this.format(qE(n,d,w,this.options.keySeparator,this.options.ignoreJSONStructure),C,r,{...a,...n,interpolationkey:w})};this.resetRegExp();const h=a&&a.missingInterpolationHandler||this.options.missingInterpolationHandler,m=a&&a.interpolation&&a.interpolation.skipOnVariables!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:b=>Ky(b)},{regex:this.regexp,safeValue:b=>this.escapeValue?Ky(this.escape(b)):Ky(b)}].forEach(b=>{for(u=0;o=b.regex.exec(t);){const x=o[1].trim();if(l=f(x),l===void 0)if(typeof h=="function"){const C=h(t,o,a);l=typeof C=="string"?C:""}else if(a&&Object.prototype.hasOwnProperty.call(a,x))l="";else if(m){l=o[0];continue}else this.logger.warn(`missed to pass in variable ${x} for interpolating ${t}`),l="";else typeof l!="string"&&!this.useRawValueToEscape&&(l=DE(l));const w=b.safeValue(l);if(t=t.replace(o[0],w),m?(b.regex.lastIndex+=l.length,b.regex.lastIndex-=o[0].length):b.regex.lastIndex=0,u++,u>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a,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 b=g.match(/'/g),x=g.match(/"/g);(b&&b.length%2===0&&!x||x.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(;a=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(a[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(a[1])){const h=a[1].split(this.formatSeparator).map(m=>m.trim());a[1]=h.shift(),d=h,f=!0}if(o=n(u.call(this,a[1].trim(),l),l),o&&a[0]===t&&typeof o!="string")return o;typeof o!="string"&&(o=DE(o)),o||(this.logger.warn(`missed to resolve ${a[1]} for nesting ${t}`),o=""),f&&(o=d.reduce((h,m)=>this.format(h,m,r.lng,{...r,interpolationkey:a[1].trim()}),o.trim())),t=t.replace(a[0],o),this.regexp.lastIndex=0}return t}}const tie=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const a=r[1].substring(0,r[1].length-1);t==="currency"&&a.indexOf(":")<0?n.currency||(n.currency=a.trim()):t==="relativetime"&&a.indexOf(":")<0?n.range||(n.range=a.trim()):a.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}},ql=e=>{const t={};return(n,r,a)=>{let o=a;a&&a.interpolationkey&&a.formatParams&&a.formatParams[a.interpolationkey]&&a[a.interpolationkey]&&(o={...o,[a.interpolationkey]:void 0});const l=r+JSON.stringify(o);let u=t[l];return u||(u=e(Ch(r),a),t[l]=u),u(n)}};class nie{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=xa.create("formatter"),this.options=t,this.formats={number:ql((n,r)=>{const a=new Intl.NumberFormat(n,{...r});return o=>a.format(o)}),currency:ql((n,r)=>{const a=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>a.format(o)}),datetime:ql((n,r)=>{const a=new Intl.DateTimeFormat(n,{...r});return o=>a.format(o)}),relativetime:ql((n,r)=>{const a=new Intl.RelativeTimeFormat(n,{...r});return o=>a.format(o,r.range||"day")}),list:ql((n,r)=>{const a=new Intl.ListFormat(n,{...r});return o=>a.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()]=ql(n)}format(t,n,r){let a=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}=tie(d);if(this.formats[f]){let m=u;try{const g=a&&a.formatParams&&a.formatParams[a.interpolationkey]||{},b=g.locale||g.lng||a.locale||a.lng||r;m=this.formats[f](u,b,{...h,...a,...g})}catch(g){this.logger.warn(g)}return m}else this.logger.warn(`there was no format function for ${f}`);return u},t)}}const rie=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class sie extends Fm{constructor(t,n,r){let a=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=a,this.logger=xa.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=a.maxParallelReads||10,this.readingCalls=0,this.maxRetries=a.maxRetries>=0?a.maxRetries:5,this.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,a.backend,a)}queueLoad(t,n,r,a){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:a}),{toLoad:Object.keys(o),pending:Object.keys(l),toLoadLanguages:Object.keys(u),toLoadNamespaces:Object.keys(d)}}loaded(t,n,r){const a=t.split("|"),o=a[0],l=a[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=>{Boe(d.loaded,[o],l),rie(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 a=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:a,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&&a{this.read.call(this,t,n,r,a+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]:{},a=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."),a&&a();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof n=="string"&&(n=[n]);const o=this.queueLoad(t,n,r,a);if(!o.toLoad.length)return o.pending.length||a(),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("|"),a=r[0],o=r[1];this.read(a,o,"read",void 0,void 0,(l,u)=>{l&&this.logger.warn(`${n}loading namespace ${o} for language ${a} failed`,l),!l&&u&&this.logger.log(`${n}loaded namespace ${o} for language ${a}`,u),this.loaded(t,l,u)})}saveMissing(t,n,r,a,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,a,d):h=f(t,n,r,a),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,a,u,d)}!t||!t[0]||this.store.addResource(t[0],n,r,a)}}}const HE=()=>({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}}),WE=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),xp=()=>{},aie=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class vd extends Fm{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=WE(t),this.services={},this.logger=xa,this.modules={external:[]},aie(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 a=HE();this.options={...a,...this.options,...WE(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...a.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?xa.init(o(this.modules.logger),this.options):xa.init(null,this.options);let h;this.modules.formatter?h=this.modules.formatter:typeof Intl<"u"&&(h=nie);const m=new UE(this.options);this.store=new BE(this.options.resources,this.options);const g=this.services;g.logger=xa,g.resourceStore=this.store,g.languageUtils=m,g.pluralResolver=new Xoe(m,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),h&&(!this.options.interpolation.format||this.options.interpolation.format===a.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 eie(this.options),g.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},g.backendConnector=new sie(o(this.modules.backend),g.resourceStore,g,this.options),g.backendConnector.on("*",function(b){for(var x=arguments.length,w=new Array(x>1?x-1:0),C=1;C1?x-1:0),C=1;C{b.init&&b.init(this)})}if(this.format=this.options.interpolation.format,r||(r=xp),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=Uu(),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]:xp;const a=typeof t=="string"?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(a&&a.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)})};a?l(a):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 a=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=xp),this.services.backendConnector.reload(t,n,o=>{a.resolve(),r(o)}),a}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"&&RO.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 a=Uu();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,a.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),a}getFixedT(t,n,r){var a=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}${x}`):b=d.keyPrefix?`${d.keyPrefix}${g}${l}`:l,a.t(b,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],a=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)&&(!a||l(o,t)))}loadNamespaces(t,n){const r=Uu();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(a=>{this.options.ns.indexOf(a)<0&&this.options.ns.push(a)}),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=Uu();typeof t=="string"&&(t=[t]);const a=this.options.preload||[],o=t.filter(l=>a.indexOf(l)<0&&this.services.languageUtils.isSupportedCode(l));return o.length?(this.options.preload=a.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 UE(HE());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 vd(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:xp;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const a={...this.options,...t,isClone:!0},o=new vd(a);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 BE(this.store.data,a),o.services.resourceStore=o.store),o.translator=new jh(o.services,a),o.translator.on("*",function(u){for(var d=arguments.length,f=new Array(d>1?d-1:0),h=1;h60":"More than 60 minutes",">120":"More than 2 hours",">300":"More than 5 hours",">1440":"More than 24 hours",custom:"Custom"},custom:{more:"More than",less:"Less than",valuePlaceholder:"Value",minutes:"Minutes",hours:"Hours",days:"Days"}},mass:{title:"Mass actions",selectAll:"Select all",selected:"{{count}} selected",newStatus:"New status",apply:"Apply to selected",noneSelected:"Select at least one session",success:"Status updated for selected sessions",error:"Failed to update status in bulk"},pagination:{showing:"Showing {{shown}} of {{total}}",perPage:"Per page",showMore:"Load more",showAll:"Show all",showLess:"Show less"},send:{title:"Send message",to:"To",messagePlaceholder:"Type your message",send:"Send",sending:"Sending...",empty:"Type a message before sending",success:"Message sent successfully",error:"Failed to send message"},actions:{sendMessage:"Send message"},empty:"No sessions found"},uie={delete:{title:"Delete Record",message:"You are about to delete the instance {{instanceName}}, Are you sure you want to continue?",messageSingle:"This action cannot be undone",confirm:"Type the instance name to confirm:"}},die={all:"All",open:"Connected",connecting:"Connecting",closed:"Disconnected"},fie={clientName:"Client name",version:"Version"},pie={theme:{label:"Toggle theme",light:"Light",dark:"Dark",system:"System"},language:{label:"Language",english:"English",portuguese:"Portuguese",spanish:"Spanish",french:"French"},logout:{action:"Sign out",title:"Are you sure you want to sign out?",description:"You will be disconnected and redirected to the login screen."}},hie={media:{attach:"Attach file",document:"Document",photosAndVideos:"Photos and Videos",errors:{audioSize:"Audio file size must be less than 16 MB",imageSize:"Image file size must be less than 5 MB",videoSize:"Video file size must be less than 16 MB",documentSize:"Document file size must be less than 100 MB",unsupportedType:"Unsupported file type"},selectedMedia:{imageAlt:"Selected image",file:"File",selectedFile:"Selected file"}},search:"Search conversations...",back:"Back",tabs:{contacts:"Contacts",groups:"Groups"},count_one:"{{count}} conversation",count_other:"{{count}} conversations",empty:{default:"No conversations yet",search:"No conversations found",tryAnother:"Try another term",selectTitle:"Select a conversation",selectDescription:"Choose a contact or group from the list to start"},input:{placeholder:"Type a message...",send:"Send"},date:{today:"Today",yesterday:"Yesterday"}},mie={dashboard:"Dashboard",chat:"Chat",configurations:"Configurations",settings:"Settings",proxy:"Proxy",events:"Events",webhook:"Webhook",websocket:"WebSocket",rabbitmq:"RabbitMQ",sqs:"SQS",integrations:"Integrations",chatwoot:"Chatwoot",typebot:"Typebot",openai:"OpenAI",dify:"Dify",n8n:"n8n",evoai:"EvoAI",evolutionBot:"Evolution Bot",flowise:"Flowise",documentation:"Documentation",postman:"Swagger",discord:"Discord"},gie={instance:{created:"Instance created successfully",deleted:"Instance deleted successfully",error:"An error occurred while creating the instance"}},vie={checking:"Checking license...",required:"License required",redirecting:"Redirecting to license registration...",registerFailed:"Failed to initiate license registration",callback:{title:"Activating license",missingCode:"Authorization code not found in URL",missingCredentials:"Credentials not found. Please log in again.",activating:"Please wait while we activate your license.",successTitle:"License activated!",successDescription:"Redirecting...",errorTitle:"Activation error",retry:"Try again",back:"Back to login",genericError:"Failed to activate license"}},yie={title:"Evolution Manager",description:"Please enter your credentials to continue",form:{serverUrl:"Server URL",apiKey:"API Key Global"},message:{invalidServer:"Invalid server",invalidCredentials:"Invalid credentials"},button:{login:"Login",connecting:"Connecting..."},subtitle:"Enter your credentials to access the system"},xie={modal:{title:"New instance"},form:{name:"Name",integration:{label:"Channel",baileys:"Baileys",whatsapp:"WhatsApp Cloud API",facebook:"Facebook",instagram:"Instagram",evolution:"Evolution"},token:"Token",number:"Number",businessId:"Business ID"},button:{save:"Save",saving:"Saving...",create:"Instance",connecting:"Connecting...",facebook:"Connect with Facebook",instagram:"Connect with Instagram",whatsapp:"Connect with WhatsApp"},dashboard:{button:{qrcode:{label:"Get QR Code",title:"Scan the QR code with your WhatsApp Web"},pairingCode:{label:"Get Pairing Code",title:"Get the pairing code to connect with WhatsApp"},restart:"Restart",disconnect:"Disconnect",sendMessage:"Send message"},alert:"To connect, scan the QR code with your WhatsApp Web",contacts:"Contacts",chats:"Chats",messages:"Messages",subtitle:"Manage your instance"}},bie={title:"Settings",toast:{success:"Settings applied successfully",error:"An error occurred while applying the settings"},form:{rejectCall:{label:"Reject Calls",description:"Reject all incoming calls"},msgCall:{label:"Message Reject Call",description:"Send a message when rejecting a call"},groupsIgnore:{label:"Ignore Groups",description:"Ignore all messages from groups"},alwaysOnline:{label:"Always Online",description:"Keep the whatsapp always online"},readMessages:{label:"Read Messages",description:"Mark all messages as read"},syncFullHistory:{label:"Sync Full History",description:"Sync all complete chat history on scan QR code"},readStatus:{label:"Read Status",description:"Mark all statuses as read"}},button:{save:"Save",saving:"Saving..."}},wie={title:"Proxy",toast:{success:"Proxy applied successfully",error:"An error occurred while applying the proxy"},form:{enabled:{label:"Enabled",description:"Enable or disable the proxy"},protocol:{label:"Protocol"},host:{label:"Host"},port:{label:"Port"},username:{label:"Username"},password:{label:"Password"}},button:{save:"Save",saving:"Saving..."}},Sie={title:"Webhook destinations",description:"Send each WhatsApp event to one or more independent destinations.",toast:{success:"Webhook applied successfully",error:"An error occurred while applying the webhook"},form:{name:{label:"Webhook name"},enabled:{label:"Enabled",description:"Enable or disable the webhook"},url:{label:"URL",n8nTestWarning:"This is an n8n test URL. It receives events only while Listen for test event is active. Copy the Production URL containing /webhook/ before saving this webhook."},byEvents:{label:"Webhook by Events",description:"Send each event to a URL formed by adding the event name to the end of the base URL",n8nWarning:"n8n Webhook nodes match an exact path and do not catch added subpaths. Create an exact n8n webhook path for each event, or turn off Webhook by Events to send every selected event to the URL above. Example delivery URL:"},base64:{label:"Webhook Base64",description:"Send media base64 data in webhook"},events:{label:"Events"}},button:{save:"Save",saving:"Saving...",add:"Add webhook",remove:"Remove webhook"},status:{enabled:"Enabled",disabled:"Disabled",events:"events"}},Cie={title:"Websocket",toast:{success:"Websocket applied successfully",error:"An error occurred while applying the websocket"},form:{enabled:{label:"Enabled",description:"Enable or disable the websocket"},events:{label:"Events"}},button:{save:"Save",saving:"Saving..."}},jie={title:"RabbitMQ",toast:{success:"RabbitMQ applied successfully",error:"An error occurred while applying the rabbitmq"},form:{enabled:{label:"Enabled",description:"Enable or disable the rabbitmq"},events:{label:"Events"}},button:{save:"Save",saving:"Saving..."}},kie={title:"SQS",toast:{success:"SQS applied successfully",error:"An error occurred while applying the sqs"},form:{enabled:{label:"Enabled",description:"Enable or disable the sqs"},events:{label:"Events"}},button:{save:"Save",saving:"Saving..."}},Eie={title:"Chatwoot",toast:{success:"Chatwoot applied successfully",error:"An error occurred while applying the Chatwoot"},form:{enabled:{label:"Enabled",description:"Enable or disable the sqs"},url:{label:"Chatwoot URL"},accountId:{label:"Account ID"},token:{label:"Token"},signMsg:{label:"Sign Messages",description:"Sign message with chatwoot username"},signDelimiter:{label:"Sign Delimiter"},nameInbox:{label:"Name Inbox"},organization:{label:"Organization"},logo:{label:"Logo"},conversationPending:{label:"Conversation Pending",description:"Conversations start as pending"},reopenConversation:{label:"Reopen Conversation",description:"Reopen conversation when receiving message"},importContacts:{label:"Import Contacts",description:"Import contacts from WhatsApp address book by connecting QR Code"},importMessages:{label:"Import Messages",description:"Import messages from WhatsApp by connecting QR Code"},daysLimitImportMessages:{label:"Days Limit Import Messages"},ignoreJids:{label:"Ignore Jids",placeholder:"Add JIDs ex: 1234567890@s.whatsapp.net and press enter"},autoCreate:{label:"Auto Create",description:"Automatically create chatwoot integration on save"}},button:{save:"Save",saving:"Saving..."}},Nie={title:"Typebots",sessions:{label:"Sessions",search:"Search for remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Push Name",sessionId:"Session ID",status:"Status",actions:{title:"Actions",open:"Open",pause:"Pause",close:"Close",delete:"Delete"},none:"Nothing to show"}},defaultSettings:"Default Settings",toast:{defaultSettings:{success:"Default settings applied successfully",error:"An error occurred while applying the default settings"},success:{update:"Typebot updated successfully",create:"Typebot created successfully",delete:"Typebot deleted successfully",status:"Typebot status updated successfully"},error:"An error occurred while creating the Typebot"},table:{none:"Nothing to show"},form:{title:"New Typebot",examples:{keywordFinish:"#FINISH",unknownMessage:"I'm sorry, I didn't understand. Can you try again?"},enabled:{label:"Enabled"},description:{label:"Description"},typebotSettings:{label:"Typebot Settings"},url:{label:"Typebot API URL"},typebot:{label:"Typebot Public Name"},triggerSettings:{label:"Trigger Settings"},triggerType:{label:"Trigger Type",keyword:"Keyword",all:"All",advanced:"Advanced",none:"None"},triggerOperator:{label:"Trigger Operator",contains:"Contains",equals:"Equals",startsWith:"Starts With",endsWith:"Ends With",regex:"Regex"},triggerValue:{label:"Trigger"},triggerConditions:{label:"Conditions"},typebotIdFallback:{label:"Typebot Fallback"},generalSettings:{label:"General Settings"},expire:{label:"Expire in minutes"},keywordFinish:{label:"Keyword Finish"},delayMessage:{label:"Default Delay Message"},unknownMessage:{label:"Unknown Message"},listeningFromMe:{label:"Listening from me",description:"Listen to messages sent by me on the bot"},stopBotFromMe:{label:"Stop bot from me",description:"Pause the bot when I send a message"},keepOpen:{label:"Keep open",description:"Keep the bot open after the conversation ends"},debounceTime:{label:"Debounce Time"},splitMessages:{label:"Split Messages",description:"Split messages into multiple messages"},timePerChar:{label:"Time per character"},ignoreJids:{label:"Ignore Jids",placeholder:"Add JIDs ex: 1234567890@s.whatsapp.net and press enter"}},button:{create:"Typebot",save:"Save",saving:"Saving...",update:"Update",defaultSettings:"Default Settings",delete:"Delete"},modal:{defaultSettings:{title:"Default Settings"}}},Tie={title:"OpenAI",sessions:{label:"Sessions",search:"Search for remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Push Name",sessionId:"Session ID",status:"Status",actions:{title:"Actions",open:"Open",pause:"Pause",close:"Close",delete:"Delete"},none:"Nothing to show"}},credentials:{title:"Credentials",table:{name:"Name",apiKey:"API Key",actions:{title:"Actions",delete:"Delete"},none:"Nothing to show"}},defaultSettings:"Default Settings",toast:{defaultSettings:{success:"Default settings applied successfully",error:"An error occurred while applying the default settings"},success:{update:"OpenAI updated successfully",create:"OpenAI created successfully",delete:"OpenAI deleted successfully",status:"OpenAI status updated successfully",credentialsCreate:"OpenAI credentials created successfully",credentialsDelete:"OpenAI credentials deleted successfully"},error:"An error occurred while creating the OpenAI"},table:{none:"Nothing to show"},form:{title:"New OpenAI",examples:{keywordFinish:"#FINISH",unknownMessage:"I'm sorry, I didn't understand. Can you try again?"},openaiCredsId:{label:"OpenAI Credentials"},enabled:{label:"Enabled"},description:{label:"Description"},openaiSettings:{label:"OpenAI Settings"},botType:{label:"Bot Type",assistant:"Assistant",chatCompletion:"Chat Completion"},assistantId:{label:"Assistant ID"},functionUrl:{label:"Function URL"},model:{label:"Language Model"},systemMessages:{label:"System Messages",description:"Send system messages to OpenAI"},assistantMessages:{label:"Assistant Messages",description:"Send assistant messages to OpenAI"},userMessages:{label:"User Messages",description:"Send user messages to OpenAI"},maxTokens:{label:"Max Tokens"},triggerSettings:{label:"Trigger Settings"},triggerType:{label:"Trigger Type",keyword:"Keyword",all:"All",advanced:"Advanced",none:"None"},triggerOperator:{label:"Trigger Operator",contains:"Contains",equals:"Equals",startsWith:"Starts With",endsWith:"Ends With",regex:"Regex"},triggerValue:{label:"Trigger"},triggerConditions:{label:"Conditions"},openaiIdFallback:{label:"OpenAI Fallback"},generalSettings:{label:"General Settings"},expire:{label:"Expire in minutes"},keywordFinish:{label:"Keyword Finish"},delayMessage:{label:"Default Delay Message"},unknownMessage:{label:"Unknown Message"},listeningFromMe:{label:"Listening from me",description:"Listen to messages sent by me on the bot"},stopBotFromMe:{label:"Stop bot from me",description:"Pause the bot when I send a message"},keepOpen:{label:"Keep open",description:"Keep the bot open after the conversation ends"},speechToText:{label:"Speech to Text",description:"Convert voice messages to text"},debounceTime:{label:"Debounce Time"},splitMessages:{label:"Split Messages",description:"Split messages into multiple messages"},timePerChar:{label:"Time per character"},ignoreJids:{label:"Ignore Jids",placeholder:"Add JIDs ex: 1234567890@s.whatsapp.net and press enter"}},button:{create:"OpenAI",save:"Save",saving:"Saving...",update:"Update",defaultSettings:"Default Settings",delete:"Delete",loadModels:"Load Models",loading:"Loading..."},modal:{defaultSettings:{title:"Default Settings"}}},Mie={title:"Dify",sessions:{label:"Sessions",search:"Search for remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Push Name",sessionId:"Session ID",status:"Status",actions:{title:"Actions",open:"Open",pause:"Pause",close:"Close",delete:"Delete"},none:"Nothing to show"}},defaultSettings:"Default Settings",toast:{defaultSettings:{success:"Default settings applied successfully",error:"An error occurred while applying the default settings"},success:{update:"Dify updated successfully",create:"Dify created successfully",delete:"Dify deleted successfully",status:"Dify status updated successfully"},error:"An error occurred while creating the Dify"},table:{none:"Nothing to show"},form:{title:"New Dify",examples:{keywordFinish:"#FINISH",unknownMessage:"I'm sorry, I didn't understand. Can you try again?"},enabled:{label:"Enabled"},description:{label:"Description"},difySettings:{label:"Dify Settings"},botType:{label:"Bot Type",chatBot:"Chat Bot",textGenerator:"Text Generator",agent:"Agent",workflow:"Workflow"},apiUrl:{label:"API URL"},apiKey:{label:"API Key"},triggerSettings:{label:"Trigger Settings"},triggerType:{label:"Trigger Type",keyword:"Keyword",all:"All",advanced:"Advanced",none:"None"},triggerOperator:{label:"Trigger Operator",contains:"Contains",equals:"Equals",startsWith:"Starts With",endsWith:"Ends With",regex:"Regex"},triggerValue:{label:"Trigger"},triggerConditions:{label:"Conditions"},difyIdFallback:{label:"Dify Fallback"},generalSettings:{label:"General Settings"},expire:{label:"Expire in minutes"},keywordFinish:{label:"Keyword Finish"},delayMessage:{label:"Default Delay Message"},unknownMessage:{label:"Unknown Message"},listeningFromMe:{label:"Listening from me",description:"Listen to messages sent by me on the bot"},stopBotFromMe:{label:"Stop bot from me",description:"Pause the bot when I send a message"},keepOpen:{label:"Keep open",description:"Keep the bot open after the conversation ends"},debounceTime:{label:"Debounce Time"},splitMessages:{label:"Split Messages",description:"Split messages into multiple messages"},timePerChar:{label:"Time per character"},ignoreJids:{label:"Ignore Jids",placeholder:"Add JIDs ex: 1234567890@s.whatsapp.net and press enter"}},button:{create:"Dify",save:"Save",saving:"Saving...",update:"Update",defaultSettings:"Default Settings",delete:"Delete"},modal:{defaultSettings:{title:"Default Settings"}}},_ie={title:"n8n",sessions:{label:"Sessions",search:"Search for remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Push Name",sessionId:"Session ID",status:"Status",actions:{title:"Actions",open:"Open",pause:"Pause",close:"Close",delete:"Delete"},none:"Nothing to show"}},defaultSettings:"Default Settings",toast:{defaultSettings:{success:"Default settings applied successfully",error:"An error occurred while applying the default settings"},success:{update:"n8n updated successfully",create:"n8n created successfully",delete:"n8n deleted successfully",status:"n8n status updated successfully"},error:"An error occurred while creating the n8n chatbot"},table:{none:"Nothing to show"},form:{title:"New n8n chatbot",examples:{keywordFinish:"#FINISH",unknownMessage:"I'm sorry, I didn't understand. Can you try again?"},enabled:{label:"Enabled"},description:{label:"Description"},n8nSettings:{label:"n8n Settings"},webhookUrl:{label:"Webhook URL"},basicAuth:{label:"Basic Auth (Optional)"},basicAuthUser:{label:"Basic Auth User"},basicAuthPass:{label:"Basic Auth Password"},triggerSettings:{label:"Trigger Settings"},triggerType:{label:"Trigger Type",keyword:"Keyword",all:"All",advanced:"Advanced",none:"None"},triggerOperator:{label:"Trigger Operator",contains:"Contains",equals:"Equals",startsWith:"Starts With",endsWith:"Ends With",regex:"Regex"},triggerValue:{label:"Trigger"},triggerConditions:{label:"Conditions"},n8nIdFallback:{label:"n8n Fallback"},generalSettings:{label:"General Settings"},expire:{label:"Expire in minutes"},keywordFinish:{label:"Keyword Finish"},delayMessage:{label:"Default Delay Message"},unknownMessage:{label:"Unknown Message"},listeningFromMe:{label:"Listening from me",description:"Listen to messages sent by me on the bot"},stopBotFromMe:{label:"Stop bot from me",description:"Pause the bot when I send a message"},keepOpen:{label:"Keep open",description:"Keep the bot open after the conversation ends"},debounceTime:{label:"Debounce Time"},splitMessages:{label:"Split Messages",description:"Split messages into multiple messages"},timePerChar:{label:"Time per character"},ignoreJids:{label:"Ignore Jids",placeholder:"Add JIDs ex: 1234567890@s.whatsapp.net and press enter"}},button:{create:"n8n",save:"Save",saving:"Saving...",update:"Update",defaultSettings:"Default Settings",delete:"Delete"},modal:{defaultSettings:{title:"Default Settings"}}},Pie={title:"EvoAI",sessions:{label:"Sessions",search:"Search for remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Push Name",sessionId:"Session ID",status:"Status",actions:{title:"Actions",open:"Open",pause:"Pause",close:"Close",delete:"Delete"},none:"Nothing to show"}},defaultSettings:"Default Settings",toast:{defaultSettings:{success:"Default settings applied successfully",error:"An error occurred while applying the default settings"},success:{update:"EvoAI updated successfully",create:"EvoAI created successfully",delete:"EvoAI deleted successfully",status:"EvoAI status updated successfully"},error:"An error occurred while creating the EvoAI chatbot"},table:{none:"Nothing to show"},form:{title:"New EvoAI chatbot",examples:{keywordFinish:"#FINISH",unknownMessage:"I'm sorry, I didn't understand. Can you try again?"},enabled:{label:"Enabled"},description:{label:"Description"},evoaiSettings:{label:"EvoAI Settings"},agentUrl:{label:"Agent URL"},apiKey:{label:"API Key (Optional)"},triggerSettings:{label:"Trigger Settings"},triggerType:{label:"Trigger Type",keyword:"Keyword",all:"All",advanced:"Advanced",none:"None"},triggerOperator:{label:"Trigger Operator",contains:"Contains",equals:"Equals",startsWith:"Starts With",endsWith:"Ends With",regex:"Regex"},triggerValue:{label:"Trigger"},triggerConditions:{label:"Conditions"},evoaiIdFallback:{label:"EvoAI Fallback"},generalSettings:{label:"General Settings"},expire:{label:"Expire in minutes"},keywordFinish:{label:"Keyword Finish"},delayMessage:{label:"Default Delay Message"},unknownMessage:{label:"Unknown Message"},listeningFromMe:{label:"Listening from me",description:"Listen to messages sent by me on the bot"},stopBotFromMe:{label:"Stop bot from me",description:"Pause the bot when I send a message"},keepOpen:{label:"Keep open",description:"Keep the bot open after the conversation ends"},debounceTime:{label:"Debounce Time"},splitMessages:{label:"Split Messages",description:"Split messages into multiple messages"},timePerChar:{label:"Time per character"},ignoreJids:{label:"Ignore Jids",placeholder:"Add JIDs ex: 1234567890@s.whatsapp.net and press enter"}},button:{create:"EvoAI",save:"Save",saving:"Saving...",update:"Update",defaultSettings:"Default Settings",delete:"Delete"},modal:{defaultSettings:{title:"Default Settings"}}},Rie={title:"Evolution Bot",sessions:{label:"Sessions",search:"Search for remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Push Name",sessionId:"Session ID",status:"Status",actions:{title:"Actions",open:"Open",pause:"Pause",close:"Close",delete:"Delete"},none:"Nothing to show"}},defaultSettings:"Default Settings",toast:{defaultSettings:{success:"Default settings applied successfully",error:"An error occurred while applying the default settings"},success:{update:"Evolution Bot updated successfully",create:"Evolution Bot created successfully",delete:"Evolution Bot deleted successfully",status:"Evolution Bot status updated successfully"},error:"An error occurred while creating the Evolution Bot"},table:{none:"Nothing to show"},form:{title:"New Evolution Bot",examples:{keywordFinish:"#FINISH",unknownMessage:"I'm sorry, I didn't understand. Can you try again?"},enabled:{label:"Enabled"},description:{label:"Description"},evolutionBotSettings:{label:"Evolution Bot Settings"},apiUrl:{label:"API URL"},apiKey:{label:"API Key"},triggerSettings:{label:"Trigger Settings"},triggerType:{label:"Trigger Type",keyword:"Keyword",all:"All",advanced:"Advanced",none:"None"},triggerOperator:{label:"Trigger Operator",contains:"Contains",equals:"Equals",startsWith:"Starts With",endsWith:"Ends With",regex:"Regex"},triggerValue:{label:"Trigger"},triggerConditions:{label:"Conditions"},botIdFallback:{label:"Evolution Bot Fallback"},generalSettings:{label:"General Settings"},expire:{label:"Expire in minutes"},keywordFinish:{label:"Keyword Finish"},delayMessage:{label:"Default Delay Message"},unknownMessage:{label:"Unknown Message"},listeningFromMe:{label:"Listening from me",description:"Listen to messages sent by me on the bot"},stopBotFromMe:{label:"Stop bot from me",description:"Pause the bot when I send a message"},keepOpen:{label:"Keep open",description:"Keep the bot open after the conversation ends"},debounceTime:{label:"Debounce Time"},splitMessages:{label:"Split Messages",description:"Split messages into multiple messages"},timePerChar:{label:"Time per character"},ignoreJids:{label:"Ignore Jids",placeholder:"Add JIDs ex: 1234567890@s.whatsapp.net and press enter"}},button:{create:"Evolution Bot",save:"Save",saving:"Saving...",update:"Update",defaultSettings:"Default Settings",delete:"Delete"},modal:{defaultSettings:{title:"Default Settings"}}},Iie={title:"Flowise",sessions:{label:"Sessions",search:"Search for remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Push Name",sessionId:"Session ID",status:"Status",actions:{title:"Actions",open:"Open",pause:"Pause",close:"Close",delete:"Delete"},none:"Nothing to show"}},defaultSettings:"Default Settings",toast:{defaultSettings:{success:"Default settings applied successfully",error:"An error occurred while applying the default settings"},success:{update:"Flowise updated successfully",create:"Flowise created successfully",delete:"Flowise deleted successfully",status:"Flowise status updated successfully"},error:"An error occurred while creating the Flowise"},table:{none:"Nothing to show"},form:{title:"New Flowise",examples:{keywordFinish:"#FINISH",unknownMessage:"I'm sorry, I didn't understand. Can you try again?"},enabled:{label:"Enabled"},description:{label:"Description"},flowiseSettings:{label:"Flowise Settings"},apiUrl:{label:"API URL"},apiKey:{label:"API Key"},triggerSettings:{label:"Trigger Settings"},triggerType:{label:"Trigger Type",keyword:"Keyword",all:"All",advanced:"Advanced",none:"None"},triggerOperator:{label:"Trigger Operator",contains:"Contains",equals:"Equals",startsWith:"Starts With",endsWith:"Ends With",regex:"Regex"},triggerValue:{label:"Trigger"},triggerConditions:{label:"Conditions"},flowiseIdFallback:{label:"Flowise Fallback"},generalSettings:{label:"General Settings"},expire:{label:"Expire in minutes"},keywordFinish:{label:"Keyword Finish"},delayMessage:{label:"Default Delay Message"},unknownMessage:{label:"Unknown Message"},listeningFromMe:{label:"Listening from me",description:"Listen to messages sent by me on the bot"},stopBotFromMe:{label:"Stop bot from me",description:"Pause the bot when I send a message"},keepOpen:{label:"Keep open",description:"Keep the bot open after the conversation ends"},debounceTime:{label:"Debounce Time"},splitMessages:{label:"Split Messages",description:"Split messages into multiple messages"},timePerChar:{label:"Time per character"},ignoreJids:{label:"Ignore Jids",placeholder:"Add JIDs ex: 1234567890@s.whatsapp.net and press enter"}},button:{create:"Flowise",save:"Save",saving:"Saving...",update:"Update",defaultSettings:"Default Settings",delete:"Delete"},modal:{defaultSettings:{title:"Default Settings"}}},Oie={search:"Search..."},Aie={title:"Send Message",description:"Send a text message from the instance",validation:{numberRequired:"Number is required",messageRequired:"Message is required"},form:{number:{label:"Number (with country code)"},message:{label:"Message",placeholder:"Type your message..."}},button:{send:"Send",sending:"Sending..."},toast:{success:"Message sent successfully",error:"Error sending message",noToken:"Instance token not available"}},Die={title:"Connect via QR Code",description:"Scan the QR Code to connect the instance",generating:"Generating QR Code...",waiting:"Waiting for QR Code...",connected:{title:"Instance connected",description:"The {{instanceName}} instance is already connected",connectedAs:"Connected as"},pairingCode:{title:"Connect with pairing code",label:"Pairing code",generate:"Generate code",generating:"Generating...",hint:"Enter the number with country code (e.g. 5511999999999) to receive a pairing code"},howTo:{title:"How to connect:",step1:"Open WhatsApp on your phone",step2:"Tap Menu or Settings",step3:"Select Linked devices",step4:"Tap Link a device",step5:"Point your camera at the QR Code"},button:{refresh:"Refresh QR Code",refreshing:"Refreshing...",close:"Close"},toast:{pairingSuccess:"Pairing code generated",pairingError:"Error generating pairing code",refreshSuccess:"QR Code refreshed",refreshError:"Error refreshing QR Code"}},Fie={title:"New Instance",description:"Create a new instance to connect to WhatsApp",validation:{nameMin:"Name must be at least 3 characters",nameMax:"Name must be at most 50 characters",nameFormat:"Name can only contain letters, numbers, hyphens and underscores"},form:{name:{label:"Instance Name",placeholder:"my-instance",hint:"Use letters, numbers, hyphen (-) or underscore (_)"},token:{label:"Token (optional)",placeholder:"Leave blank to generate automatically",hint:"If not provided, a UUID will be generated automatically"}},proxy:{title:"Configure Proxy (optional)",host:{label:"Host",placeholder:"proxy.example.com"},port:{label:"Port"},username:{label:"Username",placeholder:"user"},password:{label:"Password",placeholder:"••••••••"}},button:{create:"Create Instance",creating:"Creating..."}},Lie={loading:"Loading...",noResults:"No results found!"},$ie={dashboard:oie,button:iie,testInteractive:lie,sessions:cie,modal:uie,status:die,footer:fie,header:pie,chat:hie,sidebar:mie,toast:gie,license:vie,login:yie,instance:xie,settings:bie,proxy:wie,webhook:Sie,websocket:Cie,rabbitmq:jie,sqs:kie,chatwoot:Eie,typebot:Nie,openai:Tie,dify:Mie,n8n:_ie,evoai:Pie,evolutionBot:Rie,flowise:Iie,common:Oie,sendMessage:Aie,qrCode:Die,newInstance:Fie,table:Lie},Bie={title:"Instancias",search:"Buscar",status:"Estado",settings:"Configuraciones",instancesNotFound:"No se encontraron instancias",subtitle:"Administre sus instancias de WhatsApp",card:{phone:"Número"},empty:{title:"No se encontraron instancias",description:"Cree su primera instancia para comenzar"}},zie={delete:"Eliminar",deleting:"Eliminando...",cancel:"Cancelar",markAll:"Marcar Todos",unMarkAll:"Desmarcar Todos",refresh:"Actualizar"},Uie={title:"Probar mensajes interactivos",subtitle:"Instancia: {{instance}} ·",number:"Número de destino",numberHint:"Con código de país/área, solo dígitos (ej.: 5511999999999)",payload:"Payload JSON (editable)",send:"Enviar",sending:"Enviando...",requiresOpen:"Disponible solo con la instancia conectada",tabs:{reply:"Reply",cta:"CTA",pix:"PIX",list:"Lista",carousel:"Carrusel"},success:"Mensaje enviado (id {{id}})",errors:{missingNumber:"Indica el número de destino",invalidJson:"JSON inválido: {{message}}",unknown:"Error al enviar el mensaje"}},Vie={filters:{title:"Filtros avanzados",name:"Filtrar por nombre",namePlaceholder:"Filtrar por nombre",number:"Filtrar por número",numberPlaceholder:"Filtrar por número",status:"Filtrar por estado",time:"Filtrar por tiempo",apply:"Aplicar filtros",clear:"Limpiar",statusOptions:{all:"Todos los estados",opened:"Abierta",paused:"Pausada",closed:"Cerrada"},timeOptions:{5:"Últimos 5 minutos",10:"Últimos 10 minutos",15:"Últimos 15 minutos",20:"Últimos 20 minutos",30:"Últimos 30 minutos",60:"Últimos 60 minutos",all:"Cualquier momento",">60":"Más de 60 minutos",">120":"Más de 2 horas",">300":"Más de 5 horas",">1440":"Más de 24 horas",custom:"Personalizado"},custom:{more:"Más que",less:"Menos que",valuePlaceholder:"Valor",minutes:"Minutos",hours:"Horas",days:"Días"}},mass:{title:"Acciones masivas",selectAll:"Seleccionar todos",selected:"{{count}} seleccionada(s)",newStatus:"Nuevo estado",apply:"Aplicar a seleccionadas",noneSelected:"Selecciona al menos una sesión",success:"Estado actualizado en las sesiones seleccionadas",error:"Error al actualizar el estado en masa"},pagination:{showing:"Mostrando {{shown}} de {{total}}",perPage:"Por página",showMore:"Cargar más",showAll:"Mostrar todas",showLess:"Mostrar menos"},send:{title:"Enviar mensaje",to:"Para",messagePlaceholder:"Escribe tu mensaje",send:"Enviar",sending:"Enviando...",empty:"Escribe un mensaje antes de enviar",success:"Mensaje enviado correctamente",error:"Error al enviar el mensaje"},actions:{sendMessage:"Enviar mensaje"},empty:"No se encontraron sesiones"},qie={delete:{title:"Eliminar Registro",message:"Estás eliminando la instancia {{instanceName}}. ¿Estás seguro de que deseas continuar?",messageSingle:"Esta acción no se puede deshacer.",confirm:"Escriba el nombre de la instancia para confirmar:"}},Hie={all:"Todos",open:"Conectado",connecting:"Conectando",closed:"Desconectado"},Wie={clientName:"Nombre del Cliente",version:"Versión"},Kie={theme:{label:"Cambiar Tema",light:"Claro",dark:"Oscuro",system:"Sistema"},language:{label:"Idioma",english:"Inglés",portuguese:"Portugués",spanish:"Español",french:"Francés"},logout:{action:"Salir",title:"¿Seguro que desea salir?",description:"Será desconectado y redirigido a la pantalla de inicio de sesión."}},Gie={dashboard:"Visión General",configurations:"Configuraciones",settings:"Comportamiento",proxy:"Proxy",events:"Eventos",webhook:"Webhook",websocket:"WebSocket",rabbitmq:"RabbitMQ",sqs:"SQS",integrations:"Integraciones",chatwoot:"Chatwoot",typebot:"Typebot",openai:"OpenAI",dify:"Dify",evoai:"EvoAI",n8n:"n8n",evolutionBot:"Bot Evolution",flowise:"Flowise",documentation:"Documentación",postman:"Postman",discord:"Discord"},Jie={instance:{created:"Instancia creada con éxito",deleted:"Instancia eliminada con éxito",error:"Ocurrió un error al crear la instancia"}},Qie={checking:"Verificando licencia...",required:"Licencia requerida",redirecting:"Redirigiendo al registro de licencia...",registerFailed:"Error al iniciar el registro de licencia",callback:{title:"Activando licencia",missingCode:"Código de autorización no encontrado en la URL",missingCredentials:"Credenciales no encontradas. Inicia sesión nuevamente.",activating:"Espera mientras activamos tu licencia.",successTitle:"¡Licencia activada!",successDescription:"Redirigiendo...",errorTitle:"Error en la activación",retry:"Intentar de nuevo",back:"Volver al inicio de sesión",genericError:"Error al activar la licencia"}},Yie={title:"Evolution Manager",description:"Por favor, inicia sesión para continuar",form:{serverUrl:"URL del Servidor",apiKey:"Clave API Global"},message:{invalidServer:"Servidor inválido",invalidCredentials:"Credenciales inválidas"},button:{login:"Conectar",connecting:"Conectando..."},subtitle:"Ingrese sus credenciales para acceder al sistema"},Zie={modal:{title:"Nueva Instancia"},form:{name:"Nombre",integration:{label:"Canal",baileys:"Baileys",whatsapp:"WhatsApp Cloud API",facebook:"Facebook",instagram:"Instagram",evolution:"Evolution"},token:"Token",number:"Número",businessId:"Business ID"},button:{save:"Guardar",saving:"Guardando...",create:"Instancia",connecting:"Conectando...",facebook:"Conectar con Facebook",instagram:"Conectar con Instagram",whatsapp:"Conectar con WhatsApp"},dashboard:{button:{qrcode:{label:"Generar Código QR",title:"Escanea el Código QR con WhatsApp"},pairingCode:{label:"Generar Código de Emparejamiento",title:"Emparejar con WhatsApp"},restart:"Reiniciar",disconnect:"Desconectar",sendMessage:"Enviar mensaje"},alert:"Para conectar, escanea el Código QR con WhatsApp",contacts:"Contactos",chats:"Chats",messages:"Mensajes",subtitle:"Administre su instancia"}},Xie={title:"Comportamiento",toast:{success:"Comportamiento aplicado con éxito",error:"Ocurrió un error al aplicar el comportamiento"},form:{rejectCall:{label:"Rechazar Llamadas",description:"Rechazar todas las llamadas"},msgCall:{label:"Mensaje de Rechazo de Llamada",description:"Enviar mensaje de rechazo de llamada"},groupsIgnore:{label:"Ignorar Grupos",description:"Ignorar todos los mensajes de grupos"},alwaysOnline:{label:"Siempre Online",description:"Permanecer siempre en línea"},readMessages:{label:"Ver Mensajes",description:"Marcar todos los mensajes como leídos"},syncFullHistory:{label:"Sincronizar Historial Completo",description:"Sincronizar todo el historial al leer el Código QR"},readStatus:{label:"Ver Estado",description:"Marcar todos los estados como vistos"}},button:{save:"Guardar",saving:"Guardando..."}},ele={title:"Proxy",toast:{success:"Proxy aplicado con éxito",error:"Ocurrió un error al aplicar el proxy"},form:{enabled:{label:"Activo",description:"Activar o desactivar el proxy"},protocol:{label:"Protocolo"},host:{label:"Host"},port:{label:"Puerto"},username:{label:"Usuario"},password:{label:"Contraseña"}},button:{save:"Guardar",saving:"Guardando..."}},tle={title:"Webhook",toast:{success:"Webhook aplicado con éxito",error:"Ocurrió un error al aplicar el webhook"},form:{enabled:{label:"Activo",description:"Activar o desactivar el webhook"},url:{label:"URL"},byEvents:{label:"Webhook por Eventos",description:"Crear una ruta para cada evento agregando el nombre del evento al final de la URL"},base64:{label:"Webhook Base64",description:"Enviar datos de medios en base64 en el webhook"},events:{label:"Eventos"}},button:{save:"Guardar",saving:"Guardando..."}},nle={title:"WebSocket",toast:{success:"WebSocket aplicado con éxito",error:"Ocurrió un error al aplicar el WebSocket"},form:{enabled:{label:"Activo",description:"Activar o desactivar el WebSocket"},events:{label:"Eventos"}},button:{save:"Guardar",saving:"Guardando..."}},rle={title:"RabbitMQ",toast:{success:"RabbitMQ aplicado con éxito",error:"Ocurrió un error al aplicar el RabbitMQ"},form:{enabled:{label:"Activo",description:"Activar o desactivar el RabbitMQ"},events:{label:"Eventos"}},button:{save:"Guardar",saving:"Guardando..."}},sle={title:"SQS",toast:{success:"SQS aplicado con éxito",error:"Ocurrió un error al aplicar el SQS"},form:{enabled:{label:"Activo",description:"Activar o desactivar el SQS"},events:{label:"Eventos"}},button:{save:"Guardar",saving:"Guardando..."}},ale={title:"Chatwoot",toast:{success:"Chatwoot aplicado con éxito",error:"Ocurrió un error al aplicar el Chatwoot"},form:{enabled:{label:"Activo",description:"Activar o desactivar el Chatwoot"},url:{label:"URL de Chatwoot"},accountId:{label:"ID de la Cuenta"},token:{label:"Token"},signMsg:{label:"Firmar Mensajes",description:"Firmar mensajes con el nombre de usuario de Chatwoot"},signDelimiter:{label:"Delimitador de Firma"},nameInbox:{label:"Nombre de la Bandeja de Entrada"},organization:{label:"Organización"},logo:{label:"Logo"},conversationPending:{label:"Conversación Pendiente",description:"Las conversaciones comienzan como pendientes"},reopenConversation:{label:"Reabrir Conversación",description:"Reabrir la conversación al recibir un mensaje"},importContacts:{label:"Importar Contactos",description:"Importar contactos del libro de direcciones de WhatsApp al conectar el Código QR"},importMessages:{label:"Importar Mensajes",description:"Importar mensajes de WhatsApp al conectar el Código QR"},daysLimitImportMessages:{label:"Límite de Días para Importación de Mensajes"},ignoreJids:{label:"Ignorar JIDs",placeholder:"Agregar JIDs ej: 1234567890@s.whatsapp.net y presiona enter"},autoCreate:{label:"Creación Automática",description:"Crear automáticamente la integración con Chatwoot al guardar"}},button:{save:"Guardar",saving:"Guardando..."}},ole={title:"Typebots",sessions:{label:"Sesiones",search:"Buscar por remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Nombre Visible",sessionId:"ID de Sesión",status:"Estado",actions:{title:"Acciones",open:"Abrir",pause:"Pausar",close:"Cerrar",delete:"Eliminar"},none:"Nada que mostrar"}},defaultSettings:"Configuraciones Predeterminadas",toast:{defaultSettings:{success:"Configuraciones predeterminadas aplicadas con éxito",error:"Ocurrió un error al aplicar las configuraciones predeterminadas"},success:{update:"Typebot actualizado con éxito",create:"Typebot creado con éxito",delete:"Typebot eliminado con éxito",status:"Estado de Typebot actualizado con éxito"},error:"Ocurrió un error al crear el Typebot"},table:{none:"Nada que mostrar"},form:{title:"Nuevo Typebot",examples:{keywordFinish:"#FINISH",unknownMessage:"Lo siento, no entendí. ¿Puedes intentar de nuevo?"},enabled:{label:"Activo"},description:{label:"Descripción"},typebotSettings:{label:"Configuraciones de Typebot"},url:{label:"URL de la API de Typebot"},typebot:{label:"Nombre Público de Typebot"},triggerSettings:{label:"Configuraciones de Disparador"},triggerType:{label:"Tipo de Disparador",keyword:"Palabra clave",all:"Todos",advanced:"Avanzado",none:"Ninguno"},triggerOperator:{label:"Operador de Disparador",contains:"Contiene",equals:"Igual",startsWith:"Comienza Con",endsWith:"Termina Con",regex:"Regex"},triggerValue:{label:"Disparador"},triggerConditions:{label:"Condiciones"},typebotIdFallback:{label:"Fallback de Typebot"},generalSettings:{label:"Configuraciones Generales"},expire:{label:"Expirar en minutos"},keywordFinish:{label:"Palabra clave de Finalización"},delayMessage:{label:"Mensaje de Retraso Predeterminado"},unknownMessage:{label:"Mensaje Desconocido"},listeningFromMe:{label:"Escuchando de mí",description:"Escuchar los mensajes enviados por mí en el bot"},stopBotFromMe:{label:"Detener bot por mí",description:"Pausar el bot cuando yo envíe un mensaje"},keepOpen:{label:"Mantener abierto",description:"Mantener el bot abierto después de que termine la conversación"},debounceTime:{label:"Tiempo de Debounce"},splitMessages:{label:"Dividir Mensajes",description:"Dividir mensajes largos en múltiples mensajes"},timePerChar:{label:"Tiempo por Carácter"},ignoreJids:{label:"Ignorar JIDs",placeholder:"Agregar JIDs ej: 1234567890@s.whatsapp.net y presiona enter"}},button:{create:"Typebot",save:"Guardar",saving:"Guardando...",update:"Actualizar",defaultSettings:"Configuraciones Predeterminadas",delete:"Eliminar"},modal:{defaultSettings:{title:"Configuraciones Predeterminadas"}}},ile={title:"OpenAI",sessions:{label:"Sesiones",search:"Buscar por remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Nombre Visible",sessionId:"ID de Sesión",status:"Estado",actions:{title:"Acciones",open:"Abrir",pause:"Pausar",close:"Cerrar",delete:"Eliminar"},none:"Nada que mostrar"}},credentials:{title:"Credenciales",table:{name:"Nombre",apiKey:"Clave API",actions:{title:"Acciones",delete:"Eliminar"},none:"Nada que mostrar"}},defaultSettings:"Configuraciones Predeterminadas",toast:{defaultSettings:{success:"Configuraciones predeterminadas aplicadas con éxito",error:"Ocurrió un error al aplicar las configuraciones predeterminadas"},success:{update:"OpenAI actualizado con éxito",create:"OpenAI creado con éxito",delete:"OpenAI eliminado con éxito",status:"Estado de OpenAI actualizado con éxito",credentialsCreate:"Credenciales de OpenAI creadas con éxito",credentialsDelete:"Credenciales de OpenAI eliminadas con éxito"},error:"Ocurrió un error al crear el OpenAI"},table:{none:"Nada que mostrar"},form:{title:"Nuevo OpenAI",examples:{keywordFinish:"#FINISH",unknownMessage:"Lo siento, no entendí. ¿Puedes intentar de nuevo?"},openaiCredsId:{label:"Credenciales de OpenAI"},enabled:{label:"Activo"},description:{label:"Descripción"},openaiSettings:{label:"Configuraciones de OpenAI"},botType:{label:"Tipo de Bot",assistant:"Asistente",chatCompletion:"Chat Completion"},assistantId:{label:"ID del Asistente"},functionUrl:{label:"URL de la Función"},model:{label:"Modelo de Lenguaje"},systemMessages:{label:"Mensajes del Sistema",description:"Enviar mensajes del sistema a OpenAI"},assistantMessages:{label:"Mensajes del Asistente",description:"Enviar mensajes del asistente a OpenAI"},userMessages:{label:"Mensajes del Usuario",description:"Enviar mensajes del usuario a OpenAI"},maxTokens:{label:"Máximo de Tokens"},triggerSettings:{label:"Configuraciones de Disparador"},triggerType:{label:"Tipo de Disparador",keyword:"Palabra clave",all:"Todos",advanced:"Avanzado",none:"Ninguno"},triggerOperator:{label:"Operador de Disparador",contains:"Contiene",equals:"Igual",startsWith:"Comienza Con",endsWith:"Termina Con",regex:"Regex"},triggerValue:{label:"Disparador"},triggerConditions:{label:"Condiciones"},openaiIdFallback:{label:"Fallback de OpenAI"},generalSettings:{label:"Configuraciones Generales"},expire:{label:"Expirar en minutos"},keywordFinish:{label:"Palabra clave de Finalización"},delayMessage:{label:"Mensaje de Retraso Predeterminado"},unknownMessage:{label:"Mensaje Desconocido"},listeningFromMe:{label:"Escuchando de mí",description:"Escuchar los mensajes enviados por mí en el bot"},stopBotFromMe:{label:"Detener bot por mí",description:"Pausar el bot cuando yo envíe un mensaje"},keepOpen:{label:"Mantener abierto",description:"Mantener el bot abierto después de que termine la conversación"},speechToText:{label:"Voz a Texto",description:"Convertir mensajes de voz en texto"},debounceTime:{label:"Tiempo de Debounce"},splitMessages:{label:"Dividir Mensajes",description:"Dividir mensajes largos en múltiples mensajes"},timePerChar:{label:"Tiempo por Carácter"},ignoreJids:{label:"Ignorar JIDs",placeholder:"Agregar JIDs ej: 1234567890@s.whatsapp.net y presiona enter"}},button:{create:"OpenAI",save:"Guardar",saving:"Guardando...",update:"Actualizar",defaultSettings:"Configuraciones Predeterminadas",delete:"Eliminar",loadModels:"Cargar Modelos",loading:"Cargando..."},modal:{defaultSettings:{title:"Configuraciones Predeterminadas"}}},lle={title:"Dify",sessions:{label:"Sesiones",search:"Buscar por remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Nombre Visible",sessionId:"ID de Sesión",status:"Estado",actions:{title:"Acciones",open:"Abrir",pause:"Pausar",close:"Cerrar",delete:"Eliminar"},none:"Nada que mostrar"}},defaultSettings:"Configuraciones Predeterminadas",toast:{defaultSettings:{success:"Configuraciones predeterminadas aplicadas con éxito",error:"Ocurrió un error al aplicar las configuraciones predeterminadas"},success:{update:"Dify actualizado con éxito",create:"Dify creado con éxito",delete:"Dify eliminado con éxito",status:"Estado de Dify actualizado con éxito"},error:"Ocurrió un error al crear el Dify"},table:{none:"Nada que mostrar"},form:{title:"Nuevo Dify",examples:{keywordFinish:"#FINISH",unknownMessage:"Lo siento, no entendí. ¿Puedes intentar de nuevo?"},enabled:{label:"Activo"},description:{label:"Descripción"},difySettings:{label:"Configuraciones de Dify"},botType:{label:"Tipo de Bot",chatBot:"Chat Bot",textGenerator:"Generador de Texto",agent:"Agente",workflow:"Flujo de Trabajo"},apiUrl:{label:"URL de la API"},apiKey:{label:"Clave API"},triggerSettings:{label:"Configuraciones de Disparador"},triggerType:{label:"Tipo de Disparador",keyword:"Palabra clave",all:"Todos",advanced:"Avanzado",none:"Ninguno"},triggerOperator:{label:"Operador de Disparador",contains:"Contiene",equals:"Igual",startsWith:"Comienza Con",endsWith:"Termina Con",regex:"Regex"},triggerValue:{label:"Disparador"},triggerConditions:{label:"Condiciones"},difyIdFallback:{label:"Fallback de Dify"},generalSettings:{label:"Configuraciones Generales"},expire:{label:"Expirar en minutos"},keywordFinish:{label:"Palabra clave de Finalización"},delayMessage:{label:"Mensaje de Retraso Predeterminado"},unknownMessage:{label:"Mensaje Desconocido"},listeningFromMe:{label:"Escuchando de mí",description:"Escuchar los mensajes enviados por mí en el bot"},stopBotFromMe:{label:"Detener bot por mí",description:"Pausar el bot cuando yo envíe un mensaje"},keepOpen:{label:"Mantener abierto",description:"Mantener el bot abierto después de que termine la conversación"},debounceTime:{label:"Tiempo de Debounce"},splitMessages:{label:"Dividir Mensajes",description:"Dividir mensajes largos en múltiples mensajes"},timePerChar:{label:"Tiempo por Carácter"},ignoreJids:{label:"Ignorar JIDs",placeholder:"Agregar JIDs ej: 1234567890@s.whatsapp.net y presiona enter"}},button:{create:"Dify",save:"Guardar",saving:"Guardando...",update:"Actualizar",defaultSettings:"Configuraciones Predeterminadas",delete:"Eliminar"},modal:{defaultSettings:{title:"Configuraciones Predeterminadas"}}},cle={title:"n8n",sessions:{label:"Sesiones",search:"Buscar por remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Push Name",sessionId:"Session ID",status:"Estado",actions:{title:"Acciones",open:"Abrir",pause:"Pausar",close:"Cerrar",delete:"Eliminar"},none:"Nada que mostrar"}},defaultSettings:"Configuraciones Predeterminadas",toast:{defaultSettings:{success:"Configuraciones predeterminadas aplicadas con éxito",error:"Ocurrió un error al aplicar las configuraciones predeterminadas"},success:{update:"n8n actualizado con éxito",create:"n8n creado con éxito",delete:"n8n eliminado con éxito",status:"Estado de n8n actualizado con éxito"},error:"Ocurrió un error al crear el chatbot n8n"},table:{none:"Nada que mostrar"},form:{title:"Nuevo chatbot n8n",examples:{keywordFinish:"#FINISH",unknownMessage:"Lo siento, no entendí. ¿Puedes intentar de nuevo?"},enabled:{label:"Activo"},description:{label:"Descripción"},n8nSettings:{label:"Configuraciones de n8n"},webhookUrl:{label:"URL del Webhook"},basicAuth:{label:"Basic Auth (Opcional)"},basicAuthUser:{label:"Basic Auth User"},basicAuthPass:{label:"Basic Auth Password"},triggerSettings:{label:"Configuraciones de Disparador"},triggerType:{label:"Tipo de Disparador",keyword:"Palabra clave",all:"Todos",advanced:"Avanzado",none:"Ninguno"},triggerOperator:{label:"Operador de Disparador",contains:"Contiene",equals:"Igual",startsWith:"Comienza Con",endsWith:"Termina Con",regex:"Regex"},triggerValue:{label:"Disparador"},triggerConditions:{label:"Condiciones"},n8nIdFallback:{label:"Fallback de n8n"},generalSettings:{label:"Configuraciones Generales"},expire:{label:"Expirar en minutos"},keywordFinish:{label:"Palabra clave de Finalización"},delayMessage:{label:"Mensaje de Retraso Predeterminado"},unknownMessage:{label:"Mensaje Desconocido"},listeningFromMe:{label:"Escuchando de mí",description:"Escuchar los mensajes enviados por mí en el bot"},stopBotFromMe:{label:"Detener bot por mí",description:"Pausar el bot cuando yo envíe un mensaje"},keepOpen:{label:"Mantener abierto",description:"Mantener el bot abierto después de que termine la conversación"},debounceTime:{label:"Tiempo de Debounce"},splitMessages:{label:"Dividir Mensajes",description:"Dividir mensajes en múltiples mensajes"},timePerChar:{label:"Tiempo por carácter"},ignoreJids:{label:"Ignorar JIDs",placeholder:"Agregar JIDs ej: 1234567890@s.whatsapp.net y presiona enter"}},button:{create:"n8n",save:"Guardar",saving:"Guardando...",update:"Actualizar",defaultSettings:"Configuraciones Predeterminadas",delete:"Eliminar"},modal:{defaultSettings:{title:"Configuraciones Predeterminadas"}}},ule={title:"EvoAI",sessions:{label:"Sesiones",search:"Buscar por remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Push Name",sessionId:"Session ID",status:"Estado",actions:{title:"Acciones",open:"Abrir",pause:"Pausar",close:"Cerrar",delete:"Eliminar"},none:"Nada que mostrar"}},defaultSettings:"Configuraciones Predeterminadas",toast:{defaultSettings:{success:"Configuraciones predeterminadas aplicadas con éxito",error:"Ocurrió un error al aplicar las configuraciones predeterminadas"},success:{update:"EvoAI actualizado con éxito",create:"EvoAI creado con éxito",delete:"EvoAI eliminado con éxito",status:"Estado de EvoAI actualizado con éxito"},error:"Ocurrió un error al crear el chatbot EvoAI"},table:{none:"Nada que mostrar"},form:{title:"Nuevo chatbot EvoAI",examples:{keywordFinish:"#FINISH",unknownMessage:"Lo siento, no entendí. ¿Puedes intentar de nuevo?"},enabled:{label:"Activo"},description:{label:"Descripción"},evoaiSettings:{label:"Configuraciones de EvoAI"},agentUrl:{label:"URL del Agente"},apiKey:{label:"API Key (Opcional)"},triggerSettings:{label:"Configuraciones de Disparador"},triggerType:{label:"Tipo de Disparador",keyword:"Palabra clave",all:"Todos",advanced:"Avanzado",none:"Ninguno"},triggerOperator:{label:"Operador de Disparador",contains:"Contiene",equals:"Igual",startsWith:"Comienza Con",endsWith:"Termina Con",regex:"Regex"},triggerValue:{label:"Disparador"},triggerConditions:{label:"Condiciones"},evoaiIdFallback:{label:"Fallback de EvoAI"},generalSettings:{label:"Configuraciones Generales"},expire:{label:"Expirar en minutos"},keywordFinish:{label:"Palabra clave de Finalización"},delayMessage:{label:"Mensaje de Retraso Predeterminado"},unknownMessage:{label:"Mensaje Desconocido"},listeningFromMe:{label:"Escuchando de mí",description:"Escuchar los mensajes enviados por mí en el bot"},stopBotFromMe:{label:"Detener bot por mí",description:"Pausar el bot cuando yo envíe un mensaje"},keepOpen:{label:"Mantener abierto",description:"Mantener el bot abierto después de que termine la conversación"},debounceTime:{label:"Tiempo de Debounce"},splitMessages:{label:"Dividir Mensajes",description:"Dividir mensajes en múltiples mensajes"},timePerChar:{label:"Tiempo por carácter"},ignoreJids:{label:"Ignorar JIDs",placeholder:"Agregar JIDs ej: 1234567890@s.whatsapp.net y presiona enter"}},button:{create:"EvoAI",save:"Guardar",saving:"Guardando...",update:"Actualizar",defaultSettings:"Configuraciones Predeterminadas",delete:"Eliminar"},modal:{defaultSettings:{title:"Configuraciones Predeterminadas"}}},dle={title:"Bot Evolution",sessions:{label:"Sesiones",search:"Buscar por remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Nombre Visible",sessionId:"ID de Sesión",status:"Estado",actions:{title:"Acciones",open:"Abrir",pause:"Pausar",close:"Cerrar",delete:"Eliminar"},none:"Nada que mostrar"}},defaultSettings:"Configuraciones Predeterminadas",toast:{defaultSettings:{success:"Configuraciones predeterminadas aplicadas con éxito",error:"Ocurrió un error al aplicar las configuraciones predeterminadas"},success:{update:"Bot Evolution actualizado con éxito",create:"Bot Evolution creado con éxito",delete:"Bot Evolution eliminado con éxito",status:"Estado de Bot Evolution actualizado con éxito"},error:"Ocurrió un error al crear el Bot Evolution"},table:{none:"Nada que mostrar"},form:{title:"Nuevo Bot Evolution",examples:{keywordFinish:"#FINISH",unknownMessage:"Lo siento, no entendí. ¿Puedes intentar de nuevo?"},enabled:{label:"Activo"},description:{label:"Descripción"},evolutionBotSettings:{label:"Configuraciones de Bot Evolution"},apiUrl:{label:"URL de la API"},apiKey:{label:"Clave API"},triggerSettings:{label:"Configuraciones de Disparador"},triggerType:{label:"Tipo de Disparador",keyword:"Palabra clave",all:"Todos",advanced:"Avanzado",none:"Ninguno"},triggerOperator:{label:"Operador de Disparador",contains:"Contiene",equals:"Igual",startsWith:"Comienza Con",endsWith:"Termina Con",regex:"Regex"},triggerValue:{label:"Disparador"},triggerConditions:{label:"Condiciones"},botIdFallback:{label:"Fallback de Bot Evolution"},generalSettings:{label:"Configuraciones Generales"},expire:{label:"Expirar en minutos"},keywordFinish:{label:"Palabra clave de Finalización"},delayMessage:{label:"Mensaje de Retraso Predeterminado"},unknownMessage:{label:"Mensaje Desconocido"},listeningFromMe:{label:"Escuchando de mí",description:"Escuchar los mensajes enviados por mí en el bot"},stopBotFromMe:{label:"Detener bot por mí",description:"Pausar el bot cuando yo envíe un mensaje"},keepOpen:{label:"Mantener abierto",description:"Mantener el bot abierto después de que termine la conversación"},debounceTime:{label:"Tiempo de Debounce"},splitMessages:{label:"Dividir Mensajes",description:"Dividir mensajes largos en múltiples mensajes"},timePerChar:{label:"Tiempo por Carácter"},ignoreJids:{label:"Ignorar JIDs",placeholder:"Agregar JIDs ej: 1234567890@s.whatsapp.net y presiona enter"}},button:{create:"Bot Evolution",save:"Guardar",saving:"Guardando...",update:"Actualizar",defaultSettings:"Configuraciones Predeterminadas",delete:"Eliminar"},modal:{defaultSettings:{title:"Configuraciones Predeterminadas"}}},fle={title:"Flowise",sessions:{label:"Sesiones",search:"Buscar por remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Nombre Visible",sessionId:"ID de Sesión",status:"Estado",actions:{title:"Acciones",open:"Abrir",pause:"Pausar",close:"Cerrar",delete:"Eliminar"},none:"Nada que mostrar"}},defaultSettings:"Configuraciones Predeterminadas",toast:{defaultSettings:{success:"Configuraciones predeterminadas aplicadas con éxito",error:"Ocurrió un error al aplicar las configuraciones predeterminadas"},success:{update:"Flowise actualizado con éxito",create:"Flowise creado con éxito",delete:"Flowise eliminado con éxito",status:"Estado de Flowise actualizado con éxito"},error:"Ocurrió un error al crear el Flowise"},table:{none:"Nada que mostrar"},form:{title:"Nuevo Flowise",examples:{keywordFinish:"#FINISH",unknownMessage:"Lo siento, no entendí. ¿Puedes intentar de nuevo?"},enabled:{label:"Activo"},description:{label:"Descripción"},flowiseSettings:{label:"Configuraciones de Flowise"},apiUrl:{label:"URL de la API"},apiKey:{label:"Clave API"},triggerSettings:{label:"Configuraciones de Disparador"},triggerType:{label:"Tipo de Disparador",keyword:"Palabra clave",all:"Todos",advanced:"Avanzado",none:"Ninguno"},triggerOperator:{label:"Operador de Disparador",contains:"Contiene",equals:"Igual",startsWith:"Comienza Con",endsWith:"Termina Con",regex:"Regex"},triggerValue:{label:"Disparador"},triggerConditions:{label:"Condiciones"},flowiseIdFallback:{label:"Fallback de Flowise"},generalSettings:{label:"Configuraciones Generales"},expire:{label:"Expirar en minutos"},keywordFinish:{label:"Palabra clave de Finalización"},delayMessage:{label:"Mensaje de Retraso Predeterminado"},unknownMessage:{label:"Mensaje Desconocido"},listeningFromMe:{label:"Escuchando de mí",description:"Escuchar los mensajes enviados por mí en el bot"},stopBotFromMe:{label:"Detener bot por mí",description:"Pausar el bot cuando yo envíe un mensaje"},keepOpen:{label:"Mantener abierto",description:"Mantener el bot abierto después de que termine la conversación"},debounceTime:{label:"Tiempo de Debounce"},splitMessages:{label:"Dividir Mensajes",description:"Dividir mensajes largos en múltiples mensajes"},timePerChar:{label:"Tiempo por Carácter"},ignoreJids:{label:"Ignorar JIDs",placeholder:"Agregar JIDs ej: 1234567890@s.whatsapp.net y presiona enter"}},button:{create:"Flowise",save:"Guardar",saving:"Guardando...",update:"Actualizar",defaultSettings:"Configuraciones Predeterminadas",delete:"Eliminar"},modal:{defaultSettings:{title:"Configuraciones Predeterminadas"}}},ple={search:"Buscar conversaciones...",back:"Volver",tabs:{contacts:"Contactos",groups:"Grupos"},count_one:"{{count}} conversación",count_other:"{{count}} conversaciones",empty:{default:"Aún no hay conversaciones",search:"No se encontraron conversaciones",tryAnother:"Intente otro término",selectTitle:"Seleccione una conversación",selectDescription:"Elija un contacto o grupo de la lista para comenzar"},input:{placeholder:"Escriba un mensaje...",send:"Enviar"},date:{today:"Hoy",yesterday:"Ayer"}},hle={search:"Buscar..."},mle={title:"Enviar Mensaje",description:"Envíe un mensaje de texto desde la instancia",validation:{numberRequired:"El número es obligatorio",messageRequired:"El mensaje es obligatorio"},form:{number:{label:"Número (con código de país)"},message:{label:"Mensaje",placeholder:"Escriba su mensaje..."}},button:{send:"Enviar",sending:"Enviando..."},toast:{success:"Mensaje enviado con éxito",error:"Error al enviar el mensaje",noToken:"Token de instancia no disponible"}},gle={title:"Conectar con código QR",description:"Escanee el código QR para conectar la instancia",generating:"Generando código QR...",waiting:"Esperando código QR...",connected:{title:"Instancia conectada",description:"La instancia {{instanceName}} ya está conectada",connectedAs:"Conectado como"},pairingCode:{title:"Conectar con código de emparejamiento",label:"Código de emparejamiento",generate:"Generar código",generating:"Generando...",hint:"Ingrese el número con código de país (ej: 5511999999999) para recibir un código de emparejamiento"},howTo:{title:"Cómo conectar:",step1:"Abra WhatsApp en su teléfono",step2:"Toque Menú o Ajustes",step3:"Seleccione Dispositivos vinculados",step4:"Toque Vincular un dispositivo",step5:"Apunte su cámara al código QR"},button:{refresh:"Actualizar código QR",refreshing:"Actualizando...",close:"Cerrar"},toast:{pairingSuccess:"Código de emparejamiento generado",pairingError:"Error al generar el código de emparejamiento",refreshSuccess:"Código QR actualizado",refreshError:"Error al actualizar el código QR"}},vle={title:"Nueva Instancia",description:"Cree una nueva instancia para conectar con WhatsApp",validation:{nameMin:"El nombre debe tener al menos 3 caracteres",nameMax:"El nombre debe tener como máximo 50 caracteres",nameFormat:"El nombre solo puede contener letras, números, guiones y guiones bajos"},form:{name:{label:"Nombre de la Instancia",placeholder:"mi-instancia",hint:"Use letras, números, guion (-) o guion bajo (_)"},token:{label:"Token (opcional)",placeholder:"Deje en blanco para generar automáticamente",hint:"Si no se proporciona, se generará un UUID automáticamente"}},proxy:{title:"Configurar Proxy (opcional)",host:{label:"Host",placeholder:"proxy.ejemplo.com"},port:{label:"Puerto"},username:{label:"Usuario",placeholder:"usuario"},password:{label:"Contraseña",placeholder:"••••••••"}},button:{create:"Crear Instancia",creating:"Creando..."}},yle={loading:"Cargando...",noResults:"¡Ningún resultado encontrado!"},xle={dashboard:Bie,button:zie,testInteractive:Uie,sessions:Vie,modal:qie,status:Hie,footer:Wie,header:Kie,sidebar:Gie,toast:Jie,license:Qie,login:Yie,instance:Zie,settings:Xie,proxy:ele,webhook:tle,websocket:nle,rabbitmq:rle,sqs:sle,chatwoot:ale,typebot:ole,openai:ile,dify:lle,n8n:cle,evoai:ule,evolutionBot:dle,flowise:fle,chat:ple,common:hle,sendMessage:mle,qrCode:gle,newInstance:vle,table:yle},ble={title:"Instances",search:"Rechercher",status:"Statut",settings:"Paramètres",instancesNotFound:"Aucune instance trouvée",subtitle:"Gérez vos instances WhatsApp",card:{phone:"Numéro"},empty:{title:"Aucune instance trouvée",description:"Créez votre première instance pour commencer"}},wle={delete:"Supprimer",deleting:"Suppression...",cancel:"Annuler",markAll:"Marquer Tous",unMarkAll:"Démarquer Tous",refresh:"Actualiser"},Sle={title:"Tester les messages interactifs",subtitle:"Instance : {{instance}} ·",number:"Numéro de destination",numberHint:"Avec indicatif pays/zone, chiffres uniquement (ex. : 5511999999999)",payload:"Payload JSON (modifiable)",send:"Envoyer",sending:"Envoi...",requiresOpen:"Disponible uniquement lorsque l'instance est connectée",tabs:{reply:"Reply",cta:"CTA",pix:"PIX",list:"Liste",carousel:"Carrousel"},success:"Message envoyé (id {{id}})",errors:{missingNumber:"Indiquez le numéro de destination",invalidJson:"JSON invalide : {{message}}",unknown:"Échec de l'envoi du message"}},Cle={filters:{title:"Filtres avancés",name:"Filtrer par nom",namePlaceholder:"Filtrer par nom",number:"Filtrer par numéro",numberPlaceholder:"Filtrer par numéro",status:"Filtrer par statut",time:"Filtrer par temps",apply:"Appliquer les filtres",clear:"Effacer",statusOptions:{all:"Tous les statuts",opened:"Ouverte",paused:"En pause",closed:"Fermée"},timeOptions:{5:"Dernières 5 minutes",10:"Dernières 10 minutes",15:"Dernières 15 minutes",20:"Dernières 20 minutes",30:"Dernières 30 minutes",60:"Dernières 60 minutes",all:"À tout moment",">60":"Plus de 60 minutes",">120":"Plus de 2 heures",">300":"Plus de 5 heures",">1440":"Plus de 24 heures",custom:"Personnalisé"},custom:{more:"Plus que",less:"Moins que",valuePlaceholder:"Valeur",minutes:"Minutes",hours:"Heures",days:"Jours"}},mass:{title:"Actions en masse",selectAll:"Sélectionner tout",selected:"{{count}} sélectionnée(s)",newStatus:"Nouveau statut",apply:"Appliquer aux sélectionnées",noneSelected:"Sélectionnez au moins une session",success:"Statut mis à jour pour les sessions sélectionnées",error:"Échec de la mise à jour du statut en masse"},pagination:{showing:"Affichage de {{shown}} sur {{total}}",perPage:"Par page",showMore:"Charger plus",showAll:"Tout afficher",showLess:"Afficher moins"},send:{title:"Envoyer un message",to:"À",messagePlaceholder:"Tapez votre message",send:"Envoyer",sending:"Envoi...",empty:"Tapez un message avant d'envoyer",success:"Message envoyé avec succès",error:"Échec de l'envoi du message"},actions:{sendMessage:"Envoyer un message"},empty:"Aucune session trouvée"},jle={delete:{title:"Supprimer l'Enregistrement",message:"Vous êtes en train de supprimer l'instance {{instanceName}}. Êtes-vous sûr de vouloir continuer ?",messageSingle:"Cette action est irréversible.",confirm:"Tapez le nom de l'instance pour confirmer:"}},kle={all:"Tous",open:"Connecté",connecting:"Connexion",closed:"Déconnecté"},Ele={clientName:"Nom du Client",version:"Version"},Nle={theme:{label:"Changer de Thème",light:"Clair",dark:"Sombre",system:"Système"},language:{label:"Langue",english:"Anglais",portuguese:"Portugais",french:"Français"},logout:{action:"Déconnexion",title:"Êtes-vous sûr de vouloir vous déconnecter ?",description:"Vous serez déconnecté et redirigé vers l'écran de connexion."}},Tle={dashboard:"Vue d'ensemble",configurations:"Configurations",settings:"Comportement",proxy:"Proxy",events:"Evenements",webhook:"Webhook",websocket:"WebSocket",rabbitmq:"RabbitMQ",sqs:"SQS",integrations:"Intégrations",chatwoot:"Chatwoot",typebot:"Typebot",openai:"OpenAI",dify:"Dify",evoai:"EvoAI",n8n:"n8n",evolutionBot:"Bot Evolution",flowise:"Flowise",documentation:"Documentation",postman:"Postman",discord:"Discord"},Mle={instance:{created:"Instance créée avec succès",deleted:"Instance supprimée avec succès",error:"Une erreur est survenue lors de la création de l'instance"}},_le={checking:"Vérification de la licence...",required:"Licence requise",redirecting:"Redirection vers l'enregistrement de la licence...",registerFailed:"Échec du démarrage de l'enregistrement de la licence",callback:{title:"Activation de la licence",missingCode:"Code d'autorisation introuvable dans l'URL",missingCredentials:"Identifiants introuvables. Veuillez vous reconnecter.",activating:"Veuillez patienter pendant l'activation de votre licence.",successTitle:"Licence activée !",successDescription:"Redirection...",errorTitle:"Erreur d'activation",retry:"Réessayer",back:"Retour à la connexion",genericError:"Échec de l'activation de la licence"}},Ple={title:"Evolution Manager",description:"Veuillez vous connecter pour continuer",form:{serverUrl:"URL du Serveur",apiKey:"Clé API Globale"},message:{invalidServer:"Serveur invalide",invalidCredentials:"Identifiants invalides"},button:{login:"Se connecter",connecting:"Connexion..."},subtitle:"Entrez vos identifiants pour accéder au système"},Rle={modal:{title:"Nouvelle Instance"},form:{name:"Nom",integration:{label:"Canal",baileys:"Baileys",whatsapp:"WhatsApp Cloud API",facebook:"Facebook",instagram:"Instagram",evolution:"Evolution"},token:"Token",number:"Numéro",businessId:"ID de l'Entreprise"},button:{save:"Enregistrer",saving:"Enregistrement...",create:"Instance",connecting:"Connexion...",facebook:"Se connecter avec Facebook",instagram:"Se connecter avec Instagram",whatsapp:"Se connecter avec WhatsApp"},dashboard:{button:{qrcode:{label:"Générer un Code QR",title:"Scannez le Code QR avec WhatsApp"},pairingCode:{label:"Générer un Code d'Appairage",title:"Appairez avec WhatsApp"},restart:"Redémarrer",disconnect:"Déconnecter",sendMessage:"Envoyer un message"},alert:"Pour vous connecter, scannez le Code QR avec WhatsApp",contacts:"Contacts",chats:"Chats",messages:"Messages",subtitle:"Gérez votre instance"}},Ile={title:"Comportement",toast:{success:"Comportement appliqué avec succès",error:"Une erreur est survenue lors de l'application du comportement"},form:{rejectCall:{label:"Rejeter les Appels",description:"Rejeter tous les appels"},msgCall:{label:"Message de Rejet d'Appel",description:"Envoyer un message de rejet d'appel"},groupsIgnore:{label:"Ignorer les Groupes",description:"Ignorer tous les messages de groupes"},alwaysOnline:{label:"Toujours En Ligne",description:"Rester toujours en ligne"},readMessages:{label:"Lire les Messages",description:"Marquer tous les messages comme lus"},syncFullHistory:{label:"Synchroniser l'Historique Complet",description:"Synchroniser l'historique complet lors de la lecture du Code QR"},readStatus:{label:"Lire le Statut",description:"Marquer tous les statuts comme vus"}},button:{save:"Enregistrer",saving:"Enregistrement..."}},Ole={title:"Proxy",toast:{success:"Proxy appliqué avec succès",error:"Une erreur est survenue lors de l'application du proxy"},form:{enabled:{label:"Activé",description:"Activer ou désactiver le proxy"},protocol:{label:"Protocole"},host:{label:"Hôte"},port:{label:"Port"},username:{label:"Utilisateur"},password:{label:"Mot de passe"}},button:{save:"Enregistrer",saving:"Enregistrement..."}},Ale={title:"Webhook",toast:{success:"Webhook appliqué avec succès",error:"Une erreur est survenue lors de l'application du webhook"},form:{enabled:{label:"Activé",description:"Activer ou désactiver le webhook"},url:{label:"URL"},byEvents:{label:"Webhook par Événements",description:"Créer une route pour chaque événement en ajoutant le nom de l'événement à la fin de l'URL"},base64:{label:"Webhook Base64",description:"Envoyer des données médias en base64 dans le webhook"},events:{label:"Événements"}},button:{save:"Enregistrer",saving:"Enregistrement..."}},Dle={title:"WebSocket",toast:{success:"WebSocket appliqué avec succès",error:"Une erreur est survenue lors de l'application du WebSocket"},form:{enabled:{label:"Activé",description:"Activer ou désactiver le WebSocket"},events:{label:"Événements"}},button:{save:"Enregistrer",saving:"Enregistrement..."}},Fle={title:"RabbitMQ",toast:{success:"RabbitMQ appliqué avec succès",error:"Une erreur est survenue lors de l'application de RabbitMQ"},form:{enabled:{label:"Activé",description:"Activer ou désactiver RabbitMQ"},events:{label:"Événements"}},button:{save:"Enregistrer",saving:"Enregistrement..."}},Lle={title:"SQS",toast:{success:"SQS appliqué avec succès",error:"Une erreur est survenue lors de l'application de SQS"},form:{enabled:{label:"Activé",description:"Activer ou désactiver SQS"},events:{label:"Événements"}},button:{save:"Enregistrer",saving:"Enregistrement..."}},$le={title:"Chatwoot",toast:{success:"Chatwoot appliqué avec succès",error:"Une erreur est survenue lors de l'application de Chatwoot"},form:{enabled:{label:"Activé",description:"Activer ou désactiver Chatwoot"},url:{label:"URL de Chatwoot"},accountId:{label:"ID du Compte"},token:{label:"Token"},signMsg:{label:"Signer les Messages",description:"Signer les messages avec le nom d'utilisateur Chatwoot"},signDelimiter:{label:"Délimiteur de Signature"},nameInbox:{label:"Nom de la Boîte de Réception"},organization:{label:"Organisation"},logo:{label:"Logo"},conversationPending:{label:"Conversation en Attente",description:"Les conversations commencent en attente"},reopenConversation:{label:"Rouvrir la Conversation",description:"Rouvrir la conversation lors de la réception d'un message"},importContacts:{label:"Importer les Contacts",description:"Importer les contacts du carnet d'adresses WhatsApp en scannant le Code QR"},importMessages:{label:"Importer les Messages",description:"Importer les messages WhatsApp en scannant le Code QR"},daysLimitImportMessages:{label:"Limite de Jours pour l'Importation de Messages"},ignoreJids:{label:"Ignorer les JIDs",placeholder:"Ajouter des JIDs ex: 1234567890@s.whatsapp.net et appuyez sur entrer"},autoCreate:{label:"Création Automatique",description:"Créer automatiquement l'intégration Chatwoot lors de l'enregistrement"}},button:{save:"Enregistrer",saving:"Enregistrement..."}},Ble={title:"Typebots",sessions:{label:"Sessions",search:"Rechercher par remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Nom d'Affichage",sessionId:"ID de Session",status:"Statut",actions:{title:"Actions",open:"Ouvrir",pause:"Pause",close:"Fermer",delete:"Supprimer"},none:"Rien à afficher"}},defaultSettings:"Paramètres par Défaut",toast:{defaultSettings:{success:"Paramètres par défaut appliqués avec succès",error:"Une erreur est survenue lors de l'application des paramètres par défaut"},success:{update:"Typebot mis à jour avec succès",create:"Typebot créé avec succès",delete:"Typebot supprimé avec succès",status:"Statut de Typebot mis à jour avec succès"},error:"Une erreur est survenue lors de la création du Typebot"},table:{none:"Rien à afficher"},form:{title:"Nouveau Typebot",examples:{keywordFinish:"#FINISH",unknownMessage:"Désolé, je n'ai pas compris. Pouvez-vous réessayer ?"},enabled:{label:"Activé"},description:{label:"Description"},typebotSettings:{label:"Paramètres de Typebot"},url:{label:"URL de l'API de Typebot"},typebot:{label:"Nom Public de Typebot"},triggerSettings:{label:"Paramètres de Déclencheur"},triggerType:{label:"Type de Déclencheur",keyword:"Mot-clé",all:"Tous",advanced:"Avancé",none:"Aucun"},triggerOperator:{label:"Opérateur de Déclencheur",contains:"Contient",equals:"Égal",startsWith:"Commence Par",endsWith:"Se Termine Par",regex:"Regex"},triggerValue:{label:"Déclencheur"},triggerConditions:{label:"Conditions"},typebotIdFallback:{label:"Fallback de Typebot"},generalSettings:{label:"Paramètres Généraux"},expire:{label:"Expirer en minutes"},keywordFinish:{label:"Mot-clé de Fin"},delayMessage:{label:"Message de Délai par Défaut"},unknownMessage:{label:"Message Inconnu"},listeningFromMe:{label:"Écouter de Moi",description:"Écouter les messages envoyés par moi sur le bot"},stopBotFromMe:{label:"Arrêter le Bot de Moi",description:"Mettre en pause le bot quand j'envoie un message"},keepOpen:{label:"Garder Ouvert",description:"Garder le bot ouvert après la fin de la conversation"},debounceTime:{label:"Temps de Déclenchement"},splitMessages:{label:"Diviser les Messages",description:"Diviser les messages en plusieurs messages"},timePerChar:{label:"Temps par Caractère"},ignoreJids:{label:"Ignorer les JIDs",placeholder:"Ajouter des JIDs ex: 1234567890@s.whatsapp.net et appuyez sur entrer"}},button:{create:"Typebot",save:"Enregistrer",saving:"Enregistrement...",update:"Mettre à jour",defaultSettings:"Paramètres par Défaut",delete:"Supprimer"},modal:{defaultSettings:{title:"Paramètres par Défaut"}}},zle={title:"OpenAI",sessions:{label:"Sessions",search:"Rechercher par remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Nom d'Affichage",sessionId:"ID de Session",status:"Statut",actions:{title:"Actions",open:"Ouvrir",pause:"Pause",close:"Fermer",delete:"Supprimer"},none:"Rien à afficher"}},credentials:{title:"Identifiants",table:{name:"Nom",apiKey:"Clé API",actions:{title:"Actions",delete:"Supprimer"},none:"Rien à afficher"}},defaultSettings:"Paramètres par Défaut",toast:{defaultSettings:{success:"Paramètres par défaut appliqués avec succès",error:"Une erreur est survenue lors de l'application des paramètres par défaut"},success:{update:"OpenAI mis à jour avec succès",create:"OpenAI créé avec succès",delete:"OpenAI supprimé avec succès",status:"Statut de OpenAI mis à jour avec succès",credentialsCreate:"Identifiants OpenAI créés avec succès",credentialsDelete:"Identifiants OpenAI supprimés avec succès"},error:"Une erreur est survenue lors de la création de OpenAI"},table:{none:"Rien à afficher"},form:{title:"Nouveau OpenAI",examples:{keywordFinish:"#FINISH",unknownMessage:"Désolé, je n'ai pas compris. Pouvez-vous réessayer ?"},openaiCredsId:{label:"Identifiants OpenAI"},enabled:{label:"Activé"},description:{label:"Description"},openaiSettings:{label:"Paramètres OpenAI"},botType:{label:"Type de Bot",assistant:"Assistant",chatCompletion:"Chat Completion"},assistantId:{label:"ID de l'Assistant"},functionUrl:{label:"URL de la Fonction"},model:{label:"Modèle de Langage"},systemMessages:{label:"Messages Système",description:"Envoyer des messages système à OpenAI"},assistantMessages:{label:"Messages de l'Assistant",description:"Envoyer des messages de l'assistant à OpenAI"},userMessages:{label:"Messages de l'Utilisateur",description:"Envoyer des messages de l'utilisateur à OpenAI"},maxTokens:{label:"Nombre Maximum de Tokens"},triggerSettings:{label:"Paramètres de Déclencheur"},triggerType:{label:"Type de Déclencheur",keyword:"Mot-clé",all:"Tous",advanced:"Avancé",none:"Aucun"},triggerOperator:{label:"Opérateur de Déclencheur",contains:"Contient",equals:"Égal",startsWith:"Commence Par",endsWith:"Se Termine Par",regex:"Regex"},triggerValue:{label:"Déclencheur"},triggerConditions:{label:"Conditions"},openaiIdFallback:{label:"Fallback de OpenAI"},generalSettings:{label:"Paramètres Généraux"},expire:{label:"Expirer en minutes"},keywordFinish:{label:"Mot-clé de Fin"},delayMessage:{label:"Message de Délai par Défaut"},unknownMessage:{label:"Message Inconnu"},listeningFromMe:{label:"Écouter de Moi",description:"Écouter les messages envoyés par moi sur le bot"},stopBotFromMe:{label:"Arrêter le Bot de Moi",description:"Mettre en pause le bot quand j'envoie un message"},keepOpen:{label:"Garder Ouvert",description:"Garder le bot ouvert après la fin de la conversation"},speechToText:{label:"Parole en Texte",description:"Convertir les messages vocaux en texte"},debounceTime:{label:"Temps de Déclenchement"},splitMessages:{label:"Diviser les Messages",description:"Diviser les messages en plusieurs messages"},timePerChar:{label:"Temps par Caractère"},ignoreJids:{label:"Ignorer les JIDs",placeholder:"Ajouter des JIDs ex: 1234567890@s.whatsapp.net et appuyez sur entrer"}},button:{create:"OpenAI",save:"Enregistrer",saving:"Enregistrement...",update:"Mettre à jour",defaultSettings:"Paramètres par Défaut",delete:"Supprimer",loadModels:"Charger les Modèles",loading:"Chargement..."},modal:{defaultSettings:{title:"Paramètres par Défaut"}}},Ule={title:"Dify",sessions:{label:"Sessions",search:"Rechercher par remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Nom d'Affichage",sessionId:"ID de Session",status:"Statut",actions:{title:"Actions",open:"Ouvrir",pause:"Pause",close:"Fermer",delete:"Supprimer"},none:"Rien à afficher"}},defaultSettings:"Paramètres par Défaut",toast:{defaultSettings:{success:"Paramètres par défaut appliqués avec succès",error:"Une erreur est survenue lors de l'application des paramètres par défaut"},success:{update:"Dify mis à jour avec succès",create:"Dify créé avec succès",delete:"Dify supprimé avec succès",status:"Statut de Dify mis à jour avec succès"},error:"Une erreur est survenue lors de la création de Dify"},table:{none:"Rien à afficher"},form:{title:"Nouveau Dify",examples:{keywordFinish:"#FINISH",unknownMessage:"Désolé, je n'ai pas compris. Pouvez-vous réessayer ?"},enabled:{label:"Activé"},description:{label:"Description"},difySettings:{label:"Paramètres de Dify"},botType:{label:"Type de Bot",chatBot:"Chat Bot",textGenerator:"Générateur de Texte",agent:"Agent",workflow:"Flux de Travail"},apiUrl:{label:"URL de l'API"},apiKey:{label:"Clé API"},triggerSettings:{label:"Paramètres de Déclencheur"},triggerType:{label:"Type de Déclencheur",keyword:"Mot-clé",all:"Tous",advanced:"Avancé",none:"Aucun"},triggerOperator:{label:"Opérateur de Déclencheur",contains:"Contient",equals:"Égal",startsWith:"Commence Par",endsWith:"Se Termine Par",regex:"Regex"},triggerValue:{label:"Déclencheur"},triggerConditions:{label:"Conditions"},difyIdFallback:{label:"Fallback de Dify"},generalSettings:{label:"Paramètres Généraux"},expire:{label:"Expirer en minutes"},keywordFinish:{label:"Mot-clé de Fin"},delayMessage:{label:"Message de Délai par Défaut"},unknownMessage:{label:"Message Inconnu"},listeningFromMe:{label:"Écouter de Moi",description:"Écouter les messages envoyés par moi sur le bot"},stopBotFromMe:{label:"Arrêter le Bot de Moi",description:"Mettre en pause le bot quand j'envoie un message"},keepOpen:{label:"Garder Ouvert",description:"Garder le bot ouvert après la fin de la conversation"},debounceTime:{label:"Temps de Déclenchement"},splitMessages:{label:"Diviser les Messages",description:"Diviser les messages en plusieurs messages"},timePerChar:{label:"Temps par Caractère"},ignoreJids:{label:"Ignorer les JIDs",placeholder:"Ajouter des JIDs ex: 1234567890@s.whatsapp.net et appuyez sur entrer"}},button:{create:"Dify",save:"Enregistrer",saving:"Enregistrement...",update:"Mettre à jour",defaultSettings:"Paramètres par Défaut",delete:"Supprimer"},modal:{defaultSettings:{title:"Paramètres par Défaut"}}},Vle={title:"n8n",sessions:{label:"Sessions",search:"Rechercher par remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Push Name",sessionId:"Session ID",status:"Statut",actions:{title:"Actions",open:"Ouvrir",pause:"Pause",close:"Fermer",delete:"Supprimer"},none:"Rien à afficher"}},defaultSettings:"Paramètres par défaut",toast:{defaultSettings:{success:"Paramètres par défaut appliqués avec succès",error:"Une erreur s'est produite lors de l'application des paramètres par défaut"},success:{update:"n8n mis à jour avec succès",create:"n8n créé avec succès",delete:"n8n supprimé avec succès",status:"Statut de n8n mis à jour avec succès"},error:"Une erreur s'est produite lors de la création du chatbot n8n"},table:{none:"Rien à afficher"},form:{title:"Nouveau chatbot n8n",examples:{keywordFinish:"#FINISH",unknownMessage:"Désolé, je n'ai pas compris. Pouvez-vous réessayer ?"},enabled:{label:"Activé"},description:{label:"Description"},n8nSettings:{label:"Paramètres n8n"},webhookUrl:{label:"URL du Webhook"},basicAuth:{label:"Basic Auth (Optionnel)"},basicAuthUser:{label:"Basic Auth User"},basicAuthPass:{label:"Basic Auth Password"},triggerSettings:{label:"Paramètres du déclencheur"},triggerType:{label:"Type de déclencheur",keyword:"Mot-clé",all:"Tous",advanced:"Avancé",none:"Aucun"},triggerOperator:{label:"Opérateur de déclencheur",contains:"Contient",equals:"Égal",startsWith:"Commence par",endsWith:"Se termine par",regex:"Regex"},triggerValue:{label:"Déclencheur"},triggerConditions:{label:"Conditions"},n8nIdFallback:{label:"Fallback n8n"},generalSettings:{label:"Paramètres généraux"},expire:{label:"Expire en minutes"},keywordFinish:{label:"Mot-clé de fin"},delayMessage:{label:"Message de délai par défaut"},unknownMessage:{label:"Message inconnu"},listeningFromMe:{label:"Écouter mes messages",description:"Écouter les messages envoyés par moi sur le bot"},stopBotFromMe:{label:"Arrêter le bot de ma part",description:"Mettre en pause le bot lorsque j'envoie un message"},keepOpen:{label:"Maintenir ouvert",description:"Maintenir le bot ouvert après la fin de la conversation"},debounceTime:{label:"Temps de debounce"},splitMessages:{label:"Diviser les messages",description:"Diviser les messages en plusieurs messages"},timePerChar:{label:"Temps par caractère"},ignoreJids:{label:"Ignorer les JIDs",placeholder:"Ajouter des JIDs ex: 1234567890@s.whatsapp.net et appuyer sur entrée"}},button:{create:"n8n",save:"Enregistrer",saving:"Enregistrement...",update:"Mettre à jour",defaultSettings:"Paramètres par défaut",delete:"Supprimer"},modal:{defaultSettings:{title:"Paramètres par défaut"}}},qle={title:"EvoAI",sessions:{label:"Sessions",search:"Rechercher par remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Push Name",sessionId:"Session ID",status:"Statut",actions:{title:"Actions",open:"Ouvrir",pause:"Pause",close:"Fermer",delete:"Supprimer"},none:"Rien à afficher"}},defaultSettings:"Paramètres par défaut",toast:{defaultSettings:{success:"Paramètres par défaut appliqués avec succès",error:"Une erreur s'est produite lors de l'application des paramètres par défaut"},success:{update:"EvoAI mis à jour avec succès",create:"EvoAI créé avec succès",delete:"EvoAI supprimé avec succès",status:"Statut de EvoAI mis à jour avec succès"},error:"Une erreur s'est produite lors de la création du chatbot EvoAI"},table:{none:"Rien à afficher"},form:{title:"Nouveau chatbot EvoAI",examples:{keywordFinish:"#FINISH",unknownMessage:"Désolé, je n'ai pas compris. Pouvez-vous réessayer ?"},enabled:{label:"Activé"},description:{label:"Description"},evoaiSettings:{label:"Paramètres EvoAI"},agentUrl:{label:"URL de l'agent"},apiKey:{label:"API Key (Optionnel)"},triggerSettings:{label:"Paramètres du déclencheur"},triggerType:{label:"Type de déclencheur",keyword:"Mot-clé",all:"Tous",advanced:"Avancé",none:"Aucun"},triggerOperator:{label:"Opérateur de déclencheur",contains:"Contient",equals:"Égal",startsWith:"Commence par",endsWith:"Se termine par",regex:"Regex"},triggerValue:{label:"Déclencheur"},triggerConditions:{label:"Conditions"},evoaiIdFallback:{label:"Fallback EvoAI"},generalSettings:{label:"Paramètres généraux"},expire:{label:"Expire en minutes"},keywordFinish:{label:"Mot-clé de fin"},delayMessage:{label:"Message de délai par défaut"},unknownMessage:{label:"Message inconnu"},listeningFromMe:{label:"Écouter mes messages",description:"Écouter les messages envoyés par moi sur le bot"},stopBotFromMe:{label:"Arrêter le bot de ma part",description:"Mettre en pause le bot lorsque j'envoie un message"},keepOpen:{label:"Maintenir ouvert",description:"Maintenir le bot ouvert après la fin de la conversation"},debounceTime:{label:"Temps de debounce"},splitMessages:{label:"Diviser les messages",description:"Diviser les messages en plusieurs messages"},timePerChar:{label:"Temps par caractère"},ignoreJids:{label:"Ignorer les JIDs",placeholder:"Ajouter des JIDs ex: 1234567890@s.whatsapp.net et appuyer sur entrée"}},button:{create:"EvoAI",save:"Enregistrer",saving:"Enregistrement...",update:"Mettre à jour",defaultSettings:"Paramètres par défaut",delete:"Supprimer"},modal:{defaultSettings:{title:"Paramètres par défaut"}}},Hle={title:"Bots Evolution",sessions:{label:"Sessions",search:"Rechercher par remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Nom d'Affichage",sessionId:"ID de Session",status:"Statut",actions:{title:"Actions",open:"Ouvrir",pause:"Pause",close:"Fermer",delete:"Supprimer"},none:"Rien à afficher"}},defaultSettings:"Paramètres par Défaut",toast:{defaultSettings:{success:"Paramètres par défaut appliqués avec succès",error:"Une erreur est survenue lors de l'application des paramètres par défaut"},success:{update:"Bots Evolution mis à jour avec succès",create:"Bots Evolution créé avec succès",delete:"Bots Evolution supprimé avec succès",status:"Statut de Bots Evolution mis à jour avec succès"},error:"Une erreur est survenue lors de la création de Bots Evolution"},table:{none:"Rien à afficher"},form:{title:"Nouveau Bots Evolution",examples:{keywordFinish:"#FINISH",unknownMessage:"Désolé, je n'ai pas compris. Pouvez-vous réessayer ?"},enabled:{label:"Activé"},description:{label:"Description"},evolutionBotSettings:{label:"Paramètres de Bots Evolution"},apiUrl:{label:"URL de l'API"},apiKey:{label:"Clé API"},triggerSettings:{label:"Paramètres de Déclencheur"},triggerType:{label:"Type de Déclencheur",keyword:"Mot-clé",all:"Tous",advanced:"Avancé",none:"Aucun"},triggerOperator:{label:"Opérateur de Déclencheur",contains:"Contient",equals:"Égal",startsWith:"Commence Par",endsWith:"Se Termine Par",regex:"Regex"},triggerValue:{label:"Déclencheur"},triggerConditions:{label:"Conditions"},botIdFallback:{label:"Fallback de Bots Evolution"},generalSettings:{label:"Paramètres Généraux"},expire:{label:"Expirer en minutes"},keywordFinish:{label:"Mot-clé de Fin"},delayMessage:{label:"Message de Délai par Défaut"},unknownMessage:{label:"Message Inconnu"},listeningFromMe:{label:"Écouter de Moi",description:"Écouter les messages envoyés par moi sur le bot"},stopBotFromMe:{label:"Arrêter le Bot de Moi",description:"Mettre en pause le bot quand j'envoie un message"},keepOpen:{label:"Garder Ouvert",description:"Garder le bot ouvert après la fin de la conversation"},debounceTime:{label:"Temps de Déclenchement"},splitMessages:{label:"Diviser les Messages",description:"Diviser les messages en plusieurs messages"},timePerChar:{label:"Temps par Caractère"},ignoreJids:{label:"Ignorer les JIDs",placeholder:"Ajouter des JIDs ex: 1234567890@s.whatsapp.net et appuyez sur entrer"}},button:{create:"Bots Evolution",save:"Enregistrer",saving:"Enregistrement...",update:"Mettre à jour",defaultSettings:"Paramètres par Défaut",delete:"Supprimer"},modal:{defaultSettings:{title:"Paramètres par Défaut"}}},Wle={title:"Flowise",sessions:{label:"Sessions",search:"Rechercher par remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Nom d'Affichage",sessionId:"ID de Session",status:"Statut",actions:{title:"Actions",open:"Ouvrir",pause:"Pause",close:"Fermer",delete:"Supprimer"},none:"Rien à afficher"}},defaultSettings:"Paramètres par Défaut",toast:{defaultSettings:{success:"Paramètres par défaut appliqués avec succès",error:"Une erreur est survenue lors de l'application des paramètres par défaut"},success:{update:"Flowise mis à jour avec succès",create:"Flowise créé avec succès",delete:"Flowise supprimé avec succès",status:"Statut de Flowise mis à jour avec succès"},error:"Une erreur est survenue lors de la création de Flowise"},table:{none:"Rien à afficher"},form:{title:"Nouveau Flowise",examples:{keywordFinish:"#FINISH",unknownMessage:"Désolé, je n'ai pas compris. Pouvez-vous réessayer ?"},enabled:{label:"Activé"},description:{label:"Description"},flowiseSettings:{label:"Paramètres de Flowise"},apiUrl:{label:"URL de l'API"},apiKey:{label:"Clé API"},triggerSettings:{label:"Paramètres de Déclencheur"},triggerType:{label:"Type de Déclencheur",keyword:"Mot-clé",all:"Tous",advanced:"Avancé",none:"Aucun"},triggerOperator:{label:"Opérateur de Déclencheur",contains:"Contient",equals:"Égal",startsWith:"Commence Par",endsWith:"Se Termine Par",regex:"Regex"},triggerValue:{label:"Déclencheur"},triggerConditions:{label:"Conditions"},flowiseIdFallback:{label:"Fallback de Flowise"},generalSettings:{label:"Paramètres Généraux"},expire:{label:"Expirer en minutes"},keywordFinish:{label:"Mot-clé de Fin"},delayMessage:{label:"Message de Délai par Défaut"},unknownMessage:{label:"Message Inconnu"},listeningFromMe:{label:"Écouter de Moi",description:"Écouter les messages envoyés par moi sur le bot"},stopBotFromMe:{label:"Arrêter le Bot de Moi",description:"Mettre en pause le bot quand j'envoie un message"},keepOpen:{label:"Garder Ouvert",description:"Garder le bot ouvert après la fin de la conversation"},debounceTime:{label:"Temps de Déclenchement"},splitMessages:{label:"Diviser les Messages",description:"Diviser les messages en plusieurs messages"},timePerChar:{label:"Temps par Caractère"},ignoreJids:{label:"Ignorer les JIDs",placeholder:"Ajouter des JIDs ex: 1234567890@s.whatsapp.net et appuyez sur entrer"}},button:{create:"Flowise",save:"Enregistrer",saving:"Enregistrement...",update:"Mettre à jour",defaultSettings:"Paramètres par Défaut",delete:"Supprimer"},modal:{defaultSettings:{title:"Paramètres par Défaut"}}},Kle={search:"Rechercher des conversations...",back:"Retour",tabs:{contacts:"Contacts",groups:"Groupes"},count_one:"{{count}} conversation",count_other:"{{count}} conversations",empty:{default:"Aucune conversation pour le moment",search:"Aucune conversation trouvée",tryAnother:"Essayez un autre terme",selectTitle:"Sélectionnez une conversation",selectDescription:"Choisissez un contact ou un groupe dans la liste pour commencer"},input:{placeholder:"Tapez un message...",send:"Envoyer"},date:{today:"Aujourd'hui",yesterday:"Hier"}},Gle={search:"Rechercher..."},Jle={title:"Envoyer un Message",description:"Envoyez un message texte depuis l'instance",validation:{numberRequired:"Le numéro est obligatoire",messageRequired:"Le message est obligatoire"},form:{number:{label:"Numéro (avec indicatif pays)"},message:{label:"Message",placeholder:"Saisissez votre message..."}},button:{send:"Envoyer",sending:"Envoi..."},toast:{success:"Message envoyé avec succès",error:"Erreur lors de l'envoi du message",noToken:"Jeton d'instance non disponible"}},Qle={title:"Connecter via QR Code",description:"Scannez le QR Code pour connecter l'instance",generating:"Génération du QR Code...",waiting:"En attente du QR Code...",connected:{title:"Instance connectée",description:"L'instance {{instanceName}} est déjà connectée",connectedAs:"Connecté en tant que"},pairingCode:{title:"Connecter avec code de jumelage",label:"Code de jumelage",generate:"Générer le code",generating:"Génération...",hint:"Entrez le numéro avec indicatif pays (ex: 5511999999999) pour recevoir un code de jumelage"},howTo:{title:"Comment se connecter :",step1:"Ouvrez WhatsApp sur votre téléphone",step2:"Appuyez sur Menu ou Paramètres",step3:"Sélectionnez Appareils connectés",step4:"Appuyez sur Connecter un appareil",step5:"Pointez votre caméra sur le QR Code"},button:{refresh:"Actualiser le QR Code",refreshing:"Actualisation...",close:"Fermer"},toast:{pairingSuccess:"Code de jumelage généré",pairingError:"Erreur lors de la génération du code de jumelage",refreshSuccess:"QR Code actualisé",refreshError:"Erreur lors de l'actualisation du QR Code"}},Yle={title:"Nouvelle Instance",description:"Créez une nouvelle instance pour vous connecter à WhatsApp",validation:{nameMin:"Le nom doit contenir au moins 3 caractères",nameMax:"Le nom doit contenir au maximum 50 caractères",nameFormat:"Le nom ne peut contenir que des lettres, chiffres, tirets et underscores"},form:{name:{label:"Nom de l'Instance",placeholder:"mon-instance",hint:"Utilisez des lettres, chiffres, tiret (-) ou underscore (_)"},token:{label:"Jeton (optionnel)",placeholder:"Laissez vide pour générer automatiquement",hint:"Si non fourni, un UUID sera généré automatiquement"}},proxy:{title:"Configurer Proxy (optionnel)",host:{label:"Hôte",placeholder:"proxy.exemple.com"},port:{label:"Port"},username:{label:"Utilisateur",placeholder:"utilisateur"},password:{label:"Mot de passe",placeholder:"••••••••"}},button:{create:"Créer l'Instance",creating:"Création..."}},Zle={loading:"Chargement...",noResults:"Aucun résultat trouvé !"},Xle={dashboard:ble,button:wle,testInteractive:Sle,sessions:Cle,modal:jle,status:kle,footer:Ele,header:Nle,sidebar:Tle,toast:Mle,license:_le,login:Ple,instance:Rle,settings:Ile,proxy:Ole,webhook:Ale,websocket:Dle,rabbitmq:Fle,sqs:Lle,chatwoot:$le,typebot:Ble,openai:zle,dify:Ule,n8n:Vle,evoai:qle,evolutionBot:Hle,flowise:Wle,chat:Kle,common:Gle,sendMessage:Jle,qrCode:Qle,newInstance:Yle,table:Zle},ece={title:"Instâncias",subtitle:"Gerencie suas instâncias WhatsApp",search:"Pesquisar",status:"Status",settings:"Configurações",instancesNotFound:"Nenhuma instância encontrada",card:{phone:"Número"},empty:{title:"Nenhuma instância encontrada",description:"Crie sua primeira instância para começar"}},tce={delete:"Excluir",deleting:"Excluindo...",cancel:"Cancelar",refresh:"Atualizar",markAll:"Marcar Todos",unMarkAll:"Desmarcar Todos"},nce={title:"Testar mensagens interativas",subtitle:"Instância: {{instance}} ·",number:"Número de destino",numberHint:"Com DDI/DDD, somente dígitos (ex.: 5511999999999)",payload:"Payload JSON (editável)",send:"Enviar",sending:"Enviando...",requiresOpen:"Disponível apenas com a instância conectada",tabs:{reply:"Reply",cta:"CTA",pix:"PIX",list:"Lista",carousel:"Carrossel"},success:"Mensagem enviada (id {{id}})",errors:{missingNumber:"Informe o número de destino",invalidJson:"JSON inválido: {{message}}",unknown:"Falha ao enviar a mensagem"}},rce={filters:{title:"Filtros avançados",name:"Filtrar por nome",namePlaceholder:"Filtrar por nome",number:"Filtrar por número",numberPlaceholder:"Filtrar por número",status:"Filtrar por status",time:"Filtrar por tempo",apply:"Aplicar filtros",clear:"Limpar",statusOptions:{all:"Todos os status",opened:"Aberta",paused:"Pausada",closed:"Fechada"},timeOptions:{5:"Últimos 5 minutos",10:"Últimos 10 minutos",15:"Últimos 15 minutos",20:"Últimos 20 minutos",30:"Últimos 30 minutos",60:"Últimos 60 minutos",all:"Qualquer momento",">60":"Mais de 60 minutos",">120":"Mais de 2 horas",">300":"Mais de 5 horas",">1440":"Mais de 24 horas",custom:"Personalizado"},custom:{more:"Mais que",less:"Menos que",valuePlaceholder:"Valor",minutes:"Minutos",hours:"Horas",days:"Dias"}},mass:{title:"Ações em massa",selectAll:"Selecionar todos",selected:"{{count}} selecionada(s)",newStatus:"Novo status",apply:"Aplicar a selecionadas",noneSelected:"Selecione pelo menos uma sessão",success:"Status atualizado nas sessões selecionadas",error:"Erro ao atualizar status em massa"},pagination:{showing:"Mostrando {{shown}} de {{total}}",perPage:"Por página",showMore:"Carregar mais",showAll:"Mostrar todas",showLess:"Mostrar menos"},send:{title:"Enviar mensagem",to:"Para",messagePlaceholder:"Digite sua mensagem",send:"Enviar",sending:"Enviando...",empty:"Digite uma mensagem antes de enviar",success:"Mensagem enviada com sucesso",error:"Erro ao enviar mensagem"},actions:{sendMessage:"Enviar mensagem"},empty:"Nenhuma sessão encontrada"},sce={delete:{title:"Excluir Registro",message:"Você está excluindo a instância {{instanceName}}. Tem certeza que deseja continuar?",messageSingle:"Esta ação não pode ser desfeita.",confirm:"Digite o nome da instância para confirmar:"}},ace={all:"Todos",open:"Conectado",connecting:"Conectando",closed:"Desconectado"},oce={clientName:"Nome do Cliente",version:"Versão"},ice={theme:{label:"Mudar Tema",light:"Claro",dark:"Escuro",system:"Sistema"},language:{label:"Idioma",english:"Inglês",portuguese:"Português",spanish:"Espanhol",french:"Francês"},logout:{action:"Sair",title:"Deseja realmente sair?",description:"Você será desconectado e redirecionado para a tela de login."}},lce={dashboard:"Visão Geral",configurations:"Configurações",settings:"Comportamento",proxy:"Proxy",events:"Eventos",webhook:"Webhook",websocket:"WebSocket",rabbitmq:"RabbitMQ",sqs:"SQS",integrations:"Integrações",chatwoot:"Chatwoot",typebot:"Typebot",openai:"OpenAI",dify:"Dify",evoai:"EvoAI",n8n:"n8n",evolutionBot:"Bot Evolution",flowise:"Flowise",documentation:"Documentação",postman:"Postman",discord:"Discord"},cce={instance:{created:"Instância criada com sucesso",deleted:"Instância excluída com sucesso",error:"Ocorreu um erro ao criar a instância"}},uce={checking:"Verificando licença...",required:"Licença necessária",redirecting:"Redirecionando para o registro de licença...",registerFailed:"Falha ao iniciar o registro de licença",callback:{title:"Ativando licença",missingCode:"Código de autorização não encontrado na URL",missingCredentials:"Credenciais não encontradas. Faça login novamente.",activating:"Aguarde enquanto ativamos sua licença.",successTitle:"Licença ativada!",successDescription:"Redirecionando...",errorTitle:"Erro na ativação",retry:"Tentar novamente",back:"Voltar ao login",genericError:"Falha ao ativar a licença"}},dce={title:"Evolution Manager",description:"Por favor, faça login para continuar",subtitle:"Digite suas credenciais para acessar o sistema",form:{serverUrl:"URL do Servidor",apiKey:"Chave de API Global"},message:{invalidServer:"Servidor inválido",invalidCredentials:"Credenciais inválidas"},button:{login:"Conectar",connecting:"Conectando..."}},fce={modal:{title:"Nova Instância"},form:{name:"Nome",integration:{label:"Canal",baileys:"Baileys",whatsapp:"WhatsApp Cloud API",facebook:"Facebook",instagram:"Instagram",evolution:"Evolution"},token:"Token",number:"Número",businessId:"Business ID"},button:{save:"Salvar",saving:"Salvando...",create:"Instância",connecting:"Conectando...",facebook:"Conectar com Facebook",instagram:"Conectar com Instagram",whatsapp:"Conectar com WhatsApp"},dashboard:{subtitle:"Gerencie sua instância",button:{qrcode:{label:"Gerar QR Code",title:"Scaneie o QR Code com o WhatsApp"},pairingCode:{label:"Gerar Código de Pareamento",title:"Faça o pareamento com o WhatsApp"},restart:"Reiniciar",disconnect:"Desconectar",sendMessage:"Enviar mensagem"},alert:"Para conectar, escaneie o QR Code com o WhatsApp",contacts:"Contatos",chats:"Chats",messages:"Mensagens"}},pce={title:"Comportamento",toast:{success:"Comportamento aplicado com sucesso",error:"Ocorreu um erro ao aplicar o comportamento"},form:{rejectCall:{label:"Rejeitar Chamadas",description:"Rejeitar todas as chamadas"},msgCall:{label:"Mensagem de Rejeição de Chamada",description:"Enviar mensagem de rejeição de chamada"},groupsIgnore:{label:"Ignorar Grupos",description:"Ignorar todas as mensagens de grupos"},alwaysOnline:{label:"Sempre Online",description:"Permanecer sempre online"},readMessages:{label:"Visualizar Mensagens",description:"Marcar todas as mensagens como lidas"},syncFullHistory:{label:"Sincronizar Histórico Completo",description:"Sincronizar o histórico completo ao ler o QR Code"},readStatus:{label:"Visualizar Status",description:"Marcar todos os status como visualizados"}},button:{save:"Salvar",saving:"Salvando..."}},hce={title:"Proxy",toast:{success:"Proxy aplicado com sucesso",error:"Ocorreu um erro ao aplicar o proxy"},form:{enabled:{label:"Ativo",description:"Ativar ou desativar o proxy"},protocol:{label:"Protocolo"},host:{label:"Host"},port:{label:"Porta"},username:{label:"Usuário"},password:{label:"Senha"}},button:{save:"Salvar",saving:"Salvando..."}},mce={title:"Webhook",toast:{success:"Webhook aplicado com sucesso",error:"Ocorreu um erro ao aplicar o webhook"},form:{enabled:{label:"Ativo",description:"Ativar ou desativar o webhook"},url:{label:"URL"},byEvents:{label:"Webhook por Eventos",description:"Criar uma rota para cada evento adicionando o nome do evento ao final da URL"},base64:{label:"Webhook Base64",description:"Enviar dados de mídia em base64 no webhook"},events:{label:"Eventos"}},button:{save:"Salvar",saving:"Salvando..."}},gce={title:"WebSocket",toast:{success:"WebSocket aplicado com sucesso",error:"Ocorreu um erro ao aplicar o WebSocket"},form:{enabled:{label:"Ativo",description:"Ativar ou desativar o WebSocket"},events:{label:"Eventos"}},button:{save:"Salvar",saving:"Salvando..."}},vce={title:"RabbitMQ",toast:{success:"RabbitMQ aplicado com sucesso",error:"Ocorreu um erro ao aplicar o RabbitMQ"},form:{enabled:{label:"Ativo",description:"Ativar ou desativar o RabbitMQ"},events:{label:"Eventos"}},button:{save:"Salvar",saving:"Salvando..."}},yce={title:"SQS",toast:{success:"SQS aplicado com sucesso",error:"Ocorreu um erro ao aplicar o SQS"},form:{enabled:{label:"Ativo",description:"Ativar ou desativar o SQS"},events:{label:"Eventos"}},button:{save:"Salvar",saving:"Salvando..."}},xce={title:"Chatwoot",toast:{success:"Chatwoot aplicado com sucesso",error:"Ocorreu um erro ao aplicar o Chatwoot"},form:{enabled:{label:"Ativo",description:"Ativar ou desativar o Chatwoot"},url:{label:"URL do Chatwoot"},accountId:{label:"ID da Conta"},token:{label:"Token"},signMsg:{label:"Assinar Mensagens",description:"Assinar mensagem com o nome de usuário do Chatwoot"},signDelimiter:{label:"Delimitador de Assinatura"},nameInbox:{label:"Nome da Caixa de Entrada"},organization:{label:"Organização"},logo:{label:"Logo"},conversationPending:{label:"Conversação Pendente",description:"Conversas começam como pendentes"},reopenConversation:{label:"Reabrir Conversa",description:"Reabrir a conversa ao receber uma mensagem"},importContacts:{label:"Importar Contatos",description:"Importar contatos da agenda do WhatsApp ao conectar o QR Code"},importMessages:{label:"Importar Mensagens",description:"Importar mensagens do WhatsApp ao conectar o QR Code"},daysLimitImportMessages:{label:"Limite de Dias para Importação de Mensagens"},ignoreJids:{label:"Ignorar JIDs",placeholder:"Adicione JIDs ex: 1234567890@s.whatsapp.net e pressione enter"},autoCreate:{label:"Criação Automática",description:"Criar automaticamente a integração com o Chatwoot ao salvar"}},button:{save:"Salvar",saving:"Salvando..."}},bce={title:"Typebots",sessions:{label:"Sessões",search:"Pesquisar por remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Nome de Exibição",sessionId:"ID da Sessão",status:"Status",actions:{title:"Ações",open:"Abrir",pause:"Pausar",close:"Fechar",delete:"Excluir"},none:"Nada para mostrar"}},defaultSettings:"Configurações Padrão",toast:{defaultSettings:{success:"Configurações padrão aplicadas com sucesso",error:"Ocorreu um erro ao aplicar as configurações padrão"},success:{update:"Typebot atualizado com sucesso",create:"Typebot criado com sucesso",delete:"Typebot excluído com sucesso",status:"Status do Typebot atualizado com sucesso"},error:"Ocorreu um erro ao criar o Typebot"},table:{none:"Nada para mostrar"},form:{title:"Novo Typebot",examples:{keywordFinish:"#FINISH",unknownMessage:"Desculpe, não entendi. Pode tentar novamente?"},enabled:{label:"Ativo"},description:{label:"Descrição"},typebotSettings:{label:"Configurações do Typebot"},url:{label:"URL da API do Typebot"},typebot:{label:"Nome Público do Typebot"},triggerSettings:{label:"Configurações de Gatilho"},triggerType:{label:"Tipo de Gatilho",keyword:"Palavra-chave",all:"Todos",advanced:"Avançado",none:"Nenhum"},triggerOperator:{label:"Operador do Gatilho",contains:"Contém",equals:"Igual",startsWith:"Começa Com",endsWith:"Termina Com",regex:"Regex"},triggerValue:{label:"Gatilho"},triggerConditions:{label:"Condições"},typebotIdFallback:{label:"Fallback do Typebot"},generalSettings:{label:"Configurações Gerais"},expire:{label:"Expirar em minutos"},keywordFinish:{label:"Palavra-chave de Finalização"},delayMessage:{label:"Mensagem de Atraso Padrão"},unknownMessage:{label:"Mensagem Desconhecida"},listeningFromMe:{label:"Ouvindo de mim",description:"Ouvir as mensagens enviadas por mim no bot"},stopBotFromMe:{label:"Parar bot por mim",description:"Pausar o bot quando eu enviar uma mensagem"},keepOpen:{label:"Manter aberto",description:"Manter o bot aberto após o término da conversa"},debounceTime:{label:"Tempo de Debounce"},splitMessages:{label:"Dividir Mensagens",description:"Dividir mensagens longas em várias mensagens"},timePerChar:{label:"Tempo por Caractere"},ignoreJids:{label:"Ignorar JIDs",placeholder:"Adicione JIDs ex: 1234567890@s.whatsapp.net e pressione enter"}},button:{create:"Typebot",save:"Salvar",saving:"Salvando...",update:"Atualizar",defaultSettings:"Configurações Padrão",delete:"Excluir"},modal:{defaultSettings:{title:"Configurações Padrão"}}},wce={title:"OpenAI",sessions:{label:"Sessões",search:"Pesquisar por remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Nome de Exibição",sessionId:"ID da Sessão",status:"Status",actions:{title:"Ações",open:"Abrir",pause:"Pausar",close:"Fechar",delete:"Excluir"},none:"Nada para mostrar"}},credentials:{title:"Credenciais",table:{name:"Nome",apiKey:"Chave de API",actions:{title:"Ações",delete:"Excluir"},none:"Nada para mostrar"}},defaultSettings:"Configurações Padrão",toast:{defaultSettings:{success:"Configurações padrão aplicadas com sucesso",error:"Ocorreu um erro ao aplicar as configurações padrão"},success:{update:"OpenAI atualizado com sucesso",create:"OpenAI criado com sucesso",delete:"OpenAI excluído com sucesso",status:"Status do OpenAI atualizado com sucesso",credentialsCreate:"Credenciais do OpenAI criadas com sucesso",credentialsDelete:"Credenciais do OpenAI excluídas com sucesso"},error:"Ocorreu um erro ao criar o OpenAI"},table:{none:"Nada para mostrar"},form:{title:"Novo OpenAI",examples:{keywordFinish:"#FINISH",unknownMessage:"Desculpe, não entendi. Pode tentar novamente?"},openaiCredsId:{label:"Credenciais do OpenAI"},enabled:{label:"Ativo"},description:{label:"Descrição"},openaiSettings:{label:"Configurações do OpenAI"},botType:{label:"Tipo de Bot",assistant:"Assistente",chatCompletion:"Chat Completion"},assistantId:{label:"ID do Assistente"},functionUrl:{label:"URL da Função"},model:{label:"Modelo de Linguagem"},systemMessages:{label:"Mensagens do Sistema",description:"Enviar mensagens do sistema para o OpenAI"},assistantMessages:{label:"Mensagens do Assistente",description:"Enviar mensagens do assistente para o OpenAI"},userMessages:{label:"Mensagens do Usuário",description:"Enviar mensagens do usuário para o OpenAI"},maxTokens:{label:"Máximo de Tokens"},triggerSettings:{label:"Configurações de Gatilho"},triggerType:{label:"Tipo de Gatilho",keyword:"Palavra-chave",all:"Todos",advanced:"Avançado",none:"Nenhum"},triggerOperator:{label:"Operador do Gatilho",contains:"Contém",equals:"Igual",startsWith:"Começa Com",endsWith:"Termina Com",regex:"Regex"},triggerValue:{label:"Gatilho"},triggerConditions:{label:"Condições"},openaiIdFallback:{label:"Fallback do OpenAI"},generalSettings:{label:"Configurações Gerais"},expire:{label:"Expirar em minutos"},keywordFinish:{label:"Palavra-chave de Finalização"},delayMessage:{label:"Mensagem de Atraso Padrão"},unknownMessage:{label:"Mensagem Desconhecida"},listeningFromMe:{label:"Ouvindo de mim",description:"Ouvir as mensagens enviadas por mim no bot"},stopBotFromMe:{label:"Parar bot por mim",description:"Pausar o bot quando eu enviar uma mensagem"},keepOpen:{label:"Manter aberto",description:"Manter o bot aberto após o término da conversa"},speechToText:{label:"Fala para Texto",description:"Converter mensagens de voz em texto"},debounceTime:{label:"Tempo de Debounce"},splitMessages:{label:"Dividir Mensagens",description:"Dividir mensagens longas em várias mensagens"},timePerChar:{label:"Tempo por Caractere"},ignoreJids:{label:"Ignorar JIDs",placeholder:"Adicione JIDs ex: 1234567890@s.whatsapp.net e pressione enter"}},button:{create:"OpenAI",save:"Salvar",saving:"Salvando...",update:"Atualizar",defaultSettings:"Configurações Padrão",delete:"Excluir",loadModels:"Carregar Modelos",loading:"Carregando..."},modal:{defaultSettings:{title:"Configurações Padrão"}}},Sce={title:"Dify",sessions:{label:"Sessões",search:"Pesquisar por remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Nome de Exibição",sessionId:"ID da Sessão",status:"Status",actions:{title:"Ações",open:"Abrir",pause:"Pausar",close:"Fechar",delete:"Excluir"},none:"Nada para mostrar"}},defaultSettings:"Configurações Padrão",toast:{defaultSettings:{success:"Configurações padrão aplicadas com sucesso",error:"Ocorreu um erro ao aplicar as configurações padrão"},success:{update:"Dify atualizado com sucesso",create:"Dify criado com sucesso",delete:"Dify excluído com sucesso",status:"Status do Dify atualizado com sucesso"},error:"Ocorreu um erro ao criar o Dify"},table:{none:"Nada para mostrar"},form:{title:"Novo Dify",examples:{keywordFinish:"#FINISH",unknownMessage:"Desculpe, não entendi. Pode tentar novamente?"},enabled:{label:"Ativo"},description:{label:"Descrição"},difySettings:{label:"Configurações do Dify"},botType:{label:"Tipo de Bot",chatBot:"Bot de Chat",textGenerator:"Gerador de Texto",agent:"Agente",workflow:"Fluxo de Trabalho"},apiUrl:{label:"URL da API"},apiKey:{label:"Chave de API"},triggerSettings:{label:"Configurações de Gatilho"},triggerType:{label:"Tipo de Gatilho",keyword:"Palavra-chave",all:"Todos",advanced:"Avançado",none:"Nenhum"},triggerOperator:{label:"Operador do Gatilho",contains:"Contém",equals:"Igual",startsWith:"Começa Com",endsWith:"Termina Com",regex:"Regex"},triggerValue:{label:"Gatilho"},triggerConditions:{label:"Condições"},difyIdFallback:{label:"Fallback do Dify"},generalSettings:{label:"Configurações Gerais"},expire:{label:"Expirar em minutos"},keywordFinish:{label:"Palavra-chave de Finalização"},delayMessage:{label:"Mensagem de Atraso Padrão"},unknownMessage:{label:"Mensagem Desconhecida"},listeningFromMe:{label:"Ouvindo de mim",description:"Ouvir as mensagens enviadas por mim no bot"},stopBotFromMe:{label:"Parar bot por mim",description:"Pausar o bot quando eu enviar uma mensagem"},keepOpen:{label:"Manter aberto",description:"Manter o bot aberto após o término da conversa"},debounceTime:{label:"Tempo de Debounce"},splitMessages:{label:"Dividir Mensagens",description:"Dividir mensagens longas em várias mensagens"},timePerChar:{label:"Tempo por Caractere"},ignoreJids:{label:"Ignorar JIDs",placeholder:"Adicione JIDs ex: 1234567890@s.whatsapp.net e pressione enter"}},button:{create:"Dify",save:"Salvar",saving:"Salvando...",update:"Atualizar",defaultSettings:"Configurações Padrão",delete:"Excluir"},modal:{defaultSettings:{title:"Configurações Padrão"}}},Cce={title:"n8n",sessions:{label:"Sessões",search:"Buscar por remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Push Name",sessionId:"Session ID",status:"Status",actions:{title:"Ações",open:"Abrir",pause:"Pausar",close:"Fechar",delete:"Excluir"},none:"Nada para mostrar"}},defaultSettings:"Configurações Padrão",toast:{defaultSettings:{success:"Configurações padrão aplicadas com sucesso",error:"Ocorreu um erro ao aplicar as configurações padrão"},success:{update:"n8n atualizado com sucesso",create:"n8n criado com sucesso",delete:"n8n excluído com sucesso",status:"Status do n8n atualizado com sucesso"},error:"Ocorreu um erro ao criar o chatbot n8n"},table:{none:"Nada para mostrar"},form:{title:"Novo chatbot n8n",examples:{keywordFinish:"#FINISH",unknownMessage:"Desculpe, não entendi. Pode tentar novamente?"},enabled:{label:"Ativado"},description:{label:"Descrição"},n8nSettings:{label:"Configurações do n8n"},webhookUrl:{label:"URL do Webhook"},basicAuth:{label:"Basic Auth (Opcional)"},basicAuthUser:{label:"Basic Auth User"},basicAuthPass:{label:"Basic Auth Password"},triggerSettings:{label:"Configurações do Gatilho"},triggerType:{label:"Tipo de Gatilho",keyword:"Palavra-chave",all:"Todos",advanced:"Avançado",none:"Nenhum"},triggerOperator:{label:"Operador do Gatilho",contains:"Contém",equals:"Igual",startsWith:"Começa Com",endsWith:"Termina Com",regex:"Regex"},triggerValue:{label:"Gatilho"},triggerConditions:{label:"Condições"},n8nIdFallback:{label:"Fallback do n8n"},generalSettings:{label:"Configurações Gerais"},expire:{label:"Expirar em minutos"},keywordFinish:{label:"Palavra-chave de Finalização"},delayMessage:{label:"Mensagem de Atraso Padrão"},unknownMessage:{label:"Mensagem Desconhecida"},listeningFromMe:{label:"Ouvir de mim",description:"Ouvir mensagens enviadas por mim no bot"},stopBotFromMe:{label:"Parar bot de mim",description:"Pausar o bot quando eu enviar uma mensagem"},keepOpen:{label:"Manter aberto",description:"Manter o bot aberto após o fim da conversa"},debounceTime:{label:"Tempo de Debounce"},splitMessages:{label:"Dividir Mensagens",description:"Dividir mensagens em múltiplas mensagens"},timePerChar:{label:"Tempo por caractere"},ignoreJids:{label:"Ignorar JIDs",placeholder:"Adicionar JIDs ex: 1234567890@s.whatsapp.net e pressione enter"}},button:{create:"n8n",save:"Salvar",saving:"Salvando...",update:"Atualizar",defaultSettings:"Configurações Padrão",delete:"Excluir"},modal:{defaultSettings:{title:"Configurações Padrão"}}},jce={title:"EvoAI",sessions:{label:"Sessões",search:"Buscar por remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Push Name",sessionId:"Session ID",status:"Status",actions:{title:"Ações",open:"Abrir",pause:"Pausar",close:"Fechar",delete:"Excluir"},none:"Nada para mostrar"}},defaultSettings:"Configurações Padrão",toast:{defaultSettings:{success:"Configurações padrão aplicadas com sucesso",error:"Ocorreu um erro ao aplicar as configurações padrão"},success:{update:"EvoAI atualizado com sucesso",create:"EvoAI criado com sucesso",delete:"EvoAI excluído com sucesso",status:"Status do EvoAI atualizado com sucesso"},error:"Ocorreu um erro ao criar o chatbot EvoAI"},table:{none:"Nada para mostrar"},form:{title:"Novo chatbot EvoAI",examples:{keywordFinish:"#FINISH",unknownMessage:"Desculpe, não entendi. Pode tentar novamente?"},enabled:{label:"Ativado"},description:{label:"Descrição"},evoaiSettings:{label:"Configurações do EvoAI"},agentUrl:{label:"URL do Agente"},apiKey:{label:"API Key (Opcional)"},triggerSettings:{label:"Configurações do Gatilho"},triggerType:{label:"Tipo de Gatilho",keyword:"Palavra-chave",all:"Todos",advanced:"Avançado",none:"Nenhum"},triggerOperator:{label:"Operador do Gatilho",contains:"Contém",equals:"Igual",startsWith:"Começa Com",endsWith:"Termina Com",regex:"Regex"},triggerValue:{label:"Gatilho"},triggerConditions:{label:"Condições"},evoaiIdFallback:{label:"Fallback do EvoAI"},generalSettings:{label:"Configurações Gerais"},expire:{label:"Expirar em minutos"},keywordFinish:{label:"Palavra-chave de Finalização"},delayMessage:{label:"Mensagem de Atraso Padrão"},unknownMessage:{label:"Mensagem Desconhecida"},listeningFromMe:{label:"Ouvir de mim",description:"Ouvir mensagens enviadas por mim no bot"},stopBotFromMe:{label:"Parar bot de mim",description:"Pausar o bot quando eu enviar uma mensagem"},keepOpen:{label:"Manter aberto",description:"Manter o bot aberto após o fim da conversa"},debounceTime:{label:"Tempo de Debounce"},splitMessages:{label:"Dividir Mensagens",description:"Dividir mensagens em múltiplas mensagens"},timePerChar:{label:"Tempo por caractere"},ignoreJids:{label:"Ignorar JIDs",placeholder:"Adicionar JIDs ex: 1234567890@s.whatsapp.net e pressione enter"}},button:{create:"EvoAI",save:"Salvar",saving:"Salvando...",update:"Atualizar",defaultSettings:"Configurações Padrão",delete:"Excluir"},modal:{defaultSettings:{title:"Configurações Padrão"}}},kce={title:"Bot Evolution",sessions:{label:"Sessões",search:"Pesquisar por remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Nome de Exibição",sessionId:"ID da Sessão",status:"Status",actions:{title:"Ações",open:"Abrir",pause:"Pausar",close:"Fechar",delete:"Excluir"},none:"Nada para mostrar"}},defaultSettings:"Configurações Padrão",toast:{defaultSettings:{success:"Configurações padrão aplicadas com sucesso",error:"Ocorreu um erro ao aplicar as configurações padrão"},success:{update:"Bot Evolution atualizado com sucesso",create:"Bot Evolution criado com sucesso",delete:"Bot Evolution excluído com sucesso",status:"Status do Bot Evolution atualizado com sucesso"},error:"Ocorreu um erro ao criar o Bot Evolution"},table:{none:"Nada para mostrar"},form:{title:"Novo Bot Evolution",examples:{keywordFinish:"#FINISH",unknownMessage:"Desculpe, não entendi. Pode tentar novamente?"},enabled:{label:"Ativo"},description:{label:"Descrição"},evolutionBotSettings:{label:"Configurações do Bot Evolution"},apiUrl:{label:"URL da API"},apiKey:{label:"Chave de API"},triggerSettings:{label:"Configurações de Gatilho"},triggerType:{label:"Tipo de Gatilho",keyword:"Palavra-chave",all:"Todos",advanced:"Avançado",none:"Nenhum"},triggerOperator:{label:"Operador do Gatilho",contains:"Contém",equals:"Igual",startsWith:"Começa Com",endsWith:"Termina Com",regex:"Regex"},triggerValue:{label:"Gatilho"},triggerConditions:{label:"Condições"},botIdFallback:{label:"Fallback do Bot Evolution"},generalSettings:{label:"Configurações Gerais"},expire:{label:"Expirar em minutos"},keywordFinish:{label:"Palavra-chave de Finalização"},delayMessage:{label:"Mensagem de Atraso Padrão"},unknownMessage:{label:"Mensagem Desconhecida"},listeningFromMe:{label:"Ouvindo de mim",description:"Ouvir as mensagens enviadas por mim no bot"},stopBotFromMe:{label:"Parar bot por mim",description:"Pausar o bot quando eu enviar uma mensagem"},keepOpen:{label:"Manter aberto",description:"Manter o bot aberto após o término da conversa"},debounceTime:{label:"Tempo de Debounce"},splitMessages:{label:"Dividir Mensagens",description:"Dividir mensagens longas em várias mensagens"},timePerChar:{label:"Tempo por Caractere"},ignoreJids:{label:"Ignorar JIDs",placeholder:"Adicione JIDs ex: 1234567890@s.whatsapp.net e pressione enter"}},button:{create:"Bot Evolution",save:"Salvar",saving:"Salvando...",update:"Atualizar",defaultSettings:"Configurações Padrão",delete:"Excluir"},modal:{defaultSettings:{title:"Configurações Padrão"}}},Ece={title:"Flowise",sessions:{label:"Sessões",search:"Pesquisar por remoteJid...",table:{remoteJid:"RemoteJid",pushName:"Nome de Exibição",sessionId:"ID da Sessão",status:"Status",actions:{title:"Ações",open:"Abrir",pause:"Pausar",close:"Fechar",delete:"Excluir"},none:"Nada para mostrar"}},defaultSettings:"Configurações Padrão",toast:{defaultSettings:{success:"Configurações padrão aplicadas com sucesso",error:"Ocorreu um erro ao aplicar as configurações padrão"},success:{update:"Flowise atualizado com sucesso",create:"Flowise criado com sucesso",delete:"Flowise excluído com sucesso",status:"Status do Flowise atualizado com sucesso"},error:"Ocorreu um erro ao criar o Flowise"},table:{none:"Nada para mostrar"},form:{title:"Novo Flowise",examples:{keywordFinish:"#FINISH",unknownMessage:"Desculpe, não entendi. Pode tentar novamente?"},enabled:{label:"Ativo"},description:{label:"Descrição"},flowiseSettings:{label:"Configurações do Flowise"},apiUrl:{label:"URL da API"},apiKey:{label:"Chave de API"},triggerSettings:{label:"Configurações de Gatilho"},triggerType:{label:"Tipo de Gatilho",keyword:"Palavra-chave",all:"Todos",advanced:"Avançado",none:"Nenhum"},triggerOperator:{label:"Operador do Gatilho",contains:"Contém",equals:"Igual",startsWith:"Começa Com",endsWith:"Termina Com",regex:"Regex"},triggerValue:{label:"Gatilho"},triggerConditions:{label:"Condições"},flowiseIdFallback:{label:"Fallback do Flowise"},generalSettings:{label:"Configurações Gerais"},expire:{label:"Expirar em minutos"},keywordFinish:{label:"Palavra-chave de Finalização"},delayMessage:{label:"Mensagem de Atraso Padrão"},unknownMessage:{label:"Mensagem Desconhecida"},listeningFromMe:{label:"Ouvindo de mim",description:"Ouvir as mensagens enviadas por mim no bot"},stopBotFromMe:{label:"Parar bot por mim",description:"Pausar o bot quando eu enviar uma mensagem"},keepOpen:{label:"Manter aberto",description:"Manter o bot aberto após o término da conversa"},debounceTime:{label:"Tempo de Debounce"},splitMessages:{label:"Dividir Mensagens",description:"Dividir mensagens longas em várias mensagens"},timePerChar:{label:"Tempo por Caractere"},ignoreJids:{label:"Ignorar JIDs",placeholder:"Adicione JIDs ex: 1234567890@s.whatsapp.net e pressione enter"}},button:{create:"Flowise",save:"Salvar",saving:"Salvando...",update:"Atualizar",defaultSettings:"Configurações Padrão",delete:"Excluir"},modal:{defaultSettings:{title:"Configurações Padrão"}}},Nce={search:"Buscar conversas...",back:"Voltar",tabs:{contacts:"Contatos",groups:"Grupos"},count_one:"{{count}} conversa",count_other:"{{count}} conversas",empty:{default:"Nenhuma conversa ainda",search:"Nenhuma conversa encontrada",tryAnother:"Tente outro termo",selectTitle:"Selecione uma conversa",selectDescription:"Escolha um contato ou grupo na lista ao lado para começar"},input:{placeholder:"Digite uma mensagem...",send:"Enviar"},date:{today:"Hoje",yesterday:"Ontem"}},Tce={search:"Buscar..."},Mce={title:"Enviar Mensagem",description:"Envie uma mensagem de texto a partir da instância",validation:{numberRequired:"Número é obrigatório",messageRequired:"Mensagem é obrigatória"},form:{number:{label:"Número (com DDI)"},message:{label:"Mensagem",placeholder:"Digite sua mensagem..."}},button:{send:"Enviar",sending:"Enviando..."},toast:{success:"Mensagem enviada com sucesso",error:"Erro ao enviar mensagem",noToken:"Token da instância não disponível"}},_ce={title:"Conectar via QR Code",description:"Escaneie o QR Code para conectar a instância",generating:"Gerando QR Code...",waiting:"Aguardando QR Code...",connected:{title:"Instância conectada",description:"A instância {{instanceName}} já está conectada",connectedAs:"Conectado como"},pairingCode:{title:"Conectar por código de pareamento",label:"Código de pareamento",generate:"Gerar código",generating:"Gerando...",hint:"Informe o número com DDI (ex: 5511999999999) para receber um código de pareamento"},howTo:{title:"Como conectar:",step1:"Abra o WhatsApp no seu celular",step2:"Toque em Menu ou Configurações",step3:"Selecione Aparelhos conectados",step4:"Toque em Conectar um aparelho",step5:"Aponte a câmera para o QR Code"},button:{refresh:"Atualizar QR Code",refreshing:"Atualizando...",close:"Fechar"},toast:{pairingSuccess:"Código de pareamento gerado",pairingError:"Erro ao gerar código de pareamento",refreshSuccess:"QR Code atualizado",refreshError:"Erro ao atualizar QR Code"}},Pce={title:"Nova Instância",description:"Crie uma nova instância para conectar ao WhatsApp",validation:{nameMin:"O nome deve ter pelo menos 3 caracteres",nameMax:"O nome deve ter no máximo 50 caracteres",nameFormat:"O nome pode conter apenas letras, números, hífen e underline"},form:{name:{label:"Nome da Instância",placeholder:"minha-instancia",hint:"Use letras, números, hífen (-) ou underline (_)"},token:{label:"Token (opcional)",placeholder:"Deixe em branco para gerar automaticamente",hint:"Se não informado, um UUID será gerado automaticamente"}},proxy:{title:"Configurar Proxy (opcional)",host:{label:"Host",placeholder:"proxy.exemplo.com"},port:{label:"Porta"},username:{label:"Usuário",placeholder:"usuario"},password:{label:"Senha",placeholder:"••••••••"}},button:{create:"Criar Instância",creating:"Criando..."}},Rce={loading:"Carregando...",noResults:"Nenhum resultado encontrado!"},Ice={dashboard:ece,button:tce,testInteractive:nce,sessions:rce,modal:sce,status:ace,footer:oce,header:ice,sidebar:lce,toast:cce,license:uce,login:dce,instance:fce,settings:pce,proxy:hce,webhook:mce,websocket:gce,rabbitmq:vce,sqs:yce,chatwoot:xce,typebot:bce,openai:wce,dify:Sce,n8n:Cce,evoai:jce,evolutionBot:kce,flowise:Ece,chat:Nce,common:Tce,sendMessage:Mce,qrCode:_ce,newInstance:Pce,table:Rce};xr.use(h2).init({resources:{"en-US":{translation:$ie},"pt-BR":{translation:Ice},"es-ES":{translation:xle},"fr-FR":{translation:Xle}},lng:localStorage.getItem("i18nextLng")||"en-US",fallbackLng:"en-US",interpolation:{escapeValue:!1}});n2.createRoot(document.getElementById("root")).render(s.jsxs(ke.StrictMode,{children:[s.jsx(y2,{i18n:xr,children:s.jsx(p4,{defaultTheme:"dark",storageKey:"vite-ui-theme",children:s.jsx(aN,{client:uT,children:s.jsx(WF,{router:Doe})})})}),s.jsx(d4,{theme:"colored"})]}))});export default Oce(); diff --git a/manager/dist/index.html b/manager/dist/index.html index 2175b704b8..5cc9660ac2 100644 --- a/manager/dist/index.html +++ b/manager/dist/index.html @@ -1,14 +1,14 @@ - - - - - - - Evolution Manager - - - - -
- - + + + + + + + Evolution Manager + + + + +
+ + diff --git a/package-lock.json b/package-lock.json index 32990edbd8..7398391d27 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "evolution-api", - "version": "5.2.0", + "version": "5.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "evolution-api", - "version": "5.2.0", + "version": "5.3.0", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index bde7d15bd6..c72384b30a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "evolution-api", - "version": "5.2.0", + "version": "5.3.0", "description": "Rest api for communication with WhatsApp", "main": "./dist/main.js", "type": "commonjs", @@ -37,7 +37,8 @@ "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\"", "prepare": "husky", - "test:settings-templates": "tsx ./test/settings-template-hierarchy.test.ts" + "test:settings-templates": "tsx ./test/settings-template-hierarchy.test.ts", + "test:review-surfaces": "tsx ./test/review-surfaces.test.ts" }, "repository": { "type": "git", @@ -69,12 +70,8 @@ }, "homepage": "https://github.com/EvolutionAPI/evolution-api#readme", "lint-staged": { - "src/**/*.{ts,js}": [ - "eslint --fix" - ], - "src/**/*.ts": [ - "sh -c 'tsc --noEmit'" - ] + "src/**/*.{ts,js}": ["eslint --fix"], + "src/**/*.ts": ["sh -c 'tsc --noEmit'"] }, "config": { "commitizen": { diff --git a/scripts/audit-archive-contract.mjs b/scripts/audit-archive-contract.mjs index a8d035b363..a49ddf816b 100644 --- a/scripts/audit-archive-contract.mjs +++ b/scripts/audit-archive-contract.mjs @@ -29,11 +29,28 @@ const operations = [ ]; for (const [method, route, documented] of operations) { - if (!router.includes(`.${method}('${route}'`)) throw new Error(`Archive router is missing ${method.toUpperCase()} ${route}`); - if (!openapi.paths?.[documented]?.[method]) throw new Error(`OpenAPI is missing ${method.toUpperCase()} ${documented}`); + if (!router.includes(`.${method}('${route}'`)) + throw new Error(`Archive router is missing ${method.toUpperCase()} ${route}`); + if (!openapi.paths?.[documented]?.[method]) + throw new Error(`OpenAPI is missing ${method.toUpperCase()} ${documented}`); if (!guide.includes(documented)) throw new Error(`Archive guide is missing ${documented}`); } -for (const schema of ['ArchiveStatus', 'ArchiveEvent', 'ArchiveMedia', 'ArchiveMessageHistory', 'ArchiveReceipt', 'ArchiveReaction', 'ArchiveMembership', 'ArchiveCall', 'ArchiveSyncGap', 'ArchivePolicyInput', 'ArchivePolicy', 'ArchivePurgeCriteria', 'ArchivePurgePreview', 'ArchiveTombstone']) { +for (const schema of [ + 'ArchiveStatus', + 'ArchiveEvent', + 'ArchiveMedia', + 'ArchiveMessageHistory', + 'ArchiveReceipt', + 'ArchiveReaction', + 'ArchiveMembership', + 'ArchiveCall', + 'ArchiveSyncGap', + 'ArchivePolicyInput', + 'ArchivePolicy', + 'ArchivePurgeCriteria', + 'ArchivePurgePreview', + 'ArchiveTombstone', +]) { if (!openapi.components?.['x-archive-schemas']?.[schema]) throw new Error(`OpenAPI is missing ${schema}`); } console.log(`Audited ${operations.length} archive operations and their response contracts successfully.`); diff --git a/scripts/audit-baileys-contract.mjs b/scripts/audit-baileys-contract.mjs index fcf5f11836..9443f49b90 100644 --- a/scripts/audit-baileys-contract.mjs +++ b/scripts/audit-baileys-contract.mjs @@ -14,7 +14,8 @@ for (const method of methods) { continue; } const operation = route[1].post; - if (!operation.description || /^Run (the )?/i.test(operation.description)) failures.push(`${method}: weak description`); + if (!operation.description || /^Run (the )?/i.test(operation.description)) + failures.push(`${method}: weak description`); const resultSchema = operation.responses?.[200]?.content?.['application/json']?.schema?.properties?.result; if (!resultSchema || Object.keys(resultSchema).length === 0) failures.push(`${method}: response schema missing`); const group = route[0].split('/')[2]; diff --git a/scripts/audit-chat-openapi.mjs b/scripts/audit-chat-openapi.mjs new file mode 100644 index 0000000000..bb8ed7143e --- /dev/null +++ b/scripts/audit-chat-openapi.mjs @@ -0,0 +1,19 @@ +import fs from 'node:fs'; +const routes = JSON.parse(fs.readFileSync('docs/runtime-routes.json', 'utf8')); +const chat = routes.filter((route) => route.path.startsWith('/chat/')); +const failures = []; +for (const route of chat) { + const operation = route.operation; + if (!operation.operationId || !operation.summary) failures.push(`${route.method} ${route.path}: missing identity`); + if (['post', 'put', 'patch'].includes(route.method) && !operation.requestBody) + failures.push(`${route.method} ${route.path}: missing body`); + if (route.schema && route.method !== 'get') { + const documented = Object.values(operation.requestBody?.content ?? {})[0]?.schema?.properties ?? {}; + for (const key of Object.keys(route.schema.properties ?? {})) + if (!documented[key]) failures.push(`${route.method} ${route.path}: missing ${key}`); + } + const success = Object.keys(operation.responses ?? {}).find((code) => code.startsWith('2')); + if (!success) failures.push(`${route.method} ${route.path}: missing success response`); +} +if (failures.length) throw new Error(`Chat OpenAPI failures (${failures.length}):\n${failures.join('\n')}`); +console.log(`Audited ${chat.length} chat operations against runtime schemas successfully.`); diff --git a/scripts/audit-live-read-methods.mjs b/scripts/audit-live-read-methods.mjs index fc4965a0c6..f277a6ff20 100644 --- a/scripts/audit-live-read-methods.mjs +++ b/scripts/audit-live-read-methods.mjs @@ -32,7 +32,10 @@ const compactGroups = await request(`/baileys/groups/groupFetchAllParticipating/ }); const groups = Object.values(compactGroups.value.result ?? {}); assert.ok(groups.length > 0, 'Connected account returned no participating groups'); -assert.ok(groups.every((group) => !('participants' in group)), 'Compact group response contains participants'); +assert.ok( + groups.every((group) => !('participants' in group)), + 'Compact group response contains participants', +); const regular = groups.find((group) => !group.isCommunity && !group.isCommunityAnnounce && !group.linkedParent); assert.ok(regular?.id, 'No regular group was available for the read audit'); @@ -64,7 +67,11 @@ if (community?.id) { ); } -const legacyGroups = await request(`/group/fetchAllGroups/${instance}?getParticipants=false&live=true`, undefined, 'GET'); +const legacyGroups = await request( + `/group/fetchAllGroups/${instance}?getParticipants=false&live=true`, + undefined, + 'GET', +); assert.ok(Array.isArray(legacyGroups.value) && legacyGroups.value.length > 0); assert.ok(legacyGroups.value.every((group) => !('participants' in group))); diff --git a/scripts/audit-runtime-openapi.mjs b/scripts/audit-runtime-openapi.mjs index 12ac50e572..b06a068d08 100644 --- a/scripts/audit-runtime-openapi.mjs +++ b/scripts/audit-runtime-openapi.mjs @@ -5,7 +5,14 @@ const base = YAML.parse(fs.readFileSync('docs/openapi.yaml', 'utf8'), { maxAlias const paths = structuredClone(base.paths ?? {}); for (const route of routes) { paths[route.path] ??= {}; - paths[route.path][route.method] ??= route.operation; + const existing = paths[route.path][route.method] ?? {}; + paths[route.path][route.method] = { + ...route.operation, + ...existing, + parameters: route.operation.parameters, + ...(route.operation.requestBody ? { requestBody: route.operation.requestBody } : {}), + responses: route.operation.responses, + }; } const missing = routes.filter(({ method, path }) => !paths[path]?.[method]); if (missing.length) throw new Error(`Merged OpenAPI is missing ${missing.length} runtime operations.`); @@ -36,3 +43,51 @@ const duplicateIds = generatedIds.filter((id, index) => generatedIds.indexOf(id) if (duplicateIds.length) bad.push(`duplicate operationIds: ${[...new Set(duplicateIds)].join(', ')}`); if (bad.length) throw new Error(`Runtime OpenAPI convention failures (${bad.length}):\n${bad.join('\n')}`); console.log(`Audited ${routes.length} runtime operations and presentation conventions successfully.`); + +const exactRoutes = routes.filter( + (item) => item.schema && !(item.method === 'get' && item.schemaName === 'instanceSchema'), +); +const contractFailures = []; +for (const route of exactRoutes) { + const operation = paths[route.path][route.method]; + const documented = + route.method === 'get' + ? Object.fromEntries( + (operation.parameters ?? []) + .filter((parameter) => parameter.in === 'query') + .map((parameter) => [parameter.name, parameter.schema]), + ) + : (Object.values(operation.requestBody?.content ?? {})[0]?.schema?.properties ?? {}); + const expected = route.schema.properties ?? {}; + for (const key of Object.keys(expected)) + if (!documented[key]) contractFailures.push(`${route.method} ${route.path}: missing validator field ${key}`); + const unexpected = Object.keys(documented).filter((key) => key !== 'file' && !(key in expected)); + for (const key of unexpected) + contractFailures.push(`${route.method} ${route.path}: undocumented runtime field ${key}`); + const required = + route.method === 'get' + ? (operation.parameters ?? []) + .filter((parameter) => parameter.in === 'query' && parameter.required) + .map((parameter) => parameter.name) + : (Object.values(operation.requestBody?.content ?? {})[0]?.schema?.required ?? []); + for (const key of route.schema.required ?? []) + if (!required.includes(key)) contractFailures.push(`${route.method} ${route.path}: missing required field ${key}`); + for (const key of required) + if (!(route.schema.required ?? []).includes(key) && key !== 'file') + contractFailures.push(`${route.method} ${route.path}: incorrectly required field ${key}`); +} +for (const route of routes) { + const operation = paths[route.path][route.method]; + if (['post', 'put', 'patch'].includes(route.method) && !operation.requestBody) + contractFailures.push(`${route.method} ${route.path}: missing exact request body`); + for (const code of ['400', '401', '404', '422', '429', '500']) + if (!operation.responses?.[code]?.content) + contractFailures.push(`${route.method} ${route.path}: missing ${code} error schema/example`); + const success = Object.entries(operation.responses ?? {}).find(([code]) => code.startsWith('2'))?.[1]; + if (!success?.content) contractFailures.push(`${route.method} ${route.path}: missing success schema/example`); +} +if (contractFailures.length) + throw new Error(`Runtime contract failures (${contractFailures.length}):\n${contractFailures.join('\n')}`); +console.log( + `Audited exact validator fields for ${exactRoutes.length} runtime operations and response/error contracts for ${routes.length}.`, +); diff --git a/scripts/audit-webhook-docs.mjs b/scripts/audit-webhook-docs.mjs index 16ff194798..b58ab5fc99 100644 --- a/scripts/audit-webhook-docs.mjs +++ b/scripts/audit-webhook-docs.mjs @@ -4,7 +4,10 @@ import path from 'node:path'; import YAML from 'yaml'; const repoRoot = path.resolve(import.meta.dirname, '..'); -const controllerSource = fs.readFileSync(path.join(repoRoot, 'src', 'api', 'integrations', 'event', 'event.controller.ts'), 'utf8'); +const controllerSource = fs.readFileSync( + path.join(repoRoot, 'src', 'api', 'integrations', 'event', 'event.controller.ts'), + 'utf8', +); const enumSource = fs.readFileSync(path.join(repoRoot, 'src', 'api', 'types', 'wa.types.ts'), 'utf8'); const spec = YAML.parse(fs.readFileSync(path.join(repoRoot, 'docs', 'asyncapi.yaml'), 'utf8')); const html = fs.readFileSync(path.join(repoRoot, 'docs', 'webhooks', 'index.html'), 'utf8'); @@ -13,14 +16,18 @@ const configuredBlock = controllerSource.match(/public static readonly events = if (!configuredBlock) throw new Error('Could not find EventController.events.'); const configuredEvents = [...configuredBlock[1].matchAll(/'([A-Z0-9_]+)'/g)].map((match) => match[1]); -const wireEvents = new Map([...enumSource.matchAll(/^\s+([A-Z0-9_]+) = '([^']+)'/gm)].map((match) => [match[1], match[2]])); +const wireEvents = new Map( + [...enumSource.matchAll(/^\s+([A-Z0-9_]+) = '([^']+)'/gm)].map((match) => [match[1], match[2]]), +); const documentedEvents = Object.keys(spec.components?.messages ?? {}); const difference = (left, right) => left.filter((value) => !right.includes(value)); const missing = difference(configuredEvents, documentedEvents); const stale = difference(documentedEvents, configuredEvents); if (missing.length || stale.length) { - throw new Error(`Webhook documentation event mismatch. Missing: ${missing.join(', ') || 'none'}. Stale: ${stale.join(', ') || 'none'}.`); + throw new Error( + `Webhook documentation event mismatch. Missing: ${missing.join(', ') || 'none'}. Stale: ${stale.join(', ') || 'none'}.`, + ); } for (const eventName of configuredEvents) { @@ -33,7 +40,8 @@ for (const eventName of configuredEvents) { if (message?.name !== wireName) throw new Error(`${eventName} documents ${message?.name}, expected ${wireName}.`); if (!message?.payload?.$ref) throw new Error(`${eventName} has no payload schema.`); if (!message?.examples?.length) throw new Error(`${eventName} has no payload example.`); - if (!html.includes(wireName)) throw new Error(`Generated HTML does not contain ${wireName}; regenerate docs/webhooks.`); + if (!html.includes(wireName)) + throw new Error(`Generated HTML does not contain ${wireName}; regenerate docs/webhooks.`); } if (!html.includes('Evolution API Webhook Events') || html.length < 100_000) { diff --git a/scripts/export-validation-schemas.ts b/scripts/export-validation-schemas.ts new file mode 100644 index 0000000000..761502ee98 --- /dev/null +++ b/scripts/export-validation-schemas.ts @@ -0,0 +1,38 @@ +import fs from 'node:fs'; +import os from 'node:os'; +import path from 'node:path'; +import { pathToFileURL } from 'node:url'; + +async function main() { + const roots = ['src/validate', 'src/api/integrations']; + const files: string[] = []; + const walk = (dir: string) => { + for (const item of fs.readdirSync(dir, { withFileTypes: true })) { + const full = path.join(dir, item.name); + if (item.isDirectory()) walk(full); + else if (item.name.endsWith('.schema.ts')) files.push(full); + } + }; + for (const root of roots) walk(root); + const clean = (value: any): any => { + if (Array.isArray(value)) return value.map(clean); + if (value && typeof value === 'object') + return Object.fromEntries( + Object.entries(value) + .filter(([key]) => key !== '$id') + .map(([key, val]) => [key, clean(val)]), + ); + return value; + }; + const out: Record = {}; + for (const file of files) { + const mod = await import(pathToFileURL(path.resolve(file)).href); + for (const [name, value] of Object.entries(mod)) + if (name.endsWith('Schema') && value && typeof value === 'object') out[name] = clean(value); + } + fs.writeFileSync(path.join(os.tmpdir(), 'evolution-validation-schemas.json'), JSON.stringify(out)); +} +main().catch((error) => { + console.error(error); + process.exit(1); +}); diff --git a/scripts/generate-baileys-openapi.mjs b/scripts/generate-baileys-openapi.mjs index 6c83c55bca..0beb072a1d 100644 --- a/scripts/generate-baileys-openapi.mjs +++ b/scripts/generate-baileys-openapi.mjs @@ -88,7 +88,10 @@ function describeMethod(method) { [/^(send|relay|issue|read|presence|assert|generate)/, 'Send or apply'], ]; const match = actions.find(([pattern]) => pattern.test(concise)); - const subject = readable.replace(/^(fetch|get|extract|create|add|update|set|modify|remove|delete|clean|send|relay|issue) /, ''); + const subject = readable.replace( + /^(fetch|get|extract|create|add|update|set|modify|remove|delete|clean|send|relay|issue) /, + '', + ); if (match) return `${match[1]} ${subject} using the connected WhatsApp account and return the server result.`; return `Execute the ${readable} WhatsApp capability and return its typed result.`; } @@ -619,7 +622,8 @@ const instanceSettingsSchema = { type: ['integer', 'null'], minimum: 0, maximum: 2592000, - description: 'Instance default lifetime of local read-through snapshots in seconds; null uses environment defaults.', + description: + 'Instance default lifetime of local read-through snapshots in seconds; null uses environment defaults.', }, localReadTtlOverrides: { type: ['object', 'null'], @@ -636,7 +640,12 @@ paths['/settings/find/{instanceName}'] = { summary: 'Get instance behavior and local-read TTL settings', operationId: 'findInstanceSettings', parameters: [instanceParameter], - responses: { 200: { description: 'Persisted instance settings.', content: { 'application/json': { schema: instanceSettingsSchema } } } }, + responses: { + 200: { + description: 'Persisted instance settings.', + content: { 'application/json': { schema: instanceSettingsSchema } }, + }, + }, }, }; paths['/settings/set/{instanceName}'] = { @@ -668,11 +677,13 @@ const operationalMessageSchema = { id: { type: 'string', description: 'Evolution database row ID. Do not use it as the WhatsApp message identity.' }, waMessageId: { type: ['string', 'null'], - description: 'Stable WhatsApp message ID, unique within the instance. Null is possible only for ambiguous legacy rows.', + description: + 'Stable WhatsApp message ID, unique within the instance. Null is possible only for ambiguous legacy rows.', }, key: { type: 'object', - description: 'Original Baileys message key. Existing integrations may continue reading id, remoteJid, remoteJidAlt, fromMe, and participant here.', + description: + 'Original Baileys message key. Existing integrations may continue reading id, remoteJid, remoteJidAlt, fromMe, and participant here.', additionalProperties: true, }, remoteJid: { type: ['string', 'null'], description: 'First observed chat JID for the canonical message.' }, @@ -741,7 +752,10 @@ paths['/chat/findMessages/{instanceName}'] = { messageType: { type: 'string' }, messageTimestamp: { type: 'object', - properties: { gte: { type: 'string', format: 'date-time' }, lte: { type: 'string', format: 'date-time' } }, + properties: { + gte: { type: 'string', format: 'date-time' }, + lte: { type: 'string', format: 'date-time' }, + }, additionalProperties: false, }, key: { @@ -917,7 +931,10 @@ fs.writeFileSync(openApiPath, YAML.stringify(document, { lineWidth: 0 })); const docsDirectory = path.join(root, 'docs/baileys'); fs.mkdirSync(docsDirectory, { recursive: true }); -const mdEscape = (value) => String(value ?? '').replaceAll('|', '\\|').replaceAll('\n', ' '); +const mdEscape = (value) => + String(value ?? '') + .replaceAll('|', '\\|') + .replaceAll('\n', ' '); const renderSchema = (schema) => `\`\`\`json\n${JSON.stringify(schema, null, 2)}\n\`\`\``; const indexLines = [ '# Baileys method contracts', diff --git a/scripts/generate-runtime-openapi.mjs b/scripts/generate-runtime-openapi.mjs index 25c09df8d8..02492eaa7e 100644 --- a/scripts/generate-runtime-openapi.mjs +++ b/scripts/generate-runtime-openapi.mjs @@ -1,5 +1,16 @@ import fs from 'node:fs'; +import { execFileSync } from 'node:child_process'; +import os from 'node:os'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; import { runtimeOperation } from './runtime-openapi-conventions.mjs'; +import { applyOverride } from './runtime-openapi-overrides.mjs'; + +const tsxCli = fileURLToPath(import.meta.resolve('tsx/cli')); +execFileSync(process.execPath, [tsxCli, 'scripts/export-validation-schemas.ts'], { stdio: 'inherit' }); +const validationSchemas = JSON.parse( + fs.readFileSync(path.join(os.tmpdir(), 'evolution-validation-schemas.json'), 'utf8'), +); const routerPrefixes = { 'src/api/routes/instance.router.ts': '/instance', @@ -42,24 +53,47 @@ for (const [file, prefix] of Object.entries(routerPrefixes)) { const brokerRoute = /\.(get|post|put|patch|delete)\(this\.routerPath\('([^']+)'(?:,\s*(false))?\)/g; while ((match = brokerRoute.exec(source))) { const suffix = match[3] ? '' : '/{instanceName}'; - operations.push({ method: match[1], path: openApiPath(`${prefix}/${match[2]}${suffix}`), source: file }); + const nextRoute = source.slice(match.index + match[0].length).search(/\.(?:get|post|put|patch|delete)\(/); + const block = source.slice(match.index, nextRoute < 0 ? undefined : match.index + match[0].length + nextRoute); + const schemaName = block.match(/schema:\s*([A-Za-z0-9_]+)/)?.[1]; + operations.push({ + method: match[1], + path: openApiPath(`${prefix}/${match[2]}${suffix}`), + source: file, + schemaName, + schema: schemaName ? validationSchemas[schemaName] : undefined, + multipart: /upload\.single\(/.test(block), + runtimeStatus: block.match(/status\((?:HttpStatus\.)?([A-Z_]+|\d+)\)/)?.[1], + }); } const directRoute = /\.(get|post|put|patch|delete)\(\s*['`]([^'`]+)['`]/g; while ((match = directRoute.exec(source))) { - operations.push({ method: match[1], path: openApiPath(`${prefix}${match[2]}`), source: file }); + const nextRoute = source.slice(match.index + match[0].length).search(/\.(?:get|post|put|patch|delete)\(/); + const block = source.slice(match.index, nextRoute < 0 ? undefined : match.index + match[0].length + nextRoute); + const schemaName = block.match(/schema:\s*([A-Za-z0-9_]+)/)?.[1]; + operations.push({ + method: match[1], + path: openApiPath(`${prefix}${match[2]}`), + source: file, + schemaName, + schema: schemaName ? validationSchemas[schemaName] : undefined, + multipart: /upload\.single\(/.test(block), + runtimeStatus: block.match(/status\((?:HttpStatus\.)?([A-Z_]+|\d+)\)/)?.[1], + }); } } const unique = [...new Map(operations.map((item) => [`${item.method} ${item.path}`, item])).values()].sort( (left, right) => left.path.localeCompare(right.path) || left.method.localeCompare(right.method), ); const output = `${JSON.stringify( - unique.map((route) => ({ ...route, operation: runtimeOperation(route) })), + unique.map((route) => ({ ...route, operation: applyOverride(route, runtimeOperation(route)) })), null, 2, )}\n`; const target = 'docs/runtime-routes.json'; if (process.argv.includes('--check')) { - if (!fs.existsSync(target) || fs.readFileSync(target, 'utf8') !== output) { + const normalizeEol = (value) => value.replace(/\r\n/g, '\n'); + if (!fs.existsSync(target) || normalizeEol(fs.readFileSync(target, 'utf8')) !== normalizeEol(output)) { throw new Error(`${target} is stale. Run npm run generate:runtime-openapi.`); } } else { diff --git a/scripts/generate-webhook-asyncapi.mjs b/scripts/generate-webhook-asyncapi.mjs index 560d15a29f..0788efa638 100644 --- a/scripts/generate-webhook-asyncapi.mjs +++ b/scripts/generate-webhook-asyncapi.mjs @@ -317,7 +317,8 @@ const schemas = { }, participantDigits: { type: ['string', 'null'], - description: 'Compatibility local part of jid. This is explicitly not a verified phone number when jid is a LID.', + description: + 'Compatibility local part of jid. This is explicitly not a verified phone number when jid is a LID.', }, name: { type: 'string' }, imgUrl: { type: ['string', 'null'], format: 'uri' }, @@ -905,17 +906,19 @@ const events = [ id: '120363000000000000@g.us', participants: ['151672961659093@lid'], action: 'add', - participantsData: [{ - jid: '151672961659093@lid', - lid: '151672961659093@lid', - phoneNumber: '15551234567@s.whatsapp.net', - phoneNumberDigits: '15551234567', - canonicalJid: '15551234567@s.whatsapp.net', - identifierType: 'lid', - identityResolved: true, - participantDigits: '151672961659093', - name: 'Alice', - }], + participantsData: [ + { + jid: '151672961659093@lid', + lid: '151672961659093@lid', + phoneNumber: '15551234567@s.whatsapp.net', + phoneNumberDigits: '15551234567', + canonicalJid: '15551234567@s.whatsapp.net', + identifierType: 'lid', + identityResolved: true, + participantDigits: '151672961659093', + name: 'Alice', + }, + ], }, ), event( diff --git a/scripts/runtime-openapi-conventions.mjs b/scripts/runtime-openapi-conventions.mjs index a325e4f52d..484ef5da1f 100644 --- a/scripts/runtime-openapi-conventions.mjs +++ b/scripts/runtime-openapi-conventions.mjs @@ -36,65 +36,6 @@ const words = (value) => .trim(); const title = (value) => words(value).replace(/\b\w/g, (letter) => letter.toUpperCase()); -const templateSettingsSchema = { - type: 'object', - additionalProperties: false, - properties: { - localReadTtlSeconds: { type: ['integer', 'null'], minimum: 0, maximum: 2592000 }, - localReadTtlOverrides: { - type: ['object', 'null'], - additionalProperties: { type: 'integer', minimum: 0, maximum: 2592000 }, - }, - automationSafety: { type: ['object', 'null'], additionalProperties: true }, - }, -}; -const templateBody = (action) => { - const schemas = { - create: { - required: ['name', 'settings'], - properties: { name: { type: 'string', minLength: 1, maxLength: 255 }, settings: templateSettingsSchema }, - }, - edit: { - required: ['templateId'], - properties: { - templateId: { type: 'string', minLength: 1 }, - name: { type: 'string', minLength: 1, maxLength: 255 }, - settings: templateSettingsSchema, - }, - }, - duplicate: { - required: ['templateId', 'name'], - properties: { - templateId: { type: 'string', minLength: 1 }, - name: { type: 'string', minLength: 1, maxLength: 255 }, - }, - }, - delete: { required: ['templateId'], properties: { templateId: { type: 'string', minLength: 1 } } }, - assign: { - required: ['templateId', 'scope'], - properties: { - templateId: { type: 'string', minLength: 1 }, - scope: { type: 'string', enum: ['instance', 'group', 'contact'] }, - target: { - type: 'string', - minLength: 3, - maxLength: 255, - description: - 'Omit for instance scope. Group targets end in @g.us; contact targets are full non-group WhatsApp identifiers.', - }, - }, - }, - unassign: { - required: ['scope'], - properties: { - scope: { type: 'string', enum: ['instance', 'group', 'contact'] }, - target: { type: 'string', minLength: 3, maxLength: 255 }, - }, - }, - }; - return schemas[action] ? { type: 'object', additionalProperties: false, ...schemas[action] } : null; -}; - const actionVerb = (method, action) => { if (/^(find|fetch|get|list|connection)/i.test(action)) return 'Get'; if (/^(delete|remove|logout|leave|revoke)/i.test(action)) return 'Delete'; @@ -108,7 +49,7 @@ const actionVerb = (method, action) => { ? 'Update' : 'Run'; }; -export const runtimeOperation = ({ method, path, source }) => { +export const runtimeOperation = ({ method, path, source, schemaName, schema, multipart, runtimeStatus }) => { const segments = path.split('/').filter(Boolean); const domain = segments[0] || 'root'; const action = segments.find((s, i) => i > 0 && !s.startsWith('{')) || domain; @@ -121,6 +62,18 @@ export const runtimeOperation = ({ method, path, source }) => { })); const bodyMethods = new Set(['post', 'put', 'patch']); const summary = `${actionVerb(method, action)} ${words(action)}`; + const successCode = + { OK: '200', CREATED: '201', NO_CONTENT: '204' }[runtimeStatus] ?? + (/^2\d\d$/.test(runtimeStatus ?? '') ? runtimeStatus : '200'); + const errorSchema = { + type: 'object', + additionalProperties: true, + properties: { + status: { type: 'integer' }, + error: { type: 'string' }, + message: { oneOf: [{ type: 'string' }, { type: 'array', items: { type: 'string' } }] }, + }, + }; const operation = { tags: [domainNames[domain] || title(domain)], summary, @@ -128,23 +81,129 @@ export const runtimeOperation = ({ method, path, source }) => { operationId: `${method}_${[domain, ...segments.slice(1).filter((x) => !x.startsWith('{'))].join('_').replace(/[^A-Za-z0-9_]/g, '_')}`, parameters: params, responses: { - '200': { description: 'Successful response.' }, - '400': { description: 'Invalid request.' }, - '401': { description: 'Missing or invalid API key.' }, - '404': { description: 'Instance or resource not found.' }, + [successCode]: { + description: + successCode === '201' + ? 'Resource created. See the domain documentation for the operation-specific response fields.' + : 'Successful response. See the domain documentation for the operation-specific response fields.', + content: { + 'application/json': { + schema: { + oneOf: [ + { type: 'object', additionalProperties: true }, + { type: 'array', items: { type: 'object', additionalProperties: true } }, + { type: 'string' }, + ], + }, + }, + }, + }, + '400': { + description: 'Invalid request.', + content: { + 'application/json': { + schema: errorSchema, + example: { status: 400, error: 'Bad Request', message: 'Invalid request.' }, + }, + }, + }, + '401': { + description: 'Missing or invalid API key.', + content: { + 'application/json': { + schema: errorSchema, + example: { status: 401, error: 'Unauthorized', message: 'Missing or invalid API key.' }, + }, + }, + }, + '404': { + description: 'Instance or resource not found.', + content: { + 'application/json': { + schema: errorSchema, + example: { status: 404, error: 'Not Found', message: 'Resource not found.' }, + }, + }, + }, + '422': { + description: 'Request validation failed.', + content: { + 'application/json': { + schema: errorSchema, + example: { status: 422, error: 'Unprocessable Entity', message: ['A required field is missing.'] }, + }, + }, + }, + '429': { + description: 'Request rate limit exceeded.', + content: { + 'application/json': { + schema: errorSchema, + example: { status: 429, error: 'Too Many Requests', message: 'Request rate limit exceeded.' }, + }, + }, + }, + '500': { + description: 'Unexpected server error.', + content: { + 'application/json': { + schema: errorSchema, + example: { status: 500, error: 'Internal Server Error', message: 'Unexpected server error.' }, + }, + }, + }, }, }; - if (method === 'post' && /create|duplicate/i.test(action)) { - operation.responses = { - '201': operation.responses['200'], - ...Object.fromEntries(Object.entries(operation.responses).filter(([k]) => k !== '200')), + if (schema && method === 'get' && schemaName !== 'instanceSchema') { + operation.parameters.push( + ...Object.entries(schema.properties ?? {}).map(([name, property]) => ({ + name, + in: 'query', + required: (schema.required ?? []).includes(name), + schema: property, + })), + ); + } else if (schema && (bodyMethods.has(method) || method === 'delete')) { + const contentType = multipart ? 'multipart/form-data' : 'application/json'; + const requestSchema = multipart + ? { ...schema, properties: { ...(schema.properties ?? {}), file: { type: 'string', format: 'binary' } } } + : schema; + operation.requestBody = { required: true, content: { [contentType]: { schema: requestSchema } } }; + } else if (bodyMethods.has(method) && path === '/webhook/evolution') { + operation.requestBody = { + required: true, + content: { + 'application/json': { + schema: { + type: 'object', + required: ['numberId'], + properties: { numberId: { type: 'string' } }, + additionalProperties: true, + }, + example: { numberId: '15551234567', event: 'messages.upsert', data: {} }, + }, + }, }; - } - if (bodyMethods.has(method)) + } else if (bodyMethods.has(method) && path === '/webhook/meta') { operation.requestBody = { required: true, - content: { 'application/json': { schema: { type: 'object', additionalProperties: true }, example: {} } }, + content: { + 'application/json': { + schema: { + type: 'object', + required: ['object', 'entry'], + properties: { + object: { type: 'string', enum: ['whatsapp_business_account'] }, + entry: { type: 'array', items: { type: 'object', additionalProperties: true } }, + }, + additionalProperties: true, + }, + example: { object: 'whatsapp_business_account', entry: [] }, + }, + }, }; + } + if (schemaName) operation['x-validation-schema'] = schemaName; if (domain === 'settings-template') { const templateSummaries = { assign: 'Assign a settings template', @@ -163,40 +222,6 @@ export const runtimeOperation = ({ method, path, source }) => { : action === 'bindings' ? 'List the instance default and exact group/contact bindings.' : `${summary}. Template edits propagate to every binding without copying settings.`; - const schema = templateBody(action); - if (schema) - operation.requestBody = { - required: true, - content: { - 'application/json': { - schema, - example: - action === 'create' - ? { - name: 'Careful outreach', - settings: { localReadTtlSeconds: 120, automationSafety: { enabled: true } }, - } - : undefined, - }, - }, - }; - operation.responses = { - ...(operation.responses['201'] - ? { '201': { description: 'Settings template created.' } } - : { - '200': { - description: - action === 'list' - ? 'Settings template list.' - : action === 'bindings' - ? 'Template binding list.' - : 'Settings template operation completed.', - }, - }), - '400': { description: 'Invalid template, scope, or target.' }, - '401': { description: 'Missing or invalid API key.' }, - '404': { description: 'Instance or settings template not found.' }, - }; } operation['x-source'] = source; return operation; diff --git a/scripts/runtime-openapi-overrides.mjs b/scripts/runtime-openapi-overrides.mjs new file mode 100644 index 0000000000..73d8495c77 --- /dev/null +++ b/scripts/runtime-openapi-overrides.mjs @@ -0,0 +1,108 @@ +const string = { type: 'string' }; +const integer = { type: 'integer' }; +const boolean = { type: 'boolean' }; +const params = (properties, required = []) => + Object.entries(properties).map(([name, schema]) => ({ + name, + in: 'query', + required: required.includes(name), + schema, + })); +const body = (properties, required = []) => ({ + required: true, + content: { 'application/json': { schema: { type: 'object', additionalProperties: false, properties, required } } }, +}); +const limit = { ...integer, minimum: 1, maximum: 1000 }; +const eventsQuery = { + limit, + entityJid: string, + groupJid: string, + entityType: string, + eventType: string, + from: { ...string, format: 'date-time' }, + before: { ...string, format: 'date-time' }, +}; +const archiveHeader = { + name: 'x-archive-key', + in: 'header', + required: true, + schema: string, + description: 'Archive authorization key with the scope required by this operation.', +}; +const withArchiveHeader = (operation) => ({ + ...operation, + parameters: [archiveHeader, ...(operation.parameters ?? [])], +}); +export const overrides = { + 'get /archive/status': { parameters: params({ instanceName: string }) }, + 'get /archive/events/{instanceName}': { parameters: params({ ...eventsQuery, includePayload: boolean }) }, + ...Object.fromEntries( + ['messages', 'contacts', 'chats', 'groups'].map((x) => [ + `get /archive/${x}/{instanceName}`, + { parameters: params(eventsQuery) }, + ]), + ), + 'get /archive/media/{instanceName}': { + parameters: params({ limit, entityJid: string, groupJid: string, mediaType: string, state: string }), + }, + 'get /archive/messages/{instanceName}/{messageId}/revisions': { + parameters: params({ chatJid: string }, ['chatJid']), + }, + 'get /archive/receipts/{instanceName}': { parameters: params({ limit, messageId: string, entityJid: string }) }, + 'get /archive/reactions/{instanceName}': { parameters: params({ limit, messageId: string, entityJid: string }) }, + 'get /archive/memberships/{instanceName}': { + parameters: params({ limit, groupJid: string, participantJid: string }), + }, + 'get /archive/calls/{instanceName}': { parameters: params({ limit, peerJid: string, groupJid: string }) }, + 'get /archive/sync-gaps/{instanceName}': { parameters: params({ limit, status: string, entityJid: string }) }, + 'put /archive/policies': { + requestBody: body( + { + id: string, + scope: { type: 'string', enum: ['general', 'entity', 'account', 'jid'] }, + selector: { type: 'object', additionalProperties: true }, + policy: { type: 'object', additionalProperties: true }, + effectiveAt: { ...string, format: 'date-time' }, + }, + ['scope', 'policy'], + ), + }, + 'post /archive/verify/{instanceName}': { requestBody: body({}) }, + 'post /archive/backfill/{instanceName}': { + requestBody: body({ limit: { ...integer, minimum: 1, maximum: 100000 } }), + }, + 'post /archive/purges/preview/{instanceName}': { + requestBody: body({ + before: { ...string, format: 'date-time' }, + entityJid: string, + groupJid: string, + eventTypes: { type: 'array', items: string }, + mediaOnly: boolean, + }), + }, + 'post /archive/purges/confirm': { + requestBody: body({ previewId: string, confirmationToken: string }, ['previewId', 'confirmationToken']), + }, + 'get /settings/outbound-audit/{instanceName}': { + parameters: params({ limit: { ...integer, minimum: 1 }, recipient: string, status: string }), + }, + 'post /chat/getBase64FromMediaMessage/{instanceName}': { + requestBody: body( + { + message: { type: 'object', additionalProperties: true, description: 'Baileys WebMessageInfo object.' }, + convertToMp4: boolean, + }, + ['message'], + ), + }, + 'get /chat/findChatByRemoteJid/{instanceName}': { parameters: params({ remoteJid: string }, ['remoteJid']) }, + 'post /instance/restart/{instanceName}': { requestBody: body({}) }, + 'get /instance/connect/{instanceName}': { parameters: params({ number: string }) }, +}; +export const applyOverride = (route, operation) => { + let x = overrides[`${route.method} ${route.path}`]; + if (route.path.startsWith('/archive/')) x = withArchiveHeader(x ?? {}); + return Object.keys(x ?? {}).length + ? { ...operation, ...x, parameters: [...(operation.parameters ?? []), ...(x.parameters ?? [])] } + : operation; +}; diff --git a/src/api/routes/index.router.ts b/src/api/routes/index.router.ts index d6daf806ec..3df704736e 100644 --- a/src/api/routes/index.router.ts +++ b/src/api/routes/index.router.ts @@ -56,7 +56,14 @@ if (!serverConfig.DISABLE_DOCS) { const runtimeRoutes = JSON.parse(fs.readFileSync(path.join(process.cwd(), 'docs', 'runtime-routes.json'), 'utf8')); for (const route of runtimeRoutes) { base.paths[route.path] ??= {}; - base.paths[route.path][route.method] ??= route.operation; + const existing = base.paths[route.path][route.method] ?? {}; + base.paths[route.path][route.method] = { + ...route.operation, + ...existing, + parameters: route.operation.parameters, + ...(route.operation.requestBody ? { requestBody: route.operation.requestBody } : {}), + responses: { ...route.operation.responses, ...(existing.responses ?? {}) }, + }; } const openApiDocument = YAML.stringify(base); diff --git a/test/review-surfaces.test.ts b/test/review-surfaces.test.ts new file mode 100644 index 0000000000..4eab3cddc4 --- /dev/null +++ b/test/review-surfaces.test.ts @@ -0,0 +1,26 @@ +import assert from 'node:assert/strict'; +import fs from 'node:fs'; +const html = fs.readFileSync('manager/dist/index.html', 'utf8'); +const asset = html.match(/src="([^"]+\.js)"/)?.[1]; +assert(asset, 'Manager JavaScript asset is referenced'); +const js = fs.readFileSync(`manager/dist${asset.startsWith('/') ? asset : `/${asset}`}`, 'utf8'); +for (const text of ['Settings templates', 'New template', 'Automation safety & pacing']) + assert(js.includes(text), `embedded Manager contains ${text}`); +const routes = JSON.parse(fs.readFileSync('docs/runtime-routes.json', 'utf8')); +assert.equal(routes.length, 202); +const sendText = routes.find((route: any) => route.path === '/message/sendText/{instanceName}'); +assert.deepEqual(Object.keys(sendText.operation.requestBody.content['application/json'].schema.properties), [ + 'number', + 'settingsTemplateId', + 'text', + 'linkPreview', + 'delay', + 'quoted', + 'everyOne', + 'mentioned', +]); +assert( + sendText.operation.responses['201'].content['application/json'].schema, + 'sendText has a documented success envelope', +); +console.log('review surface regression tests passed');